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 /Modules/CPackDeb.cmake | |
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 'Modules/CPackDeb.cmake')
-rw-r--r-- | Modules/CPackDeb.cmake | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake index 640cf9a..106b44c 100644 --- a/Modules/CPackDeb.cmake +++ b/Modules/CPackDeb.cmake @@ -187,22 +187,22 @@ if(CMAKE_BINARY_DIR) message(FATAL_ERROR "CPackDeb.cmake may only be used by CPack internally.") -endif(CMAKE_BINARY_DIR) +endif() if(NOT UNIX) message(FATAL_ERROR "CPackDeb.cmake may only be used under UNIX.") -endif(NOT UNIX) +endif() # CPACK_DEBIAN_PACKAGE_SHLIBDEPS # If specify OFF, only user depends are used if(NOT DEFINED CPACK_DEBIAN_PACKAGE_SHLIBDEPS) set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) -endif(NOT DEFINED CPACK_DEBIAN_PACKAGE_SHLIBDEPS) +endif() find_program(FAKEROOT_EXECUTABLE fakeroot) if(FAKEROOT_EXECUTABLE) set(CPACK_DEBIAN_FAKEROOT_EXECUTABLE ${FAKEROOT_EXECUTABLE}) -endif(FAKEROOT_EXECUTABLE) +endif() if(CPACK_DEBIAN_PACKAGE_SHLIBDEPS) # dpkg-shlibdeps is a Debian utility for generating dependency list @@ -220,7 +220,7 @@ if(CPACK_DEBIAN_PACKAGE_SHLIBDEPS) set(SHLIBDEPS_EXECUTABLE_VERSION "${CMAKE_MATCH_1}") if(CPACK_DEBIAN_PACKAGE_DEBUG) message( "CPackDeb Debug: dpkg-shlibdeps version is <${SHLIBDEPS_EXECUTABLE_VERSION}>") - endif(CPACK_DEBIAN_PACKAGE_DEBUG) + endif() # Generating binary list - Get type of all install files execute_process(COMMAND find -type f @@ -260,17 +260,17 @@ if(CPACK_DEBIAN_PACKAGE_SHLIBDEPS) if(CPACK_DEBIAN_PACKAGE_DEBUG) # dpkg-shlibdeps will throw some warnings if some input files are not binary message( "CPackDeb Debug: dpkg-shlibdeps warnings \n${SHLIBDEPS_ERROR}") - endif(CPACK_DEBIAN_PACKAGE_DEBUG) + endif() if (NOT SHLIBDEPS_RESULT EQUAL 0) message (FATAL_ERROR "CPackDeb: dpkg-shlibdeps: ${SHLIBDEPS_ERROR}") - endif (NOT SHLIBDEPS_RESULT EQUAL 0) + endif () #Get rid of prefix generated by dpkg-shlibdeps string (REGEX REPLACE "^.*Depends=" "" CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS ${SHLIBDEPS_OUTPUT}) if(CPACK_DEBIAN_PACKAGE_DEBUG) message( "CPackDeb Debug: Found dependency: ${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}") - endif(CPACK_DEBIAN_PACKAGE_DEBUG) + endif() # Remove blank control file # Might not be safe if package actual contain file or directory named debian @@ -279,21 +279,21 @@ if(CPACK_DEBIAN_PACKAGE_SHLIBDEPS) # Append user depend if set if (CPACK_DEBIAN_PACKAGE_DEPENDS) set (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}, ${CPACK_DEBIAN_PACKAGE_DEPENDS}") - else (CPACK_DEBIAN_PACKAGE_DEPENDS) + else () set (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}") - endif (CPACK_DEBIAN_PACKAGE_DEPENDS) + endif () - else (SHLIBDEPS_EXECUTABLE) + else () if(CPACK_DEBIAN_PACKAGE_DEBUG) message( "CPackDeb Debug: Using only user-provided depends because dpkg-shlibdeps is not found.") - endif(CPACK_DEBIAN_PACKAGE_DEBUG) - endif(SHLIBDEPS_EXECUTABLE) + endif() + endif() -else (CPACK_DEBIAN_PACKAGE_SHLIBDEPS) +else () if(CPACK_DEBIAN_PACKAGE_DEBUG) message( "CPackDeb Debug: Using only user-provided depends") - endif(CPACK_DEBIAN_PACKAGE_DEBUG) -endif(CPACK_DEBIAN_PACKAGE_SHLIBDEPS) + endif() +endif() # Let's define the control file found in debian package: @@ -305,15 +305,15 @@ endif(CPACK_DEBIAN_PACKAGE_SHLIBDEPS) # Package: (mandatory) if(NOT CPACK_DEBIAN_PACKAGE_NAME) string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_DEBIAN_PACKAGE_NAME) -endif(NOT CPACK_DEBIAN_PACKAGE_NAME) +endif() # Version: (mandatory) if(NOT CPACK_DEBIAN_PACKAGE_VERSION) if(NOT CPACK_PACKAGE_VERSION) message(FATAL_ERROR "CPackDeb: Debian package requires a package version") - endif(NOT CPACK_PACKAGE_VERSION) + endif() set(CPACK_DEBIAN_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION}) -endif(NOT CPACK_DEBIAN_PACKAGE_VERSION) +endif() # Architecture: (mandatory) if(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE) @@ -323,12 +323,12 @@ if(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE) if(NOT DPKG_CMD) message(STATUS "CPackDeb: Can not find dpkg in your path, default to i386.") set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386) - endif(NOT DPKG_CMD) + endif() execute_process(COMMAND "${DPKG_CMD}" --print-architecture OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE ) -endif(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE) +endif() # have a look at get_property(result GLOBAL PROPERTY ENABLED_FEATURES), # this returns the successful find_package() calls, maybe this can help @@ -337,33 +337,33 @@ endif(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE) # TODO: automate 'objdump -p | grep NEEDED' if(NOT CPACK_DEBIAN_PACKAGE_DEPENDS) message(STATUS "CPACK_DEBIAN_PACKAGE_DEPENDS not set, the package will have no dependencies.") -endif(NOT CPACK_DEBIAN_PACKAGE_DEPENDS) +endif() # Maintainer: (mandatory) if(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER) if(NOT CPACK_PACKAGE_CONTACT) message(FATAL_ERROR "CPackDeb: Debian package requires a maintainer for a package, set CPACK_PACKAGE_CONTACT or CPACK_DEBIAN_PACKAGE_MAINTAINER") - endif(NOT CPACK_PACKAGE_CONTACT) + endif() set(CPACK_DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_CONTACT}) -endif(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER) +endif() # Description: (mandatory) if(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION) if(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY) message(FATAL_ERROR "CPackDeb: Debian package requires a summary for a package, set CPACK_PACKAGE_DESCRIPTION_SUMMARY or CPACK_DEBIAN_PACKAGE_DESCRIPTION") - endif(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY) + endif() set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY}) -endif(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION) +endif() # Section: (recommended) if(NOT CPACK_DEBIAN_PACKAGE_SECTION) set(CPACK_DEBIAN_PACKAGE_SECTION "devel") -endif(NOT CPACK_DEBIAN_PACKAGE_SECTION) +endif() # Priority: (recommended) if(NOT CPACK_DEBIAN_PACKAGE_PRIORITY) set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional") -endif(NOT CPACK_DEBIAN_PACKAGE_PRIORITY ) +endif() # Recommends: # You should set: CPACK_DEBIAN_PACKAGE_RECOMMENDS @@ -388,11 +388,11 @@ if(CPACK_DEB_PACKAGE_COMPONENT) set(CPACK_DEB_PACKAGE_COMPONENT_PART_PATH "/${CPACK_DEB_PACKAGE_COMPONENT}") set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}/${CPACK_DEB_PACKAGE_COMPONENT}") string(TOLOWER "${CPACK_PACKAGE_NAME}${CPACK_DEB_PACKAGE_COMPONENT_PART_NAME}" CPACK_DEBIAN_PACKAGE_NAME) -else(CPACK_DEB_PACKAGE_COMPONENT) +else() set(CPACK_DEB_PACKAGE_COMPONENT_PART_NAME "") set(CPACK_DEB_PACKAGE_COMPONENT_PART_PATH "") set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}") -endif(CPACK_DEB_PACKAGE_COMPONENT) +endif() # Print out some debug information if we were asked for that if(CPACK_DEBIAN_PACKAGE_DEBUG) @@ -404,7 +404,7 @@ if(CPACK_DEBIAN_PACKAGE_DEBUG) message("CPackDeb:Debug: CPACK_PACKAGE_FILE_NAME = ${CPACK_PACKAGE_FILE_NAME}") message("CPackDeb:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY = ${CPACK_PACKAGE_INSTALL_DIRECTORY}") message("CPackDeb:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}") -endif(CPACK_DEBIAN_PACKAGE_DEBUG) +endif() # For debian source packages: # debian/control @@ -418,4 +418,4 @@ endif(CPACK_DEBIAN_PACKAGE_DEBUG) # set(CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS # "debhelper (>> 5.0.0), libncurses5-dev, tcl8.4" # ) -#endif(NOT CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS) +#endif() |