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/CMakeTests/FindBaseTest.cmake.in | |
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/CMakeTests/FindBaseTest.cmake.in')
-rw-r--r-- | Tests/CMakeTests/FindBaseTest.cmake.in | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Tests/CMakeTests/FindBaseTest.cmake.in b/Tests/CMakeTests/FindBaseTest.cmake.in index 47c1692..658b350 100644 --- a/Tests/CMakeTests/FindBaseTest.cmake.in +++ b/Tests/CMakeTests/FindBaseTest.cmake.in @@ -12,7 +12,7 @@ set(_HEADER_FULL_A "${MY_SOURCE_DIR}/A/include/${_HEADER}") find_file(FOO_H_1 ${_HEADER}) if(FOO_H_1) message(FATAL_ERROR "${_HEADER} found: ${FOO_H_1}, it should not exist !") -endif(FOO_H_1) +endif() # The HINTS option should override the system but the PATHS option # should not. @@ -21,10 +21,10 @@ find_file(TEST_H_1 ${_HEADER} HINTS ${MY_SOURCE_DIR}/A/include) find_file(TEST_H_2 ${_HEADER} PATHS ${MY_SOURCE_DIR}/A/include) if(NOT "${TEST_H_1}" STREQUAL "${_HEADER_FULL_A}") message(FATAL_ERROR "Did not find \"${_HEADER_FULL_A}\"\ngot \"${TEST_H_1}\" instead!") -endif(NOT "${TEST_H_1}" STREQUAL "${_HEADER_FULL_A}") +endif() if(NOT "${TEST_H_2}" STREQUAL "${_HEADER_FULL}") message(FATAL_ERROR "Did not find \"${_HEADER_FULL}\"\ngot \"${TEST_H_2}\" instead!") -endif(NOT "${TEST_H_2}" STREQUAL "${_HEADER_FULL}") +endif() set(CMAKE_SYSTEM_PREFIX_PATH) # with this it still should not be found, since the include/ subdir is still missing @@ -32,20 +32,20 @@ set(CMAKE_INCLUDE_PATH "${MY_SOURCE_DIR}") find_file(FOO_H_2 ${_HEADER}) if(FOO_H_2) message(FATAL_ERROR "${_HEADER} found: ${FOO_H_2}, it should not exist !") -endif(FOO_H_2) +endif() # now with the PATH_SUFFIX it should be found find_file(FOO_H_3 NAMES ${_HEADER} PATH_SUFFIXES include ) if(NOT "${FOO_H_3}" STREQUAL "${_HEADER_FULL}") message(FATAL_ERROR "Did not find \"${_HEADER_FULL}\"\ngot ${FOO_H_3} instead !") -endif(NOT "${FOO_H_3}" STREQUAL "${_HEADER_FULL}") +endif() # without PATH_SUFFIX, but with a CMAKE_INCLUDE_PATH it should not be found set(CMAKE_INCLUDE_PATH /include) find_file(FOO_H_4 ${_HEADER}) if(FOO_H_4) message(FATAL_ERROR "${_HEADER} found: ${FOO_H_4}, it should not exist !") -endif(FOO_H_4) +endif() # when setting CMAKE_FIND_ROOT_PATH to the current source dir, # together with the CMAKE_INCLUDE_PATH it should be found @@ -53,10 +53,10 @@ set(CMAKE_FIND_ROOT_PATH blub "${MY_SOURCE_DIR}") find_file(FOO_H_5 ${_HEADER}) if(NOT "${FOO_H_5}" STREQUAL "${_HEADER_FULL}") message(FATAL_ERROR "Did not find \"${_HEADER_FULL}\"\ngot ${FOO_H_5} instead !") -endif(NOT "${FOO_H_5}" STREQUAL "${_HEADER_FULL}") +endif() # by explicitly disabling CMAKE_FIND_ROOT_PATH again it shouldn't be found find_file(FOO_H_6 ${_HEADER} NO_CMAKE_FIND_ROOT_PATH) if(FOO_H_6) message(FATAL_ERROR "${_HEADER} found: ${FOO_H_6}, it should not exist !") -endif(FOO_H_6) +endif() |