I´m trying to compile some C++ code with cmake and make that uses the include
and get the following make error:
#error \"SSE2
You need to call
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "-msse -msse2 -msse3")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse -msse2 -msse3")
The CMAKE_C_FLAGS
are applied to C files, and from your post's C++ tag, I guess you're compiling C++ files, hence the need to change CMAKE_CXX_FLAGS
instead.
As for the positioning of the quotation marks; in your original version, you were setting CMAKE_C_FLAGS
to contain 2 separate entries, the first being the starting value of CMAKE_C_FLAGS
and the second being the string "-msse -msse2 -msse3"
.
CMake holds lists like this as semi-colon separated entries. In the case of CMAKE_<lang>_FLAGS
, invariably they are a single value comprised of a string containing all the required flags.