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/SimpleInstall/CMakeLists.txt | |
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/SimpleInstall/CMakeLists.txt')
-rw-r--r-- | Tests/SimpleInstall/CMakeLists.txt | 78 |
1 files changed, 39 insertions, 39 deletions
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) |