summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/GenEx-PATH/CMAKE_PATH.cmake.in
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/GenEx-PATH/CMAKE_PATH.cmake.in')
-rw-r--r--Tests/RunCMake/GenEx-PATH/CMAKE_PATH.cmake.in53
1 files changed, 53 insertions, 0 deletions
diff --git a/Tests/RunCMake/GenEx-PATH/CMAKE_PATH.cmake.in b/Tests/RunCMake/GenEx-PATH/CMAKE_PATH.cmake.in
new file mode 100644
index 0000000..41205fa
--- /dev/null
+++ b/Tests/RunCMake/GenEx-PATH/CMAKE_PATH.cmake.in
@@ -0,0 +1,53 @@
+
+include ("${RunCMake_SOURCE_DIR}/check_errors.cmake")
+unset (errors)
+
+
+cmake_path(SET reference "/x/y/z/../../a/d")
+set(output "$<PATH:CMAKE_PATH,/x/y/z/../../a/d>")
+if (NOT output STREQUAL reference)
+ list (APPEND errors "'${output}' instead of '${reference}'")
+endif()
+cmake_path(SET reference NORMALIZE "/x/y/z/../../a/d")
+set(output "$<PATH:CMAKE_PATH,NORMALIZE,/x/y/z/../../a/d>")
+if (NOT output STREQUAL reference)
+ list (APPEND errors "'${output}' instead of '${reference}'")
+endif()
+
+if (WIN32)
+ cmake_path(SET reference "/x\\y/z\\..\\../a/d")
+ set(output "$<PATH:CMAKE_PATH,/x\y/z\..\../a/d>")
+ if (NOT output STREQUAL reference)
+ list (APPEND errors "'${output}' instead of '${reference}'")
+ endif()
+ cmake_path(SET reference NORMALIZE "/x\\y/z\\..\\../a/d")
+ set(output "$<PATH:CMAKE_PATH,NORMALIZE,/x\y/z\..\../a/d>")
+ if (NOT output STREQUAL reference)
+ list (APPEND errors "'${output}' instead of '${reference}'")
+ endif()
+
+ cmake_path(SET reference "//?/c:/x\\y/z\\..\\../a/d")
+ set(output "$<PATH:CMAKE_PATH,//?/c:/x\y/z\..\../a/d>")
+ if (NOT output STREQUAL reference)
+ list (APPEND errors "'${output}' instead of '${reference}'")
+ endif()
+ cmake_path(SET reference NORMALIZE "//?/c:/x\\y/z\\..\\../a/d")
+ set(output "$<PATH:CMAKE_PATH,NORMALIZE,//?/c:/x\y/z\..\../a/d>")
+ if (NOT output STREQUAL reference)
+ list (APPEND errors "'${output}' instead of '${reference}'")
+ endif()
+
+ cmake_path(SET reference "\\\\?\\UNC/host/x\\y/z\\..\\../a/d")
+ set(output "$<PATH:CMAKE_PATH,\\?\UNC/host/x\y/z\..\../a/d>")
+ if (NOT output STREQUAL reference)
+ list (APPEND errors "'${output}' instead of '${reference}'")
+ endif()
+ cmake_path(SET reference NORMALIZE "\\\\?\\UNC\\host/x\\y/z\\..\\../a/d")
+ set(output "$<PATH:CMAKE_PATH,NORMALIZE,\\?\UNC/host/x\y/z\..\../a/d>")
+ if (NOT output STREQUAL reference)
+ list (APPEND errors "'${output}' instead of '${reference}'")
+ endif()
+endif()
+
+
+check_errors("PATH:CMAKE_PATH" ${errors})