summaryrefslogtreecommitdiff
path: root/Modules/CMakePackageConfigHelpers.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Help: Modernize PackageConfigHelpers exampleFeRD (Frank Dana)2023-01-231-5/+7
| | | | | | | | | | | | | | | | The example shown in the module documentation for CMakePackageConfigHelpers was showing its age, by: 1. Hardcoding directory prefixes (`etc/`, `lib/`, etc.) instead of using GNUInstallDirs 2. Handwaving `set()` commands (incorrectly!) as: `set(VAR dir/ ... CACHE )` which should, at the very least, be: `set(VAR dir/ CACHE ... )` 3. Installing CMake configuration files to `lib/Foo/cmake/`, when current practice favors `${CMAKE_INSTALL_LIBDIR}/cmake/Foo/` This updated example addresses all of those issues.
* CMakePackageConfigHelpers: Fix note about version files supporting rangesfriendlyanon2022-05-111-3/+3
| | | | | | | | In commit 55c3b6a77e (CMakePackageConfigHelpers: Relax restrictions on version range, 2019-05-30, v3.20.0-rc1~295^2~1) the documentation for write_basic_package_version_file documented the support of version ranges by the generated version files, however the note wrongly specifies a COMPATIBILITY_MODE argument, instead of COMPATIBILITY.
* Modules: Fix typos and spelling in documentationJosef Angstenberger2021-05-071-2/+2
|
* CMakePackageConfigHelpers: Relax restrictions on version rangeMarc Chevrier2020-12-151-3/+4
|
* Help: Add `.. versionadded` directives to module docsNikita Nemkin2020-12-021-20/+26
| | | | Issue: #19715
* Help: Cleanup typos and grammar for the 3.19 releaseCraig Scott2020-10-241-2/+2
|
* CMakePackageConfigHelpers: Add version range supportMarc Chevrier2020-09-231-0/+5
|
* CMakePackageConfigHelpers: Add ARCH_INDEPENDENT optionJustin Bassett2018-11-301-1/+14
| | | | | | | Allow skipping the architecture check in the package version file generated from calling write_basic_package_version_file. Document said architecture check. Fixes: #16184
* Help: Convert remaining modules to block-style commentsKitware Robot2018-10-221-203/+204
|
* doc: Consistently use <PackageName> for describing the name of a packageJean-Christophe Fillion-Robin2018-08-141-6/+6
|
* Help: Package without components should use 'check_required_components' tooRuslan Baratov2018-06-071-7/+9
| | | | | | | | | Macro 'check_required_components' should be called even if there are no components provided by package. This will make sure error is reported in next cases: find_package(Foo CONFIG REQUIRED oops) # 'oops' treated as component find_package(Foo CONFIG REQUIRED COMPONENTS foo) # no components expected
* WriteBasicConfigVersionFile: Add SameMinorVersion COMPATIBILITY optionDaniele E. Domenichelli2017-11-211-5/+7
|
* Fix trivial typos in textluzpaz2017-11-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Some are user facing. Found using codespell -q 3 --skip="./Utilities" -I .cmake-whitelist.txt` whereby the whitelist contained: ans dum helpfull emmited emmitted buil iff isnt nto ot pathes substract te todays upto whitespaces
* Help: Fix cmake code block warnings produced by Sphinx 1.4Brad King2017-02-101-3/+3
| | | | | | | Some of our "cmake" code blocks do not use fully valid CMake syntax because they have placeholders for human reference. Sphinx has never been able to properly lex and highlight these, but now warns. Fix each block's syntax or change to a non-cmake block as appropriate.
* Don't include CMakeParseArgumentsDaniel Pfeifer2017-01-111-3/+0
| | | | | | | | | | | | The cmake_parse_arguments command is builtin with version 3.5. The CMakeParseArguments module is empty and exists for backwards compatibility with CMake 3.4 and lower. Remove the includes of CMakeParseArguments from CMake's modules. The modules are always used with the current version of CMake. Leave the includes in the tests, as the tests may be run with an older version of CMake.
* Simplify CMake per-source license noticesBrad King2016-09-271-13/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* Use string(APPEND) in ModulesDaniel Pfeifer2016-07-281-4/+4
| | | | | | | Automate with: find Modules -type f -print0 | xargs -0 perl -i -0pe \ 's/set\(([a-zA-Z0-9_]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'
* CMakePackageConfigHelpers: allow to specify a relative CMAKE_INSTALL_PREFIXSergiu Deitsch2016-03-221-1/+3
|
* Modules: Format documentation to avoid over-long preformatted linesBrad King2014-10-221-23/+27
| | | | | | Convert several preformatted code block literals that enumerate lists of options or variables to use reST definition lists instead. Manually wrap other long lines in code blocks.
* CMakePackageConfigHelpers: Add INSTALL_PREFIX optionDaniele E. Domenichelli2014-08-111-10/+28
| | | | | | | | | | | | | | | | | This option instructs configure_package_config_file to consider paths that are not absolute as relative to the INSTALL_PREFIX directory instead of relative to the CMAKE_INSTALL_PREFIX directory. If this argument is not passed, the default behaviour is to use the CMAKE_INSTALL_PREFIX variable. The new signature is therefore: configure_package_config_file(<input> <output> INSTALL_DESTINATION <path> [PATH_VARS <var1> <var2> ... <varN>] [NO_SET_AND_CHECK_MACRO] [NO_CHECK_REQUIRED_COMPONENTS_MACRO] [INSTALL_PREFIX <path>])
* CMakePackageConfigHelpers: restructure documentation and document commandsDaniele E. Domenichelli2014-08-111-120/+125
|
* CMakePackageConfigHelpers: Remove unused variableDaniele E. Domenichelli2014-08-041-2/+0
|
* write_basic_package_version_file: use PROJECT_VERSIONAlex Neundorf2014-01-291-1/+4
| | | | | | | In the write_basic_package_version_file(), the VERSION argument is now optional. If none is given, it falls back to ${PROJECT_VERSION}. Alex
* Don't copy find_dependency in configure_package_config_file.Stephen Kelly2013-12-241-9/+2
| | | | | | | There is not really any need to. Downstreams can either rely on it being provided by CMake, or copy and distribute it. Change the documented include for the find_dependency macro.
* Split the find_dependency macro into a separate file.Stephen Kelly2013-12-131-31/+4
| | | | | This allows Config file authors to use it without having to use CONFIGURE_PACKAGE_CONFIG_FILE.
* Convert builtin help to reStructuredText source filesKitware Robot2013-10-151-117/+165
| | | | | | | | Run the convert-help.bash script to convert documentation: ./convert-help.bash "/path/to/CMake-build/bin" Then remove it.
* CMakePackageConfigHelpers: Add a find_dependency macroStephen Kelly2013-08-301-2/+37
| | | | | | This macro handles the EXACT, REQUIRED and QUIET options and sets an appropriate NOT_FOUND_MESSAGE for the package if a dependency is not found.
* Handle usr-move without forcing absolute paths (#14041)Brad King2013-04-031-21/+19
| | | | | | | | | | | | | | | | | | | | | | In commit 0c727b90 (install(EXPORT): Force absolute paths for usr-move, 2013-03-08) and commit d4774140 (configure_package_config_file: force absolute paths for usr-move, 2013-01-24) we supported Linux distributions implementing the "/usr move" by assuming that installation to (/usr)?/lib(64)? represents a non-relocatable system package. When cross-compiling one may prepare a package for installation into a system location on a target machine but install the package files on the *host* machine inside another path for use with CMAKE_FIND_ROOT_PATH. In this case the package development files must still be relocatable. Handle "/usr move" with a new approach that works with relocatable files. Teach configure_package_config_file and install(EXPORT) to generate special logic in a package configuration file or targets file for installation under (/usr)?/lib(64)?. Teach the file to recognize when it is loaded through a symlink that refers to the same realpath as its original install destination. In such a case, use the original install prefix. Otherwise, compute the prefix relative to the current file location to make it relocatable.
* configure_package_config_file(): extend documentationAlex Neundorf2013-01-241-0/+2
| | | | Alex
* configure_package_config_file(): fix indentationAlex Neundorf2013-01-241-6/+6
| | | | | | This is a separate commit, so that the previous commit is smaller. Alex
* configure_package_config_file: force absolute paths for usr-moveAlex Neundorf2013-01-241-0/+16
| | | | | | | | | | | | The configure_package_config()_file() macro will now use absolute paths for the PATH_VARS if the Config.cmake file will be installed into /lib(64) or /usr/lib(64), since due to the usr-move filesystem changes Config.cmake files installed there may be found via two paths (once per symlink via /lib(64) and once via /usr/lib ), and in this case relative paths break. Alex
* CONFIGURE_PACKAGE_CONFIG_FILE(): improve generated commentsAlex Neundorf2012-12-061-0/+5
| | | | | | | | | 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
* Remove CMake-language block-end command argumentsKitware Robot2012-08-131-1/+1
| | | | | | | | | | | | | | | | | 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
* Convert CMake-language commands to lower caseKitware Robot2012-08-131-5/+5
| | | | | | | | | | | | | | | | | 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
* add macro check_required_components() to configure_package_config_file()Alex Neundorf2012-03-191-4/+34
| | | | | | | | | | | | | 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
* write_basic_package_version_file: add ExactVersion modeAlex Neundorf2012-03-101-1/+5
| | | | | | | This mode is for packages which consider themselves only compatible if exactly the same version is requested. The tweak version is ignored. Alex
* write_basic_package_version_file(): improve documentationAlex Neundorf2012-03-101-0/+4
| | | | | | add notes when which mode should be used Alex
* wrap write_basic_config_version_file as write_basic_package_version_file()Alex Neundorf2012-03-071-3/+38
| | | | | | | So the name fits better with configure_package_config_file(), as discussed on the mailing list. Adapt the documentation accordingly. Alex
* add CMakePackageConfigHelpers: configure_package_config_file()Alex Neundorf2012-03-071-0/+154
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