@@ -51,7 +51,7 @@ endif()
51
51
# Cf. https://github.com/pybind/pybind11/issues/2268
52
52
#find_package(PythonInterp ${PythonLibsNew_FIND_VERSION} REQUIRED)
53
53
# the above line uses a deprecated cmake method, use the following instead
54
- find_package (Python COMPONENTS Interpreter REQUIRED)
54
+ find_package (Python COMPONENTS Interpreter Development.Module NumPy REQUIRED)
55
55
56
56
set (pybind11_REQUIRED_VERSION 2.6.1)
57
57
if (TARGET pybind11 OR TARGET pybind11::headers)
@@ -62,12 +62,6 @@ else()
62
62
message (STATUS "Found pybind11: ${pybind11_INCLUDE_DIRS} /pybind11" )
63
63
endif ()
64
64
65
- # Look for NumPy headers, except if NUMPY_INCLUDE_DIRS is passed,
66
- # which is required under some circumstances (such as wasm, where
67
- # there is no real python executable)
68
- if (NOT Python_NumPy_INCLUDE_DIR)
69
- find_package (NumPy REQUIRED)
70
- endif ()
71
65
message (STATUS "Found numpy: ${Python_NumPy_INCLUDE_DIR} " )
72
66
73
67
# Build
@@ -87,7 +81,7 @@ set(XTENSOR_PYTHON_HEADERS
87
81
88
82
add_library (xtensor-python INTERFACE )
89
83
target_include_directories (xtensor-python INTERFACE
90
- "$<BUILD_INTERFACE:${XTENSOR_PYTHON_INCLUDE_DIR} ;${pybind11_INCLUDE_DIRS} ;${NUMPY_INCLUDE_DIRS } >"
84
+ "$<BUILD_INTERFACE:${XTENSOR_PYTHON_INCLUDE_DIR} ;${pybind11_INCLUDE_DIRS} ;${Python_NumPy_INCLUDE_DIR } >"
91
85
$<INSTALL_INTERFACE:include >)
92
86
target_link_libraries (xtensor-python INTERFACE xtensor)
93
87
get_target_property (inc_dir xtensor-python INTERFACE_INCLUDE_DIRECTORIES )
0 commit comments