CMake incorrectly identifying valid C++ compiler options?
问题 I have a set of C++ potential compiler flags stored in a variable and over it, I'm running the following test on CMake 3.14.5 , to see which ones applies and which doesn't to a certain version of the compiler (I'm using GCC , CLANG and ICC to compile the same project, hence the necessity to apply to each only the relevant flags): foreach (FLAG IN LISTS CXX_COMPILER_FLAGS_TO_USE) # Check if the compiler supports the flag. string(REGEX REPLACE "[-=+]" "" FLAG_NO_SIGNS ${FLAG}) # <- The variable