[Cmake-commits] [cmake-commits] king committed CMakeLists.txt 1.76 1.77 EnforceConfig.cmake NONE 1.1

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Dec 18 14:26:22 EST 2008


Update of /cvsroot/CMake/CMake/Tests
In directory public:/mounts/ram/cvs-serv15755/Tests

Modified Files:
	CMakeLists.txt 
Added Files:
	EnforceConfig.cmake 
Log Message:
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.


--- NEW FILE: EnforceConfig.cmake ---
# 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)

Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/CMakeLists.txt,v
retrieving revision 1.76
retrieving revision 1.77
diff -C 2 -d -r1.76 -r1.77
*** CMakeLists.txt	18 Dec 2008 17:28:04 -0000	1.76
--- CMakeLists.txt	18 Dec 2008 19:26:20 -0000	1.77
***************
*** 14,17 ****
--- 14,22 ----
  ENDMACRO(ADD_TEST_MACRO)
  
+ # Make sure the 'testing' test gets a proper configuration.
+ SET_DIRECTORY_PROPERTIES(PROPERTIES
+   TEST_INCLUDE_FILE "${CMake_SOURCE_DIR}/Tests/EnforceConfig.cmake"
+   )
+ 
  # Testing
  IF(BUILD_TESTING)



More information about the Cmake-commits mailing list