Skip to content

Commit 0135cbd

Browse files
committed
Use FindPython's numpy component to find numpy include directories
1 parent 88734bd commit 0135cbd

File tree

2 files changed

+4
-93
lines changed

2 files changed

+4
-93
lines changed

CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# The full license is in the file LICENSE, distributed with this software. #
88
############################################################################
99

10-
cmake_minimum_required(VERSION 3.1)
10+
cmake_minimum_required(VERSION 3.14)
1111
project(xtensor-python)
1212

1313
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
@@ -55,8 +55,8 @@ else()
5555
message(STATUS "Found pybind11: ${pybind11_INCLUDE_DIRS}/pybind11")
5656
endif()
5757

58-
find_package(NumPy REQUIRED)
59-
message(STATUS "Found numpy: ${NUMPY_INCLUDE_DIRS}")
58+
# Look for NumPy headers
59+
find_package(Python REQUIRED COMPONENTS NumPy)
6060

6161
# Build
6262
# =====
@@ -75,7 +75,7 @@ set(XTENSOR_PYTHON_HEADERS
7575

7676
add_library(xtensor-python INTERFACE)
7777
target_include_directories(xtensor-python INTERFACE
78-
"$<BUILD_INTERFACE:${XTENSOR_PYTHON_INCLUDE_DIR};${pybind11_INCLUDE_DIRS};${NUMPY_INCLUDE_DIRS}>"
78+
"$<BUILD_INTERFACE:${XTENSOR_PYTHON_INCLUDE_DIR};${pybind11_INCLUDE_DIRS};${Python_NumPy_INCLUDE_DIRS}>"
7979
$<INSTALL_INTERFACE:include>)
8080
target_link_libraries(xtensor-python INTERFACE xtensor)
8181
get_target_property(inc_dir xtensor-python INTERFACE_INCLUDE_DIRECTORIES)

cmake/FindNumPy.cmake

Lines changed: 0 additions & 89 deletions
This file was deleted.

0 commit comments

Comments
 (0)