From 71545e542c5b14351a0addf713234cf87a39a5c3 Mon Sep 17 00:00:00 2001 From: Ankit Meel Date: Thu, 17 Feb 2022 01:28:10 +0530 Subject: 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 --- source/creator/CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 $/../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() -- cgit v1.2.3