blob: 9a5f042319a7e9cf0e286a41fee3befdb2cc891a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# 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_CMD "@CMAKE_CTEST_COMMAND@@CMAKE_EXECUTABLE_SUFFIX@")
GET_FILENAME_COMPONENT(CTEST_DIR "${CTEST_CMD}" PATH)
GET_FILENAME_COMPONENT(CTEST_EXE "${CTEST_CMD}" NAME)
FOREACH(cfg Release Debug MinSizeRel RelWithDebInfo)
IF(NOT CTEST_CONFIGURATION_TYPE)
IF(EXISTS "${CTEST_DIR}/${cfg}/${CTEST_EXE}")
SET(CTEST_CONFIGURATION_TYPE ${cfg})
ENDIF(EXISTS "${CTEST_DIR}/${cfg}/${CTEST_EXE}")
ENDIF(NOT CTEST_CONFIGURATION_TYPE)
ENDFOREACH(cfg)
IF(NOT CTEST_CONFIGURATION_TYPE)
SET(CTEST_CONFIGURATION_TYPE NoConfig)
ENDIF(NOT CTEST_CONFIGURATION_TYPE)
MESSAGE("Guessing configuration ${CTEST_CONFIGURATION_TYPE}")
ENDIF(NOT CTEST_CONFIGURATION_TYPE AND CONFIG_REQUIRED)
# Fake a user home directory to avoid polluting the real one.
IF(DEFINED ENV{HOME})
SET(HOME "@CMake_BINARY_DIR@/Tests/CMakeFiles/TestHome")
FILE(MAKE_DIRECTORY "${HOME}")
SET(ENV{HOME} "${HOME}")
ENDIF(DEFINED ENV{HOME})
|