[CMake] set_target_properties - compile flags problem

"Sören Freudiger" muffmolch at gmx.de
Sat Nov 21 05:33:55 EST 2009


Hello
I'm in big trouble. I cannot change the cxx compile flags as I want.

binary project for VS 2008 - example:
...
ADD_EXECUTABLE( project ${source_files} )
SET_TARGET_PROPERTIES(project PROPERTIES COMPILE_FLAGS_DEBUG   "/MTd")
SET_TARGET_PROPERTIES(project PROPERTIES COMPILE_FLAGS_RELEASE "/MT")
-> the resulting flag in my project is still /MD for ALL configrations

changing the flag like:
ADD_EXECUTABLE( project ${source_files} )
SET_TARGET_PROPERTIES(project PROPERTIES COMPILE_FLAGS "/MT")
-> leads to /MT in my project file for ALL configurations

but this would be only a sucking workaround and I really need to have:
/MT for release and /MTd for debug

I also tried this one:
ADD_EXECUTABLE( project ${source_files} )
SET_TARGET_PROPERTIES(project PROPERTIES COMPILE_FLAGS "/MT")
SET_TARGET_PROPERTIES(serial PROPERTIES COMPILE_FLAGS_DEBUG   "/MTd")
SET_TARGET_PROPERTIES(serial PROPERTIES COMPILE_FLAGS_RELEASE "/MT")
-> still all configs have /MT only

I think the problem is the predefined CXX_FLAG of CMake "/MD"
Adding "/MT" overwrites the "/MD" but adding different flags for other configurations doesn't has any effects.

What can I do? Any clue?

Best,
SirAnn

     

-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01


More information about the CMake mailing list