CMake: detect numpy with Python 3.13

Resolves #137635.
This commit is contained in:
Campbell Barton
2025-04-17 17:32:48 +10:00
parent cc83a7dbef
commit 8de93061f7

View File

@@ -2487,7 +2487,12 @@ if(WITH_PYTHON)
# Always use numpy bundled in precompiled libs.
elseif((WITH_PYTHON_INSTALL AND WITH_PYTHON_INSTALL_NUMPY) OR WITH_PYTHON_NUMPY)
if(("${PYTHON_NUMPY_PATH}" STREQUAL "") OR (${PYTHON_NUMPY_PATH} MATCHES NOTFOUND))
find_python_package(numpy "core/include")
set(_numpy_include "_core/include")
if(PYTHON_VERSION VERSION_LESS "3.13")
set(_numpy_include "core/include")
endif()
find_python_package(numpy "${_numpy_include}")
unset(_numpy_include)
endif()
endif()