summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/ExternalProject
Commit message (Collapse)AuthorAgeFilesLines
* Tests: Fix RunCMake.ExternalProject filesystem delay for Borland MakefilesBrad King2022-06-031-1/+8
| | | | | | | | | Our 1.125s delay does not seem to be long enough to be reliable with the Borland "make" tool. Use a longer delay for Borland and Watcom. Follow the pattern from commit 67040500ea (Tests: Fix RunCMake.BuildDepends filesystem delay for Borland Makefiles, 2015-09-25, v3.4.0-rc1~38^2).
* ExternalProject: Add DOWNLOAD_EXTRACT_TIMESTAMP option and policyKasper Laudrup2022-05-044-0/+4
| | | | | | | | | | Add the option to keep the current filestamps when extracting an archive in ExternalProject_Add. Enabling this option makes the behavior consistent with how ExternalProject_Add is used when checking out code from revision control instead of an archive. Fixes: #22746
* Tests: Improve RunCMake.ExternalProject rebuild case robustnessBrad King2022-02-101-2/+9
| | | | | | | The `CONFIGURE_HANDLED_BY_BUILD` case occasionally fails on builds with the `Borland Makefiles` generator due to the `make` tool's 1s file timestamp resolution. Somehow the 1.125s delay is not enough. Several other tests use a 3s delay for Borland tools for the same reason.
* Merge topic 'test-download-server-timeout'Brad King2022-02-071-1/+4
|\ | | | | | | | | | | | | 8809183d58 Tests: Optionally extend RunCMake.ExternalProject download server timeout Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6952
| * Tests: Optionally extend RunCMake.ExternalProject download server timeoutBrad King2022-02-041-1/+4
| | | | | | | | | | | | | | | | Some of the `RunCMake.ExternalProject` test cases use a download server implemented in Python. Normally we wait up to 30 seconds for it to start. However, on some machines running many tests concurrently, the download server may take longer than that to start. Add an undocumented cache entry to use on those machines to extend the timeout.
* | ExternalProject: Add support for USES_TERMINAL_PATCH keywordCraig Scott2022-02-032-9/+13
|/ | | | | | | 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.
* ExternalProject: Rerun download on SOURCE_DIR changeCraig Scott2022-02-014-5/+45
| | | Fixes: #21748
* Tests: Remove stray argument from test invocationCraig Scott2022-01-241-1/+1
| | | | | | | The run_cmake_with_options() command already sets the test command to ${CMAKE_COMMAND}. The options passed to that command shouldn't also add another ${CMAKE_COMMAND}. This removes a warning seen in the output of tests that invoke __ep_test_with_build_with_server().
* Merge topic 'codespell'Brad King2021-05-101-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fd02f10103 Xcode: Fix typos and spelling in error message 5950e54325 Source: Fix typos and spelling in comments 7072d83772 Help: Fix typos and spelling in documentation 03b1140ddc CONTRIBUTING: Fix typos and spelling 87f8843d8b FindMatlab: Fix spelling in warning and documentation 15cc39ed7f Modules: Fix typos and spelling in documentation f015c36c5a Modules: Fix typos and spelling in comments of generated code dad5b9d845 Modules: Fix typos and spelling in comments ... Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Ben Boeckel <ben.boeckel@kitware.com> Merge-request: !6099
| * Tests: Fix typos and spelling in commentsJosef Angstenberger2021-05-071-1/+1
| |
* | ExternalProject: Ensure git fetch if updating to hash we don't have yetCraig Scott2021-05-093-3/+20
|/ | | | | | | | | | | In ac6a4d4884 (ExternalProject: Improve robustness of update step, 2020-10-17), the method used to check whether we already have a commit or not was changed from using git rev-list to git rev-parse. The new logic assumed rev-parse would output nothing if given a commit hash it didn't know about, but it simply prints the hash again without raising an error in this scenario. Amend that logic by adding ^{commit} to the ref to ensure we do get an error if that ref is not currently known. Fixes: #22166
* Revert ExternalProject and FetchContent refactoringCraig Scott2021-03-096-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Tests: Fix ExternalProject CONFIGURE_HANDLED_BY_BUILD on 1s filesystemsDaan De Meyer2021-02-221-2/+2
| | | | | | | | | Following commit 7155e358c9 (ExternalProject: Add CONFIGURE_HANDLED_BY_BUILD option, 2020-12-16, v3.20.0-rc1~168^2), modify the CONFIGURE_HANDLED_BY_BUILD test to sleep 1.125 seconds to make sure the file timestamp is always updated regardless of the resolution of the underlying filesystem. Fixes: #21830
* ExternalProject: Refactor pre-configure steps to support no-target usesCraig Scott2021-02-046-7/+7
| | | | | | | | | | | | | | | | | | | | | | The mkdir, download, update and patch steps are used by FetchContent during the configure phase of the main build. Because these steps need a target, this has so far required a sub-build to be set up. The changes here factor out the preparation of the scripts from the creation of the targets, allowing future work to leverage these steps without a sub-build (see #21703). As part of the refactoring, some rationalisation of the stamp files, repository info files and script names was done to make things more consistent between download methods and step implementations. Every download method now records its own specific repository info in a file and that file is a dependency of the download step. The source directory is also written to that file, so if the SOURCE_DIR changes, the download will be retriggered (the existing implementation fails in this scenario). Each download method now also has just one driver script that implements the whole step (it may pull in other scripts to do its task though). The patch step gained support for USES_TERMINAL as a result of generalising the implementation for custom commands. Fixes: #21748
* ExternalProject: Avoid scanning docs for keywords, use include_guard()Craig Scott2021-01-297-43/+0
| | | | | | | | | | | | | | | | | | | | | | The previous implementation was scanning the documentation in the file at runtime to determine the set of supported keywords for each public function. This was fragile, made it difficult to restructure the documentation and was sometimes observable in runtime performance measurements. Change to a more conventional approach where supported keywords are explicitly listed in the code. The internal _ExternalProject_SELF variable is no longer needed. CMake now provides CMAKE_CURRENT_FUNCTION_LIST_DIR which can be used for the same purpose and avoids having to set a variable when the module is read. This also removes the requirement that the module must be included by the current or a parent scope. It is now enough that the module has been included once somewhere before calling any of its functions. The above changes combined mean that the module can now use include_guard() and avoid having to re-parse the very long file every time.
* ExternalProject: Improve robustness of update stepCraig Scott2021-01-283-0/+91
| | | | | | | | | | | | | | | | | | Refactor the update logic to make it easier to follow. The following fixes/improvements are some consequences of this change: * Absorb a confusing git checkout failure message when the failure is allowed and we act on that failure appropriately. * Fix an unnecessary fetch in some scenarios when checking out a git hash we already have locally. * Stash and restore any local changes even when not rebasing. * Avoid unsafe rebasing where we are not on a branch that is already tracking the requested branch. * When fetching, use --tags --force to ensure we get all the tags and commits leading up to them regardless of whether the tags are on branches or not. Also update our local tags if they move on the remote. Fixes: #20677
* ExternalProject: Add CONFIGURE_HANDLED_BY_BUILD optionDaan De Meyer2021-01-123-0/+77
| | | | Fixes #21592.
* Tests: Fix policy version in RunCMake.ExternalProject testBrad King2020-10-081-1/+1
| | | | | Now that we have policies that need to be tested, this test cannot just use CMAKE_VERSION for the policy level.
* ExternalProject: Use CMP0114 NEW behavior with Xcode "new build system"Brad King2020-09-186-5/+36
| | | | | | | 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.
* Tests: Remove RunCMake.ExternalProject unnecessary CMake version checkBrad King2020-09-151-2/+0
|
* Tests: Simplify RunCMake.ExternalProject Add_StepDependencies stderrBrad King2020-09-154-24/+2
| | | | | Set CMP0114 to OLD for this case to suppress the policy warning. The warning is covered by the `NO_DEPENDS-CMP0114-WARN` case.
* ExternalProject: Add policy CMP0114 to refine step target dependenciesBrad King2020-09-1431-6/+325
| | | | | | | | | | | | | | | | | | | | | | | | `ExternalProject_Add_StepTargets` and `INDEPENDENT_STEP_TARGETS` have some limitations and lack some sanity checks. They can cause confusing build systems to be generated. The basic problems are: * The notion of step independence is attached to the step target rather than the step itself. * The custom commands implementing the steps are duplicated in the step targets and the primary targets. This can cause races. It is also incompatible with the Xcode "new build system". Fix this by introducing policy CMP0114 to change the way step target dependencies are handled. Define independence from external dependencies as a property of each individual step regardless of whether there is a target for it. Add dependencies among the primary target and the step targets such that each custom command only appears in one target. When some steps are disconnected from the primary target, add step targets for the steps commonly depended upon so that there is a place to hold their custom commands uniquely. Fixes: #18663
* Tests: Match RunCMake.ExternalProject NO_DEPENDS output more strictlyBrad King2020-09-101-18/+38
|
* ExternalProject: Factor out an internal helper to add a step targetBrad King2020-09-101-3/+4
|
* Improve the stability of the ExternalProject download testsThomas Bernard2020-09-021-1/+5
|
* Tests: Remove workaround from RunCMake.ExternalProject MultiCommand caseBrad King2020-09-011-4/+0
| | | | | | Since commit 7249ba9677 (ExternalProject: Enforce that patch depends on update, 2020-04-03, v3.18.0-rc1~403^2) we do not need the workaround in the MultiCommand case.
* Tests: Add timeout on the RunCMake.ExternalProject download serverThomas Bernard2020-08-271-5/+12
| | | | Fixes: #21132
* ExternalProject: add INACTIVITY_TIMEOUT argumentThomas Bernard2020-08-186-0/+106
| | | | | | | In order to abort transfers on slow connections the ExternalProject command support passing the INACTIVITY_TIMEOUT argument. Fixes: #20992
* ExternalProject: retry download on recoverable errorsThomas Bernard2020-08-114-0/+8
| | | | | | In order to shorten the download failure of ExternalProject download steps, a download retry is only done when a recoverable network error is encountered.
* ExternalProject: Preserve empty string argumentsCraig Scott2020-05-235-3/+46
|
* ExternalProject: Fix step dependency on mkdir stepVyacheslav Yurkov2020-04-201-1/+1
| | | | | | | | When looking at `list(FIND)` result, zero index is ignored due to incorrect error handling, and users can't set dependencies on mkdir step. Fixes: #20605
* ExternalProject: add LOG_OUTPUT_ON_FAILURE optionWouter Klouwen2018-12-209-0/+67
| | | | | | | | This option only has an effect if at least one of the other LOG_<step> options is enabled. If an error occurs for a step which has logging to file enabled, that step's output will be printed to the console. For cases where a large amount of output is recorded, just the end of that output may be printed to the console.
* ExternalProject: Report error if local variables are not definedJean-Christophe Fillion-Robin2018-09-067-0/+43
| | | | | | | | | | | | | Since in some situations, ExternalProject module may be included in a sub-directory, functions will be available in the global scope but local variables like "_ep_keywords_<keyword>" will not be defined, this commit checks and reports an error indicating that the ExternalProject module must be explicitly included before using any of the ExternalProject_* functions that require the module's inclusion within the current scope or above. Co-authored-by: Pablo Hernandez <pablo.hernandez@kitware.com> Co-authored-by: Craig Scott <craig.scott@crascit.com>
* ExternalProject: Fix cache generation when args end with "-NOTFOUND"Jean-Christophe Fillion-Robin2018-06-044-2/+22
| | | | | | | | | | | Generalize the fix in commit v3.11.0-rc4~8^2 (ExternalProject: Fix cache generation when last args ends with "-NOTFOUND", 2018-03-10) to work for any argument rather than just the last one. ExternalProject can now successfully generate the cache file when any (not only the last one) cache variable associated with either `CMAKE_CACHE_ARGS` or `CMAKE_DEFAULT_CACHE_ARGS` configure step option is set to a `<value>` ending with `-NOTFOUND`.
* ExternalProject: Fix cache generation when last args ends with "-NOTFOUND"Jean-Christophe Fillion-Robin2018-03-124-2/+22
|
* GENERATOR_IS_MULTI_CONFIG: Use for multi-config checks in TestsCraig Scott2017-12-294-4/+8
|
* ExternalProject: Support substituting <DOWNLOAD_DIR>Craig Scott2017-12-063-7/+60
|
* ExternalProject: Prevent COMMAND from being treated as a true keywordCraig Scott2017-09-023-0/+55
| | | | | | | | | | | | | | | The known keywords for each function are obtained by scraping the documentation for lines matching a particular regular expression. In commit 8842a027 (ExternalProject: Improve documentation, 2017-07-09), the docs were overhauled and the COMMAND docs subsequently matched the regular expression when they shouldn't have. This made COMMAND appear as a true keyword, which thwarted the special handling logic elsewhere for the intended use of COMMAND arguments. This commit contains a workaround for issue #17229 to force a dependency of the patch step on the update step to ensure a predictable step order. Fixes: #17198
* ExternalProject: Improve documentationCraig Scott2017-07-173-6/+6
| | | | | | | | | | | - Added clearer structure by grouping the options into logical sections. - Expanded the details for many of the options. - Added Examples section to show how to use the various commands. - Specifically highlighted that the contents of SOURCE_DIR may be lost if a download method is also provided. - Updated argument-matching regex to be more robust and account for the varying leading spaces before keywords in the docs. - Updated tests to account for slightly changed error messages.
* ExternalProject: Fix regression in passing list to CMAKE_CACHE_ARGSMax Smolens2016-10-104-2/+24
| | | | | | | | | | Fix passing a list to the CMAKE_CACHE_ARGS and CMAKE_CACHE_DEFAULT_ARGS options of ExternalProject_Add. Following commit v3.7.0-rc1~273^2~1 (prefer list(APPEND) over string(APPEND) where appropriate, 2016-08-08), the semicolon list separator after the first list element was missing in the generated cache.
* ExternalProject: Added new USES_TERMINAL optionsJames Johnston2015-07-063-0/+143
| | | | | | | | | | | | | | | | | | Added new USES_TERMINAL option to the ExternalProject_Add_Step function. This option passes USES_TERMINAL to the underlying add_custom_command call so that the Ninja console pool is used. Also, corresponding new USES_TERMINAL_<step> options were added to the ExternalProject_Add function. Justification: if using Ninja with a CMake superbuild, it's often desirable to limit the superbuild to ONE sub-Ninja process at a time to avoid oversubscribing the CPU. Using the console pool also makes it easy to monitor the progress of the sub-Ninja process. Independent USES_TERMINAL_<step> arguments are passed to ExternalProject_Add instead of one USES_TERMINAL argument that controls everything. Users may wish to run some steps in parallel but not others (e.g. parallelize configure but not build).
* ExternalProject: Improve error when SOURCE_DIR is missing (#15560)Brad King2015-05-0810-0/+69
| | | | | Mention the SOURCE_DIR that we checked and found empty or missing so that the user can see the full path to what we expected to find.
* ExternalProject: Allow dependencies on INTERFACE librariesBrad King2015-04-227-0/+29
| | | | | Respect INTERFACE library property whitelist. Check that a target has type "UTILITY" before querying other properties.
* ExternalProject: Allow generator expressions in initial cache optionsAndrey Pokrovskiy2015-04-216-7/+16
| | | | | | Use file(GENERATE) to write the initial cache file so that we can evaluate generator expressions. Use a per-config initial cache file name in case the content varies by configuration.
* Tests: Delay RunCMake.ExternalProject case checksBrad King2015-04-206-58/+63
| | | | | Use RunCMake "-check.cmake" scripts to check the generated initial cache file content so that the full generation process is completed.
* ExternalProject: Add unit testsDaniele E. Domenichelli2014-11-035-0/+87
|
* ExternalProject: Add unit tests for CMAKE_CACHE_DEFAULT_ARGSDaniele E. Domenichelli2014-10-315-0/+79