From 81558783e40394c2c60f61626eb6814f17128503 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 9 Sep 2022 10:25:35 +1000 Subject: Python: install "bpy" as a package WITH_PYTHON_MODULE Building WITH_PYTHON_MODULE was creating a "bpy" module that required Blenders data-files to be located in the module search path too. This mean that a typical installation on Linux would create: - `/usr/lib/python3.10/site-packages/bpy.so` - `/usr/lib/python3.10/site-packages/3.4` (containing `scripts` & `datafiles`). The new behavior creates: - `/usr/lib/python3.10/site-packages/bpy/__init__.so` - `/usr/lib/python3.10/site-packages/bpy/3.4` With the advantage that the "bpy" directory is the self contained Python module. No changes are needed for the module loading logic as the mechanism to swap in blend internal Python "bpy" module (defined in `release/scripts/modules/bpy/__init__.py`) works the same in both instances. Thanks to Brecht for macOS support. Reviewed by brecht Ref D15911 --- source/blender/blenkernel/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender/blenkernel/CMakeLists.txt') diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt index 9521da8417e..b982c69a378 100644 --- a/source/blender/blenkernel/CMakeLists.txt +++ b/source/blender/blenkernel/CMakeLists.txt @@ -659,6 +659,10 @@ if(WITH_PYTHON) ) add_definitions(-DWITH_PYTHON) + if(WITH_PYTHON_MODULE) + add_definitions(-DWITH_PYTHON_MODULE) + endif() + if(WITH_PYTHON_SAFETY) add_definitions(-DWITH_PYTHON_SAFETY) endif() -- cgit v1.2.3