EnforceConfig.cmake.in 883 Bytes
Newer Older
1
# Choose a configuration with which to drive CTest tests.
2 3
if(CTEST_CONFIGURATION_TYPE)
  set(CTestTest_CONFIG "${CTEST_CONFIGURATION_TYPE}")
4
else()
5
  set(CTestTest_CONFIG "@CTestTest_CONFIG@")
6
endif()
7

8
# Choose a configuration that was built if none is given.
9 10 11 12 13 14 15 16
if(NOT CTEST_CONFIGURATION_TYPE)
  set(CTEST_CMD "@CMAKE_CTEST_COMMAND@@CMAKE_EXECUTABLE_SUFFIX@")
  get_filename_component(CTEST_DIR "${CTEST_CMD}" PATH)
  get_filename_component(CTEST_EXE "${CTEST_CMD}" NAME)
  foreach(cfg Release Debug MinSizeRel RelWithDebInfo)
    if(NOT CTEST_CONFIGURATION_TYPE)
      if(EXISTS "${CTEST_DIR}/${cfg}/${CTEST_EXE}")
        set(CTEST_CONFIGURATION_TYPE ${cfg})
17 18 19
      endif()
    endif()
  endforeach()
20 21
  if(NOT CTEST_CONFIGURATION_TYPE)
    set(CTEST_CONFIGURATION_TYPE NoConfig)
22
  endif()
23
  message("Guessing configuration ${CTEST_CONFIGURATION_TYPE}")
24
endif()
25

26
@TEST_HOME_ENV_CODE@