diff options
Diffstat (limited to 'Tests/RunCMake/cmake_path/IS_ABSOLUTE.cmake')
-rw-r--r-- | Tests/RunCMake/cmake_path/IS_ABSOLUTE.cmake | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/Tests/RunCMake/cmake_path/IS_ABSOLUTE.cmake b/Tests/RunCMake/cmake_path/IS_ABSOLUTE.cmake new file mode 100644 index 0000000..794e786 --- /dev/null +++ b/Tests/RunCMake/cmake_path/IS_ABSOLUTE.cmake @@ -0,0 +1,48 @@ + +include ("${RunCMake_SOURCE_DIR}/check_errors.cmake") +unset (errors) + +if (WIN32) + set (path "c:/a") +else() + set (path "/a") +endif() +cmake_path(IS_ABSOLUTE path output) +if (NOT output) + list (APPEND errors "'${path} is not absolute") +endif() + +set (path "a/b") +cmake_path(IS_ABSOLUTE path output) +if (output) + list (APPEND errors "'${path} is absolute") +endif() + +if (WIN32) + set (path "c:/a/b") + cmake_path(IS_ABSOLUTE path output) + if (NOT output) + list (APPEND errors "'${path} is not absolute") + endif() + + set (path "//host/b") + cmake_path(IS_ABSOLUTE path output) + if (NOT output) + list (APPEND errors "'${path} is not absolute") + endif() + + set (path "/a") + cmake_path(IS_ABSOLUTE path output) + if (output) + list (APPEND errors "'${path} is absolute") + endif() + + set (path "c:a") + cmake_path(IS_ABSOLUTE path output) + if (output) + list (APPEND errors "'${path} is absolute") + endif() +endif() + + +check_errors (IS_ABSOLUTE ${errors}) |