Browse Source

Fix the VC10 multiple link target issue.

Peter C 13 years ago
parent
commit
42c87f5913
1 changed files with 11 additions and 0 deletions
  1. 11 0
      Build/CMakeLists.txt

+ 11 - 0
Build/CMakeLists.txt

@@ -52,6 +52,17 @@ if(NOT BUILD_SHARED_LIBS)
     add_definitions(-DSTATIC_LIB)
     add_definitions(-DSTATIC_LIB)
 endif()
 endif()
 
 
+#on windows, check for VC10 and fix the multiple compile target issue.
+IF(WIN32)
+  if(MSVC)
+    if(${MSVC_VERSION} STREQUAL 1600 OR ${MSVC_VERSION} STRGREATER 1600)
+      message("Visual Studio 2010 (${MSVC_VERSION}) build fix at play (/FORCE:MULTIPLE)")
+      set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /FORCE:MULTIPLE")
+    endif()
+  endif() 
+ENDIF(WIN32)
+
+
 #===================================
 #===================================
 # Find dependencies ================
 # Find dependencies ================
 #===================================
 #===================================