source: trunk/tmdmcreator/build/cmake/Use_visualstudioMT.cmake @ 30

Revision 29, 1.6 KB checked in by lucsch, 12 years ago (diff)

Updating build script for Windows

Line 
1# CMAKE BUILD FILE FOR USING
2# MT Library (compatibility with < WinXP
3# (c) LUCIEN SCHREIBER CREALP 2007
4# partial work from mysql cmakefile
5
6SET (USE_MT_LIBRARY CACHE BOOL "Should we use the MT option for building, use it if lib were build with the MT option")
7
8IF (USE_MT_LIBRARY)
9        # replace /MDd with /MTd
10    STRING(REPLACE "/MD"  "/MT"  CMAKE_C_FLAGS_RELEASE          ${CMAKE_C_FLAGS_RELEASE})
11    STRING(REPLACE "/MD"  "/MT"  CMAKE_C_FLAGS_RELWITHDEBINFO   ${CMAKE_C_FLAGS_RELWITHDEBINFO})
12    STRING(REPLACE "/MDd" "/MTd" CMAKE_C_FLAGS_DEBUG            ${CMAKE_C_FLAGS_DEBUG})
13    STRING(REPLACE "/MDd" "/MTd" CMAKE_C_FLAGS_DEBUG_INIT       ${CMAKE_C_FLAGS_DEBUG_INIT})
14
15    STRING(REPLACE "/MD"  "/MT"  CMAKE_CXX_FLAGS_RELEASE        ${CMAKE_CXX_FLAGS_RELEASE})
16    STRING(REPLACE "/MD"  "/MT"  CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
17    STRING(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG          ${CMAKE_CXX_FLAGS_DEBUG})
18    STRING(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG_INIT     ${CMAKE_CXX_FLAGS_DEBUG_INIT})
19
20    # adding multi-core support
21    SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
22   
23    # Disable automatic manifest generation.
24    STRING(REPLACE "/MANIFEST" "/MANIFEST:NO" CMAKE_EXE_LINKER_FLAGS
25           ${CMAKE_EXE_LINKER_FLAGS})
26    # Explicitly disable it since it is the default for newer versions of VS
27    STRING(REGEX MATCH "MANIFEST:NO" tmp_manifest ${CMAKE_EXE_LINKER_FLAGS})
28    IF(NOT tmp_manifest)
29        SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
30    ENDIF(NOT tmp_manifest)
31
32ENDIF (USE_MT_LIBRARY)
Note: See TracBrowser for help on using the repository browser.