diff options
author | Brad King <brad.king@kitware.com> | 2008-12-18 19:26:20 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-12-18 19:26:20 (GMT) |
commit | 64f419c0e85f9929687c4c159930c8398a299854 (patch) | |
tree | 00a4d8bccfc387969b5efc1ffbf038327be97112 /Tests/EnforceConfig.cmake | |
parent | 0a83aa6f5700b424830136ebd2bf285e8ce6b56d (diff) | |
download | CMake-64f419c0e85f9929687c4c159930c8398a299854.zip CMake-64f419c0e85f9929687c4c159930c8398a299854.tar.gz CMake-64f419c0e85f9929687c4c159930c8398a299854.tar.bz2 |
BUG: Fix new 'testing' test for CMake releases
The recent change of the 'testing' test to actually drive the tests
within it does not work on Windows with released CMakes 2.6.2 and lower
if no configuration is given to ctest with a -C option. This works
around the problem by detecting the case and changing the empty
configuration to Debug.
Diffstat (limited to 'Tests/EnforceConfig.cmake')
-rw-r--r-- | Tests/EnforceConfig.cmake | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Tests/EnforceConfig.cmake b/Tests/EnforceConfig.cmake new file mode 100644 index 0000000..82b9c87 --- /dev/null +++ b/Tests/EnforceConfig.cmake @@ -0,0 +1,15 @@ +# 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) + SET(CTEST_CONFIGURATION_TYPE Debug) +ENDIF(NOT CTEST_CONFIGURATION_TYPE AND CONFIG_REQUIRED) |