[Bf-blender-cvs] [71545e542c5] master: macOS/bpy module: install scripts relative to bpy.so

Ankit Meel noreply at git.blender.org
Wed Feb 16 21:03:30 CET 2022


Commit: 71545e542c5b14351a0addf713234cf87a39a5c3
Author: Ankit Meel
Date:   Thu Feb 17 01:28:10 2022 +0530
Branches: master
https://developer.blender.org/rB71545e542c5b14351a0addf713234cf87a39a5c3

macOS/bpy module: install scripts relative to bpy.so

Brew's Python framework's site-packages is a symlink so the assumption
that Resources and site-packages would be in the same directory
doesn't hold. So install scripts etc relative to bpy.so. Part of D14111

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

M	source/creator/CMakeLists.txt

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

diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index e6e122508a9..6a1d5b78611 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -319,11 +319,16 @@ elseif(WIN32)
 elseif(APPLE)
   if(WITH_PYTHON_MODULE)
     if(WITH_INSTALL_PORTABLE)
+      set(BPY_INSTALL_DIR)
       set(TARGETDIR_VER $<TARGET_FILE_DIR:blender>/../Resources/${BLENDER_VERSION})
       # Keep the `BLENDER_VERSION` folder and bpy.so in the build folder.
       set(INSTALL_BPY_TO_SITE_PACKAGES OFF)
     else()
-      set(TARGETDIR_VER "${PYTHON_LIBPATH}/Resources/${BLENDER_VERSION}")
+      # Parent directory of bpy.so for installation.
+      set(BPY_INSTALL_DIR ${PYTHON_LIBPATH}/site-packages)
+      # Defined in terms of site-packages since the site-packages
+      # directory can be a symlink (brew for example).
+      set(TARGETDIR_VER "${BPY_INSTALL_DIR}/../Resources/${BLENDER_VERSION}")
       set(INSTALL_BPY_TO_SITE_PACKAGES ON)
     endif()
   else()
@@ -1108,11 +1113,12 @@ elseif(APPLE)
     )
     unset(_py_inc_suffix)
   endif()
+
   if(WITH_PYTHON_MODULE)
     if(INSTALL_BPY_TO_SITE_PACKAGES)
       install(
         TARGETS blender
-        LIBRARY DESTINATION ${PYTHON_LIBPATH}/site-packages
+        LIBRARY DESTINATION ${BPY_INSTALL_DIR}
       )
     endif()
   endif()



More information about the Bf-blender-cvs mailing list