14 lines
498 B
CMake
Raw Normal View History

2017-07-20 19:35:53 +02:00
set(unix_cmd "a \"b c\" 'd e' \";\" \\ \\'\\\" '\\'' \"\\\"\"")
set(unix_exp "a;b c;d e;\;; '\";';\"")
separate_arguments(unix_out UNIX_COMMAND "${unix_cmd}")
if(NOT "${unix_out}" STREQUAL "${unix_exp}")
message(FATAL_ERROR "separate_arguments unix-style failed. "
"Expected\n [${unix_exp}]\nbut got\n [${unix_out}]\n")
endif()
2021-09-14 00:13:48 +02:00
separate_arguments(empty_out UNIX_COMMAND)
if(NOT empty_out STREQUAL "")
message(FATAL_ERROR "separate_arguments unix-style failed on no arguments")
endif()