ENH: Allow overwriting CTestConfig.cmake items

This commit is contained in:
Andy Cedilnik 2006-04-28 09:58:15 -04:00
parent d57ba7cb3c
commit cd09448a53
1 changed files with 15 additions and 8 deletions

View File

@ -18,19 +18,26 @@ IF(BUILD_TESTING)
ENDIF("${val}" MATCHES "^$") ENDIF("${val}" MATCHES "^$")
ENDMACRO(SET_IF_SET) ENDMACRO(SET_IF_SET)
MACRO(SET_IF_SET_AND_NOT_SET var val)
IF("${val}" MATCHES "^$")
ELSE("${val}" MATCHES "^$")
SET_IF_NOT_SET("${var}" "${val}")
ENDIF("${val}" MATCHES "^$")
ENDMACRO(SET_IF_SET_AND_NOT_SET)
# Make sure testing is enabled # Make sure testing is enabled
ENABLE_TESTING() ENABLE_TESTING()
IF(EXISTS "${PROJECT_SOURCE_DIR}/CTestConfig.cmake") IF(EXISTS "${PROJECT_SOURCE_DIR}/CTestConfig.cmake")
INCLUDE("${PROJECT_SOURCE_DIR}/CTestConfig.cmake") INCLUDE("${PROJECT_SOURCE_DIR}/CTestConfig.cmake")
SET_IF_SET(NIGHTLY_START_TIME "${CTEST_NIGHTLY_START_TIME}") SET_IF_SET_AND_NOT_SET(NIGHTLY_START_TIME "${CTEST_NIGHTLY_START_TIME}")
SET_IF_SET(DROP_METHOD "${CTEST_DROP_METHOD}") SET_IF_SET_AND_NOT_SET(DROP_METHOD "${CTEST_DROP_METHOD}")
SET_IF_SET(DROP_SITE "${CTEST_DROP_SITE}") SET_IF_SET_AND_NOT_SET(DROP_SITE "${CTEST_DROP_SITE}")
SET_IF_SET(DROP_SITE_USER "${CTEST_DROP_SITE_USER}") SET_IF_SET_AND_NOT_SET(DROP_SITE_USER "${CTEST_DROP_SITE_USER}")
SET_IF_SET(DROP_SITE_PASSWORD "${CTEST_DROP_SITE_PASWORD}") SET_IF_SET_AND_NOT_SET(DROP_SITE_PASSWORD "${CTEST_DROP_SITE_PASWORD}")
SET_IF_SET(DROP_SITE_MODE "${CTEST_DROP_SITE_MODE}") SET_IF_SET_AND_NOT_SET(DROP_SITE_MODE "${CTEST_DROP_SITE_MODE}")
SET_IF_SET(DROP_LOCATION "${CTEST_DROP_LOCATION}") SET_IF_SET_AND_NOT_SET(DROP_LOCATION "${CTEST_DROP_LOCATION}")
SET_IF_SET(TRIGGER_SITE "${CTEST_TRIGGER_SITE}") SET_IF_SET_AND_NOT_SET(TRIGGER_SITE "${CTEST_TRIGGER_SITE}")
ENDIF(EXISTS "${PROJECT_SOURCE_DIR}/CTestConfig.cmake") ENDIF(EXISTS "${PROJECT_SOURCE_DIR}/CTestConfig.cmake")
# the project can have a DartConfig.cmake file # the project can have a DartConfig.cmake file