diff options
author | Kitware Robot <kwrobot@kitware.com> | 2012-08-13 17:47:32 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-08-13 18:19:16 (GMT) |
commit | 77543bde41b0e52c3959016698b529835945d62d (patch) | |
tree | ff63e5fbec326c4a5d821e7496c6d2cb52f75b92 /Modules/CTest.cmake | |
parent | 7bbaa4283de26864b2e55e819db0884771585467 (diff) | |
download | CMake-77543bde41b0e52c3959016698b529835945d62d.zip CMake-77543bde41b0e52c3959016698b529835945d62d.tar.gz CMake-77543bde41b0e52c3959016698b529835945d62d.tar.bz2 |
Convert CMake-language commands to lower case
Ancient CMake versions required upper-case commands. Later command
names became case-insensitive. Now the preferred style is lower-case.
Run the following shell code:
cmake --help-command-list |
grep -v "cmake version" |
while read c; do
echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
Diffstat (limited to 'Modules/CTest.cmake')
-rw-r--r-- | Modules/CTest.cmake | 270 |
1 files changed, 135 insertions, 135 deletions
diff --git a/Modules/CTest.cmake b/Modules/CTest.cmake index a32baa2..4e861a9 100644 --- a/Modules/CTest.cmake +++ b/Modules/CTest.cmake @@ -58,46 +58,46 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -OPTION(BUILD_TESTING "Build the testing tree." ON) +option(BUILD_TESTING "Build the testing tree." ON) # function to turn generator name into a version string # like vs7 vs71 vs8 vs9 -FUNCTION(GET_VS_VERSION_STRING generator var) - STRING(REGEX REPLACE "Visual Studio ([0-9][0-9]?)($|.*)" "\\1" +function(GET_VS_VERSION_STRING generator var) + string(REGEX REPLACE "Visual Studio ([0-9][0-9]?)($|.*)" "\\1" NUMBER "${generator}") - IF("${generator}" MATCHES "Visual Studio 7 .NET 2003") - SET(ver_string "vs71") - ELSE("${generator}" MATCHES "Visual Studio 7 .NET 2003") - SET(ver_string "vs${NUMBER}") - ENDIF("${generator}" MATCHES "Visual Studio 7 .NET 2003") - SET(${var} ${ver_string} PARENT_SCOPE) -ENDFUNCTION(GET_VS_VERSION_STRING) + if("${generator}" MATCHES "Visual Studio 7 .NET 2003") + set(ver_string "vs71") + else("${generator}" MATCHES "Visual Studio 7 .NET 2003") + set(ver_string "vs${NUMBER}") + endif("${generator}" MATCHES "Visual Studio 7 .NET 2003") + set(${var} ${ver_string} PARENT_SCOPE) +endfunction(GET_VS_VERSION_STRING) -IF(BUILD_TESTING) +if(BUILD_TESTING) # Setup some auxilary macros - MACRO(SET_IF_NOT_SET var val) - IF(NOT DEFINED "${var}") - SET("${var}" "${val}") - ENDIF(NOT DEFINED "${var}") - ENDMACRO(SET_IF_NOT_SET) + macro(SET_IF_NOT_SET var val) + if(NOT DEFINED "${var}") + set("${var}" "${val}") + endif(NOT DEFINED "${var}") + endmacro(SET_IF_NOT_SET) - MACRO(SET_IF_SET var val) - IF(NOT "${val}" MATCHES "^$") - SET("${var}" "${val}") - ENDIF(NOT "${val}" MATCHES "^$") - ENDMACRO(SET_IF_SET) + macro(SET_IF_SET var val) + if(NOT "${val}" MATCHES "^$") + set("${var}" "${val}") + endif(NOT "${val}" MATCHES "^$") + endmacro(SET_IF_SET) - MACRO(SET_IF_SET_AND_NOT_SET var val) - IF(NOT "${val}" MATCHES "^$") + macro(SET_IF_SET_AND_NOT_SET var val) + if(NOT "${val}" MATCHES "^$") SET_IF_NOT_SET("${var}" "${val}") - ENDIF(NOT "${val}" MATCHES "^$") - ENDMACRO(SET_IF_SET_AND_NOT_SET) + endif(NOT "${val}" MATCHES "^$") + endmacro(SET_IF_SET_AND_NOT_SET) # Make sure testing is enabled - ENABLE_TESTING() + enable_testing() - IF(EXISTS "${PROJECT_SOURCE_DIR}/CTestConfig.cmake") - INCLUDE("${PROJECT_SOURCE_DIR}/CTestConfig.cmake") + if(EXISTS "${PROJECT_SOURCE_DIR}/CTestConfig.cmake") + include("${PROJECT_SOURCE_DIR}/CTestConfig.cmake") SET_IF_SET_AND_NOT_SET(NIGHTLY_START_TIME "${CTEST_NIGHTLY_START_TIME}") SET_IF_SET_AND_NOT_SET(DROP_METHOD "${CTEST_DROP_METHOD}") SET_IF_SET_AND_NOT_SET(DROP_SITE "${CTEST_DROP_SITE}") @@ -107,155 +107,155 @@ IF(BUILD_TESTING) SET_IF_SET_AND_NOT_SET(DROP_LOCATION "${CTEST_DROP_LOCATION}") SET_IF_SET_AND_NOT_SET(TRIGGER_SITE "${CTEST_TRIGGER_SITE}") SET_IF_SET_AND_NOT_SET(UPDATE_TYPE "${CTEST_UPDATE_TYPE}") - ENDIF(EXISTS "${PROJECT_SOURCE_DIR}/CTestConfig.cmake") + endif(EXISTS "${PROJECT_SOURCE_DIR}/CTestConfig.cmake") # the project can have a DartConfig.cmake file - IF(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake") - INCLUDE("${PROJECT_SOURCE_DIR}/DartConfig.cmake") - ELSE(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake") + if(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake") + include("${PROJECT_SOURCE_DIR}/DartConfig.cmake") + else(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake") # Dashboard is opened for submissions for a 24 hour period starting at # the specified NIGHTLY_START_TIME. Time is specified in 24 hour format. SET_IF_NOT_SET (NIGHTLY_START_TIME "00:00:00 EDT") SET_IF_NOT_SET(DROP_METHOD "http") SET_IF_NOT_SET (COMPRESS_SUBMISSION ON) - ENDIF(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake") + endif(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake") SET_IF_NOT_SET (NIGHTLY_START_TIME "00:00:00 EDT") - FIND_PROGRAM(CVSCOMMAND cvs ) - SET(CVS_UPDATE_OPTIONS "-d -A -P" CACHE STRING + find_program(CVSCOMMAND cvs ) + set(CVS_UPDATE_OPTIONS "-d -A -P" CACHE STRING "Options passed to the cvs update command.") - FIND_PROGRAM(SVNCOMMAND svn) - FIND_PROGRAM(BZRCOMMAND bzr) - FIND_PROGRAM(HGCOMMAND hg) - FIND_PROGRAM(GITCOMMAND git) + find_program(SVNCOMMAND svn) + find_program(BZRCOMMAND bzr) + find_program(HGCOMMAND hg) + find_program(GITCOMMAND git) - IF(NOT UPDATE_TYPE) - IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CVS") - SET(UPDATE_TYPE cvs) - ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.svn") - SET(UPDATE_TYPE svn) - ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.bzr") - SET(UPDATE_TYPE bzr) - ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.hg") - SET(UPDATE_TYPE hg) - ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git") - SET(UPDATE_TYPE git) - ENDIF() - ENDIF(NOT UPDATE_TYPE) + if(NOT UPDATE_TYPE) + if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CVS") + set(UPDATE_TYPE cvs) + elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.svn") + set(UPDATE_TYPE svn) + elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.bzr") + set(UPDATE_TYPE bzr) + elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.hg") + set(UPDATE_TYPE hg) + elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git") + set(UPDATE_TYPE git) + endif() + endif(NOT UPDATE_TYPE) - STRING(TOLOWER "${UPDATE_TYPE}" _update_type) - IF("${_update_type}" STREQUAL "cvs") - SET(UPDATE_COMMAND "${CVSCOMMAND}") - SET(UPDATE_OPTIONS "${CVS_UPDATE_OPTIONS}") - ELSEIF("${_update_type}" STREQUAL "svn") - SET(UPDATE_COMMAND "${SVNCOMMAND}") - SET(UPDATE_OPTIONS "${SVN_UPDATE_OPTIONS}") - ELSEIF("${_update_type}" STREQUAL "bzr") - SET(UPDATE_COMMAND "${BZRCOMMAND}") - SET(UPDATE_OPTIONS "${BZR_UPDATE_OPTIONS}") - ELSEIF("${_update_type}" STREQUAL "hg") - SET(UPDATE_COMMAND "${HGCOMMAND}") - SET(UPDATE_OPTIONS "${HG_UPDATE_OPTIONS}") - ELSEIF("${_update_type}" STREQUAL "git") - SET(UPDATE_COMMAND "${GITCOMMAND}") - SET(UPDATE_OPTIONS "${GIT_UPDATE_OPTIONS}") - ENDIF() + string(TOLOWER "${UPDATE_TYPE}" _update_type) + if("${_update_type}" STREQUAL "cvs") + set(UPDATE_COMMAND "${CVSCOMMAND}") + set(UPDATE_OPTIONS "${CVS_UPDATE_OPTIONS}") + elseif("${_update_type}" STREQUAL "svn") + set(UPDATE_COMMAND "${SVNCOMMAND}") + set(UPDATE_OPTIONS "${SVN_UPDATE_OPTIONS}") + elseif("${_update_type}" STREQUAL "bzr") + set(UPDATE_COMMAND "${BZRCOMMAND}") + set(UPDATE_OPTIONS "${BZR_UPDATE_OPTIONS}") + elseif("${_update_type}" STREQUAL "hg") + set(UPDATE_COMMAND "${HGCOMMAND}") + set(UPDATE_OPTIONS "${HG_UPDATE_OPTIONS}") + elseif("${_update_type}" STREQUAL "git") + set(UPDATE_COMMAND "${GITCOMMAND}") + set(UPDATE_OPTIONS "${GIT_UPDATE_OPTIONS}") + endif() - SET(DART_TESTING_TIMEOUT 1500 CACHE STRING + set(DART_TESTING_TIMEOUT 1500 CACHE STRING "Maximum time allowed before CTest will kill the test.") - SET(CTEST_SUBMIT_RETRY_DELAY 5 CACHE STRING + set(CTEST_SUBMIT_RETRY_DELAY 5 CACHE STRING "How long to wait between timed-out CTest submissions.") - SET(CTEST_SUBMIT_RETRY_COUNT 3 CACHE STRING + set(CTEST_SUBMIT_RETRY_COUNT 3 CACHE STRING "How many times to retry timed-out CTest submissions.") - FIND_PROGRAM(MEMORYCHECK_COMMAND + find_program(MEMORYCHECK_COMMAND NAMES purify valgrind boundscheck PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Rational Software\\Purify\\Setup;InstallFolder]" DOC "Path to the memory checking command, used for memory error detection." ) - FIND_PROGRAM(SLURM_SBATCH_COMMAND sbatch DOC + find_program(SLURM_SBATCH_COMMAND sbatch DOC "Path to the SLURM sbatch executable" ) - FIND_PROGRAM(SLURM_SRUN_COMMAND srun DOC + find_program(SLURM_SRUN_COMMAND srun DOC "Path to the SLURM srun executable" ) - SET(MEMORYCHECK_SUPPRESSIONS_FILE "" CACHE FILEPATH + set(MEMORYCHECK_SUPPRESSIONS_FILE "" CACHE FILEPATH "File that contains suppressions for the memory checker") - FIND_PROGRAM(SCPCOMMAND scp DOC + find_program(SCPCOMMAND scp DOC "Path to scp command, used by CTest for submitting results to a Dart server" ) - FIND_PROGRAM(COVERAGE_COMMAND gcov DOC + find_program(COVERAGE_COMMAND gcov DOC "Path to the coverage program that CTest uses for performing coverage inspection" ) - SET(COVERAGE_EXTRA_FLAGS "-l" CACHE STRING + set(COVERAGE_EXTRA_FLAGS "-l" CACHE STRING "Extra command line flags to pass to the coverage tool") # set the site name - SITE_NAME(SITE) + site_name(SITE) # set the build name - IF(NOT BUILDNAME) - SET(DART_COMPILER "${CMAKE_CXX_COMPILER}") - IF(NOT DART_COMPILER) - SET(DART_COMPILER "${CMAKE_C_COMPILER}") - ENDIF(NOT DART_COMPILER) - IF(NOT DART_COMPILER) - SET(DART_COMPILER "unknown") - ENDIF(NOT DART_COMPILER) - IF(WIN32) - SET(DART_NAME_COMPONENT "NAME_WE") - ELSE(WIN32) - SET(DART_NAME_COMPONENT "NAME") - ENDIF(WIN32) - IF(NOT BUILD_NAME_SYSTEM_NAME) - SET(BUILD_NAME_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}") - ENDIF(NOT BUILD_NAME_SYSTEM_NAME) - IF(WIN32) - SET(BUILD_NAME_SYSTEM_NAME "Win32") - ENDIF(WIN32) - IF(UNIX OR BORLAND) - GET_FILENAME_COMPONENT(DART_CXX_NAME + if(NOT BUILDNAME) + set(DART_COMPILER "${CMAKE_CXX_COMPILER}") + if(NOT DART_COMPILER) + set(DART_COMPILER "${CMAKE_C_COMPILER}") + endif(NOT DART_COMPILER) + if(NOT DART_COMPILER) + set(DART_COMPILER "unknown") + endif(NOT DART_COMPILER) + if(WIN32) + set(DART_NAME_COMPONENT "NAME_WE") + else(WIN32) + set(DART_NAME_COMPONENT "NAME") + endif(WIN32) + if(NOT BUILD_NAME_SYSTEM_NAME) + set(BUILD_NAME_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}") + endif(NOT BUILD_NAME_SYSTEM_NAME) + if(WIN32) + set(BUILD_NAME_SYSTEM_NAME "Win32") + endif(WIN32) + if(UNIX OR BORLAND) + get_filename_component(DART_CXX_NAME "${CMAKE_CXX_COMPILER}" ${DART_NAME_COMPONENT}) - ELSE(UNIX OR BORLAND) - GET_FILENAME_COMPONENT(DART_CXX_NAME + else(UNIX OR BORLAND) + get_filename_component(DART_CXX_NAME "${CMAKE_BUILD_TOOL}" ${DART_NAME_COMPONENT}) - ENDIF(UNIX OR BORLAND) - IF(DART_CXX_NAME MATCHES "msdev") - SET(DART_CXX_NAME "vs60") - ENDIF(DART_CXX_NAME MATCHES "msdev") - IF(DART_CXX_NAME MATCHES "devenv") + endif(UNIX OR BORLAND) + if(DART_CXX_NAME MATCHES "msdev") + set(DART_CXX_NAME "vs60") + endif(DART_CXX_NAME MATCHES "msdev") + if(DART_CXX_NAME MATCHES "devenv") GET_VS_VERSION_STRING("${CMAKE_GENERATOR}" DART_CXX_NAME) - ENDIF(DART_CXX_NAME MATCHES "devenv") - SET(BUILDNAME "${BUILD_NAME_SYSTEM_NAME}-${DART_CXX_NAME}") - ENDIF(NOT BUILDNAME) + endif(DART_CXX_NAME MATCHES "devenv") + set(BUILDNAME "${BUILD_NAME_SYSTEM_NAME}-${DART_CXX_NAME}") + endif(NOT BUILDNAME) # the build command - BUILD_COMMAND(MAKECOMMAND_DEFAULT_VALUE + build_command(MAKECOMMAND_DEFAULT_VALUE CONFIGURATION "\${CTEST_CONFIGURATION_TYPE}") - SET(MAKECOMMAND ${MAKECOMMAND_DEFAULT_VALUE} + set(MAKECOMMAND ${MAKECOMMAND_DEFAULT_VALUE} CACHE STRING "Command to build the project") # the default build configuration the ctest build handler will use # if there is no -C arg given to ctest: - SET(DEFAULT_CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}") - IF(DEFAULT_CTEST_CONFIGURATION_TYPE STREQUAL "") - SET(DEFAULT_CTEST_CONFIGURATION_TYPE "Release") - ENDIF(DEFAULT_CTEST_CONFIGURATION_TYPE STREQUAL "") + set(DEFAULT_CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}") + if(DEFAULT_CTEST_CONFIGURATION_TYPE STREQUAL "") + set(DEFAULT_CTEST_CONFIGURATION_TYPE "Release") + endif(DEFAULT_CTEST_CONFIGURATION_TYPE STREQUAL "") - IF(NOT "${CMAKE_GENERATOR}" MATCHES "Make") - SET(CTEST_USE_LAUNCHERS 0) - ENDIF(NOT "${CMAKE_GENERATOR}" MATCHES "Make") - IF(CTEST_USE_LAUNCHERS) - SET(CTEST_LAUNCH_COMPILE "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <OBJECT> --source <SOURCE> --language <LANGUAGE> --") - SET(CTEST_LAUNCH_LINK "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <TARGET> --target-type <TARGET_TYPE> --language <LANGUAGE> --") - SET(CTEST_LAUNCH_CUSTOM "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <OUTPUT> --") - SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CTEST_LAUNCH_COMPILE}") - SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CTEST_LAUNCH_LINK}") - SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_CUSTOM "${CTEST_LAUNCH_CUSTOM}") - ENDIF(CTEST_USE_LAUNCHERS) + if(NOT "${CMAKE_GENERATOR}" MATCHES "Make") + set(CTEST_USE_LAUNCHERS 0) + endif(NOT "${CMAKE_GENERATOR}" MATCHES "Make") + if(CTEST_USE_LAUNCHERS) + set(CTEST_LAUNCH_COMPILE "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <OBJECT> --source <SOURCE> --language <LANGUAGE> --") + set(CTEST_LAUNCH_LINK "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <TARGET> --target-type <TARGET_TYPE> --language <LANGUAGE> --") + set(CTEST_LAUNCH_CUSTOM "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <OUTPUT> --") + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CTEST_LAUNCH_COMPILE}") + set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CTEST_LAUNCH_LINK}") + set_property(GLOBAL PROPERTY RULE_LAUNCH_CUSTOM "${CTEST_LAUNCH_CUSTOM}") + endif(CTEST_USE_LAUNCHERS) - MARK_AS_ADVANCED( + mark_as_advanced( BZRCOMMAND BZR_UPDATE_OPTIONS COVERAGE_COMMAND @@ -278,9 +278,9 @@ IF(BUILD_TESTING) SVNCOMMAND SVN_UPDATE_OPTIONS ) - IF(NOT RUN_FROM_DART) - SET(RUN_FROM_CTEST_OR_DART 1) - INCLUDE(CTestTargets) - SET(RUN_FROM_CTEST_OR_DART) - ENDIF(NOT RUN_FROM_DART) -ENDIF(BUILD_TESTING) + if(NOT RUN_FROM_DART) + set(RUN_FROM_CTEST_OR_DART 1) + include(CTestTargets) + set(RUN_FROM_CTEST_OR_DART) + endif(NOT RUN_FROM_DART) +endif(BUILD_TESTING) |