COLLADA branch: merge from trunk -r 25745:26429.
[blender-staging.git] / CMake / macros.cmake
index de84b5f3372363b933bab623a8903c33de6b4a28..0accf960cff6559ddb28a75c77e94e7d691895ed 100644 (file)
@@ -135,15 +135,35 @@ MACRO(SETUP_LIBLINKS
     TARGET_LINK_LIBRARIES(${target} ${QUICKTIME_LIB})
   ENDIF(WITH_QUICKTIME)
   IF(WITH_OPENEXR)
-    TARGET_LINK_LIBRARIES(${target} ${OPENEXR_LIB})
+    IF(WIN32)
+      FOREACH(loop_var ${OPENEXR_LIB})
+        TARGET_LINK_LIBRARIES(${target} debug ${loop_var}_d)
+        TARGET_LINK_LIBRARIES(${target} optimized ${loop_var})
+      ENDFOREACH(loop_var)
+    ELSE(WIN32)
+      TARGET_LINK_LIBRARIES(${target} ${OPENEXR_LIB})
+    ENDIF(WIN32)
   ENDIF(WITH_OPENEXR)
   IF(WITH_FFMPEG)
     TARGET_LINK_LIBRARIES(${target} ${FFMPEG_LIB})
   ENDIF(WITH_FFMPEG)
   IF(WITH_OPENCOLLADA)
-    TARGET_LINK_LIBRARIES(${target} ${OPENCOLLADA_LIB})
-    TARGET_LINK_LIBRARIES(${target} ${PCRE_LIB})
-    TARGET_LINK_LIBRARIES(${target} ${EXPAT_LIB})
+    IF(WIN32)
+      FOREACH(loop_var ${OPENCOLLADA_LIB})
+        TARGET_LINK_LIBRARIES(${target} debug ${loop_var}_d)
+        TARGET_LINK_LIBRARIES(${target} optimized ${loop_var})
+      ENDFOREACH(loop_var)
+      TARGET_LINK_LIBRARIES(${target} debug ${PCRE_LIB}_d)
+      TARGET_LINK_LIBRARIES(${target} optimized ${PCRE_LIB})
+      IF(EXPAT_LIB)
+        TARGET_LINK_LIBRARIES(${target} debug ${EXPAT_LIB}_d)
+        TARGET_LINK_LIBRARIES(${target} optimized ${EXPAT_LIB})
+      ENDIF(EXPAT_LIB)
+    ELSE(WIN32)
+         TARGET_LINK_LIBRARIES(${target} ${OPENCOLLADA_LIB})
+      TARGET_LINK_LIBRARIES(${target} ${PCRE_LIB})
+      TARGET_LINK_LIBRARIES(${target} ${EXPAT_LIB})
+    ENDIF(WIN32)
   ENDIF(WITH_OPENCOLLADA)
   IF(WIN32)
     TARGET_LINK_LIBRARIES(${target} ${PTHREADS_LIB})