[CMake] multithreaded runtime libraries with VS7

William A. Hoffman billlist at nycap.rr.com
Tue Jan 25 11:26:16 EST 2005


Actually, the VS7 2003 generator uses multithread by default.
That can be changed if you set CMAKE_CXX_FLAGS.  But the default
has never been /MT.   

Here are the defaults:
  IF(CMAKE_USING_VC_FREE_TOOLS)
    MESSAGE(STATUS "Using FREE VC TOOLS, NO DEBUG available")
    SET(CMAKE_BUILD_TYPE_INIT Release)
    SET (CMAKE_CXX_FLAGS_INIT "/W3 /Zm1000 /GX /GR")
    SET (CMAKE_CXX_FLAGS_DEBUG_INIT "/MTd /Zi /Od /GZ")
    SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "/MT /O1")
    SET (CMAKE_CXX_FLAGS_RELEASE_INIT "/MT /O2")
    SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "/MT /Zi /O2")
    SET (CMAKE_C_FLAGS_INIT "/W3 /Zm1000 /GX /GR")
    SET (CMAKE_C_FLAGS_DEBUG_INIT "/MTd /Zi /Od /GZ")
    SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "/MT /O1")
    SET (CMAKE_C_FLAGS_RELEASE_INIT "/MT /O2")
    SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MT /Zi /O2")
  ELSE(CMAKE_USING_VC_FREE_TOOLS)
    SET(CMAKE_BUILD_TYPE_INIT Debug)
    SET (CMAKE_CXX_FLAGS_INIT "/W3 /Zm1000 /GX /GR")
    SET (CMAKE_CXX_FLAGS_DEBUG_INIT "/MDd /Zi /Od /GZ")
    SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "/MD /O1 /D NDEBUG")
    SET (CMAKE_CXX_FLAGS_RELEASE_INIT "/MD /O2 /D NDEBUG")
    SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /D NDEBUG")
    SET (CMAKE_C_FLAGS_INIT "/W3 /Zm1000")
    SET (CMAKE_C_FLAGS_DEBUG_INIT "/MDd /Zi /Od /GZ")
    SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "/MD /O1 /D NDEBUG")
    SET (CMAKE_C_FLAGS_RELEASE_INIT "/MD /O2 /D NDEBUG")
    SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /D NDEBUG")

There is no /ML or /MLd to specify single threaded libraries.


-Bill



At 08:03 AM 1/25/2005, Brad King wrote:
>Marco Petrone wrote:
>>Dear All, I'm using CMake to generate projects for VS6 and VS7 for compiling our software, and what I noticed today is the VS7 2003 generator is using by default the single threaded runtme libraries, while VS6 one was using multithreaded ones. Is there a way to force this code generation option?
>
>Please submit this difference to the bug tracker:
>
>http://www.cmake.org/Bug
>
>so we don't forget about it.
>
>In CMakeSetup turn on advanced cache values and look at the flags in CMAKE_CXX_FLAGS, CMAKE_CXX_FLAGS_DEBUG, and CMAKE_CXX_FLAGS_RELEASE (similarly for CMAKE_C_* variables).  These are the VC++ flags that control this link.  There may also be some CMAKE_*LINK* flags too.
>
>-Brad
>_______________________________________________
>CMake mailing list
>CMake at www.cmake.org
>http://www.cmake.org/mailman/listinfo/cmake



More information about the CMake mailing list