[CMake] visual studio compiler option not being set

Jon W knowdat at gmail.com
Fri Jun 8 16:56:47 EDT 2007


I'm just beginning to learn cmake, and am trying to add the "/EHac-"
option to the additional command line options.

I'm setting the CMAKE_C_FLAGS as follows:
---------------------------------------------------------
SET (MY_C_FLAGS "/EHac-")
MARK_AS_ADVANCED (MY_C_FLAGS)

SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MY_C_FLAGS}" CACHE STRING
"Resetting the default compiler options." FORCE)
---------------------------------------------------------

The CMakeCache.txt has the proper options:
CMAKE_C_FLAGS:STRING= /DWIN32 /D_WINDOWS /W3 /Zm1000 /EHac-

However, the generated vcproj file looks as follows (note that EHac-
is just c-):
AdditionalOptions=" /DWIN32 /D_WINDOWS  /Zm1000 c-    /D NDEBUG

Any idea what I'm doing wrong, or is this possibly a bug?

Does anybody know of cmake examples that use precompiled headers,
special visual studio compiler options, etc..?

Thanks,
Jon


More information about the CMake mailing list