Changeset View
Changeset View
Standalone View
Standalone View
CMakeLists.txt
| Show First 20 Lines • Show All 343 Lines • ▼ Show 20 Lines | if(WITH_STATIC_LIBS) | ||||
| option(WITH_BOOST_ICU "Boost uses ICU library (required for linking with static Boost built with libicu)." OFF) | option(WITH_BOOST_ICU "Boost uses ICU library (required for linking with static Boost built with libicu)." OFF) | ||||
| mark_as_advanced(WITH_BOOST_ICU) | mark_as_advanced(WITH_BOOST_ICU) | ||||
| endif() | endif() | ||||
| endif() | endif() | ||||
| option(WITH_PYTHON_INSTALL "Copy system python into the blender install folder" ON) | option(WITH_PYTHON_INSTALL "Copy system python into the blender install folder" ON) | ||||
| if(WIN32 OR APPLE) | if(WIN32 OR APPLE) | ||||
| # Windows and macOS have this bundled with Python libraries. | # Windows and macOS have this bundled with Python libraries. | ||||
| elseif(WITH_PYTHON_INSTALL OR (WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE)) | elseif(WITH_PYTHON_INSTALL OR (WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE) OR WITH_MOD_FLUID) | ||||
| option(WITH_PYTHON_NUMPY "Use Numpy python module in Blender build (used by Audaspace and Mantaflow)" ON) | |||||
sybren: NumPy is not used during the build, so this sentence is a bit weird. I think "Copy the NumPy… | |||||
Done Inline ActionsActually, the whole point of this new option is because numpy is used during the build, since we need its headers... We need those even if we do not install python and its extra modules. mont29: Actually, the whole point of this new option is because numpy **is** used during the build… | |||||
Done Inline ActionsAh, I see where my confusion is coming from: I thought of "using numpy" as doing import numpy and then using it to compute stuff. How about making it less specific, so that it basically covers all? "Include NumPy in Blender (used by Audaspace and Mantaflow)" removes the details on where & how exactly it's used, and to me covers enough information to understand the option. sybren: Ah, I see where my confusion is coming from: I thought of "using numpy" as doing `import numpy`… | |||||
| set(PYTHON_NUMPY_PATH "" CACHE PATH "Path to python site-packages or dist-packages containing 'numpy' module") | set(PYTHON_NUMPY_PATH "" CACHE PATH "Path to python site-packages or dist-packages containing 'numpy' module") | ||||
| mark_as_advanced(PYTHON_NUMPY_PATH) | mark_as_advanced(PYTHON_NUMPY_PATH) | ||||
| set(PYTHON_NUMPY_INCLUDE_DIRS ${PYTHON_NUMPY_PATH}/numpy/core/include CACHE PATH "Path to the include directory of the numpy module") | set(PYTHON_NUMPY_INCLUDE_DIRS "" CACHE PATH "Path to the include directory of the numpy module") | ||||
| mark_as_advanced(PYTHON_NUMPY_INCLUDE_DIRS) | mark_as_advanced(PYTHON_NUMPY_INCLUDE_DIRS) | ||||
| endif() | endif() | ||||
| if(WITH_PYTHON_INSTALL) | if(WITH_PYTHON_INSTALL) | ||||
| option(WITH_PYTHON_INSTALL_NUMPY "Copy system numpy into the blender install folder" ON) | option(WITH_PYTHON_INSTALL_NUMPY "Copy system numpy into the blender install folder" ON) | ||||
| if(UNIX AND NOT APPLE) | if(UNIX AND NOT APPLE) | ||||
| option(WITH_PYTHON_INSTALL_REQUESTS "Copy system requests into the blender install folder" ON) | option(WITH_PYTHON_INSTALL_REQUESTS "Copy system requests into the blender install folder" ON) | ||||
| set(PYTHON_REQUESTS_PATH "" CACHE PATH "Path to python site-packages or dist-packages containing 'requests' module") | set(PYTHON_REQUESTS_PATH "" CACHE PATH "Path to python site-packages or dist-packages containing 'requests' module") | ||||
| ▲ Show 20 Lines • Show All 1,252 Lines • ▼ Show 20 Lines | message(FATAL_ERROR | ||||
| "Set the cache entry 'PYTHON_INCLUDE_DIR' to point " | "Set the cache entry 'PYTHON_INCLUDE_DIR' to point " | ||||
| "to a valid python include path. Containing " | "to a valid python include path. Containing " | ||||
| "Python.h for python version \"${PYTHON_VERSION}\"" | "Python.h for python version \"${PYTHON_VERSION}\"" | ||||
| ) | ) | ||||
| endif() | endif() | ||||
| if(WIN32 OR APPLE) | if(WIN32 OR APPLE) | ||||
| # Windows and macOS have this bundled with Python libraries. | # Windows and macOS have this bundled with Python libraries. | ||||
| elseif((WITH_PYTHON_INSTALL AND WITH_PYTHON_INSTALL_NUMPY) OR (WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE)) | elseif((WITH_PYTHON_INSTALL AND WITH_PYTHON_INSTALL_NUMPY) OR (WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE)) | ||||
brechtUnsubmitted Done Inline ActionsWITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE -> WITH_PYTHON_NUMPY? To ensure it finds the package when WITH_PYTHON_NUMPY=ON and WITH_PYTHON_INSTALL_NUMPY=OFF. brecht: `WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE` -> `WITH_PYTHON_NUMPY`?
To ensure it finds the… | |||||
| if(("${PYTHON_NUMPY_PATH}" STREQUAL "") OR (${PYTHON_NUMPY_PATH} MATCHES NOTFOUND)) | if(("${PYTHON_NUMPY_PATH}" STREQUAL "") OR (${PYTHON_NUMPY_PATH} MATCHES NOTFOUND)) | ||||
| find_python_package(numpy) | find_python_package(numpy "core/include") | ||||
| unset(PYTHON_NUMPY_INCLUDE_DIRS CACHE) | |||||
| set(PYTHON_NUMPY_INCLUDE_DIRS ${PYTHON_NUMPY_PATH}/numpy/core/include CACHE PATH "Path to the include directory of the numpy module") | |||||
| mark_as_advanced(PYTHON_NUMPY_INCLUDE_DIRS) | |||||
| endif() | endif() | ||||
| endif() | endif() | ||||
| if(WIN32 OR APPLE) | if(WIN32 OR APPLE) | ||||
| # pass, we have this in lib/python/site-packages | # pass, we have this in lib/python/site-packages | ||||
| elseif(WITH_PYTHON_INSTALL_REQUESTS) | elseif(WITH_PYTHON_INSTALL_REQUESTS) | ||||
| find_python_package(requests) | find_python_package(requests) | ||||
| endif() | endif() | ||||
| ▲ Show 20 Lines • Show All 276 Lines • Show Last 20 Lines | |||||
NumPy is not used during the build, so this sentence is a bit weird. I think "Copy the NumPy library into the blender install folder" is clearer and consistent with the WITH_PYTHON_INSTALL description.
Also note the capitalisation of NumPy.