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/Complex/Executable | |
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/Complex/Executable')
-rw-r--r-- | Tests/Complex/Executable/CMakeLists.txt | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/Tests/Complex/Executable/CMakeLists.txt b/Tests/Complex/Executable/CMakeLists.txt index 4138835..432dbf8 100644 --- a/Tests/Complex/Executable/CMakeLists.txt +++ b/Tests/Complex/Executable/CMakeLists.txt @@ -11,16 +11,16 @@ add_library(ExeImportedTarget UNKNOWN IMPORTED) # Test if(TARGET) command. if(NOT TARGET CMakeTestLibrary) message(FATAL_ERROR "if(NOT TARGET CMakeTestLibrary) returned true!") -endif(NOT TARGET CMakeTestLibrary) +endif() if(NOT TARGET ExeImportedTarget) message(FATAL_ERROR "if(NOT TARGET ExeImportedTarget) returned true!") -endif(NOT TARGET ExeImportedTarget) +endif() if(TARGET LibImportedTarget) message(FATAL_ERROR "if(TARGET LibImportedTarget) returned true!") -endif(TARGET LibImportedTarget) +endif() if(TARGET NotATarget) message(FATAL_ERROR "if(TARGET NotATarget) returned true!") -endif(TARGET NotATarget) +endif() # Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to set(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared) @@ -46,37 +46,37 @@ add_executable(complex.file complex.file.cxx complex_nobuild.cxx if (UNIX) target_link_libraries(complex ${CMAKE_DL_LIBS}) -else(UNIX) +else() if (NOT BORLAND) if(NOT MINGW) target_link_libraries(complex rpcrt4.lib) - endif(NOT MINGW) - endif(NOT BORLAND) -endif (UNIX) + endif() + endif() +endif () # Test linking to static lib when a shared lib has the same name. if(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) add_definitions(-DCOMPLEX_TEST_LINK_STATIC) target_link_libraries(complex CMakeTestLinkStatic) -endif(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) +endif() # can we get the path to a source file get_source_file_property(A_LOCATION A.cxx LOCATION) if ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx") add_definitions(-DCMAKE_FOUND_ACXX) -endif ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx") +endif () # get the directory parent get_directory_property(P_VALUE PARENT_DIRECTORY) if ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}") add_definitions(-DCMAKE_FOUND_PARENT) -endif ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}") +endif () # get the stack of listfiles include(Included.cmake) if ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake") add_definitions(-DCMAKE_FOUND_LISTFILE_STACK) -endif ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake") +endif () # Test add/remove definitions. add_definitions( @@ -128,7 +128,7 @@ target_link_libraries(notInAllExe notInAllLib) if(MSVC) set_target_properties(notInAllExe PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBC;LIBCMT;MSVCRT") -endif(MSVC) +endif() # Test creating a custom target that builds not-in-all targets. add_custom_target(notInAllCustom) @@ -146,7 +146,7 @@ add_subdirectory(Temp) if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX) add_executable(testSystemDir testSystemDir.cxx) set_target_properties(testSystemDir PROPERTIES COMPILE_FLAGS "-Werror") -endif(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX) +endif() # # Extra coverage.Not used. |