diff options
Diffstat (limited to 'Tests/MacroTest')
-rw-r--r-- | Tests/MacroTest/CMakeLists.txt | 34 | ||||
-rw-r--r-- | Tests/MacroTest/context.cmake | 2 |
2 files changed, 18 insertions, 18 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) diff --git a/Tests/MacroTest/context.cmake b/Tests/MacroTest/context.cmake index 82eb485..f7350d7 100644 --- a/Tests/MacroTest/context.cmake +++ b/Tests/MacroTest/context.cmake @@ -7,4 +7,4 @@ if(NOT "${current_file}" STREQUAL "${CMAKE_CURRENT_LIST_FILE}") " ${current_file}\n" "from the macro." ) -endif(NOT "${current_file}" STREQUAL "${CMAKE_CURRENT_LIST_FILE}") +endif() |