Thank you for your answer, this solution looks really nice.

I tried this command to change the MT switch, but it doesn't work:

  SET (
    CMAKE_CXX_FLAGS_RELEASE
      "/RuntimeLibrary:MT ${CMAKE_CXX_FLAGS_RELEASE}"
  )

Do I really need your macro or do I need a development version of CMake to make 
this work? Do I need to patch and recompile CMake to use this solution? Will 
these changes be included in future CMake versions?

_______________________________________________

Frédéric Sagnes, A&D AS RD DH K3 Siemens AG Karlsruhe

-----Ursprüngliche Nachricht-----
Von: Sylvain Benner [mailto:[EMAIL PROTECTED] 
Gesendet: Dienstag, 18. Juli 2006 12:11
An: Sagnes, Frederic; [email protected]
Betreff: Re: [CMake] Selecting runtime library on Visual Studio projects

Hi,

I think you can't override a flag in the current version of CMake (release 
or CVS) because the loop that parses the flag string do not provide this.
I changed this function in order to override easily the flags in the low 
level configuration files.

I attached the modified flag table for compiler and the modified function 
that loop on this table
Note that there are imaginery flags that do not exist in VS. With these 
imaginery flags we can set the default options without forcing them in the 
code.
There are also some flags for VS2005 (especially for exception handling).

With this code you can override a flag with this macro :

MACRO(ADD_FLAG where flag)

SET(${where} "${flag} ${${where}}")

ENDMACRO(ADD_FLAG)



// example : override a subsystem flag

ADD_FLAG(CMAKE_EXE_LINKER_FLAGS /SUBSYSTEM:CONSOLE)
_______________________________________________
CMake mailing list
[email protected]
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to