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 /Tests/CMakeTests | |
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 'Tests/CMakeTests')
-rw-r--r-- | Tests/CMakeTests/CMakeLists.txt | 14 | ||||
-rw-r--r-- | Tests/CMakeTests/ListTest.cmake.in | 90 | ||||
-rw-r--r-- | Tests/CMakeTests/ToolchainTest.cmake.in | 2 | ||||
-rw-r--r-- | Tests/CMakeTests/VariableWatchTest.cmake.in | 12 |
4 files changed, 59 insertions, 59 deletions
diff --git a/Tests/CMakeTests/CMakeLists.txt b/Tests/CMakeTests/CMakeLists.txt index c42c490..fadcc1e 100644 --- a/Tests/CMakeTests/CMakeLists.txt +++ b/Tests/CMakeTests/CMakeLists.txt @@ -1,12 +1,12 @@ -SET(CMAKE_EXECUTABLE "${CMake_BIN_DIR}/cmake") +set(CMAKE_EXECUTABLE "${CMake_BIN_DIR}/cmake") -MACRO(AddCMakeTest TestName PreArgs) - CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/${TestName}Test.cmake.in" +macro(AddCMakeTest TestName PreArgs) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${TestName}Test.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/${TestName}Test.cmake" @ONLY IMMEDIATE) - ADD_TEST(CMake.${TestName} ${CMAKE_EXECUTABLE} ${PreArgs} + add_test(CMake.${TestName} ${CMAKE_EXECUTABLE} ${PreArgs} -P "${CMAKE_CURRENT_BINARY_DIR}/${TestName}Test.cmake" ${ARGN}) -ENDMACRO(AddCMakeTest) +endmacro(AddCMakeTest) AddCMakeTest(List "") @@ -43,12 +43,12 @@ if(HAVE_ELF_H) AddCMakeTest(ELF "") endif() -SET(EndStuff_PreArgs +set(EndStuff_PreArgs "-Ddir:STRING=${CMAKE_CURRENT_BINARY_DIR}/EndStuffTest" ) AddCMakeTest(EndStuff "${EndStuff_PreArgs}") -SET(GetPrerequisites_PreArgs +set(GetPrerequisites_PreArgs "-DCTEST_CONFIGURATION_TYPE:STRING=\\\${CTEST_CONFIGURATION_TYPE}" ) AddCMakeTest(GetPrerequisites "${GetPrerequisites_PreArgs}") diff --git a/Tests/CMakeTests/ListTest.cmake.in b/Tests/CMakeTests/ListTest.cmake.in index cf6f91a..5db171c 100644 --- a/Tests/CMakeTests/ListTest.cmake.in +++ b/Tests/CMakeTests/ListTest.cmake.in @@ -1,88 +1,88 @@ -MACRO(TEST command expected) - IF("x${result}" STREQUAL "x${expected}") - #MESSAGE("TEST \"${command}\" success: \"${result}\" expected: \"${expected}\"") - ELSE("x${result}" STREQUAL "x${expected}") - MESSAGE(SEND_ERROR "${CMAKE_CURRENT_LIST_LINE}: TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"") - ENDIF("x${result}" STREQUAL "x${expected}") -ENDMACRO(TEST command expected) +macro(TEST command expected) + if("x${result}" STREQUAL "x${expected}") + #message("TEST \"${command}\" success: \"${result}\" expected: \"${expected}\"") + else("x${result}" STREQUAL "x${expected}") + message(SEND_ERROR "${CMAKE_CURRENT_LIST_LINE}: TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"") + endif("x${result}" STREQUAL "x${expected}") +endmacro(TEST command expected) -SET(mylist andy bill ken brad) +set(mylist andy bill ken brad) -LIST(LENGTH mylist result) +list(LENGTH mylist result) TEST("LENGTH mylist result" "4") -LIST(LENGTH "mylist" result) +list(LENGTH "mylist" result) TEST("LENGTH \"mylist\" result" "4") -LIST(LENGTH "nonexiting_list1" result) +list(LENGTH "nonexiting_list1" result) TEST("LENGTH \"nonexiting_list1\" result" "0") -LIST(GET mylist 3 2 1 0 result) +list(GET mylist 3 2 1 0 result) TEST("GET mylist 3 2 1 0 result" "brad;ken;bill;andy") -LIST(GET mylist 0 item0) -LIST(GET mylist 1 item1) -LIST(GET mylist 2 item2) -LIST(GET mylist 3 item3) -SET(result "${item3}" "${item0}" "${item1}" "${item2}") +list(GET mylist 0 item0) +list(GET mylist 1 item1) +list(GET mylist 2 item2) +list(GET mylist 3 item3) +set(result "${item3}" "${item0}" "${item1}" "${item2}") TEST("GET individual 3 2 1 0 result" "brad;andy;bill;ken") -LIST(GET mylist -1 -2 -3 -4 result) +list(GET mylist -1 -2 -3 -4 result) TEST("GET mylist -1 -2 -3 -4 result" "brad;ken;bill;andy") -LIST(GET mylist -1 2 -3 0 result) +list(GET mylist -1 2 -3 0 result) TEST("GET mylist -1 2 -3 0 ${result}" "brad;ken;bill;andy") -LIST(GET "nonexiting_list2" 1 result) +list(GET "nonexiting_list2" 1 result) TEST("GET \"nonexiting_list2\" 1 result" "NOTFOUND") -SET(result andy) -LIST(APPEND result brad) +set(result andy) +list(APPEND result brad) TEST("APPEND result brad" "andy;brad") -LIST(APPEND "nonexiting_list3" brad) -SET(result "${nonexiting_list3}") +list(APPEND "nonexiting_list3" brad) +set(result "${nonexiting_list3}") TEST("APPEND \"nonexiting_list3\" brad" "brad") -LIST(INSERT "nonexiting_list4" 0 andy bill brad ken) -SET(result "${nonexiting_list4}") +list(INSERT "nonexiting_list4" 0 andy bill brad ken) +set(result "${nonexiting_list4}") TEST("APPEND \"nonexiting_list4\" andy bill brad ken" "andy;bill;brad;ken") -SET(result andy brad) -LIST(INSERT result -1 bill ken) +set(result andy brad) +list(INSERT result -1 bill ken) TEST("INSERT result -1 bill ken" "andy;bill;ken;brad") -SET(result andy bill brad ken bob) -LIST(REMOVE_ITEM result bob) +set(result andy bill brad ken bob) +list(REMOVE_ITEM result bob) TEST("REMOVE_ITEM result bob" "andy;bill;brad;ken") -SET(result andy bill bob brad ken peter) -LIST(REMOVE_ITEM result peter bob) +set(result andy bill bob brad ken peter) +list(REMOVE_ITEM result peter bob) TEST("REMOVE_ITEM result peter bob" "andy;bill;brad;ken") -SET(result bob andy bill bob brad ken bob) -LIST(REMOVE_ITEM result bob) +set(result bob andy bill bob brad ken bob) +list(REMOVE_ITEM result bob) TEST("REMOVE_ITEM result bob" "andy;bill;brad;ken") -SET(result andy bill bob brad ken peter) -LIST(REMOVE_AT result 2 -1) +set(result andy bill bob brad ken peter) +list(REMOVE_AT result 2 -1) TEST("REMOVE_AT result 2 -1" "andy;bill;brad;ken") # ken is at index 2, nobody is not in the list so -1 should be returned -SET(mylist andy bill ken brad) -LIST(FIND mylist ken result) +set(mylist andy bill ken brad) +list(FIND mylist ken result) TEST("FIND mylist ken result" "2") -LIST(FIND mylist nobody result) +list(FIND mylist nobody result) TEST("FIND mylist nobody result" "-1") -SET(result ken bill andy brad) -LIST(SORT result) +set(result ken bill andy brad) +list(SORT result) TEST("SORT result" "andy;bill;brad;ken") -SET(result andy bill brad ken) -LIST(REVERSE result) +set(result andy bill brad ken) +list(REVERSE result) TEST("REVERSE result" "ken;brad;bill;andy") -SET(result bill andy bill brad ken ken ken) -LIST(REMOVE_DUPLICATES result) +set(result bill andy bill brad ken ken ken) +list(REMOVE_DUPLICATES result) TEST("REMOVE_DUPLICATES result" "bill;andy;brad;ken") diff --git a/Tests/CMakeTests/ToolchainTest.cmake.in b/Tests/CMakeTests/ToolchainTest.cmake.in index 1799456..cd258db 100644 --- a/Tests/CMakeTests/ToolchainTest.cmake.in +++ b/Tests/CMakeTests/ToolchainTest.cmake.in @@ -1,7 +1,7 @@ ############################################################ # some preparations so that the CMakeDetermineXXX.cmake files will work in scripted mode -# overwrite MARK_AS_ADVANCED(), since this is used in CMakeDetermineCCompiler.cmake +# overwrite mark_as_advanced(), since this is used in CMakeDetermineCCompiler.cmake # which will complain that it can"t be used in script mode macro(MARK_AS_ADVANCED) endmacro(MARK_AS_ADVANCED) diff --git a/Tests/CMakeTests/VariableWatchTest.cmake.in b/Tests/CMakeTests/VariableWatchTest.cmake.in index bdb4f7e..3d290d6 100644 --- a/Tests/CMakeTests/VariableWatchTest.cmake.in +++ b/Tests/CMakeTests/VariableWatchTest.cmake.in @@ -1,15 +1,15 @@ -MESSAGE("Start") +message("Start") -VARIABLE_WATCH(TESTVAR MESSAGE) -VARIABLE_WATCH(TESTVAR1) +variable_watch(TESTVAR MESSAGE) +variable_watch(TESTVAR1) macro(testwatch var access file stack) - MESSAGE("There was a ${access} access done on the variable: ${var} in file ${file}") - MESSAGE("List file stack is: ${stack}") + message("There was a ${access} access done on the variable: ${var} in file ${file}") + message("List file stack is: ${stack}") set(${var}_watched 1) endmacro(testwatch) -VARIABLE_WATCH(somevar testwatch) +variable_watch(somevar testwatch) set(TESTVAR1 "1") set(TESTVAR "1") |