CMake/Tests/CustomCommand/compare_options.cmake
Ed Branch 7c8ab7ddc8 add_custom_{command,target}: Add COMMAND_EXPAND_LISTS option
This option allows lists generated by generator expressions to be expanded.

Closes: #15935
2017-01-13 20:02:16 -06: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()