diff options
author | Kitware Robot <kwrobot@kitware.com> | 2012-08-13 13:47:32 -0400 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-08-13 14:19:16 -0400 |
commit | 77543bde41b0e52c3959016698b529835945d62d (patch) | |
tree | ff63e5fbec326c4a5d821e7496c6d2cb52f75b92 /Tests/CommandLineTest/CMakeLists.txt | |
parent | 7bbaa4283de26864b2e55e819db0884771585467 (diff) | |
download | cmake-77543bde41b0e52c3959016698b529835945d62d.tar.gz |
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/CommandLineTest/CMakeLists.txt')
-rw-r--r-- | Tests/CommandLineTest/CMakeLists.txt | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/Tests/CommandLineTest/CMakeLists.txt b/Tests/CommandLineTest/CMakeLists.txt index 0493a0c4b0..8a4b4f4a81 100644 --- a/Tests/CommandLineTest/CMakeLists.txt +++ b/Tests/CommandLineTest/CMakeLists.txt @@ -1,13 +1,13 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(CommandLineTest) +project(CommandLineTest) -GET_FILENAME_COMPONENT(CMAKE_BIN_DIR ${CMAKE_COMMAND} PATH) -MACRO(EXEC_CMAKE_COMMAND CMAKE_ARGS) - EXEC_PROGRAM("${CMAKE_COMMAND}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET) - IF(${RET}) - MESSAGE(SEND_ERROR "CMake command failed with arguments \"${CMAKE_ARGS}\"") - ENDIF(${RET}) -ENDMACRO(EXEC_CMAKE_COMMAND) +get_filename_component(CMAKE_BIN_DIR ${CMAKE_COMMAND} PATH) +macro(EXEC_CMAKE_COMMAND CMAKE_ARGS) + exec_program("${CMAKE_COMMAND}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET) + if(${RET}) + message(SEND_ERROR "CMake command failed with arguments \"${CMAKE_ARGS}\"") + endif(${RET}) +endmacro(EXEC_CMAKE_COMMAND) EXEC_CMAKE_COMMAND("-E chdir \"${CMAKE_CURRENT_SOURCE_DIR}\" \"${CMAKE_COMMAND}\" -E echo \"Hello World\"") EXEC_CMAKE_COMMAND("-E time \"${CMAKE_COMMAND} -N -L ${CommandLineTest_SOURCE_DIR}\"") @@ -24,22 +24,22 @@ EXEC_CMAKE_COMMAND("--help-html \"${CMAKE_CURRENT_BINARY_DIR}/cmake.html\"") EXEC_CMAKE_COMMAND("--copyright \"${CMAKE_CURRENT_BINARY_DIR}/Copyright.txt\"") EXEC_CMAKE_COMMAND("--version \"${CMAKE_CURRENT_BINARY_DIR}/version.txt\"") -ADD_EXECUTABLE(CommandLineTest CommandLineTest.cxx) +add_executable(CommandLineTest CommandLineTest.cxx) -GET_FILENAME_COMPONENT(CMAKE_COMMAND_PATH "${CMAKE_COMMAND}" PATH) -SET(CTEST_COMMAND "${CMAKE_COMMAND_PATH}/ctest") -MACRO(EXEC_CTEST_COMMAND CMAKE_ARGS) - EXEC_PROGRAM("${CTEST_COMMAND}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET) - IF(${RET}) - MESSAGE(SEND_ERROR "CTest command failed with arguments \"${CMAKE_ARGS}\"") - ENDIF(${RET}) -ENDMACRO(EXEC_CTEST_COMMAND) -MACRO(EXEC_CTEST_COMMAND_WITH_DIR DIR CMAKE_ARGS) - EXEC_PROGRAM("${CTEST_COMMAND}" "${DIR}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET) - IF(${RET}) - MESSAGE(SEND_ERROR "CTest command failed with arguments \"${CMAKE_ARGS}\"") - ENDIF(${RET}) -ENDMACRO(EXEC_CTEST_COMMAND_WITH_DIR) +get_filename_component(CMAKE_COMMAND_PATH "${CMAKE_COMMAND}" PATH) +set(CTEST_COMMAND "${CMAKE_COMMAND_PATH}/ctest") +macro(EXEC_CTEST_COMMAND CMAKE_ARGS) + exec_program("${CTEST_COMMAND}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET) + if(${RET}) + message(SEND_ERROR "CTest command failed with arguments \"${CMAKE_ARGS}\"") + endif(${RET}) +endmacro(EXEC_CTEST_COMMAND) +macro(EXEC_CTEST_COMMAND_WITH_DIR DIR CMAKE_ARGS) + exec_program("${CTEST_COMMAND}" "${DIR}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET) + if(${RET}) + message(SEND_ERROR "CTest command failed with arguments \"${CMAKE_ARGS}\"") + endif(${RET}) +endmacro(EXEC_CTEST_COMMAND_WITH_DIR) EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." "-N") EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." "-R complex -N") @@ -55,25 +55,25 @@ EXEC_CTEST_COMMAND("--help-man \"${CMAKE_CURRENT_BINARY_DIR}/ctest.man\"") EXEC_CTEST_COMMAND("--help-html \"${CMAKE_CURRENT_BINARY_DIR}/ctest.html\"") EXEC_CTEST_COMMAND("--version") -IF(THIS_SHOULD_BE_SET) - MESSAGE(STATUS "***************************") - MESSAGE(STATUS "PreLoad.cmake works fine.") - MESSAGE(STATUS "***************************") -ELSE(THIS_SHOULD_BE_SET) - MESSAGE("***************************") - MESSAGE(FATAL_ERROR "PreLoad.cmake does not work.") -ENDIF(THIS_SHOULD_BE_SET) +if(THIS_SHOULD_BE_SET) + message(STATUS "***************************") + message(STATUS "PreLoad.cmake works fine.") + message(STATUS "***************************") +else(THIS_SHOULD_BE_SET) + message("***************************") + message(FATAL_ERROR "PreLoad.cmake does not work.") +endif(THIS_SHOULD_BE_SET) -IF(DEFINED ENV{TEST_ENVIRONMENT_VARIABLE_NOTSET}) - MESSAGE(SEND_ERROR "Environment variable definition test broken!") -ENDIF(DEFINED ENV{TEST_ENVIRONMENT_VARIABLE_NOTSET}) +if(DEFINED ENV{TEST_ENVIRONMENT_VARIABLE_NOTSET}) + message(SEND_ERROR "Environment variable definition test broken!") +endif(DEFINED ENV{TEST_ENVIRONMENT_VARIABLE_NOTSET}) -SET(ENV{TEST_ENVIRONMENT_VARIABLE} "Environment variable set") -IF("$ENV{TEST_ENVIRONMENT_VARIABLE}" STREQUAL "Environment variable set") - MESSAGE(STATUS "Environment variable set to: $ENV{TEST_ENVIRONMENT_VARIABLE}") - IF(NOT DEFINED ENV{TEST_ENVIRONMENT_VARIABLE}) - MESSAGE(SEND_ERROR "Environment variable definition test failed!") - ENDIF(NOT DEFINED ENV{TEST_ENVIRONMENT_VARIABLE}) -ELSE("$ENV{TEST_ENVIRONMENT_VARIABLE}" STREQUAL "Environment variable set") - MESSAGE(SEND_ERROR "Environment variable setting is broken") -ENDIF("$ENV{TEST_ENVIRONMENT_VARIABLE}" STREQUAL "Environment variable set") +set(ENV{TEST_ENVIRONMENT_VARIABLE} "Environment variable set") +if("$ENV{TEST_ENVIRONMENT_VARIABLE}" STREQUAL "Environment variable set") + message(STATUS "Environment variable set to: $ENV{TEST_ENVIRONMENT_VARIABLE}") + if(NOT DEFINED ENV{TEST_ENVIRONMENT_VARIABLE}) + message(SEND_ERROR "Environment variable definition test failed!") + endif(NOT DEFINED ENV{TEST_ENVIRONMENT_VARIABLE}) +else("$ENV{TEST_ENVIRONMENT_VARIABLE}" STREQUAL "Environment variable set") + message(SEND_ERROR "Environment variable setting is broken") +endif("$ENV{TEST_ENVIRONMENT_VARIABLE}" STREQUAL "Environment variable set") |