summaryrefslogtreecommitdiffstats
path: root/Tests/MacroTest/CMakeLists.txt
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/MacroTest/CMakeLists.txt
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/MacroTest/CMakeLists.txt')
-rw-r--r--Tests/MacroTest/CMakeLists.txt34
1 files changed, 17 insertions, 17 deletions
diff --git a/Tests/MacroTest/CMakeLists.txt b/Tests/MacroTest/CMakeLists.txt
index 9d189b9..02bb31f 100644
--- a/Tests/MacroTest/CMakeLists.txt
+++ b/Tests/MacroTest/CMakeLists.txt
@@ -4,48 +4,48 @@ project (MacroTest)
macro(FAILED testname)
message(SEND_ERROR "${testname} failed ${ARGN}")
-endmacro(FAILED)
+endmacro()
macro(PASS testname)
message("${testname} passed ${ARGN}")
-endmacro(PASS)
+endmacro()
# test ARGC
macro(weird_name)
if("${ARGC}" EQUAL "3")
PASS("ARGC")
- else("${ARGC}" EQUAL "3")
+ else()
FAILED("ARGC" "Got: ${ARGC}")
- endif("${ARGC}" EQUAL "3")
-endmacro(weird_name)
+ endif()
+endmacro()
WeIrD_nAmE(a1 a2 a3)
# test ARGN
macro(test_argn_macro argument)
if("${ARGN}" EQUAL "3")
PASS("ARGN")
- else("${ARGN}" EQUAL "3")
+ else()
FAILED("ARGN" "Got: ${ARGN}")
- endif("${ARGN}" EQUAL "3")
-endmacro(test_argn_macro)
+ endif()
+endmacro()
Test_Argn_Macro(ignored 3)
# case test
macro(strange_macro m)
set("${m}" strange_macro)
-endmacro(strange_macro m)
+endmacro()
STRANGE_MACRO(var)
set(second_var "second_var")
if("${var}" STREQUAL "strange_macro" AND "${second_var}" STREQUAL "second_var")
PASS("Case Test" "(${var} ${second_var})")
-else("${var}" STREQUAL "strange_macro" AND "${second_var}" STREQUAL "second_var")
+else()
FAILED("Case test" "(${var} ${second_var})")
-endif("${var}" STREQUAL "strange_macro" AND "${second_var}" STREQUAL "second_var")
+endif()
# test backing up command
macro(ADD_EXECUTABLE exec)
_ADD_EXECUTABLE("mini${exec}" ${ARGN})
-endmacro(ADD_EXECUTABLE)
+endmacro()
include(CheckCSourceCompiles)
Check_C_Source_Compiles(
@@ -64,9 +64,9 @@ int main(int ac, char*av[]){
SOME_CHECK)
if(SOME_CHECK)
message("CheckCSourceCompiles works")
-else(SOME_CHECK)
+else()
message(FATAL_ERROR "CheckCSourceCompiles does not work")
-endif(SOME_CHECK)
+endif()
include(CheckCXXSourceCompiles)
Check_CXX_Source_Compiles(
@@ -79,13 +79,13 @@ int main(int ac, char*av[]){
SOME_CHECK)
if(SOME_CHECK)
message("CheckCXXSourceCompiles works")
-else(SOME_CHECK)
+else()
message(FATAL_ERROR "CheckCXXSourceCompiles does not work")
-endif(SOME_CHECK)
+endif()
add_executable(MacroTest macroTest.c)
macro(GET_CURRENT_FILE var)
set(${var} ${CMAKE_CURRENT_LIST_FILE})
-endmacro(GET_CURRENT_FILE)
+endmacro()
include(context.cmake)