Introduce "generator expressions" to add_test()
[cmake.git] / Tests / CMakeTests / SeparateArgumentsTest.cmake.in
blob48964b8cbdcaeebf7f2ed44de0a612e17aa536b6
1 set(old_out "a b  c")
2 separate_arguments(old_out)
3 set(old_exp "a;b;;c")
5 set(unix_cmd "a \"b c\" 'd e' \";\" \\ \\'\\\" '\\'' \"\\\"\"")
6 set(unix_exp "a;b c;d e;\;; '\";';\"")
7 separate_arguments(unix_out UNIX_COMMAND "${unix_cmd}")
9 set(windows_cmd "a \"b c\" 'd e' \";\" \\ \"c:\\windows\\path\\\\\" \\\"")
10 set(windows_exp "a;b c;'d;e';\;;\\;c:\\windows\\path\\;\"")
11 separate_arguments(windows_out WINDOWS_COMMAND "${windows_cmd}")
13 foreach(mode old unix windows)
14   if(NOT "${${mode}_out}" STREQUAL "${${mode}_exp}")
15     message(FATAL_ERROR "separate_arguments ${mode}-style failed.  "
16       "Expected\n  [${${mode}_exp}]\nbut got\n  [${${mode}_out}]\n")
17   endif()
18 endforeach()
20 set(nothing)
21 separate_arguments(nothing)
22 if(DEFINED nothing)
23   message(FATAL_ERROR "separate_arguments null-case failed: "
24     "nothing=[${nothing}]")
25 endif()