[Bf-blender-cvs] [f420ef6e61b] tmp_libupdate_34: Fix Python module build for Linux/macOS
Brecht Van Lommel
noreply at git.blender.org
Wed Aug 17 16:52:54 CEST 2022
Commit: f420ef6e61b0ae7f894e1e96a0506482e95c8a3e
Author: Brecht Van Lommel
Date: Wed Aug 17 16:51:05 2022 +0200
Branches: tmp_libupdate_34
https://developer.blender.org/rBf420ef6e61b0ae7f894e1e96a0506482e95c8a3e
Fix Python module build for Linux/macOS
However this puts a lib/ folder directly in site-packages which is not great.
There is already a 3.4 folder there which really is wrong as well. A proper
solution would be to move everything into a bpy/ folder instead of having a
bpy.so at the top level.
===================================================================
M build_files/cmake/platform/platform_apple.cmake
M source/creator/CMakeLists.txt
===================================================================
diff --git a/build_files/cmake/platform/platform_apple.cmake b/build_files/cmake/platform/platform_apple.cmake
index 0d5b0625f86..87a7602437c 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -520,10 +520,18 @@ if(WITH_COMPILER_CCACHE)
endif()
endif()
+if(WITH_COMPILER_ASAN)
+ list(APPEND PLATFORM_BUNDLED_LIBRARIES ${COMPILER_ASAN_LIBRARY})
+endif()
+
# For the installed Python module and installed Blender executable, we set the
# rpath to the location where install step will copy the shared libraries.
set(CMAKE_SKIP_INSTALL_RPATH FALSE)
-list(APPEND CMAKE_INSTALL_RPATH "@loader_path/../Resources/${BLENDER_VERSION}/lib")
+if(WITH_PYTHON_MODULE)
+ list(APPEND CMAKE_INSTALL_RPATH "@loader_path/${BLENDER_VERSION}/lib")
+else()
+ list(APPEND CMAKE_INSTALL_RPATH "@loader_path/../Resources/${BLENDER_VERSION}/lib")
+endif()
# For binaries that are built but not installed (like makesdan or tests), we add
# the original directory of all shared libraries to the rpath. This is needed because
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index fd40d0d22b8..7f00e9cd9aa 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -304,8 +304,10 @@ set(BLENDER_TEXT_FILES
if(UNIX AND NOT APPLE)
if(WITH_PYTHON_MODULE)
if(WITH_INSTALL_PORTABLE)
+ set(BPY_INSTALL_DIR ".")
set(TARGETDIR_VER ${BLENDER_VERSION})
else()
+ set(BPY_INSTALL_DIR ${PYTHON_SITE_PACKAGES})
set(TARGETDIR_VER ${PYTHON_SITE_PACKAGES}/${BLENDER_VERSION})
endif()
else()
@@ -339,7 +341,6 @@ elseif(APPLE)
endif()
# License, copyright, readme files.
set(BLENDER_TEXT_FILES_DESTINATION "${TARGETDIR_VER}/../text")
- set(MAC_BLENDER_TARGET_DYLIBS_DIR "${TARGETDIR_VER}/lib")
# Skip relinking on cpack / install
set_target_properties(blender PROPERTIES BUILD_WITH_INSTALL_RPATH true)
endif()
@@ -505,14 +506,22 @@ if(UNIX AND NOT APPLE)
if(WITH_INSTALL_PORTABLE)
install(
TARGETS blender
- DESTINATION "."
+ DESTINATION ${BPY_INSTALL_DIR}
)
else()
install(
TARGETS blender
- LIBRARY DESTINATION ${PYTHON_SITE_PACKAGES}
+ LIBRARY DESTINATION ${BPY_INSTALL_DIR}
+ )
+ endif()
+
+ if(PLATFORM_BUNDLED_LIBRARIES)
+ install(
+ FILES ${PLATFORM_BUNDLED_LIBRARIES}
+ DESTINATION ${BPY_INSTALL_DIR}/lib
)
endif()
+
# none of the other files are needed currently
elseif(WITH_INSTALL_PORTABLE)
install(
@@ -552,7 +561,10 @@ if(UNIX AND NOT APPLE)
endif()
if(PLATFORM_BUNDLED_LIBRARIES)
- install(FILES ${PLATFORM_BUNDLED_LIBRARIES} DESTINATION "lib")
+ install(
+ FILES ${PLATFORM_BUNDLED_LIBRARIES}
+ DESTINATION lib
+ )
endif()
set(BLENDER_TEXT_FILES_DESTINATION ".")
@@ -1177,13 +1189,7 @@ elseif(APPLE)
if(PLATFORM_BUNDLED_LIBRARIES)
install(
FILES ${PLATFORM_BUNDLED_LIBRARIES}
- DESTINATION ${MAC_BLENDER_TARGET_DYLIBS_DIR})
- endif()
-
- if(WITH_COMPILER_ASAN)
- install(
- FILES "${COMPILER_ASAN_LIBRARY}"
- DESTINATION "${MAC_BLENDER_TARGET_DYLIBS_DIR}"
+ DESTINATION ${TARGETDIR_VER}/lib
)
endif()
More information about the Bf-blender-cvs
mailing list