diff options
Diffstat (limited to 'Tests')
139 files changed, 1131 insertions, 1131 deletions
diff --git a/Tests/ArgumentExpansion/CMakeLists.txt b/Tests/ArgumentExpansion/CMakeLists.txt index a24636f..1735400 100644 --- a/Tests/ArgumentExpansion/CMakeLists.txt +++ b/Tests/ArgumentExpansion/CMakeLists.txt @@ -8,7 +8,7 @@ function (argument_tester expected expected_len) if (NOT ${expected_received_len} EQUAL ${expected_len}) message(STATUS "Unexpected: Expanding expected values isn't working") - endif (NOT ${expected_received_len} EQUAL ${expected_len}) + endif () if (${argn_len} EQUAL ${expected_len}) set(i 0) @@ -23,13 +23,13 @@ function (argument_tester expected expected_len) endif () math(EXPR i "${i} + 1") - endwhile (i LESS ${argn_len}) - else (${argn_len} EQUAL ${expected_len}) + endwhile () + else () message(STATUS "Unexpected: Lengths of arguments don't match") message(STATUS " Expected: ${expected_len}") message(STATUS " Received: ${argn_len}") - endif (${argn_len} EQUAL ${expected_len}) -endfunction (argument_tester expected) + endif () +endfunction () set(empty_test) message(STATUS "Test: Empty arguments") diff --git a/Tests/Assembler/CMakeLists.txt b/Tests/Assembler/CMakeLists.txt index 456e496..5f71036 100644 --- a/Tests/Assembler/CMakeLists.txt +++ b/Tests/Assembler/CMakeLists.txt @@ -18,16 +18,16 @@ if("${CMAKE_GENERATOR}" MATCHES "Makefile") DEPENDS main.c VERBATIM ) - endif(("${CMAKE_C_COMPILER_ID}" MATCHES "^(GNU|HP|SunPro|XL)$") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Intel" AND UNIX)) -endif("${CMAKE_GENERATOR}" MATCHES "Makefile") + endif() +endif() if(SRCS) set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS}") enable_language(ASM OPTIONAL) -else(SRCS) +else() message(STATUS "No assembler enabled, using C") set(SRCS main.c) -endif(SRCS) +endif() add_executable(HelloAsm ${SRCS}) diff --git a/Tests/BuildDepends/CMakeLists.txt b/Tests/BuildDepends/CMakeLists.txt index 045acb8..d3b1f3c 100644 --- a/Tests/BuildDepends/CMakeLists.txt +++ b/Tests/BuildDepends/CMakeLists.txt @@ -15,7 +15,7 @@ set(CMAKE_SUPPRESS_REGENERATION 1) # Xcode needs some help with the fancy dependencies in this test. if("${CMAKE_GENERATOR}" MATCHES "Xcode") set(HELP_XCODE 1) -endif("${CMAKE_GENERATOR}" MATCHES "Xcode") +endif() function(help_xcode_depends) if(HELP_XCODE) file(GLOB_RECURSE MACRO_OBJS @@ -24,9 +24,9 @@ function(help_xcode_depends) if(MACRO_OBJS) message("Helping Xcode by removing objects [${MACRO_OBJS}]") file(REMOVE ${MACRO_OBJS}) - endif(MACRO_OBJS) - endif(HELP_XCODE) -endfunction(help_xcode_depends) + endif() + endif() +endfunction() if("${CMAKE_GENERATOR}" MATCHES "Ninja") set(HELP_NINJA 1) # TODO Why is this needed? @@ -80,12 +80,12 @@ if(HELP_XCODE) ${BuildDepends_SOURCE_DIR}/Project testRebuild OUTPUT_VARIABLE OUTPUT) -endif(HELP_XCODE) +endif() message("Output from first build:\n${OUTPUT}") if(NOT RESULT) message(SEND_ERROR "Could not build test project (1)!") -endif(NOT RESULT) +endif() set(bar ${BuildDepends_BINARY_DIR}/Project/bar${CMAKE_EXECUTABLE_SUFFIX}) if(EXISTS @@ -111,9 +111,9 @@ message("Run result: ${runResult} Output: \"${out}\"") if("${out}" STREQUAL "foo ") message("Worked!") -else("${out}" STREQUAL "foo ") +else() message(SEND_ERROR "Project did not initially build properly: ${out}") -endif("${out}" STREQUAL "foo ") +endif() message("Running ${zot} ") execute_process(COMMAND ${zot} OUTPUT_VARIABLE out RESULT_VARIABLE runResult) @@ -123,9 +123,9 @@ message("Run result: ${runResult} Output: \"${out}\"") set(VALUE_UNCHANGED "[zot] [zot_custom] [zot_macro_dir] [zot_macro_tgt] ") if("${out}" STREQUAL "${VALUE_UNCHANGED}") message("Worked!") -else("${out}" STREQUAL "${VALUE_UNCHANGED}") +else() message(SEND_ERROR "Project did not initially build properly: ${out}") -endif("${out}" STREQUAL "${VALUE_UNCHANGED}") +endif() message("Waiting 3 seconds...") # any additional argument will cause ${bar} to wait forever @@ -174,7 +174,7 @@ endif() message("Output from second build:\n${OUTPUT}") if(NOT RESULT) message(SEND_ERROR "Could not build test project (2)!") -endif(NOT RESULT) +endif() if(EXISTS "${BuildDepends_BINARY_DIR}/Project/Debug/bar${CMAKE_EXECUTABLE_SUFFIX}" ) message("found debug") @@ -193,9 +193,9 @@ message("Run result: ${runResult} Output: \"${out}\"") if("${out}" STREQUAL "foo changed ") message("Worked!") -else("${out}" STREQUAL "foo changed ") +else() message(SEND_ERROR "Project did not rebuild properly!") -endif("${out}" STREQUAL "foo changed ") +endif() message("Running ${zot} ") execute_process(COMMAND ${zot} OUTPUT_VARIABLE out RESULT_VARIABLE runResult) @@ -207,9 +207,9 @@ set(VALUE_CHANGED ) if("${out}" STREQUAL "${VALUE_CHANGED}") message("Worked!") -else("${out}" STREQUAL "${VALUE_CHANGED}") +else() message(SEND_ERROR "Project did not rebuild properly!") -endif("${out}" STREQUAL "${VALUE_CHANGED}") +endif() if(TEST_LINK_DEPENDS) set(linkdep ${BuildDepends_BINARY_DIR}/Project/linkdep${CMAKE_EXECUTABLE_SUFFIX}) diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt index a258de2..01f5f62 100644 --- a/Tests/BuildDepends/Project/CMakeLists.txt +++ b/Tests/BuildDepends/Project/CMakeLists.txt @@ -27,7 +27,7 @@ if(APPLE) set(CMAKE_OSX_ARCHITECTURES i386 x86_64) endif() endif() -endif(APPLE) +endif() add_library(foo STATIC ${testRebuild_BINARY_DIR}/foo.cxx) set_target_properties(foo PROPERTIES OUTPUT_NAME "foolib") @@ -65,11 +65,11 @@ if("${CMAKE_GENERATOR}" MATCHES "Make") set(ZOT_DEPENDS IMPLICIT_DEPENDS CXX ${CMAKE_CURRENT_SOURCE_DIR}/dep.cxx) set(ZOT_CUSTOM_DEP IMPLICIT_DEPENDS CXX ${CMAKE_CURRENT_SOURCE_DIR}/dep_custom.cxx) -else("${CMAKE_GENERATOR}" MATCHES "Make") +else() # No IMPLICIT_DEPENDS...just depend directly. set(ZOT_DEPENDS DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/zot.hxx.in) set(ZOT_CUSTOM_DEP DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/zot_custom.hxx.in) -endif("${CMAKE_GENERATOR}" MATCHES "Make") +endif() add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zot.hxx COMMAND ${CMAKE_COMMAND} -E copy diff --git a/Tests/BundleTest/CMakeLists.txt b/Tests/BundleTest/CMakeLists.txt index 4fb65bf..de69d75 100644 --- a/Tests/BundleTest/CMakeLists.txt +++ b/Tests/BundleTest/CMakeLists.txt @@ -61,7 +61,7 @@ set_target_properties(BundleTest PROPERTIES OUTPUT_NAME BundleTestExe) # Test executable versioning if it is supported. if(NOT XCODE) set_target_properties(BundleTest PROPERTIES VERSION 1) -endif(NOT XCODE) +endif() # Make sure the executable can find its installed library. set_target_properties(BundleTestLib PROPERTIES @@ -77,26 +77,26 @@ if(EXISTS /usr/lib/libtcl.dylib message("frame: ${TCL}") if(NOT "${TCL}" MATCHES .framework) message(FATAL_ERROR "Could not find tcl framework, found ${TCL}") - endif(NOT "${TCL}" MATCHES .framework) + endif() set(TCL NOTFOUND) set(CMAKE_FIND_FRAMEWORK LAST) find_library(TCL tcl) if("${TCL}" MATCHES .framework) message(FATAL_ERROR "Found framework and should have found dylib ${TCL}") - endif("${TCL}" MATCHES .framework) + endif() set(TCL NOTFOUND) set(CMAKE_FIND_FRAMEWORK NEVER) find_library(TCL tcl) if("${TCL}" MATCHES .framework) message(FATAL_ERROR "Found framework and should have found dylib ${TCL}") - endif("${TCL}" MATCHES .framework) + endif() message("not frame: ${TCL}") set(TCL NOTFOUND) set(CMAKE_FIND_FRAMEWORK FIRST) find_library(TCL tcl) if(NOT "${TCL}" MATCHES .framework) message(FATAL_ERROR "Could not find tcl framework, found ${TCL}") - endif(NOT "${TCL}" MATCHES .framework) + endif() message("frame: ${TCL}") endif(EXISTS /usr/lib/libtcl.dylib AND EXISTS /System/Library/Frameworks/Tcl.framework) diff --git a/Tests/BundleUtilities/bundleutils.cmake b/Tests/BundleUtilities/bundleutils.cmake index 46765e7..cc89347 100644 --- a/Tests/BundleUtilities/bundleutils.cmake +++ b/Tests/BundleUtilities/bundleutils.cmake @@ -31,7 +31,7 @@ configure_file("${MODULE}" "${OUTPUT_MODULE}" COPYONLY) # this shouldn't be necessary except for the non-bundle case on Mac function(gp_item_default_embedded_path_override item path) set(path "@executable_path" PARENT_SCOPE) -endfunction(gp_item_default_embedded_path_override) +endfunction() include(BundleUtilities) fixup_bundle("${OUTPUT}" "${OUTPUT_MODULE}" "${INPUTDIR}") @@ -42,4 +42,4 @@ execute_process(COMMAND "${OUTPUT}" RESULT_VARIABLE result OUTPUT_VARIABLE out E if(NOT result STREQUAL "0") message(FATAL_ERROR " failed to execute test program\n${out}") -endif(NOT result STREQUAL "0") +endif() diff --git a/Tests/CMakeBuildTest.cmake.in b/Tests/CMakeBuildTest.cmake.in index 02206de..195f107 100644 --- a/Tests/CMakeBuildTest.cmake.in +++ b/Tests/CMakeBuildTest.cmake.in @@ -16,7 +16,7 @@ execute_process(COMMAND "${CMAKE_COMMAND}" RESULT_VARIABLE RESULT) if(RESULT) message(FATAL_ERROR "Error running cmake command") -endif(RESULT) +endif() # Now use the --build option to build the project message("running: ${CMAKE_COMMAND} --build") @@ -25,7 +25,7 @@ execute_process(COMMAND "${CMAKE_COMMAND}" RESULT_VARIABLE RESULT) if(RESULT) message(FATAL_ERROR "Error running cmake --build") -endif(RESULT) +endif() # check for configuration types set(CMAKE_CONFIGURATION_TYPES @CMAKE_CONFIGURATION_TYPES@) @@ -33,15 +33,15 @@ set(CMAKE_CONFIGURATION_TYPES @CMAKE_CONFIGURATION_TYPES@) # are configuration types if(CMAKE_CONFIGURATION_TYPES) set(RUN_TEST "@CMAKE_BUILD_TEST_BINARY_DIR@/Debug/@CMAKE_BUILD_TEST_EXE@") -else(CMAKE_CONFIGURATION_TYPES) +else() set(RUN_TEST "@CMAKE_BUILD_TEST_BINARY_DIR@/@CMAKE_BUILD_TEST_EXE@") -endif(CMAKE_CONFIGURATION_TYPES) +endif() # run the test results message("running [${RUN_TEST}]") execute_process(COMMAND "${RUN_TEST}" RESULT_VARIABLE RESULT) if(RESULT) message(FATAL_ERROR "Error running test @CMAKE_BUILD_TEST_EXE@") -endif(RESULT) +endif() # build it again with clean and only @CMAKE_BUILD_TEST_EXE@ target execute_process(COMMAND "${CMAKE_COMMAND}" @@ -50,10 +50,10 @@ execute_process(COMMAND "${CMAKE_COMMAND}" RESULT_VARIABLE RESULT) if(RESULT) message(FATAL_ERROR "Error running cmake --build") -endif(RESULT) +endif() # run it again after clean execute_process(COMMAND "${RUN_TEST}" RESULT_VARIABLE RESULT) if(RESULT) message(FATAL_ERROR "Error running test @CMAKE_BUILD_TEST_EXE@ after clean ") -endif(RESULT) +endif() diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 70d4171..651e1b9 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -14,12 +14,12 @@ macro(ADD_TEST_MACRO NAME COMMAND) ${${NAME}_EXTRA_OPTIONS} --test-command ${COMMAND} ${ARGN}) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${dir}") -endmacro(ADD_TEST_MACRO) +endmacro() macro(REGEX_ESCAPE_STRING _OUT _IN) # Escape special regex metacharacters with a backslash string(REGEX REPLACE "([$^.[|*+?()]|])" "\\\\\\1" ${_OUT} "${_IN}") -endmacro(REGEX_ESCAPE_STRING _OUT _IN) +endmacro() include(${CMAKE_CURRENT_SOURCE_DIR}/CheckFortran.cmake) @@ -75,7 +75,7 @@ if(BUILD_TESTING) "Should the KDE4 stable branch test be run?" OFF) mark_as_advanced(TEST_KDE4_STABLE_BRANCH) - endif (CMAKE_RUN_LONG_TESTS) + endif () # Should tests that use CVS be run? # @@ -83,19 +83,19 @@ if(BUILD_TESTING) if(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake) find_package(CVS QUIET) - else(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake) + else() find_program(CVS_EXECUTABLE NAMES cvs) - endif(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake) + endif() if(CVS_EXECUTABLE) set(do_cvs_tests 1) - endif(CVS_EXECUTABLE) + endif() if(do_cvs_tests AND NOT UNIX) if("${CVS_EXECUTABLE}" MATCHES "cygwin") set(do_cvs_tests 0) - endif("${CVS_EXECUTABLE}" MATCHES "cygwin") - endif(do_cvs_tests AND NOT UNIX) + endif() + endif() # Should CPack tests be run? By default, yes, but... # @@ -123,20 +123,20 @@ if(BUILD_TESTING) message(STATUS "Forcing CTEST_TEST_CPACK=OFF on OSX < 10.4") message(STATUS "OSX_VERSION='${OSX_VERSION}'") set(CTEST_TEST_CPACK OFF) - else(OSX_VERSION MATCHES "^10\\.[0123]" OR OSX_VERSION MATCHES "ProductVersion:\t10\\.[0123]") + else() set(CTEST_TEST_OSX_ARCH 1) - endif(OSX_VERSION MATCHES "^10\\.[0123]" OR OSX_VERSION MATCHES "ProductVersion:\t10\\.[0123]") - endif(APPLE) + endif() + endif() # Use 1500 or CTEST_TEST_TIMEOUT for long test timeout value, # whichever is greater. set(CMAKE_LONG_TEST_TIMEOUT 1500) if(CTEST_TEST_TIMEOUT) set(CMAKE_LONG_TEST_TIMEOUT ${CTEST_TEST_TIMEOUT}) - endif(CTEST_TEST_TIMEOUT) + endif() if(CMAKE_LONG_TEST_TIMEOUT LESS 1500) set(CMAKE_LONG_TEST_TIMEOUT 1500) - endif(CMAKE_LONG_TEST_TIMEOUT LESS 1500) + endif() # add a bunch of standard build-and-test style tests ADD_TEST_MACRO(CommandLineTest CommandLineTest) @@ -225,18 +225,18 @@ if(BUILD_TESTING) PASS_REGULAR_EXPRESSION "TRY_RUN.. invoked in cross-compiling mode") if("${CMAKE_TEST_GENERATOR}" MATCHES "Make") ADD_TEST_MACRO(Policy0002 Policy0002) - endif("${CMAKE_TEST_GENERATOR}" MATCHES "Make") + endif() if(CTEST_TEST_OSX_ARCH) ADD_TEST_MACRO(Architecture Architecture) set_tests_properties(Architecture PROPERTIES PASS_REGULAR_EXPRESSION "(file is not of required architecture|does not match cputype|not the architecture being linked)") - endif(CTEST_TEST_OSX_ARCH) + endif() list(APPEND TEST_BUILD_DIRS ${CMake_TEST_INSTALL_PREFIX}) if(NOT QT4_FOUND) find_package(Qt4) - endif(NOT QT4_FOUND) + endif() if(QT4_FOUND) # test whether the Qt4 which has been found works, on some machines @@ -380,7 +380,7 @@ if(BUILD_TESTING) --build-project Simple --test-command Simple) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_EclipseGenerator") - endif ("${cmakeOutput}" MATCHES Eclipse) + endif () # check for the CodeBlocks generator if ("${cmakeOutput}" MATCHES CodeBlocks) @@ -394,7 +394,7 @@ if(BUILD_TESTING) --build-project Simple --test-command Simple) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_CodeBlocksGenerator") - endif ("${cmakeOutput}" MATCHES CodeBlocks) + endif () # check for the KDevelop3 generator if ("${cmakeOutput}" MATCHES KDevelop3) add_test(Simple_KDevelop3Generator ${CMAKE_CTEST_COMMAND} @@ -407,9 +407,9 @@ if(BUILD_TESTING) --build-project Simple --test-command Simple) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_KDevelop3Generator") - endif ("${cmakeOutput}" MATCHES KDevelop3) + endif () - endif(${CMAKE_TEST_GENERATOR} MATCHES "Unix Makefiles" OR ${CMAKE_TEST_GENERATOR} MATCHES "KDevelop") + endif() # test for correct sub-project generation # not implemented in VS6 or Xcode @@ -454,11 +454,11 @@ if(BUILD_TESTING) ) set_tests_properties ( SubProject-Stage2 PROPERTIES DEPENDS SubProject) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubProject") - endif(NOT MSVC60 AND NOT XCODE AND NOT MSVC70) + endif() if (CMAKE_STRICT) ADD_TEST_MACRO(DocTest DocTest) - endif (CMAKE_STRICT) + endif () # macro to add a test that will build a nightly release # of CMake for given platform using the release scripts macro(ADD_NIGHTLY_BUILD_TEST name script) @@ -472,8 +472,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ add_test(${name} /bin/sh ${_TEST_DIR}/nightly-cmake.sh) if(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY) set_tests_properties (${name} PROPERTIES TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT}) - endif(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY) - endmacro(ADD_NIGHTLY_BUILD_TEST) + endif() + endmacro() if(CMAKE_BUILD_NIGHTLY_RELEASES) ADD_NIGHTLY_BUILD_TEST(CMakeNightlyWindows dash2win64_release.cmake) @@ -483,7 +483,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ dashmacmini5_release.cmake) ADD_NIGHTLY_BUILD_TEST(CMakeNightlyLinux magrathea_release.cmake) - endif(CMAKE_BUILD_NIGHTLY_RELEASES) + endif() # add tests with more complex invocations add_test(Framework ${CMAKE_CTEST_COMMAND} @@ -663,11 +663,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if (CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT CMAKE_CURRENT_BINARY_DIR MATCHES ".* .*") find_program(RPMBUILD NAMES rpmbuild) - endif(CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT CMAKE_CURRENT_BINARY_DIR MATCHES ".* .*") + endif() # Do not try to build RPM if (NOT RPMBUILD) set(CPACK_BINARY_RPM OFF) - endif(NOT RPMBUILD) + endif() find_program(NSIS_MAKENSIS_EXECUTABLE NAMES makensis PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS] @@ -680,21 +680,21 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if(WIN32) if(NSIS_MAKENSIS_EXECUTABLE) set(CTEST_RUN_CPackComponents ON) - else(NSIS_MAKENSIS_EXECUTABLE) + else() set(CTEST_RUN_CPackComponents OFF) set(CTEST_package_X11_TEST OFF) - endif(NSIS_MAKENSIS_EXECUTABLE) - endif(WIN32) + endif() + endif() if(CTEST_RUN_CPackComponents) set(CPackComponents_EXTRA_OPTIONS) if(APPLE) set(CPackComponents_EXTRA_OPTIONS -DCPACK_BINARY_DRAGNDROP:BOOL=ON) - endif(APPLE) + endif() if(NSIS_MAKENSIS_EXECUTABLE) set(CPackComponents_EXTRA_OPTIONS ${CPackComponents_EXTRA_OPTIONS} -DCPACK_BINARY_NSIS:BOOL=ON) - endif(NSIS_MAKENSIS_EXECUTABLE) + endif() add_test(CPackComponents ${CMAKE_CTEST_COMMAND} --build-and-test @@ -714,7 +714,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "-DCPackComponents_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/CPackComponents" -P "${CMake_SOURCE_DIR}/Tests/CPackComponents/VerifyResult.cmake") list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponents") - endif(CTEST_RUN_CPackComponents) + endif() if(CTEST_RUN_CPackComponentsForAll) # Check whether if rpmbuild command is found @@ -722,13 +722,13 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ find_program(RPMBUILD_EXECUTABLE NAMES rpmbuild) if(RPMBUILD_EXECUTABLE) list(APPEND ACTIVE_CPACK_GENERATORS RPM) - endif(RPMBUILD_EXECUTABLE) + endif() # Check whether if dpkg command is found # before adding DEB tests find_program(DPKG_EXECUTABLE NAMES dpkg) if(DPKG_EXECUTABLE) list(APPEND ACTIVE_CPACK_GENERATORS DEB) - endif(DPKG_EXECUTABLE) + endif() # ACTIVE_CPACK_GENERATORS variable # now contains the list of 'active generators' @@ -738,17 +738,17 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ list(APPEND GENLST "ZIP") if(APPLE) list(APPEND GENLST "DragNDrop") - endif(APPLE) + endif() if (NOT CMAKE_CURRENT_BINARY_DIR MATCHES ".* .*") list(FIND ACTIVE_CPACK_GENERATORS "RPM" RPM_ACTIVE) if (NOT ${RPM_ACTIVE} EQUAL -1) list(APPEND GENLST "RPM") - endif(NOT ${RPM_ACTIVE} EQUAL -1) - endif(NOT CMAKE_CURRENT_BINARY_DIR MATCHES ".* .*") + endif() + endif() list(FIND ACTIVE_CPACK_GENERATORS "DEB" DEB_ACTIVE) if (NOT ${DEB_ACTIVE} EQUAL -1) list(APPEND GENLST "DEB") - endif(NOT ${DEB_ACTIVE} EQUAL -1) + endif() # set up list of component packaging ways list(APPEND CWAYLST "default") @@ -778,9 +778,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CPackRun_CPackComponentWay}" -P "${CMake_SOURCE_DIR}/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake") list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/build${CPackGen}-${CPackComponentWay}") - endforeach(CPackComponentWay) - endforeach(CPackGen) - endif(CTEST_RUN_CPackComponentsForAll) + endforeach() + endforeach() + endif() # By default, turn this test off (because it takes a long time...) # @@ -797,7 +797,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ endif(CMAKE_CXX_FLAGS MATCHES "-ftest-coverage" OR NOT "$ENV{COVFILE}" STREQUAL "" OR CMAKE_RUN_LONG_TESTS) - endif(NOT DEFINED CTEST_RUN_CPackTestAllGenerators) + endif() if(CTEST_RUN_CPackTestAllGenerators) add_test(CPackTestAllGenerators ${CMAKE_CTEST_COMMAND} @@ -814,13 +814,13 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ -P ${CMake_SOURCE_DIR}/Tests/CPackTestAllGenerators/RunCPack.cmake ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackTestAllGenerators") - endif(CTEST_RUN_CPackTestAllGenerators) + endif() if(CTEST_package_X11_TEST) set(X11_build_target_arg --build-target package) - else(CTEST_package_X11_TEST) + else() set(X11_build_target_arg) - endif(CTEST_package_X11_TEST) + endif() add_test(X11 ${CMAKE_CTEST_COMMAND} --build-and-test @@ -836,7 +836,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if(NOT DEFINED CTEST_RUN_CMakeTestAllGenerators) set(CTEST_RUN_CMakeTestAllGenerators ON) - endif(NOT DEFINED CTEST_RUN_CMakeTestAllGenerators) + endif() if(CTEST_RUN_CMakeTestAllGenerators) add_test(CMakeTestAllGenerators ${CMAKE_CMAKE_COMMAND} @@ -846,11 +846,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CMakeTestAllGenerators") - endif(CTEST_RUN_CMakeTestAllGenerators) + endif() if(NOT DEFINED CTEST_RUN_CMakeTestBadCommandLines) set(CTEST_RUN_CMakeTestBadCommandLines ON) - endif(NOT DEFINED CTEST_RUN_CMakeTestBadCommandLines) + endif() if(CTEST_RUN_CMakeTestBadCommandLines) add_test(CMakeTestBadCommandLines ${CMAKE_CMAKE_COMMAND} @@ -861,11 +861,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CMakeTestBadCommandLines") - endif(CTEST_RUN_CMakeTestBadCommandLines) + endif() if(NOT DEFINED CTEST_RUN_CMakeTestMultipleConfigures) set(CTEST_RUN_CMakeTestMultipleConfigures ON) - endif(NOT DEFINED CTEST_RUN_CMakeTestMultipleConfigures) + endif() if(CTEST_RUN_CMakeTestMultipleConfigures) add_test(CMakeTestMultipleConfigures ${CMAKE_CMAKE_COMMAND} @@ -876,7 +876,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CMakeTestMultipleConfigures") - endif(CTEST_RUN_CMakeTestMultipleConfigures) + endif() add_test(LoadedCommandOneConfig ${CMAKE_CTEST_COMMAND} --build-and-test @@ -987,7 +987,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-project Tutorial --test-command Tutorial 25.0) - endforeach(STP) + endforeach() list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Tutorial") add_test(testing ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE} @@ -1081,12 +1081,12 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ set(_DLL_PATH "$ENV{DLL_PATH}") if(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.(:.*)?$") message(FATAL_ERROR "In order to successfully run the CMake test suite on Syllable you need to add \"\\@bindir\\@/.\" to the DLL_PATH environment variable") - endif(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.(:.*)?$") + endif() if(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.\\./lib(:.*)?$") message(FATAL_ERROR "In order to successfully run the CMake test suite on Syllable you need to add \"\\@bindir\\@/../lib\" to the DLL_PATH environment variable") - endif(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.\\./lib(:.*)?$") + endif() - else("${CMAKE_SYSTEM_NAME}" MATCHES syllable) + else() add_test(JumpWithLibOut ${CMAKE_CTEST_COMMAND} --build-and-test @@ -1127,8 +1127,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG) ADD_TEST_MACRO(RuntimePath RuntimePath) - endif(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG) - endif("${CMAKE_SYSTEM_NAME}" MATCHES syllable) + endif() + endif() add_test(linkorder1 ${CMAKE_CTEST_COMMAND} --build-and-test @@ -1184,7 +1184,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --test-command kwsysTestsCxx testIOS ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/kwsys") - endif(NOT CMAKE_TEST_DIFFERENT_GENERATOR) + endif() set(MAKE_IS_GNU ) if(${CMAKE_TEST_MAKEPROGRAM} MATCHES make) exec_program( @@ -1194,9 +1194,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if("${res}" EQUAL 0) if("${out}" MATCHES "GNU") set(MAKE_IS_GNU 1) - endif("${out}" MATCHES "GNU") - endif("${res}" EQUAL 0) - endif(${CMAKE_TEST_MAKEPROGRAM} MATCHES make) + endif() + endif() + endif() # only add this test on platforms that support it # some old versions of make simply cannot handle spaces in paths @@ -1234,7 +1234,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere" "${CMake_BINARY_DIR}/Tests/SubDir/testfromsubdir.obj" ) - else (WIN32) + else () add_test(SubDir ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/SubDir" @@ -1247,7 +1247,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere" "${CMake_BINARY_DIR}/Tests/SubDir/testfromsubdir.o" ) - endif (WIN32) + endif () list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubDir") if(CMAKE_TEST_MSVC) @@ -1273,7 +1273,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --test-command check_clean ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MakeClean") - endif("${CMAKE_TEST_GENERATOR}" MATCHES "Makefile") + endif() if(NOT DEFINED CTEST_RUN_MFC) set(CTEST_RUN_MFC OFF) @@ -1383,7 +1383,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if(${CMAKE_TEST_GENERATOR} MATCHES "Visual Studio") if(NOT MSVC60) ADD_TEST_MACRO(SBCS SBCS) - endif(NOT MSVC60) + endif() add_test(VSExternalInclude ${CMAKE_CTEST_COMMAND} --build-and-test @@ -1406,7 +1406,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --test-command VSMidl) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSMidl") - endif(${CMAKE_TEST_GENERATOR} MATCHES "Visual Studio") + endif() if (APPLE) if (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") @@ -1444,8 +1444,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CFBundleTest") ADD_TEST_MACRO(ObjC++ ObjC++) - endif (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") - endif (APPLE) + endif () + endif () if(APPLE AND CTEST_TEST_CPACK) add_test(BundleGeneratorTest ${CMAKE_CTEST_COMMAND} @@ -1460,7 +1460,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-options "-DCMAKE_INSTALL_PREFIX:PATH=${CMake_BINARY_DIR}/Tests/BundleGeneratorTest/InstallDirectory" ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleGeneratorTest") - endif(APPLE AND CTEST_TEST_CPACK) + endif() add_test(WarnUnusedUnusedViaSet ${CMAKE_CTEST_COMMAND} --build-and-test @@ -1570,8 +1570,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ mark_as_advanced(Subversion_SVNADMIN_EXECUTABLE) if(NOT Subversion_SVNADMIN_EXECUTABLE) set(Subversion_FOUND FALSE) - endif(NOT Subversion_SVNADMIN_EXECUTABLE) - endif(Subversion_FOUND) + endif() + endif() if(Subversion_FOUND) set(CTestUpdateSVN_DIR "CTest UpdateSVN") configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateSVN.cmake.in" @@ -1580,22 +1580,22 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ -P "${CMake_BINARY_DIR}/Tests/CTestUpdateSVN.cmake" ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateSVN_DIR}") - endif(Subversion_FOUND) + endif() # Test CTest Update with CVS if(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake) find_package(CVS QUIET) - else(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake) + else() find_program(CVS_EXECUTABLE NAMES cvs) set(CVS_FOUND ${CVS_EXECUTABLE}) - endif(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake) + endif() set(CTEST_TEST_UPDATE_CVS ${CVS_FOUND}) if(CTEST_TEST_UPDATE_CVS AND NOT UNIX) if("${CVS_EXECUTABLE}" MATCHES "cygwin") message(STATUS "No CTest.UpdateCVS test with cygwin cvs.exe outside cygwin!") set(CTEST_TEST_UPDATE_CVS 0) - endif("${CVS_EXECUTABLE}" MATCHES "cygwin") - endif(CTEST_TEST_UPDATE_CVS AND NOT UNIX) + endif() + endif() if(CTEST_TEST_UPDATE_CVS) set(CTestUpdateCVS_DIR "CTest UpdateCVS") configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateCVS.cmake.in" @@ -1604,7 +1604,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ -P "${CMake_BINARY_DIR}/Tests/CTestUpdateCVS.cmake" ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateCVS_DIR}") - endif(CTEST_TEST_UPDATE_CVS) + endif() # Test CTest Update with BZR find_program(BZR_EXECUTABLE NAMES bzr) @@ -1613,8 +1613,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if(BZR_EXECUTABLE) if(NOT "${BZR_EXECUTABLE}" MATCHES "cygwin" OR UNIX) set(CTEST_TEST_UPDATE_BZR 1) - endif(NOT "${BZR_EXECUTABLE}" MATCHES "cygwin" OR UNIX) - endif(BZR_EXECUTABLE) + endif() + endif() if(CTEST_TEST_UPDATE_BZR) # Check if xmloutput plugin is there execute_process(COMMAND ${BZR_EXECUTABLE} xmlplugins RESULT_VARIABLE xmlplugres @@ -1635,8 +1635,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ) set_tests_properties(CTest.UpdateBZR.CLocale PROPERTIES ENVIRONMENT LC_ALL=C) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateBZR_DIR}") - endif( NOT ${xmlplugres} ) - endif(CTEST_TEST_UPDATE_BZR) + endif() + endif() # Test CTest Update with GIT find_program(GIT_EXECUTABLE NAMES git) @@ -1645,8 +1645,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if(GIT_EXECUTABLE) if(NOT "${GIT_EXECUTABLE}" MATCHES "cygwin" OR UNIX) set(CTEST_TEST_UPDATE_GIT 1) - endif(NOT "${GIT_EXECUTABLE}" MATCHES "cygwin" OR UNIX) - endif(GIT_EXECUTABLE) + endif() + endif() if(CTEST_TEST_UPDATE_GIT) set(CTestUpdateGIT_DIR "CTest UpdateGIT") configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateGIT.cmake.in" @@ -1655,7 +1655,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ -P "${CMake_BINARY_DIR}/Tests/CTestUpdateGIT.cmake" ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateGIT_DIR}") - endif(CTEST_TEST_UPDATE_GIT) + endif() # Test CTest Update with HG find_program(HG_EXECUTABLE NAMES hg) @@ -1664,8 +1664,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if(HG_EXECUTABLE) if(NOT "${HG_EXECUTABLE}" MATCHES "cygwin" OR UNIX) set(CTEST_TEST_UPDATE_HG 1) - endif(NOT "${HG_EXECUTABLE}" MATCHES "cygwin" OR UNIX) - endif(HG_EXECUTABLE) + endif() + endif() if(CTEST_TEST_UPDATE_HG) set(CTestUpdateHG_DIR "CTest UpdateHG") configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateHG.cmake.in" @@ -1674,8 +1674,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ -P "${CMake_BINARY_DIR}/Tests/CTestUpdateHG.cmake" ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateHG_DIR}") - endif(CTEST_TEST_UPDATE_HG) - endif(CTEST_TEST_UPDATE) + endif() + endif() configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestFailure/testNoBuild.cmake.in" @@ -1841,10 +1841,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if(CMAKE_TEST_GENERATOR MATCHES "Watcom WMake") set_tests_properties(CTestTestCrash PROPERTIES PASS_REGULAR_EXPRESSION "Failed") - else(CMAKE_TEST_GENERATOR MATCHES "Watcom WMake") + else() set_tests_properties(CTestTestCrash PROPERTIES PASS_REGULAR_EXPRESSION "(Illegal|SegFault)") - endif(CMAKE_TEST_GENERATOR MATCHES "Watcom WMake") + endif() configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestBadExe/test.cmake.in" @@ -2055,14 +2055,14 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ set(protocol "${CMAKE_MATCH_1}") set(server "${CMAKE_MATCH_2}") set(path "${CMAKE_MATCH_3}") - else ("${CMAKE_TESTS_CDASH_SERVER}" MATCHES "${regex}") + else () set(protocol "http") set(server "www.cdash.org") set(path "/CDash") message("warning: CMAKE_TESTS_CDASH_SERVER does not match expected regex...") message(" ...using default url='${protocol}://${server}${path}' for CTestTest[23]") - endif ("${CMAKE_TESTS_CDASH_SERVER}" MATCHES "${regex}") - endif (CMAKE_TESTS_CDASH_SERVER) + endif () + endif () if (CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS AND CMAKE_TESTS_CDASH_SERVER) @@ -2097,40 +2097,40 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) set_tests_properties ( CTestTest PROPERTIES TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT}) - endif ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) + endif () get_test_property(CTestTest2 TIMEOUT PREVIOUS_TIMEOUT) if ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) set_tests_properties ( CTestTest2 PROPERTIES TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT}) - endif ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) - endif (CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS AND CMAKE_TESTS_CDASH_SERVER) + endif () + endif () if (CMAKE_RUN_LONG_TESTS AND TEST_KDE4_STABLE_BRANCH) if(UNIX) if(NOT QT4_FOUND) find_package(Qt4) - endif(NOT QT4_FOUND) + endif() set(TRY_BUILD_KDE4 TRUE) if(QT4_FOUND) # check whether it's Qt 4.5 in a cmake 2.4. compatible way: if(NOT EXISTS "${QT_QTNETWORK_INCLUDE_DIR}/QAbstractNetworkCache") set(TRY_BUILD_KDE4 FALSE) - endif(NOT EXISTS "${QT_QTNETWORK_INCLUDE_DIR}/QAbstractNetworkCache") - else(QT4_FOUND) + endif() + else() set(TRY_BUILD_KDE4 FALSE) - endif(QT4_FOUND) + endif() find_package(Perl) if(NOT PERL_FOUND) set(TRY_BUILD_KDE4 FALSE) - endif(NOT PERL_FOUND) + endif() find_package(ZLIB) if(NOT ZLIB_FOUND) set(TRY_BUILD_KDE4 FALSE) - endif(NOT ZLIB_FOUND) + endif() if(TRY_BUILD_KDE4) file(MAKE_DIRECTORY ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest) @@ -2138,18 +2138,18 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ configure_file(${CMake_SOURCE_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh.in ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh @ONLY) execute_process(COMMAND chmod 755 ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh ) add_test(KDE4StableBranchTest ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh) - endif(TRY_BUILD_KDE4) + endif() - endif(UNIX) - endif (CMAKE_RUN_LONG_TESTS AND TEST_KDE4_STABLE_BRANCH) + endif() + endif () if("${CMAKE_TEST_GENERATOR}" MATCHES Xcode) set(CMAKE_SKIP_BOOTSTRAP_TEST 1) - endif("${CMAKE_TEST_GENERATOR}" MATCHES Xcode) + endif() if(EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt") # If there is CMakeLists.txt in the binary tree, assume in-source build set(CMAKE_SKIP_BOOTSTRAP_TEST 1) - endif(EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt") + endif() set(bootstrap "") if(CMAKE_RUN_LONG_TESTS AND NOT CMAKE_SKIP_BOOTSTRAP_TEST) if(UNIX) @@ -2180,7 +2180,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) set_tests_properties ( BootstrapTest PROPERTIES TIMEOUT 5400) - endif ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) + endif () endif() if(CMAKE_Fortran_COMPILER) @@ -2237,7 +2237,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-run-dir "${CMake_BINARY_DIR}/Tests/Java/" --test-command ${JAVA_RUNTIME} -classpath hello.jar HelloWorld) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Java") - endif("${JNI_FILE}" MATCHES "JDK1_2") + endif() endif() endif() @@ -2259,7 +2259,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "-DCMAKE_SYSTEM_NAME=Generic" "-DCMAKE_C_COMPILER=${SDCC_EXECUTABLE}") list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleCOnly_sdcc") - endif(SDCC_EXECUTABLE) + endif() # If a Linux -> MinGW cross compiler is found then try it find_program(MINGW_CC_LINUX2WIN_EXECUTABLE i586-mingw32msvc-gcc) @@ -2282,7 +2282,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_Mingw_Linux2Win") endif() - endif(CMAKE_TEST_GENERATOR MATCHES "Makefiles" OR CMAKE_TEST_GENERATOR MATCHES "KDevelop") + endif() if(UNIX) string(COMPARE EQUAL "${CMAKE_INSTALL_PREFIX}" "${CMake_BINARY_DIR}/Tests/TestShellInstall/Prefix" @@ -2294,36 +2294,36 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ @ONLY IMMEDIATE ) add_test(ShellInstall /bin/sh ${CMake_BINARY_DIR}/Tests/TestShellInstall/TestShellInstall.sh) - endif(PREFIX_IS_FOR_TEST) - endif(UNIX) + endif() + endif() if(CMAKE_TEST_PROJECT_CSE_DIR) set(script "${CMAKE_TEST_PROJECT_CSE_DIR}/BuildProjectCSE.cmake") if(NOT EXISTS "${script}") set(script "${CMAKE_TEST_PROJECT_CSE_DIR}/cse_build.cmake") - endif(NOT EXISTS "${script}") + endif() if(NOT EXISTS "${script}") message("warning: CMAKE_TEST_PROJECT_CSE_DIR set, but no build script found...") - endif(NOT EXISTS "${script}") + endif() add_test(BuildCSE ${CMAKE_CTEST_COMMAND} -V -S "${script}") set_tests_properties(BuildCSE PROPERTIES TIMEOUT 5400) - endif(CMAKE_TEST_PROJECT_CSE_DIR) + endif() if(CMAKE_TEST_PLPLOT_DIR) add_test(plplot ${CMAKE_CTEST_COMMAND} -V -S ${CMAKE_TEST_PLPLOT_DIR}/../../EasyDashboardScripts/plplot.cmake ) set_tests_properties ( plplot PROPERTIES TIMEOUT 5400) - endif(CMAKE_TEST_PLPLOT_DIR) + endif() if(CMAKE_TEST_CHICKEN_DIR) add_test(Chicken ${CMAKE_CTEST_COMMAND} -V -S ${CMAKE_TEST_CHICKEN_DIR}/../../EasyDashboardScripts/Chicken.cmake ) set_tests_properties ( Chicken PROPERTIES TIMEOUT 5400) - endif(CMAKE_TEST_CHICKEN_DIR) + endif() if(CMAKE_TEST_KDELIBS_ALPHA_1_DIR) add_test(KDELibsAlpha1 ${CMAKE_CTEST_COMMAND} -V -S ${CMAKE_TEST_KDELIBS_ALPHA_1_DIR}/../../EasyDashboardScripts/kdelibs.cmake ) set_tests_properties ( KDELibsAlpha1 PROPERTIES TIMEOUT 5400) - endif(CMAKE_TEST_KDELIBS_ALPHA_1_DIR) + endif() # If this is not an in-source build, provide a target to wipe out # all the test build directories. @@ -2334,7 +2334,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ COMMAND ${CMAKE_COMMAND} -P ${CMake_BINARY_DIR}/Tests/test_clean.cmake COMMENT "Removing test build directories." ) - endif(NOT EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt") + endif() add_test(CMakeWizardTest ${CMAKE_CMAKE_COMMAND} -D build_dir:STRING=${CMAKE_CURRENT_BINARY_DIR}/CMakeWizardTest @@ -2399,6 +2399,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ set_tests_properties(KWStyle PROPERTIES WORKING_DIRECTORY ${CMake_BINARY_DIR}/Utilities/KWStyle) endif() -endif(BUILD_TESTING) +endif() subdirs(CMakeTests) diff --git a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt index 551cee3..fb0bd15 100644 --- a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt +++ b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt @@ -13,7 +13,7 @@ file(GLOB FIND_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../Modules/Find*.cmake macro(do_find MODULE_NAME) message(STATUS " Checking Find${MODULE_NAME}") find_package(${MODULE_NAME}) -endmacro(do_find) +endmacro() # It is only possible to use either Qt3 or Qt4 in one project. # Since FindQt will complain if both are found we explicitly request Qt4 here @@ -35,15 +35,15 @@ foreach(FIND_MODULE ${FIND_MODULES}) do_find(${MODULE_NAME}) endif () -endforeach(FIND_MODULE) +endforeach() # Qt4 is not present, so we can check Qt3 if (NOT QT4_FOUND) set(DESIRED_QT_VERSION 3) foreach(FIND_MODULE ${NO_QT4_MODULES} "Qt") do_find(${FIND_MODULE}) - endforeach(FIND_MODULE) -endif (NOT QT4_FOUND) + endforeach() +endif () macro(check_version_string MODULE_NAME VERSION_VAR) if (${MODULE_NAME}_FOUND) @@ -65,7 +65,7 @@ macro(check_version_string MODULE_NAME VERSION_VAR) message(SEND_ERROR "${MODULE_NAME}_FOUND is set but version number variable ${VERSION_VAR} is NOT DEFINED") endif() endif () -endmacro(check_version_string) +endmacro() # If any of these modules reported that it was found a version number should have been # reported. @@ -73,12 +73,12 @@ endmacro(check_version_string) foreach(VTEST ALSA ARMADILLO BZIP2 CUPS CURL EXPAT FREETYPE GETTEXT GIT HSPELL JASPER LIBLZMA LIBXML2 LIBXSLT PERL PKG_CONFIG PostgreSQL TIFF ZLIB) check_version_string(${VTEST} ${VTEST}_VERSION_STRING) -endforeach(VTEST) +endforeach() foreach(VTEST BISON Boost CUDA DOXYGEN FLEX GIF GTK2 LibArchive OPENSCENEGRAPH RUBY SWIG) check_version_string(${VTEST} ${VTEST}_VERSION) -endforeach(VTEST) +endforeach() check_version_string(PYTHONINTERP PYTHON_VERSION_STRING) check_version_string(SUBVERSION Subversion_VERSION_SVN) diff --git a/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt b/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt index 70c186c..9528aa3 100644 --- a/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt +++ b/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt @@ -23,7 +23,7 @@ foreach(_config_type Release RelWithDebInfo MinSizeRel Debug) if (CSE_RESULT_${_config_type}) message(SEND_ERROR "CheckCXXSymbolExists reported a nonexistent symbol as existing in configuration ${_config_type}") - endif (CSE_RESULT_${_config_type}) + endif () endforeach() set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE}) @@ -42,12 +42,12 @@ if (NOT CSE_RESULT_ERRNO_CERRNO) if (NOT CSE_RESULT_ERRNO_ERRNOH) message(SEND_ERROR "CheckCXXSymbolExists did not find errno in <cerrno> and <errno.h>") - else (NOT CSE_RESULT_ERRNO_ERRNOH) + else () message(STATUS "errno found in <errno.h>") - endif (NOT CSE_RESULT_ERRNO_ERRNOH) -else (NOT CSE_RESULT_ERRNO_CERRNO) + endif () +else () message(STATUS "errno found in <cerrno>") -endif (NOT CSE_RESULT_ERRNO_CERRNO) +endif () if (CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3") @@ -58,5 +58,5 @@ if (CMAKE_COMPILER_IS_GNUCXX) if (CSE_RESULT_O3) message(SEND_ERROR "CheckCXXSymbolExists reported a nonexistent symbol as existing with optimization -O3") - endif (CSE_RESULT_O3) -endif (CMAKE_COMPILER_IS_GNUCXX) + endif () +endif () diff --git a/Tests/CMakeOnly/CheckSymbolExists/CMakeLists.txt b/Tests/CMakeOnly/CheckSymbolExists/CMakeLists.txt index acf0d2d..7656577 100644 --- a/Tests/CMakeOnly/CheckSymbolExists/CMakeLists.txt +++ b/Tests/CMakeOnly/CheckSymbolExists/CMakeLists.txt @@ -24,7 +24,7 @@ foreach(_config_type Release RelWithDebInfo MinSizeRel Debug) if (CSE_RESULT_${_config_type}) message(SEND_ERROR "CheckSymbolExists reported a nonexistent symbol as existing in configuration ${_config_type}") - endif (CSE_RESULT_${_config_type}) + endif () endforeach() set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE}) @@ -34,9 +34,9 @@ check_symbol_exists(errno "errno.h" CSE_RESULT_ERRNO) if (NOT CSE_RESULT_ERRNO) message(SEND_ERROR "CheckSymbolExists did not find errno in <errno.h>") -else (NOT CSE_RESULT_ERRNO) +else () message(STATUS "errno found as expected") -endif (NOT CSE_RESULT_ERRNO) +endif () if (CMAKE_COMPILER_IS_GNUCC) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3") @@ -47,5 +47,5 @@ if (CMAKE_COMPILER_IS_GNUCC) if (CSE_RESULT_O3) message(SEND_ERROR "CheckSymbolExists reported a nonexistent symbol as existing with optimization -O3") - endif (CSE_RESULT_O3) -endif (CMAKE_COMPILER_IS_GNUCC) + endif () +endif () diff --git a/Tests/CMakeTestMultipleConfigures/RunCMake.cmake b/Tests/CMakeTestMultipleConfigures/RunCMake.cmake index 19391d7..9632664 100644 --- a/Tests/CMakeTestMultipleConfigures/RunCMake.cmake +++ b/Tests/CMakeTestMultipleConfigures/RunCMake.cmake @@ -143,7 +143,7 @@ function(analyze_directory_diffs d1 d2 diff_count_var) endif() set(${diff_count_var} ${diffs} PARENT_SCOPE) -endfunction(analyze_directory_diffs) +endfunction() # Analyze diffs between b1:b2, b2:b3, b3:b4, b4:b5 ... bN-1:bN. diff --git a/Tests/CMakeTests/CMakeLists.txt b/Tests/CMakeTests/CMakeLists.txt index fadcc1e..d34d4a6 100644 --- a/Tests/CMakeTests/CMakeLists.txt +++ b/Tests/CMakeTests/CMakeLists.txt @@ -6,7 +6,7 @@ macro(AddCMakeTest TestName PreArgs) "${CMAKE_CURRENT_BINARY_DIR}/${TestName}Test.cmake" @ONLY IMMEDIATE) add_test(CMake.${TestName} ${CMAKE_EXECUTABLE} ${PreArgs} -P "${CMAKE_CURRENT_BINARY_DIR}/${TestName}Test.cmake" ${ARGN}) -endmacro(AddCMakeTest) +endmacro() AddCMakeTest(List "") diff --git a/Tests/CMakeTests/FindBaseTest.cmake.in b/Tests/CMakeTests/FindBaseTest.cmake.in index 47c1692..658b350 100644 --- a/Tests/CMakeTests/FindBaseTest.cmake.in +++ b/Tests/CMakeTests/FindBaseTest.cmake.in @@ -12,7 +12,7 @@ set(_HEADER_FULL_A "${MY_SOURCE_DIR}/A/include/${_HEADER}") find_file(FOO_H_1 ${_HEADER}) if(FOO_H_1) message(FATAL_ERROR "${_HEADER} found: ${FOO_H_1}, it should not exist !") -endif(FOO_H_1) +endif() # The HINTS option should override the system but the PATHS option # should not. @@ -21,10 +21,10 @@ find_file(TEST_H_1 ${_HEADER} HINTS ${MY_SOURCE_DIR}/A/include) find_file(TEST_H_2 ${_HEADER} PATHS ${MY_SOURCE_DIR}/A/include) if(NOT "${TEST_H_1}" STREQUAL "${_HEADER_FULL_A}") message(FATAL_ERROR "Did not find \"${_HEADER_FULL_A}\"\ngot \"${TEST_H_1}\" instead!") -endif(NOT "${TEST_H_1}" STREQUAL "${_HEADER_FULL_A}") +endif() if(NOT "${TEST_H_2}" STREQUAL "${_HEADER_FULL}") message(FATAL_ERROR "Did not find \"${_HEADER_FULL}\"\ngot \"${TEST_H_2}\" instead!") -endif(NOT "${TEST_H_2}" STREQUAL "${_HEADER_FULL}") +endif() set(CMAKE_SYSTEM_PREFIX_PATH) # with this it still should not be found, since the include/ subdir is still missing @@ -32,20 +32,20 @@ set(CMAKE_INCLUDE_PATH "${MY_SOURCE_DIR}") find_file(FOO_H_2 ${_HEADER}) if(FOO_H_2) message(FATAL_ERROR "${_HEADER} found: ${FOO_H_2}, it should not exist !") -endif(FOO_H_2) +endif() # now with the PATH_SUFFIX it should be found find_file(FOO_H_3 NAMES ${_HEADER} PATH_SUFFIXES include ) if(NOT "${FOO_H_3}" STREQUAL "${_HEADER_FULL}") message(FATAL_ERROR "Did not find \"${_HEADER_FULL}\"\ngot ${FOO_H_3} instead !") -endif(NOT "${FOO_H_3}" STREQUAL "${_HEADER_FULL}") +endif() # without PATH_SUFFIX, but with a CMAKE_INCLUDE_PATH it should not be found set(CMAKE_INCLUDE_PATH /include) find_file(FOO_H_4 ${_HEADER}) if(FOO_H_4) message(FATAL_ERROR "${_HEADER} found: ${FOO_H_4}, it should not exist !") -endif(FOO_H_4) +endif() # when setting CMAKE_FIND_ROOT_PATH to the current source dir, # together with the CMAKE_INCLUDE_PATH it should be found @@ -53,10 +53,10 @@ set(CMAKE_FIND_ROOT_PATH blub "${MY_SOURCE_DIR}") find_file(FOO_H_5 ${_HEADER}) if(NOT "${FOO_H_5}" STREQUAL "${_HEADER_FULL}") message(FATAL_ERROR "Did not find \"${_HEADER_FULL}\"\ngot ${FOO_H_5} instead !") -endif(NOT "${FOO_H_5}" STREQUAL "${_HEADER_FULL}") +endif() # by explicitly disabling CMAKE_FIND_ROOT_PATH again it shouldn't be found find_file(FOO_H_6 ${_HEADER} NO_CMAKE_FIND_ROOT_PATH) if(FOO_H_6) message(FATAL_ERROR "${_HEADER} found: ${FOO_H_6}, it should not exist !") -endif(FOO_H_6) +endif() diff --git a/Tests/CMakeTests/GetFilenameComponentRealpathTest.cmake.in b/Tests/CMakeTests/GetFilenameComponentRealpathTest.cmake.in index 7adc240..22f6afd 100644 --- a/Tests/CMakeTests/GetFilenameComponentRealpathTest.cmake.in +++ b/Tests/CMakeTests/GetFilenameComponentRealpathTest.cmake.in @@ -66,7 +66,7 @@ if(UNIX) if(EXISTS file1 OR EXISTS file2) message(FATAL_ERROR "removal of file1 or file2 failed") endif() - endif(LN) + endif() file(REMOVE ${bindir}/file3) endif() diff --git a/Tests/CMakeTests/GetPrerequisitesTest.cmake.in b/Tests/CMakeTests/GetPrerequisitesTest.cmake.in index daf467b..89ca735 100644 --- a/Tests/CMakeTests/GetPrerequisitesTest.cmake.in +++ b/Tests/CMakeTests/GetPrerequisitesTest.cmake.in @@ -58,7 +58,7 @@ function(stresstest_list_prerequisites file) message(STATUS "=============================================================================") message(STATUS "") -endfunction(stresstest_list_prerequisites) +endfunction() function(test_cmake_executables) @@ -68,7 +68,7 @@ function(test_cmake_executables) get_filename_component(cmake_bin_dir "${CMAKE_COMMAND}" PATH) list_prerequisites_by_glob(GLOB "${cmake_bin_dir}/*" 0 0 1) -endfunction(test_cmake_executables) +endfunction() message(STATUS "=============================================================================") @@ -93,7 +93,7 @@ if(do_testdefaults) message(STATUS "") list_prerequisites("${CMAKE_COMMAND}") message(STATUS "") -endif(do_testdefaults) +endif() set(do_stresstest 0) @@ -103,7 +103,7 @@ if(do_stresstest) message(STATUS "") stresstest_list_prerequisites("${CMAKE_COMMAND}") message(STATUS "") -endif(do_stresstest) +endif() test_cmake_executables() @@ -141,7 +141,7 @@ message(STATUS "") get_cmake_property(vs VARIABLES) foreach(v ${vs}) message(STATUS "${v}='${${v}}'") -endforeach(v) +endforeach() message(STATUS "") message(STATUS "=============================================================================") diff --git a/Tests/CMakeTests/IncludeTest.cmake.in b/Tests/CMakeTests/IncludeTest.cmake.in index eca679b..985333c 100644 --- a/Tests/CMakeTests/IncludeTest.cmake.in +++ b/Tests/CMakeTests/IncludeTest.cmake.in @@ -9,18 +9,18 @@ set(fileTwo "${CMAKE_ROOT}/Modules/CMake.cmake") if(WIN32) string(TOLOWER "${fileOne}" fileOne) string(TOLOWER "${fileTwo}" fileTwo) -endif(WIN32) +endif() if(NOT "${fileOne}" STREQUAL "${fileTwo}") message(FATAL_ERROR "Wrong CMake.cmake was included: \"${fileOne}\" expected \"${fileTwo}\"") -endif(NOT "${fileOne}" STREQUAL "${fileTwo}") +endif() # this one must return NOTFOUND in _includedFile include(I_do_not_exist OPTIONAL RESULT_VARIABLE _includedFile) if(_includedFile) message(FATAL_ERROR "File \"I_do_not_exist\" was included, although it shouldn't exist,\nIncluded file is \"${_includedFile}\"") -endif(_includedFile) +endif() # and this one must succeed too include(CMake OPTIONAL RESULT_VARIABLE _includedFile) @@ -29,11 +29,11 @@ set(fileTwo "${CMAKE_ROOT}/Modules/CMake.cmake") if(WIN32) string(TOLOWER "${fileOne}" fileOne) string(TOLOWER "${fileTwo}" fileTwo) -endif(WIN32) +endif() if(NOT "${fileOne}" STREQUAL "${fileTwo}") message(FATAL_ERROR "Wrong CMake.cmake was included: \"${fileOne}\" expected \"${fileTwo}\"") -endif(NOT "${fileOne}" STREQUAL "${fileTwo}") +endif() # Check that CMAKE_CURRENT_LIST_DIR is working: # Needs to be a file in the build tree, which is correct cmake script diff --git a/Tests/CMakeTests/ListTest.cmake.in b/Tests/CMakeTests/ListTest.cmake.in index 5db171c..07fc7c6 100644 --- a/Tests/CMakeTests/ListTest.cmake.in +++ b/Tests/CMakeTests/ListTest.cmake.in @@ -1,10 +1,10 @@ macro(TEST command expected) if("x${result}" STREQUAL "x${expected}") #message("TEST \"${command}\" success: \"${result}\" expected: \"${expected}\"") - else("x${result}" STREQUAL "x${expected}") + else() message(SEND_ERROR "${CMAKE_CURRENT_LIST_LINE}: TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"") - endif("x${result}" STREQUAL "x${expected}") -endmacro(TEST command expected) + endif() +endmacro() set(mylist andy bill ken brad) diff --git a/Tests/CMakeTests/StringTestScript.cmake b/Tests/CMakeTests/StringTestScript.cmake index 7a264a0..a562e71 100644 --- a/Tests/CMakeTests/StringTestScript.cmake +++ b/Tests/CMakeTests/StringTestScript.cmake @@ -236,42 +236,42 @@ elseif(testname STREQUAL string_find_with_no_possible_result) # pass message(STATUS "v='${v}'") if(NOT(-1 EQUAL ${v})) message(SEND_ERROR "FIND sub-command should return -1 but returned ${v}.") - endif(NOT(-1 EQUAL ${v})) + endif() elseif(testname STREQUAL string_find_reverse_with_no_possible_result) # pass string(FIND "CMake is a great application." "z" v REVERSE) message(STATUS "v='${v}'") if(NOT(-1 EQUAL ${v})) message(SEND_ERROR "FIND REVERSE sub-command should return -1 but returned ${v}.") - endif(NOT(-1 EQUAL ${v})) + endif() elseif(testname STREQUAL string_find_with_required_result) # pass string(FIND "CMake is a great application." "g" v) message(STATUS "v='${v}'") if(NOT(11 EQUAL ${v})) message(SEND_ERROR "FIND sub-command should return 11 but returned ${v}.") - endif(NOT(11 EQUAL ${v})) + endif() elseif(testname STREQUAL string_find_reverse_with_required_result) # pass string(FIND "CMake is a great application." "e" v REVERSE) message(STATUS "v='${v}'") if(NOT(13 EQUAL ${v})) message(SEND_ERROR "FIND REVERSE sub-command should return 13 but returned ${v}.") - endif(NOT(13 EQUAL ${v})) + endif() elseif(testname STREQUAL string_find_word_reverse_with_required_result) # pass string(FIND "The command should find REVERSE in this string. Or maybe this REVERSE?!" "REVERSE" v) message(STATUS "v='${v}'") if(NOT(24 EQUAL ${v})) message(SEND_ERROR "FIND sub-command should return 24 but returned ${v}.") - endif(NOT(24 EQUAL ${v})) + endif() elseif(testname STREQUAL string_find_reverse_word_reverse_with_required_result) # pass string(FIND "The command should find REVERSE in this string. Or maybe this REVERSE?!" "REVERSE" v REVERSE) message(STATUS "v='${v}'") if(NOT(62 EQUAL ${v})) message(SEND_ERROR "FIND sub-command should return 62 but returned ${v}.") - endif(NOT(62 EQUAL ${v})) + endif() else() # fail message(FATAL_ERROR "testname='${testname}' - error: no such test in '${CMAKE_CURRENT_LIST_FILE}'") diff --git a/Tests/CMakeTests/ToolchainTest.cmake.in b/Tests/CMakeTests/ToolchainTest.cmake.in index cd258db..c010fca 100644 --- a/Tests/CMakeTests/ToolchainTest.cmake.in +++ b/Tests/CMakeTests/ToolchainTest.cmake.in @@ -4,7 +4,7 @@ # overwrite mark_as_advanced(), since this is used in CMakeDetermineCCompiler.cmake # which will complain that it can"t be used in script mode macro(MARK_AS_ADVANCED) -endmacro(MARK_AS_ADVANCED) +endmacro() # set this to a place where we are allowed to write set(CMAKE_PLATFORM_ROOT_BIN "${CMAKE_CURRENT_BINARY_DIR}") @@ -21,19 +21,19 @@ include(CMakeDetermineSystem) # check that CMAKE_SYSTEM_XXX and CMAKE_HOST_SYSTEM_xxx are identical if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "${CMAKE_HOST_SYSTEM_NAME}") message(FATAL_ERROR "CMAKE_SYSTEM_NAME and CMAKE_HOST_SYSTEM_NAME not identical: \"${CMAKE_SYSTEM_NAME}\" vs. \"${CMAKE_HOST_SYSTEM_NAME}\"") -endif(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "${CMAKE_HOST_SYSTEM_NAME}") +endif() if(NOT "${CMAKE_SYSTEM}" STREQUAL "${CMAKE_HOST_SYSTEM}") message(FATAL_ERROR "CMAKE_SYSTEM and CMAKE_HOST_SYSTEM not identical: \"${CMAKE_SYSTEM}\" vs. \"${CMAKE_HOST_SYSTEM}\"") -endif(NOT "${CMAKE_SYSTEM}" STREQUAL "${CMAKE_HOST_SYSTEM}") +endif() if(NOT "${CMAKE_SYSTEM_VERSION}" STREQUAL "${CMAKE_HOST_SYSTEM_VERSION}") message(FATAL_ERROR "CMAKE_SYSTEM_VERSION and CMAKE_HOST_SYSTEM_VERSION not identical: \"${CMAKE_SYSTEM_VERSION}\" vs. \"${CMAKE_HOST_SYSTEM_VERSION}\"") -endif(NOT "${CMAKE_SYSTEM_VERSION}" STREQUAL "${CMAKE_HOST_SYSTEM_VERSION}") +endif() if(NOT "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "${CMAKE_HOST_SYSTEM_PROCESSOR}") message(FATAL_ERROR "CMAKE_SYSTEM_PROCESSOR and CMAKE_HOST_SYSTEM_PROCESSOR not identical: \"${CMAKE_SYSTEM_PROCESSOR}\" vs. \"${CMAKE_HOST_SYSTEM_PROCESSOR}\"") -endif(NOT "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "${CMAKE_HOST_SYSTEM_PROCESSOR}") +endif() # save the values so we can compare them to CMAKE_HOST_SYSTEM_XXX in the toolchain case @@ -73,35 +73,35 @@ include(CMakeDetermineCXXCompiler) if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Dumdidum") message(FATAL_ERROR "CMAKE_SYSTEM_NAME overwritten: \"${CMAKE_SYSTEM_NAME}\", was: \"Dumdidum\"") -endif(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Dumdidum") +endif() if(NOT "${CMAKE_SYSTEM}" STREQUAL "Dumdidum-1.0") message(FATAL_ERROR "CMAKE_SYSTEM wrong: \"${CMAKE_SYSTEM}\", expected: \"Dumdidum-1.0\"") -endif(NOT "${CMAKE_SYSTEM}" STREQUAL "Dumdidum-1.0") +endif() set(fileOne "${_INCLUDED_TOOLCHAIN_FILE}") set(fileTwo "${MY_SOURCE_DIR}/DummyToolchain.cmake") if(WIN32) string(TOLOWER "${fileOne}" fileOne) string(TOLOWER "${fileTwo}" fileTwo) -endif(WIN32) +endif() if(NOT "${fileOne}" STREQUAL "${fileTwo}") message(FATAL_ERROR "Wrong toolchain was loaded: \"${fileOne}\" expected \"${fileTwo}\"") -endif(NOT "${fileOne}" STREQUAL "${fileTwo}") +endif() # check that CMAKE_HOST_SYSTEM_XXX and _SYSTEM_xxx detected above are identical if(NOT "${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "${NATIVE_SYSTEM_NAME}") message(FATAL_ERROR "CMAKE_HOST_SYSTEM_NAME and NATIVE_SYSTEM_NAME not identical: \"${CMAKE_HOST_SYSTEM_NAME}\" vs. \"${NATIVE_SYSTEM_NAME}\"") -endif(NOT "${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "${NATIVE_SYSTEM_NAME}") +endif() if(NOT "${CMAKE_HOST_SYSTEM}" STREQUAL "${NATIVE_SYSTEM}") message(FATAL_ERROR "CMAKE_HOST_SYSTEM and NATIVE_SYSTEM not identical: \"${CMAKE_HOST_SYSTEM}\" vs. \"${NATIVE_SYSTEM}\"") -endif(NOT "${CMAKE_HOST_SYSTEM}" STREQUAL "${NATIVE_SYSTEM}") +endif() if(NOT "${CMAKE_HOST_SYSTEM_VERSION}" STREQUAL "${NATIVE_SYSTEM_VERSION}") message(FATAL_ERROR "CMAKE_HOST_SYSTEM_VERSION and NATIVE_SYSTEM_VERSION not identical: \"${CMAKE_HOST_SYSTEM_VERSION}\" vs. \"${NATIVE_SYSTEM_VERSION}\"") -endif(NOT "${CMAKE_HOST_SYSTEM_VERSION}" STREQUAL "${NATIVE_SYSTEM_VERSION}") +endif() if(NOT "${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "${NATIVE_SYSTEM_PROCESSOR}") message(FATAL_ERROR "CMAKE_HOST_SYSTEM_PROCESSOR and NATIVE_SYSTEM_PROCESSOR not identical: \"${CMAKE_HOST_SYSTEM_PROCESSOR}\" vs. \"${NATIVE_SYSTEM_PROCESSOR}\"") -endif(NOT "${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "${NATIVE_SYSTEM_PROCESSOR}") +endif() ############################################################# @@ -109,15 +109,15 @@ endif(NOT "${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "${NATIVE_SYSTEM_PROCESSOR}" if(NOT "${_CMAKE_TOOLCHAIN_PREFIX}" STREQUAL "arm-elf-") message(FATAL_ERROR "wrong toolchain prefix detected: \"${_CMAKE_TOOLCHAIN_PREFIX}\", expected: \"arm-elf-\"") -endif(NOT "${_CMAKE_TOOLCHAIN_PREFIX}" STREQUAL "arm-elf-") +endif() if(NOT "${_CMAKE_USER_C_COMPILER_PATH}" STREQUAL "/opt/foo/bin") message(FATAL_ERROR "wrong C compiler location detected: \"${_CMAKE_USER_C_COMPILER_PATH}\", expected: \"/opt/foo/bin\"") -endif(NOT "${_CMAKE_USER_C_COMPILER_PATH}" STREQUAL "/opt/foo/bin") +endif() if(NOT "${CMAKE_C_OUTPUT_EXTENSION}" STREQUAL ".foo") message(FATAL_ERROR "C output extension overwritten: \"${CMAKE_C_OUTPUT_EXTENSION}\", was: \".foo\"") -endif(NOT "${CMAKE_C_OUTPUT_EXTENSION}" STREQUAL ".foo") +endif() ############################################################# @@ -125,11 +125,11 @@ endif(NOT "${CMAKE_C_OUTPUT_EXTENSION}" STREQUAL ".foo") if(NOT "${_CMAKE_USER_CXX_COMPILER_PATH}" STREQUAL "/opt/bar/bin") message(FATAL_ERROR "wrong CXX compiler location detected: \"${_CMAKE_USER_CXX_COMPILER_PATH}\", expected: \"/opt/bar/bin\"") -endif(NOT "${_CMAKE_USER_CXX_COMPILER_PATH}" STREQUAL "/opt/bar/bin") +endif() if(NOT "${CMAKE_CXX_OUTPUT_EXTENSION}" STREQUAL ".bar") message(FATAL_ERROR "C output extension overwritten: \"${CMAKE_CXX_OUTPUT_EXTENSION}\", was: \".bar\"") -endif(NOT "${CMAKE_CXX_OUTPUT_EXTENSION}" STREQUAL ".bar") +endif() message(STATUS "CMAKE_SYSTEM: \"${CMAKE_SYSTEM}\"") message(STATUS "_CMAKE_TOOLCHAIN_PREFIX: \"${_CMAKE_TOOLCHAIN_PREFIX}\"") diff --git a/Tests/CMakeTests/VariableWatchTest.cmake.in b/Tests/CMakeTests/VariableWatchTest.cmake.in index 3d290d6..0c084fd 100644 --- a/Tests/CMakeTests/VariableWatchTest.cmake.in +++ b/Tests/CMakeTests/VariableWatchTest.cmake.in @@ -7,7 +7,7 @@ macro(testwatch var access file stack) message("There was a ${access} access done on the variable: ${var} in file ${file}") message("List file stack is: ${stack}") set(${var}_watched 1) -endmacro(testwatch) +endmacro() variable_watch(somevar testwatch) diff --git a/Tests/CMakeTests/WhileTest.cmake.in b/Tests/CMakeTests/WhileTest.cmake.in index 4693f2d..4cec291 100644 --- a/Tests/CMakeTests/WhileTest.cmake.in +++ b/Tests/CMakeTests/WhileTest.cmake.in @@ -10,7 +10,7 @@ while(COUNT LESS 200) set(NUMBERS "${NUMBERS} ${NCOUNT}") set(NCOUNT "${NCOUNT}0") endwhile() -endwhile(COUNT LESS 200) +endwhile() if(NOT NUMBERS STREQUAL " 0 3 30 20 3 30") message(SEND_ERROR "while loop nesting error, result: '${NUMBERS}'") diff --git a/Tests/COnly/CMakeLists.txt b/Tests/COnly/CMakeLists.txt index 5ef0f1e..b3cc438 100644 --- a/Tests/COnly/CMakeLists.txt +++ b/Tests/COnly/CMakeLists.txt @@ -10,14 +10,14 @@ target_link_libraries(COnly testc1 testc2) if(MSVC_VERSION) set_target_properties(COnly PROPERTIES LINK_FLAGS " /NODEFAULTLIB:\"libcdg.lib\" /NODEFAULTLIB:\"libcmtg.lib\" /NODEFAULTLIB:\"foomsvcrt.lib\" /NODEFAULTLIB:\"libbar.lib\" /NODEFAULTLIB:\"libfooba.lib\"") -endif(MSVC_VERSION) +endif() string(ASCII 35 32 67 77 97 107 101 ASCII_STRING) message(STATUS "String: ${ASCII_STRING}") get_source_file_property(LANG conly.c LANGUAGE) if("${LANG}" STREQUAL "C") message("Language is C") -else("${LANG}" STREQUAL "C") +else() message(FATAL_ERROR "Bad language for file conly.c") -endif("${LANG}" STREQUAL "C") +endif() add_library(testCModule MODULE testCModule.c) diff --git a/Tests/CPackComponents/VerifyResult.cmake b/Tests/CPackComponents/VerifyResult.cmake index 850ec00..c7c24fd 100644 --- a/Tests/CPackComponents/VerifyResult.cmake +++ b/Tests/CPackComponents/VerifyResult.cmake @@ -4,7 +4,7 @@ message(STATUS "") if(NOT CPackComponents_BINARY_DIR) message(FATAL_ERROR "CPackComponents_BINARY_DIR not set") -endif(NOT CPackComponents_BINARY_DIR) +endif() set(expected_file_mask "") @@ -18,15 +18,15 @@ if(WIN32) ) if(NSIS_MAKENSIS_EXECUTABLE) set(expected_file_mask "${CPackComponents_BINARY_DIR}/MyLib-*.exe") - endif(NSIS_MAKENSIS_EXECUTABLE) -endif(WIN32) + endif() +endif() if(APPLE) # Always expect the *.dmg installer - PackageMaker should always # be installed on a development Mac: # set(expected_file_mask "${CPackComponents_BINARY_DIR}/MyLib-*.dmg") -endif(APPLE) +endif() if(expected_file_mask) set(expected_count 1) @@ -38,11 +38,11 @@ if(expected_file_mask) if(NOT expected_file) message(FATAL_ERROR "error: expected_file does not exist: CPackComponents test fails.") - endif(NOT expected_file) + endif() list(LENGTH expected_file actual_count) message(STATUS "actual_count='${actual_count}'") if(NOT actual_count EQUAL expected_count) message(FATAL_ERROR "error: expected_count does not match actual_count: CPackComponents test fails.") - endif(NOT actual_count EQUAL expected_count) -endif(expected_file_mask) + endif() +endif() diff --git a/Tests/CPackComponentsForAll/CMakeLists.txt b/Tests/CPackComponentsForAll/CMakeLists.txt index 5449d09..8162f0c 100644 --- a/Tests/CPackComponentsForAll/CMakeLists.txt +++ b/Tests/CPackComponentsForAll/CMakeLists.txt @@ -118,6 +118,6 @@ if (NOT ("${CPackComponentWay}" STREQUAL "default")) ${CPackComponentsForAll_BINARY_DIR}/MyLibCPackConfig-${CPackComponentWay}.cmake @ONLY) set(CPACK_PROJECT_CONFIG_FILE ${CPackComponentsForAll_BINARY_DIR}/MyLibCPackConfig-${CPackComponentWay}.cmake) -endif (NOT ("${CPackComponentWay}" STREQUAL "default")) +endif () # Include CPack to introduce the appropriate targets include(CPack)
\ No newline at end of file diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-AllInOne.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-AllInOne.cmake.in index 1d203c8..0bfbf14 100644 --- a/Tests/CPackComponentsForAll/MyLibCPackConfig-AllInOne.cmake.in +++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-AllInOne.cmake.in @@ -3,15 +3,15 @@ # if(CPACK_GENERATOR MATCHES "ZIP") set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON") -endif(CPACK_GENERATOR MATCHES "ZIP") +endif() if(CPACK_GENERATOR MATCHES "RPM") set(CPACK_RPM_COMPONENT_INSTALL "ON") -endif(CPACK_GENERATOR MATCHES "RPM") +endif() if(CPACK_GENERATOR MATCHES "DEB") set(CPACK_DEB_COMPONENT_INSTALL "ON") -endif(CPACK_GENERATOR MATCHES "DEB") +endif() # # Choose grouping way diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in index 9444a14..450c204 100644 --- a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in +++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in @@ -3,16 +3,16 @@ # if(CPACK_GENERATOR MATCHES "ZIP") set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON") -endif(CPACK_GENERATOR MATCHES "ZIP") +endif() if(CPACK_GENERATOR MATCHES "RPM") set(CPACK_RPM_COMPONENT_INSTALL "ON") set(CPACK_RPM_applications_PACKAGE_REQUIRES "mylib-libraries") -endif(CPACK_GENERATOR MATCHES "RPM") +endif() if(CPACK_GENERATOR MATCHES "DEB") set(CPACK_DEB_COMPONENT_INSTALL "ON") -endif(CPACK_GENERATOR MATCHES "DEB") +endif() # # Choose grouping way diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in index 2d251b3..60bdd06 100644 --- a/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in +++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in @@ -3,20 +3,20 @@ # if(CPACK_GENERATOR MATCHES "ZIP") set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON") -endif(CPACK_GENERATOR MATCHES "ZIP") +endif() if(CPACK_GENERATOR MATCHES "RPM") set(CPACK_RPM_COMPONENT_INSTALL "ON") set(CPACK_RPM_Development_PACKAGE_REQUIRES "mylib-Runtime") -endif(CPACK_GENERATOR MATCHES "RPM") +endif() if(CPACK_GENERATOR MATCHES "DEB") set(CPACK_DEB_COMPONENT_INSTALL "ON") -endif(CPACK_GENERATOR MATCHES "DEB") +endif() if(CPACK_GENERATOR MATCHES "DragNDrop") set(CPACK_COMPONENTS_GROUPING "ONE_PER_GROUP") -endif(CPACK_GENERATOR MATCHES "DragNDrop") +endif() # # Choose grouping way diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake index e2d343d..9a022c5 100644 --- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake +++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake @@ -4,21 +4,21 @@ message(STATUS "") if(NOT CPackComponentsForAll_BINARY_DIR) message(FATAL_ERROR "CPackComponentsForAll_BINARY_DIR not set") -endif(NOT CPackComponentsForAll_BINARY_DIR) +endif() if(NOT CPackGen) message(FATAL_ERROR "CPackGen not set") -endif(NOT CPackGen) +endif() get_filename_component(CPACK_LOCATION ${CMAKE_COMMAND} PATH) set(CPackCommand "${CPACK_LOCATION}/cpack") message("cpack = ${CPackCommand}") if(NOT CPackCommand) message(FATAL_ERROR "CPackCommand not set") -endif(NOT CPackCommand) +endif() if(NOT CPackComponentWay) message(FATAL_ERROR "CPackComponentWay not set") -endif(NOT CPackComponentWay) +endif() set(expected_file_mask "") # The usual default behavior is to expect a single file @@ -30,7 +30,7 @@ set(config_type $ENV{CMAKE_CONFIG_TYPE}) set(config_args ) if(config_type) set(config_args -C ${config_type}) -endif(config_type) +endif() set(config_verbose ) if(CPackGen MATCHES "ZIP") @@ -80,15 +80,15 @@ if(CPackGen MATCHES "DragNDrop") elseif (${CPackComponentWay} STREQUAL "AllInOne") set(expected_count 1) endif () -endif(CPackGen MATCHES "DragNDrop") +endif() # clean-up previously CPack generated files if(expected_file_mask) file(GLOB expected_file "${expected_file_mask}") if (expected_file) file(REMOVE ${expected_file}) - endif(expected_file) -endif(expected_file_mask) + endif() +endif() message("config_args = ${config_args}") message("config_verbose = ${config_verbose}") @@ -100,9 +100,9 @@ execute_process(COMMAND ${CPackCommand} ${config_verbose} -G ${CPackGen} ${confi if (CPack_result) message(FATAL_ERROR "error: CPack execution went wrong!, CPack_output=${CPack_output}, CPack_error=${CPack_error}") -else (CPack_result) +else () message(STATUS "CPack_output=${CPack_output}") -endif(CPack_result) +endif() # Now verify if the number of expected file is OK # - using expected_file_mask and @@ -116,11 +116,11 @@ if(expected_file_mask) if(NOT expected_file) message(FATAL_ERROR "error: expected_file=${expected_file} does not exist: CPackComponentsForAll test fails. (CPack_output=${CPack_output}, CPack_error=${CPack_error}") - endif(NOT expected_file) + endif() list(LENGTH expected_file actual_count) message(STATUS "actual_count='${actual_count}'") if(NOT actual_count EQUAL expected_count) message(FATAL_ERROR "error: expected_count=${expected_count} does not match actual_count=${actual_count}: CPackComponents test fails. (CPack_output=${CPack_output}, CPack_error=${CPack_error})") - endif(NOT actual_count EQUAL expected_count) -endif(expected_file_mask) + endif() +endif() diff --git a/Tests/CTestScriptMode/CTestTestScriptMode.cmake.in b/Tests/CTestScriptMode/CTestTestScriptMode.cmake.in index 7731710..45f0e37 100644 --- a/Tests/CTestScriptMode/CTestTestScriptMode.cmake.in +++ b/Tests/CTestScriptMode/CTestTestScriptMode.cmake.in @@ -5,7 +5,7 @@ set(CMAKE_CMAKE_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@") if (NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "${CMAKE_CMAKE_SYSTEM_NAME}") message(FATAL_ERROR "Error: CMAKE_SYSTEM_NAME is \"${CMAKE_SYSTEM_NAME}\", but should be \"@CMAKE_SYSTEM_NAME@\"") -endif(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "${CMAKE_CMAKE_SYSTEM_NAME}") +endif() # this seems to be necessary, otherwise ctest complains that these # variables are not set: diff --git a/Tests/CTestTestCostSerial/CMakeLists.txt b/Tests/CTestTestCostSerial/CMakeLists.txt index 29d2983..d3344cf 100644 --- a/Tests/CTestTestCostSerial/CMakeLists.txt +++ b/Tests/CTestTestCostSerial/CMakeLists.txt @@ -6,7 +6,7 @@ add_executable (Sleep sleep.c) foreach (index RANGE 1 3) add_test (TestSleep${index} Sleep) -endforeach (index RANGE 1 3) +endforeach () set_tests_properties(TestSleep1 PROPERTIES COST -500) set_tests_properties(TestSleep2 PROPERTIES COST 12) diff --git a/Tests/CTestTestCostSerial/test.cmake.in b/Tests/CTestTestCostSerial/test.cmake.in index 3f0f6f8..8661767 100644 --- a/Tests/CTestTestCostSerial/test.cmake.in +++ b/Tests/CTestTestCostSerial/test.cmake.in @@ -18,7 +18,7 @@ set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIP # Remove old cost data file if it exists if(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") file(REMOVE "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") -endif(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") +endif() CTEST_START(Experimental) CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestScheduler/CMakeLists.txt b/Tests/CTestTestScheduler/CMakeLists.txt index d2b3bb4..ccd7b2c 100644 --- a/Tests/CTestTestScheduler/CMakeLists.txt +++ b/Tests/CTestTestScheduler/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable (Sleep sleep.c) foreach (time RANGE 1 4) add_test (TestSleep${time} Sleep ${time}) -endforeach (time RANGE 1 4) +endforeach () diff --git a/Tests/CTestTestScheduler/test.cmake.in b/Tests/CTestTestScheduler/test.cmake.in index 87a390a..9115a61 100644 --- a/Tests/CTestTestScheduler/test.cmake.in +++ b/Tests/CTestTestScheduler/test.cmake.in @@ -18,7 +18,7 @@ set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIP # Remove old cost data file if it exists if(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") file(REMOVE "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") -endif(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") +endif() CTEST_START(Experimental) CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestStopTime/GetDate.cmake b/Tests/CTestTestStopTime/GetDate.cmake index ac8f65d..60f1e0c 100644 --- a/Tests/CTestTestStopTime/GetDate.cmake +++ b/Tests/CTestTestStopTime/GetDate.cmake @@ -37,17 +37,17 @@ macro(GET_DATE) set(GD_PREFIX "GD_") if(NOT "${ARGV0}" STREQUAL "") set(GD_PREFIX "${ARGV0}") - endif(NOT "${ARGV0}" STREQUAL "") + endif() if(NOT "${GD_PREFIX}" STREQUAL "GD_") set(${GD_PREFIX}PREFIX "${GD_PREFIX}") - endif(NOT "${GD_PREFIX}" STREQUAL "GD_") + endif() # If there's an ARGV1, use it as ${GD_PREFIX}VERBOSE: # set(${GD_PREFIX}VERBOSE "0") if(NOT "${ARGV1}" STREQUAL "") set(${GD_PREFIX}VERBOSE "${ARGV1}") - endif(NOT "${ARGV1}" STREQUAL "") + endif() # Retrieve the current date and time in the format: # @@ -65,13 +65,13 @@ macro(GET_DATE) # set(${GD_PREFIX}CMD "cmd") set(${GD_PREFIX}ARGS "/c echo %DATE% %TIME%") - else(WIN32) + else() # # Match the format returned by default in US English Windows: # set(${GD_PREFIX}CMD "date") set(${GD_PREFIX}ARGS "\"+%a %m/%d/%Y %H:%M:%S.00\"") - endif(WIN32) + endif() exec_program("${${GD_PREFIX}CMD}" "." ARGS "${${GD_PREFIX}ARGS}" OUTPUT_VARIABLE ${GD_PREFIX}OV RETURN_VALUE ${GD_PREFIX}RV @@ -84,7 +84,7 @@ macro(GET_DATE) message(STATUS "GD_PREFIX='${GD_PREFIX}'") if(NOT "${GD_PREFIX}" STREQUAL "GD_") message(STATUS "${GD_PREFIX}PREFIX='${${GD_PREFIX}PREFIX}'") - endif(NOT "${GD_PREFIX}" STREQUAL "GD_") + endif() message(STATUS "${GD_PREFIX}VERBOSE='${${GD_PREFIX}VERBOSE}'") message(STATUS "") message(STATUS "${GD_PREFIX}CMD='${${GD_PREFIX}CMD}'") @@ -92,7 +92,7 @@ macro(GET_DATE) message(STATUS "${GD_PREFIX}OV='${${GD_PREFIX}OV}'") message(STATUS "${GD_PREFIX}RV='${${GD_PREFIX}RV}'") message(STATUS "") - endif(${GD_PREFIX}VERBOSE) + endif() if("${${GD_PREFIX}RV}" STREQUAL "0") # @@ -119,59 +119,59 @@ macro(GET_DATE) # if(NOT "${${GD_PREFIX}YEAR}" MATCHES "^[0-9][0-9][0-9][0-9]$") message(STATUS "WARNING: Extracted ${GD_PREFIX}YEAR='${${GD_PREFIX}YEAR}' is not a four digit number...") - endif(NOT "${${GD_PREFIX}YEAR}" MATCHES "^[0-9][0-9][0-9][0-9]$") + endif() # Expecting month to be <= 12: # if(${${GD_PREFIX}MONTH} GREATER 12) message(STATUS "WARNING: Extracted ${GD_PREFIX}MONTH='${${GD_PREFIX}MONTH}' is greater than 12!") - endif(${${GD_PREFIX}MONTH} GREATER 12) + endif() # Expecting day to be <= 31: # if(${${GD_PREFIX}DAY} GREATER 31) message(STATUS "WARNING: Extracted ${GD_PREFIX}DAY='${${GD_PREFIX}DAY}' is greater than 31!") - endif(${${GD_PREFIX}DAY} GREATER 31) + endif() # Expecting hour to be <= 23: # if(${${GD_PREFIX}HOUR} GREATER 23) message(STATUS "WARNING: Extracted ${GD_PREFIX}HOUR='${${GD_PREFIX}HOUR}' is greater than 23!") - endif(${${GD_PREFIX}HOUR} GREATER 23) + endif() # Expecting minute to be <= 59: # if(${${GD_PREFIX}MINUTE} GREATER 59) message(STATUS "WARNING: Extracted ${GD_PREFIX}MINUTE='${${GD_PREFIX}MINUTE}' is greater than 59!") - endif(${${GD_PREFIX}MINUTE} GREATER 59) + endif() # Expecting second to be <= 59: # if(${${GD_PREFIX}SECOND} GREATER 59) message(STATUS "WARNING: Extracted ${GD_PREFIX}SECOND='${${GD_PREFIX}SECOND}' is greater than 59!") - endif(${${GD_PREFIX}SECOND} GREATER 59) + endif() # If individual components are single digit, # prepend a leading zero: # if("${${GD_PREFIX}YEAR}" MATCHES "^[0-9]$") set(${GD_PREFIX}YEAR "0${${GD_PREFIX}YEAR}") - endif("${${GD_PREFIX}YEAR}" MATCHES "^[0-9]$") + endif() if("${${GD_PREFIX}MONTH}" MATCHES "^[0-9]$") set(${GD_PREFIX}MONTH "0${${GD_PREFIX}MONTH}") - endif("${${GD_PREFIX}MONTH}" MATCHES "^[0-9]$") + endif() if("${${GD_PREFIX}DAY}" MATCHES "^[0-9]$") set(${GD_PREFIX}DAY "0${${GD_PREFIX}DAY}") - endif("${${GD_PREFIX}DAY}" MATCHES "^[0-9]$") + endif() if("${${GD_PREFIX}HOUR}" MATCHES "^[0-9]$") set(${GD_PREFIX}HOUR "0${${GD_PREFIX}HOUR}") - endif("${${GD_PREFIX}HOUR}" MATCHES "^[0-9]$") + endif() if("${${GD_PREFIX}MINUTE}" MATCHES "^[0-9]$") set(${GD_PREFIX}MINUTE "0${${GD_PREFIX}MINUTE}") - endif("${${GD_PREFIX}MINUTE}" MATCHES "^[0-9]$") + endif() if("${${GD_PREFIX}SECOND}" MATCHES "^[0-9]$") set(${GD_PREFIX}SECOND "0${${GD_PREFIX}SECOND}") - endif("${${GD_PREFIX}SECOND}" MATCHES "^[0-9]$") + endif() if(${GD_PREFIX}VERBOSE) message(STATUS "${GD_PREFIX}REGEX='${${GD_PREFIX}REGEX}'") @@ -192,16 +192,16 @@ macro(GET_DATE) message(STATUS " monthly : ${${GD_PREFIX}YEAR}${${GD_PREFIX}MONTH}") message(STATUS " annually : ${${GD_PREFIX}YEAR}") message(STATUS "") - endif(${GD_PREFIX}VERBOSE) - else("${${GD_PREFIX}RV}" STREQUAL "0") + endif() + else() message(SEND_ERROR "ERROR: macro(GET_DATE) failed. ${GD_PREFIX}CMD='${${GD_PREFIX}CMD}' ${GD_PREFIX}ARGS='${${GD_PREFIX}ARGS}' ${GD_PREFIX}OV='${${GD_PREFIX}OV}' ${GD_PREFIX}RV='${${GD_PREFIX}RV}'") - endif("${${GD_PREFIX}RV}" STREQUAL "0") + endif() if(${GD_PREFIX}VERBOSE) message(STATUS "</GET_DATE>") message(STATUS "") - endif(${GD_PREFIX}VERBOSE) -endmacro(GET_DATE) + endif() +endmacro() macro(ADD_SECONDS sec) set(new_min ${${GD_PREFIX}MINUTE}) @@ -230,4 +230,4 @@ macro(ADD_SECONDS sec) if(${hr_len} EQUAL 1) set(new_hr "0${new_hr}") endif() -endmacro(ADD_SECONDS) +endmacro() diff --git a/Tests/CTestUpdateBZR.cmake.in b/Tests/CTestUpdateBZR.cmake.in index c654f47..8fb1d34 100644 --- a/Tests/CTestUpdateBZR.cmake.in +++ b/Tests/CTestUpdateBZR.cmake.in @@ -74,7 +74,7 @@ if(dirs_added) WORKING_DIRECTORY ${TOP}/user-source COMMAND ${BZR} add ${dirs_added} ) -endif(dirs_added) +endif() run_child( WORKING_DIRECTORY ${TOP}/user-source COMMAND ${BZR} add ${files_added} diff --git a/Tests/CTestUpdateCVS.cmake.in b/Tests/CTestUpdateCVS.cmake.in index f7f5db6..1699c3f 100644 --- a/Tests/CTestUpdateCVS.cmake.in +++ b/Tests/CTestUpdateCVS.cmake.in @@ -91,7 +91,7 @@ if(dirs_added) WORKING_DIRECTORY ${TOP}/user-source COMMAND ${CVSCMD} add ${dirs_added} ) -endif(dirs_added) +endif() run_child( WORKING_DIRECTORY ${TOP}/user-source COMMAND ${CVSCMD} add ${files_added} diff --git a/Tests/CTestUpdateCommon.cmake b/Tests/CTestUpdateCommon.cmake index 335d09e..aaf88a8 100644 --- a/Tests/CTestUpdateCommon.cmake +++ b/Tests/CTestUpdateCommon.cmake @@ -12,8 +12,8 @@ function(run_child) string(REGEX REPLACE "\n" "\n " OUTPUT "${OUTPUT}") message(FATAL_ERROR "Child failed (${FAILED}), output is\n ${OUTPUT}\n" "Command = [${ARGN}]\n") - endif(FAILED) -endfunction(run_child) + endif() +endfunction() #----------------------------------------------------------------------------- # Function to find the Update.xml file and check for expected entries. @@ -26,7 +26,7 @@ function(check_updates build) ) if(NOT UPDATE_XML_FILE) message(FATAL_ERROR "Cannot find Update.xml with pattern\n ${PATTERN}") - endif(NOT UPDATE_XML_FILE) + endif() message(" found ${UPDATE_XML_FILE}") set(max_update_xml_size 16384) @@ -73,11 +73,11 @@ function(check_updates build) set(MSG "${MSG}Update.xml is missing expected entries:\n") foreach(f ${MISSING}) set(MSG "${MSG} ${f}\n") - endforeach(f) - else(MISSING) + endforeach() + else() # Success message(" no entries missing from Update.xml") - endif(MISSING) + endif() # Report the result if(EXTRA) @@ -85,11 +85,11 @@ function(check_updates build) set(MSG "${MSG}Update.xml has extra unexpected entries:\n") foreach(f ${EXTRA}) set(MSG "${MSG} ${f}\n") - endforeach(f) - else(EXTRA) + endforeach() + else() # Success message(" no extra entries in Update.xml") - endif(EXTRA) + endif() if(MSG) # Provide the log file @@ -99,14 +99,14 @@ function(check_updates build) file(READ ${UPDATE_LOG_FILE} UPDATE_LOG LIMIT ${max_update_xml_size}) string(REGEX REPLACE "\n" "\n " UPDATE_LOG "${UPDATE_LOG}") set(MSG "${MSG}Update log:\n ${UPDATE_LOG}") - else(UPDATE_LOG_FILE) + else() set(MSG "${MSG}No update log found!") - endif(UPDATE_LOG_FILE) + endif() # Display the error message message(FATAL_ERROR "${MSG}") - endif(MSG) -endfunction(check_updates) + endif() +endfunction() #----------------------------------------------------------------------------- # Function to create initial content. @@ -123,7 +123,7 @@ set(CTEST_NIGHTLY_START_TIME \"21:00:00 EDT\") # Some other files. file(WRITE ${TOP}/${dir}/foo.txt "foo\n") file(WRITE ${TOP}/${dir}/bar.txt "bar\n") -endfunction(create_content) +endfunction() #----------------------------------------------------------------------------- # Function to update content. @@ -137,20 +137,20 @@ function(update_content dir added_var removed_var dirs_var) set(${dirs_var} subdir PARENT_SCOPE) set(${added_var} zot.txt subdir/foo.txt subdir/bar.txt PARENT_SCOPE) set(${removed_var} bar.txt PARENT_SCOPE) -endfunction(update_content) +endfunction() #----------------------------------------------------------------------------- # Function to change existing files function(change_content dir) file(APPEND ${TOP}/${dir}/foo.txt "foo line 3\n") file(APPEND ${TOP}/${dir}/subdir/foo.txt "foo line 2\n") -endfunction(change_content) +endfunction() #----------------------------------------------------------------------------- # Function to create local modifications before update function(modify_content dir) file(APPEND ${TOP}/${dir}/CTestConfig.cmake "# local modification\n") -endfunction(modify_content) +endfunction() #----------------------------------------------------------------------------- # Function to write CTestConfiguration.ini content. @@ -163,7 +163,7 @@ BuildDirectory: ${TOP}/${bin_dir} Site: test.site BuildName: user-test ") -endfunction(create_build_tree) +endfunction() #----------------------------------------------------------------------------- # Function to write the dashboard test script. @@ -181,7 +181,7 @@ ${custom_text} ctest_start(Experimental) ctest_update(SOURCE \${CTEST_SOURCE_DIRECTORY}) ") -endfunction(create_dashboard_script) +endfunction() #----------------------------------------------------------------------------- # Function to run the dashboard through the command line @@ -205,7 +205,7 @@ function(run_dashboard_command_line bin_dir) Updated{subdir/bar.txt} ${_modified} ) -endfunction(run_dashboard_command_line) +endfunction() #----------------------------------------------------------------------------- # Function to run the dashboard through a script @@ -224,11 +224,11 @@ function(run_dashboard_script bin_dir) Updated{subdir/foo.txt} Updated{subdir/bar.txt} ) -endfunction(run_dashboard_script) +endfunction() #----------------------------------------------------------------------------- # Function to initialize the testing directory. function(init_testing) file(REMOVE_RECURSE ${TOP}) file(MAKE_DIRECTORY ${TOP}) -endfunction(init_testing) +endfunction() diff --git a/Tests/CTestUpdateGIT.cmake.in b/Tests/CTestUpdateGIT.cmake.in index eb9f987..0c01291 100644 --- a/Tests/CTestUpdateGIT.cmake.in +++ b/Tests/CTestUpdateGIT.cmake.in @@ -159,7 +159,7 @@ if(dirs_added) WORKING_DIRECTORY ${TOP}/user-source COMMAND ${GIT} add ${dirs_added} ) -endif(dirs_added) +endif() run_child( WORKING_DIRECTORY ${TOP}/user-source COMMAND ${GIT} add ${files_added} @@ -221,7 +221,7 @@ macro(rewind_source src_dir) WORKING_DIRECTORY ${TOP}/${src_dir} COMMAND ${GIT} submodule update ) -endmacro(rewind_source) +endmacro() rewind_source(user-source) # Make sure pull does not try to rebase (which does not work with diff --git a/Tests/CTestUpdateHG.cmake.in b/Tests/CTestUpdateHG.cmake.in index 640d2c6..c5440f9 100644 --- a/Tests/CTestUpdateHG.cmake.in +++ b/Tests/CTestUpdateHG.cmake.in @@ -70,7 +70,7 @@ if(dirs_added) WORKING_DIRECTORY ${TOP}/user-source COMMAND ${HG} add ${dirs_added} ) -endif(dirs_added) +endif() run_child( WORKING_DIRECTORY ${TOP}/user-source COMMAND ${HG} add ${files_added} diff --git a/Tests/CTestUpdateSVN.cmake.in b/Tests/CTestUpdateSVN.cmake.in index 15b833b..b5728fd 100644 --- a/Tests/CTestUpdateSVN.cmake.in +++ b/Tests/CTestUpdateSVN.cmake.in @@ -74,7 +74,7 @@ if(dirs_added) WORKING_DIRECTORY ${TOP}/user-source COMMAND ${SVNCMD} add ${depth_empty} ${dirs_added} ) -endif(dirs_added) +endif() run_child( WORKING_DIRECTORY ${TOP}/user-source COMMAND ${SVNCMD} add ${files_added} 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() diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt index 45ea901..048f966 100644 --- a/Tests/Complex/CMakeLists.txt +++ b/Tests/Complex/CMakeLists.txt @@ -11,8 +11,8 @@ if(POLICY CMP0003) cmake_policy(GET CMP0003 P3) if(NOT "${P3}" STREQUAL "NEW") message(FATAL_ERROR "cmake_policy(GET) did not report NEW!") - endif(NOT "${P3}" STREQUAL "NEW") -endif(POLICY CMP0003) + endif() +endif() # Test building without per-rule echo lines in Makefiles. set_property(GLOBAL PROPERTY RULE_MESSAGES OFF) @@ -25,8 +25,8 @@ set(CPACK_SOURCE_IGNORE_FILES "~$;\\.cvsignore$;^C:/hoffman/My Builds/testcase.* macro(ASSERT value msg) if (NOT ${value}) message ("Assertion failure:" ${msg} ) - endif (NOT ${value}) -endmacro(ASSERT) + endif () +endmacro() # invoke the macro ASSERT(Complex_BINARY_DIR "The PROJECT command is broken") @@ -38,8 +38,8 @@ macro(TEST_ARGC value1 value2) add_definitions(${value1} ${value2}) if (${ARGC} MATCHES 4) add_definitions(${ARGV2} ${ARGV3}) - endif (${ARGC} MATCHES 4) -endmacro(TEST_ARGC) + endif () +endmacro() # invoke the macro TEST_ARGC(-DCMAKE_ARGV1 -DCMAKE_ARGV2 -DCMAKE_ARGV3 -DCMAKE_ARGV4) @@ -47,34 +47,34 @@ TEST_ARGC(-DCMAKE_ARGV1 -DCMAKE_ARGV2 -DCMAKE_ARGV3 -DCMAKE_ARGV4) macro(TEST_VAR_ARG fa) if("${ARGV}" MATCHES "^1;2;3$") message(STATUS "ARGV works") - else("${ARGV}" MATCHES "^1;2;3$") + else() message(FATAL_ERROR "ARGV does not work; got \"${ARGV}\" instead of \"1;2;3\"") - endif("${ARGV}" MATCHES "^1;2;3$") + endif() if("${ARGN}" MATCHES "^2;3$") message(STATUS "ARGN works") - else("${ARGN}" MATCHES "^2;3$") + else() message(FATAL_ERROR "ARGV does not work; got \"${ARGN}\" instead of \"2;3\"") - endif("${ARGN}" MATCHES "^2;3$") -endmacro(TEST_VAR_ARG) + endif() +endmacro() TEST_VAR_ARG(1 2 3) # Floating-point comparison test. if(2.4 LESS 2.4) message(FATAL_ERROR "Failed: 2.4 LESS 2.4") -endif(2.4 LESS 2.4) +endif() if(2.4 GREATER 2.4) message(FATAL_ERROR "Failed: 2.4 GREATER 2.4") -endif(2.4 GREATER 2.4) +endif() if(NOT 2.4 EQUAL 2.4) message(FATAL_ERROR "Failed: NOT 2.4 EQUAL 2.4") -endif(NOT 2.4 EQUAL 2.4) +endif() if(CMAKE_SYSTEM MATCHES "OSF1-V.*") if(NOT CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ") - endif(NOT CMAKE_COMPILER_IS_GNUCXX) -endif(CMAKE_SYSTEM MATCHES "OSF1-V.*") + endif() +endif() add_definitions(-DCMAKE_IS_FUN) @@ -93,7 +93,7 @@ separate_arguments(TEST_SEP) # if (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) include(${Complex_SOURCE_DIR}/VarTests.cmake) -endif (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) +endif () include(fileshouldnotbehere OPTIONAL) load_cache(${Complex_SOURCE_DIR}/Cache EXCLUDE @@ -104,9 +104,9 @@ load_cache(${Complex_SOURCE_DIR}/Cache load_cache(${Complex_SOURCE_DIR}/Cache READ_WITH_PREFIX foo CACHE_TEST_VAR2) if(${fooCACHE_TEST_VAR2} MATCHES bar) message("Load cache worked: ${fooCACHE_TEST_VAR2}") -else(${fooCACHE_TEST_VAR2} MATCHES bar) +else() message(FATAL_ERROR "Load cache with prefix failed: ${fooCACHE_TEST_VAR2}") -endif(${fooCACHE_TEST_VAR2} MATCHES bar) +endif() @@ -151,9 +151,9 @@ message("\nIgnore this message") option(NO_EXEC_PROGRAM "Do not test EXEC_PROGRAM" 0) if (NOT NO_EXEC_PROGRAM) exec_program(${CMAKE_COMMAND} ARGS -E echo NO_EXEC_PROGRAM "${Complex_BINARY_DIR}") -else (NOT NO_EXEC_PROGRAM) +else () message("Set this option ON") -endif (NOT NO_EXEC_PROGRAM) +endif () mark_as_advanced(NO_EXEC_PROGRAM) mark_as_advanced(CLEAR NO_EXEC_PROGRAM) @@ -164,9 +164,9 @@ execute_process( OUTPUT_VARIABLE TEST_OUT ) if("${TEST_OUT}" MATCHES "^ABCDEFG\n$") -else("${TEST_OUT}" MATCHES "^ABCDEFG\n$") +else() message(SEND_ERROR "EXECUTE_PROCESS output test failed: [${TEST_OUT}]") -endif("${TEST_OUT}" MATCHES "^ABCDEFG\n$") +endif() # This test has some problems on UNIX systems. Disabling for now. # @@ -180,9 +180,9 @@ endif("${TEST_OUT}" MATCHES "^ABCDEFG\n$") # if("${RESULT}" MATCHES "^0$") # message(SEND_ERROR # "EXECUTE_PROCESS result test failed with RESULT=[${RESULT}]") -# else("${RESULT}" MATCHES "^0$") +# else() # message(STATUS "EXECUTE_PROCESS result test passed with RESULT=[${RESULT}]") -# endif("${RESULT}" MATCHES "^0$") +# endif() # # Create directory. @@ -206,7 +206,7 @@ foreach (ext ${CMAKE_SHLIB_SUFFIX};.so;.a;.sl ${Complex_SOURCE_DIR}/Library/dummy ${Complex_BINARY_DIR}/Library/libdummylib${ext} COPYONLY IMMEDIATE) -endforeach (ext) +endforeach () find_library(FIND_DUMMY_LIB dummylib @@ -288,8 +288,8 @@ if (WIN32) "[${hkey}]" DOC "Registry_Test_Path") exec_program(${CMAKE_COMMAND} ARGS "-E delete_regv \"${hkey}\"") exec_program(${CMAKE_COMMAND} ARGS "-E remove \"${dir}/${file}\"") - endif (NOT UNIX) -endif (WIN32) + endif () +endif () # # Test a set and a remove @@ -305,17 +305,17 @@ foreach(x "a") if(${x} MATCHES "a") # Should always execute. set(IF_INSIDE_FOREACH_THEN_EXECUTED 1) - else(${x} MATCHES "a") + else() # Should never execute. set(IF_INSIDE_FOREACH_ELSE_EXECUTED 1) - endif(${x} MATCHES "a") -endforeach(x) + endif() +endforeach() # test WHILE command set (while_var 1) while (while_var LESS 1000) set(while_var ${while_var}0) -endwhile(while_var LESS 1000) +endwhile() set(SHOULD_BE_ZERO ) set(SHOULD_BE_ONE 1) @@ -328,7 +328,7 @@ if (RESULT EQUAL 1) set (ELSEIF_RESULT 1) elseif (RESULT EQUAL 3) set (ELSEIF_RESULT 1) - endif (RESULT EQUAL 2) + endif () elseif (RESULT EQUAL 2) set (ELSEIF_RESULT 1) elseif (RESULT EQUAL 3) @@ -337,25 +337,25 @@ elseif (RESULT EQUAL 3) elseif (RESULT EQUAL 3) if (NOT ELSEIF_RESULT EQUAL 1) set (ELSEIF_RESULT 2) - endif (NOT ELSEIF_RESULT EQUAL 1) - endif (RESULT EQUAL 2) + endif () + endif () elseif (RESULT EQUAL 4) if (RESULT EQUAL 2) set (ELSEIF_RESULT 1) elseif (RESULT EQUAL 3) set (ELSEIF_RESULT 1) - endif (RESULT EQUAL 2) -else (RESULT EQUAL 1) + endif () +else () if (RESULT EQUAL 2) set (ELSEIF_RESULT 1) elseif (RESULT EQUAL 3) set (ELSEIF_RESULT 1) - endif (RESULT EQUAL 2) -endif (RESULT EQUAL 1) + endif () +endif () if (NOT ELSEIF_RESULT EQUAL 2) set (ELSEIF_RESULT 0) -endif (NOT ELSEIF_RESULT EQUAL 2) +endif () # test handling of parenthetical groups in conditionals if (2 GREATER 1 AND (4 LESS 3 OR 5 LESS 6) AND NOT (7 GREATER 8)) @@ -381,19 +381,19 @@ configure_file( string(REGEX MATCH "b" RESULT "abc") if(NOT RESULT) message(SEND_ERROR "string(REGEX MATCH ... ) test failed.") -endif(NOT RESULT) +endif() string(REGEX MATCHALL "b" RESULT "abcb") if(NOT RESULT) message(SEND_ERROR "string(REGEX MATCHALL ... ) test failed.") -endif(NOT RESULT) +endif() string(REGEX REPLACE ".([bd])." "[\\1]" RESULT "a(b)c(d)e") if("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") set(STRING_REGEX_PASSED 1) -endif("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") +endif() if(NOT STRING_REGEX_PASSED) message(SEND_ERROR "string(REGEX REPLACE ... ) test failed (\"${RESULT}\" v. \"a[b]c[d]e\")") -endif(NOT STRING_REGEX_PASSED) +endif() # diff --git a/Tests/Complex/Executable/CMakeLists.txt b/Tests/Complex/Executable/CMakeLists.txt index 4138835..432dbf8 100644 --- a/Tests/Complex/Executable/CMakeLists.txt +++ b/Tests/Complex/Executable/CMakeLists.txt @@ -11,16 +11,16 @@ add_library(ExeImportedTarget UNKNOWN IMPORTED) # Test if(TARGET) command. if(NOT TARGET CMakeTestLibrary) message(FATAL_ERROR "if(NOT TARGET CMakeTestLibrary) returned true!") -endif(NOT TARGET CMakeTestLibrary) +endif() if(NOT TARGET ExeImportedTarget) message(FATAL_ERROR "if(NOT TARGET ExeImportedTarget) returned true!") -endif(NOT TARGET ExeImportedTarget) +endif() if(TARGET LibImportedTarget) message(FATAL_ERROR "if(TARGET LibImportedTarget) returned true!") -endif(TARGET LibImportedTarget) +endif() if(TARGET NotATarget) message(FATAL_ERROR "if(TARGET NotATarget) returned true!") -endif(TARGET NotATarget) +endif() # Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to set(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared) @@ -46,37 +46,37 @@ add_executable(complex.file complex.file.cxx complex_nobuild.cxx if (UNIX) target_link_libraries(complex ${CMAKE_DL_LIBS}) -else(UNIX) +else() if (NOT BORLAND) if(NOT MINGW) target_link_libraries(complex rpcrt4.lib) - endif(NOT MINGW) - endif(NOT BORLAND) -endif (UNIX) + endif() + endif() +endif () # Test linking to static lib when a shared lib has the same name. if(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) add_definitions(-DCOMPLEX_TEST_LINK_STATIC) target_link_libraries(complex CMakeTestLinkStatic) -endif(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) +endif() # can we get the path to a source file get_source_file_property(A_LOCATION A.cxx LOCATION) if ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx") add_definitions(-DCMAKE_FOUND_ACXX) -endif ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx") +endif () # get the directory parent get_directory_property(P_VALUE PARENT_DIRECTORY) if ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}") add_definitions(-DCMAKE_FOUND_PARENT) -endif ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}") +endif () # get the stack of listfiles include(Included.cmake) if ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake") add_definitions(-DCMAKE_FOUND_LISTFILE_STACK) -endif ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake") +endif () # Test add/remove definitions. add_definitions( @@ -128,7 +128,7 @@ target_link_libraries(notInAllExe notInAllLib) if(MSVC) set_target_properties(notInAllExe PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBC;LIBCMT;MSVCRT") -endif(MSVC) +endif() # Test creating a custom target that builds not-in-all targets. add_custom_target(notInAllCustom) @@ -146,7 +146,7 @@ add_subdirectory(Temp) if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX) add_executable(testSystemDir testSystemDir.cxx) set_target_properties(testSystemDir PROPERTIES COMPILE_FLAGS "-Werror") -endif(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX) +endif() # # Extra coverage.Not used. diff --git a/Tests/Complex/Library/CMakeLists.txt b/Tests/Complex/Library/CMakeLists.txt index 41faeba..5c43052 100644 --- a/Tests/Complex/Library/CMakeLists.txt +++ b/Tests/Complex/Library/CMakeLists.txt @@ -33,10 +33,10 @@ if(WIN32) target_link_libraries(CMakeTestLibrary optimized kernel32.lib) - endif(NOT MINGW) - endif(NOT BORLAND) - endif(NOT CYGWIN) -endif(WIN32) + endif() + endif() + endif() +endif() # # Create shared library @@ -53,12 +53,12 @@ define_property( set_target_properties(CMakeTestCLibraryShared PROPERTIES FOO BAR) if(NOT BEOS AND NOT WIN32) # No libm on BeOS. set_target_properties(CMakeTestCLibraryShared PROPERTIES LINK_FLAGS "-lm") -endif(NOT BEOS AND NOT WIN32) +endif() get_target_property(FOO_BAR_VAR CMakeTestCLibraryShared FOO) if(${FOO_BAR_VAR} MATCHES "BAR") -else(${FOO_BAR_VAR} MATCHES "BAR") +else() message(SEND_ERROR "SET_TARGET_PROPERTIES or GET_TARGET_PROPERTY failed, FOO_BAR_VAR should be BAR, but is ${FOO_BAR_VAR}") -endif(${FOO_BAR_VAR} MATCHES "BAR") +endif() # Create static and shared lib of same name. if(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) @@ -66,7 +66,7 @@ if(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) add_library(CMakeTestLinkShared SHARED TestLink.c) set_target_properties(CMakeTestLinkStatic CMakeTestLinkShared PROPERTIES OUTPUT_NAME CMakeTestLink) -endif(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) +endif() # # Attach pre-build/pre-link/post-build custom-commands to the lib. @@ -127,7 +127,7 @@ if("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM) if(ARCH_COUNT GREATER 1) # OSX does not support preprocessing more than one architecture. set(MAYBE_ALL) - endif(ARCH_COUNT GREATER 1) + endif() # Custom target to try preprocessing invocation. add_custom_target(test_preprocess ${MAYBE_ALL} @@ -136,5 +136,5 @@ if("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM) COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/test_preprocess.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) - endif(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE) -endif("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM) + endif() +endif() diff --git a/Tests/Complex/Library/test_preprocess.cmake b/Tests/Complex/Library/test_preprocess.cmake index 885c613..4c8ec21 100644 --- a/Tests/Complex/Library/test_preprocess.cmake +++ b/Tests/Complex/Library/test_preprocess.cmake @@ -2,6 +2,6 @@ set(TEST_FILE CMakeFiles/create_file.dir/create_file.i) file(READ ${TEST_FILE} CONTENTS) if("${CONTENTS}" MATCHES "Unable to close") message(STATUS "${TEST_FILE} created successfully!") -else("${CONTENTS}" MATCHES "Unable to close") +else() message(FATAL_ERROR "${TEST_FILE} creation failed!") -endif("${CONTENTS}" MATCHES "Unable to close") +endif() diff --git a/Tests/Complex/VarTests.cmake b/Tests/Complex/VarTests.cmake index 7e968fd..52ec1fc 100644 --- a/Tests/Complex/VarTests.cmake +++ b/Tests/Complex/VarTests.cmake @@ -6,9 +6,9 @@ set (ZERO_VAR2 0) if(ZERO_VAR) add_definitions(-DSHOULD_NOT_BE_DEFINED) -else(ZERO_VAR) +else() add_definitions(-DSHOULD_BE_DEFINED) -endif(ZERO_VAR) +endif() set(ONE_VAR 1) set(ONE_VAR2 1) @@ -25,83 +25,83 @@ variable_requires(ONE_VAR # if(NOT ZERO_VAR) add_definitions(-DSHOULD_BE_DEFINED_NOT) -else(NOT ZERO_VAR) +else() add_definitions(-DSHOULD_NOT_BE_DEFINED_NOT) -endif(NOT ZERO_VAR) +endif() if(NOT ONE_VAR) add_definitions(-DSHOULD_NOT_BE_DEFINED_NOT2) -else(NOT ONE_VAR) +else() add_definitions(-DSHOULD_BE_DEFINED_NOT2) -endif(NOT ONE_VAR) +endif() if(ONE_VAR AND ONE_VAR2) add_definitions(-DSHOULD_BE_DEFINED_AND) -else(ONE_VAR AND ONE_VAR2) +else() add_definitions(-DSHOULD_NOT_BE_DEFINED_AND) -endif(ONE_VAR AND ONE_VAR2) +endif() if(ONE_VAR AND ZERO_VAR) add_definitions(-DSHOULD_NOT_BE_DEFINED_AND2) -else(ONE_VAR AND ZERO_VAR) +else() add_definitions(-DSHOULD_BE_DEFINED_AND2) -endif(ONE_VAR AND ZERO_VAR) +endif() if(ZERO_VAR OR ONE_VAR2) add_definitions(-DSHOULD_BE_DEFINED_OR) -else(ZERO_VAR OR ONE_VAR2) +else() add_definitions(-DSHOULD_NOT_BE_DEFINED_OR) -endif(ZERO_VAR OR ONE_VAR2) +endif() if(ZERO_VAR OR ZERO_VAR2) add_definitions(-DSHOULD_NOT_BE_DEFINED_OR2) -else(ZERO_VAR OR ZERO_VAR2) +else() add_definitions(-DSHOULD_BE_DEFINED_OR2) -endif(ZERO_VAR OR ZERO_VAR2) +endif() if(STRING_VAR MATCHES "^CMake") add_definitions(-DSHOULD_BE_DEFINED_MATCHES) -else(STRING_VAR MATCHES "^CMake") +else() add_definitions(-DSHOULD_NOT_BE_DEFINED_MATCHES) -endif(STRING_VAR MATCHES "^CMake") +endif() if(STRING_VAR MATCHES "^foo") add_definitions(-DSHOULD_NOT_BE_DEFINED_MATCHES2) -else(STRING_VAR MATCHES "^foo") +else() add_definitions(-DSHOULD_BE_DEFINED_MATCHES2) -endif(STRING_VAR MATCHES "^foo") +endif() if(COMMAND "IF") add_definitions(-DSHOULD_BE_DEFINED_COMMAND) -else(COMMAND "IF") +else() add_definitions(-DSHOULD_NOT_BE_DEFINED_COMMAND) -endif(COMMAND "IF") +endif() if(COMMAND "ROQUEFORT") add_definitions(-DSHOULD_NOT_BE_DEFINED_COMMAND2) -else(COMMAND "ROQUEFORT") +else() add_definitions(-DSHOULD_BE_DEFINED_COMMAND2) -endif(COMMAND "ROQUEFORT") +endif() if (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) add_definitions(-DSHOULD_BE_DEFINED_EXISTS) -else(EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) +else() add_definitions(-DSHOULD_NOT_BE_DEFINED_EXISTS) -endif (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) +endif () if (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) add_definitions(-DSHOULD_NOT_BE_DEFINED_EXISTS2) -else(EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) +else() add_definitions(-DSHOULD_BE_DEFINED_EXISTS2) -endif (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) +endif () if (IS_DIRECTORY ${Complex_SOURCE_DIR}) add_definitions(-DSHOULD_BE_DEFINED_IS_DIRECTORY) -endif (IS_DIRECTORY ${Complex_SOURCE_DIR}) +endif () if (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake) add_definitions(-DSHOULD_BE_DEFINED_IS_DIRECTORY2) -endif (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake) +endif () set (SNUM1_VAR "1") set (SNUM2_VAR "2") @@ -110,78 +110,78 @@ set (SNUM3_VAR "1") if (SNUM1_VAR LESS SNUM2_VAR) add_definitions(-DSHOULD_BE_DEFINED_LESS) -else (SNUM1_VAR LESS SNUM2_VAR) +else () add_definitions(-DSHOULD_NOT_BE_DEFINED_LESS) -endif (SNUM1_VAR LESS SNUM2_VAR) +endif () if (SNUM2_VAR LESS SNUM1_VAR) add_definitions(-DSHOULD_NOT_BE_DEFINED_LESS2) -else (SNUM2_VAR LESS SNUM1_VAR) +else () add_definitions(-DSHOULD_BE_DEFINED_LESS2) -endif (SNUM2_VAR LESS SNUM1_VAR) +endif () if (SNUM2_VAR GREATER SNUM1_VAR) add_definitions(-DSHOULD_BE_DEFINED_GREATER) -else (SNUM2_VAR GREATER SNUM1_VAR) +else () add_definitions(-DSHOULD_NOT_BE_DEFINED_GREATER) -endif (SNUM2_VAR GREATER SNUM1_VAR) +endif () if (SNUM2_VAR EQUAL SNUM1_VAR) add_definitions(-DSHOULD_NOT_BE_DEFINED_EQUAL) -else (SNUM2_VAR EQUAL SNUM1_VAR) +else () add_definitions(-DSHOULD_BE_DEFINED_EQUAL) -endif (SNUM2_VAR EQUAL SNUM1_VAR) +endif () if (SNUM3_VAR EQUAL SNUM1_VAR) add_definitions(-DSHOULD_BE_DEFINED_EQUAL) -else (SNUM3_VAR EQUAL SNUM1_VAR) +else () add_definitions(-DSHOULD_NOT_BE_DEFINED_EQUAL) -endif (SNUM3_VAR EQUAL SNUM1_VAR) +endif () if (SNUM1_VAR GREATER SNUM2_VAR) add_definitions(-DSHOULD_NOT_BE_DEFINED_GREATER2) -else (SNUM1_VAR GREATER SNUM2_VAR) +else () add_definitions(-DSHOULD_BE_DEFINED_GREATER2) -endif (SNUM1_VAR GREATER SNUM2_VAR) +endif () set (SSTR1_VAR "abc") set (SSTR2_VAR "bcd") if (SSTR1_VAR STRLESS SSTR2_VAR) add_definitions(-DSHOULD_BE_DEFINED_STRLESS) -else (SSTR1_VAR STRLESS SSTR2_VAR) +else () add_definitions(-DSHOULD_NOT_BE_DEFINED_STRLESS) -endif (SSTR1_VAR STRLESS SSTR2_VAR) +endif () if (SSTR2_VAR STRLESS SSTR1_VAR) add_definitions(-DSHOULD_NOT_BE_DEFINED_STRLESS2) -else (SSTR2_VAR STRLESS SSTR1_VAR) +else () add_definitions(-DSHOULD_BE_DEFINED_STRLESS2) -endif (SSTR2_VAR STRLESS SSTR1_VAR) +endif () if (SSTR2_VAR STRGREATER SSTR1_VAR) add_definitions(-DSHOULD_BE_DEFINED_STRGREATER) -else (SSTR2_VAR STRGREATER SSTR1_VAR) +else () add_definitions(-DSHOULD_NOT_BE_DEFINED_STRGREATER) -endif (SSTR2_VAR STRGREATER SSTR1_VAR) +endif () if (SSTR1_VAR STRGREATER SSTR2_VAR) add_definitions(-DSHOULD_NOT_BE_DEFINED_STRGREATER2) -else (SSTR1_VAR STRGREATER SSTR2_VAR) +else () add_definitions(-DSHOULD_BE_DEFINED_STRGREATER2) -endif (SSTR1_VAR STRGREATER SSTR2_VAR) +endif () # # Test FOREACH # foreach (INDEX 1 2) set(FOREACH_VAR${INDEX} "VALUE${INDEX}") -endforeach(INDEX) +endforeach() set(FOREACH_CONCAT "") foreach (INDEX a;b;c;d;e;f;g) set(FOREACH_CONCAT "${FOREACH_CONCAT}${INDEX}") -endforeach(INDEX) +endforeach() # # Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt index 1080933..b0748fe 100644 --- a/Tests/ComplexOneConfig/CMakeLists.txt +++ b/Tests/ComplexOneConfig/CMakeLists.txt @@ -11,8 +11,8 @@ if(POLICY CMP0003) cmake_policy(GET CMP0003 P3) if(NOT "${P3}" STREQUAL "NEW") message(FATAL_ERROR "cmake_policy(GET) did not report NEW!") - endif(NOT "${P3}" STREQUAL "NEW") -endif(POLICY CMP0003) + endif() +endif() # Test building without per-rule echo lines in Makefiles. set_property(GLOBAL PROPERTY RULE_MESSAGES OFF) @@ -25,8 +25,8 @@ set(CPACK_SOURCE_IGNORE_FILES "~$;\\.cvsignore$;^C:/hoffman/My Builds/testcase.* macro(ASSERT value msg) if (NOT ${value}) message ("Assertion failure:" ${msg} ) - endif (NOT ${value}) -endmacro(ASSERT) + endif () +endmacro() # invoke the macro ASSERT(Complex_BINARY_DIR "The PROJECT command is broken") @@ -38,8 +38,8 @@ macro(TEST_ARGC value1 value2) add_definitions(${value1} ${value2}) if (${ARGC} MATCHES 4) add_definitions(${ARGV2} ${ARGV3}) - endif (${ARGC} MATCHES 4) -endmacro(TEST_ARGC) + endif () +endmacro() # invoke the macro TEST_ARGC(-DCMAKE_ARGV1 -DCMAKE_ARGV2 -DCMAKE_ARGV3 -DCMAKE_ARGV4) @@ -47,34 +47,34 @@ TEST_ARGC(-DCMAKE_ARGV1 -DCMAKE_ARGV2 -DCMAKE_ARGV3 -DCMAKE_ARGV4) macro(TEST_VAR_ARG fa) if("${ARGV}" MATCHES "^1;2;3$") message(STATUS "ARGV works") - else("${ARGV}" MATCHES "^1;2;3$") + else() message(FATAL_ERROR "ARGV does not work; got \"${ARGV}\" instead of \"1;2;3\"") - endif("${ARGV}" MATCHES "^1;2;3$") + endif() if("${ARGN}" MATCHES "^2;3$") message(STATUS "ARGN works") - else("${ARGN}" MATCHES "^2;3$") + else() message(FATAL_ERROR "ARGV does not work; got \"${ARGN}\" instead of \"2;3\"") - endif("${ARGN}" MATCHES "^2;3$") -endmacro(TEST_VAR_ARG) + endif() +endmacro() TEST_VAR_ARG(1 2 3) # Floating-point comparison test. if(2.4 LESS 2.4) message(FATAL_ERROR "Failed: 2.4 LESS 2.4") -endif(2.4 LESS 2.4) +endif() if(2.4 GREATER 2.4) message(FATAL_ERROR "Failed: 2.4 GREATER 2.4") -endif(2.4 GREATER 2.4) +endif() if(NOT 2.4 EQUAL 2.4) message(FATAL_ERROR "Failed: NOT 2.4 EQUAL 2.4") -endif(NOT 2.4 EQUAL 2.4) +endif() if(CMAKE_SYSTEM MATCHES "OSF1-V.*") if(NOT CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ") - endif(NOT CMAKE_COMPILER_IS_GNUCXX) -endif(CMAKE_SYSTEM MATCHES "OSF1-V.*") + endif() +endif() add_definitions(-DCMAKE_IS_FUN) @@ -93,7 +93,7 @@ separate_arguments(TEST_SEP) # if (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) include(${Complex_SOURCE_DIR}/VarTests.cmake) -endif (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) +endif () include(fileshouldnotbehere OPTIONAL) load_cache(${Complex_SOURCE_DIR}/Cache EXCLUDE @@ -104,9 +104,9 @@ load_cache(${Complex_SOURCE_DIR}/Cache load_cache(${Complex_SOURCE_DIR}/Cache READ_WITH_PREFIX foo CACHE_TEST_VAR2) if(${fooCACHE_TEST_VAR2} MATCHES bar) message("Load cache worked: ${fooCACHE_TEST_VAR2}") -else(${fooCACHE_TEST_VAR2} MATCHES bar) +else() message(FATAL_ERROR "Load cache with prefix failed: ${fooCACHE_TEST_VAR2}") -endif(${fooCACHE_TEST_VAR2} MATCHES bar) +endif() @@ -151,9 +151,9 @@ message("\nIgnore this message") option(NO_EXEC_PROGRAM "Do not test EXEC_PROGRAM" 0) if (NOT NO_EXEC_PROGRAM) exec_program(${CMAKE_COMMAND} ARGS -E echo NO_EXEC_PROGRAM "${Complex_BINARY_DIR}") -else (NOT NO_EXEC_PROGRAM) +else () message("Set this option ON") -endif (NOT NO_EXEC_PROGRAM) +endif () mark_as_advanced(NO_EXEC_PROGRAM) mark_as_advanced(CLEAR NO_EXEC_PROGRAM) @@ -164,9 +164,9 @@ execute_process( OUTPUT_VARIABLE TEST_OUT ) if("${TEST_OUT}" MATCHES "^ABCDEFG\n$") -else("${TEST_OUT}" MATCHES "^ABCDEFG\n$") +else() message(SEND_ERROR "EXECUTE_PROCESS output test failed: [${TEST_OUT}]") -endif("${TEST_OUT}" MATCHES "^ABCDEFG\n$") +endif() # This test has some problems on UNIX systems. Disabling for now. # @@ -180,9 +180,9 @@ endif("${TEST_OUT}" MATCHES "^ABCDEFG\n$") # if("${RESULT}" MATCHES "^0$") # message(SEND_ERROR # "EXECUTE_PROCESS result test failed with RESULT=[${RESULT}]") -# else("${RESULT}" MATCHES "^0$") +# else() # message(STATUS "EXECUTE_PROCESS result test passed with RESULT=[${RESULT}]") -# endif("${RESULT}" MATCHES "^0$") +# endif() # # Create directory. @@ -204,7 +204,7 @@ foreach (ext ${CMAKE_SHLIB_SUFFIX};.so;.a;.sl) ${Complex_SOURCE_DIR}/Library/dummy ${Complex_BINARY_DIR}/Library/libdummylib${ext} COPYONLY IMMEDIATE) -endforeach (ext) +endforeach () find_library(FIND_DUMMY_LIB dummylib @@ -258,8 +258,8 @@ if (WIN32) "[${hkey}]" DOC "Registry_Test_Path") exec_program(${CMAKE_COMMAND} ARGS "-E delete_regv \"${hkey}\"") exec_program(${CMAKE_COMMAND} ARGS "-E remove \"${dir}/${file}\"") - endif (NOT UNIX) -endif (WIN32) + endif () +endif () # # Test a set and a remove @@ -275,17 +275,17 @@ foreach(x "a") if(${x} MATCHES "a") # Should always execute. set(IF_INSIDE_FOREACH_THEN_EXECUTED 1) - else(${x} MATCHES "a") + else() # Should never execute. set(IF_INSIDE_FOREACH_ELSE_EXECUTED 1) - endif(${x} MATCHES "a") -endforeach(x) + endif() +endforeach() # test WHILE command set (while_var 1) while (while_var LESS 1000) set(while_var ${while_var}0) -endwhile(while_var LESS 1000) +endwhile() set(SHOULD_BE_ZERO ) set(SHOULD_BE_ONE 1) @@ -298,7 +298,7 @@ if (RESULT EQUAL 1) set (ELSEIF_RESULT 1) elseif (RESULT EQUAL 3) set (ELSEIF_RESULT 1) - endif (RESULT EQUAL 2) + endif () elseif (RESULT EQUAL 2) set (ELSEIF_RESULT 1) elseif (RESULT EQUAL 3) @@ -307,25 +307,25 @@ elseif (RESULT EQUAL 3) elseif (RESULT EQUAL 3) if (NOT ELSEIF_RESULT EQUAL 1) set (ELSEIF_RESULT 2) - endif (NOT ELSEIF_RESULT EQUAL 1) - endif (RESULT EQUAL 2) + endif () + endif () elseif (RESULT EQUAL 4) if (RESULT EQUAL 2) set (ELSEIF_RESULT 1) elseif (RESULT EQUAL 3) set (ELSEIF_RESULT 1) - endif (RESULT EQUAL 2) -else (RESULT EQUAL 1) + endif () +else () if (RESULT EQUAL 2) set (ELSEIF_RESULT 1) elseif (RESULT EQUAL 3) set (ELSEIF_RESULT 1) - endif (RESULT EQUAL 2) -endif (RESULT EQUAL 1) + endif () +endif () if (NOT ELSEIF_RESULT EQUAL 2) set (ELSEIF_RESULT 0) -endif (NOT ELSEIF_RESULT EQUAL 2) +endif () # test handling of parenthetical groups in conditionals if (2 GREATER 1 AND (4 LESS 3 OR 5 LESS 6) AND NOT (7 GREATER 8)) @@ -351,19 +351,19 @@ configure_file( string(REGEX MATCH "b" RESULT "abc") if(NOT RESULT) message(SEND_ERROR "string(REGEX MATCH ... ) test failed.") -endif(NOT RESULT) +endif() string(REGEX MATCHALL "b" RESULT "abcb") if(NOT RESULT) message(SEND_ERROR "string(REGEX MATCHALL ... ) test failed.") -endif(NOT RESULT) +endif() string(REGEX REPLACE ".([bd])." "[\\1]" RESULT "a(b)c(d)e") if("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") set(STRING_REGEX_PASSED 1) -endif("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") +endif() if(NOT STRING_REGEX_PASSED) message(SEND_ERROR "string(REGEX REPLACE ... ) test failed (\"${RESULT}\" v. \"a[b]c[d]e\")") -endif(NOT STRING_REGEX_PASSED) +endif() # diff --git a/Tests/ComplexOneConfig/Executable/CMakeLists.txt b/Tests/ComplexOneConfig/Executable/CMakeLists.txt index 4138835..432dbf8 100644 --- a/Tests/ComplexOneConfig/Executable/CMakeLists.txt +++ b/Tests/ComplexOneConfig/Executable/CMakeLists.txt @@ -11,16 +11,16 @@ add_library(ExeImportedTarget UNKNOWN IMPORTED) # Test if(TARGET) command. if(NOT TARGET CMakeTestLibrary) message(FATAL_ERROR "if(NOT TARGET CMakeTestLibrary) returned true!") -endif(NOT TARGET CMakeTestLibrary) +endif() if(NOT TARGET ExeImportedTarget) message(FATAL_ERROR "if(NOT TARGET ExeImportedTarget) returned true!") -endif(NOT TARGET ExeImportedTarget) +endif() if(TARGET LibImportedTarget) message(FATAL_ERROR "if(TARGET LibImportedTarget) returned true!") -endif(TARGET LibImportedTarget) +endif() if(TARGET NotATarget) message(FATAL_ERROR "if(TARGET NotATarget) returned true!") -endif(TARGET NotATarget) +endif() # Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to set(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared) @@ -46,37 +46,37 @@ add_executable(complex.file complex.file.cxx complex_nobuild.cxx if (UNIX) target_link_libraries(complex ${CMAKE_DL_LIBS}) -else(UNIX) +else() if (NOT BORLAND) if(NOT MINGW) target_link_libraries(complex rpcrt4.lib) - endif(NOT MINGW) - endif(NOT BORLAND) -endif (UNIX) + endif() + endif() +endif () # Test linking to static lib when a shared lib has the same name. if(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) add_definitions(-DCOMPLEX_TEST_LINK_STATIC) target_link_libraries(complex CMakeTestLinkStatic) -endif(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) +endif() # can we get the path to a source file get_source_file_property(A_LOCATION A.cxx LOCATION) if ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx") add_definitions(-DCMAKE_FOUND_ACXX) -endif ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx") +endif () # get the directory parent get_directory_property(P_VALUE PARENT_DIRECTORY) if ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}") add_definitions(-DCMAKE_FOUND_PARENT) -endif ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}") +endif () # get the stack of listfiles include(Included.cmake) if ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake") add_definitions(-DCMAKE_FOUND_LISTFILE_STACK) -endif ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake") +endif () # Test add/remove definitions. add_definitions( @@ -128,7 +128,7 @@ target_link_libraries(notInAllExe notInAllLib) if(MSVC) set_target_properties(notInAllExe PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBC;LIBCMT;MSVCRT") -endif(MSVC) +endif() # Test creating a custom target that builds not-in-all targets. add_custom_target(notInAllCustom) @@ -146,7 +146,7 @@ add_subdirectory(Temp) if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX) add_executable(testSystemDir testSystemDir.cxx) set_target_properties(testSystemDir PROPERTIES COMPILE_FLAGS "-Werror") -endif(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX) +endif() # # Extra coverage.Not used. diff --git a/Tests/ComplexOneConfig/Library/CMakeLists.txt b/Tests/ComplexOneConfig/Library/CMakeLists.txt index 41faeba..5c43052 100644 --- a/Tests/ComplexOneConfig/Library/CMakeLists.txt +++ b/Tests/ComplexOneConfig/Library/CMakeLists.txt @@ -33,10 +33,10 @@ if(WIN32) target_link_libraries(CMakeTestLibrary optimized kernel32.lib) - endif(NOT MINGW) - endif(NOT BORLAND) - endif(NOT CYGWIN) -endif(WIN32) + endif() + endif() + endif() +endif() # # Create shared library @@ -53,12 +53,12 @@ define_property( set_target_properties(CMakeTestCLibraryShared PROPERTIES FOO BAR) if(NOT BEOS AND NOT WIN32) # No libm on BeOS. set_target_properties(CMakeTestCLibraryShared PROPERTIES LINK_FLAGS "-lm") -endif(NOT BEOS AND NOT WIN32) +endif() get_target_property(FOO_BAR_VAR CMakeTestCLibraryShared FOO) if(${FOO_BAR_VAR} MATCHES "BAR") -else(${FOO_BAR_VAR} MATCHES "BAR") +else() message(SEND_ERROR "SET_TARGET_PROPERTIES or GET_TARGET_PROPERTY failed, FOO_BAR_VAR should be BAR, but is ${FOO_BAR_VAR}") -endif(${FOO_BAR_VAR} MATCHES "BAR") +endif() # Create static and shared lib of same name. if(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) @@ -66,7 +66,7 @@ if(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) add_library(CMakeTestLinkShared SHARED TestLink.c) set_target_properties(CMakeTestLinkStatic CMakeTestLinkShared PROPERTIES OUTPUT_NAME CMakeTestLink) -endif(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) +endif() # # Attach pre-build/pre-link/post-build custom-commands to the lib. @@ -127,7 +127,7 @@ if("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM) if(ARCH_COUNT GREATER 1) # OSX does not support preprocessing more than one architecture. set(MAYBE_ALL) - endif(ARCH_COUNT GREATER 1) + endif() # Custom target to try preprocessing invocation. add_custom_target(test_preprocess ${MAYBE_ALL} @@ -136,5 +136,5 @@ if("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM) COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/test_preprocess.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) - endif(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE) -endif("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM) + endif() +endif() diff --git a/Tests/ComplexOneConfig/Library/test_preprocess.cmake b/Tests/ComplexOneConfig/Library/test_preprocess.cmake index 885c613..4c8ec21 100644 --- a/Tests/ComplexOneConfig/Library/test_preprocess.cmake +++ b/Tests/ComplexOneConfig/Library/test_preprocess.cmake @@ -2,6 +2,6 @@ set(TEST_FILE CMakeFiles/create_file.dir/create_file.i) file(READ ${TEST_FILE} CONTENTS) if("${CONTENTS}" MATCHES "Unable to close") message(STATUS "${TEST_FILE} created successfully!") -else("${CONTENTS}" MATCHES "Unable to close") +else() message(FATAL_ERROR "${TEST_FILE} creation failed!") -endif("${CONTENTS}" MATCHES "Unable to close") +endif() diff --git a/Tests/ComplexOneConfig/VarTests.cmake b/Tests/ComplexOneConfig/VarTests.cmake index 7e968fd..52ec1fc 100644 --- a/Tests/ComplexOneConfig/VarTests.cmake +++ b/Tests/ComplexOneConfig/VarTests.cmake @@ -6,9 +6,9 @@ set (ZERO_VAR2 0) if(ZERO_VAR) add_definitions(-DSHOULD_NOT_BE_DEFINED) -else(ZERO_VAR) +else() add_definitions(-DSHOULD_BE_DEFINED) -endif(ZERO_VAR) +endif() set(ONE_VAR 1) set(ONE_VAR2 1) @@ -25,83 +25,83 @@ variable_requires(ONE_VAR # if(NOT ZERO_VAR) add_definitions(-DSHOULD_BE_DEFINED_NOT) -else(NOT ZERO_VAR) +else() add_definitions(-DSHOULD_NOT_BE_DEFINED_NOT) -endif(NOT ZERO_VAR) +endif() if(NOT ONE_VAR) add_definitions(-DSHOULD_NOT_BE_DEFINED_NOT2) -else(NOT ONE_VAR) +else() add_definitions(-DSHOULD_BE_DEFINED_NOT2) -endif(NOT ONE_VAR) +endif() if(ONE_VAR AND ONE_VAR2) add_definitions(-DSHOULD_BE_DEFINED_AND) -else(ONE_VAR AND ONE_VAR2) +else() add_definitions(-DSHOULD_NOT_BE_DEFINED_AND) -endif(ONE_VAR AND ONE_VAR2) +endif() if(ONE_VAR AND ZERO_VAR) add_definitions(-DSHOULD_NOT_BE_DEFINED_AND2) -else(ONE_VAR AND ZERO_VAR) +else() add_definitions(-DSHOULD_BE_DEFINED_AND2) -endif(ONE_VAR AND ZERO_VAR) +endif() if(ZERO_VAR OR ONE_VAR2) add_definitions(-DSHOULD_BE_DEFINED_OR) -else(ZERO_VAR OR ONE_VAR2) +else() add_definitions(-DSHOULD_NOT_BE_DEFINED_OR) -endif(ZERO_VAR OR ONE_VAR2) +endif() if(ZERO_VAR OR ZERO_VAR2) add_definitions(-DSHOULD_NOT_BE_DEFINED_OR2) -else(ZERO_VAR OR ZERO_VAR2) +else() add_definitions(-DSHOULD_BE_DEFINED_OR2) -endif(ZERO_VAR OR ZERO_VAR2) +endif() if(STRING_VAR MATCHES "^CMake") add_definitions(-DSHOULD_BE_DEFINED_MATCHES) -else(STRING_VAR MATCHES "^CMake") +else() add_definitions(-DSHOULD_NOT_BE_DEFINED_MATCHES) -endif(STRING_VAR MATCHES "^CMake") +endif() if(STRING_VAR MATCHES "^foo") add_definitions(-DSHOULD_NOT_BE_DEFINED_MATCHES2) -else(STRING_VAR MATCHES "^foo") +else() add_definitions(-DSHOULD_BE_DEFINED_MATCHES2) -endif(STRING_VAR MATCHES "^foo") +endif() if(COMMAND "IF") add_definitions(-DSHOULD_BE_DEFINED_COMMAND) -else(COMMAND "IF") +else() add_definitions(-DSHOULD_NOT_BE_DEFINED_COMMAND) -endif(COMMAND "IF") +endif() if(COMMAND "ROQUEFORT") add_definitions(-DSHOULD_NOT_BE_DEFINED_COMMAND2) -else(COMMAND "ROQUEFORT") +else() add_definitions(-DSHOULD_BE_DEFINED_COMMAND2) -endif(COMMAND "ROQUEFORT") +endif() if (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) add_definitions(-DSHOULD_BE_DEFINED_EXISTS) -else(EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) +else() add_definitions(-DSHOULD_NOT_BE_DEFINED_EXISTS) -endif (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) +endif () if (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) add_definitions(-DSHOULD_NOT_BE_DEFINED_EXISTS2) -else(EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) +else() add_definitions(-DSHOULD_BE_DEFINED_EXISTS2) -endif (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) +endif () if (IS_DIRECTORY ${Complex_SOURCE_DIR}) add_definitions(-DSHOULD_BE_DEFINED_IS_DIRECTORY) -endif (IS_DIRECTORY ${Complex_SOURCE_DIR}) +endif () if (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake) add_definitions(-DSHOULD_BE_DEFINED_IS_DIRECTORY2) -endif (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake) +endif () set (SNUM1_VAR "1") set (SNUM2_VAR "2") @@ -110,78 +110,78 @@ set (SNUM3_VAR "1") if (SNUM1_VAR LESS SNUM2_VAR) add_definitions(-DSHOULD_BE_DEFINED_LESS) -else (SNUM1_VAR LESS SNUM2_VAR) +else () add_definitions(-DSHOULD_NOT_BE_DEFINED_LESS) -endif (SNUM1_VAR LESS SNUM2_VAR) +endif () if (SNUM2_VAR LESS SNUM1_VAR) add_definitions(-DSHOULD_NOT_BE_DEFINED_LESS2) -else (SNUM2_VAR LESS SNUM1_VAR) +else () add_definitions(-DSHOULD_BE_DEFINED_LESS2) -endif (SNUM2_VAR LESS SNUM1_VAR) +endif () if (SNUM2_VAR GREATER SNUM1_VAR) add_definitions(-DSHOULD_BE_DEFINED_GREATER) -else (SNUM2_VAR GREATER SNUM1_VAR) +else () add_definitions(-DSHOULD_NOT_BE_DEFINED_GREATER) -endif (SNUM2_VAR GREATER SNUM1_VAR) +endif () if (SNUM2_VAR EQUAL SNUM1_VAR) add_definitions(-DSHOULD_NOT_BE_DEFINED_EQUAL) -else (SNUM2_VAR EQUAL SNUM1_VAR) +else () add_definitions(-DSHOULD_BE_DEFINED_EQUAL) -endif (SNUM2_VAR EQUAL SNUM1_VAR) +endif () if (SNUM3_VAR EQUAL SNUM1_VAR) add_definitions(-DSHOULD_BE_DEFINED_EQUAL) -else (SNUM3_VAR EQUAL SNUM1_VAR) +else () add_definitions(-DSHOULD_NOT_BE_DEFINED_EQUAL) -endif (SNUM3_VAR EQUAL SNUM1_VAR) +endif () if (SNUM1_VAR GREATER SNUM2_VAR) add_definitions(-DSHOULD_NOT_BE_DEFINED_GREATER2) -else (SNUM1_VAR GREATER SNUM2_VAR) +else () add_definitions(-DSHOULD_BE_DEFINED_GREATER2) -endif (SNUM1_VAR GREATER SNUM2_VAR) +endif () set (SSTR1_VAR "abc") set (SSTR2_VAR "bcd") if (SSTR1_VAR STRLESS SSTR2_VAR) add_definitions(-DSHOULD_BE_DEFINED_STRLESS) -else (SSTR1_VAR STRLESS SSTR2_VAR) +else () add_definitions(-DSHOULD_NOT_BE_DEFINED_STRLESS) -endif (SSTR1_VAR STRLESS SSTR2_VAR) +endif () if (SSTR2_VAR STRLESS SSTR1_VAR) add_definitions(-DSHOULD_NOT_BE_DEFINED_STRLESS2) -else (SSTR2_VAR STRLESS SSTR1_VAR) +else () add_definitions(-DSHOULD_BE_DEFINED_STRLESS2) -endif (SSTR2_VAR STRLESS SSTR1_VAR) +endif () if (SSTR2_VAR STRGREATER SSTR1_VAR) add_definitions(-DSHOULD_BE_DEFINED_STRGREATER) -else (SSTR2_VAR STRGREATER SSTR1_VAR) +else () add_definitions(-DSHOULD_NOT_BE_DEFINED_STRGREATER) -endif (SSTR2_VAR STRGREATER SSTR1_VAR) +endif () if (SSTR1_VAR STRGREATER SSTR2_VAR) add_definitions(-DSHOULD_NOT_BE_DEFINED_STRGREATER2) -else (SSTR1_VAR STRGREATER SSTR2_VAR) +else () add_definitions(-DSHOULD_BE_DEFINED_STRGREATER2) -endif (SSTR1_VAR STRGREATER SSTR2_VAR) +endif () # # Test FOREACH # foreach (INDEX 1 2) set(FOREACH_VAR${INDEX} "VALUE${INDEX}") -endforeach(INDEX) +endforeach() set(FOREACH_CONCAT "") foreach (INDEX a;b;c;d;e;f;g) set(FOREACH_CONCAT "${FOREACH_CONCAT}${INDEX}") -endforeach(INDEX) +endforeach() # # Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt index 58408d7..d3ced3f 100644 --- a/Tests/CustomCommand/CMakeLists.txt +++ b/Tests/CustomCommand/CMakeLists.txt @@ -337,7 +337,7 @@ if(NOT MINGW) # * # MinGW programs on windows always expands the wildcard! # / # MSys make converts a leading slash to the mingw home directory list(APPEND CHECK_ARGS * /) -endif(NOT MINGW) +endif() # The windows command shell does not support a double quote by itself: # double\"quote @@ -359,7 +359,7 @@ foreach(arg ${CHECK_ARGS} "") set(EXPECTED_ARGUMENTS "${EXPECTED_ARGUMENTS} \"${ARG}\", ") -endforeach(arg) +endforeach() configure_file(${CMAKE_CURRENT_SOURCE_DIR}/check_command_line.c.in ${CMAKE_CURRENT_BINARY_DIR}/check_command_line.c @ONLY IMMEDIATE) diff --git a/Tests/CustomCommand/check_mark.cmake b/Tests/CustomCommand/check_mark.cmake index f8638d4..1f47fd0 100644 --- a/Tests/CustomCommand/check_mark.cmake +++ b/Tests/CustomCommand/check_mark.cmake @@ -1,5 +1,5 @@ if(EXISTS "${MARK_FILE}") message(FATAL_ERROR "Custom command run more than once!") -else(EXISTS "${MARK_FILE}") +else() file(WRITE "${MARK_FILE}" "check for running custom command twice\n") -endif(EXISTS "${MARK_FILE}") +endif() diff --git a/Tests/EnforceConfig.cmake.in b/Tests/EnforceConfig.cmake.in index 27ee1fd..8c0817c 100644 --- a/Tests/EnforceConfig.cmake.in +++ b/Tests/EnforceConfig.cmake.in @@ -1,9 +1,9 @@ # Choose a configuration with which to drive CTest tests. if(CTEST_CONFIGURATION_TYPE) set(CTestTest_CONFIG "${CTEST_CONFIGURATION_TYPE}") -else(CTEST_CONFIGURATION_TYPE) +else() set(CTestTest_CONFIG "@CTestTest_CONFIG@") -endif(CTEST_CONFIGURATION_TYPE) +endif() # Choose a configuration that was built if none is given. if(NOT CTEST_CONFIGURATION_TYPE) @@ -14,13 +14,13 @@ if(NOT CTEST_CONFIGURATION_TYPE) if(NOT CTEST_CONFIGURATION_TYPE) if(EXISTS "${CTEST_DIR}/${cfg}/${CTEST_EXE}") set(CTEST_CONFIGURATION_TYPE ${cfg}) - endif(EXISTS "${CTEST_DIR}/${cfg}/${CTEST_EXE}") - endif(NOT CTEST_CONFIGURATION_TYPE) - endforeach(cfg) + endif() + endif() + endforeach() if(NOT CTEST_CONFIGURATION_TYPE) set(CTEST_CONFIGURATION_TYPE NoConfig) - endif(NOT CTEST_CONFIGURATION_TYPE) + endif() message("Guessing configuration ${CTEST_CONFIGURATION_TYPE}") -endif(NOT CTEST_CONFIGURATION_TYPE) +endif() @TEST_HOME_ENV_CODE@ diff --git a/Tests/ExportImport/CMakeLists.txt b/Tests/ExportImport/CMakeLists.txt index ccfb894..d6593e8 100644 --- a/Tests/ExportImport/CMakeLists.txt +++ b/Tests/ExportImport/CMakeLists.txt @@ -14,13 +14,13 @@ set_property( if(CMAKE_CONFIGURATION_TYPES) set(NESTED_CONFIG_TYPE -C "${CMAKE_CFG_INTDIR}") -else(CMAKE_CONFIGURATION_TYPES) +else() if(CMAKE_BUILD_TYPE) set(NESTED_CONFIG_TYPE -C "${CMAKE_BUILD_TYPE}") - else(CMAKE_BUILD_TYPE) + else() set(NESTED_CONFIG_TYPE) - endif(CMAKE_BUILD_TYPE) -endif(CMAKE_CONFIGURATION_TYPES) + endif() +endif() if(MINGW OR MSYS) # Test CMAKE_GNUtoMS whether we have VS or not. diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt index f06a465..f118c30 100644 --- a/Tests/ExportImport/Export/CMakeLists.txt +++ b/Tests/ExportImport/Export/CMakeLists.txt @@ -56,7 +56,7 @@ add_library(testLib6 STATIC testLib6.cxx testLib6c.c) set(VS6) if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") set(VS6 1) -endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") +endif() # Test using the target_link_libraries command to set the # LINK_INTERFACE_LIBRARIES* properties. We construct two libraries @@ -129,7 +129,7 @@ install(EXPORT exp NAMESPACE exp_ DESTINATION lib/exp) # Install testLib5.dll outside the export. if(WIN32) install(TARGETS testLib5 RUNTIME DESTINATION bin) -endif(WIN32) +endif() # Export from build tree. export(TARGETS testExe1 testLib1 testLib2 testLib3 diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt index a21e1b0..650af6a 100644 --- a/Tests/ExportImport/Import/A/CMakeLists.txt +++ b/Tests/ExportImport/Import/A/CMakeLists.txt @@ -73,7 +73,7 @@ target_link_libraries(imp_mod1b bld_testExe2) foreach(c DEBUG RELWITHDEBINFO) set_property(TARGET imp_testExe1 PROPERTY COMPILE_DEFINITIONS_${c} EXE_DBG) set_property(TARGET imp_testExe1b PROPERTY COMPILE_DEFINITIONS_${c} EXE_DBG) -endforeach(c) +endforeach() #----------------------------------------------------------------------------- # Create a custom target to generate a header for the libraries below. diff --git a/Tests/ExternalOBJ/CMakeLists.txt b/Tests/ExternalOBJ/CMakeLists.txt index 542bfab..458c88b 100644 --- a/Tests/ExternalOBJ/CMakeLists.txt +++ b/Tests/ExternalOBJ/CMakeLists.txt @@ -7,9 +7,9 @@ if(APPLE) # check for Power PC and change to ppc if("${_CMAKE_OSX_MACHINE}" MATCHES "Power") set(_CMAKE_OSX_MACHINE ppc) - endif("${_CMAKE_OSX_MACHINE}" MATCHES "Power") + endif() set(CMAKE_OSX_ARCHITECTURES ${_CMAKE_OSX_MACHINE}) -endif(APPLE) +endif() # Build the external object file. try_compile(EXTERNAL_OBJECT_BUILT @@ -24,12 +24,12 @@ if(EXTERNAL_OBJECT_BUILT) "Building external_object.cxx succeeded with the following output:\n" "[${OUTPUT}]" ) -else(EXTERNAL_OBJECT_BUILT) +else() message(FATAL_ERROR "Building external_object.cxx failed with the following output:\n" "[${OUTPUT}]" ) -endif(EXTERNAL_OBJECT_BUILT) +endif() # Find the external object file. set(DIR ${ExternalOBJ_BINARY_DIR}/Object) @@ -38,9 +38,9 @@ file(GLOB_RECURSE EXTERNAL_OBJECT if(EXTERNAL_OBJECT) list (GET EXTERNAL_OBJECT 0 EXTERNAL_OBJECT) message("Found \"${EXTERNAL_OBJECT}\".") -else(EXTERNAL_OBJECT) +else() message(FATAL_ERROR "Could not find external object.") -endif(EXTERNAL_OBJECT) +endif() # Test creation of external objects by custom commands. set(CUSTOM_OBJECT diff --git a/Tests/ExternalOBJ/Object/CMakeLists.txt b/Tests/ExternalOBJ/Object/CMakeLists.txt index b24e91b..dbfe09e 100644 --- a/Tests/ExternalOBJ/Object/CMakeLists.txt +++ b/Tests/ExternalOBJ/Object/CMakeLists.txt @@ -6,8 +6,8 @@ if(APPLE) # check for Power PC and change to ppc if("${_CMAKE_OSX_MACHINE}" MATCHES "Power") set(_CMAKE_OSX_MACHINE ppc) - endif("${_CMAKE_OSX_MACHINE}" MATCHES "Power") + endif() set(CMAKE_OSX_ARCHITECTURES ${_CMAKE_OSX_MACHINE}) -endif(APPLE) +endif() add_executable(external external_object.cxx external_main.cxx) diff --git a/Tests/ExternalProject/TryCheckout.cmake b/Tests/ExternalProject/TryCheckout.cmake index de069eb..6a396c3 100644 --- a/Tests/ExternalProject/TryCheckout.cmake +++ b/Tests/ExternalProject/TryCheckout.cmake @@ -25,7 +25,7 @@ function(try_cvs_checkout repository module dir result_var) message(STATUS "try_cvs_checkout -- done") endif() -endfunction(try_cvs_checkout) +endfunction() function(try_svn_checkout repository dir result_var) @@ -51,4 +51,4 @@ function(try_svn_checkout repository dir result_var) message(STATUS "try_svn_checkout -- done") endif() -endfunction(try_svn_checkout) +endfunction() diff --git a/Tests/FindModulesExecuteAll/CMakeLists.txt b/Tests/FindModulesExecuteAll/CMakeLists.txt index df51626..21b9d38 100644 --- a/Tests/FindModulesExecuteAll/CMakeLists.txt +++ b/Tests/FindModulesExecuteAll/CMakeLists.txt @@ -23,8 +23,8 @@ foreach(module ${all_modules}) # disabled for now, since too many modules break: # if(NOT DEFINED ${packageNameUpper}_FOUND) # message(SEND_ERROR "${packageNameUpper}_FOUND not defined !") -# endif(NOT DEFINED ${packageNameUpper}_FOUND) +# endif() -endforeach(module ${all_modules}) +endforeach() add_executable(FindModulesExecuteAll main.c) diff --git a/Tests/FindPackageTest/Baz 1.1/BazConfigVersion.cmake b/Tests/FindPackageTest/Baz 1.1/BazConfigVersion.cmake index 61db416..979bbdf 100644 --- a/Tests/FindPackageTest/Baz 1.1/BazConfigVersion.cmake +++ b/Tests/FindPackageTest/Baz 1.1/BazConfigVersion.cmake @@ -3,6 +3,6 @@ if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) set(PACKAGE_VERSION_COMPATIBLE 1) if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) set(PACKAGE_VERSION_EXACT 1) - endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) -endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) + endif() +endif() diff --git a/Tests/FindPackageTest/Baz 1.2/CMake/BazConfigVersion.cmake b/Tests/FindPackageTest/Baz 1.2/CMake/BazConfigVersion.cmake index e0042d5..17caaa7 100644 --- a/Tests/FindPackageTest/Baz 1.2/CMake/BazConfigVersion.cmake +++ b/Tests/FindPackageTest/Baz 1.2/CMake/BazConfigVersion.cmake @@ -3,6 +3,6 @@ if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) set(PACKAGE_VERSION_COMPATIBLE 1) if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2) set(PACKAGE_VERSION_EXACT 1) - endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2) -endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) + endif() +endif() diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt index d344649..bca149b 100644 --- a/Tests/FindPackageTest/CMakeLists.txt +++ b/Tests/FindPackageTest/CMakeLists.txt @@ -30,7 +30,7 @@ find_path(FOO_DIR foo.h) if(NOT FOO_DIR) message(FATAL_ERROR "Did not find foo.h which is in ${CMAKE_CURRENT_SOURCE_DIR}/include CMAKE_PREFIX_PATH = ${CMAKE_PREFIX_PATH}") -endif(NOT FOO_DIR) +endif() find_package(VersionTestA 1) find_package(VersionTestB 1.2) @@ -93,7 +93,7 @@ set(PACKAGES ) foreach(p ${PACKAGES}) set(${p}_DIR "" CACHE FILEPATH "Wipe out find results for testing." FORCE) -endforeach(p) +endforeach() # Enable framework and bundle searching. Make sure bundles are found # before unix-syle packages. @@ -238,58 +238,58 @@ foreach(p ${PACKAGES}) # Debugging output. if(CMAKE_FIND_DEBUG_MODE) message("Package ${p} found [${REL_${p}_CONFIG}]") - endif(CMAKE_FIND_DEBUG_MODE) + endif() # Check and report failure. if(NOT "${REL_${p}_CONFIG}" STREQUAL "${${p}_EXPECTED}") message(SEND_ERROR "Package ${p} should have been [${${p}_EXPECTED}] but " "was [${REL_${p}_CONFIG}]") - endif(NOT "${REL_${p}_CONFIG}" STREQUAL "${${p}_EXPECTED}") + endif() else() message(SEND_ERROR "Package ${p} not found!") endif() -endforeach(p) +endforeach() # Check that version information was extracted. if(NOT "${VersionedA_VERSION}" STREQUAL "2.0") message(SEND_ERROR "Package VersionedA is version [${VersionedA_VERSION}], not [2.0]") -endif(NOT "${VersionedA_VERSION}" STREQUAL "2.0") +endif() if(NOT "${VersionedA_VERSION_MAJOR}" STREQUAL "2") message(SEND_ERROR "Package VersionedA is major version [${VersionedA_VERSION_MAJOR}], not [2]") -endif(NOT "${VersionedA_VERSION_MAJOR}" STREQUAL "2") +endif() if(NOT "${VersionedA_VERSION_MINOR}" STREQUAL "0") message(SEND_ERROR "Package VersionedA is minor version [${VersionedA_VERSION_MINOR}], not [0]") -endif(NOT "${VersionedA_VERSION_MINOR}" STREQUAL "0") +endif() if(NOT "${VersionedB_VERSION}" STREQUAL "3.1") message(SEND_ERROR "Package VersionedB is version [${VersionedB_VERSION}], not [3.1]") -endif(NOT "${VersionedB_VERSION}" STREQUAL "3.1") +endif() if(NOT "${VersionedB_VERSION_MAJOR}" STREQUAL "3") message(SEND_ERROR "Package VersionedB is major version [${VersionedB_VERSION_MAJOR}], not [3]") -endif(NOT "${VersionedB_VERSION_MAJOR}" STREQUAL "3") +endif() if(NOT "${VersionedB_VERSION_MINOR}" STREQUAL "1") message(SEND_ERROR "Package VersionedB is minor version [${VersionedB_VERSION_MINOR}], not [1]") -endif(NOT "${VersionedB_VERSION_MINOR}" STREQUAL "1") +endif() if(NOT "${Special_VERSION}" STREQUAL "1.2") message(SEND_ERROR "Package Special is version [${Special_VERSION}], not [1.2]") -endif(NOT "${Special_VERSION}" STREQUAL "1.2") +endif() if(NOT "${Special_VERSION_MAJOR}" STREQUAL "1") message(SEND_ERROR "Package Special is major version [${Special_VERSION_MAJOR}], not [1]") -endif(NOT "${Special_VERSION_MAJOR}" STREQUAL "1") +endif() if(NOT "${Special_VERSION_MINOR}" STREQUAL "2") message(SEND_ERROR "Package Special is minor version [${Special_VERSION_MINOR}], not [2]") -endif(NOT "${Special_VERSION_MINOR}" STREQUAL "2") +endif() # Test version number comparison. if(NOT "1.2.3.4" VERSION_LESS "1.2.3.5") diff --git a/Tests/FindPackageTest/FindVersionTestA.cmake b/Tests/FindPackageTest/FindVersionTestA.cmake index c6031d9..9828593 100644 --- a/Tests/FindPackageTest/FindVersionTestA.cmake +++ b/Tests/FindPackageTest/FindVersionTestA.cmake @@ -1,18 +1,18 @@ if(NOT "${VersionTestA_FIND_VERSION}" STREQUAL "1") message(SEND_ERROR "VersionTestA_FIND_VERSION=${VersionTestA_FIND_VERSION} is not 1") -endif(NOT "${VersionTestA_FIND_VERSION}" STREQUAL "1") +endif() if(NOT "${VersionTestA_FIND_VERSION_MAJOR}" STREQUAL "1") message(SEND_ERROR "VersionTestA_FIND_VERSION_MAJOR=${VersionTestA_FIND_VERSION_MAJOR} is not 1") -endif(NOT "${VersionTestA_FIND_VERSION_MAJOR}" STREQUAL "1") +endif() if(NOT "${VersionTestA_FIND_VERSION_MINOR}" STREQUAL "0") message(SEND_ERROR "VersionTestA_FIND_VERSION_MINOR=${VersionTestA_FIND_VERSION_MINOR} is not 0") -endif(NOT "${VersionTestA_FIND_VERSION_MINOR}" STREQUAL "0") +endif() if(NOT "${VersionTestA_FIND_VERSION_PATCH}" STREQUAL "0") message(SEND_ERROR "VersionTestA_FIND_VERSION_PATCH=${VersionTestA_FIND_VERSION_PATCH} is not 0") -endif(NOT "${VersionTestA_FIND_VERSION_PATCH}" STREQUAL "0") +endif() if(NOT "${VersionTestA_FIND_VERSION_TWEAK}" STREQUAL "0") message(SEND_ERROR "VersionTestA_FIND_VERSION_TWEAK=${VersionTestA_FIND_VERSION_TWEAK} is not 0") -endif(NOT "${VersionTestA_FIND_VERSION_TWEAK}" STREQUAL "0") +endif() if(NOT "${VersionTestA_FIND_VERSION_COUNT}" STREQUAL "1") message(SEND_ERROR "VersionTestA_FIND_VERSION_COUNT=${VersionTestA_FIND_VERSION_COUNT} is not 1") -endif(NOT "${VersionTestA_FIND_VERSION_COUNT}" STREQUAL "1") +endif() diff --git a/Tests/FindPackageTest/FindVersionTestB.cmake b/Tests/FindPackageTest/FindVersionTestB.cmake index 914d5a7..1ebb823 100644 --- a/Tests/FindPackageTest/FindVersionTestB.cmake +++ b/Tests/FindPackageTest/FindVersionTestB.cmake @@ -1,18 +1,18 @@ if(NOT "${VersionTestB_FIND_VERSION}" STREQUAL "1.2") message(SEND_ERROR "VersionTestB_FIND_VERSION=${VersionTestB_FIND_VERSION} is not 1.2") -endif(NOT "${VersionTestB_FIND_VERSION}" STREQUAL "1.2") +endif() if(NOT "${VersionTestB_FIND_VERSION_MAJOR}" STREQUAL "1") message(SEND_ERROR "VersionTestB_FIND_VERSION_MAJOR=${VersionTestB_FIND_VERSION_MAJOR} is not 1") -endif(NOT "${VersionTestB_FIND_VERSION_MAJOR}" STREQUAL "1") +endif() if(NOT "${VersionTestB_FIND_VERSION_MINOR}" STREQUAL "2") message(SEND_ERROR "VersionTestB_FIND_VERSION_MINOR=${VersionTestB_FIND_VERSION_MINOR} is not 2") -endif(NOT "${VersionTestB_FIND_VERSION_MINOR}" STREQUAL "2") +endif() if(NOT "${VersionTestB_FIND_VERSION_PATCH}" STREQUAL "0") message(SEND_ERROR "VersionTestB_FIND_VERSION_PATCH=${VersionTestB_FIND_VERSION_PATCH} is not 0") -endif(NOT "${VersionTestB_FIND_VERSION_PATCH}" STREQUAL "0") +endif() if(NOT "${VersionTestB_FIND_VERSION_TWEAK}" STREQUAL "0") message(SEND_ERROR "VersionTestB_FIND_VERSION_TWEAK=${VersionTestB_FIND_VERSION_TWEAK} is not 0") -endif(NOT "${VersionTestB_FIND_VERSION_TWEAK}" STREQUAL "0") +endif() if(NOT "${VersionTestB_FIND_VERSION_COUNT}" STREQUAL "2") message(SEND_ERROR "VersionTestB_FIND_VERSION_COUNT=${VersionTestB_FIND_VERSION_COUNT} is not 2") -endif(NOT "${VersionTestB_FIND_VERSION_COUNT}" STREQUAL "2") +endif() diff --git a/Tests/FindPackageTest/FindVersionTestC.cmake b/Tests/FindPackageTest/FindVersionTestC.cmake index 66e07ea..450c2e9 100644 --- a/Tests/FindPackageTest/FindVersionTestC.cmake +++ b/Tests/FindPackageTest/FindVersionTestC.cmake @@ -1,18 +1,18 @@ if(NOT "${VersionTestC_FIND_VERSION}" STREQUAL "1.2.3") message(SEND_ERROR "VersionTestC_FIND_VERSION=${VersionTestC_FIND_VERSION} is not 1.2.3") -endif(NOT "${VersionTestC_FIND_VERSION}" STREQUAL "1.2.3") +endif() if(NOT "${VersionTestC_FIND_VERSION_MAJOR}" STREQUAL "1") message(SEND_ERROR "VersionTestC_FIND_VERSION_MAJOR=${VersionTestC_FIND_VERSION_MAJOR} is not 1") -endif(NOT "${VersionTestC_FIND_VERSION_MAJOR}" STREQUAL "1") +endif() if(NOT "${VersionTestC_FIND_VERSION_MINOR}" STREQUAL "2") message(SEND_ERROR "VersionTestC_FIND_VERSION_MINOR=${VersionTestC_FIND_VERSION_MINOR} is not 2") -endif(NOT "${VersionTestC_FIND_VERSION_MINOR}" STREQUAL "2") +endif() if(NOT "${VersionTestC_FIND_VERSION_PATCH}" STREQUAL "3") message(SEND_ERROR "VersionTestC_FIND_VERSION_PATCH=${VersionTestC_FIND_VERSION_PATCH} is not 3") -endif(NOT "${VersionTestC_FIND_VERSION_PATCH}" STREQUAL "3") +endif() if(NOT "${VersionTestC_FIND_VERSION_TWEAK}" STREQUAL "0") message(SEND_ERROR "VersionTestC_FIND_VERSION_TWEAK=${VersionTestC_FIND_VERSION_TWEAK} is not 0") -endif(NOT "${VersionTestC_FIND_VERSION_TWEAK}" STREQUAL "0") +endif() if(NOT "${VersionTestC_FIND_VERSION_COUNT}" STREQUAL "3") message(SEND_ERROR "VersionTestC_FIND_VERSION_COUNT=${VersionTestC_FIND_VERSION_COUNT} is not 3") -endif(NOT "${VersionTestC_FIND_VERSION_COUNT}" STREQUAL "3") +endif() diff --git a/Tests/FindPackageTest/FindVersionTestD.cmake b/Tests/FindPackageTest/FindVersionTestD.cmake index 88d9299..9f2db72 100644 --- a/Tests/FindPackageTest/FindVersionTestD.cmake +++ b/Tests/FindPackageTest/FindVersionTestD.cmake @@ -1,18 +1,18 @@ if(NOT "${VersionTestD_FIND_VERSION}" STREQUAL "1.2.3.4") message(SEND_ERROR "VersionTestD_FIND_VERSION=${VersionTestD_FIND_VERSION} is not 1.2.3.4") -endif(NOT "${VersionTestD_FIND_VERSION}" STREQUAL "1.2.3.4") +endif() if(NOT "${VersionTestD_FIND_VERSION_MAJOR}" STREQUAL "1") message(SEND_ERROR "VersionTestD_FIND_VERSION_MAJOR=${VersionTestD_FIND_VERSION_MAJOR} is not 1") -endif(NOT "${VersionTestD_FIND_VERSION_MAJOR}" STREQUAL "1") +endif() if(NOT "${VersionTestD_FIND_VERSION_MINOR}" STREQUAL "2") message(SEND_ERROR "VersionTestD_FIND_VERSION_MINOR=${VersionTestD_FIND_VERSION_MINOR} is not 2") -endif(NOT "${VersionTestD_FIND_VERSION_MINOR}" STREQUAL "2") +endif() if(NOT "${VersionTestD_FIND_VERSION_PATCH}" STREQUAL "3") message(SEND_ERROR "VersionTestD_FIND_VERSION_PATCH=${VersionTestD_FIND_VERSION_PATCH} is not 3") -endif(NOT "${VersionTestD_FIND_VERSION_PATCH}" STREQUAL "3") +endif() if(NOT "${VersionTestD_FIND_VERSION_TWEAK}" STREQUAL "4") message(SEND_ERROR "VersionTestD_FIND_VERSION_TWEAK=${VersionTestD_FIND_VERSION_TWEAK} is not 4") -endif(NOT "${VersionTestD_FIND_VERSION_TWEAK}" STREQUAL "4") +endif() if(NOT "${VersionTestD_FIND_VERSION_COUNT}" STREQUAL "4") message(SEND_ERROR "VersionTestD_FIND_VERSION_COUNT=${VersionTestD_FIND_VERSION_COUNT} is not 4") -endif(NOT "${VersionTestD_FIND_VERSION_COUNT}" STREQUAL "4") +endif() diff --git a/Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config-version.cmake b/Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config-version.cmake index 514e830..822b449 100644 --- a/Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config-version.cmake @@ -3,5 +3,5 @@ if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4) set(PACKAGE_VERSION_COMPATIBLE 1) if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0) set(PACKAGE_VERSION_EXACT 1) - endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0) -endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4) + endif() +endif() diff --git a/Tests/FindPackageTest/lib/arch/zot-3.1/zot-config-version.cmake b/Tests/FindPackageTest/lib/arch/zot-3.1/zot-config-version.cmake index 59fe59d..31573b9 100644 --- a/Tests/FindPackageTest/lib/arch/zot-3.1/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/arch/zot-3.1/zot-config-version.cmake @@ -3,5 +3,5 @@ if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) set(PACKAGE_VERSION_COMPATIBLE 1) if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) set(PACKAGE_VERSION_EXACT 1) - endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) -endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) + endif() +endif() diff --git a/Tests/FindPackageTest/lib/cmake/zot-4.0/zot-config-version.cmake b/Tests/FindPackageTest/lib/cmake/zot-4.0/zot-config-version.cmake index 7afcc9b..bcefcd7 100644 --- a/Tests/FindPackageTest/lib/cmake/zot-4.0/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/cmake/zot-4.0/zot-config-version.cmake @@ -3,6 +3,6 @@ if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4) set(PACKAGE_VERSION_COMPATIBLE 1) if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0) set(PACKAGE_VERSION_EXACT 1) - endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0) -endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4) + endif() +endif() diff --git a/Tests/FindPackageTest/lib/suffix/test/SuffixTestConfigVersion.cmake b/Tests/FindPackageTest/lib/suffix/test/SuffixTestConfigVersion.cmake index 4e8ee82..b37bc8e 100644 --- a/Tests/FindPackageTest/lib/suffix/test/SuffixTestConfigVersion.cmake +++ b/Tests/FindPackageTest/lib/suffix/test/SuffixTestConfigVersion.cmake @@ -3,5 +3,5 @@ if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) set(PACKAGE_VERSION_COMPATIBLE 1) if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2) set(PACKAGE_VERSION_EXACT 1) - endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2) -endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) + endif() +endif() diff --git a/Tests/FindPackageTest/lib/zot-2.0/zot-config-version.cmake b/Tests/FindPackageTest/lib/zot-2.0/zot-config-version.cmake index 78e41a5..db3a8a4 100644 --- a/Tests/FindPackageTest/lib/zot-2.0/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/zot-2.0/zot-config-version.cmake @@ -1,5 +1,5 @@ set(PACKAGE_VERSION 2.0) if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 2) set(PACKAGE_VERSION_COMPATIBLE 1) -endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 2) +endif() diff --git a/Tests/FindPackageTest/lib/zot-3.0/zot-config-version.cmake b/Tests/FindPackageTest/lib/zot-3.0/zot-config-version.cmake index 8e3daff..dd9c939 100644 --- a/Tests/FindPackageTest/lib/zot-3.0/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/zot-3.0/zot-config-version.cmake @@ -1,5 +1,5 @@ set(PACKAGE_VERSION 3.0) if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) set(PACKAGE_VERSION_COMPATIBLE 1) -endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) +endif() diff --git a/Tests/FindPackageTest/lib/zot-3.1/zot-config-version.cmake b/Tests/FindPackageTest/lib/zot-3.1/zot-config-version.cmake index b09c008..8fa767e 100644 --- a/Tests/FindPackageTest/lib/zot-3.1/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/zot-3.1/zot-config-version.cmake @@ -3,6 +3,6 @@ if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) set(PACKAGE_VERSION_COMPATIBLE 1) if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) set(PACKAGE_VERSION_EXACT 1) - endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) -endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) + endif() +endif() diff --git a/Tests/FindPackageTest/lib/zot/zot-config-version.cmake b/Tests/FindPackageTest/lib/zot/zot-config-version.cmake index 5674f70..430f009 100644 --- a/Tests/FindPackageTest/lib/zot/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/zot/zot-config-version.cmake @@ -5,6 +5,6 @@ if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) set(PACKAGE_VERSION_COMPATIBLE 1) if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) set(PACKAGE_VERSION_EXACT 1) - endif("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) -endif("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) + endif() +endif() diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt index 679ec83..6e78f42 100644 --- a/Tests/Fortran/CMakeLists.txt +++ b/Tests/Fortran/CMakeLists.txt @@ -167,7 +167,7 @@ if(CMAKE_Fortran_COMPILER_SUPPORTS_F90) add_executable(test_preprocess test_preprocess.F90) set(TEST_MODULE_DEPENDS 1) -endif(CMAKE_Fortran_COMPILER_SUPPORTS_F90) +endif() if(TEST_MODULE_DEPENDS) # Build the external project separately using a custom target. @@ -175,10 +175,10 @@ if(TEST_MODULE_DEPENDS) if(CMAKE_CONFIGURATION_TYPES) set(External_CONFIG_TYPE -C "${CMAKE_CFG_INTDIR}") set(External_BUILD_TYPE) - else(CMAKE_CONFIGURATION_TYPES) + else() set(External_CONFIG_TYPE) set(External_BUILD_TYPE -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}) - endif(CMAKE_CONFIGURATION_TYPES) + endif() set(External_SOURCE_DIR "${testf_SOURCE_DIR}/External") set(External_BINARY_DIR "${testf_BINARY_DIR}/External") if("${testf_BINARY_DIR}" MATCHES " ") @@ -211,10 +211,10 @@ if(TEST_MODULE_DEPENDS) # Test module output directory if available. if(CMAKE_Fortran_MODDIR_FLAG) set(Library_MODDIR "${testf_BINARY_DIR}/Library/modules") - else(CMAKE_Fortran_MODDIR_FLAG) + else() set(Library_MODDIR "${testf_BINARY_DIR}/Library") - endif(CMAKE_Fortran_MODDIR_FLAG) + endif() add_subdirectory(Library) add_subdirectory(Executable) -endif(TEST_MODULE_DEPENDS) +endif() diff --git a/Tests/Fortran/Library/CMakeLists.txt b/Tests/Fortran/Library/CMakeLists.txt index 6e39cda..17438ca 100644 --- a/Tests/Fortran/Library/CMakeLists.txt +++ b/Tests/Fortran/Library/CMakeLists.txt @@ -8,4 +8,4 @@ if(CMAKE_Fortran_MODDIR_FLAG) set_target_properties(subdir_mods PROPERTIES Fortran_MODULE_DIRECTORY modules ) -endif(CMAKE_Fortran_MODDIR_FLAG) +endif() diff --git a/Tests/FunctionTest/CMakeLists.txt b/Tests/FunctionTest/CMakeLists.txt index 204a824..d1fada4 100644 --- a/Tests/FunctionTest/CMakeLists.txt +++ b/Tests/FunctionTest/CMakeLists.txt @@ -4,63 +4,63 @@ project (FunctionTest) function(FAILED testname) message(SEND_ERROR "${testname} failed ${ARGN}") -endfunction(FAILED) +endfunction() function(PASS testname) message("${testname} passed ${ARGN}") -endfunction(PASS) +endfunction() # test scope set(COUNT 3) function(scope_test) set(COUNT 4) -endfunction(scope_test) +endfunction() scope_test() if(COUNT EQUAL "3") PASS("scope") -else(COUNT EQUAL "3") +else() FAILED("COUNT Got: ${COUNT}") -endif(COUNT EQUAL "3") +endif() # test ARGC function(weird_name) if("${ARGC}" EQUAL "3") PASS("ARGC") - else("${ARGC}" EQUAL "3") + else() FAILED("ARGC" "Got: ${ARGC}") - endif("${ARGC}" EQUAL "3") -endfunction(weird_name) + endif() +endfunction() WeIrD_nAmE(a1 a2 a3) # test ARGN function(test_argn_function argument) if("${ARGN}" EQUAL "3") PASS("ARGN") - else("${ARGN}" EQUAL "3") + else() FAILED("ARGN" "Got: ${ARGN}") - endif("${ARGN}" EQUAL "3") -endfunction(test_argn_function) + endif() +endfunction() Test_Argn_Function(ignored 3) # test argument naming and raise scope function(track_find_variable cache_variable is_changed) set("${is_changed}" changed PARENT_SCOPE) -endfunction(track_find_variable) +endfunction() track_find_variable(testvar is_changed) if ("${is_changed}" STREQUAL changed) pass("same argument name test") -else ("${is_changed}" STREQUAL changed) +else () pass("same argument name test") -endif ("${is_changed}" STREQUAL changed) +endif () include("Util.cmake") tester() if (tester_res STREQUAL "${CMAKE_CURRENT_LIST_FILE}") pass("CMAKE_CURRENT_LIST_FILE test") -else (tester_res STREQUAL "${CMAKE_CURRENT_LIST_FILE}") +else () pass("CMAKE_CURRENT_LIST_FILE test") -endif (tester_res STREQUAL "${CMAKE_CURRENT_LIST_FILE}") +endif () @@ -68,67 +68,67 @@ endif (tester_res STREQUAL "${CMAKE_CURRENT_LIST_FILE}") function (factorial argument result) if (argument LESS 2) set (lresult 1) - else (argument LESS 2) + else () math (EXPR temp "${argument} - 1") factorial (${temp} tresult) math (EXPR lresult "${argument}*${tresult}") - endif (argument LESS 2) + endif () set ("${result}" "${lresult}" PARENT_SCOPE) -endfunction (factorial) +endfunction () factorial (5 fresult) if (fresult EQUAL 120) pass("factorial") -else (fresult EQUAL 120) +else () failed ("factorial, computed ${fresult} instead of 120") -endif (fresult EQUAL 120) +endif () # case test function(strange_function m) set("${m}" strange_function PARENT_SCOPE) -endfunction(strange_function m) +endfunction() STRANGE_FUNCTION(var) set(second_var "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() FAILED("Case test" "(${var} ${second_var})") -endif("${var}" STREQUAL "strange_function" AND "${second_var}" STREQUAL "second_var") +endif() # test backing up command function(ADD_EXECUTABLE exec) _ADD_EXECUTABLE(mini${exec} ${ARGN}) -endfunction(ADD_EXECUTABLE) +endfunction() # var undef case function(undef_var m) set("${m}" PARENT_SCOPE) -endfunction(undef_var) +endfunction() set(FUNCTION_UNDEFINED 1) undef_var(FUNCTION_UNDEFINED) if(DEFINED FUNCTION_UNDEFINED) FAILED("Function Undefine Test" "(${FUNCTION_UNDEFINED})") -else(DEFINED FUNCTION_UNDEFINED) +else() PASS("Function Undefine Test" "(${FUNCTION_UNDEFINED})") -endif(DEFINED FUNCTION_UNDEFINED) +endif() # Subdirectory scope raise. set(SUBDIR_UNDEFINED 1) add_subdirectory(SubDirScope) if(DEFINED SUBDIR_UNDEFINED) FAILED("Subdir Undefine Test" "(${SUBDIR_UNDEFINED})") -else(DEFINED SUBDIR_UNDEFINED) +else() PASS("Subdir Undefine Test" "(${SUBDIR_UNDEFINED})") -endif(DEFINED SUBDIR_UNDEFINED) +endif() if(DEFINED SUBDIR_DEFINED) PASS("Subdir Define Test" "(${SUBDIR_DEFINED})") -else(DEFINED SUBDIR_DEFINED) +else() FAILED("Subdir Define Test" "(${SUBDIR_DEFINED})") -endif(DEFINED SUBDIR_DEFINED) +endif() # Test function-scoped directory. function(ADD_SUBDIR2 dir) @@ -136,15 +136,15 @@ function(ADD_SUBDIR2 dir) # The parent scope sets in the subdir should be visible here. if(DEFINED SUBDIR_UNDEFINED) FAILED("Subdir Function Undefine Test 1" "(${SUBDIR_UNDEFINED})") - else(DEFINED SUBDIR_UNDEFINED) + else() PASS("Subdir Function Undefine Test 1" "(${SUBDIR_UNDEFINED})") - endif(DEFINED SUBDIR_UNDEFINED) + endif() if(DEFINED SUBDIR_DEFINED) PASS("Subdir Function Define Test 1" "(${SUBDIR_DEFINED})") - else(DEFINED SUBDIR_DEFINED) + else() FAILED("Subdir Function Define Test 1" "(${SUBDIR_DEFINED})") - endif(DEFINED SUBDIR_DEFINED) -endfunction(ADD_SUBDIR2) + endif() +endfunction() # Reset test variables. set(SUBDIR_UNDEFINED 1) @@ -156,14 +156,14 @@ ADD_SUBDIR2(SubDirScope) # The parent scope sets in the subdir should not be visible here. if(DEFINED SUBDIR_UNDEFINED) PASS("Subdir Function Undefine Test 2" "(${SUBDIR_UNDEFINED})") -else(DEFINED SUBDIR_UNDEFINED) +else() FAILED("Subdir Function Undefine Test 2" "(${SUBDIR_UNDEFINED})") -endif(DEFINED SUBDIR_UNDEFINED) +endif() if(DEFINED SUBDIR_DEFINED) FAILED("Subdir Function Define Test 2" "(${SUBDIR_DEFINED})") -else(DEFINED SUBDIR_DEFINED) +else() PASS("Subdir Function Define Test 2" "(${SUBDIR_DEFINED})") -endif(DEFINED SUBDIR_DEFINED) +endif() add_executable(FunctionTest functionTest.c) diff --git a/Tests/FunctionTest/SubDirScope/CMakeLists.txt b/Tests/FunctionTest/SubDirScope/CMakeLists.txt index c40fadb..c1a3cfb 100644 --- a/Tests/FunctionTest/SubDirScope/CMakeLists.txt +++ b/Tests/FunctionTest/SubDirScope/CMakeLists.txt @@ -4,11 +4,11 @@ set(SUBDIR_UNDEFINED PARENT_SCOPE) # The above sets should not affect the current scope. if(DEFINED SUBDIR_UNDEFINED) PASS("SubdirScope Undefine Test" "(${SUBDIR_UNDEFINED})") -else(DEFINED SUBDIR_UNDEFINED) +else() FAILED("SubdirScope Undefine Test" "(${SUBDIR_UNDEFINED})") -endif(DEFINED SUBDIR_UNDEFINED) +endif() if(DEFINED SUBDIR_DEFINED) FAILED("SubdirScope Define Test" "(${SUBDIR_DEFINED})") -else(DEFINED SUBDIR_DEFINED) +else() PASS("SubdirScope Define Test" "(${SUBDIR_DEFINED})") -endif(DEFINED SUBDIR_DEFINED) +endif() diff --git a/Tests/FunctionTest/Util.cmake b/Tests/FunctionTest/Util.cmake index f0c73b5..846abd7 100644 --- a/Tests/FunctionTest/Util.cmake +++ b/Tests/FunctionTest/Util.cmake @@ -1,3 +1,3 @@ function(tester) set (tester_res "${CMAKE_CURRENT_LIST_FILE}" PARENT_SCOPE) -endfunction(tester) +endfunction() diff --git a/Tests/JCTest/CMakeLists.txt b/Tests/JCTest/CMakeLists.txt index 17cea0f..31dcc3a 100644 --- a/Tests/JCTest/CMakeLists.txt +++ b/Tests/JCTest/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(TestTime TestTime.cxx) foreach(f 1 2 3 4 5 6 7 8 9 10 11 12 12 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30) add_test(TestTime${f} TestTime 50000000) -endforeach(f) +endforeach() diff --git a/Tests/Jump/Executable/CMakeLists.txt b/Tests/Jump/Executable/CMakeLists.txt index a09bac7..bc6731f 100644 --- a/Tests/Jump/Executable/CMakeLists.txt +++ b/Tests/Jump/Executable/CMakeLists.txt @@ -1,6 +1,6 @@ if(NOT LIBRARY_OUTPUT_PATH) link_directories(${Jump_BINARY_DIR}/Library/Static ${Jump_BINARY_DIR}/Library/Shared) -endif(NOT LIBRARY_OUTPUT_PATH) +endif() add_executable(jumpExecutable jumpExecutable.cxx) target_link_libraries(jumpExecutable jumpStatic jumpShared) diff --git a/Tests/Jump/Library/Shared/CMakeLists.txt b/Tests/Jump/Library/Shared/CMakeLists.txt index 87d40e5..a37299a 100644 --- a/Tests/Jump/Library/Shared/CMakeLists.txt +++ b/Tests/Jump/Library/Shared/CMakeLists.txt @@ -6,7 +6,7 @@ endif() if(APPLE) set(SHARED_MUST_BE_IN_EXE_DIR 1) -endif(APPLE) +endif() if(SHARED_MUST_BE_IN_EXE_DIR) set(LIB_NAME @@ -14,13 +14,13 @@ if(SHARED_MUST_BE_IN_EXE_DIR) set(EXE_DIR ${Jump_BINARY_DIR}/Executable) if(EXECUTABLE_OUTPUT_PATH) set(EXE_DIR ${EXECUTABLE_OUTPUT_PATH}) - endif(EXECUTABLE_OUTPUT_PATH) + endif() set(LIB_DIR ${Jump_BINARY_DIR}/Library/Shared) if(LIBRARY_OUTPUT_PATH) set(LIB_DIR ${LIBRARY_OUTPUT_PATH}) - endif(LIBRARY_OUTPUT_PATH) + endif() add_custom_command(TARGET jumpShared POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy ${LIB_DIR}/${CMAKE_CFG_INTDIR}/${LIB_NAME} ${EXE_DIR}/${CMAKE_CFG_INTDIR}/${LIB_NAME}) -endif(SHARED_MUST_BE_IN_EXE_DIR) +endif() diff --git a/Tests/LibName/CMakeLists.txt b/Tests/LibName/CMakeLists.txt index b3ad311..3ac125f 100644 --- a/Tests/LibName/CMakeLists.txt +++ b/Tests/LibName/CMakeLists.txt @@ -13,7 +13,7 @@ add_executable(foobar foobar.c) target_link_libraries(foobar foo) if(UNIX) target_link_libraries(foobar -L/usr/local/lib) -endif(UNIX) +endif() # check with lib version diff --git a/Tests/LoadCommand/CMakeCommands/CMakeLists.txt b/Tests/LoadCommand/CMakeCommands/CMakeLists.txt index 276fdb6..99b1aba 100644 --- a/Tests/LoadCommand/CMakeCommands/CMakeLists.txt +++ b/Tests/LoadCommand/CMakeCommands/CMakeLists.txt @@ -3,7 +3,7 @@ project(CMAKE_LOADED_COMMANDS) if (MUDSLIDE_TYPE MATCHES MUCHO) add_definitions(-DMUCHO_MUDSLIDE) -endif (MUDSLIDE_TYPE MATCHES MUCHO) +endif () include_directories(${CMAKE_ROOT}/include ${CMAKE_ROOT}/Source) @@ -11,4 +11,4 @@ add_library(cmCMAKE_TEST_COMMAND MODULE cmTestCommand.c) if(WATCOM) target_link_libraries(cmCMAKE_TEST_COMMAND clbsdll.lib) -endif(WATCOM) +endif() diff --git a/Tests/LoadCommand/CMakeLists.txt b/Tests/LoadCommand/CMakeLists.txt index 9787f83..c933798 100644 --- a/Tests/LoadCommand/CMakeLists.txt +++ b/Tests/LoadCommand/CMakeLists.txt @@ -20,7 +20,7 @@ include_directories(${LoadCommand_BINARY_DIR}) # try to compile the command # make sure it is not already loaded if(COMMAND CMAKE_TEST_COMMAND) -else(COMMAND CMAKE_TEST_COMMAND) +else() try_compile(COMPILE_OK ${LoadCommand_BINARY_DIR}/CMakeCommands ${LoadCommand_SOURCE_DIR}/CMakeCommands @@ -33,7 +33,7 @@ else(COMMAND CMAKE_TEST_COMMAND) ${LoadCommand_SOURCE_DIR}/CMakeCommands CMAKE_LOADED_COMMANDS CMAKE_FLAGS -DMUDSLIDE_TYPE:STRING=MUCHO OUTPUT_VARIABLE OUTPUT ) -endif(COMMAND CMAKE_TEST_COMMAND) +endif() message("Output from try compile: ${OUTPUT}") @@ -51,13 +51,13 @@ if (COMPILE_OK) "${LoadCommand_BINARY_DIR}/LoadedCommand2.cxx.in" "${LoadCommand_BINARY_DIR}/LoadedCommand3.cxx" ) - endif (COMMAND CMAKE_TEST_COMMAND) -else (COMPILE_OK) + endif () +else () message("failed to compile CMAKE_LOADED_COMMANDS") -endif (COMPILE_OK) +endif () # TEST_DEF is set by the loaded command cmTestCommand.c if (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC) add_definitions(-DCMAKE_IS_FUN) -endif (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC) +endif () diff --git a/Tests/LoadCommandOneConfig/CMakeCommands/CMakeLists.txt b/Tests/LoadCommandOneConfig/CMakeCommands/CMakeLists.txt index 2d96b04..5ee2ed0 100644 --- a/Tests/LoadCommandOneConfig/CMakeCommands/CMakeLists.txt +++ b/Tests/LoadCommandOneConfig/CMakeCommands/CMakeLists.txt @@ -3,15 +3,15 @@ project(CMAKE_LOADED_COMMANDS) if (MUDSLIDE_TYPE MATCHES MUCHO) add_definitions(-DMUCHO_MUDSLIDE) -endif (MUDSLIDE_TYPE MATCHES MUCHO) +endif () if(WATCOM) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") -endif(WATCOM) +endif() include_directories(${CMAKE_ROOT}/include ${CMAKE_ROOT}/Source) add_library(cmCMAKE_TEST_COMMAND MODULE cmTestCommand.c) if(WATCOM) target_link_libraries(cmCMAKE_TEST_COMMAND clbsdll.lib) -endif(WATCOM) +endif() diff --git a/Tests/LoadCommandOneConfig/CMakeLists.txt b/Tests/LoadCommandOneConfig/CMakeLists.txt index a443605..a75ad5a 100644 --- a/Tests/LoadCommandOneConfig/CMakeLists.txt +++ b/Tests/LoadCommandOneConfig/CMakeLists.txt @@ -26,7 +26,7 @@ include_directories(${LoadCommand_BINARY_DIR}) # try to compile the command # make sure it is not already loaded if(COMMAND CMAKE_TEST_COMMAND) -else(COMMAND CMAKE_TEST_COMMAND) +else() try_compile(COMPILE_OK ${LoadCommand_BINARY_DIR}/CMakeCommands ${LoadCommand_SOURCE_DIR}/CMakeCommands @@ -39,7 +39,7 @@ else(COMMAND CMAKE_TEST_COMMAND) ${LoadCommand_SOURCE_DIR}/CMakeCommands CMAKE_LOADED_COMMANDS CMAKE_FLAGS -DMUDSLIDE_TYPE:STRING=MUCHO OUTPUT_VARIABLE OUTPUT ) -endif(COMMAND CMAKE_TEST_COMMAND) +endif() message("Output from try compile: ${OUTPUT}") @@ -57,13 +57,13 @@ if (COMPILE_OK) "${LoadCommand_BINARY_DIR}/LoadedCommand2.cxx.in" "${LoadCommand_BINARY_DIR}/LoadedCommand3.cxx" ) - endif (COMMAND CMAKE_TEST_COMMAND) -else (COMPILE_OK) + endif () +else () message("failed to compile CMAKE_LOADED_COMMANDS") -endif (COMPILE_OK) +endif () # TEST_DEF is set by the loaded command cmTestCommand.c if (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC) add_definitions(-DCMAKE_IS_FUN) -endif (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC) +endif () 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() diff --git a/Tests/MakeClean/CMakeLists.txt b/Tests/MakeClean/CMakeLists.txt index 7400754..13348a2 100644 --- a/Tests/MakeClean/CMakeLists.txt +++ b/Tests/MakeClean/CMakeLists.txt @@ -13,12 +13,12 @@ if(TOCLEAN_BUILT) "Building ToClean succeeded with the following output:\n" "[${OUTPUT}]" ) -else(TOCLEAN_BUILT) +else() message(FATAL_ERROR "Building ToClean failed with the following output:\n" "[${OUTPUT}]" ) -endif(TOCLEAN_BUILT) +endif() # Get the set of files to check from the ToClean project. include(${MakeClean_BINARY_DIR}/ToClean/ToCleanFiles.cmake) @@ -26,16 +26,16 @@ include(${MakeClean_BINARY_DIR}/ToClean/ToCleanFiles.cmake) # Check for the existence of the files. foreach(f ${TOCLEAN_FILES}) if(EXISTS "${f}") - else(EXISTS "${f}") + else() message(FATAL_ERROR "File \"${f}\" does not exist!") - endif(EXISTS "${f}") -endforeach(f) + endif() +endforeach() # Configure an executable to check that all the files are missing. set(CHECK_FILES) foreach(f ${TOCLEAN_FILES}) set(CHECK_FILES "${CHECK_FILES} \"${f}\",\n") -endforeach(f) +endforeach() configure_file(${MakeClean_SOURCE_DIR}/check_clean.c.in ${MakeClean_BINARY_DIR}/check_clean.c @ONLY IMMEDIATE) add_executable(check_clean ${MakeClean_BINARY_DIR}/check_clean.c) diff --git a/Tests/MathTest/CMakeLists.txt b/Tests/MathTest/CMakeLists.txt index 44d4aae..34beaa0 100644 --- a/Tests/MathTest/CMakeLists.txt +++ b/Tests/MathTest/CMakeLists.txt @@ -17,7 +17,7 @@ foreach(expression ${expressions}) math(EXPR expr "${expression}") set(FILE_EXPRESSIONS "${FILE_EXPRESSIONS}TEST_EXPRESSION(${expression}, ${expr})\n") -endforeach(expression) +endforeach() configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/MathTestTests.h.in" diff --git a/Tests/OutOfSource/CMakeLists.txt b/Tests/OutOfSource/CMakeLists.txt index 420310f..de1603a 100644 --- a/Tests/OutOfSource/CMakeLists.txt +++ b/Tests/OutOfSource/CMakeLists.txt @@ -8,7 +8,7 @@ get_directory_property(ANIMAL DIRECTORY OutOfSourceSubdir DEFINITION WEASELS) get_directory_property(ANIMALREL DIRECTORY SubDir/../OutOfSourceSubdir DEFINITION WEASELS) if(NOT "${ANIMAL}" STREQUAL "${ANIMALREL}") message(FATAL_ERROR "GET_DIRECTORY_PROPERTY does not seem to collapse paths.") -endif(NOT "${ANIMAL}" STREQUAL "${ANIMALREL}") +endif() configure_file( ${OutOfSource_SOURCE_DIR}/testdp.h.in diff --git a/Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt b/Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt index d418809..10a2f59 100644 --- a/Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt +++ b/Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt @@ -36,7 +36,7 @@ if ("${PROJECT_SOURCE_DIR}" STREQUAL "${ANOTHER_PROJ_SOURCE_DIR}") while("${DEEPDIR_LEN}" LESS "${MAXPATH}") set(DEEPDIR ${DEEPDIR}/and/deeper) string(LENGTH "${DEEPDIR}" DEEPDIR_LEN) - endwhile("${DEEPDIR_LEN}" LESS "${MAXPATH}") + endwhile() set(DEEPSRC ${DEEPDIR}/simple.cxx) string(LENGTH "${DEEPSRC}" DEEPSRC_LEN) configure_file(simple.cxx.in ${DEEPSRC} COPYONLY) @@ -46,12 +46,12 @@ if ("${PROJECT_SOURCE_DIR}" STREQUAL "${ANOTHER_PROJ_SOURCE_DIR}") if(${CMAKE_GENERATOR} MATCHES "Watcom WMake") set(DEEPSRC "") add_definitions(-DNO_DEEPSRC) - endif(${CMAKE_GENERATOR} MATCHES "Watcom WMake") + endif() add_library(testlib testlib.cxx) add_executable (simple simple.cxx ../simple.cxx ${DEEPSRC}) target_link_libraries(simple testlib outlib) -endif ("${PROJECT_SOURCE_DIR}" STREQUAL "${ANOTHER_PROJ_SOURCE_DIR}") +endif () # test getting a definition from a subdir set (WEASELS SIZZLING) @@ -59,4 +59,4 @@ set (WEASELS SIZZLING) get_directory_property(incDirs INCLUDE_DIRECTORIES) if(NOT incDirs) message(FATAL_ERROR "get_directory_property(INCLUDE_DIRECTORIES) returned empty list") -endif(NOT incDirs) +endif() diff --git a/Tests/PolicyScope/CMakeLists.txt b/Tests/PolicyScope/CMakeLists.txt index e6f2edc..413195a 100644 --- a/Tests/PolicyScope/CMakeLists.txt +++ b/Tests/PolicyScope/CMakeLists.txt @@ -7,7 +7,7 @@ function(check msg lhs rhs) if(NOT "${lhs}" STREQUAL "${rhs}") message(FATAL_ERROR "${msg}: expected [${lhs}], got [${rhs}]") endif() -endfunction(check) +endfunction() #----------------------------------------------------------------------------- # Test using a development framework that sets policies for us. @@ -52,7 +52,7 @@ if(1) # CMP0002 should be changed when this function is invoked cmake_policy(GET CMP0002 cmp) check(CMP0002 "OLD" "${cmp}") - endfunction(func1) + endfunction() # Unset CMP0002 cmake_policy(VERSION 2.4) @@ -65,8 +65,8 @@ if(1) cmake_policy(SET CMP0002 OLD) cmake_policy(GET CMP0002 cmp) check(CMP0002 "OLD" "${cmp}") - endmacro(macro1) -endif(1) + endmacro() +endif() cmake_policy(POP) # CMP0002 should still be NEW in this context. diff --git a/Tests/PrecompiledHeader/CMakeLists.txt b/Tests/PrecompiledHeader/CMakeLists.txt index e5ac6d3..6958131 100644 --- a/Tests/PrecompiledHeader/CMakeLists.txt +++ b/Tests/PrecompiledHeader/CMakeLists.txt @@ -12,28 +12,28 @@ if(CMAKE_CONFIGURATION_TYPES) foreach(cfg ${CMAKE_CONFIGURATION_TYPES}) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/PCH/${cfg}) endforeach() -else(CMAKE_CONFIGURATION_TYPES) +else() set(PCH_DIR "${CMAKE_CURRENT_BINARY_DIR}/PCH") file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/PCH) -endif(CMAKE_CONFIGURATION_TYPES) +endif() # The VS6 IDE does not support renaming .pch files with /Fp. if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") set(PCH_USE_INCLUDE_DIR 1) set(PCH_FILE) -else("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") +else() set(PCH_USE_INCLUDE_DIR 0) set(PCH_FILE "\"/Fp${PCH_DIR}/foo_precompiled.pch\"") -endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") +endif() # Choose between an explicit include path and using /I during # precompilation. The /I form is used to test that the PCH is # actually used. In practice the include path form would be used. if(PCH_USE_INCLUDE_DIR) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) -else(PCH_USE_INCLUDE_DIR) +else() set(PCH_INCLUDE_DIR "\"/I${CMAKE_CURRENT_SOURCE_DIR}/include\"") -endif(PCH_USE_INCLUDE_DIR) +endif() # Create a target that will use a precompiled header. set(foo_SRCS foo1.c foo2.c) @@ -56,4 +56,4 @@ if("${CMAKE_GENERATOR}" MATCHES "Makefile" OR # These source files use the precompiled header. set_source_files_properties(${foo_SRCS} PROPERTIES OBJECT_DEPENDS "${PCH_DIR}/foo_precompiled.pch") -endif("${CMAKE_GENERATOR}" MATCHES "Makefile") +endif() diff --git a/Tests/Preprocess/CMakeLists.txt b/Tests/Preprocess/CMakeLists.txt index 1ed7b83..78746e7 100644 --- a/Tests/Preprocess/CMakeLists.txt +++ b/Tests/Preprocess/CMakeLists.txt @@ -9,37 +9,37 @@ project(Preprocess) # to work with each tool and documents those known to not work. if("${CMAKE_GENERATOR}" MATCHES "Xcode") set(PP_XCODE 1) -endif("${CMAKE_GENERATOR}" MATCHES "Xcode") +endif() if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") set(PP_VS6 1) -endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") +endif() if("${CMAKE_GENERATOR}" MATCHES "Unix Makefiles") set(PP_UMAKE 1) -endif("${CMAKE_GENERATOR}" MATCHES "Unix Makefiles") +endif() if("${CMAKE_GENERATOR}" MATCHES "NMake Makefiles") set(PP_NMAKE 1) -endif("${CMAKE_GENERATOR}" MATCHES "NMake Makefiles") +endif() if("${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles") set(PP_MINGW 1) -endif("${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles") +endif() if("${CMAKE_GENERATOR}" MATCHES "Borland Makefiles") set(PP_BORLAND 1) -endif("${CMAKE_GENERATOR}" MATCHES "Borland Makefiles") +endif() if("${CMAKE_GENERATOR}" MATCHES "Watcom WMake") set(PP_WATCOM 1) -endif("${CMAKE_GENERATOR}" MATCHES "Watcom WMake") +endif() if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 7$") set(PP_VS70 1) -endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio 7$") +endif() if("${CMAKE_GENERATOR}" MATCHES "Visual Studio") set(PP_VS 1) -endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio") +endif() if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 10") set(PP_VS100 1) -endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio 10") +endif() if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 11") set(PP_VS110 1) -endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio 11") +endif() # Some tests below check the PP_* variables set above. They are meant # to test the case that the build tool is at fault. Other tests below @@ -80,8 +80,8 @@ if(NOT PP_VS6) # trouble passing to other tools, and the compiler may be directly # invoked from the command line. set(STRING_EXTRA "${STRING_EXTRA} ") - endif(NOT PP_BORLAND AND NOT PP_WATCOM) -endif(NOT PP_VS6) + endif() +endif() if(NOT PP_VS) # VS: , @@ -89,21 +89,21 @@ if(NOT PP_VS) # The comma-separated list of PreprocessorDefinitions in the project # file seems to be parsed before the content of entries is examined. set(STRING_EXTRA "${STRING_EXTRA},") -endif(NOT PP_VS) +endif() if(NOT PP_MINGW) # MinGW: & # When inside -D"FOO=\"a & b\"" MinGW make wants -D"FOO=\"a "&" b\"" # but it does not like quoted ampersand elsewhere. set(STRING_EXTRA "${STRING_EXTRA}&") -endif(NOT PP_MINGW) +endif() if(NOT PP_MINGW) # MinGW: | # When inside -D"FOO=\"a | b\"" MinGW make wants -D"FOO=\"a "|" b\"" # but it does not like quoted pipe elsewhere. set(STRING_EXTRA "${STRING_EXTRA}|") -endif(NOT PP_MINGW) +endif() if(NOT PP_BORLAND AND NOT PP_MINGW AND NOT PP_NMAKE) # Borland, NMake, MinGW: ^ @@ -111,13 +111,13 @@ if(NOT PP_BORLAND AND NOT PP_MINGW AND NOT PP_NMAKE) # but do not like quoted carrot elsewhere. In NMake the non-quoted # syntax works when the flags are not in a make variable. set(STRING_EXTRA "${STRING_EXTRA}^") -endif(NOT PP_BORLAND AND NOT PP_MINGW AND NOT PP_NMAKE) +endif() if(NOT PP_BORLAND AND NOT PP_MINGW AND NOT PP_NMAKE) # Borland, MinGW: < > # Angle-brackets have funny behavior that is hard to escape. set(STRING_EXTRA "${STRING_EXTRA}<>") -endif(NOT PP_BORLAND AND NOT PP_MINGW AND NOT PP_NMAKE) +endif() set(EXPR_OP1 "/") if((NOT MSVC OR PP_NMAKE) AND @@ -150,7 +150,7 @@ endif() # - NMake is okay with just \\\" if(PP_NMAKE OR PP_UMAKE) set(STRING_EXTRA "${STRING_EXTRA}\\\"") -endif(PP_NMAKE OR PP_UMAKE) +endif() # General: # # MSVC will not accept a # in the value of a string definition on the @@ -187,7 +187,7 @@ set(EXPR "x*y+!(x==(y+1*2))*f(x${EXPR_OP1}2)") if(NOT WATCOM) # Watcom does not support - or / because it parses them as options. set(EXPR "${EXPR} + y/x-x") -endif(NOT WATCOM) +endif() #----------------------------------------------------------------------------- @@ -199,11 +199,11 @@ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DPREPROCESS_DEBUG") # Inform the test if it built from Xcode or VS6 IDE. if(PP_XCODE) set(PREPROCESS_XCODE 1) -endif(PP_XCODE) +endif() if(PP_VS6) set(PREPROCESS_VS6 1) set(VS6 _vs6) -endif(PP_VS6) +endif() # Test old-style definitions. add_definitions(-DOLD_DEF -DOLD_EXPR=2) @@ -213,7 +213,7 @@ set(OLD_DEFS_EXPECTED "OLD_DEF;OLD_EXPR=2") get_property(OLD_DEFS DIRECTORY PROPERTY COMPILE_DEFINITIONS) if(NOT "${OLD_DEFS}" STREQUAL "${OLD_DEFS_EXPECTED}") message(SEND_ERROR "add_definitions not converted to directory property!") -endif(NOT "${OLD_DEFS}" STREQUAL "${OLD_DEFS_EXPECTED}") +endif() add_executable(Preprocess preprocess.c preprocess${VS6}.cxx) @@ -234,14 +234,14 @@ foreach(c "" "_DEBUG" "_RELEASE") SOURCE preprocess.c preprocess${VS6}.cxx PROPERTY COMPILE_DEFINITIONS${c} "FILE_DEF${c}" ) -endforeach(c) +endforeach() # Add definitions with values. if(NOT PREPROCESS_VS6) # The path might have spaces, which VS6 does not support. set(DEF_TARGET_PATH "TARGET_PATH=\"${TARGET_PATH}\"") set(DEF_FILE_PATH "FILE_PATH=\"${FILE_PATH}\"") -endif(NOT PREPROCESS_VS6) +endif() set_property( TARGET Preprocess APPEND PROPERTY COMPILE_DEFINITIONS @@ -263,7 +263,7 @@ add_custom_target(drive COMMAND Preprocess) # Configure the header file with the desired string value. if(SEMICOLON) set(STRING_VALUE "${STRING_VALUE};") -endif(SEMICOLON) +endif() configure_file(${Preprocess_SOURCE_DIR}/preprocess.h.in ${Preprocess_BINARY_DIR}/preprocess.h) include_directories(${Preprocess_BINARY_DIR}) diff --git a/Tests/Properties/CMakeLists.txt b/Tests/Properties/CMakeLists.txt index ed6d2d4..7bf9c2d 100644 --- a/Tests/Properties/CMakeLists.txt +++ b/Tests/Properties/CMakeLists.txt @@ -27,7 +27,7 @@ get_property(GLOBALRESULT GLOBAL PROPERTY GLOBALTEST DEFINED) if (GLOBALRESULT) message(SEND_ERROR "Error: global prop defined when it should not be, " "result is GLOBALRESULT=${GLOBALRESULT}") -endif (GLOBALRESULT) +endif () define_property(GLOBAL PROPERTY GLOBALTEST BRIEF_DOCS "A test property" @@ -38,7 +38,7 @@ get_property(GLOBALRESULT GLOBAL PROPERTY GLOBALTEST DEFINED) if (NOT GLOBALRESULT) message(SEND_ERROR "Error: global prop not defined " "result is GLOBALRESULT=${GLOBALRESULT}") -endif (NOT GLOBALRESULT) +endif () set_property(GLOBAL PROPERTY GLOBALTEST 1) set_property(DIRECTORY PROPERTY DIRECTORYTEST 1) @@ -69,7 +69,7 @@ get_property(TARGETRESULT TARGET Properties PROPERTY TARGETTEST) if (NOT TARGETRESULT) message(SEND_ERROR "Error: target result is TARGETRESULT=${TARGETRESULT}") -endif (NOT TARGETRESULT) +endif () # test APPEND and APPEND_STRING set_property() set_property(TARGET Properties PROPERTY FOO foo) @@ -94,7 +94,7 @@ get_property(TARGETRESULT TARGET Properties PROPERTY TARGETTEST SET) if (NOT TARGETRESULT) message(SEND_ERROR "Error: target prop not set, result is TARGETRESULT=${TARGETRESULT}") -endif (NOT TARGETRESULT) +endif () # test unsetting a property set_property(TARGET Properties PROPERTY TARGETTEST) @@ -102,7 +102,7 @@ get_property(TARGETRESULT TARGET Properties PROPERTY TARGETTEST SET) if (TARGETRESULT) message(SEND_ERROR "Error: target prop not unset, " "result is TARGETRESULT=${TARGETRESULT}") -endif (TARGETRESULT) +endif () @@ -114,7 +114,7 @@ if(NOT RESULT4) message(SEND_ERROR "Error: target result is" " RESULT4=${RESULT4}" " Properties_SOURCES=[${Properties_SOURCES}]") -endif(NOT RESULT4) +endif() # test CACHE properties macro(check_cache_props) @@ -123,8 +123,8 @@ macro(check_cache_props) if(NOT "x${result}" STREQUAL "x${expect_${prop}}") message(SEND_ERROR "CACHE property ${prop} is [${result}], not [${expect_${prop}}]") endif() - endforeach(prop) -endmacro(check_cache_props) + endforeach() +endmacro() set(expect_VALUE "ON") set(expect_TYPE "BOOL") set(expect_HELPSTRING "sample cache entry") diff --git a/Tests/ReturnTest/CMakeLists.txt b/Tests/ReturnTest/CMakeLists.txt index a08855e..3bd7ce0 100644 --- a/Tests/ReturnTest/CMakeLists.txt +++ b/Tests/ReturnTest/CMakeLists.txt @@ -4,24 +4,24 @@ project (ReturnTest) function (FAILED testname) message (SEND_ERROR "${testname} failed ${ARGN}") -endfunction (FAILED) +endfunction () function (PASS testname) message ("${testname} passed ${ARGN}") -endfunction (PASS) +endfunction () # test simple return function (simple) set(simpleResult 1 PARENT_SCOPE) return() set(simpleResult 0 PARENT_SCOPE) -endfunction (simple) +endfunction () simple() if ("${simpleResult}") pass ("simple") -else ("${simpleResult}") +else () failed ("simple got: ${simpleResult}") -endif ("${simpleResult}") +endif () #test return in an if statement set (simple2IF 1) @@ -29,15 +29,15 @@ function (simple2) set(simple2Result 1 PARENT_SCOPE) if (simple2IF) return() - endif (simple2IF) + endif () set(simple2Result 0 PARENT_SCOPE) -endfunction (simple2) +endfunction () simple2() if ("${simple2Result}") pass ("simple2") -else ("${simple2Result}") +else () failed ("simple2 got: ${simple2Result}") -endif ("${simple2Result}") +endif () #test return in a foreach loop function (looptest) @@ -45,15 +45,15 @@ function (looptest) set (looptestResult "${iter}" PARENT_SCOPE) if ("${iter}" EQUAL 3) return () - endif ("${iter}" EQUAL 3) - endforeach (iter) -endfunction (looptest) + endif () + endforeach () +endfunction () looptest() if ("${looptestResult}" EQUAL 3) pass ("looptest") -else ("${looptestResult}" EQUAL 3) +else () failed ("looptest got: ${looptestResult}") -endif ("${looptestResult}" EQUAL 3) +endif () #test return in a while loop function (whiletest) @@ -62,58 +62,58 @@ function (whiletest) set (whiletestResult "${iter}" PARENT_SCOPE) if ("${iter}" STREQUAL "aaa") return () - endif ("${iter}" STREQUAL "aaa") + endif () set (iter "${iter}a") - endwhile(NOT "${iter}" STREQUAL "aaaaa") -endfunction (whiletest) + endwhile() +endfunction () whiletest() if ("${whiletestResult}" STREQUAL "aaa") pass ("whiletest") -else ("${whiletestResult}" STREQUAL "aaa") +else () failed ("whiletest got: ${whiletestResult}") -endif ("${whiletestResult}" STREQUAL "aaa") +endif () # check subdir return add_subdirectory(subdir) get_directory_property(subdirResult DIRECTORY subdir DEFINITION subdirreturn) if ("${subdirResult}" EQUAL 1) pass ("subdir") -else ("${subdirResult}" EQUAL 1) +else () failed ("subdir got: ${subdirResult}") -endif ("${subdirResult}" EQUAL 1) +endif () # check return from a file include(include_return.cmake) if ("${include_returnResult}" EQUAL 1) pass ("include_return") -else ("${include_returnResult}" EQUAL 1) +else () failed ("include_return got: ${include_returnResult}") -endif ("${include_returnResult}" EQUAL 1) +endif () # check return from within a macro macro (mymacro) set (foo 1) if (foo) return() - endif (foo) -endmacro(mymacro) + endif () +endmacro() # test simple return function (simple3) set (bar 0) set(simple3Result 1 PARENT_SCOPE) if (bar) - else (bar) + else () mymacro() - endif(bar) + endif() set(simple3Result 0 PARENT_SCOPE) -endfunction (simple3) +endfunction () simple3() if ("${simple3Result}") pass ("macrotest") -else ("${simple3Result}") +else () failed ("macrotest got: ${simple3Result}") -endif ("${simple3Result}") +endif () # test break command now in a foreach @@ -121,27 +121,27 @@ foreach (iter RANGE 1 5) set (break1 "${iter}") if ("${iter}" EQUAL 3) break () - endif ("${iter}" EQUAL 3) -endforeach (iter) + endif () +endforeach () if ("${break1}" EQUAL 3) pass ("break in foreach") -else ("${break1}" EQUAL 3) +else () failed ("break in foreach got: ${break1}") -endif ("${break1}" EQUAL 3) +endif () # test break in a while loop set (iter "a") while(NOT "${iter}" STREQUAL "aaaaa") if ("${iter}" STREQUAL "aaa") break () - endif ("${iter}" STREQUAL "aaa") + endif () set (iter "${iter}a") -endwhile(NOT "${iter}" STREQUAL "aaaaa") +endwhile() if ("${iter}" STREQUAL "aaa") pass ("break in a while") -else ("${iter}" STREQUAL "aaa") +else () failed ("break in a whi;e got: ${whiletestResult}") -endif ("${iter}" STREQUAL "aaa") +endif () add_executable (ReturnTest returnTest.c) diff --git a/Tests/RunCMake/include_external_msproject/check_utils.cmake b/Tests/RunCMake/include_external_msproject/check_utils.cmake index 7d6b8f8..7f5ef53 100644 --- a/Tests/RunCMake/include_external_msproject/check_utils.cmake +++ b/Tests/RunCMake/include_external_msproject/check_utils.cmake @@ -8,8 +8,8 @@ macro(check_line_exists TARGET_FILE REG_EXP_REF) if(_VAR_LEN GREATER 0) set(IS_FOUND "TRUE") - endif(_VAR_LEN GREATER 0) -endmacro(check_line_exists TARGET_FILE REG_EXP_REF) + endif() +endmacro() # Search and parse project section line by project name. # If search was successful stores found type and guid into FOUND_TYPE and FOUND_GUID variables respectively. @@ -20,13 +20,13 @@ macro(parse_project_section TARGET_FILE PROJECT_NAME) check_line_exists(${TARGET_FILE} REG_EXP) if(NOT IS_FOUND) return() - endif(NOT IS_FOUND) + endif() string(REGEX REPLACE "${REG_EXP}" "\\1;\\2" _GUIDS "${FOUND_LINE}") list(GET _GUIDS 0 FOUND_TYPE) list(GET _GUIDS 1 FOUND_GUID) -endmacro(parse_project_section TARGET_FILE PROJECT_NAME) +endmacro() # Search project section line by project name and type. # Returns TRUE if found and FALSE otherwise @@ -36,8 +36,8 @@ function(check_project_type TARGET_FILE PROJECT_NAME PROJECT_TYPE RESULT) parse_project_section(${TARGET_FILE} ${PROJECT_NAME}) if(IS_FOUND AND FOUND_TYPE STREQUAL PROJECT_TYPE) set(${RESULT} "TRUE" PARENT_SCOPE) - endif(IS_FOUND AND FOUND_TYPE STREQUAL PROJECT_TYPE) -endfunction(check_project_type TARGET_FILE PROJECT_NAME PROJECT_TYPE RESULT) + endif() +endfunction() # Search project section line by project name and id. @@ -48,8 +48,8 @@ function(check_project_guid TARGET_FILE PROJECT_NAME PROJECT_GUID RESULT) parse_project_section(${TARGET_FILE} ${PROJECT_NAME}) if(IS_FOUND AND FOUND_GUID STREQUAL PROJECT_GUID) set(${RESULT} "TRUE" PARENT_SCOPE) - endif(IS_FOUND AND FOUND_GUID STREQUAL PROJECT_GUID) -endfunction(check_project_guid TARGET_FILE PROJECT_NAME PROJECT_GUID RESULT) + endif() +endfunction() # Search project's build configuration line by project name and target platform name. @@ -61,7 +61,7 @@ function(check_custom_platform TARGET_FILE PROJECT_NAME PLATFORM_NAME RESULT) parse_project_section(${TARGET_FILE} ${PROJECT_NAME}) if(NOT IS_FOUND) return() - endif(NOT IS_FOUND) + endif() # probably whould be better to use configuration name # extracted from CMAKE_CONFIGURATION_TYPES than just hardcoded "Debug" instead @@ -69,7 +69,7 @@ function(check_custom_platform TARGET_FILE PROJECT_NAME PLATFORM_NAME RESULT) check_line_exists(${TARGET_FILE} REG_EXP) set(${RESULT} ${IS_FOUND} PARENT_SCOPE) -endfunction(check_custom_platform TARGET_FILE PLATFORM_NAME RESULT) +endfunction() # RunCMake test check helper function(check_project test name guid type platform) diff --git a/Tests/RuntimePath/CMakeLists.txt b/Tests/RuntimePath/CMakeLists.txt index 2164cdb..6583a87 100644 --- a/Tests/RuntimePath/CMakeLists.txt +++ b/Tests/RuntimePath/CMakeLists.txt @@ -30,4 +30,4 @@ if(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG) set_property(TARGET bar2 PROPERTY OUTPUT_NAME bar) set_property(TARGET bar2 PROPERTY LIBRARY_OUTPUT_DIRECTORY A) target_link_libraries(bar2 foo2) -endif(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG) +endif() diff --git a/Tests/Simple/CMakeLists.txt b/Tests/Simple/CMakeLists.txt index 20d9705..a951c2d 100644 --- a/Tests/Simple/CMakeLists.txt +++ b/Tests/Simple/CMakeLists.txt @@ -14,4 +14,4 @@ target_link_libraries (Simple simpleLib) # make sure optimized libs are not used by debug builds if(CMAKE_BUILD_TYPE MATCHES Debug) target_link_libraries(Simple optimized c:/not/here.lib ) -endif(CMAKE_BUILD_TYPE MATCHES Debug) +endif() diff --git a/Tests/SimpleCOnly/CMakeLists.txt b/Tests/SimpleCOnly/CMakeLists.txt index d0ed651..fb24779 100644 --- a/Tests/SimpleCOnly/CMakeLists.txt +++ b/Tests/SimpleCOnly/CMakeLists.txt @@ -14,4 +14,4 @@ message(STATUS "sizeof(float): ${SIZE_FLOAT}") # make sure optimized libs are not used by debug builds if(CMAKE_BUILD_TYPE MATCHES Debug) target_link_libraries(Simple optimized c:/not/here.lib ) -endif(CMAKE_BUILD_TYPE MATCHES Debug) +endif() diff --git a/Tests/SimpleExclude/run.cmake.in b/Tests/SimpleExclude/run.cmake.in index 8f83380..d31d2e5 100644 --- a/Tests/SimpleExclude/run.cmake.in +++ b/Tests/SimpleExclude/run.cmake.in @@ -8,6 +8,6 @@ message("T9 ${t9_name} resulted ${t9_var}") if ( "${t4_var}" EQUAL "0" AND "${t9_var}" EQUAL "0" ) message("Everything is good, Yoshimi won...") -else ( "${t4_var}" EQUAL "0" AND "${t9_var}" EQUAL "0" ) +else () message(FATAL_ERROR "Yoshimi lost... The evil pink robots will take over the world") -endif ( "${t4_var}" EQUAL "0" AND "${t9_var}" EQUAL "0" ) +endif () diff --git a/Tests/SimpleInstall/CMakeLists.txt b/Tests/SimpleInstall/CMakeLists.txt index f05587e..479d6ec 100644 --- a/Tests/SimpleInstall/CMakeLists.txt +++ b/Tests/SimpleInstall/CMakeLists.txt @@ -40,13 +40,13 @@ if(STAGE2) include(${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake OPTIONAL) if(CMAKE_INSTALL_SCRIPT_DID_RUN) message(STATUS "Stage 1 did run install script 2.") - else(CMAKE_INSTALL_SCRIPT_DID_RUN) + else() message(SEND_ERROR "Stage 1 did not run install script 2.") - endif(CMAKE_INSTALL_SCRIPT_DID_RUN) + endif() if(CYGWIN OR MINGW) set(LIBPATHS ${LIBPATHS} "${CMAKE_INSTALL_PREFIX}/MyTest/bin") - endif(CYGWIN OR MINGW) + endif() message("Search for library in: ${LIBPATHS}") set(TEST1_LIBRARY "TEST1_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE) @@ -77,44 +77,44 @@ if(STAGE2) if("${TEST1_LIBRARY}" MATCHES "static") message(STATUS "test1 correctly found in lib/static") - else("${TEST1_LIBRARY}" MATCHES "static") + else() message(SEND_ERROR "test1 not found in lib/static!") - endif("${TEST1_LIBRARY}" MATCHES "static") + endif() # Check for failure of configuration-specific installation. if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h") message(FATAL_ERROR "Debug-configuration file installed for Release!") - endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h") + endif() if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h") message(FATAL_ERROR "Release-configuration file installed for Debug!") - endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h") + endif() # Check for failure of directory installation. if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h") message(FATAL_ERROR "Directory installation did not install TSD.h") - endif(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h") + endif() if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS") message(FATAL_ERROR "Directory installation installed CVS directory.") - endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS") + endif() if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS") message(FATAL_ERROR "Directory installation installed CVS directory.") - endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS") + endif() if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt") message(FATAL_ERROR "Directory installation installed CMakeLists.txt.") - endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt") + endif() if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h") message(FATAL_ERROR "Directory installation did not install alternate TSD.h") - endif(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h") + endif() if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx") message(FATAL_ERROR "Directory installation installed alternate TSD.cxx") - endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx") + endif() # Check that scripts properly installed. if(WIN32 AND NOT CYGWIN) set(BAT .bat) - else(WIN32 AND NOT CYGWIN) + else() set(BAT) - endif(WIN32 AND NOT CYGWIN) + endif() foreach(loc share share/old1 share/old2 share/old3 share/alt) set(CUR_SCRIPT "${CMAKE_INSTALL_PREFIX}/MyTest/${loc}/sample_script${BAT}") execute_process( @@ -125,21 +125,21 @@ if(STAGE2) if(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$") message(FATAL_ERROR "Sample script [${CUR_SCRIPT}] failed: [${SAMPLE_SCRIPT_RESULT}]") - endif(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$") + endif() if(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output") message(FATAL_ERROR "Bad sample script [${CUR_SCRIPT}] output: [${SAMPLE_SCRIPT_OUTPUT}]") - endif(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output") - endforeach(loc) + endif() + endforeach() # Check for failure of empty directory installation. if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty") message(FATAL_ERROR "Empty directory installation did not install.") - endif(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty") + endif() file(GLOB EMPTY_FILES "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty/*") if(EMPTY_FILES) message(FATAL_ERROR "Empty directory installed [${EMPTY_FILES}].") - endif(EMPTY_FILES) + endif() # Make sure the test executable can run from the install tree. set_target_properties(SimpleInstExeS2 PROPERTIES @@ -153,9 +153,9 @@ if(STAGE2) get_target_property(simpleInstallImported S1_SimpleInstall IMPORTED) if(NOT simpleInstallImported) message(FATAL_ERROR "Target S1_SimpleInstall could not be imported") - endif(NOT simpleInstallImported) + endif() -else(STAGE2) +else() # Wipe out the install directory to do a fresh test. file(REMOVE_RECURSE ${CMAKE_INSTALL_PREFIX}/MyTest) @@ -177,7 +177,7 @@ else(STAGE2) # Disable VERSION test until it is implemented in the Xcode generator. if(NOT XCODE) set_target_properties(SimpleInstall PROPERTIES VERSION 1.2) - endif(NOT XCODE) + endif() # Make sure the test executable can run from the install tree. set_target_properties(SimpleInstall PROPERTIES @@ -190,7 +190,7 @@ else(STAGE2) if(CMAKE_GENERATOR MATCHES "Makefiles") add_subdirectory(TestSubDir) add_dependencies(SimpleInstall TSD) - endif(CMAKE_GENERATOR MATCHES "Makefiles") + endif() add_dependencies(SimpleInstall test3) add_dependencies(test2 test3) @@ -305,13 +305,13 @@ else(STAGE2) ${CMAKE_CURRENT_SOURCE_DIR}/PostInstall.cmake) set_target_properties(test4 PROPERTIES VERSION 1.2 SOVERSION 3 INSTALL_NAME_DIR @executable_path/../lib) -endif(STAGE2) +endif() if(CMAKE_CONFIGURATION_TYPES) set(SI_CONFIG -C ${CMAKE_CFG_INTDIR}) -else(CMAKE_CONFIGURATION_TYPES) +else() set(SI_CONFIG) -endif(CMAKE_CONFIGURATION_TYPES) +endif() # Dummy test of CPack set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Test of packaging with cpack") @@ -325,8 +325,8 @@ if(WIN32 AND NOT UNIX) ) if(NOT NSIS_MAKENSIS) set(CPACK_GENERATOR TGZ) - endif(NOT NSIS_MAKENSIS) -endif(WIN32 AND NOT UNIX) + endif() +endif() if(UNIX AND NOT APPLE) set(CPACK_GENERATOR "TGZ;STGZ;TZ") # find_program(found_compress @@ -335,31 +335,31 @@ if(UNIX AND NOT APPLE) # find_program(file_command NAMES file) # if(NOT file_command) # set(file_command file) - # endif(NOT file_command) + # endif() # execute_process(COMMAND ${file_command} ${found_compress} # OUTPUT_VARIABLE output) # set(SKIP_TZ FALSE) # if("${output}" MATCHES "script") # set(SKIP_TZ TRUE) - # endif("${output}" MATCHES "script") + # endif() # if("${output}" MATCHES "dummy.sh") # set(SKIP_TZ TRUE) - # endif("${output}" MATCHES "dummy.sh") + # endif() # if(NOT SKIP_TZ) # message("compress found and it was not a script") # message("output from file command: [${output}]") # set(CPACK_GENERATOR "${CPACK_GENERATOR};TZ") - # else(NOT SKIP_TZ) + # else() # message("compress found, but it was a script so dont use it") # message("output from file command: [${output}]") - # endif(NOT SKIP_TZ) - # endif(found_compress) + # endif() + # endif() find_program(found_bz2 NAMES bzip2) if(found_bz2) set(CPACK_GENERATOR "${CPACK_GENERATOR};TBZ2") - endif(found_bz2) -endif(UNIX AND NOT APPLE) + endif() +endif() set(CPACK_PACKAGE_EXECUTABLES "SimpleInstall" "Simple Install") set(CMAKE_INSTALL_MFC_LIBRARIES 1) @@ -374,9 +374,9 @@ if(CTEST_TEST_CPACK) # set(CPACK_BINARY_ZIP OFF) set(CPACK_MONOLITHIC_INSTALL ON) -else(CTEST_TEST_CPACK) +else() set(PACKAGE_TARGET) -endif(CTEST_TEST_CPACK) +endif() include(CPack) diff --git a/Tests/SimpleInstall/InstallScript1.cmake b/Tests/SimpleInstall/InstallScript1.cmake index 85465bf..ef9da57 100644 --- a/Tests/SimpleInstall/InstallScript1.cmake +++ b/Tests/SimpleInstall/InstallScript1.cmake @@ -2,4 +2,4 @@ message("This is install script 1.") set(INSTALL_SCRIPT_1_DID_RUN 1) if(INSTALL_CODE_DID_RUN) message(FATAL_ERROR "Install script 1 did not run before install code.") -endif(INSTALL_CODE_DID_RUN) +endif() diff --git a/Tests/SimpleInstall/InstallScript2.cmake b/Tests/SimpleInstall/InstallScript2.cmake index a675df7..c1d20a3 100644 --- a/Tests/SimpleInstall/InstallScript2.cmake +++ b/Tests/SimpleInstall/InstallScript2.cmake @@ -1,14 +1,14 @@ message("This is install script 2.") if(INSTALL_SCRIPT_1_DID_RUN) message("Install script ordering works.") -else(INSTALL_SCRIPT_1_DID_RUN) +else() message(FATAL_ERROR "Install script 1 did not run before install script 2.") -endif(INSTALL_SCRIPT_1_DID_RUN) +endif() if(INSTALL_CODE_DID_RUN) message("Install code ordering works.") -else(INSTALL_CODE_DID_RUN) +else() message(FATAL_ERROR "Install script 2 did not run after install code.") -endif(INSTALL_CODE_DID_RUN) +endif() file(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake" "set(CMAKE_INSTALL_SCRIPT_DID_RUN 1)\n" ) diff --git a/Tests/SimpleInstall/InstallScript3.cmake b/Tests/SimpleInstall/InstallScript3.cmake index a955be1..6485156 100644 --- a/Tests/SimpleInstall/InstallScript3.cmake +++ b/Tests/SimpleInstall/InstallScript3.cmake @@ -2,11 +2,11 @@ message("This is install script 3.") set(INSTALL_SCRIPT_3_DID_RUN 1) if(INSTALL_CODE_WITH_COMPONENT_DID_RUN) message(FATAL_ERROR "Install script 3 did not run before install code with component.") -endif(INSTALL_CODE_WITH_COMPONENT_DID_RUN) +endif() if(CMAKE_INSTALL_COMPONENT) if(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") message("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"") message(FATAL_ERROR "Install script 3 should only run for \"Development\" INSTALL COMPONENT.") -endif(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") -endif(CMAKE_INSTALL_COMPONENT) +endif() +endif() diff --git a/Tests/SimpleInstall/InstallScript4.cmake b/Tests/SimpleInstall/InstallScript4.cmake index 0bbd9d2..34d0a73 100644 --- a/Tests/SimpleInstall/InstallScript4.cmake +++ b/Tests/SimpleInstall/InstallScript4.cmake @@ -1,21 +1,21 @@ message("This is install script 4.") if(INSTALL_SCRIPT_3_DID_RUN) message("Install script ordering works.") -else(INSTALL_SCRIPT_3_DID_RUN) +else() message(FATAL_ERROR "Install script 3 did not run before install script 4.") -endif(INSTALL_SCRIPT_3_DID_RUN) +endif() if(INSTALL_CODE_WITH_COMPONENT_DID_RUN) message("Install code ordering works.") -else(INSTALL_CODE_WITH_COMPONENT_DID_RUN) +else() message(FATAL_ERROR "Install script 4 did not run after install with component code.") -endif(INSTALL_CODE_WITH_COMPONENT_DID_RUN) +endif() if(CMAKE_INSTALL_COMPONENT) if(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") message("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"") message(FATAL_ERROR "Install script 4 should only run for \"Development\" INSTALL COMPONENT.") -endif(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") -endif(CMAKE_INSTALL_COMPONENT) +endif() +endif() file(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScript4Out.cmake" "set(CMAKE_INSTALL_SCRIPT_4_DID_RUN 1)\n" diff --git a/Tests/SimpleInstall/PackageScript.cmake b/Tests/SimpleInstall/PackageScript.cmake index be07f89..53b7909 100644 --- a/Tests/SimpleInstall/PackageScript.cmake +++ b/Tests/SimpleInstall/PackageScript.cmake @@ -6,5 +6,5 @@ get_cmake_property(res VARIABLES) foreach(var ${res}) file(APPEND ${CMAKE_INSTALL_PREFIX}/AllVariables.txt "${var} \"${${var}}\"\n") -endforeach(var ${res}) +endforeach() diff --git a/Tests/SimpleInstall/PostInstall.cmake b/Tests/SimpleInstall/PostInstall.cmake index 222cc5a..d616221 100644 --- a/Tests/SimpleInstall/PostInstall.cmake +++ b/Tests/SimpleInstall/PostInstall.cmake @@ -1,6 +1,6 @@ message("In post install") if(PRE_INSTALL_DID_RUN) message("Pre and post install work fine") -else(PRE_INSTALL_DID_RUN) +else() message(FATAL_ERROR "Pre install did not run before post install") -endif(PRE_INSTALL_DID_RUN) +endif() diff --git a/Tests/SimpleInstallS2/CMakeLists.txt b/Tests/SimpleInstallS2/CMakeLists.txt index f05587e..479d6ec 100644 --- a/Tests/SimpleInstallS2/CMakeLists.txt +++ b/Tests/SimpleInstallS2/CMakeLists.txt @@ -40,13 +40,13 @@ if(STAGE2) include(${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake OPTIONAL) if(CMAKE_INSTALL_SCRIPT_DID_RUN) message(STATUS "Stage 1 did run install script 2.") - else(CMAKE_INSTALL_SCRIPT_DID_RUN) + else() message(SEND_ERROR "Stage 1 did not run install script 2.") - endif(CMAKE_INSTALL_SCRIPT_DID_RUN) + endif() if(CYGWIN OR MINGW) set(LIBPATHS ${LIBPATHS} "${CMAKE_INSTALL_PREFIX}/MyTest/bin") - endif(CYGWIN OR MINGW) + endif() message("Search for library in: ${LIBPATHS}") set(TEST1_LIBRARY "TEST1_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE) @@ -77,44 +77,44 @@ if(STAGE2) if("${TEST1_LIBRARY}" MATCHES "static") message(STATUS "test1 correctly found in lib/static") - else("${TEST1_LIBRARY}" MATCHES "static") + else() message(SEND_ERROR "test1 not found in lib/static!") - endif("${TEST1_LIBRARY}" MATCHES "static") + endif() # Check for failure of configuration-specific installation. if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h") message(FATAL_ERROR "Debug-configuration file installed for Release!") - endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h") + endif() if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h") message(FATAL_ERROR "Release-configuration file installed for Debug!") - endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h") + endif() # Check for failure of directory installation. if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h") message(FATAL_ERROR "Directory installation did not install TSD.h") - endif(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h") + endif() if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS") message(FATAL_ERROR "Directory installation installed CVS directory.") - endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS") + endif() if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS") message(FATAL_ERROR "Directory installation installed CVS directory.") - endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS") + endif() if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt") message(FATAL_ERROR "Directory installation installed CMakeLists.txt.") - endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt") + endif() if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h") message(FATAL_ERROR "Directory installation did not install alternate TSD.h") - endif(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h") + endif() if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx") message(FATAL_ERROR "Directory installation installed alternate TSD.cxx") - endif(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx") + endif() # Check that scripts properly installed. if(WIN32 AND NOT CYGWIN) set(BAT .bat) - else(WIN32 AND NOT CYGWIN) + else() set(BAT) - endif(WIN32 AND NOT CYGWIN) + endif() foreach(loc share share/old1 share/old2 share/old3 share/alt) set(CUR_SCRIPT "${CMAKE_INSTALL_PREFIX}/MyTest/${loc}/sample_script${BAT}") execute_process( @@ -125,21 +125,21 @@ if(STAGE2) if(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$") message(FATAL_ERROR "Sample script [${CUR_SCRIPT}] failed: [${SAMPLE_SCRIPT_RESULT}]") - endif(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$") + endif() if(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output") message(FATAL_ERROR "Bad sample script [${CUR_SCRIPT}] output: [${SAMPLE_SCRIPT_OUTPUT}]") - endif(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output") - endforeach(loc) + endif() + endforeach() # Check for failure of empty directory installation. if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty") message(FATAL_ERROR "Empty directory installation did not install.") - endif(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty") + endif() file(GLOB EMPTY_FILES "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty/*") if(EMPTY_FILES) message(FATAL_ERROR "Empty directory installed [${EMPTY_FILES}].") - endif(EMPTY_FILES) + endif() # Make sure the test executable can run from the install tree. set_target_properties(SimpleInstExeS2 PROPERTIES @@ -153,9 +153,9 @@ if(STAGE2) get_target_property(simpleInstallImported S1_SimpleInstall IMPORTED) if(NOT simpleInstallImported) message(FATAL_ERROR "Target S1_SimpleInstall could not be imported") - endif(NOT simpleInstallImported) + endif() -else(STAGE2) +else() # Wipe out the install directory to do a fresh test. file(REMOVE_RECURSE ${CMAKE_INSTALL_PREFIX}/MyTest) @@ -177,7 +177,7 @@ else(STAGE2) # Disable VERSION test until it is implemented in the Xcode generator. if(NOT XCODE) set_target_properties(SimpleInstall PROPERTIES VERSION 1.2) - endif(NOT XCODE) + endif() # Make sure the test executable can run from the install tree. set_target_properties(SimpleInstall PROPERTIES @@ -190,7 +190,7 @@ else(STAGE2) if(CMAKE_GENERATOR MATCHES "Makefiles") add_subdirectory(TestSubDir) add_dependencies(SimpleInstall TSD) - endif(CMAKE_GENERATOR MATCHES "Makefiles") + endif() add_dependencies(SimpleInstall test3) add_dependencies(test2 test3) @@ -305,13 +305,13 @@ else(STAGE2) ${CMAKE_CURRENT_SOURCE_DIR}/PostInstall.cmake) set_target_properties(test4 PROPERTIES VERSION 1.2 SOVERSION 3 INSTALL_NAME_DIR @executable_path/../lib) -endif(STAGE2) +endif() if(CMAKE_CONFIGURATION_TYPES) set(SI_CONFIG -C ${CMAKE_CFG_INTDIR}) -else(CMAKE_CONFIGURATION_TYPES) +else() set(SI_CONFIG) -endif(CMAKE_CONFIGURATION_TYPES) +endif() # Dummy test of CPack set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Test of packaging with cpack") @@ -325,8 +325,8 @@ if(WIN32 AND NOT UNIX) ) if(NOT NSIS_MAKENSIS) set(CPACK_GENERATOR TGZ) - endif(NOT NSIS_MAKENSIS) -endif(WIN32 AND NOT UNIX) + endif() +endif() if(UNIX AND NOT APPLE) set(CPACK_GENERATOR "TGZ;STGZ;TZ") # find_program(found_compress @@ -335,31 +335,31 @@ if(UNIX AND NOT APPLE) # find_program(file_command NAMES file) # if(NOT file_command) # set(file_command file) - # endif(NOT file_command) + # endif() # execute_process(COMMAND ${file_command} ${found_compress} # OUTPUT_VARIABLE output) # set(SKIP_TZ FALSE) # if("${output}" MATCHES "script") # set(SKIP_TZ TRUE) - # endif("${output}" MATCHES "script") + # endif() # if("${output}" MATCHES "dummy.sh") # set(SKIP_TZ TRUE) - # endif("${output}" MATCHES "dummy.sh") + # endif() # if(NOT SKIP_TZ) # message("compress found and it was not a script") # message("output from file command: [${output}]") # set(CPACK_GENERATOR "${CPACK_GENERATOR};TZ") - # else(NOT SKIP_TZ) + # else() # message("compress found, but it was a script so dont use it") # message("output from file command: [${output}]") - # endif(NOT SKIP_TZ) - # endif(found_compress) + # endif() + # endif() find_program(found_bz2 NAMES bzip2) if(found_bz2) set(CPACK_GENERATOR "${CPACK_GENERATOR};TBZ2") - endif(found_bz2) -endif(UNIX AND NOT APPLE) + endif() +endif() set(CPACK_PACKAGE_EXECUTABLES "SimpleInstall" "Simple Install") set(CMAKE_INSTALL_MFC_LIBRARIES 1) @@ -374,9 +374,9 @@ if(CTEST_TEST_CPACK) # set(CPACK_BINARY_ZIP OFF) set(CPACK_MONOLITHIC_INSTALL ON) -else(CTEST_TEST_CPACK) +else() set(PACKAGE_TARGET) -endif(CTEST_TEST_CPACK) +endif() include(CPack) diff --git a/Tests/SimpleInstallS2/InstallScript1.cmake b/Tests/SimpleInstallS2/InstallScript1.cmake index 85465bf..ef9da57 100644 --- a/Tests/SimpleInstallS2/InstallScript1.cmake +++ b/Tests/SimpleInstallS2/InstallScript1.cmake @@ -2,4 +2,4 @@ message("This is install script 1.") set(INSTALL_SCRIPT_1_DID_RUN 1) if(INSTALL_CODE_DID_RUN) message(FATAL_ERROR "Install script 1 did not run before install code.") -endif(INSTALL_CODE_DID_RUN) +endif() diff --git a/Tests/SimpleInstallS2/InstallScript2.cmake b/Tests/SimpleInstallS2/InstallScript2.cmake index a675df7..c1d20a3 100644 --- a/Tests/SimpleInstallS2/InstallScript2.cmake +++ b/Tests/SimpleInstallS2/InstallScript2.cmake @@ -1,14 +1,14 @@ message("This is install script 2.") if(INSTALL_SCRIPT_1_DID_RUN) message("Install script ordering works.") -else(INSTALL_SCRIPT_1_DID_RUN) +else() message(FATAL_ERROR "Install script 1 did not run before install script 2.") -endif(INSTALL_SCRIPT_1_DID_RUN) +endif() if(INSTALL_CODE_DID_RUN) message("Install code ordering works.") -else(INSTALL_CODE_DID_RUN) +else() message(FATAL_ERROR "Install script 2 did not run after install code.") -endif(INSTALL_CODE_DID_RUN) +endif() file(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake" "set(CMAKE_INSTALL_SCRIPT_DID_RUN 1)\n" ) diff --git a/Tests/SimpleInstallS2/InstallScript3.cmake b/Tests/SimpleInstallS2/InstallScript3.cmake index a955be1..6485156 100644 --- a/Tests/SimpleInstallS2/InstallScript3.cmake +++ b/Tests/SimpleInstallS2/InstallScript3.cmake @@ -2,11 +2,11 @@ message("This is install script 3.") set(INSTALL_SCRIPT_3_DID_RUN 1) if(INSTALL_CODE_WITH_COMPONENT_DID_RUN) message(FATAL_ERROR "Install script 3 did not run before install code with component.") -endif(INSTALL_CODE_WITH_COMPONENT_DID_RUN) +endif() if(CMAKE_INSTALL_COMPONENT) if(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") message("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"") message(FATAL_ERROR "Install script 3 should only run for \"Development\" INSTALL COMPONENT.") -endif(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") -endif(CMAKE_INSTALL_COMPONENT) +endif() +endif() diff --git a/Tests/SimpleInstallS2/InstallScript4.cmake b/Tests/SimpleInstallS2/InstallScript4.cmake index 0bbd9d2..34d0a73 100644 --- a/Tests/SimpleInstallS2/InstallScript4.cmake +++ b/Tests/SimpleInstallS2/InstallScript4.cmake @@ -1,21 +1,21 @@ message("This is install script 4.") if(INSTALL_SCRIPT_3_DID_RUN) message("Install script ordering works.") -else(INSTALL_SCRIPT_3_DID_RUN) +else() message(FATAL_ERROR "Install script 3 did not run before install script 4.") -endif(INSTALL_SCRIPT_3_DID_RUN) +endif() if(INSTALL_CODE_WITH_COMPONENT_DID_RUN) message("Install code ordering works.") -else(INSTALL_CODE_WITH_COMPONENT_DID_RUN) +else() message(FATAL_ERROR "Install script 4 did not run after install with component code.") -endif(INSTALL_CODE_WITH_COMPONENT_DID_RUN) +endif() if(CMAKE_INSTALL_COMPONENT) if(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") message("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"") message(FATAL_ERROR "Install script 4 should only run for \"Development\" INSTALL COMPONENT.") -endif(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") -endif(CMAKE_INSTALL_COMPONENT) +endif() +endif() file(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScript4Out.cmake" "set(CMAKE_INSTALL_SCRIPT_4_DID_RUN 1)\n" diff --git a/Tests/SimpleInstallS2/PackageScript.cmake b/Tests/SimpleInstallS2/PackageScript.cmake index be07f89..53b7909 100644 --- a/Tests/SimpleInstallS2/PackageScript.cmake +++ b/Tests/SimpleInstallS2/PackageScript.cmake @@ -6,5 +6,5 @@ get_cmake_property(res VARIABLES) foreach(var ${res}) file(APPEND ${CMAKE_INSTALL_PREFIX}/AllVariables.txt "${var} \"${${var}}\"\n") -endforeach(var ${res}) +endforeach() diff --git a/Tests/SimpleInstallS2/PostInstall.cmake b/Tests/SimpleInstallS2/PostInstall.cmake index 222cc5a..d616221 100644 --- a/Tests/SimpleInstallS2/PostInstall.cmake +++ b/Tests/SimpleInstallS2/PostInstall.cmake @@ -1,6 +1,6 @@ message("In post install") if(PRE_INSTALL_DID_RUN) message("Pre and post install work fine") -else(PRE_INSTALL_DID_RUN) +else() message(FATAL_ERROR "Pre install did not run before post install") -endif(PRE_INSTALL_DID_RUN) +endif() diff --git a/Tests/StringFileTest/CMakeLists.txt b/Tests/StringFileTest/CMakeLists.txt index 0af11f7..6d798b0 100644 --- a/Tests/StringFileTest/CMakeLists.txt +++ b/Tests/StringFileTest/CMakeLists.txt @@ -10,9 +10,9 @@ file(READ "${CMAKE_CURRENT_SOURCE_DIR}/test.bin" hexContents HEX) if("${hexContents}" STREQUAL "0001027700") message("file(READ HEX) correctly read [${hexContents}]") -else("${hexContents}" STREQUAL "0001027700") +else() message(SEND_ERROR "file(READ HEX) incorrectly read [${hexContents}], but expected was [0001027700]") -endif("${hexContents}" STREQUAL "0001027700") +endif() # file(STRINGS) test file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in" infile_strings @@ -21,17 +21,17 @@ file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in" infile_strings set(infile_strings_goal "#include \"includefile\"\n") if("${infile_strings}" STREQUAL "${infile_strings_goal}") message("file(STRINGS) correctly read [${infile_strings}]") -else("${infile_strings}" STREQUAL "${infile_strings_goal}") +else() message(SEND_ERROR "file(STRINGS) incorrectly read [${infile_strings}]") -endif("${infile_strings}" STREQUAL "${infile_strings_goal}") +endif() # test reading a file and getting its binary data as hex string file(READ "${CMAKE_CURRENT_SOURCE_DIR}/main.srec" infilehex LIMIT 4 HEX) if(NOT "${infilehex}" STREQUAL "53313036") message(SEND_ERROR "file(READ ... HEX) error, read: \"${infilehex}\", expected \"53313036\"") -endif(NOT "${infilehex}" STREQUAL "53313036") +endif() # test that file(STRINGS) also work with Intel hex and Motorola S-record files @@ -40,20 +40,20 @@ file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/main.ihx" infile_strings REGEX INFO) set(infile_strings_goal "INFO:compiler\\[SDCC-HEX\\]") if("${infile_strings}" MATCHES "${infile_strings_goal}") message("file(STRINGS) correctly read from hex file [${infile_strings}]") -else("${infile_strings}" MATCHES "${infile_strings_goal}") +else() message(SEND_ERROR "file(STRINGS) incorrectly read from hex file [${infile_strings}]") -endif("${infile_strings}" MATCHES "${infile_strings_goal}") +endif() # this file has been created with "sdcc main.c --out-fmt-s19" file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/main.srec" infile_strings REGEX INFO) set(infile_strings_goal "INFO:compiler\\[SDCC-SREC\\]") if("${infile_strings}" MATCHES "${infile_strings_goal}") message("file(STRINGS) correctly read from srec file [${infile_strings}]") -else("${infile_strings}" MATCHES "${infile_strings_goal}") +else() message(SEND_ERROR "file(STRINGS) incorrectly read from srec file [${infile_strings}]") -endif("${infile_strings}" MATCHES "${infile_strings_goal}") +endif() # String test string(REGEX MATCH "[cC][mM][aA][kK][eE]" rmvar "CMake is great") @@ -75,35 +75,35 @@ string(REPLACE "Autoconf" "CMake" repvar "People should use Autoconf") if("abc" STREQUAL "xyz") message(SEND_ERROR "Problem with the if(STREQUAL), \"abc\" and \"xyz\" considered equal") -endif("abc" STREQUAL "xyz") +endif() if("CMake is cool" MATCHES "(CMake) (is).+") if(NOT "${CMAKE_MATCH_0}" STREQUAL "CMake is cool") message(SEND_ERROR "CMAKE_MATCH_0 wrong: \"${CMAKE_MATCH_0}\", expected \"CMake is cool\"") - endif(NOT "${CMAKE_MATCH_0}" STREQUAL "CMake is cool") + endif() if(NOT "${CMAKE_MATCH_1}" STREQUAL "CMake") message(SEND_ERROR "CMAKE_MATCH_1 wrong: \"${CMAKE_MATCH_1}\", expected \"CMake\"") - endif(NOT "${CMAKE_MATCH_1}" STREQUAL "CMake") + endif() if(NOT "${CMAKE_MATCH_2}" STREQUAL "is") message(SEND_ERROR "CMAKE_MATCH_2 wrong: \"${CMAKE_MATCH_2}\", expected \"is\"") - endif(NOT "${CMAKE_MATCH_2}" STREQUAL "is") -else("CMake is cool" MATCHES "(CMake) (is).+") + endif() +else() message(SEND_ERROR "Problem with the if(MATCHES), no match found") -endif("CMake is cool" MATCHES "(CMake) (is).+") +endif() string(REGEX MATCH "(People).+CMake" matchResultVar "People should use CMake") if(NOT "${matchResultVar}" STREQUAL "People should use CMake") message(SEND_ERROR "string(REGEX MATCH) problem: \"${matchResultVar}\", expected \"People should use CMake\"") -endif(NOT "${matchResultVar}" STREQUAL "People should use CMake") +endif() if(NOT "${CMAKE_MATCH_0}" STREQUAL "People should use CMake") message(SEND_ERROR "CMAKE_MATCH_0 wrong: \"${CMAKE_MATCH_0}\", expected \"People should use CMake\"") -endif(NOT "${CMAKE_MATCH_0}" STREQUAL "People should use CMake") +endif() if(NOT "${CMAKE_MATCH_1}" STREQUAL "People") message(SEND_ERROR "CMAKE_MATCH_1 wrong: \"${CMAKE_MATCH_1}\", expected \"People\"") -endif(NOT "${CMAKE_MATCH_1}" STREQUAL "People") +endif() if(NOT "${CMAKE_MATCH_2}" STREQUAL "") message(SEND_ERROR "CMAKE_MATCH_2 wrong: \"${CMAKE_MATCH_2}\", expected empty string") -endif(NOT "${CMAKE_MATCH_2}" STREQUAL "") +endif() string(STRIP " @@ -115,10 +115,10 @@ string(STRIP " ST3" ST3) foreach(var ST1 ST2 ST3) if("${var}" STREQUAL "${${var}}") message("[${var}] == [${${var}}]") - else("${var}" STREQUAL "${${var}}") + else() message(SEND_ERROR "Problem with the STRIP command for ${var}: [${${var}}]") - endif("${var}" STREQUAL "${${var}}") -endforeach(var) + endif() +endforeach() string(SUBSTRING "People should use Autoconf" 7 10 substringres) set(substringres "Everybody ${substringres} CMake") @@ -139,7 +139,7 @@ message("Output: [${var}]") string(COMPARE EQUAL "${var}" "$(VAR1)$(VAR2)/$(VAR3)" result) if(NOT result) message(SEND_ERROR "Unquoted $(VAR) syntax is broken.") -endif(NOT result) +endif() # Obscure environment variable name set("ENV{x+(y)}" "Obscure environment variable value") @@ -178,12 +178,12 @@ foreach(var tuvar tlvar) file(APPEND "${file}" "#define ${var} \"${${var}}\"\n") -endforeach(var) +endforeach() # Verify that the file was created recently. if(NOT "${file}" IS_NEWER_THAN "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in") message(FATAL_ERROR "if(FILE_IS_NEWER) does not seem to work.") -endif(NOT "${file}" IS_NEWER_THAN "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in") +endif() # Test configuration of the string set(TEST_DEFINED 123) @@ -225,13 +225,13 @@ macro(TEST_RANGE ARGS CHECK) set(r) foreach(a RANGE ${ARGS}) set(r ${r} ${a}) - endforeach(a) + endforeach() message("FOREACH with RANGE ${ARGS} produces ${r}") if("x${r}x" MATCHES "^x${CHECK}x$") - else("x${r}x" MATCHES "^x${CHECK}x$") + else() message(SEND_ERROR "The range resulted in: ${r} should be ${CHECK}") - endif("x${r}x" MATCHES "^x${CHECK}x$") -endmacro(TEST_RANGE) + endif() +endmacro() TEST_RANGE("5" "0;1;2;3;4;5") TEST_RANGE("3;5" "3;4;5") TEST_RANGE("5;3" "5;4;3") @@ -246,7 +246,7 @@ set(var_a) set(var_b) foreach(item IN LISTS list1 list2 ITEMS "" a "") set(var_${item} "${var_${item}}x") -endforeach(item) +endforeach() if(NOT "${var_}" STREQUAL "xxxxx") message(FATAL_ERROR "count incorrect for \"\": [${var_}]") endif() @@ -267,16 +267,16 @@ string(SUBSTRING ${ST_INPUTSTRING} 9 -1 ST_NINE) if(ST_EMPTY) message(SEND_ERROR "SUBSTRING with length 0 does not return an empty string") -endif(ST_EMPTY) +endif() if(NOT ST_ONE STREQUAL "1") message(SEND_ERROR "SUBSTING command does not cut the correct selected character, was \"" ${ST_ONE} "\", should be \"1\"") -endif(NOT ST_ONE STREQUAL "1") +endif() if(NOT ST_INPUTSTRING STREQUAL ST_ALL) message(SEND_ERROR "SUBSTRING does not return the whole string when selected with length") -endif(NOT ST_INPUTSTRING STREQUAL ST_ALL) +endif() if(NOT ST_INPUTSTRING STREQUAL ST_ALL_MINUS) message(SEND_ERROR "SUBSTRING does not return the whole string when selected with -1") -endif(NOT ST_INPUTSTRING STREQUAL ST_ALL_MINUS) +endif() if(NOT ST_NINE STREQUAL "9") message(SEND_ERROR "SUBSTRING does not return the tail when selected with -1") -endif(NOT ST_NINE STREQUAL "9") +endif() diff --git a/Tests/SubDir/CMakeLists.txt b/Tests/SubDir/CMakeLists.txt index 2aec956..6822e6b 100644 --- a/Tests/SubDir/CMakeLists.txt +++ b/Tests/SubDir/CMakeLists.txt @@ -7,11 +7,11 @@ if(WATCOM) set(PLUS_NAME_FILES AnotherSubdir/pair_int.int.c vcl_algorithm_vcl_pair_double.foo.c) -else(WATCOM) +else() set(PLUS_NAME_FILES AnotherSubdir/pair+int.int.c vcl_algorithm+vcl_pair+double.foo.c) -endif(WATCOM) +endif() add_executable(TestFromSubdir AnotherSubdir/testfromsubdir.c @@ -23,24 +23,24 @@ aux_source_directory(ThirdSubDir SOURCES) if(WATCOM) foreach(f ${SOURCES}) if("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") - else("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") + else() set(SOURCES2 ${f} ${SOURCES2}) - endif("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") - endforeach(f) + endif() + endforeach() set(SOURCES ${SOURCES2}) set(SOURCES ${SOURCES} vcl_algorithm_vcl_pair_double.foo.c) -else(WATCOM) +else() foreach(f ${SOURCES}) if("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") - else("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") + else() set(SOURCES2 ${f} ${SOURCES2}) message("${f}") - endif("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") - endforeach(f) + endif() + endforeach() set(SOURCES ${SOURCES2}) set(SOURCES ${SOURCES} vcl_algorithm+vcl_pair+double.foo.c) -endif(WATCOM) +endif() message("Sources: ${SOURCES}") add_executable(TestWithAuxSourceDir ${SOURCES}) diff --git a/Tests/SubDirSpaces/CMakeLists.txt b/Tests/SubDirSpaces/CMakeLists.txt index f1ace0f..69f1d68 100644 --- a/Tests/SubDirSpaces/CMakeLists.txt +++ b/Tests/SubDirSpaces/CMakeLists.txt @@ -4,7 +4,7 @@ project(SUBDIR) # Some systems do not seem to support rpath with spaces. if("${CMAKE_SYSTEM}" MATCHES "IRIX|QNX") set(CMAKE_SKIP_BUILD_RPATH 1) -endif("${CMAKE_SYSTEM}" MATCHES "IRIX|QNX") +endif() # be able to see output from make on dashboards set(CMAKE_VERBOSE_MAKEFILE 1) @@ -26,9 +26,9 @@ endif() if(CMAKE_PAREN) add_definitions(-DCMAKE_PAREN=1) subdirs("Executable Sources" "Some(x86) Sources" EXCLUDE_FROM_ALL "Some Examples") -else(CMAKE_PAREN) +else() subdirs("Executable Sources" EXCLUDE_FROM_ALL "Some Examples") -endif(CMAKE_PAREN) +endif() write_file(${SUBDIR_BINARY_DIR}/ShouldBeHere "This file should exist.") #WATCOM WMAKE does not support + in the name of a file! @@ -36,11 +36,11 @@ if(WATCOM) set(PLUS_NAME_FILES "Another Subdir/pair_int.int.c" vcl_algorithm_vcl_pair_double.foo.c) -else(WATCOM) +else() set(PLUS_NAME_FILES "Another Subdir/pair+int.int.c" vcl_algorithm+vcl_pair+double.foo.c) -endif(WATCOM) +endif() add_executable(TestFromSubdir "Another Subdir/testfromsubdir.c" @@ -52,26 +52,26 @@ aux_source_directory(ThirdSubDir SOURCES) if(WATCOM) foreach(f ${SOURCES}) if("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") - else("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") + else() set(SOURCES2 ${f} ${SOURCES2}) - endif("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") - endforeach(f) + endif() + endforeach() set(SOURCES ${SOURCES2}) set(SOURCES ${SOURCES} vcl_algorithm_vcl_pair_double.foo.c) -else(WATCOM) +else() foreach(f ${SOURCES}) if("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") - else("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") + else() set(SOURCES2 ${f} ${SOURCES2}) - endif("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") - endforeach(f) + endif() + endforeach() set(SOURCES ${SOURCES2}) set(SOURCES ${SOURCES} vcl_algorithm+vcl_pair+double.foo.c) -endif(WATCOM) +endif() add_executable(TestWithAuxSourceDir ${SOURCES}) if(CMAKE_PAREN) target_link_libraries(TestWithAuxSourceDir testOddPath) -endif(CMAKE_PAREN) +endif() diff --git a/Tests/SwigTest/CMakeLists.txt b/Tests/SwigTest/CMakeLists.txt index b3017f1..17a502d 100644 --- a/Tests/SwigTest/CMakeLists.txt +++ b/Tests/SwigTest/CMakeLists.txt @@ -11,33 +11,33 @@ if(${language} MATCHES python) find_package(PythonLibs) include_directories(${PYTHON_INCLUDE_PATH}) set(SWIG_LANG_LIBRARIES ${PYTHON_LIBRARIES}) -endif(${language} MATCHES python) +endif() if(${language} MATCHES perl) find_package(PerlLibs) include_directories(${PERL_INCLUDE_PATH}) add_definitions(${PERL_EXTRA_C_FLAGS}) set(SWIG_LANG_LIBRARIES ${PERL_LIBRARY}) -endif(${language} MATCHES perl) +endif() if(${language} MATCHES tcl) find_package(TCL) include_directories(${TCL_INCLUDE_PATH}) set(SWIG_LANG_LIBRARIES ${TCL_LIBRARY}) -endif(${language} MATCHES tcl) +endif() if(${language} MATCHES ruby) find_package(Ruby) include_directories(${RUBY_INCLUDE_PATH}) set(SWIG_LANG_LIBRARIES ${RUBY_LIBRARY}) -endif(${language} MATCHES ruby) +endif() if(${language} MATCHES php4) find_package(PHP4) include_directories(${PHP4_INCLUDE_PATH}) set(SWIG_LANG_LIBRARIES ${PHP4_LIBRARY}) -endif(${language} MATCHES php4) +endif() if(${language} MATCHES pike) find_package(Pike) include_directories(${PIKE_INCLUDE_PATH}) set(SWIG_LANG_LIBRARIES ${PIKE_LIBRARY}) -endif(${language} MATCHES pike) +endif() include_directories(${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/Tests/SystemInformation/CMakeLists.txt b/Tests/SystemInformation/CMakeLists.txt index c29f3e8..838fd4a 100644 --- a/Tests/SystemInformation/CMakeLists.txt +++ b/Tests/SystemInformation/CMakeLists.txt @@ -16,7 +16,7 @@ add_executable(SystemInformation DumpInformation.cxx) macro(FOO args) message("Test macro") -endmacro(FOO) +endmacro() FOO(lala) @@ -25,34 +25,34 @@ get_cmake_property(res VARIABLES) foreach(var ${res}) file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllVariables.txt "${var} \"${${var}}\"\n") -endforeach(var ${res}) +endforeach() file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllCommands.txt "") get_cmake_property(res COMMANDS) foreach(var ${res}) file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllCommands.txt "${var}\n") -endforeach(var ${res}) +endforeach() file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt "") get_cmake_property(res MACROS) foreach(var ${res}) file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt "${var}\n") -endforeach(var ${res}) +endforeach() file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt "") get_directory_property(res INCLUDE_DIRECTORIES) foreach(var ${res}) file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt "INCLUDE_DIRECTORY: ${var}\n") -endforeach(var) +endforeach() get_directory_property(res LINK_DIRECTORIES) foreach(var ${res}) file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt "LINK_DIRECTORIES: ${var}\n") -endforeach(var) +endforeach() get_directory_property(res INCLUDE_REGULAR_EXPRESSION) file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt diff --git a/Tests/TarTest/CMakeLists.txt b/Tests/TarTest/CMakeLists.txt index b1f1c6d..bcc340b 100644 --- a/Tests/TarTest/CMakeLists.txt +++ b/Tests/TarTest/CMakeLists.txt @@ -6,15 +6,15 @@ macro(EXEC_TAR_COMMAND DIR ARGS) exec_program("${CMAKE_COMMAND}" "${DIR}" ARGS "-E tar ${ARGS}" RETURN_VALUE RET) if(${RET}) message(FATAL_ERROR "CMake tar command failed with arguments \"${ARGS}\"") - endif(${RET}) -endmacro(EXEC_TAR_COMMAND) + endif() +endmacro() # Create a directory structure set(CHECK_FILES) macro(COPY F1 F2) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${F1}" "${CMAKE_CURRENT_BINARY_DIR}/tar_dir/${F2}" COPYONLY) set(CHECK_FILES ${CHECK_FILES} "${F2}") -endmacro(COPY) +endmacro() COPY("CMakeLists.txt" "f1.txt") COPY("CMakeLists.txt" "d1/f1.txt") COPY("CMakeLists.txt" "d 2/f1.txt") @@ -26,7 +26,7 @@ COPY("CMakeLists.txt" "My Special Directory/f1.txt") if(UNIX) exec_program("ln" ARGS "-sf f1.txt \"${CMAKE_CURRENT_BINARY_DIR}/tar_dir/d1/f2.txt\"") set(CHECK_FILES ${CHECK_FILES} "d1/f2.txt") -endif(UNIX) +endif() # cleanup first in case there are files left from previous runs # if the umask is odd on the machine it might create files that @@ -54,14 +54,14 @@ macro(CHECK_DIR_STRUCTURE DIR) set(rfile "${CMAKE_CURRENT_BINARY_DIR}/tar_dir/${file}") if(NOT EXISTS "${sfile}") message(SEND_ERROR "Cannot find file ${sfile}") - else(NOT EXISTS "${sfile}") + else() exec_program("${CMAKE_COMMAND}" ARGS "-E compare_files \"${sfile}\" \"${rfile}\"" RETURN_VALUE ret) if(${ret}) message(SEND_ERROR "Files \"${sfile}\" \"${rfile}\" are different") - endif(${ret}) - endif(NOT EXISTS "${sfile}") - endforeach(file) -endmacro(CHECK_DIR_STRUCTURE) + endif() + endif() + endforeach() +endmacro() CHECK_DIR_STRUCTURE("${CMAKE_CURRENT_BINARY_DIR}/test_output_tar/tar_dir") diff --git a/Tests/TargetName/scripts/CMakeLists.txt b/Tests/TargetName/scripts/CMakeLists.txt index a693e40..58af64d 100644 --- a/Tests/TargetName/scripts/CMakeLists.txt +++ b/Tests/TargetName/scripts/CMakeLists.txt @@ -10,4 +10,4 @@ if(NOT CMAKE_BINARY_DIR STREQUAL "${CMAKE_SOURCE_DIR}") DEPENDS #hello_world ${CMAKE_CURRENT_BINARY_DIR}/hello_world ) -endif(NOT CMAKE_BINARY_DIR STREQUAL "${CMAKE_SOURCE_DIR}") +endif() diff --git a/Tests/Testing/CMakeLists.txt b/Tests/Testing/CMakeLists.txt index 20af09b..8f69cbe 100644 --- a/Tests/Testing/CMakeLists.txt +++ b/Tests/Testing/CMakeLists.txt @@ -20,9 +20,9 @@ set (EXECUTABLE_OUTPUT_PATH # if (EXECUTABLE_OUTPUT_PATH) set (CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH}) -else (EXECUTABLE_OUTPUT_PATH) +else () set (CXX_TEST_PATH .) -endif (EXECUTABLE_OUTPUT_PATH) +endif () # # Include Dart diff --git a/Tests/TryCompile/CMakeLists.txt b/Tests/TryCompile/CMakeLists.txt index 90f878e..b6b66d8 100644 --- a/Tests/TryCompile/CMakeLists.txt +++ b/Tests/TryCompile/CMakeLists.txt @@ -4,26 +4,26 @@ project(TryCompile) macro(TEST_ASSERT value msg) if (NOT ${value}) message (SEND_ERROR "Assertion failure:" ${msg} ) - endif (NOT ${value}) -endmacro(TEST_ASSERT) + endif () +endmacro() macro(TEST_FAIL value msg) if (${value}) message (SEND_ERROR "Failing test succeeded:" ${msg} ) - endif (${value}) -endmacro(TEST_FAIL) + endif () +endmacro() macro(TEST_EXPECT_EXACT command expected) if(NOT "x${result}" STREQUAL "x${expected}") message(SEND_ERROR "${CMAKE_CURRENT_LIST_LINE}: TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"") - endif(NOT "x${result}" STREQUAL "x${expected}") -endmacro(TEST_EXPECT_EXACT command expected) + endif() +endmacro() macro(TEST_EXPECT_CONTAINS command expected) if(NOT "${result}" MATCHES "${expected}") message(SEND_ERROR "${CMAKE_CURRENT_LIST_LINE}: TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"") - endif(NOT "${result}" MATCHES "${expected}") -endmacro(TEST_EXPECT_CONTAINS command expected) + endif() +endmacro() # try to compile a file that should compile @@ -37,12 +37,12 @@ try_compile(SHOULD_PASS if(NOT SHOULD_PASS) message(SEND_ERROR "should pass failed ${TRY_OUT}") -endif(NOT SHOULD_PASS) +endif() if(NOT EXISTS "${TryCompile_BINARY_DIR}/CopyOfPass") message(SEND_ERROR "COPY_FILE to \"${TryCompile_BINARY_DIR}/CopyOfPass\" failed") -else(NOT EXISTS "${TryCompile_BINARY_DIR}/CopyOfPass") +else() file(REMOVE "${TryCompile_BINARY_DIR}/CopyOfPass") -endif(NOT EXISTS "${TryCompile_BINARY_DIR}/CopyOfPass") +endif() # try to compile a file that should not compile try_compile(SHOULD_FAIL @@ -51,7 +51,7 @@ try_compile(SHOULD_FAIL OUTPUT_VARIABLE TRY_OUT) if(SHOULD_FAIL) message(SEND_ERROR "Should fail passed ${TRY_OUT}") -endif(SHOULD_FAIL) +endif() # try to compile a file that should compile try_compile(SHOULD_PASS @@ -60,7 +60,7 @@ try_compile(SHOULD_PASS OUTPUT_VARIABLE TRY_OUT) if(NOT SHOULD_PASS) message(SEND_ERROR "should pass failed ${TRY_OUT}") -endif(NOT SHOULD_PASS) +endif() # try to compile a file that should not compile try_compile(SHOULD_FAIL @@ -69,42 +69,42 @@ try_compile(SHOULD_FAIL OUTPUT_VARIABLE TRY_OUT) if(SHOULD_FAIL) message(SEND_ERROR "Should fail passed ${TRY_OUT}") -endif(SHOULD_FAIL) +endif() if(NOT SHOULD_FAIL) if(SHOULD_PASS) message("All Tests passed, ignore all previous output.") - else(SHOULD_PASS) + else() message("Test failed") - endif(SHOULD_PASS) -else(NOT SHOULD_FAIL) + endif() +else() message("Test failed") -endif(NOT SHOULD_FAIL) +endif() try_compile(CMAKE_ANSI_FOR_SCOPE ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp ${CMAKE_ROOT}/Modules/TestForAnsiForScope.cxx OUTPUT_VARIABLE OUT) if (CMAKE_ANSI_FOR_SCOPE) message("Compiler supports ansi for") -else(CMAKE_ANSI_FOR_SCOPE) +else() message("Compiler does not support ansi for scope") -endif(CMAKE_ANSI_FOR_SCOPE) +endif() try_compile(CMAKE_ANSI_FOR_SCOPE ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp ${CMAKE_ROOT}/Modules/TestForAnsiForScope.cxx OUTPUT_VARIABLE OUT) if (CMAKE_ANSI_FOR_SCOPE) message("Compiler supports ansi for") -else(CMAKE_ANSI_FOR_SCOPE) +else() message("Compiler does not support ansi for scope") -endif(CMAKE_ANSI_FOR_SCOPE) +endif() message("use the module now") include(${CMAKE_ROOT}/Modules/TestForANSIForScope.cmake) if (CMAKE_ANSI_FOR_SCOPE) message("Compiler supports ansi for") -else(CMAKE_ANSI_FOR_SCOPE) +else() message("Compiler does not support ansi for scope") -endif(CMAKE_ANSI_FOR_SCOPE) +endif() message("Testing try_compile project mode") try_compile(TEST_INNER @@ -129,18 +129,18 @@ try_run(SHOULD_RUN SHOULD_COMPILE OUTPUT_VARIABLE TRY_OUT) if(NOT SHOULD_COMPILE) message(SEND_ERROR "exit_success failed compiling: ${TRY_OUT}") -endif(NOT SHOULD_COMPILE) +endif() if(NOT "${SHOULD_RUN}" STREQUAL "0") message(SEND_ERROR "exit_success failed running with exit code ${SHOULD_RUN}") -endif(NOT "${SHOULD_RUN}" STREQUAL "0") +endif() # check the compile output for the filename if(NOT "${TRY_OUT}" MATCHES "exit_success") message(SEND_ERROR " TRY_OUT didn't contain \"exit_success\": \"${TRY_OUT}\"") -endif(NOT "${TRY_OUT}" MATCHES "exit_success") +endif() # check the run output if(NOT "${TRY_OUT}" MATCHES "hello world") message(SEND_ERROR " TRY_OUT didn't contain \"hello world\": \"${TRY_OUT}\"") -endif(NOT "${TRY_OUT}" MATCHES "hello world") +endif() try_run(ARG_TEST_RUN ARG_TEST_COMPILE ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp @@ -149,10 +149,10 @@ try_run(ARG_TEST_RUN ARG_TEST_COMPILE ARGS arg1 arg2) if(NOT ARG_TEST_COMPILE) message(SEND_ERROR "expect_arg failed compiling: ${TRY_OUT}") -endif(NOT ARG_TEST_COMPILE) +endif() if(NOT "${ARG_TEST_RUN}" STREQUAL "0") message(SEND_ERROR "expect_arg failed running with exit code ${ARG_TEST_RUN} ${TRY_OUT}") -endif(NOT "${ARG_TEST_RUN}" STREQUAL "0") +endif() # try to run a file that should compile and run, but return an error try_run(SHOULD_EXIT_WITH_ERROR SHOULD_COMPILE @@ -163,23 +163,23 @@ try_run(SHOULD_EXIT_WITH_ERROR SHOULD_COMPILE if(NOT SHOULD_COMPILE) message(STATUS " exit_with_error failed compiling: ${COMPILE_OUTPUT}") -endif(NOT SHOULD_COMPILE) +endif() if("${SHOULD_EXIT_WITH_ERROR}" STREQUAL "0") message(SEND_ERROR " exit_with_error passed with exit code ${SHOULD_EXIT_WITH_ERROR}") -endif("${SHOULD_EXIT_WITH_ERROR}" STREQUAL "0") +endif() # check the compile output, it should contain the filename if(NOT "${COMPILE_OUTPUT}" MATCHES "exit_with_error") message(SEND_ERROR " COMPILE_OUT didn't contain \"exit_with_error\": \"${COMPILE_OUTPUT}\"") -endif(NOT "${COMPILE_OUTPUT}" MATCHES "exit_with_error") +endif() #... but not the run time output if("${COMPILE_OUTPUT}" MATCHES "hello world") message(SEND_ERROR " COMPILE_OUT contains the run output: \"${COMPILE_OUTPUT}\"") -endif("${COMPILE_OUTPUT}" MATCHES "hello world") +endif() # check the run output, it should stdout if(NOT "${RUN_OUTPUT}" MATCHES "hello world") message(SEND_ERROR " RUN_OUTPUT didn't contain \"hello world\": \"${RUN_OUTPUT}\"") -endif(NOT "${RUN_OUTPUT}" MATCHES "hello world") +endif() ####################################################################### # diff --git a/Tests/Tutorial/Step2/CMakeLists.txt b/Tests/Tutorial/Step2/CMakeLists.txt index c82b7df..cf1d30e 100644 --- a/Tests/Tutorial/Step2/CMakeLists.txt +++ b/Tests/Tutorial/Step2/CMakeLists.txt @@ -24,7 +24,7 @@ if (USE_MYMATH) include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions") add_subdirectory (MathFunctions) set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions) -endif (USE_MYMATH) +endif () # add the executable add_executable (Tutorial tutorial.cxx) diff --git a/Tests/Tutorial/Step3/CMakeLists.txt b/Tests/Tutorial/Step3/CMakeLists.txt index 22d7150..762302b 100644 --- a/Tests/Tutorial/Step3/CMakeLists.txt +++ b/Tests/Tutorial/Step3/CMakeLists.txt @@ -24,7 +24,7 @@ if (USE_MYMATH) include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions") add_subdirectory (MathFunctions) set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions) -endif (USE_MYMATH) +endif () # add the executable add_executable (Tutorial tutorial.cxx) diff --git a/Tests/Tutorial/Step4/CMakeLists.txt b/Tests/Tutorial/Step4/CMakeLists.txt index fbceedb..6994aa1 100644 --- a/Tests/Tutorial/Step4/CMakeLists.txt +++ b/Tests/Tutorial/Step4/CMakeLists.txt @@ -29,7 +29,7 @@ if (USE_MYMATH) include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions") add_subdirectory (MathFunctions) set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions) -endif (USE_MYMATH) +endif () # add the executable add_executable (Tutorial tutorial.cxx) @@ -59,7 +59,7 @@ macro (do_test arg result) set_tests_properties (TutorialComp${arg} PROPERTIES PASS_REGULAR_EXPRESSION ${result} ) -endmacro (do_test) +endmacro () # do a bunch of result based tests do_test (25 "25 is 5") diff --git a/Tests/Tutorial/Step5/CMakeLists.txt b/Tests/Tutorial/Step5/CMakeLists.txt index dcd735b..e40b676 100644 --- a/Tests/Tutorial/Step5/CMakeLists.txt +++ b/Tests/Tutorial/Step5/CMakeLists.txt @@ -29,7 +29,7 @@ if (USE_MYMATH) include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions") add_subdirectory (MathFunctions) set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions) -endif (USE_MYMATH) +endif () # add the executable add_executable (Tutorial tutorial.cxx) @@ -59,7 +59,7 @@ macro (do_test arg result) set_tests_properties (TutorialComp${arg} PROPERTIES PASS_REGULAR_EXPRESSION ${result} ) -endmacro (do_test) +endmacro () # do a bunch of result based tests do_test (4 "4 is 2") diff --git a/Tests/Tutorial/Step6/CMakeLists.txt b/Tests/Tutorial/Step6/CMakeLists.txt index 92a29fa..0fb7cac 100644 --- a/Tests/Tutorial/Step6/CMakeLists.txt +++ b/Tests/Tutorial/Step6/CMakeLists.txt @@ -29,7 +29,7 @@ if (USE_MYMATH) include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions") add_subdirectory (MathFunctions) set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions) -endif (USE_MYMATH) +endif () # add the executable add_executable (Tutorial tutorial.cxx) @@ -59,7 +59,7 @@ macro (do_test arg result) set_tests_properties (TutorialComp${arg} PROPERTIES PASS_REGULAR_EXPRESSION ${result} ) -endmacro (do_test) +endmacro () # do a bunch of result based tests do_test (4 "4 is 2") diff --git a/Tests/Tutorial/Step7/CMakeLists.txt b/Tests/Tutorial/Step7/CMakeLists.txt index 898723a..d9a92fb 100644 --- a/Tests/Tutorial/Step7/CMakeLists.txt +++ b/Tests/Tutorial/Step7/CMakeLists.txt @@ -29,7 +29,7 @@ if (USE_MYMATH) include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions") add_subdirectory (MathFunctions) set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions) -endif (USE_MYMATH) +endif () # add the executable add_executable (Tutorial tutorial.cxx) @@ -59,7 +59,7 @@ macro (do_test arg result) set_tests_properties (TutorialComp${arg} PROPERTIES PASS_REGULAR_EXPRESSION ${result} ) -endmacro (do_test) +endmacro () # do a bunch of result based tests do_test (4 "4 is 2") diff --git a/Tests/Unset/CMakeLists.txt b/Tests/Unset/CMakeLists.txt index bacb6d2..781da3f 100644 --- a/Tests/Unset/CMakeLists.txt +++ b/Tests/Unset/CMakeLists.txt @@ -5,51 +5,51 @@ project(Unset C) set(x 42) if(NOT x EQUAL 42) message(FATAL_ERROR "x!=42") -endif(NOT x EQUAL 42) +endif() if(NOT DEFINED x) message(FATAL_ERROR "x should be defined!") -endif(NOT DEFINED x) +endif() unset(x) if(DEFINED x) message(FATAL_ERROR "x should be undefined now!") -endif(DEFINED x) +endif() # Local variable test unset via set() set(x 43) if(NOT x EQUAL 43) message(FATAL_ERROR "x!=43") -endif(NOT x EQUAL 43) +endif() set(x) if(DEFINED x) message(FATAL_ERROR "x should be undefined now!") -endif(DEFINED x) +endif() # Cache variable set(BAR "test" CACHE STRING "documentation") if(NOT DEFINED BAR) message(FATAL_ERROR "BAR not defined") -endif(NOT DEFINED BAR) +endif() # Test interaction of cache entries with variables. set(BAR "test-var") if(NOT "$CACHE{BAR}" STREQUAL "test") message(FATAL_ERROR "\$CACHE{BAR} changed by variable BAR") -endif(NOT "$CACHE{BAR}" STREQUAL "test") +endif() if(NOT "${BAR}" STREQUAL "test-var") message(FATAL_ERROR "\${BAR} not separate from \$CACHE{BAR}") -endif(NOT "${BAR}" STREQUAL "test-var") +endif() unset(BAR) if(NOT "${BAR}" STREQUAL "test") message(FATAL_ERROR "\${BAR} does not fall through to \$CACHE{BAR}") -endif(NOT "${BAR}" STREQUAL "test") +endif() # Test unsetting of CACHE entry. unset(BAR CACHE) if(DEFINED BAR) message(FATAL_ERROR "BAR still defined") -endif(DEFINED BAR) +endif() add_executable(Unset unset.c) diff --git a/Tests/VSExternalInclude/CMakeLists.txt b/Tests/VSExternalInclude/CMakeLists.txt index af0b18f..399ac69 100644 --- a/Tests/VSExternalInclude/CMakeLists.txt +++ b/Tests/VSExternalInclude/CMakeLists.txt @@ -3,9 +3,9 @@ project(VSExternalInclude) if(${CMAKE_GENERATOR} MATCHES "Visual Studio 6") set(PROJECT_EXT dsp) -else(${CMAKE_GENERATOR} MATCHES "Visual Studio 6") +else() set(PROJECT_EXT vcproj) -endif(${CMAKE_GENERATOR} MATCHES "Visual Studio 6") +endif() if(${CMAKE_GENERATOR} MATCHES "Visual Studio 1[01]") set(PROJECT_EXT vcxproj) endif() diff --git a/Tests/Wrapping/CMakeLists.txt b/Tests/Wrapping/CMakeLists.txt index 344b11d..22233df 100644 --- a/Tests/Wrapping/CMakeLists.txt +++ b/Tests/Wrapping/CMakeLists.txt @@ -24,9 +24,9 @@ set (EXECUTABLE_OUTPUT_PATH # if (EXECUTABLE_OUTPUT_PATH) set (CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH}) -else (EXECUTABLE_OUTPUT_PATH) +else () set (CXX_TEST_PATH .) -endif (EXECUTABLE_OUTPUT_PATH) +endif () # # Add exe @@ -36,7 +36,7 @@ add_executable (wrapping wrapping.cxx) add_executable (Wrap Wrap.c) if(WIN32) set(EXE_EXT ".exe") -endif(WIN32) +endif() set(WRAP ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/Wrap${EXE_EXT}) # @@ -75,9 +75,9 @@ if (QT_FOUND AND QT_WRAP_UI) target_link_libraries(qtwrapping myqtlib) target_link_libraries( qtwrapping ${QT_LIBRARIES} ) -else (QT_FOUND AND QT_WRAP_UI) +else () add_executable (qtwrapping qtnoqtmain.cxx) -endif (QT_FOUND AND QT_WRAP_UI) +endif () # # FLTK Wrappers diff --git a/Tests/X11/CMakeLists.txt b/Tests/X11/CMakeLists.txt index 33ee277..76ae58c 100644 --- a/Tests/X11/CMakeLists.txt +++ b/Tests/X11/CMakeLists.txt @@ -16,9 +16,9 @@ if(APPLE) if(NOT EXISTS /usr/X11R6/lib//libSM.6.dylib) set(X11_FOUND FALSE) message("disable X11, because of universal binary and sysroot") - endif(NOT EXISTS /usr/X11R6/lib//libSM.6.dylib) - endif(NUMARCH GREATER 1) -endif(APPLE) + endif() + endif() +endif() if(X11_FOUND) add_definitions(-DCMAKE_HAS_X) @@ -33,8 +33,8 @@ if(X11_FOUND) set(CPACK_BINARY_PACKAGEMAKER OFF CACHE BOOL "" FORCE ) set(CPACK_PACKAGE_NAME HelloWorldX11Package) set(CPACK_PACKAGE_EXECUTABLES HelloWorldX11 HelloWorldX11) - endif(APPLE) -endif(X11_FOUND) + endif() +endif() # build a CPack driven installer package include(CPack) |