ABSOLUTE_PATH.cmake.in 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. include ("${RunCMake_SOURCE_DIR}/check_errors.cmake")
  2. unset (errors)
  3. set (reference "../../a/d")
  4. cmake_path(ABSOLUTE_PATH reference BASE_DIRECTORY "/x/y/a/f")
  5. set(output "$<PATH:ABSOLUTE_PATH,../../a/d,/x/y/a/f>")
  6. if (NOT output STREQUAL reference)
  7. list (APPEND errors "'${output}' instead of '${reference}'")
  8. endif()
  9. set (reference "../../a/d")
  10. cmake_path(ABSOLUTE_PATH reference BASE_DIRECTORY "/x/y/a/f" NORMALIZE)
  11. set(output "$<PATH:ABSOLUTE_PATH,NORMALIZE,../../a/d,/x/y/a/f>")
  12. if (NOT output STREQUAL reference)
  13. list (APPEND errors "'${output}' instead of '${reference}'")
  14. endif()
  15. set (reference "/a/d/../e")
  16. cmake_path(ABSOLUTE_PATH reference BASE_DIRECTORY "/x/y/a/f")
  17. set(output "$<PATH:ABSOLUTE_PATH,/a/d/../e,/x/y/a/f>")
  18. if (NOT output STREQUAL reference)
  19. list (APPEND errors "'${output}' instead of '${reference}'")
  20. endif()
  21. set (reference "/a/d/../e")
  22. cmake_path(ABSOLUTE_PATH reference BASE_DIRECTORY "/x/y/a/f" NORMALIZE)
  23. set(output "$<PATH:ABSOLUTE_PATH,NORMALIZE,/a/d/../e,/x/y/a/f>")
  24. if (NOT output STREQUAL reference)
  25. list (APPEND errors "'${output}' instead of '${reference}'")
  26. endif()
  27. check_errors("PATH:ABSOLUTE_PATH" ${errors})