cmake_path: various updates

To follow discussions in #21385 and !5682:
* Fix bug in cmCMakePath::IsSuffix() method
* cmake_path(HASH) always normalized paths (NORMALIZE option removed)
This commit is contained in:
Marc Chevrier
2021-01-13 15:27:49 +01:00
parent 3ad1ee8144
commit 76f0bcdfb6
5 changed files with 14 additions and 24 deletions
-5
View File
@@ -14,11 +14,6 @@ set (path1 "a///b/c/../d")
cmake_path(HASH path1 hash1)
set (path2 "a/b////d")
cmake_path(HASH path2 hash2)
if (hash1 STREQUAL hash2)
list (APPEND errors "'hash values equal for '${path1}' and '${path2}'")
endif()
cmake_path(HASH path1 hash1 NORMALIZE)
cmake_path(HASH path2 NORMALIZE hash2)
if (NOT hash1 STREQUAL hash2)
list (APPEND errors "'hash values not equal for '${path1}' and '${path2}'")
endif()
@@ -18,5 +18,10 @@ if (NOT output)
list (APPEND errors "'${path} is not prefix of 'a/b/d/e'")
endif()
set(path "/a/b/..")
cmake_path(IS_PREFIX path "/a/c/../b" NORMALIZE output)
if (NOT output)
list (APPEND errors "'${path} is not prefix of '/a/c/../b'")
endif()
check_errors (IS_PREFIX ${errors})