Commit Graph

8 Commits

Author SHA1 Message Date
Alex Neundorf 8039bd0864 CONFIGURE_PACKAGE_CONFIG_FILE(): improve generated comments
CONFIGURE_PACKAGE_CONFIG_FILE() now additionally generates
"Any changes to this file will be overwritten by the next CMake run
The input file was FooConfig.cmake.in"
into the configured file.

Alex
2012-12-06 22:24:43 +01:00
Kitware Robot 9db3116226 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
2012-08-13 14:19:16 -04:00
Kitware Robot 77543bde41 Convert CMake-language commands to lower case
Ancient CMake versions required upper-case commands.  Later command
names became case-insensitive.  Now the preferred style is lower-case.

Run the following shell code:

cmake --help-command-list |
grep -v "cmake version" |
while read c; do
    echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
2012-08-13 14:19:16 -04:00
Alex Neundorf d81d83c218 add macro check_required_components() to configure_package_config_file()
As discussed on cmake-developers, this patch adds a macro
check_required_components() to the file configured via
configure_package_config_file(), so for proper handling
of components in Config.cmake files users can simply call

check_required_components(PackageName)

and this will do the right thing.

Alex
2012-03-19 10:53:36 -04:00
Alex Neundorf 5d18223917 write_basic_package_version_file: add ExactVersion mode
This mode is for packages which consider themselves only compatible if
exactly the same version is requested. The tweak version is ignored.

Alex
2012-03-10 16:10:52 +01:00
Alex Neundorf 1c69cd8feb write_basic_package_version_file(): improve documentation
add notes when which mode should be used

Alex
2012-03-10 16:09:17 +01:00
Alex Neundorf 6973e2d5a8 wrap write_basic_config_version_file as write_basic_package_version_file()
So the name fits better with configure_package_config_file(), as
discussed on the mailing list. Adapt the documentation accordingly.

Alex
2012-03-07 11:23:18 -05:00
Alex Neundorf 204f5d443c add CMakePackageConfigHelpers: configure_package_config_file()
The function configure_package_config_file() may be used instead of
configure_file() for generating the Config.cmake files for installation,
they help to make those files relocatable.

Alex
2012-03-07 11:23:11 -05:00