cmake: apply patch to link with correct python library in win32 debug mode.
authorBenoit Bolsee <benoit.bolsee@online.be>
Mon, 18 May 2009 07:53:13 +0000 (07:53 +0000)
committerBenoit Bolsee <benoit.bolsee@online.be>
Mon, 18 May 2009 07:53:13 +0000 (07:53 +0000)
CMake/macros.cmake

index 95799a2c1fdbc1189e3829dbdb53c4610ddf05e6..e4ba662eefb9c3da73594bef4d31d7765c9ae800 100644 (file)
@@ -59,7 +59,24 @@ ENDMACRO(SETUP_LIBDIRS)
 MACRO(SETUP_LIBLINKS
   target)
   SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS} ")
-  TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LIB} ${PYTHON_LINKFLAGS} ${JPEG_LIB} ${PNG_LIB} ${ZLIB_LIB} ${SDL_LIB} ${LLIBS})
+  #TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LIB} ${PYTHON_LINKFLAGS} ${JPEG_LIB} ${PNG_LIB} ${ZLIB_LIB} ${SDL_LIB} ${LLIBS})
+
+  TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LINKFLAGS} ${JPEG_LIB} ${PNG_LIB} ${ZLIB_LIB} ${SDL_LIB} ${LLIBS})
+
+  # since we are using the local libs for python when compiling msvc projects, we need to add _d when compiling debug versions
+
+  IF(WIN32)
+
+            TARGET_LINK_LIBRARIES(${target} debug ${PYTHON_LIB}_d)
+
+            TARGET_LINK_LIBRARIES(${target} optimized ${PYTHON_LIB})
+
+  ELSE(WIN32)
+
+            TARGET_LINK_LIBRARIES(${target} ${PYTHON_LIB})
+
+  ENDIF(WIN32)
+
   IF(WITH_INTERNATIONAL)
     TARGET_LINK_LIBRARIES(${target} ${FREETYPE_LIB})
     TARGET_LINK_LIBRARIES(${target} ${GETTEXT_LIB})