From 9d823f78479b19a739c3bb9037a0f72f3a65535c Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 10 Dec 2009 10:33:42 -0500 Subject: [PATCH] Apply CMake test-time config to all tests We configure an EnforceConfig.cmake script to load at CTest time. Previously we loaded it from Tests/CTestTestfile.cmake, but now we load it from the top level so it applies to all tests. --- CMakeLists.txt | 4 ++++ Tests/CMakeLists.txt | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 173e92314..fcb317492 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -342,6 +342,10 @@ SET(CMake_VERSION_FULL "${CMake_VERSION}.${CMake_VERSION_PATCH}") ENABLE_TESTING() INCLUDE (${CMAKE_ROOT}/Modules/Dart.cmake) +# Set up test-time configuration. +SET_DIRECTORY_PROPERTIES(PROPERTIES + TEST_INCLUDE_FILE "${CMake_BINARY_DIR}/Tests/EnforceConfig.cmake") + # where to write the resulting executables and libraries SET(BUILD_SHARED_LIBS OFF) SET(EXECUTABLE_OUTPUT_PATH "" CACHE INTERNAL "No configurable exe dir.") diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 2a31989a2..5fa4059e6 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -28,12 +28,8 @@ IF(NOT CMAKE_CONFIGURATION_TYPES AND CMAKE_BUILD_TYPE) SET(CTestTest_CONFIG ${CMAKE_BUILD_TYPE}) ENDIF() -# Make sure the 'testing' test gets a proper configuration. CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/EnforceConfig.cmake.in ${CMake_BINARY_DIR}/Tests/EnforceConfig.cmake @ONLY) -SET_DIRECTORY_PROPERTIES(PROPERTIES - TEST_INCLUDE_FILE "${CMake_BINARY_DIR}/Tests/EnforceConfig.cmake" - ) # Testing IF(BUILD_TESTING)