Commit Graph

218 Commits

Author SHA1 Message Date
Jean-Christophe Fillion-Robin
df1ddeec12 ExternalProject: Report error if local variables are not defined
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>
2018-09-06 23:02:24 +10:00
Brad King
21b7e14800 Merge topic 'ep-support-passing-var-ending-with-notfound'
7ad5165c67 ExternalProject: Fix cache generation when args end with "-NOTFOUND"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2127
2018-06-05 11:23:49 -04:00
Matt McCormick
470ff56e5a ExternalProject: Improve URL_HASH argument description
The previous documentation suggested

  ALGO=MD5=d7a3dc7757a35df3dbb890f7dee0976b

for example.
2018-06-04 16:17:58 -04:00
Jean-Christophe Fillion-Robin
7ad5165c67 ExternalProject: Fix cache generation when args end with "-NOTFOUND"
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`.
2018-06-04 11:37:52 -04:00
Jean-Christophe Fillion-Robin
7ad981c8f7 ExternalProject: Fix cache generation when last args ends with "-NOTFOUND" 2018-03-12 13:45:50 -04:00
Brad King
f7f34a46e6 Merge topic 'use_generator_is_multi_config'
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
2018-01-08 11:14:16 -05:00
Luz Paz
3ab7bf8285 Various typo fixes
Some are user-facing. Others are source comments.
2018-01-04 06:52:01 +11:00
Craig Scott
3c413e2a31 GENERATOR_IS_MULTI_CONFIG: Use for multi-config checks in Modules 2017-12-30 09:35:56 +11:00
Craig Scott
b8b8748977 ExternalProject: Support substituting <DOWNLOAD_DIR> 2017-12-07 07:22:02 +11:00
Brad King
6b3cd64d42 ExternalProject: Propagate the generator instance
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).
2017-10-19 10:20:11 -04:00
Brad King
358ceee5d8 Merge topic 'curl_netrc_options'
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
2017-10-19 09:27:43 -04:00
Shane Parris
60c272b69a ExternalProject: Add support for NETRC and NETRC_FILE suboption 2017-10-18 15:21:43 -04:00
Brad King
491d210898 ExternalProject: Avoid if() auto-dereferene in quoted arguments
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
2017-10-11 08:19:58 -04:00
Jean-Christophe Fillion-Robin
da4705255e ExternalProject: Refactor code introducing _ep_get_complete_stampfile 2017-09-27 22:42:08 -04:00
Craig Scott
1561748496 ExternalProject: Prevent COMMAND from being treated as a true keyword
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
2017-09-02 17:53:16 +10:00
Craig Scott
8842a0272b ExternalProject: Improve documentation
- 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.
2017-07-18 08:39:39 +10:00
Daniel Pfeifer
9e24af0137 Use string(APPEND) in Modules
Automate with:

find Modules -type f -print0 | xargs -0 perl -i -0pe \
  's/set\(([a-zA-Z0-9_\$\{\}]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'
2017-05-17 11:26:11 -06:00
Brad King
12a781301c ExternalProject: Run git checkout with -- to clarify arguments
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
2017-04-03 14:34:35 -04:00
Brad King
8bc545c24c Merge topic 'ExternalProject-fix-remote-branch'
6f3838c0 ExternalProject: Fix regression in GIT_TAG with remote branch name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !649
2017-04-03 09:26:53 -04:00
Brad King
6f3838c034 ExternalProject: Fix regression in GIT_TAG with remote branch name
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
2017-03-31 12:59:53 -04:00
Ben Boeckel
99d6de6c1a ExternalProject: only append COMMAND if actually adding a command
Fixes #16544.
2017-02-27 11:33:31 -05:00
Brad King
f79efeac79 Merge topic 'ExternalProject-checkout-clarify'
a9fa6a2c ExternalProject: Run `git checkout` with `--` to clarify arguments
2017-02-27 09:11:25 -05:00
Brad King
dab2ff3e23 Merge branch 'ExternalProject-checkout-clarify' into release 2017-02-24 13:22:45 -05:00
Brad King
a9fa6a2c77 ExternalProject: Run git checkout with -- to clarify arguments
Fix the case when the tag name to be checked out also happens to match a
path name.

Fixes: #16678
2017-02-24 13:22:40 -05:00
Brad King
c95d017f9c ExternalProject: Clarify documented role of INSTALL_DIR
It does not actually configure the project to install to the given
location.  That must be done by passing the `<INSTALL_DIR>` placeholder
to the external project configuration step.
2017-02-21 10:32:26 -05:00
Wilfried Goesgens
4b21290e20 ExternalProject: Clarify documented role of INSTALL_COMMAND
It is for the install step of the external project and does not
affect installation of the calling project.
2017-02-21 10:32:25 -05:00
Brad King
0ed885f742 ExternalProject: Restore case-insensitive download hash check
Refactoring in commit v3.6.0-rc1~47^2 (ExternalProject: Re-implement
download logic as a dedicated script, 2016-05-19) accidentally made the
download hash check case-sensitive.  The hash comparison is done in hex
strings, so restore case-insensitive comparison since the case of the
hex digits does not matter.

Fixes: #16568
2017-01-17 11:45:18 -05:00
Karsten Sperling
0244513838 ExternalProject: Do not trip over pre-existing 'cmd' variable
Callers of `_ep_get_build_command` do not initialize the output variable
they pass and expect the function to unconditionally set it.  Revise the
function to not check its own output variable.  Otherwise if a `cmd`
variable happens to be set when `ExternalProject_Add` is called then it
will be erroneously used as the default `BUILD`, `TEST`, and `INSTALL`
command.
2016-11-17 13:40:29 -05:00
Brad King
b6f1b1741d Merge topic 'add-SHA-3'
f636d1e7 Help: Add notes for topic 'add-SHA-3'
cb5dba8e Tests: Add SHA-3 algorithm coverage to CPack checksum test
a9fa6099 ExternalProject: Add support for SHA-3 algorithms
b4ffd26f ExternalData: Add support for SHA-3 algorithms
60939702 file: Add support for SHA-3 algorithms
92f95aed string: Add support for SHA-3 algorithms
c326209f cmCryptoHash: Add support for SHA-3 algorithms
979e8ba6 Help: De-duplicate and spell out supported hash algorithms
7a79f7e3 librhash: Activate SHA-3 implementation
87584b5e Merge branch 'upstream-librhash' into add-SHA-3
7fcbd47e librhash 2016-11-06 (de79828d)
c50c32a3 librhash: Update import script to add SHA-3 implementation
2016-11-15 09:26:16 -05:00
Brad King
4deaa25f46 ExternalProject: Fix UPDATE_DISCONNECTED with empty update steps
When `UPDATE_DISCONNECTED` is enabled the post-update steps
unconditionally depend on a `skip-update` step instead of `update`.
Make `skip-update` available whenever `UPDATE_DISCONNECTED` is enabled,
whether there is a real update step or not.

Closes: #16428
2016-11-15 08:45:04 -05:00
Brad King
a9fa60997a ExternalProject: Add support for SHA-3 algorithms 2016-11-11 11:46:00 -05:00
Christian Fetzer
2be9d85af8 ExternalProject: Allow passing config flags to git clone
Add a `GIT_CONFIG` parameter that allows to specify `--config` flags
that are passed to the git clone command.  This can be used to specify
for example `core.autocrlf=true`.  The `--config` parameter is supported
since Git 1.7.7.
2016-11-09 15:54:13 -05:00
Brad King
fc7ecd6b05 Merge topic 'external-project-clone-progress'
e89fbfaf ExternalProject: support GIT_PROGRESS argument
64aa29b7 ExternalProject: fix typo
2016-10-20 08:51:18 -04:00
Ben Boeckel
63d215dfa8 ExternalProject: support extracting the configure command
Previously, the configure command generated by ExternalProject was not
accessible prior to actually adding the targets. This makes the CMake
configure command accessible with just a call to _ep_parse_arguments.

Future work will leverage this to support custom environment settings on
a per-project basis.
2016-10-19 08:58:25 -04:00
Brad King
a08a48c2da Merge topic 'external-project-source-subdir-usage'
615f3ed2 ExternalProject: make SOURCE_SUBDIR directly appendable
fdce782b ExternalProject: error out only if the property is unset
2016-10-19 08:48:40 -04:00
Ben Boeckel
e89fbfaf66 ExternalProject: support GIT_PROGRESS argument 2016-10-18 17:41:02 -04:00
Ben Boeckel
615f3ed2b4 ExternalProject: make SOURCE_SUBDIR directly appendable
This allows it to be used in expansions without being conditional based
on its value.
2016-10-18 12:51:38 -04:00
Ben Boeckel
fdce782b61 ExternalProject: error out only if the property is unset
Property values may be empty; instead make sure they exist and allow for
empty values.
2016-10-18 12:51:06 -04:00
Ben Boeckel
64aa29b7d6 ExternalProject: fix typo 2016-10-18 11:30:44 -04:00
Max Smolens
a3c98cb30e ExternalProject: Fix regression in passing list to CMAKE_CACHE_ARGS
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.
2016-10-10 14:40:12 -04:00
Brad King
86578eccf2 Simplify CMake per-source license notices
Per-source copyright/license notice headers that spell out copyright holder
names and years are hard to maintain and often out-of-date or plain wrong.
Precise contributor information is already maintained automatically by the
version control tool.  Ultimately it is the receiver of a file who is
responsible for determining its licensing status, and per-source notices are
merely a convenience.  Therefore it is simpler and more accurate for
each source to have a generic notice of the license name and references to
more detailed information on copyright holders and full license terms.

Our `Copyright.txt` file now contains a list of Contributors whose names
appeared source-level copyright notices.  It also references version control
history for more precise information.  Therefore we no longer need to spell
out the list of Contributors in each source file notice.

Replace CMake per-source copyright/license notice headers with a short
description of the license and links to `Copyright.txt` and online information
available from "https://cmake.org/licensing".  The online URL also handles
cases of modules being copied out of our source into other projects, so we
can drop our notices about replacing links with full license text.

Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority
of the replacements mechanically.  Manually fix up shebang lines and trailing
newlines in a few files.  Manually update the notices in a few files that the
script does not handle.
2016-09-27 15:14:44 -04:00
Ruslan Baratov
0f424c3d07 ExternalProject: Add HTTP_HEADER 2016-09-19 16:05:12 +03:00
Ruslan Baratov
e1ca117332 ExternalProject: Add HTTP_{USERNAME,PASSWORD} 2016-09-15 07:52:54 +03:00
Brad King
e240a7c017 Merge topic 'ExternalProject-SOURCE_SUBDIR'
a8345d65 ExternalProject: Add SOURCE_SUBDIR option
2016-08-16 13:26:22 -04:00
Matthew Woehlke
a8345d65f3 ExternalProject: Add SOURCE_SUBDIR option
Add a new SOURCE_SUBDIR option to ExternalProject_Add that allows
specifying the location of the CMakeLists.txt to use as the project root
relative to the SOURCE_DIR.

This is helpful for projects that have unusual layouts, or projects that
provide both a superbuild and project-only build depending on which
CMakeLists.txt is used.

Fixes: #15118
2016-08-16 13:18:18 -04:00
Ben Boeckel
2bdba83e4b issues: update references to the CMake issue tracker
References to specific comments are left as-is since comments were not
migrated.
2016-08-15 09:34:06 -04:00
Daniel Pfeifer
3a7be4f394 prefer list(APPEND) over string(APPEND) where appropriate 2016-08-08 21:28:52 +02:00
Brad King
ef729c5bc2 Merge topic 'ExternalProject-no-DS_Store'
52aecc0c ExternalProject: Ignore macOS .DS_Store files in tarball extraction
2016-08-03 09:20:44 -04:00
Brad King
52aecc0c38 ExternalProject: Ignore macOS .DS_Store files in tarball extraction
Do not consider a top-level `.DS_Store` file when deciding whether a
tarball contains exactly one directory whose contents should be used as
the resulting top-level of the extraction.

Fixes #16218.

Suggested-by: Patrice Kouame
2016-08-02 10:14:26 -04:00
Daniel Pfeifer
5d0d980d99 Use string(APPEND) in Modules
Automate with:

find Modules -type f -print0 | xargs -0 perl -i -0pe \
's/set\(([a-zA-Z0-9_]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'
2016-07-28 00:41:13 +02:00