diff --git a/Help/command/file.rst b/Help/command/file.rst index 943bf7c1b8..a9cbd403c8 100644 --- a/Help/command/file.rst +++ b/Help/command/file.rst @@ -38,10 +38,10 @@ Synopsis `Filesystem`_ file({`GLOB`_ | `GLOB_RECURSE`_} [...] [...]) + file(`MAKE_DIRECTORY`_ [...]) + file({`REMOVE`_ | `REMOVE_RECURSE`_ } [...]) file(`RENAME`_ [...]) file(`COPY_FILE`_ [...]) - file({`REMOVE`_ | `REMOVE_RECURSE`_ } [...]) - file(`MAKE_DIRECTORY`_ [...]) file({`COPY`_ | `INSTALL`_} ... DESTINATION [...]) file(`SIZE`_ ) file(`READ_SYMLINK`_ ) @@ -691,6 +691,32 @@ Examples of recursive globbing include:: /dir/*.py - match all python files in /dir and subdirectories +.. _MAKE_DIRECTORY: + +.. code-block:: cmake + + file(MAKE_DIRECTORY [...]) + +Create the given directories and their parents as needed. + +.. _REMOVE: +.. _REMOVE_RECURSE: + +.. code-block:: cmake + + file(REMOVE [...]) + file(REMOVE_RECURSE [...]) + +Remove the given files. The ``REMOVE_RECURSE`` mode will remove the given +files and directories, also non-empty directories. No error is emitted if a +given file does not exist. Relative input paths are evaluated with respect +to the current source directory. + +.. versionchanged:: 3.15 + Empty input paths are ignored with a warning. Previous versions of CMake + interpreted empty strings as a relative path with respect to the current + directory and removed its contents. + .. _RENAME: .. code-block:: cmake @@ -739,32 +765,6 @@ The options are: If the ```` path already exists, do not replace it if it is the same as ````. Otherwise, an error is emitted. -.. _REMOVE: -.. _REMOVE_RECURSE: - -.. code-block:: cmake - - file(REMOVE [...]) - file(REMOVE_RECURSE [...]) - -Remove the given files. The ``REMOVE_RECURSE`` mode will remove the given -files and directories, also non-empty directories. No error is emitted if a -given file does not exist. Relative input paths are evaluated with respect -to the current source directory. - -.. versionchanged:: 3.15 - Empty input paths are ignored with a warning. Previous versions of CMake - interpreted empty string as a relative path with respect to the current - directory and removed its contents. - -.. _MAKE_DIRECTORY: - -.. code-block:: cmake - - file(MAKE_DIRECTORY [...]) - -Create the given directories and their parents as needed. - .. _COPY: .. _INSTALL: