diff options
author | Brad King <brad.king@kitware.com> | 2022-09-12 13:37:59 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-09-12 13:38:07 (GMT) |
commit | 64f4bb57288c334acd1f1b1393e47945e38b3758 (patch) | |
tree | 94cd0218640c6c3688375e3449845fe86276477f /Modules/FetchContent.cmake | |
parent | 0f8838c8d3a7a69049634d99ad41bcc4e0a7a05a (diff) | |
parent | 48b380c9613318b888473aa6f178d06de3f21e7e (diff) | |
download | CMake-64f4bb57288c334acd1f1b1393e47945e38b3758.zip CMake-64f4bb57288c334acd1f1b1393e47945e38b3758.tar.gz CMake-64f4bb57288c334acd1f1b1393e47945e38b3758.tar.bz2 |
Merge topic 'fetchcontent-redirect-version-exact'
48b380c961 FetchContent: Ignore EXACT for redirected find_package() calls
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7665
Diffstat (limited to 'Modules/FetchContent.cmake')
-rw-r--r-- | Modules/FetchContent.cmake | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Modules/FetchContent.cmake b/Modules/FetchContent.cmake index e6fe15f..7e69dfe 100644 --- a/Modules/FetchContent.cmake +++ b/Modules/FetchContent.cmake @@ -303,13 +303,16 @@ Commands ``<lowercaseName>-extra.cmake`` or ``<name>Extra.cmake`` file with the ``OPTIONAL`` flag (so the files can be missing and won't generate a warning). Similarly, if no config version file exists, a very simple - one will be written which sets ``PACKAGE_VERSION_COMPATIBLE`` to true. + one will be written which sets ``PACKAGE_VERSION_COMPATIBLE`` and + ``PACKAGE_VERSION_EXACT`` to true. This ensures all future calls to + :command:`find_package()` for the dependency will use the redirected + config file, regardless of any version requirements. CMake cannot automatically determine an arbitrary dependency's version, - so it cannot set ``PACKAGE_VERSION`` or ``PACKAGE_VERSION_EXACT``. + so it cannot set ``PACKAGE_VERSION``. When a dependency is pulled in via :command:`add_subdirectory` in the next step, it may choose to overwrite the generated config version file in :variable:`CMAKE_FIND_PACKAGE_REDIRECTS_DIR` with one that also sets - ``PACKAGE_VERSION``, and if appropriate, ``PACKAGE_VERSION_EXACT``. + ``PACKAGE_VERSION``. The dependency may also write a ``<lowercaseName>-extra.cmake`` or ``<name>Extra.cmake`` file to perform custom processing or define any variables that their normal (installed) package config file would |