diff options
author | Kitware Robot <kwrobot@kitware.com> | 2012-08-13 17:50:14 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-08-13 18:19:16 (GMT) |
commit | 9db3116226cb99fcf54e936c833953abcde9b729 (patch) | |
tree | bd755ed9e616bbf1482a894bc7946980d81b7703 /Tests/BuildDepends | |
parent | 77543bde41b0e52c3959016698b529835945d62d (diff) | |
download | CMake-9db3116226cb99fcf54e936c833953abcde9b729.zip CMake-9db3116226cb99fcf54e936c833953abcde9b729.tar.gz CMake-9db3116226cb99fcf54e936c833953abcde9b729.tar.bz2 |
Remove CMake-language block-end command arguments
Ancient versions of CMake required else(), endif(), and similar block
termination commands to have arguments matching the command starting the
block. This is no longer the preferred style.
Run the following shell code:
for c in else endif endforeach endfunction endmacro endwhile; do
echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
egrep -z -v 'Tests/CMakeTests/While-Endwhile-' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
Diffstat (limited to 'Tests/BuildDepends')
-rw-r--r-- | Tests/BuildDepends/CMakeLists.txt | 30 | ||||
-rw-r--r-- | Tests/BuildDepends/Project/CMakeLists.txt | 6 |
2 files changed, 18 insertions, 18 deletions
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 |