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/TarTest | |
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/TarTest')
-rw-r--r-- | Tests/TarTest/CMakeLists.txt | 18 |
1 files changed, 9 insertions, 9 deletions
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") |