diff options
author | Brad King <brad.king@kitware.com> | 2009-12-10 16:19:23 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-12-10 16:19:23 (GMT) |
commit | faf6d82bd6b6d31887f1f909d3b46b5fd130a435 (patch) | |
tree | 5b2e08b314234196c74daaef7d7dda3b43887371 /Tests | |
parent | 6c79c96265e43416fbc8130e701830389ae6c01a (diff) | |
download | CMake-faf6d82bd6b6d31887f1f909d3b46b5fd130a435.zip CMake-faf6d82bd6b6d31887f1f909d3b46b5fd130a435.tar.gz CMake-faf6d82bd6b6d31887f1f909d3b46b5fd130a435.tar.bz2 |
Always use a configuration for CMake tests
Previously our EnforceConfig script that loads at test-time would only
enforce a non-empty CTEST_CONFIGURATION_TYPE for CMake 2.6.2 and lower.
Now we simply always enforce use of a configuration, and select one of
the configurations that was built if none is given.
This is necessary to run tests like CMake.Install that need to know the
configuration with which CMake was built.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/EnforceConfig.cmake.in | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/Tests/EnforceConfig.cmake.in b/Tests/EnforceConfig.cmake.in index 0340db0..c9028a3 100644 --- a/Tests/EnforceConfig.cmake.in +++ b/Tests/EnforceConfig.cmake.in @@ -5,20 +5,8 @@ ELSE(CTEST_CONFIGURATION_TYPE) SET(CTestTest_CONFIG "@CTestTest_CONFIG@") ENDIF(CTEST_CONFIGURATION_TYPE) -# Older versions of CMake do not support an empty configuration name in -# CTEST_CONFIGURATION_TYPE for the 'testing' test. -SET(CONFIG_REQUIRED) -IF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.6) - SET(CONFIG_REQUIRED 1) -ELSE("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.6) - IF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" STREQUAL 2.6) - IF("${CMAKE_PATCH_VERSION}" LESS 3) - SET(CONFIG_REQUIRED 1) - ENDIF("${CMAKE_PATCH_VERSION}" LESS 3) - ENDIF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" STREQUAL 2.6) -ENDIF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.6) - -IF(NOT CTEST_CONFIGURATION_TYPE AND CONFIG_REQUIRED) +# Choose a configuration that was built if none is given. +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) @@ -33,6 +21,6 @@ IF(NOT CTEST_CONFIGURATION_TYPE AND CONFIG_REQUIRED) SET(CTEST_CONFIGURATION_TYPE NoConfig) ENDIF(NOT CTEST_CONFIGURATION_TYPE) MESSAGE("Guessing configuration ${CTEST_CONFIGURATION_TYPE}") -ENDIF(NOT CTEST_CONFIGURATION_TYPE AND CONFIG_REQUIRED) +ENDIF(NOT CTEST_CONFIGURATION_TYPE) @TEST_HOME_ENV_CODE@ |