[CMake] adding to CMAKE_CXX_FLAGS

philrosenberg philip_rosenberg at yahoo.com
Fri Aug 31 12:32:32 EDT 2012


Hi
This is my first post to the CMAKE mailing list and I'm a complete CMAKe
beginner so please go easy on me.

I'm trying to compile a library using visual studio that uses CMAKe as its
build system and want to add some extra command line options to the
compilation. Specifically /MT to link statically and /D UNICODE to compile
with unicode support. I'd really like to do this at the command line as it's
a third party library and i don't want to modify the project's CMAKE code if
i can help it.

I've spent a long time googling for solutions and the best I've found is to 
add -DCMAKE_CXX_FLAGS="/MT /D UNICODE" when I execute CMAKE. Unfortunately
this seems to overwrite the 'normal' command line options so things like
WIN32 don't get defined.

Is there a better way to pass these options to these options to my compiler?

Thanks in advance

Phil



--
View this message in context: http://cmake.3232098.n2.nabble.com/adding-to-CMAKE-CXX-FLAGS-tp7581457.html
Sent from the CMake mailing list archive at Nabble.com.


More information about the CMake mailing list