mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-30 18:29:37 -06:00
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
This commit is contained in:
@@ -28,7 +28,7 @@ function(WRITE_BASIC_CONFIG_VERSION_FILE _filename)
|
||||
|
||||
if(CVF_UNPARSED_ARGUMENTS)
|
||||
message(FATAL_ERROR "Unknown keywords given to WRITE_BASIC_CONFIG_VERSION_FILE(): \"${CVF_UNPARSED_ARGUMENTS}\"")
|
||||
endif(CVF_UNPARSED_ARGUMENTS)
|
||||
endif()
|
||||
|
||||
set(versionTemplateFile "${CMAKE_ROOT}/Modules/BasicConfigVersion-${CVF_COMPATIBILITY}.cmake.in")
|
||||
if(NOT EXISTS "${versionTemplateFile}")
|
||||
@@ -41,4 +41,4 @@ function(WRITE_BASIC_CONFIG_VERSION_FILE _filename)
|
||||
|
||||
configure_file("${versionTemplateFile}" "${_filename}" @ONLY)
|
||||
|
||||
endfunction(WRITE_BASIC_CONFIG_VERSION_FILE)
|
||||
endfunction()
|
||||
|
||||
Reference in New Issue
Block a user