What is wrong with this:
if(CMAKE_COMPILER_IS_GNUCXX OR MINGW OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
add_compile_options("$<$<CONFIG:RELEASE>:-W -Wall -O3 -pedantic>")
add_compile_options("$<$<CONFIG:DEBUG>:-W -Wall -O0 -g -pedantic>")
endif()
I get:
g++: error: unrecognized command line option ‘-W -Wall -O3 -pedantic’
If I put it like this it works:
if(CMAKE_COMPILER_IS_GNUCXX OR MINGW OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
add_compile_options("$<$<CONFIG:RELEASE>:-W>")
add_compile_options("$<$<CONFIG:RELEASE>:-Wall>")
add_compile_options("$<$<CONFIG:RELEASE>:-O3>")
add_compile_options("$<$<CONFIG:RELEASE>:-pedantic>")
add_compile_options("$<$<CONFIG:DEBUG>:-W>")
add_compile_options("$<$<CONFIG:DEBUG>:-Wall>")
add_compile_options("$<$<CONFIG:DEBUG>:-g>")
add_compile_options("$<$<CONFIG:DEBUG>:-O0>")
add_compile_options("$<$<CONFIG:DEBUG>:-pedantic>")
endif()
...but I guess that's not intended to be like that...