summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/FetchContent
Commit message (Collapse)AuthorAgeFilesLines
* Tests/RunCMake: Update cmake_minimum_required versions to 3.10Brad King2024-10-031-1/+1
| | | | | For policy-specific tests, use the version before the policy was introduced. Otherwise, use 3.10 where possible.
* FetchContent: Force cmake --fresh to re-execute direct population stepsCraig Scott2024-06-071-0/+8
| | | | Issue: #25468
* Tests: RunCMake.FetchContent should not always force _deps removalCraig Scott2024-06-071-3/+0
| | | | | | | | | | | To properly test some functionality, tests may rely on not clearing things like time stamps between cmake invocations. The RunCMake infrastructure clears the build directory by default anyway, and tests may individually ask for that to be disabled where needed. The line being removed here was originally added to assist with manually re-running individual tests locally outside the control of RunCMake. That is no longer appropriate.
* Tests: Fix -direct variants of FetchContent tests using wrong filesCraig Scott2024-06-072-8/+6
| | | | | | | | | | The -direct variants of the RunCMake.FetchContent tests were meant to be using the same result, stdout and stderr files as the non-direct tests. The -direct tests were specified in the wrong way for that and ended up using no files at all, so they weren't testing the full set of expected conditions. Use the test variant feature provided by the RunCMake infrastructure instead, which is the proper way to handle this sort of scenario.
* ExternalProject,FetchContent: Avoid CMAKE_DISABLE_SOURCE_CHANGES errorCraig Scott2024-05-312-0/+20
| | | | | | | | | | | | The file(MAKE_DIRECTORY) implementation checks whether a path is allowed to be written to before it checks if it already exists. For the scenario where a SOURCE_DIR is an existing directory within the main project's source directory, this triggers a fatal error if CMAKE_DISABLE_SOURCE_CHANGES is set to true for ExternalProject, and some FetchContent scenarios. Therefore, add an explicit check for existence first to avoid making such error-triggering calls. Fixes: #21872
* FetchContent: Deprecate FetchContent_Populate(depName)Craig Scott2024-05-2913-0/+26
| | | | | Projects should use FetchContent_MakeAvailable(depName) instead. Policy CMP0169 provides backward compatibility.
* FetchContent: Make FetchContent_Populate() honor CMP0168Craig Scott2024-05-251-0/+16
|
* FetchContent: Populate directly without a sub-buildCraig Scott2024-05-1712-43/+94
| | | | Fixes: #21703
* ExternalProject: Add TLS version options for https connectionsBrad King2024-02-291-0/+5
| | | | | | | Add a `TLS_VERSION` option and honor `CMAKE_TLS_VERSION` variables. Also map the version to Git options as we already do for `TLS_VERIFY`. Issue: #25701
* FetchContent: Set CMAKE_EXPORT_FIND_PACKAGE_NAMEKyle Edwards2023-11-136-0/+110
|
* FetchContent: Add support for EXCLUDE_FROM_ALLSteven Stallion2023-09-254-0/+25
| | | | Fixes: #20167
* FetchContent: Reject CMAKE_TOOLCHAIN_FILE env var in sub-buildCraig Scott2023-02-242-0/+3
| | | | | | | | | | 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
* Merge topic 'add_subdirectory_system'Brad King2022-09-2717-0/+72
|\ | | | | | | | | | | | | 2eb30a7036 add_subdirectory: Add SYSTEM option Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7399
| * add_subdirectory: Add SYSTEM optionDa Quexian2022-09-2617-0/+72
| | | | | | | | | | Fixes: #22401 Signed-off-by: Da Quexian <daquexian566@gmail.com>
* | FetchContent: Disable header set verification for dependenciesCraig Scott2022-08-035-0/+31
|/ | | | | | | | | | | | | | | | 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: Pass through networking-related CMAKE_... variablesCraig Scott2021-10-052-0/+39
| | | | | | | CMAKE_TLS_VERIFY, CMAKE_TLS_CAINFO, CMAKE_NETRC and CMAKE_NETRC_FILE are now passed through to the underlying ExternalProject sub-build. Previously, they were silently ignored. Fixes: #22144
* Revert ExternalProject and FetchContent refactoringCraig Scott2021-03-098-110/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | 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: Don't update timestamps if files don't changeCraig Scott2021-02-225-0/+85
| | | | | | | | | | | | | | | | | | | | The refactoring in 17e5516e60 (FetchContent: Invoke steps directly and avoid a separate sub-build, 2021-01-29) uses a different way of writing out the step scripts and updating time stamps when steps are executed. That inadvertently always wrote out the scripts for custom commands, even when the contents didn't change. This caused their timestamp to always be updated, resulting in those steps always being seen as out-of-date and needing to be re-executed. The way timestamps were checked to determine whether to re-execute a step also did not adequately account for file systems which only have second-resolution timestamps. The IS_NEWER_THAN if condition also returns true when timestamps are the same, so one needs to use the negative form to get a true "is newer than" test. ExternalProject is not susceptible to this problem because it uses file(GENERATE) to write out the script files and that only updates the file's timestamp if the contents change. It also mostly leaves timestamp checking to the build tool.
* FetchContent: Restore patch command supportCraig Scott2021-02-173-0/+25
| | | | | | The refactoring in 17e5516e60 (FetchContent: Invoke steps directly and avoid a separate sub-build, 2021-01-29) contained a typo which resulted in any PATCH_COMMAND being ignored. Fix the typo and add a test case that would have caught the regression.
* FetchContent: Invoke steps directly and avoid a separate sub-buildCraig Scott2021-02-042-18/+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
* FetchContent: Relative SOURCE_DIR override cannot be a hard errorCraig Scott2020-12-223-0/+9
| | | Fixes: #21624
* FetchContent: Raise error if manually given source dir does not existCraig Scott2020-10-035-0/+26
| | | Fixes: #21208
* FetchContent: Fix SOURCE_DIR, BUILD_DIR when disconnected or overriddenCraig Scott2020-08-233-3/+55
| | | Fixes: #21123
* FetchContent: Preserve empty string argumentsCraig Scott2020-05-234-0/+26
| | | | Fixes: #20579
* FetchContent: Add support for SOURCE_SUBDIRCraig Scott2020-05-163-2/+17
| | | Fixes: #19875
* FetchContent: Add support for DOWNLOAD_NO_EXTRACTCraig Scott2020-04-033-0/+11
| | | Fixes: #20526
* FetchContent: Add new command FetchContent_MakeAvailable()Craig Scott2019-01-2610-0/+52
| | | Relates: #18754
* FetchContent: Give access to the terminal for download and updateCraig Scott2019-01-144-0/+24
| | | | | | | | | | | | | | | 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: Add testsCraig Scott2017-10-1617-0/+317