diff options
author | Craig Scott <craig.scott@crascit.com> | 2020-07-28 14:23:26 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-07-28 14:23:35 (GMT) |
commit | 22bfe014d0a2676f46523b3e0cd334dba154f77a (patch) | |
tree | b02240ea37123cd493db477f7a51b7569984d521 /Help | |
parent | 261a2585d9df7113a5ba7c9beacb641754444523 (diff) | |
parent | fed7d8f76de3442f4aede00f8e47c3d142f73e94 (diff) | |
download | CMake-22bfe014d0a2676f46523b3e0cd334dba154f77a.zip CMake-22bfe014d0a2676f46523b3e0cd334dba154f77a.tar.gz CMake-22bfe014d0a2676f46523b3e0cd334dba154f77a.tar.bz2 |
Merge topic 'file-download-no-save'
fed7d8f76d file(DOWNLOAD): Make file argument optional
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5060
Diffstat (limited to 'Help')
-rw-r--r-- | Help/command/file.rst | 15 | ||||
-rw-r--r-- | Help/release/dev/file-download-optional-file.rst | 5 |
2 files changed, 15 insertions, 5 deletions
diff --git a/Help/command/file.rst b/Help/command/file.rst index 693c059..2cf938b 100644 --- a/Help/command/file.rst +++ b/Help/command/file.rst @@ -776,11 +776,14 @@ Transfer .. code-block:: cmake - file(DOWNLOAD <url> <file> [<options>...]) + file(DOWNLOAD <url> [<file>] [<options>...]) file(UPLOAD <file> <url> [<options>...]) -The ``DOWNLOAD`` mode downloads the given ``<url>`` to a local ``<file>``. -The ``UPLOAD`` mode uploads a local ``<file>`` to a given ``<url>``. +The ``DOWNLOAD`` mode downloads the given ``<url>`` to a local ``<file>``. If +``<file>`` is not specified for ``file(DOWNLOAD)``, the file is not saved. This +can be useful if you want to know if a file can be downloaded (for example, to +check that it exists) without actually saving it anywhere. The ``UPLOAD`` mode +uploads a local ``<file>`` to a given ``<url>``. Options to both ``DOWNLOAD`` and ``UPLOAD`` are: @@ -853,10 +856,12 @@ Additional options to ``DOWNLOAD`` are: Verify that the downloaded content hash matches the expected value, where ``ALGO`` is one of the algorithms supported by ``file(<HASH>)``. - If it does not match, the operation fails with an error. + If it does not match, the operation fails with an error. It is an error to + specify this if ``DOWNLOAD`` is not given a ``<file>``. ``EXPECTED_MD5 <value>`` - Historical short-hand for ``EXPECTED_HASH MD5=<value>``. + Historical short-hand for ``EXPECTED_HASH MD5=<value>``. It is an error to + specify this if ``DOWNLOAD`` is not given a ``<file>``. Locking ^^^^^^^ diff --git a/Help/release/dev/file-download-optional-file.rst b/Help/release/dev/file-download-optional-file.rst new file mode 100644 index 0000000..f3dc24c --- /dev/null +++ b/Help/release/dev/file-download-optional-file.rst @@ -0,0 +1,5 @@ +file-download-optional-file +--------------------------- + +* The ``<file>`` argument is now optional for :command:`file(DOWNLOAD)`. If it + is not specified, the file is not saved. |