From 010f44b855cab664126975543e0e760576202d85 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 14 Dec 2020 16:40:00 +0100 Subject: Fix several issues with handling of numpy in CMake. Issues were: * Abusing of `WITH_PYTHON_INSTALL_NUMPY` by both Audaspace and Mantaflow. - `PYTHON_INSTALL` options only decide whether we copy python (and some extra modules) in our Blender installation. On linux it makes much more sense to use global python installation. - Now we have instead a proper `WITH_PYTHON_NUMPY` * Bad assumptions regarding path of headers relative to path of python module. - In current Debian testing, modules are under `python3.9` directory, while headers are under `python3` directory. - Now we properly `find_path` for headers as well, modifying `find_python_package` to take an optional argument for headers. Note that the required changes done to `extern` libraries are in blender-specific files that do not exist upstream. Differential Revision: https://developer.blender.org/D9773 --- extern/mantaflow/CMakeLists.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'extern/mantaflow') diff --git a/extern/mantaflow/CMakeLists.txt b/extern/mantaflow/CMakeLists.txt index ee155ee8636..ccf272650e3 100644 --- a/extern/mantaflow/CMakeLists.txt +++ b/extern/mantaflow/CMakeLists.txt @@ -85,7 +85,7 @@ if(WIN32) add_definitions(-D_USE_MATH_DEFINES) endif() -if(WITH_MANTA_NUMPY AND WITH_PYTHON_INSTALL_NUMPY) +if(WITH_MANTA_NUMPY AND WITH_PYTHON_NUMPY) add_definitions(-DNUMPY=1) endif() @@ -109,7 +109,7 @@ set(INC_SYS ${ZLIB_INCLUDE_DIRS} ) -if(WITH_MANTA_NUMPY AND WITH_PYTHON_INSTALL_NUMPY) +if(WITH_MANTA_NUMPY AND WITH_PYTHON_NUMPY) list(APPEND INC_SYS ${PYTHON_NUMPY_INCLUDE_DIRS} ) @@ -255,8 +255,7 @@ if(WITH_MANTA_DEPENDENCIES) ${MANTA_DEP}/cnpy/cnpy.h ) endif() - -if(WITH_MANTA_NUMPY AND WITH_PYTHON_INSTALL_NUMPY) +if(WITH_MANTA_NUMPY AND WITH_PYTHON_NUMPY) list(APPEND SRC ${MANTA_PP}/plugin/numpyconvert.cpp ${MANTA_PP}/plugin/tfplugins.cpp -- cgit v1.2.3