From c3c55fe646ad6934e429edd080aceae54260551c Mon Sep 17 00:00:00 2001
From: Bernd Waibel <waebbl-gentoo@posteo.net>
Date: Sun, 30 Oct 2022 14:50:48 +0100
Subject: [PATCH] use external pybind11

Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net>
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -302,7 +302,7 @@ else()
 endif()
 
 if (USE_PYTHON)
-    add_subdirectory(external_dependencies/pybind11)
+    find_package(pybind11)
     find_path(PYBIND_INCLUDE_DIR pybind11/pybind11.h HINTS ${PYTHON_INCLUDE_DIR})
     if( PYBIND_INCLUDE_DIR )
         message(STATUS "Found Pybind11: ${PYBIND_INCLUDE_DIR}")
--- a/cmake/SuperBuild.cmake
+++ b/cmake/SuperBuild.cmake
@@ -154,7 +154,6 @@ endif()
 #######################################################################
 if (USE_PYTHON)
   find_path(PYBIND_INCLUDE_DIR pybind11/pybind11.h PATHS ${CMAKE_CURRENT_SOURCE_DIR}/external_dependencies/pybind11/include NO_DEFAULT_PATH)
-    set(NG_INSTALL_PYBIND ON)
     if( NOT PYBIND_INCLUDE_DIR )
       # if the pybind submodule is missing, try to initialize and update all submodules
       execute_process(COMMAND git submodule update --init --recursive WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
-- 
2.38.1

