When generating makefiles cmake shall escape resp. shell meta characters also for compiler options (CMAKE_<lang>_FLAGS)
While cmake is escaping resp. SHELL meta character in defines and include paths it does not the same for compiler or linker options defined in CMAKE_<lang>_FLAGS
or provided by other configuration means. There is also another ticket #17025 pointing out to this problem even though in some other context.
And one more remark regarding how to provide options using CMAKE_<lang>_FLAGS
: CMAKE_<lang>_FLAGS
expects options to be defined as a string and does not accepts options provided as a cmake list. This seems to be inconsistent with regard of how compiler defines and include paths are defined and might be a reason why shell meta character escaping is missing for compiler options (as for defines and include paths meta character escaping is done while composing the string from list elements).