diff options
author | Brad King <brad.king@kitware.com> | 2021-03-03 20:54:14 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-03-04 13:44:06 (GMT) |
commit | c61292726cd3018ec502f8d59e62352c8dce62d3 (patch) | |
tree | 66f8d89ec3c3329453622e37abacb6dc22c852b2 /Help/command | |
parent | 0c2dc345047135cac824ffc222bfb0c26f6c23be (diff) | |
download | CMake-c61292726cd3018ec502f8d59e62352c8dce62d3.zip CMake-c61292726cd3018ec502f8d59e62352c8dce62d3.tar.gz CMake-c61292726cd3018ec502f8d59e62352c8dce62d3.tar.bz2 |
file(RENAME): Add option to capture error message on failure
Diffstat (limited to 'Help/command')
-rw-r--r-- | Help/command/file.rst | 11 |
1 files changed, 9 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: |