10000 Enabled `add_subdirectory()` for pybind11 dependency · SylvainCorlay/xtensor-python@6667b3e · GitHub
[go: up one dir, main page]

Skip to content

Commit 6667b3e

Browse files
committed
Enabled add_subdirectory() for pybind11 dependency
1 parent fb77795 commit 6667b3e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

CMakeLists.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,16 @@ else()
4545
find_package(xtensor ${xtensor_REQUIRED_VERSION} REQUIRED)
4646
message(STATUS "Found xtensor: ${xtensor_INCLUDE_DIRS}/xtensor")
4747
endif()
48+
49+
# Currently no required version for pybind11
50+
if(TARGET pybind11)
51+
# pybind11 has a variable that indicates its version already, so use that
52+
message(STATUS "Found pybind11 v${pybind11_VERSION}")
53+
else()
54+
find_package(pybind11 REQUIRED)
55+
message(STATUS "Found pybind11: ${pybind11_INCLUDE_DIRS}/pybind11")
56+
endif()
4857

49-
find_package(pybind11 REQUIRED)
50-
message(STATUS "Found pybind11: ${pybind11_INCLUDE_DIRS}/pybind11")
5158
find_package(NumPy REQUIRED)
5259
message(STATUS "Found numpy: ${NUMPY_INCLUDE_DIRS}")
5360

0 commit comments

Comments
 (0)
0