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 adds a test that uses two project commands in the same CMakeLists.txt
file. It also adds a fix so that cmake --build will work in that case.
The fix sets the name of the last project command in the top level
CMakeLists.txt in the cache variable CMAKE_PROJECT_NAME. This variable
is used by cmake --build to find the project name.
This cleans up the 'cmake --build' command-line interface:
- Rename --clean to --clean-first to better describe it.
- Replace --extra-options with a -- separator to simplify passing of
multiple native build tool options.
- Document the options in the main CMake man page description of the
--build option, and shares this with the usage message.
- Require --build to be the first argument when present.
- Move implementation into cmakemain where it belongs.