summaryrefslogtreecommitdiffstats
path: root/Help/command
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-09-01 13:19:09 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-09-01 13:19:18 (GMT)
commitf7fbe405131eae2e914cd5aec310e1ec2614d840 (patch)
tree8c243dddcb9e4770e14da5a7e09dc3d6831ebbcd /Help/command
parent4a804837502c512610035d4ffb6da3d8d06b79ae (diff)
parent7de60beddf5b41f643e187fe487ffb91cd47e9f7 (diff)
downloadCMake-f7fbe405131eae2e914cd5aec310e1ec2614d840.zip
CMake-f7fbe405131eae2e914cd5aec310e1ec2614d840.tar.gz
CMake-f7fbe405131eae2e914cd5aec310e1ec2614d840.tar.bz2
Merge topic 'file_chmod'
7de60beddf file: Add CHMOD and CHMOD_RECURSE subcommands Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Marc Chevrier <marc.chevrier@gmail.com> Merge-request: !5122
Diffstat (limited to 'Help/command')
-rw-r--r--Help/command/file.rst47
1 files changed, 47 insertions, 0 deletions
diff --git a/Help/command/file.rst b/Help/command/file.rst
index 953172b..9d6ff91 100644
--- a/Help/command/file.rst
+++ b/Help/command/file.rst
@@ -30,6 +30,8 @@ Synopsis
file(`SIZE`_ <filename> <out-var>)
file(`READ_SYMLINK`_ <linkname> <out-var>)
file(`CREATE_LINK`_ <original> <linkname> [...])
+ file(`CHMOD`_ <files>... <directories>... PERMISSIONS <permissions>... [...])
+ file(`CHMOD_RECURSE`_ <files>... <directories>... PERMISSIONS <permissions>... [...])
`Path Conversion`_
file(`RELATIVE_PATH`_ <out-var> <directory> <file>)
@@ -741,6 +743,51 @@ creating the link fails. It can be useful for handling situations such as
``<original>`` and ``<linkname>`` being on different drives or mount points,
which would make them unable to support a hard link.
+.. _CHMOD:
+
+.. code-block:: cmake
+
+ file(CHMOD <files>... <directories>... [PERMISSIONS <permissions>...]
+ [FILE_PERMISSIONS <permissions>...]
+ [DIRECTORY_PERMISSIONS <permissions>...])
+
+Set the permissions for the ``<files>...`` and ``<directories>...`` specified.
+Valid permissions are ``OWNER_READ``, ``OWNER_WRITE``, ``OWNER_EXECUTE``,
+``GROUP_READ``, ``GROUP_WRITE``, ``GROUP_EXECUTE``, ``WORLD_READ``,
+``WORLD_WRITE``, ``WORLD_EXECUTE``.
+
+Valid combination of keywords are:
+
+``PERMISSIONS``
+ all items are changed
+
+``FILE_PERMISSIONS``
+ only files are changed
+
+``DIRECTORY_PERMISSIONS``
+ only directories are changed
+
+``PERMISSIONS`` and ``FILE_PERMISSIONS``
+ ``FILE_PERMISSIONS`` overrides ``PERMISSIONS`` for files
+
+``PERMISSIONS`` and ``DIRECTORY_PERMISSIONS``
+ ``DIRECTORY_PERMISSIONS`` overrides ``PERMISSIONS`` for directories
+
+``FILE_PERMISSIONS`` and ``DIRECTORY_PERMISSIONS``
+ use ``FILE_PERMISSIONS`` for files and ``DIRECTORY_PERMISSIONS`` for
+ directories
+
+
+.. _CHMOD_RECURSE:
+
+.. code-block:: cmake
+
+ file(CHMOD_RECURSE <files>... <directories>... PERMISSIONS <permissions>...
+ FILE_PERMISSIONS <permissions>... DIRECTORY_PERMISSIONS <permissions>...)
+
+Same as `CHMOD`_, but change the permissions of files and directories present in
+the ``<directories>..`` recursively.
+
Path Conversion
^^^^^^^^^^^^^^^