From aa6691e23c1145f5e2b3c8d59911d175b114d2df Mon Sep 17 00:00:00 2001 From: Ghislain Vaillant Date: Mon, 24 Nov 2025 14:22:17 +0100 Subject: [PATCH] Allow use of system pybind11 In case pybind11 is not available through find_package, fall back to the previous behavior. --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c81d62..4ef1fee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,7 +38,10 @@ set(CMAKE_CXX_STANDARD 11) # -------------------------------------------------- # initialize pybind for python wrapping -add_subdirectory(${pybind11_DIR} pybind11) +find_package(pybind11 CONFIG) +if(NOT pybind11_FOUND) + add_subdirectory(${pybind11_DIR} pybind11) +endif() message(STATUS "ITK_DIR=${ITK_DIR} pybind11_DIR=${pybind11_DIR}")