diff options
Diffstat (limited to 'Tests/RunCMake/GenEx-PATH/APPEND.cmake.in')
-rw-r--r-- | Tests/RunCMake/GenEx-PATH/APPEND.cmake.in | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/Tests/RunCMake/GenEx-PATH/APPEND.cmake.in b/Tests/RunCMake/GenEx-PATH/APPEND.cmake.in new file mode 100644 index 0000000..ab967a2 --- /dev/null +++ b/Tests/RunCMake/GenEx-PATH/APPEND.cmake.in @@ -0,0 +1,68 @@ + +include ("${RunCMake_SOURCE_DIR}/check_errors.cmake") +unset (errors) + +cmake_path (APPEND path "/a/b" "c") +set(output "$<PATH:APPEND,/a/b,c>") +if (NOT output STREQUAL path) + list (APPEND errors "'${output}' instead of '${path}'") +endif() + +set (path "a") +cmake_path (APPEND path "") +set(output "$<PATH:APPEND,a,>") +if (NOT output STREQUAL path) + list (APPEND errors "'${output}' instead of '${path}'") +endif() + +cmake_path (APPEND path "/b") +set(output "$<PATH:APPEND,a/,/b>") +if (NOT output STREQUAL path) + list (APPEND errors "'${output}' instead of '${path}'") +endif() + +if (WIN32) + set (path "a") + cmake_path (APPEND path "c:/b") + set(output "$<PATH:APPEND,a,c:/b>") + if (NOT output STREQUAL path) + list (APPEND errors "'${output}' instead of '${path}'") + endif() + + set (path "a") + cmake_path (APPEND path "c:") + set(output "$<PATH:APPEND,a,c:>") + if (NOT output STREQUAL path) + list (APPEND errors "'${output}' instead of '${path}'") + endif() + + set (path "c:a") + cmake_path (APPEND path "/b") + set(output "$<PATH:APPEND,c:a,/b>") + if (NOT output STREQUAL path) + list (APPEND errors "'${output}' instead of '${path}'") + endif() + + set (path "c:a") + cmake_path (APPEND path "c:b") + set(output "$<PATH:APPEND,c:a,c:b>") + if (NOT output STREQUAL path) + list (APPEND errors "'${output}' instead of '${path}'") + endif() + + set (path "//host") + cmake_path (APPEND path "b") + set(output "$<PATH:APPEND,//host,b>") + if (NOT output STREQUAL path) + list (APPEND errors "'${output}' instead of '${path}'") + endif() + + set (path "//host/") + cmake_path (APPEND path "b") + set(output "$<PATH:APPEND,//host/,b>") + if (NOT output STREQUAL path) + list (APPEND errors "'${output}' instead of '${path}'") + endif() +endif() + +check_errors ("PATH:APPEND" ${errors}) |