diff options
author | Ankit Meel <ankitjmeel@gmail.com> | 2022-02-16 22:58:10 +0300 |
---|---|---|
committer | Ankit Meel <ankitjmeel@gmail.com> | 2022-02-16 23:01:03 +0300 |
commit | 71545e542c5b14351a0addf713234cf87a39a5c3 (patch) | |
tree | 87fc469e7440bd263d3e0945a919d93162a25644 /source/creator/CMakeLists.txt | |
parent | 57013e2a44e974d307f08f41793d810a49537f96 (diff) |
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
Diffstat (limited to 'source/creator/CMakeLists.txt')
-rw-r--r-- | source/creator/CMakeLists.txt | 10 |
1 files 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 $<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() |