RunCMakeTest.cmake 723 B

1234567891011121314151617181920
  1. include(RunCMake)
  2. function(run_cmake_intdir_strategy base strategy)
  3. unset(ENV{CMAKE_INTERMEDIATE_DIR_STRATEGY})
  4. if (base STREQUAL "IntDirStrategyCache")
  5. set(RunCMake_TEST_OPTIONS -DCMAKE_INTERMEDIATE_DIR_STRATEGY=${strategy})
  6. elseif (base STREQUAL "IntDirStrategyEnv")
  7. set(ENV{CMAKE_INTERMEDIATE_DIR_STRATEGY} "${strategy}")
  8. else ()
  9. message(FATAL_ERROR "unsupported base: ${base}")
  10. endif ()
  11. set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${base}${strategy}-build)
  12. run_cmake(${base}${strategy})
  13. endfunction()
  14. foreach (strategy IN ITEMS INVALID FULL SHORT)
  15. run_cmake_intdir_strategy(IntDirStrategyCache ${strategy})
  16. run_cmake_intdir_strategy(IntDirStrategyEnv ${strategy})
  17. endforeach ()