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/CMakeExpandImportedTargets.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/CMakeExpandImportedTargets.cmake')
-rw-r--r-- | Modules/CMakeExpandImportedTargets.cmake | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/Modules/CMakeExpandImportedTargets.cmake b/Modules/CMakeExpandImportedTargets.cmake index d698ad8..14551d1 100644 --- a/Modules/CMakeExpandImportedTargets.cmake +++ b/Modules/CMakeExpandImportedTargets.cmake @@ -76,16 +76,16 @@ function(CMAKE_EXPAND_IMPORTED_TARGETS _RESULT ) # guard against infinite loop: abort after 100 iterations ( 100 is arbitrary chosen) if ("${_CCSR_LOOP_COUNTER}" LESS 100) set(_CHECK_FOR_IMPORTED_TARGETS TRUE) -# else ("${_CCSR_LOOP_COUNTER}" LESS 1) +# else () # message(STATUS "********* aborting loop, counter : ${_CCSR_LOOP_COUNTER}") - endif ("${_CCSR_LOOP_COUNTER}" LESS 100) + endif () # if one of the imported configurations equals ${CMAKE_TRY_COMPILE_CONFIGURATION}, # use it, otherwise simply use the first one: list(FIND _importedConfigs "${CEIT_CONFIGURATION}" _configIndexToUse) if("${_configIndexToUse}" EQUAL -1) set(_configIndexToUse 0) - endif("${_configIndexToUse}" EQUAL -1) + endif() list(GET _importedConfigs ${_configIndexToUse} _importedConfigToUse) get_target_property(_importedLocation "${_CURRENT_LIB}" IMPORTED_LOCATION_${_importedConfigToUse}) @@ -98,18 +98,18 @@ function(CMAKE_EXPAND_IMPORTED_TARGETS _RESULT ) # message(STATUS "Appending link interface lib ${_currentLinkInterfaceLib}") if(_currentLinkInterfaceLib) list(APPEND _CCSR_NEW_REQ_LIBS "${_currentLinkInterfaceLib}" ) - endif(_currentLinkInterfaceLib) - endforeach(_currentLinkInterfaceLib "${_linkInterfaceLibs}") - endif(_linkInterfaceLibs) - else(_importedConfigs) + endif() + endforeach() + endif() + else() # "Normal" libraries are just used as they are. list(APPEND _CCSR_NEW_REQ_LIBS "${_CURRENT_LIB}" ) # message(STATUS "Appending lib directly: ${_CURRENT_LIB}") - endif(_importedConfigs) - endforeach(_CURRENT_LIB ${_CCSR_REQ_LIBS}) + endif() + endforeach() set(_CCSR_REQ_LIBS ${_CCSR_NEW_REQ_LIBS} ) - endwhile(_CHECK_FOR_IMPORTED_TARGETS) + endwhile() # Finally we iterate once more over all libraries. This loop only removes # all remaining imported target names (there shouldn't be any left anyway). @@ -119,10 +119,10 @@ function(CMAKE_EXPAND_IMPORTED_TARGETS _RESULT ) if (NOT _importedConfigs) list(APPEND _CCSR_NEW_REQ_LIBS "${_CURRENT_LIB}" ) # message(STATUS "final: appending ${_CURRENT_LIB}") - else (NOT _importedConfigs) + else () # message(STATUS "final: skipping ${_CURRENT_LIB}") - endif (NOT _importedConfigs) - endforeach(_CURRENT_LIB ${_CCSR_REQ_LIBS}) + endif () + endforeach() # message(STATUS "setting -${_RESULT}- to -${_CCSR_NEW_REQ_LIBS}-") set(${_RESULT} "${_CCSR_NEW_REQ_LIBS}" PARENT_SCOPE) |