mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 21:31:08 -06:00
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
20 lines
385 B
CMake
20 lines
385 B
CMake
include(CTest)
|
|
|
|
|
|
set(cmp_args "1ARG=COMMAND_EXPAND_LISTS" "2ARG=test" "3ARG=outfile"
|
|
"4ARG=content")
|
|
set(AARGS "")
|
|
foreach(arg IN LISTS cmp_args)
|
|
list(APPEND AARGS "-DA${arg}")
|
|
endforeach()
|
|
|
|
|
|
|
|
add_test(
|
|
NAME CommandExpandList
|
|
COMMAND ${CMAKE_COMMAND} ${AARGS} -V
|
|
"-DB$<JOIN:${cmp_args},;-DB>"
|
|
"-P" "${CMAKE_CURRENT_LIST_DIR}/compare_options.cmake"
|
|
COMMAND_EXPAND_LISTS
|
|
)
|