Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 3 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
cmake_minimum_required(VERSION 3.29)
project(xtensor-python)

set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
set(XTENSOR_PYTHON_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)

# Versioning
Expand Down Expand Up @@ -46,7 +45,7 @@ else()
message(STATUS "Found xtensor: ${xtensor_INCLUDE_DIRS}/xtensor")
endif()

find_package(Python COMPONENTS Interpreter REQUIRED)
find_package(Python3 COMPONENTS Interpreter Development.Module NumPy REQUIRED)

set(pybind11_REQUIRED_VERSION 3.0.0)
if (NOT TARGET pybind11::headers)
Expand All @@ -60,14 +59,6 @@ else ()
message(STATUS "Found pybind11 v${pybind11_VERSION}")
endif ()

# Look for NumPy headers, except if NUMPY_INCLUDE_DIRS is passed,
# which is required under some circumstances (such as wasm, where
# there is no real python executable)
if(NOT NUMPY_INCLUDE_DIRS)
find_package(NumPy REQUIRED)
endif()
message(STATUS "Found numpy: ${NUMPY_INCLUDE_DIRS}")

# Build
# =====

Expand All @@ -84,10 +75,8 @@ set(XTENSOR_PYTHON_HEADERS
)

add_library(xtensor-python INTERFACE)
target_include_directories(xtensor-python INTERFACE
"$<BUILD_INTERFACE:${XTENSOR_PYTHON_INCLUDE_DIR};${pybind11_INCLUDE_DIRS};${NUMPY_INCLUDE_DIRS}>"
$<INSTALL_INTERFACE:include>)
target_link_libraries(xtensor-python INTERFACE xtensor)
target_include_directories(xtensor-python INTERFACE "$<BUILD_INTERFACE:${XTENSOR_PYTHON_INCLUDE_DIR}>" $<INSTALL_INTERFACE:include>)
target_link_libraries(xtensor-python INTERFACE xtensor pybind11::pybind11 Python3::NumPy)
get_target_property(inc_dir xtensor-python INTERFACE_INCLUDE_DIRECTORIES)

OPTION(BUILD_TESTS "xtensor test suite" OFF)
Expand Down
89 changes: 0 additions & 89 deletions cmake/FindNumPy.cmake

This file was deleted.

Loading