summaryrefslogtreecommitdiffstats
path: root/Help/command
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2023-10-21 15:16:13 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2023-11-01 13:53:31 (GMT)
commit337bc5662c35acce32630bfa26e87a42d472726f (patch)
tree46e94efa0b6df83c8491b4baf25de7aac5a9b6b4 /Help/command
parentfdf64354278b2586c34e7c42f66b071dc3b526f8 (diff)
downloadCMake-337bc5662c35acce32630bfa26e87a42d472726f.zip
CMake-337bc5662c35acce32630bfa26e87a42d472726f.tar.gz
CMake-337bc5662c35acce32630bfa26e87a42d472726f.tar.bz2
if(): add operators IS_READABLE, IS_WRITABLE and IS_EXECUTABLE.
Offers possibility to check for file or directory permissions.
Diffstat (limited to 'Help/command')
-rw-r--r--Help/command/if.rst41
1 files changed, 41 insertions, 0 deletions
diff --git a/Help/command/if.rst b/Help/command/if.rst
index 5d85a1f..1afbe04 100644
--- a/Help/command/if.rst
+++ b/Help/command/if.rst
@@ -178,6 +178,47 @@ File Operations
False if the given path is an empty string.
+ .. warning::
+ To check the readability of a file, use preferably ``if(IS_READABLE)``
+ because this test will evolve to check file existence only in a future
+ release.
+
+.. signature:: if(IS_READABLE <path-to-file-or-directory>)
+
+ .. versionadded:: 3.29
+
+ True if the named file or directory is readable. Behavior
+ is well-defined only for explicit full paths (a leading ``~/`` is not
+ expanded as a home directory and is considered a relative path).
+ Resolves symbolic links, i.e. if the named file or directory is a
+ symbolic link, returns true if the target of the symbolic link is readable.
+
+ False if the given path is an empty string.
+
+.. signature:: if(IS_WRITABLE <path-to-file-or-directory>)
+
+ .. versionadded:: 3.29
+
+ True if the named file or directory is writable. Behavior
+ is well-defined only for explicit full paths (a leading ``~/`` is not
+ expanded as a home directory and is considered a relative path).
+ Resolves symbolic links, i.e. if the named file or directory is a
+ symbolic link, returns true if the target of the symbolic link is writable.
+
+ False if the given path is an empty string.
+
+.. signature:: if(IS_EXECUTABLE <path-to-file-or-directory>)
+
+ .. versionadded:: 3.29
+
+ True if the named file or directory is executable. Behavior
+ is well-defined only for explicit full paths (a leading ``~/`` is not
+ expanded as a home directory and is considered a relative path).
+ Resolves symbolic links, i.e. if the named file or directory is a
+ symbolic link, returns true if the target of the symbolic link is executable.
+
+ False if the given path is an empty string.
+
.. signature:: if(<file1> IS_NEWER_THAN <file2>)
:target: IS_NEWER_THAN