From a5ba99ff5fed7cb77a5fe71f81241581ce10b373 Mon Sep 17 00:00:00 2001 From: Wiebe van Breukelen Date: Fri, 15 Aug 2025 16:19:34 +0200 Subject: [PATCH] Only fetch pybind11 when target not available (#25) --- python/CMakeLists.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 81e1494..56fa0c8 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -1,8 +1,10 @@ -FetchContent_Declare( - pybind11 - GIT_REPOSITORY https://github.com/pybind/pybind11.git - GIT_TAG v3.0.0) -FetchContent_MakeAvailable(pybind11) +if(NOT TARGET pybind11) + FetchContent_Declare( + pybind11 + GIT_REPOSITORY https://github.com/pybind/pybind11.git + GIT_TAG v3.0.0) + FetchContent_MakeAvailable(pybind11) +endif() pybind11_add_module(pytrigdx bindings.cpp) target_link_libraries(pytrigdx PRIVATE trigdx)