summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2007-02-28 17:25:19 (GMT)
committerKen Martin <ken.martin@kitware.com>2007-02-28 17:25:19 (GMT)
commit56e3a35ece5f4db276bd02c9849e7b58ca479970 (patch)
treed9a3fe19c139564a4a26e029b403484a8569c68a /CMakeLists.txt
parentb1aae98926b9a6021d6404ce5a5f52eb2d15643d (diff)
downloadCMake-56e3a35ece5f4db276bd02c9849e7b58ca479970.zip
CMake-56e3a35ece5f4db276bd02c9849e7b58ca479970.tar.gz
CMake-56e3a35ece5f4db276bd02c9849e7b58ca479970.tar.bz2
BUG: allow system information to accept the -G option
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt46
1 files changed, 45 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 14179ed..fe9c53c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -430,7 +430,51 @@ CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/Templates/CTestScript.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/CTestScript.cmake"
@ONLY IMMEDIATE)
+# Testing
+IF (NOT DART_ROOT)
+ SET(MAKEPROGRAM ${CMAKE_MAKE_PROGRAM})
+ENDIF (NOT DART_ROOT)
+
+IF(BUILD_TESTING)
+ SET(CMAKE_TEST_GENERATOR "" CACHE STRING "Generator used when running tests")
+ SET(CMAKE_TEST_MAKEPROGRAM "" CACHE FILEPATH "Generator used when running tests")
+ IF(NOT CMAKE_TEST_GENERATOR)
+ SET(CMAKE_TEST_GENERATOR "${CMAKE_GENERATOR}")
+ SET(CMAKE_TEST_MAKEPROGRAM "${MAKEPROGRAM}")
+ ELSE(NOT CMAKE_TEST_GENERATOR)
+ SET(CMAKE_TEST_DIFFERENT_GENERATOR TRUE)
+ ENDIF(NOT CMAKE_TEST_GENERATOR)
+
+ # Are we testing with the MSVC compiler?
+ SET(CMAKE_TEST_MSVC 0)
+ IF(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
+ SET(CMAKE_TEST_MSVC 1)
+ ELSE(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
+ IF("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR
+ "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio")
+ SET(CMAKE_TEST_MSVC 1)
+ ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR
+ "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio")
+ ENDIF(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
+
+ SET(CMAKE_TEST_SYSTEM_LIBRARIES 0)
+ FOREACH(util CURL EXPAT XMLRPC ZLIB)
+ IF(CMAKE_USE_SYSTEM_${util})
+ SET(CMAKE_TEST_SYSTEM_LIBRARIES 1)
+ ENDIF(CMAKE_USE_SYSTEM_${util})
+ ENDFOREACH(util)
+
+ # This variable is set by cmake, however to
+ # test cmake we want to make sure that
+ # the ctest from this cmake is used for testing
+ # and not the ctest from the cmake building and testing
+ # cmake.
+ SET(CMAKE_CTEST_COMMAND "${EXECUTABLE_OUTPUT_PATH}/ctest")
+ SET(CMAKE_CMAKE_COMMAND "${EXECUTABLE_OUTPUT_PATH}/cmake")
+ENDIF(BUILD_TESTING)
+
ADD_TEST(SystemInformationNew
- "${EXECUTABLE_OUTPUT_PATH}/cmake" --system-information
+ "${CMAKE_CMAKE_COMMAND}" --system-information
+ -G "${CMAKE_TEST_GENERATOR}"
)