8000 Merge pull request #296 from dokempf/master · xtensor-stack/xtensor-python@1b14707 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1b14707

Browse files
authored
Merge pull request #296 from dokempf/master
Use FindPython's numpy component to find numpy include directories
2 parents d4dd6ce + 3ffb0e4 commit 1b14707

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 numberDi 8000 ff 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})
@@ -60,8 +60,8 @@ else()
6060
message(STATUS "Found pybind11: ${pybind11_INCLUDE_DIRS}/pybind11")
6161
endif()
6262

63-
find_package(NumPy REQUIRED)
64-
message(STATUS "Found numpy: ${NUMPY_INCLUDE_DIRS}")
63+
# Look for NumPy headers
64+
find_package(Python REQUIRED COMPONENTS NumPy)
6565

6666
# Build
6767
# =====
@@ -80,7 +80,7 @@ set(XTENSOR_PYTHON_HEADERS
8080

8181
add_library(xtensor-python INTERFACE)
8282
target_include_directories(xtensor-python INTERFACE
83-
"$<BUILD_INTERFACE:${XTENSOR_PYTHON_INCLUDE_DIR};${pybind11_INCLUDE_DIRS};${NUMPY_INCLUDE_DIRS}>"
83+
"$<BUILD_INTERFACE:${XTENSOR_PYTHON_INCLUDE_DIR};${pybind11_INCLUDE_DIRS};${Python_NumPy_INCLUDE_DIRS}>"
8484
$<INSTALL_INTERFACE:include>)
8585
target_link_libraries(xtensor-python INTERFACE xtensor)
8686
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)
0