summaryrefslogtreecommitdiffstats
path: root/Modules/CMakePackageConfigHelpers.cmake
Commit message (Collapse)AuthorAgeFilesLines
* iOS: Add support for Mac CatalystRaul Metsma2024-07-031-0/+7
| | | | | Issue: #20132 Signed-off-by: Raul Metsma <raul@metsma.ee>
* CMakePackageConfigHelpers: Document PACKAGE_PREFIX_DIR for public useCraig Scott2024-04-201-0/+17
| | | | | | | | | | This variable has long been provided by `configure_package_config_file` in the `@PACKAGE_INIT@` part of the package configuration file it generates. Although not publicly documented, projects have come to use it. Now that we preserve the value across nested `find_package` calls, it has a stable meaning. Issue: #25827
* generate_apple_architecture_selection_file: Avoid early returnsCraig Scott2024-04-191-15/+27
| | | | | | | This refactoring makes the generated file follow the same structure as generate_apple_platform_selection_file(). It uses a single if-elseif-else-endif block rather than a sequence of if-endif blocks. This avoids any early return() calls, allowing cleanup code to be added at the end later.
* Help: Add missing section heading for apple architecture selectionCraig Scott2024-04-191-0/+3
|
* Help: Fix CMakePackageConfigHelpers typos, grammar and formattingCraig Scott2024-04-191-57/+56
|
* CMakePackageConfigHelpers: Restore undocumented PACKAGE_PREFIX_DIR variableBrad King2024-04-111-35/+7
| | | | | | | | | | | Revert commit 6ddf8712cd (CMakePackageConfigHelpers: Use unique variable name for pkg prefix, 2024-03-30, v3.29.1~8^2). It regressed existing projects that rely on the undocumented `PACKAGE_PREFIX_DIR` variable in package configuration files generated by `CMakePackageConfigHelpers`. Fixes: #25873 Fixes: #25885 Issue: #25827
* CMakePackageConfigHelpers: Use unique variable name for pkg prefixCraig Scott2024-03-311-7/+35
| | | | Fixes: #25827
* CMakePackageConfigHelpers: Remove unused variableCraig Scott2024-03-311-2/+0
|
* generate_apple_*_selection_file: Add option to capture errorsBrad King2024-03-191-3/+60
| | | | | | | Add an option to capture error messages in a variable instead of terminating with a fatal error. Fixes: #25778
* generate_apple_architecture_selection_file: Document $(ARCHS_STANDARD) supportBrad King2024-03-191-0/+4
| | | | | | Also add a test case. Fixes: #25780
* generate_apple_architecture_selection_file: Simplify signatureBrad King2024-03-191-15/+12
| | | | | | | Allow callers to pass multiple values to list-valued arguments instead of putting the entire list in a single quoted argument. Fixes: #25779
* CMakePackageConfigHelpers: Clarify generate_apple_*_selection_file signaturesBrad King2024-01-051-57/+57
| | | | | | | | | | | | | | | | | | | The helpers added by: * commit 37bc3400cd (CMakePackageConfigHelpers: Add generate_apple_platform_selection_file(), 2023-11-03) * commit 4ac5a2f866 (CMakePackageConfigHelpers: Add generate_apple_architecture_selection_file(), 2023-12-19) were worded in terms of including package configuration files, but the actual functionality is to include files *from* package configuration files. The included files do not themselves need to be usable as package configuration files. Rename the options and clarify the documentation accordingly. Issue: #25262 Issue: #25516
* CMakePackageConfigHelpers: Add generate_apple_architecture_selection_file()Brad King2023-12-191-0/+127
| | | | | | | Add a helper to select architecture-specific implementations of a package on an Apple-specific platform. Fixes: #25516
* CMakePackageConfigHelpers: Remove outdated documentation summary paragraphBrad King2023-12-191-3/+0
|
* generate_apple_platform_selection_file: Add INSTALL_PREFIX optionBrad King2023-12-191-1/+17
| | | | This is necessary to forward to `configure_package_config_file`.
* Merge topic 'package-dispatch-apple'Brad King2023-12-191-1/+5
|\ | | | | | | | | | | | | | | dc5098429b CMakePackageConfigHelpers: Clarify Apple platform selection usage error 3b9586671c CMakePackageConfigHelpers: Clarify Apple platform selection template name Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9087
| * CMakePackageConfigHelpers: Clarify Apple platform selection usage errorBrad King2023-12-181-0/+4
| | | | | | | | `generate_apple_platform_selection_file` requires `INSTALL_DESTINATION`.
| * CMakePackageConfigHelpers: Clarify Apple platform selection template nameBrad King2023-12-181-1/+1
| | | | | | | | | | | | The template added by commit 37bc3400cd (CMakePackageConfigHelpers: Add generate_apple_platform_selection_file(), 2023-11-03) is specific to Apple platforms. Give it an Apple-specific name.
* | CMakePackageConfigHelpers: Fix generate_apple_platform_selection_file docsBrad King2023-12-181-43/+45
|/ | | | Previously the documentation was not rendered correctly.
* CMakePackageConfigHelpers: Move platform selection template to Internal/Brad King2023-12-071-1/+1
| | | | | | The template added by commit 37bc3400cd (CMakePackageConfigHelpers: Add generate_apple_platform_selection_file(), 2023-11-03) is a private implementation detail. Move it to `Modules/Internal/`.
* CMakePackageConfigHelpers: Add generate_apple_platform_selection_file()Kyle Edwards2023-11-151-0/+104
| | | | Issue: #25262
* codespell: Fix typosBrad King2023-05-221-1/+1
|
* 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-141-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-12-011-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-271-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.