Skip to content

Commit f43d2e8

Browse files
author
Kasper Peeters
committed
Search system-supplied pybind11 first.
1 parent f8458f3 commit f43d2e8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,11 @@ include(GNUInstallDirs)
300300

301301
set(Python_POSTFIX "3")
302302
find_package(Python COMPONENTS Interpreter Development)
303-
add_subdirectory(libs/pybind11)
303+
find_package(pybind11 CONFIG)
304+
if (NOT pybind11_FOUND)
305+
message(STATUS "Using included pybind11.")
306+
add_subdirectory(libs/pybind11)
307+
endif()
304308

305309
message(STATUS "Found python ${Python_LIBRARIES}")
306310
message(STATUS "Python version is ${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}.")
@@ -331,7 +335,7 @@ message(STATUS "Python standard platform-independent installation directory (Py
331335
message(STATUS "Python standard platform-dependent installation directory (Python_STDARCH) ${Python_STDARCH}")
332336
message(STATUS "Python 3rd-party platform-independent installation directory (Python_SITELIB) ${Python_SITELIB}")
333337
message(STATUS "Python 3rd-party platform-dependent installation directory (Python_SITEARCH) ${Python_SITEARCH}")
334-
message(STATUS "Installing Cadabra Python modules in ${PYTHON_SITE_PATH}")
338+
message(STATUS "Installing Cadabra Python modules in (PYTHON_SITE_PATH) ${PYTHON_SITE_PATH}")
335339
# We need to give our Python module an abi-name extension
336340
# so that it can be installed in a folder which does not
337341
# contain the abi name. See

0 commit comments

Comments
 (0)