summaryrefslogtreecommitdiffstats
path: root/Modules/FetchContent
Commit message (Collapse)AuthorAgeFilesLines
* FetchContent: Reject CMAKE_TOOLCHAIN_FILE env var in sub-buildCraig Scott2023-02-241-0/+6
| | | | | | | | | | The sub-build should never try to use a toolchain file. The toolchain file may itself be getting downloaded by FetchContent. If the CMAKE_TOOLCHAIN_FILE environment variable is set, CMake uses it to initialize the CMake variable of the same name. We need to explicitly clear them before the first project call of the sub-build. Fixes: #24535
* FetchContent: Only use @-@ replacements for sub-build CMakeLists.txtCraig Scott2023-02-241-6/+6
| | | | | | | 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: Ignore EXACT for redirected find_package() callsCraig Scott2022-09-111-1/+4
| | | | | | | | | | | | | 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
* Packages: Integrate FetchContent and find_package()Craig Scott2022-05-032-0/+16
| | | | | | | | Allow FetchContent_MakeAvailable() to try a call to find_package() first, or redirect a find_package() call to FetchContent_MakeAvailable(). The user can set variables to control which of these are allowed or tried by default. Fixes: #21687
* ExternalProject: Add support for USES_TERMINAL_PATCH keywordCraig Scott2022-02-031-0/+1
| | | | | | | This brings the patch step into line with all the others which already had their own `USES_TERMINAL_<step>` keyword. All steps (including patch) already have their own `LOG_<step>` keyword too, so the lack of `USES_TERMINAL_PATCH` was inconsistent.
* Revert ExternalProject and FetchContent refactoringCraig Scott2021-03-091-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | Refactoring of the ExternalProject and FetchContent modules moved the commands into CMake scripts. This broke custom commands that used shell redirection or special build tool variables of the form $(MakeVar). Undo the sequence of commits that performed this refactoring and follow-up fixes associated with it. The following commits are reverted by this change: 4f3d1abbb4 (ExternalProject: Refactor pre-configure steps to support no-target uses, 2021-02-05) 17e5516e60 (FetchContent: Invoke steps directly and avoid a separate sub-build, 2021-01-29) bd876f3849 (FetchContent: Restore patch command support, 2021-02-18) 404cddb7bb (ExternalProject: Fix misuse of IS_NEWER_THAN in timestamp checks, 2021-02-21) b0da671243 (FetchContent: Don't update timestamps if files don't change, 2021-02-18) Fixes: #21892
* FetchContent: Invoke steps directly and avoid a separate sub-buildCraig Scott2021-02-041-27/+0
| | | | | | | | | | | | The cost of setting up and executing a separate sub-build to do the download, update and patch steps required for FetchContent population can be significant with some platforms and CMake generators. Avoid the sub-build altogether by invoking the step scripts directly. Previously, if no generator was set (e.g. population was being done in script mode), a generator needed to be available on the default PATH. Since we no longer use a sub-build, this restriction is also now gone. Fixes: #21703
* FindGit: Cache the GIT_EXECUTABLE version for the current runCraig Scott2021-01-191-0/+2
| | | | | | | | | | | The git version should not change while CMake is running. When using FetchContent with many dependencies, the repeated calls to get the git version every time ExternalProject is used can be measurable on some platforms. This commit queries that version only once and then caches it in a global property for the rest of that run. The git version can still safely change between runs because it is not cached, only the GIT_EXECUTABLE location is cached. Relates: #21703
* FetchContent: Remove unnecessary policy CMP0114 settingBrad King2020-10-081-1/+0
| | | | | Now that `CMAKE_VERSION` is at least 3.19, the policy will be set to NEW implicitly by the version.
* ExternalProject: Use CMP0114 NEW behavior with Xcode "new build system"Brad King2020-09-181-0/+1
| | | | | | | The ExternalProject module cannot be implemented in the Xcode "new build system" without using CMP0114's NEW behavior. When configuring for that build system, warn if the policy is not set to NEW and use NEW behavior anyway.
* FetchContent: Add support for DOWNLOAD_NO_EXTRACTCraig Scott2020-04-031-0/+2
| | | Fixes: #20526
* FetchContent: Give access to the terminal for download and updateCraig Scott2019-01-141-0/+2
| | | | | | | | | | | | | | | A main scenario where this is needed is when a git operation needs the password to a private key and asks for it on the console. Without this change, such operations can appear to hang indefinitely with no prompt if QUIET is in effect (which it is by default). Another scenario this addresses is when progress of a download or update should be shown. Without this change, all such progress is buffered with some generators and will only be shown at the end, which defeats the purpose of logging any progress to begin with. Relates: #18238
* FetchContent: New module for populating content at configure timeCraig Scott2017-10-161-0/+21