diff options
author | Brad King <brad.king@kitware.com> | 2021-04-20 13:58:23 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-04-20 13:58:51 (GMT) |
commit | b0be93c5c73225517bba233f95f4775141ed3091 (patch) | |
tree | 19913a376ec19741128290970b426d1ae373a3c0 /Help | |
parent | dc7871739f16c75d8acb3b7d34d4c7d3f5a068af (diff) | |
parent | 6234afdff4feda1459b3b30d94cc07a48e8dfe68 (diff) | |
download | CMake-b0be93c5c73225517bba233f95f4775141ed3091.zip CMake-b0be93c5c73225517bba233f95f4775141ed3091.tar.gz CMake-b0be93c5c73225517bba233f95f4775141ed3091.tar.bz2 |
Merge topic 'doc-if-IS_ABSOLUTE' into release-3.20
6234afdff4 Help: Document special cases for if(IS_ABSOLUTE)
789307b02f Help: Behavior of file(TO_NATIVE_PATH) depends on the host platform
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6016
Diffstat (limited to 'Help')
-rw-r--r-- | Help/command/file.rst | 3 | ||||
-rw-r--r-- | Help/command/if.rst | 11 |
2 files changed, 12 insertions, 2 deletions
diff --git a/Help/command/file.rst b/Help/command/file.rst index 24e43e9..31de610 100644 --- a/Help/command/file.rst +++ b/Help/command/file.rst @@ -922,7 +922,8 @@ system search path like ``$ENV{PATH}``. A search path will be converted to a cmake-style list separated by ``;`` characters. The ``TO_NATIVE_PATH`` mode converts a cmake-style ``<path>`` into a native -path with platform-specific slashes (``\`` on Windows and ``/`` elsewhere). +path with platform-specific slashes (``\`` on Windows hosts and ``/`` +elsewhere). Always use double quotes around the ``<path>`` to be sure it is treated as a single argument to this command. diff --git a/Help/command/if.rst b/Help/command/if.rst index f327ca9..fbf3e36 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 """"""""""" |