Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnkit Meel <ankitjmeel@gmail.com>2021-03-29 19:55:13 +0300
committerAnkit Meel <ankitjmeel@gmail.com>2021-03-29 19:55:13 +0300
commit241f05d53c32323c6d4bb8b179b87ec62b5f3a57 (patch)
treef3190095d92270a5061ced0fd103bda4bf920df6 /source/creator
parent77ac67dae4bcbcd861b1ab15aa22fab769bb0e0c (diff)
macOS/bpy: accommodate portable builds, and multi-config generators.
Old code's `install` step did not guarantee that all script files will be copied from source folder to build folder _before_ copying from build folder to site-packages. That caused incomplete installation. Fixed by copying scripts etc., only once. Also match the behavior on Linux: install to site-packages only if `WITH_INSTALL_PORTABLE` is OFF. Also fix install and launch issues with Xcode.
Diffstat (limited to 'source/creator')
-rw-r--r--source/creator/CMakeLists.txt28
1 files changed, 15 insertions, 13 deletions
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 43533d55f55..d9064682203 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -326,7 +326,14 @@ elseif(WIN32)
elseif(APPLE)
if(WITH_PYTHON_MODULE)
- set(TARGETDIR_VER ${BLENDER_VERSION})
+ if(WITH_INSTALL_PORTABLE)
+ 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}")
+ set(INSTALL_BPY_TO_SITE_PACKAGES ON)
+ endif()
else()
set(TARGETDIR_VER Blender.app/Contents/Resources/${BLENDER_VERSION})
endif()
@@ -1007,8 +1014,6 @@ elseif(APPLE)
)
if(WITH_PYTHON_MODULE)
# Move the dylib in a Blender version folder to keep the corresponding OpenMP version.
- # Also for easy copying of a single folder, `TARGETDIR_VER` to site-packages
- # during installation.
install(
DIRECTORY ${CMAKE_BINARY_DIR}/Resources/lib
DESTINATION ${TARGETDIR_VER}
@@ -1018,9 +1023,7 @@ elseif(APPLE)
# Change it to support multiple rpaths.
COMMAND xcrun install_name_tool -change "@executable_path/../Resources/lib/libomp.dylib" "@rpath/libomp.dylib" "$<TARGET_FILE:blender>"
# For installation into site-packages.
- COMMAND xcrun install_name_tool -add_rpath "@loader_path/../Resources/${TARGETDIR_VER}/lib" "$<TARGET_FILE:blender>"
- # For in-build-folder experiments.
- COMMAND xcrun install_name_tool -add_rpath "@loader_path/${TARGETDIR_VER}/lib" "$<TARGET_FILE:blender>"
+ COMMAND xcrun install_name_tool -add_rpath "@loader_path/../Resources/${BLENDER_VERSION}/lib" "$<TARGET_FILE:blender>"
)
endif()
endif()
@@ -1055,13 +1058,12 @@ elseif(APPLE)
unset(_py_inc_suffix)
endif()
if(WITH_PYTHON_MODULE)
- install(
- TARGETS blender
- LIBRARY DESTINATION ${PYTHON_LIBPATH}/site-packages
- )
- install_dir(
- ${CMAKE_INSTALL_PREFIX}/${TARGETDIR_VER}
- ${PYTHON_LIBPATH}/Resources)
+ if(INSTALL_BPY_TO_SITE_PACKAGES)
+ install(
+ TARGETS blender
+ LIBRARY DESTINATION ${PYTHON_LIBPATH}/site-packages
+ )
+ endif()
endif()
if(WITH_DRACO)