[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43433] trunk/blender/CMakeLists.txt: OSX/ Cmake: make bpy module work finally by linking against python3.2 framework

jens verwiebe info at jensverwiebe.de
Mon Jan 16 21:10:41 CET 2012


Revision: 43433
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43433
Author:   jensverwiebe
Date:     2012-01-16 20:10:38 +0000 (Mon, 16 Jan 2012)
Log Message:
-----------
OSX/Cmake: make bpy module work finally by linking against python3.2 framework

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

Modified: trunk/blender/CMakeLists.txt
===================================================================
--- trunk/blender/CMakeLists.txt	2012-01-16 20:00:53 UTC (rev 43432)
+++ trunk/blender/CMakeLists.txt	2012-01-16 20:10:38 UTC (rev 43433)
@@ -1092,16 +1092,28 @@
 	endif()
 
 	if(WITH_PYTHON)
-		# we use precompiled libraries for py 3.2 and up by default
+		if(NOT WITH_PYTHON_MODULE)
+			# we use precompiled libraries for py 3.2 and up by default
 
-		# normally cached but not since we include them with blender
-		set(PYTHON_VERSION 3.2)
-		set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}")
-		# set(PYTHON_BINARY "${LIBDIR}/python/bin/python${PYTHON_VERSION}") # not used yet
-		set(PYTHON_LIBRARY python${PYTHON_VERSION})
-		set(PYTHON_LIBPATH "${LIBDIR}/python/lib/python${PYTHON_VERSION}")
-		# set(PYTHON_LINKFLAGS "-u _PyMac_Error")  # won't  build with this enabled
+			# normally cached but not since we include them with blender
+			set(PYTHON_VERSION 3.2)
+			set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}")
+			# set(PYTHON_BINARY "${LIBDIR}/python/bin/python${PYTHON_VERSION}") # not used yet
+			set(PYTHON_LIBRARY python${PYTHON_VERSION})
+			set(PYTHON_LIBPATH "${LIBDIR}/python/lib/python${PYTHON_VERSION}")
+			# set(PYTHON_LINKFLAGS "-u _PyMac_Error")  # won't  build with this enabled
+		else()
+			# module must be compiled against Python framework
 
+			# normally cached but not since we include them with blender
+			set(PYTHON_VERSION 3.2)
+			set(PYTHON_INCLUDE_DIR "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/include/python${PYTHON_VERSION}m")
+			set(PYTHON_BINARY "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/bin/python${PYTHON_VERSION}")
+			#set(PYTHON_LIBRARY python${PYTHON_VERSION})
+			set(PYTHON_LIBPATH "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config-3.2m")
+			#set(PYTHON_LINKFLAGS "-u _PyMac_Error -framework Python")  # won't  build with this enabled
+		endif()
+		
 		# uncached vars
 		set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
 		set(PYTHON_LIBRARIES  "${PYTHON_LIBRARY}")
@@ -1196,7 +1208,11 @@
 		set(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime")
 		set(WITH_INPUT_NDOF OFF)  # unsupported
 	endif()
-
+	
+	if(WITH_PYTHON_MODULE)
+		set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/python")# force cmake to link right framework
+	endif()
+	
 	if(WITH_OPENCOLLADA)
 		set(OPENCOLLADA ${LIBDIR}/opencollada)
 



More information about the Bf-blender-cvs mailing list