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/FunctionTest | |
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/FunctionTest')
-rw-r--r-- | Tests/FunctionTest/CMakeLists.txt | 132 | ||||
-rw-r--r-- | Tests/FunctionTest/SubDirScope/CMakeLists.txt | 16 |
2 files changed, 74 insertions, 74 deletions
diff --git a/Tests/FunctionTest/CMakeLists.txt b/Tests/FunctionTest/CMakeLists.txt index 5d4f42d..204a824 100644 --- a/Tests/FunctionTest/CMakeLists.txt +++ b/Tests/FunctionTest/CMakeLists.txt @@ -1,46 +1,46 @@ # a simple C only test case cmake_minimum_required (VERSION 2.6) -PROJECT (FunctionTest) +project (FunctionTest) -FUNCTION(FAILED testname) - MESSAGE(SEND_ERROR "${testname} failed ${ARGN}") -ENDFUNCTION(FAILED) +function(FAILED testname) + message(SEND_ERROR "${testname} failed ${ARGN}") +endfunction(FAILED) -FUNCTION(PASS testname) - MESSAGE("${testname} passed ${ARGN}") -ENDFUNCTION(PASS) +function(PASS testname) + message("${testname} passed ${ARGN}") +endfunction(PASS) # test scope -SET(COUNT 3) -FUNCTION(scope_test) - SET(COUNT 4) -ENDFUNCTION(scope_test) +set(COUNT 3) +function(scope_test) + set(COUNT 4) +endfunction(scope_test) scope_test() -IF(COUNT EQUAL "3") +if(COUNT EQUAL "3") PASS("scope") -ELSE(COUNT EQUAL "3") +else(COUNT EQUAL "3") FAILED("COUNT Got: ${COUNT}") -ENDIF(COUNT EQUAL "3") +endif(COUNT EQUAL "3") # test ARGC -FUNCTION(weird_name) - IF("${ARGC}" EQUAL "3") +function(weird_name) + if("${ARGC}" EQUAL "3") PASS("ARGC") - ELSE("${ARGC}" EQUAL "3") + else("${ARGC}" EQUAL "3") FAILED("ARGC" "Got: ${ARGC}") - ENDIF("${ARGC}" EQUAL "3") -ENDFUNCTION(weird_name) + endif("${ARGC}" EQUAL "3") +endfunction(weird_name) WeIrD_nAmE(a1 a2 a3) # test ARGN -FUNCTION(test_argn_function argument) - IF("${ARGN}" EQUAL "3") +function(test_argn_function argument) + if("${ARGN}" EQUAL "3") PASS("ARGN") - ELSE("${ARGN}" EQUAL "3") + else("${ARGN}" EQUAL "3") FAILED("ARGN" "Got: ${ARGN}") - ENDIF("${ARGN}" EQUAL "3") -ENDFUNCTION(test_argn_function) + endif("${ARGN}" EQUAL "3") +endfunction(test_argn_function) Test_Argn_Function(ignored 3) # test argument naming and raise scope @@ -86,91 +86,91 @@ endif (fresult EQUAL 120) # case test -FUNCTION(strange_function m) - SET("${m}" strange_function PARENT_SCOPE) -ENDFUNCTION(strange_function m) +function(strange_function m) + set("${m}" strange_function PARENT_SCOPE) +endfunction(strange_function m) STRANGE_FUNCTION(var) set(second_var "second_var") -IF("${var}" STREQUAL "strange_function" AND "${second_var}" STREQUAL "second_var") +if("${var}" STREQUAL "strange_function" AND "${second_var}" STREQUAL "second_var") PASS("Case Test" "(${var} ${second_var})") -ELSE("${var}" STREQUAL "strange_function" AND "${second_var}" STREQUAL "second_var") +else("${var}" STREQUAL "strange_function" AND "${second_var}" STREQUAL "second_var") FAILED("Case test" "(${var} ${second_var})") -ENDIF("${var}" STREQUAL "strange_function" AND "${second_var}" STREQUAL "second_var") +endif("${var}" STREQUAL "strange_function" AND "${second_var}" STREQUAL "second_var") # test backing up command -FUNCTION(ADD_EXECUTABLE exec) +function(ADD_EXECUTABLE exec) _ADD_EXECUTABLE(mini${exec} ${ARGN}) -ENDFUNCTION(ADD_EXECUTABLE) +endfunction(ADD_EXECUTABLE) # var undef case -FUNCTION(undef_var m) - SET("${m}" PARENT_SCOPE) -ENDFUNCTION(undef_var) +function(undef_var m) + set("${m}" PARENT_SCOPE) +endfunction(undef_var) -SET(FUNCTION_UNDEFINED 1) +set(FUNCTION_UNDEFINED 1) undef_var(FUNCTION_UNDEFINED) -IF(DEFINED FUNCTION_UNDEFINED) +if(DEFINED FUNCTION_UNDEFINED) FAILED("Function Undefine Test" "(${FUNCTION_UNDEFINED})") -ELSE(DEFINED FUNCTION_UNDEFINED) +else(DEFINED FUNCTION_UNDEFINED) PASS("Function Undefine Test" "(${FUNCTION_UNDEFINED})") -ENDIF(DEFINED FUNCTION_UNDEFINED) +endif(DEFINED FUNCTION_UNDEFINED) # Subdirectory scope raise. -SET(SUBDIR_UNDEFINED 1) -ADD_SUBDIRECTORY(SubDirScope) -IF(DEFINED SUBDIR_UNDEFINED) +set(SUBDIR_UNDEFINED 1) +add_subdirectory(SubDirScope) +if(DEFINED SUBDIR_UNDEFINED) FAILED("Subdir Undefine Test" "(${SUBDIR_UNDEFINED})") -ELSE(DEFINED SUBDIR_UNDEFINED) +else(DEFINED SUBDIR_UNDEFINED) PASS("Subdir Undefine Test" "(${SUBDIR_UNDEFINED})") -ENDIF(DEFINED SUBDIR_UNDEFINED) -IF(DEFINED SUBDIR_DEFINED) +endif(DEFINED SUBDIR_UNDEFINED) +if(DEFINED SUBDIR_DEFINED) PASS("Subdir Define Test" "(${SUBDIR_DEFINED})") -ELSE(DEFINED SUBDIR_DEFINED) +else(DEFINED SUBDIR_DEFINED) FAILED("Subdir Define Test" "(${SUBDIR_DEFINED})") -ENDIF(DEFINED SUBDIR_DEFINED) +endif(DEFINED SUBDIR_DEFINED) # Test function-scoped directory. -FUNCTION(ADD_SUBDIR2 dir) - ADD_SUBDIRECTORY("${dir}" "${dir}2") +function(ADD_SUBDIR2 dir) + add_subdirectory("${dir}" "${dir}2") # The parent scope sets in the subdir should be visible here. - IF(DEFINED SUBDIR_UNDEFINED) + if(DEFINED SUBDIR_UNDEFINED) FAILED("Subdir Function Undefine Test 1" "(${SUBDIR_UNDEFINED})") - ELSE(DEFINED SUBDIR_UNDEFINED) + else(DEFINED SUBDIR_UNDEFINED) PASS("Subdir Function Undefine Test 1" "(${SUBDIR_UNDEFINED})") - ENDIF(DEFINED SUBDIR_UNDEFINED) - IF(DEFINED SUBDIR_DEFINED) + endif(DEFINED SUBDIR_UNDEFINED) + if(DEFINED SUBDIR_DEFINED) PASS("Subdir Function Define Test 1" "(${SUBDIR_DEFINED})") - ELSE(DEFINED SUBDIR_DEFINED) + else(DEFINED SUBDIR_DEFINED) FAILED("Subdir Function Define Test 1" "(${SUBDIR_DEFINED})") - ENDIF(DEFINED SUBDIR_DEFINED) -ENDFUNCTION(ADD_SUBDIR2) + endif(DEFINED SUBDIR_DEFINED) +endfunction(ADD_SUBDIR2) # Reset test variables. -SET(SUBDIR_UNDEFINED 1) -SET(SUBDIR_DEFINED) +set(SUBDIR_UNDEFINED 1) +set(SUBDIR_DEFINED) # Run test function. ADD_SUBDIR2(SubDirScope) # The parent scope sets in the subdir should not be visible here. -IF(DEFINED SUBDIR_UNDEFINED) +if(DEFINED SUBDIR_UNDEFINED) PASS("Subdir Function Undefine Test 2" "(${SUBDIR_UNDEFINED})") -ELSE(DEFINED SUBDIR_UNDEFINED) +else(DEFINED SUBDIR_UNDEFINED) FAILED("Subdir Function Undefine Test 2" "(${SUBDIR_UNDEFINED})") -ENDIF(DEFINED SUBDIR_UNDEFINED) -IF(DEFINED SUBDIR_DEFINED) +endif(DEFINED SUBDIR_UNDEFINED) +if(DEFINED SUBDIR_DEFINED) FAILED("Subdir Function Define Test 2" "(${SUBDIR_DEFINED})") -ELSE(DEFINED SUBDIR_DEFINED) +else(DEFINED SUBDIR_DEFINED) PASS("Subdir Function Define Test 2" "(${SUBDIR_DEFINED})") -ENDIF(DEFINED SUBDIR_DEFINED) +endif(DEFINED SUBDIR_DEFINED) -ADD_EXECUTABLE(FunctionTest functionTest.c) +add_executable(FunctionTest functionTest.c) # Use the PROJECT_LABEL property: in IDEs, the project label should appear # in the UI rather than the target name. If this were a good test of the # property rather than just a smoke test, it would verify that the label # actually appears in the UI of the IDE... Or at least that the text appears # somewhere in the generated project files. -SET_PROPERTY(TARGET miniFunctionTest +set_property(TARGET miniFunctionTest PROPERTY PROJECT_LABEL "Test de Fonctionnement") diff --git a/Tests/FunctionTest/SubDirScope/CMakeLists.txt b/Tests/FunctionTest/SubDirScope/CMakeLists.txt index 4a53d2c..c40fadb 100644 --- a/Tests/FunctionTest/SubDirScope/CMakeLists.txt +++ b/Tests/FunctionTest/SubDirScope/CMakeLists.txt @@ -1,14 +1,14 @@ -SET(SUBDIR_DEFINED 1 PARENT_SCOPE) -SET(SUBDIR_UNDEFINED PARENT_SCOPE) +set(SUBDIR_DEFINED 1 PARENT_SCOPE) +set(SUBDIR_UNDEFINED PARENT_SCOPE) # The above sets should not affect the current scope. -IF(DEFINED SUBDIR_UNDEFINED) +if(DEFINED SUBDIR_UNDEFINED) PASS("SubdirScope Undefine Test" "(${SUBDIR_UNDEFINED})") -ELSE(DEFINED SUBDIR_UNDEFINED) +else(DEFINED SUBDIR_UNDEFINED) FAILED("SubdirScope Undefine Test" "(${SUBDIR_UNDEFINED})") -ENDIF(DEFINED SUBDIR_UNDEFINED) -IF(DEFINED SUBDIR_DEFINED) +endif(DEFINED SUBDIR_UNDEFINED) +if(DEFINED SUBDIR_DEFINED) FAILED("SubdirScope Define Test" "(${SUBDIR_DEFINED})") -ELSE(DEFINED SUBDIR_DEFINED) +else(DEFINED SUBDIR_DEFINED) PASS("SubdirScope Define Test" "(${SUBDIR_DEFINED})") -ENDIF(DEFINED SUBDIR_DEFINED) +endif(DEFINED SUBDIR_DEFINED) |