1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-15 12:16:40 +08:00

Help: cmake_path: fix erroneous example for IS_PREFIX

Fixes: #22302
This commit is contained in:
Marc Chevrier
2021-06-12 11:23:47 +02:00
parent 8a4f3fd861
commit 4665d1e69a

View File

@@ -459,9 +459,10 @@ are :ref:`normalized <Normalization>` before the check.
.. code-block:: cmake
set(path "/a/b/c/d")
cmake_path(IS_PREFIX path "/a/b" result) # result = true
cmake_path(IS_PREFIX path "/x/y/z" result) # result = false
set(path "/a/b/c")
cmake_path(IS_PREFIX path "/a/b/c/d" result) # result = true
cmake_path(IS_PREFIX path "/a/b" result) # result = false
cmake_path(IS_PREFIX path "/x/y/z" result) # result = false
set(path "/a/b")
cmake_path(IS_PREFIX path "/a/c/../b" NORMALIZE result) # result = true