diff options
author | Craig Scott <craig.scott@crascit.com> | 2021-04-17 19:16:01 +1000 |
---|---|---|
committer | Craig Scott <craig.scott@crascit.com> | 2021-04-17 19:41:53 +1000 |
commit | 6234afdff4feda1459b3b30d94cc07a48e8dfe68 (patch) | |
tree | f1e9a98689df3cfcddb9828a06b97f88428163e5 | |
parent | 789307b02fe37e0af1a9016d11470a001b84bf39 (diff) | |
download | cmake-6234afdff4feda1459b3b30d94cc07a48e8dfe68.tar.gz |
Help: Document special cases for if(IS_ABSOLUTE)
The meaning of "absolute path" was previously assumed knowledge,
but a number of special cases were left unspecified. The way some of
these are handled differs to the way that cmake_path(IS_ABSOLUTE)
works, so document those special cases so that the differing behavior
between these two commands is clearly defined.
-rw-r--r-- | Help/command/if.rst | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Help/command/if.rst b/Help/command/if.rst index f327ca9434..fbf3e363f3 100644 --- a/Help/command/if.rst +++ b/Help/command/if.rst @@ -153,7 +153,16 @@ File Operations only for full paths. ``if(IS_ABSOLUTE path)`` - True if the given path is an absolute path. + True if the given path is an absolute path. Note the following special + cases: + + * An empty ``path`` evaluates to false. + * On Windows hosts, any ``path`` that begins with a drive letter and colon + (e.g. ``C:``), a forward slash or a backslash will evaluate to true. + This means a path like ``C:no\base\dir`` will evaluate to true, even + though the non-drive part of the path is relative. + * On non-Windows hosts, any ``path`` that begins with a tilde (``~``) + evaluates to true. Comparisons """"""""""" |