| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- 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()
- ######################################
- ## tests with list of paths
- ######################################
- set(reference "/x/y/z/../../a/d;/x/y/z/../../b/e")
- set(output "$<PATH:CMAKE_PATH,/x/y/z/../../a/d;/x/y/z/../../b/e>")
- if (NOT output STREQUAL reference)
- list (APPEND errors "'${output}' instead of '${reference}'")
- endif()
- unset(reference)
- foreach(path IN ITEMS "/x/y/z/../../a/d" "/x/y/z/../../b/e")
- cmake_path(SET result NORMALIZE "${path}")
- list(APPEND reference "${result}")
- endforeach()
- set(output "$<PATH:CMAKE_PATH,NORMALIZE,/x/y/z/../../a/d;/x/y/z/../../b/e>")
- if (NOT output STREQUAL reference)
- list (APPEND errors "'${output}' instead of '${reference}'")
- endif()
- if (WIN32)
- unset(reference)
- foreach(path IN ITEMS "/x\\y/z\\..\\../a/d" "/x\\y/z\\..\\../b/e")
- cmake_path(SET result "${path}")
- list(APPEND reference "${result}")
- endforeach()
- set(output "$<PATH:CMAKE_PATH,/x\y/z\..\../a/d;/x\y/z\..\../b/e>")
- if (NOT output STREQUAL reference)
- list (APPEND errors "'${output}' instead of '${reference}'")
- endif()
- unset(reference)
- foreach(path IN ITEMS "/x\\y/z\\..\\../a/d" "/x\\y/z\\..\\../b/e")
- cmake_path(SET result NORMALIZE "${path}")
- list(APPEND reference "${result}")
- endforeach()
- set(output "$<PATH:CMAKE_PATH,NORMALIZE,/x\y/z\..\../a/d;/x\y/z\..\../b/e>")
- if (NOT output STREQUAL reference)
- list (APPEND errors "'${output}' instead of '${reference}'")
- endif()
- endif()
- check_errors("PATH:CMAKE_PATH" ${errors})
|