summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-03-03 20:54:14 (GMT)
committerBrad King <brad.king@kitware.com>2021-03-04 13:44:06 (GMT)
commitc61292726cd3018ec502f8d59e62352c8dce62d3 (patch)
tree66f8d89ec3c3329453622e37abacb6dc22c852b2 /Help
parent0c2dc345047135cac824ffc222bfb0c26f6c23be (diff)
downloadCMake-c61292726cd3018ec502f8d59e62352c8dce62d3.zip
CMake-c61292726cd3018ec502f8d59e62352c8dce62d3.tar.gz
CMake-c61292726cd3018ec502f8d59e62352c8dce62d3.tar.bz2
file(RENAME): Add option to capture error message on failure
Diffstat (limited to 'Help')
-rw-r--r--Help/command/file.rst11
-rw-r--r--Help/release/dev/file-RENAME.rst5
2 files changed, 14 insertions, 2 deletions
diff --git a/Help/command/file.rst b/Help/command/file.rst
index 3db605d..b28e206 100644
--- a/Help/command/file.rst
+++ b/Help/command/file.rst
@@ -38,7 +38,7 @@ Synopsis
`Filesystem`_
file({`GLOB`_ | `GLOB_RECURSE`_} <out-var> [...] [<globbing-expr>...])
- file(`RENAME`_ <oldname> <newname>)
+ file(`RENAME`_ <oldname> <newname> [...])
file({`REMOVE`_ | `REMOVE_RECURSE`_ } [<files>...])
file(`MAKE_DIRECTORY`_ [<dir>...])
file({`COPY`_ | `INSTALL`_} <file>... DESTINATION <dir> [...])
@@ -665,11 +665,18 @@ Examples of recursive globbing include::
.. code-block:: cmake
- file(RENAME <oldname> <newname>)
+ file(RENAME <oldname> <newname>
+ [RESULT <result>])
Move a file or directory within a filesystem from ``<oldname>`` to
``<newname>``, replacing the destination atomically.
+The options are:
+
+``RESULT <result>``
+ Set ``<result>`` variable to ``0`` on success or an error message otherwise.
+ If ``RESULT`` is not specified and the operation fails, an error is emitted.
+
.. _REMOVE:
.. _REMOVE_RECURSE:
diff --git a/Help/release/dev/file-RENAME.rst b/Help/release/dev/file-RENAME.rst
new file mode 100644
index 0000000..6cde036
--- /dev/null
+++ b/Help/release/dev/file-RENAME.rst
@@ -0,0 +1,5 @@
+file-RENAME
+-----------
+
+* The :command:`file(RENAME)` command learned to optionally capture
+ failure in a result variable.