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 /Utilities/Release | |
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 'Utilities/Release')
-rw-r--r-- | Utilities/Release/Cygwin/CMakeLists.txt | 6 | ||||
-rw-r--r-- | Utilities/Release/create-cmake-release.cmake | 2 | ||||
-rw-r--r-- | Utilities/Release/release_cmake.cmake | 64 | ||||
-rw-r--r-- | Utilities/Release/upload_release.cmake | 2 |
4 files changed, 37 insertions, 37 deletions
diff --git a/Utilities/Release/Cygwin/CMakeLists.txt b/Utilities/Release/Cygwin/CMakeLists.txt index 6a45361..c59a6fa 100644 --- a/Utilities/Release/Cygwin/CMakeLists.txt +++ b/Utilities/Release/Cygwin/CMakeLists.txt @@ -5,9 +5,9 @@ foreach(f ${INSTALLED_CURSES}) string(REGEX REPLACE ".*-([0-9]*).dll" "\\1" NUMBER "${f}") if(NUMBER GREATER MAX) set(MAX ${NUMBER}) - endif(NUMBER GREATER MAX) - endif(NOT "${f}" MATCHES "\\+") -endforeach(f) + endif() + endif() +endforeach() string(REGEX REPLACE "/usr/bin/" "\\1" NUMBER "${f}") set(CMAKE_NCURSES_VERSION "libncurses${MAX}") message(STATUS "Using curses version: libncurses${MAX}") diff --git a/Utilities/Release/create-cmake-release.cmake b/Utilities/Release/create-cmake-release.cmake index c304e67..37e223d 100644 --- a/Utilities/Release/create-cmake-release.cmake +++ b/Utilities/Release/create-cmake-release.cmake @@ -32,7 +32,7 @@ ${CMAKE_COMMAND} -DCMAKE_CREATE_VERSION=${CMAKE_CREATE_VERSION} -P ${CMAKE_ROOT} xterm -geometry 64x6+${x}+${y} -sb -sl 2000 -T ${f}-${CMAKE_CREATE_VERSION}.log -e tail -f ${CMAKE_CURRENT_SOURCE_DIR}/logs/${f}-${CMAKE_CREATE_VERSION}.log& ") math(EXPR i "${i}+1") - endforeach(f) + endforeach() execute_process(COMMAND chmod a+x ${filename}) endfunction() diff --git a/Utilities/Release/release_cmake.cmake b/Utilities/Release/release_cmake.cmake index 04ec2e5..f351ac8 100644 --- a/Utilities/Release/release_cmake.cmake +++ b/Utilities/Release/release_cmake.cmake @@ -3,31 +3,31 @@ get_filename_component(SCRIPT_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH) # default to self extracting tgz, tgz, and tar.Z if(NOT DEFINED CPACK_BINARY_GENERATORS) set(CPACK_BINARY_GENERATORS "STGZ TGZ TZ") -endif(NOT DEFINED CPACK_BINARY_GENERATORS) +endif() if(DEFINED EXTRA_COPY) set(HAS_EXTRA_COPY 1) -endif(DEFINED EXTRA_COPY) +endif() if(NOT DEFINED CMAKE_RELEASE_DIRECTORY) set(CMAKE_RELEASE_DIRECTORY "~/CMakeReleaseDirectory") -endif(NOT DEFINED CMAKE_RELEASE_DIRECTORY) +endif() if(NOT DEFINED SCRIPT_NAME) set(SCRIPT_NAME "${HOST}") -endif(NOT DEFINED SCRIPT_NAME) +endif() if(NOT DEFINED MAKE_PROGRAM) message(FATAL_ERROR "MAKE_PROGRAM must be set") -endif(NOT DEFINED MAKE_PROGRAM) +endif() if(NOT DEFINED MAKE) set(MAKE "${MAKE_PROGRAM}") -endif(NOT DEFINED MAKE) +endif() if(NOT DEFINED RUN_SHELL) set(RUN_SHELL "/bin/sh") -endif(NOT DEFINED RUN_SHELL) +endif() if(NOT DEFINED PROCESSORS) set(PROCESSORS 1) -endif(NOT DEFINED PROCESSORS) +endif() if(NOT DEFINED CMAKE_CREATE_VERSION) message(FATAL_ERROR "CMAKE_CREATE_VERSION not defined") -endif(NOT DEFINED CMAKE_CREATE_VERSION) +endif() if(NOT DEFINED GIT_COMMAND) set(GIT_COMMAND git) endif() @@ -40,14 +40,14 @@ endif() if(NOT DEFINED FINAL_PATH ) set(FINAL_PATH ${CMAKE_RELEASE_DIRECTORY}/${CMAKE_CREATE_VERSION}-build) -endif(NOT DEFINED FINAL_PATH ) +endif() if(NOT HOST) message(FATAL_ERROR "HOST must be specified with -DHOST=host") -endif(NOT HOST) +endif() if(NOT DEFINED MAKE) message(FATAL_ERROR "MAKE must be specified with -DMAKE=\"make -j2\"") -endif(NOT DEFINED MAKE) +endif() message("Creating CMake release ${CMAKE_CREATE_VERSION} on ${HOST} with parallel = ${PROCESSORS}") @@ -57,14 +57,14 @@ macro(remote_command comment command) if(${ARGC} GREATER 2) message("ssh ${HOST} ${EXTRA_HOP} ${command}") execute_process(COMMAND ssh ${HOST} ${EXTRA_HOP} ${command} RESULT_VARIABLE result INPUT_FILE ${ARGV2}) - else(${ARGC} GREATER 2) + else() message("ssh ${HOST} ${EXTRA_HOP} ${command}") execute_process(COMMAND ssh ${HOST} ${EXTRA_HOP} ${command} RESULT_VARIABLE result) - endif(${ARGC} GREATER 2) + endif() if(${result} GREATER 0) message(FATAL_ERROR "Error running command: ${command}, return value = ${result}") - endif(${result} GREATER 0) -endmacro(remote_command) + endif() +endmacro() # set this so configure file will work from script mode # create the script specific for the given host @@ -75,10 +75,10 @@ configure_file(${SCRIPT_PATH}/release_cmake.sh.in ${SCRIPT_FILE} @ONLY) # then using the script file as input to the shell if(RUN_LOCAL) message(FATAL_ERROR "run this command: ${RUN_SHELL} ${SCRIPT_FILE}") -else(RUN_LOCAL) +else() remote_command("run release_cmake-${HOST}.sh on server" "${RUN_SHELL}" ${SCRIPT_FILE}) -endif(RUN_LOCAL) +endif() # now figure out which types of packages were created set(generators ${CPACK_BINARY_GENERATORS} ${CPACK_SOURCE_GENERATORS}) @@ -86,30 +86,30 @@ separate_arguments(generators) foreach(gen ${generators}) if("${gen}" STREQUAL "TGZ") set(SUFFIXES ${SUFFIXES} "*.tar.gz") - endif("${gen}" STREQUAL "TGZ") + endif() if("${gen}" STREQUAL "STGZ") set(SUFFIXES ${SUFFIXES} "*.sh") - endif("${gen}" STREQUAL "STGZ") + endif() if("${gen}" STREQUAL "PackageMaker") set(SUFFIXES ${SUFFIXES} "*.dmg") - endif("${gen}" STREQUAL "PackageMaker") + endif() if("${gen}" STREQUAL "TBZ2") set(SUFFIXES ${SUFFIXES} "*.tar.bz2") - endif("${gen}" STREQUAL "TBZ2") + endif() if("${gen}" MATCHES "Cygwin") set(SUFFIXES ${SUFFIXES} "*.tar.bz2") set(extra_files setup.hint) - endif("${gen}" MATCHES "Cygwin") + endif() if("${gen}" STREQUAL "TZ") set(SUFFIXES ${SUFFIXES} "*.tar.Z") - endif("${gen}" STREQUAL "TZ") + endif() if("${gen}" STREQUAL "ZIP") set(SUFFIXES ${SUFFIXES} "*.zip") - endif("${gen}" STREQUAL "ZIP") + endif() if("${gen}" STREQUAL "NSIS") set(SUFFIXES ${SUFFIXES} "*.exe") - endif("${gen}" STREQUAL "NSIS") -endforeach(gen) + endif() +endforeach() # copy all the files over from the remote machine set(PROJECT_PREFIX cmake-) foreach(suffix ${SUFFIXES}) @@ -119,8 +119,8 @@ foreach(suffix ${SUFFIXES}) RESULT_VARIABLE result) if(${result} GREATER 0) message("error getting file back scp ${HOST}:${FINAL_PATH}/${PROJECT_PREFIX}${suffix} .") - endif(${result} GREATER 0) -endforeach(suffix) + endif() +endforeach() # if there are extra files to copy get them as well if(extra_files) @@ -131,6 +131,6 @@ if(extra_files) RESULT_VARIABLE result) if(${result} GREATER 0) message("error getting file back scp ${HOST}:${FINAL_PATH}/${f} .") - endif(${result} GREATER 0) - endforeach(f) -endif(extra_files) + endif() + endforeach() +endif() diff --git a/Utilities/Release/upload_release.cmake b/Utilities/Release/upload_release.cmake index 827e683..9bf3523 100644 --- a/Utilities/Release/upload_release.cmake +++ b/Utilities/Release/upload_release.cmake @@ -34,7 +34,7 @@ foreach(file ${FILES}) math(EXPR count "${count} + 1") endif() -endforeach(file) +endforeach() if(${count} EQUAL 0) message(FATAL_ERROR "Error no files uploaded.") endif() |