[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43263] trunk/blender/source/creator/ CMakeLists.txt: OSX: fix compiling Blender as MODULE

jens verwiebe info at jensverwiebe.de
Tue Jan 10 17:47:27 CET 2012


Revision: 43263
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43263
Author:   jensverwiebe
Date:     2012-01-10 16:47:20 +0000 (Tue, 10 Jan 2012)
Log Message:
-----------
OSX: fix compiling Blender as MODULE

Modified Paths:
--------------
    trunk/blender/source/creator/CMakeLists.txt

Modified: trunk/blender/source/creator/CMakeLists.txt
===================================================================
--- trunk/blender/source/creator/CMakeLists.txt	2012-01-10 16:30:16 UTC (rev 43262)
+++ trunk/blender/source/creator/CMakeLists.txt	2012-01-10 16:47:20 UTC (rev 43263)
@@ -165,25 +165,39 @@
 	add_definitions(-DWITH_PYTHON_MODULE)
 
 	# creates ./bin/bpy.so which can be imported as a python module.
-	add_library(blender SHARED ${SRC})
-	set_target_properties(
-		blender
-		PROPERTIES
-			PREFIX ""
-			OUTPUT_NAME bpy
-			LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
-			RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin  # only needed on windows
-	)
+	if(APPLE)
+		add_library(blender MODULE ${SRC})
+		set_target_properties(
+			blender
+			PROPERTIES
+				PREFIX ""
+				OUTPUT_NAME bpy
+				LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
+				RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin  # only needed on windows
+		)
+		TARGET_LINK_LIBRARIES(blender -Wl,-undefined -Wl,dynamic_lookup)
 
-	if(WIN32)
-		# python modules use this
+	else(APPLE)
+		add_library(blender SHARED ${SRC})
 		set_target_properties(
 			blender
 			PROPERTIES
-			SUFFIX ".pyd"
+				PREFIX ""
+				OUTPUT_NAME bpy
+				LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
+				RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin  # only needed on windows
 		)
-	endif()
 
+		if(WIN32)
+			# python modules use this
+			set_target_properties(
+				blender
+				PROPERTIES
+				SUFFIX ".pyd"
+			)
+		endif()
+	endif(APPLE)
+
 else()
 	add_executable(blender ${EXETYPE} ${SRC})
 endif()



More information about the Bf-blender-cvs mailing list