In commit 5bc6230741 (ExternalProject: Option to turn off recursive
update of git submodules, 2019-10-16) we implemented the feature in the
clone script written by `_ep_write_gitclone_script` but not in the
update script written by `_ep_write_gitupdate_script`. Implement the
latter by factoring out a common helper to use in both places.
Fixes: #20335
The clone step checks out the cloned branch but is always followed by an
explicit checkout of the desired `GIT_TAG`. Tell `git clone` not to
check out.
-- When using default values for the external project forward GHS platform
variables so that the external project builds with the same tools as
the original project.
-- Fix issue with bad top level project when GHS_PRIMARY_TARGET is set but has
no value. In this case treat it as unset and use default value.
When GIT_SHALLOW is used, the '--depth 1 --no-single-branch'
arguments are add. It means that only branch names and tags
is downloaded to repository. Most Commit Hash is not working.
With this commit the documentation was updated, to describe
the limitation of GIT_SHALLOW.
Since commit 79410eeb1f (ExternalProject: Initialize Git submodules
recursively and on update (#16083), 2016-04-26, v3.6.0-rc1~105^2) our
`git submodule update` step uses the `--init` flag. This makes the
prior `git submodule init` unnecessary.
In commit b6f6cac378 (ExternalProject: add LOG_DIR option that allows
overriding of log location, 2018-10-12, v3.14.0-rc1~515^2~1) the log
directory got its own option. The intention was to fall back to the
stamp directory by default. However, the implementation actually only
falls back to the same default as the stamp directory and does not
consider a custom stamp dir.
Update the default log dir computation to fall back to whatever is the
final selection for the stamp dir.
Fixes: #19000
The output is only merged for a step if it is logging to file. This
option is ignored for steps that are logging normally.
A minor grammatical error has also been fixed as part of this change.
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.
Most steps support the logging into a file but the patch command is a
notable exception. This commit adds the LOG_PATCH options that acts as
the other LOG_* options.
In some circumstances the user of ExternalProject may not desire the
split log files for stdout and stderr. In particular with a project has
many errors it can be difficult to correlate the output error with the
command that it resulted from.
This commit adds the LOG_MERGED_STDOUTERR option that when enabled
outputs into a unified <name>-<step>.log for each step. If disabled it
will default to the previous behaviour of <name>-<step>-out.log and
<name>-<step>-err.log.
In some situations it can be helpful to separate out the location of the
log files from the location of the stamp files. For instance if you have
a continuous integration that exposes the location where log files are
stored.
This commit adds an option that allows a user to override the default
behaviour of putting the log files in STAMP_DIR called LOG_DIR. The
previous behaviour of putting the log files into the STAMP_DIR applies
if LOG_DIR is not specified.
* The code snippets in the docs consist of CMake code mixed
with syntax definition punctuation like < > [ ] ... Therefore
a pure CMake lexer is inadequate. Here it is replaced by a
CMake syntax definition parser.
* Fixed syntax definition snippets in FindPkgConfig.cmake to
make best use of syntax highlighting. This source file is the
hardest to support because it contains comparison operators
<= = >=, which need special attention to avoid confusion
with the placeholder indicators <...>.
* Fixed syntax in execute_process.rst (there were unbalanced
brackets).
* Disabled syntax highlighting for long string examples in
cmake-language.7.rst.
* No highlighting of removed syntax in CMP0049
* To inspect the outcome of this patch, see e.g. the pages
* manual/cmake-buildsystem.7.html
* module/ExternalProject.html
* module/FindPkgConfig.html
which are particularly rich in complex code snippets.
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>
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`.
3c413e2a GENERATOR_IS_MULTI_CONFIG: Use for multi-config checks in Modules
c267ea1c GENERATOR_IS_MULTI_CONFIG: Use for multi-config checks in Tests
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1627
When the `CMAKE_GENERATOR` option is given to `ExternalProject_Add`,
look also for option `CMAKE_GENERATOR_INSTANCE` to pass on to cmake as a
cache definition. When no `CMAKE_GENERATOR` option is given explicitly
then use the current project's `CMAKE_GENERATOR_INSTANCE` (since we
already use its CMAKE_GENERATOR).
d45aa38a Add dev notes for topic 'curl_netrc_options'
60c272b6 ExternalProject: Add support for NETRC and NETRC_FILE suboption
754e39dd Add testcases for file(DOWNLOAD|UPLOAD) netrc options
5d67e902 file(DOWNLOAD|UPLOAD): Add 'NETRC' and 'NETRC_FILE' suboption
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ruslan Baratov <ruslan_baratov@yahoo.com>
Merge-request: !1376
The implementation of this module doesn't expect such dereferences
to happen, but can when a project sets a variable called `x`.
Set `CMP0054` explicitly to get its NEW behavior.
Fixes: #17335
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
- 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.
Fix the case when the tag name to be checked out also happens to match a
path name. Unfortunately we cannot do this for Git versions prior to
1.8.5 because they do not "do what I mean" to checkout remote branches
when the `--` argument is given.
Fixes: #16678
The change in commit v3.8.0-rc2~7^2 (ExternalProject: Run `git
checkout` with `--` to clarify arguments, 2017-02-24) broke the case of
`GIT_TAG some-remote-branch` because an explicit `--` means that the
preceding argument is a tree-ish instead of a branch. Revert the change
and leave a comment.
Fixes: #16763