summaryrefslogtreecommitdiffstats
path: root/Modules/FetchContent.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'fc-provider-find-package-args'Craig Scott2023-12-171-2/+2
|\ | | | | | | | | | | | | 0415304970 FetchContent: Fix FIND_PACKAGE_ARGS not being passed to dep providers Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9080
| * FetchContent: Fix FIND_PACKAGE_ARGS not being passed to dep providersCraig Scott2023-12-161-2/+2
| | | | | | | | Fixes: #25504
* | Help: Add note not to use FETCHCONTENT_FULLY_DISCONNECTED on first runCraig Scott2023-12-161-0/+11
|/ | | | Fixes: #25481
* Merge topic 'doc-fetchcontent-bad-ref'Brad King2023-12-071-1/+1
|\ | | | | | | | | | | | | bd50e8a058 Help: Fix malformed cross-reference in FetchContent docs Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9047
| * Help: Fix malformed cross-reference in FetchContent docsCraig Scott2023-12-071-1/+1
| |
* | Merge topic 'FetchContent-find_package-args'Brad King2023-11-171-2/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | 42dbdf8914 FetchContent: Fix syntax to forward FIND_PACKAGE_ARGS arguments correctly Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8967
| * | FetchContent: Fix syntax to forward FIND_PACKAGE_ARGS arguments correctlyAdam Šulc2023-11-151-2/+2
| | | | | | | | | | | | Previously we incorrectly mixed list operations with string operations.
* | | Merge topic 'doc-find_package-advice'Brad King2023-11-151-0/+6
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | d007d304ff Help: FetchContent FIND_PACKAGE_ARGS REQUIRED usually inappropriate 6341267780 Help: Note ways CMAKE_..._FIND_PACKAGE_... vars can break projects Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8951
| * | | Help: FetchContent FIND_PACKAGE_ARGS REQUIRED usually inappropriateCraig Scott2023-11-071-0/+6
| |/ /
* | | FetchContent: Set CMAKE_EXPORT_FIND_PACKAGE_NAMEKyle Edwards2023-11-131-0/+23
|/ /
* | FetchContent: Pass GHS Variables to subbuildWilliam Sciaroni2023-11-041-0/+14
|/ | | | Fixes: #24244
* FetchContent: Add support for EXCLUDE_FROM_ALLSteven Stallion2023-09-251-7/+30
| | | | Fixes: #20167
* FetchContent: Protect ExternalProject keywords from unknown argumentsBrad King2023-06-291-1/+3
| | | | | | | | | | | | | | `ExternalProject_Add` treats all keyword arguments as multi-valued. FetchContent re-orders some keyword arguments w.r.t. unparsed arguments. Add an internal keyword argument to separate the keyword values from following unparsed arguments. This was exposed by commit 550f63447d (ExternalProject/FetchContent: Support relative remote URLs, 2023-04-21, v3.27.0-rc1~156^2) by adding `GIT_REPOSITORY` to the set of re-ordered keyword arguments. This caused its value to absorb following unparsed arguments. Fixes: #25029
* ExternalProject: Avoid reconfigure when updates are disconnectedCraig Scott2023-05-231-8/+15
| | | | | | | | | | | | | | | | | | | | When UPDATE_DISCONNECTED is true, create separate update_disconnected and patch_disconnected targets which have ALWAYS set to false. Make the configure step depend on patch_disconnected in this case too. This ensures the configure, build, install and test steps are not executed unnecessarily when updates are disconnected. Make the update and patch commands depend on the details of those steps. This ensures they are re-executed when any of those details change, even if updates are disconnected. Allow updates to occur even if UPDATE_DISCONNECTED is true, but don't contact the remote in that case. If asked to update to a ref that isn't known locally, that is now detected and causes a fatal error when updates are disconnected. Previously, the build would have silently and erroneously continued to use the old ref. Fixes: #16419, #19703, #21146
* ExternalProject/FetchContent: Support relative remote URLsChris Wright2023-04-261-0/+27
| | | | | | | | | Teach `ExternalProject_Add` and `FetchContent_Declare` to resolve relative remote URLs provided via `GIT_REPOSITORY`. Add policy CMP0150 to maintain compatibility. Fixes: #24211 Co-Authored-By: Craig Scott <craig.scott@crascit.com>
* Merge topic 'fetchcontent-reject-CMAKE_TOOLCHAIN_FILE-env-var'Craig Scott2023-02-251-1/+3
|\ | | | | | | | | | | | | | | | | c15674a9cb FetchContent: Reject CMAKE_TOOLCHAIN_FILE env var in sub-build 31ef93f19f FetchContent: Only use @-@ replacements for sub-build CMakeLists.txt Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !8248
| * FetchContent: Only use @-@ replacements for sub-build CMakeLists.txtCraig Scott2023-02-241-1/+3
| | | | | | | | | | | | | | There was a mix of ${} and @-@ substitutions in the CMakeLists.txt.in file. It is sometimes useful to temporarily put ${} evaluations there while working on issues, but they get replaced. Using @ONLY leaves them untouched and uses a consistent substitution method for the whole file.
* | FetchContent: Relay CMAKE_GENERATOR_INSTANCEMáté Ferenc Nagy-Egri2023-02-231-1/+3
|/ | | | | | | If set, relay `CMAKE_GENERATOR_INSTANCE`. It may affect compiler detection in the subbuild folder. Fixes: #24404
* FetchContent: Bump documented example Catch2 to v3.0.1Eisuke Kawashima2023-02-071-3/+3
| | | | | | The previous Catch2 v2.13.4 does not compile on some platforms [1]. [1] https://github.com/catchorg/Catch2/issues/2326
* Merge topic 'doc-SYSTEM'Craig Scott2022-12-191-6/+11
|\ | | | | | | | | | | | | dfab263825 Help: Clarify and update SYSTEM-related docs Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8027
| * Help: Clarify and update SYSTEM-related docsCraig Scott2022-12-171-6/+11
| |
* | Merge topic 'FetchContent-SYSTEM'Craig Scott2022-12-051-0/+3
|\ \ | |/ | | | | | | | | | | 4b85141f83 FetchContent: Don't pass SYSTEM through to sub-build Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7977
| * FetchContent: Don't pass SYSTEM through to sub-buildCraig Scott2022-12-021-0/+3
| | | | | | | | | | | | | | | | | | If we don't filter out SYSTEM from the arguments we pass through to ExternalProject_Add(), it gets appended as a list item to whatever arguments precede it because ExternalProject_Add() doesn't recognize it as a keyword. Fixes: #24201
* | Help: Use captions for code snippets in the `FetchContent` moduleAlex Turbov2022-11-071-6/+4
| | | | | | | | | | Instead of "manually" added captions use the Sphinx option of `code-block` directive.
* | Help: Use role `:program:`Alex Turbov2022-11-061-1/+1
|/ | | | | When mention execitable names use Sphinx semantic role `:program` instead of ``executable`` or **executable**.
* Merge topic 'add_subdirectory_system'Brad King2022-09-271-2/+17
|\ | | | | | | | | | | | | 2eb30a7036 add_subdirectory: Add SYSTEM option Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7399
| * add_subdirectory: Add SYSTEM optionDa Quexian2022-09-261-2/+17
| | | | | | | | | | Fixes: #22401 Signed-off-by: Da Quexian <daquexian566@gmail.com>
* | Merge topic 'fetchcontent-redirect-version-exact'Brad King2022-09-121-3/+6
|\ \ | | | | | | | | | | | | | | | | | | 48b380c961 FetchContent: Ignore EXACT for redirected find_package() calls Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7665
| * | FetchContent: Ignore EXACT for redirected find_package() callsCraig Scott2022-09-111-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When FetchContent_MakeAvailable() populates a dependency for which find_package() integration is enabled, all future calls to find_package() MUST succeed using the contents of the redirection directory. The generated config version file was not handling calls where the EXACT keyword was given, resulting in such calls rejecting the redirection directory's contents and continuing its search. It is not allowed to do that. Fix the generated file to also set PACKAGE_VERSION_EXACT to true so that calls with EXACT now accept it, as was originally intended. Fixes: #23950
* | | Merge topic 'fetchcontent-unset-wrong-nested-var'Craig Scott2022-09-111-1/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | d9a6e0ffc8 FetchContent: Fix unsetting wrong variable name after provider returns Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7663
| * | | FetchContent: Fix unsetting wrong variable name after provider returnsCraig Scott2022-09-101-1/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The unset() command was using __cmake_contentNameLower before that variable was restored from the __cmake_fcCurrentVarsStack. That means if there had been a nested call to FetchContent_MakeAvailable(), the wrong variable name would have been cleared (the nested name instead of the one from the current call). That would have left the variable set upon return, blocking the dependency provider from seeing any further calls to FetchContent_MakeAvailable() in the current variable scope or below for the current dependency.
* | | Merge topic 'fetchcontent-extra'Brad King2022-09-091-4/+4
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | 629d106c5e Help: Fix typo in FetchContent example, extras should read extra Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: hinell <al.neodim@gmail.com> Merge-request: !7657
| * | Help: Fix typo in FetchContent example, extras should read extraMathieu Malaterre2022-09-091-4/+4
| | | | | | | | | | | | | | | Amends 29e31e2825a (Packages: Integrate FetchContent and find_package(), 2022-04-28)
* | | Merge topic 'doc-fetchcontent-gtest-example'Craig Scott2022-09-051-2/+2
|\ \ \ | |/ / | | | | | | | | | | | | | | | daa2a6cda6 Help: Fix wrong casing of GTest in FetchContent integration example Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7644
| * | Help: Fix wrong casing of GTest in FetchContent integration exampleCraig Scott2022-09-041-2/+2
| | |
* | | FetchContent: Fix protobuf example to avoid CMP0077 warningHarald Fernengel2022-08-121-3/+4
|/ / | | | | | | | | | | The protobuf example would raise a "Policy CMP0077" warning and protobuf tests would still be built, e.g. setting the variable is ignored in latest CMake. Set an INTERNAL cache variable instead so that CMP0077 warnings won't be triggered.
* | FetchContent: Disable header set verification for dependenciesCraig Scott2022-08-031-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The CMAKE_VERIFY_INTERFACE_HEADER_SETS variable is intended to be under the control of the user. It doesn't discriminate between header sets defined in the main project and those defined by dependencies brought into the build directly via FetchContent. Developers will usually only be interested in verifying the main project's header sets, not those from dependencies. Make the variable effectively only enable header set verification of the main project by turning it off during FetchContent_MakeAvailable() calls. The user still has variables like CMAKE_PROJECT_INCLUDE and CMAKE_PROJECT_<projectName>_INCLUDE available to them if they want to enable verification of all or specific dependencies respectively. Fixes: #23808
* | FetchContent: Restore support for multiple URL valuesCraig Scott2022-07-291-29/+42
| | | | | | | | | | | | | | | | | | In c2044fdf3f (FetchContent: Respect the CMP0135 policy setting, 2022-06-02), the URL keyword was wrongly assumed to only have a single value. Multiple URL values are allowed if they are all non-local. Rework the logic to remove that incorrect assumption and handle both single and multi-value URL combinations. Fixes: #23792
* | FetchContent: Don't use if(... IN_LIST ...)Craig Scott2022-06-281-2/+8
|/ | | | This avoids the need for changing policy settings, which would then propagate through to projects brought into the build via FetchContent.
* FetchContent: Fix example code in documentationpigeon2022-06-211-3/+3
|
* Merge topic 'fetchcontent-global-targets' into release-3.24Brad King2022-06-111-2/+24
|\ | | | | | | | | | | | | | | | | f19b48e0b8 FetchContent: Honor CMAKE_FIND_PACKAGE_TARGETS_GLOBAL 1305bade56 Help: Add missing version directive for find_package() GLOBAL keyword Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7347
| * FetchContent: Honor CMAKE_FIND_PACKAGE_TARGETS_GLOBALCraig Scott2022-06-101-2/+24
| | | | | | Fixes: #23606
* | Help: Overhaul and expand the Using Dependencies GuideCraig Scott2022-06-091-1/+7
|/ | | | | | | | The guide previously only focused on the find_package() command, with a bias towards libraries. FetchContent was not mentioned at all. Reorganise and update the existing content. Add new sections to cover providing dependencies with FetchContent and dependency providers. Improve discoverability of the guide by mentioning it at the beginning of the find_package(), FetchContent and dependency provider docs.
* FetchContent: Respect the CMP0135 policy settingCraig Scott2022-06-021-6/+43
| | | Fixes: #23560
* Merge topic 'dependency-providers'Brad King2022-05-251-42/+197
|\ | | | | | | | | | | | | | | | | | | | | 2aa83fa15b Dependency providers: Add find_package and FetchContent support 8a28368feb FetchContent: Don't discard non-empty SOURCE_DIR and BINARY_DIR 8ce9bb8a0c FetchContent: Don't leak internal variables 74a6ddc339 cmFindPackageCommand: Handle Makefile variable definitions more robustly Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Gerhard Olsson <gerhard.nospam@gmail.com> Merge-request: !7276
| * Dependency providers: Add find_package and FetchContent supportCraig Scott2022-05-241-36/+177
| | | | | | Fixes: #22619
| * FetchContent: Don't discard non-empty SOURCE_DIR and BINARY_DIRCraig Scott2022-05-181-3/+9
| |
| * FetchContent: Don't leak internal variablesCraig Scott2022-05-181-3/+11
| |
* | FetchContent: Use Debug rather than Release for sub-buildCraig Scott2022-05-171-3/+3
|/ | | | | | | | The config used can be part of the path to the sub-build. On some platforms, there are restrictions on the length of paths or file names. Use Debug rather than Release because the former is shorter. When CMAKE_CONFIGURATION_TYPES is left at its default, this also makes the path the same as the previous default before 10865c8e5f (FetchContent: Hard-code a config for the sub-build, 2022-05-01) .
* Merge topic 'fetchcontent-subbuild-config-type'Craig Scott2022-05-161-2/+11
|\ | | | | | | | | | | | | | | 10865c8e5f FetchContent: Hard-code a config for the sub-build Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !7228