summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/GenEx-PATH/APPEND.cmake.in
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/GenEx-PATH/APPEND.cmake.in')
-rw-r--r--Tests/RunCMake/GenEx-PATH/APPEND.cmake.in35
1 files changed, 35 insertions, 0 deletions
diff --git a/Tests/RunCMake/GenEx-PATH/APPEND.cmake.in b/Tests/RunCMake/GenEx-PATH/APPEND.cmake.in
index ab967a2..1955480 100644
--- a/Tests/RunCMake/GenEx-PATH/APPEND.cmake.in
+++ b/Tests/RunCMake/GenEx-PATH/APPEND.cmake.in
@@ -65,4 +65,39 @@ if (WIN32)
endif()
endif()
+
+######################################
+## tests with list of paths
+######################################
+unset(reference)
+foreach(item IN ITEMS "/a/b" "/x/y")
+ cmake_path (APPEND result "${item}" "c")
+ list(APPEND reference "${result}")
+endforeach()
+set(output "$<PATH:APPEND,/a/b;/x/y,c>")
+if (NOT output STREQUAL reference)
+ list (APPEND errors "'${output}' instead of '${reference}'")
+endif()
+
+unset(reference)
+foreach(item IN ITEMS "a" "c")
+ cmake_path (APPEND item "")
+ list(APPEND reference "${item}")
+endforeach()
+set(output "$<PATH:APPEND,a;c,>")
+if (NOT output STREQUAL reference)
+ list (APPEND errors "'${output}' instead of '${reference}'")
+endif()
+
+unset(reference)
+foreach(item IN ITEMS "a/" "c/")
+ cmake_path (APPEND item "/b")
+ list(APPEND reference "${item}")
+endforeach()
+set(output "$<PATH:APPEND,a/;c/,/b>")
+if (NOT output STREQUAL reference)
+ list (APPEND errors "'${output}' instead of '${reference}'")
+endif()
+
+
check_errors ("PATH:APPEND" ${errors})