summaryrefslogtreecommitdiffstats
path: root/Tests/CommandLineTest
diff options
context:
space:
mode:
authorKitware Robot <kwrobot@kitware.com>2012-08-13 17:50:14 (GMT)
committerBrad King <brad.king@kitware.com>2012-08-13 18:19:16 (GMT)
commit9db3116226cb99fcf54e936c833953abcde9b729 (patch)
treebd755ed9e616bbf1482a894bc7946980d81b7703 /Tests/CommandLineTest
parent77543bde41b0e52c3959016698b529835945d62d (diff)
downloadCMake-9db3116226cb99fcf54e936c833953abcde9b729.zip
CMake-9db3116226cb99fcf54e936c833953abcde9b729.tar.gz
CMake-9db3116226cb99fcf54e936c833953abcde9b729.tar.bz2
Remove CMake-language block-end command arguments
Ancient versions of CMake required else(), endif(), and similar block termination commands to have arguments matching the command starting the block. This is no longer the preferred style. Run the following shell code: for c in else endif endforeach endfunction endmacro endwhile; do echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/' done >convert.sed && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' | egrep -z -v '^(Utilities/cm|Source/kwsys/)' | egrep -z -v 'Tests/CMakeTests/While-Endwhile-' | xargs -0 sed -i -f convert.sed && rm convert.sed
Diffstat (limited to 'Tests/CommandLineTest')
-rw-r--r--Tests/CommandLineTest/CMakeLists.txt24
1 files changed, 12 insertions, 12 deletions
diff --git a/Tests/CommandLineTest/CMakeLists.txt b/Tests/CommandLineTest/CMakeLists.txt
index 8a4b4f4..96aac10 100644
--- a/Tests/CommandLineTest/CMakeLists.txt
+++ b/Tests/CommandLineTest/CMakeLists.txt
@@ -6,8 +6,8 @@ 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)
+ endif()
+endmacro()
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}\"")
@@ -32,14 +32,14 @@ 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)
+ endif()
+endmacro()
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)
+ endif()
+endmacro()
EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." "-N")
EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." "-R complex -N")
@@ -59,21 +59,21 @@ if(THIS_SHOULD_BE_SET)
message(STATUS "***************************")
message(STATUS "PreLoad.cmake works fine.")
message(STATUS "***************************")
-else(THIS_SHOULD_BE_SET)
+else()
message("***************************")
message(FATAL_ERROR "PreLoad.cmake does not work.")
-endif(THIS_SHOULD_BE_SET)
+endif()
if(DEFINED ENV{TEST_ENVIRONMENT_VARIABLE_NOTSET})
message(SEND_ERROR "Environment variable definition test broken!")
-endif(DEFINED ENV{TEST_ENVIRONMENT_VARIABLE_NOTSET})
+endif()
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")
+ endif()
+else()
message(SEND_ERROR "Environment variable setting is broken")
-endif("$ENV{TEST_ENVIRONMENT_VARIABLE}" STREQUAL "Environment variable set")
+endif()