[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43271] trunk/blender: when building blender as a py module use add_library(...

Campbell Barton ideasman42 at gmail.com
Wed Jan 11 01:09:53 CET 2012


Revision: 43271
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43271
Author:   campbellbarton
Date:     2012-01-11 00:09:46 +0000 (Wed, 11 Jan 2012)
Log Message:
-----------
when building blender as a py module use add_library(... MODULE on all systems, was SHARED on linux/windows.

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

Modified: trunk/blender/build_files/cmake/RpmBuild.cmake
===================================================================
--- trunk/blender/build_files/cmake/RpmBuild.cmake	2012-01-10 23:14:20 UTC (rev 43270)
+++ trunk/blender/build_files/cmake/RpmBuild.cmake	2012-01-11 00:09:46 UTC (rev 43271)
@@ -13,7 +13,7 @@
 
 	if(RPMBUILD)
 		message(STATUS "RPM Build Found: ${RPMBUILD}")
-	else(RPMBUILD) 
+	else() 
 		message(STATUS "RPM Build Not Found (rpmbuild). RPM generation will not be available")
 	endif()
 
@@ -21,6 +21,6 @@
 
 if(RPMBUILD)
 	set(RPMBUILD_FOUND TRUE)
-else(RPMBUILD) 
+else() 
 	set(RPMBUILD_FOUND FALSE)
 endif()
\ No newline at end of file

Modified: trunk/blender/source/creator/CMakeLists.txt
===================================================================
--- trunk/blender/source/creator/CMakeLists.txt	2012-01-10 23:14:20 UTC (rev 43270)
+++ trunk/blender/source/creator/CMakeLists.txt	2012-01-11 00:09:46 UTC (rev 43271)
@@ -165,37 +165,28 @@
 	add_definitions(-DWITH_PYTHON_MODULE)
 
 	# creates ./bin/bpy.so which can be imported as a python module.
-	if(APPLE)
-		add_library(blender MODULE ${SRC})
-		set_target_properties(
-			blender
-			PROPERTIES
-				PREFIX ""
-				OUTPUT_NAME bpy
-				LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
-		)
+	#
+	# note that 'SHARED' works on Linux and Windows,
+	# but not OSX which _must_ be 'MODULE'
+	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
+	)
 
-	else(APPLE)
-		add_library(blender SHARED ${SRC})
+	if(WIN32)
+		# python modules use this
 		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
+			SUFFIX ".pyd"
 		)
+	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