[Bf-blender-cvs] [3030e2d] master: CMake: tweak recent py module changes

Campbell Barton noreply at git.blender.org
Tue Mar 24 09:10:47 CET 2015


Commit: 3030e2d1cb1aaec554a409e44170b890d073c661
Author: Campbell Barton
Date:   Tue Mar 24 19:09:51 2015 +1100
Branches: master
https://developer.blender.org/rB3030e2d1cb1aaec554a409e44170b890d073c661

CMake: tweak recent py module changes

support installing portable builds to CMAKE_INSTALL_PREFIX

===================================================================

M	CMakeLists.txt
M	source/creator/CMakeLists.txt

===================================================================

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 100d00b..2ce183e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -201,7 +201,7 @@ set(WITH_PYTHON_SECURITY ON CACHE BOOL "ON" FORCE) # temp force on.
 
 option(WITH_PYTHON_SAFETY "Enable internal API error checking to track invalid data to prevent crash on access (at the expense of some effeciency, only enable for development)." OFF)
 mark_as_advanced(WITH_PYTHON_SAFETY)
-option(WITH_PYTHON_MODULE "Enable building as a python module which runs without a user interface, like running regular blender in background mode (experimental, only enable for development), installs to PYTHON_SITE_PACKAGES" OFF)
+option(WITH_PYTHON_MODULE "Enable building as a python module which runs without a user interface, like running regular blender in background mode (experimental, only enable for development), installs to PYTHON_SITE_PACKAGES (or CMAKE_INSTALL_PREFIX if WITH_INSTALL_PORTABLE is enabled)." OFF)
 if(APPLE)
 	option(WITH_PYTHON_FRAMEWORK "Enable building using the Python available in the framework (OSX only)" OFF)
 endif()
@@ -617,8 +617,6 @@ endif()
 # may as well build python module without a UI
 if(WITH_PYTHON_MODULE)
 	set(WITH_HEADLESS ON)
-	# building as a Python module wont use /usr/shared
-	set(WITH_INSTALL_PORTABLE ON)
 endif()
 
 if(NOT WITH_PYTHON)
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index b9044e6..193737e 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -262,7 +262,11 @@ endif()
 
 if(UNIX AND NOT APPLE)
 	if(WITH_PYTHON_MODULE)
-		set(TARGETDIR_VER ${PYTHON_SITE_PACKAGES}/${BLENDER_VERSION})
+		if(WITH_INSTALL_PORTABLE)
+			set(TARGETDIR_VER ${BLENDER_VERSION})
+		else()
+			set(TARGETDIR_VER ${PYTHON_SITE_PACKAGES}/${BLENDER_VERSION})
+		endif()
 	else()
 		if(WITH_INSTALL_PORTABLE)
 			set(TARGETDIR_VER ${BLENDER_VERSION})
@@ -408,10 +412,17 @@ if(UNIX AND NOT APPLE)
 
 	# there are a few differences between portable and system install
 	if(WITH_PYTHON_MODULE)
-		install(
-			TARGETS blender
-			LIBRARY DESTINATION ${PYTHON_SITE_PACKAGES}
-		)
+		if(WITH_INSTALL_PORTABLE)
+			install(
+				TARGETS blender
+				DESTINATION "."
+			)
+		else()
+			install(
+				TARGETS blender
+				LIBRARY DESTINATION ${PYTHON_SITE_PACKAGES}
+			)
+		endif()
 		# none of the other files are needed currently
 	elseif(WITH_INSTALL_PORTABLE)
 		install(




More information about the Bf-blender-cvs mailing list