From a1602db827ecd2f3ade80ed49adb312874449805 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gr=C3=A9goire=20Kubler?= <gregoire.kubler@proton.me>
Date: Mon, 13 May 2024 12:01:53 +0200
Subject: [PATCH] fix : in the end we need this python dep

---
 CMakeLists.txt                   | 3 ++-
 cmake/PybindModuleCreation.cmake | 3 +--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f5559e33f..ff2e6fb2c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -87,10 +87,11 @@ if (PYBIND)
     # Handles Python + pybind11 headers dependencies
     target_link_libraries(${module_name}
         PRIVATE
-            Python::Module
+            Python::Python
         PUBLIC
             pybind11::pybind11
         )
+    target_link_libraries(${project} PUBLIC ${module_name})
 endif()
 
 target_link_libraries(${module_name} PUBLIC Threads::Threads fmt::fmt)
diff --git a/cmake/PybindModuleCreation.cmake b/cmake/PybindModuleCreation.cmake
index 9ed3fcec4..dea2ba2b5 100644
--- a/cmake/PybindModuleCreation.cmake
+++ b/cmake/PybindModuleCreation.cmake
@@ -4,7 +4,7 @@ macro(generate_python_binding )
 
     # Use the New FindPython mode, recommanded. Requires CMake 3.15+
     find_package(Python 3.7.0
-                    COMPONENTS Interpreter Development.Module 
+                    COMPONENTS Interpreter Development.Module Development.Embed
                     REQUIRED)
     set(PYBIND11_FINDPYTHON ON)
     set(PYBIND_VERSION v2.10.4)
@@ -21,7 +21,6 @@ macro(generate_python_binding )
 
     pybind11_add_module(${project} MODULE ${pybind_src_files} "NO_EXTRAS") # NO EXTRA required for pip install
     target_include_directories(${project} PUBLIC "python_binding" ${pybind11_INCLUDE_DIRECTORIES})
-    target_link_libraries(${project} PUBLIC ${module_name})
 endmacro()
 
 
-- 
GitLab