mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-13 01:29:02 -05:00
file(RENAME): Add option to not replace existing path
Add a `NO_REPLACE` option that prevents overwriting `<newname>` if it exists.
This commit is contained in:
@@ -666,7 +666,8 @@ Examples of recursive globbing include::
|
||||
.. code-block:: cmake
|
||||
|
||||
file(RENAME <oldname> <newname>
|
||||
[RESULT <result>])
|
||||
[RESULT <result>]
|
||||
[NO_REPLACE])
|
||||
|
||||
Move a file or directory within a filesystem from ``<oldname>`` to
|
||||
``<newname>``, replacing the destination atomically.
|
||||
@@ -677,6 +678,11 @@ The options are:
|
||||
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.
|
||||
|
||||
``NO_REPLACE``
|
||||
If the ``<newname>`` path already exists, do not replace it.
|
||||
If ``RESULT <result>`` is used, the result variable will be
|
||||
set to ``NO_REPLACE``. Otherwise, an error is emitted.
|
||||
|
||||
.. _REMOVE:
|
||||
.. _REMOVE_RECURSE:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user