From 008850c3e83a67d102786c965121ca61fefb2be0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gr=C3=A9goire=20Kubler?= <gregoire.kubler@proton.me>
Date: Fri, 10 May 2024 16:40:59 +0200
Subject: [PATCH] fix : python found in cibuildwheel

---
 cmake/PybindModuleCreation.cmake | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/cmake/PybindModuleCreation.cmake b/cmake/PybindModuleCreation.cmake
index 8030c1a86..4e03a71ee 100644
--- a/cmake/PybindModuleCreation.cmake
+++ b/cmake/PybindModuleCreation.cmake
@@ -9,7 +9,9 @@ function(generate_python_binding name target_to_bind)
     )
 
     # Use the New FindPython mode, recommanded. Requires CMake 3.15+
-    find_package(Python COMPONENTS Interpreter Development)
+    if ( NOT DEFINED PYTHON_EXECUTABLE OR NOT DEFINED PYTHON_INCLUDE_DIR OR NOT DEFINED PYTHON_LIBRARY )
+        find_package(Python 3.7 COMPONENTS Interpreter Development.Module REQUIRED)
+    endif()
     FetchContent_MakeAvailable(PyBind11)
 
     message(STATUS "Creating binding for module ${name}")
-- 
GitLab