Skip to content

Commit ca93049

Browse files
committed
CMake/test: changing how Python is linked
1 parent cbccfb2 commit ca93049

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ else()
8080
endif()
8181

8282
find_package(Threads)
83+
find_package(pybind11 REQUIRED)
84+
find_package(Python REQUIRED COMPONENTS Interpreter Development NumPy)
8385

8486
include_directories(${GTEST_INCLUDE_DIRS})
8587

@@ -93,7 +95,7 @@ set(XTENSOR_PYTHON_TESTS
9395
)
9496

9597
add_executable(test_xtensor_python ${XTENSOR_PYTHON_TESTS} ${XTENSOR_PYTHON_HEADERS})
96-
target_link_libraries(test_xtensor_python xtensor-python ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${PYTHON_LIBRARIES})
98+
target_link_libraries(test_xtensor_python xtensor-python ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} pybind11::module Python::NumPy)
9799

98100
if(DOWNLOAD_GTEST OR GTEST_SRC_DIR)
99101
add_dependencies(test_xtensor_python gtest_main)

0 commit comments

Comments
 (0)