Add support of list of values for COMPILE_LANGUAGE and/or COMPILE_LANG_AND_ID generator expressions.
I would like to add compile options for different languages/compilers within the same add_compiler_options command. I found that COMPILE_LANGUAGE and COMPILE_LANG_AND_ID don't support more then 1 value to expand. check next sample.
add_compile_options(
$<$<COMPILE_LANGUAGE:CXX>:
-Wno-deprecated-declarations;
-Wall
$<$<CONFIG:Release>:
-O3
>
$<$<CONFIG:Debug>:
-g
>
>
$<$<COMPILE_LANGUAGE:Fortran>:
-assume nounderscore
>
)
Result is errors like
g++: error: $<1:-Wno-deprecated-declarations: No such file or directory
g++: error: unrecognized command line option ‘-Wall>’; did you mean ‘-Wall’?
for Config lists are supported. It would be great to add things with same manner and get rid of using variables CMAKE_<LANG>_FLAGS
as workaround.
I'm on CMake 3.18.4