What’s the correct syntax for using a function argument as a conditional operator in a generator expression? The example below encapsulates what I’m trying to achieve, but the syntax here doesn’t work, and neither do various different (and less readable) versions that I’ve tried:
function(set_SWIG_flags)
set (prefix SWIGLIB)
set (noValues PY2 PY3)
cmake_parse_arguments(${prefix} "${noValues}" "${singleValues}" "${multiValues}" ${ARGN})
set(CMAKE_SWIG_FLAGS -c++
-builtin
$<SWIGLIB_PY2:-classic>
PARENT_SCOPE)
endfunction()
I’m sure this must be possible, but I’d appreciate a push in the right direction.