Files
CMake/Tests/RunCMake/CTestCommandExpandLists/compare_options.cmake
Sergey Bobrenok e791ffac61 add_test: Add COMMAND_EXPAND_LISTS option
Add a `COMMAND_EXPAND_LISTS` option to the `add_test` command to cause
`;`-separated lists produced by generator expressions to be expanded
into multiple arguments.  The `add_custom_command` command already
has such an option.

Fixes: #17284
2019-06-07 13:14:29 -04:00

15 lines
372 B
CMake

set(range 1 2 3 4 5 6 7 8 9 10)
set(aargs "")
set(bargs "")
foreach(n IN LISTS range)
set(aval "${A${n}ARG}")
set(bval "${B${n}ARG}")
if(aval OR bval)
list(APPEND aargs "\"${aval}\"")
list(APPEND bargs "\"${bval}\"")
endif()
endforeach()
if(NOT "${aargs}" STREQUAL "${bargs}")
message(FATAL_ERROR "COMPARE_OPTIONS: \n\t${aargs} != \n\t${bargs}")
endif()