From 47b3ef594ce1d41dae26f892f6c9ae764355d10f Mon Sep 17 00:00:00 2001 From: Pascal Thomet Date: Sat, 16 Nov 2024 00:19:01 +0100 Subject: [PATCH] configure_imgui_test_engine_with_python_gil: handle python for skbuild vs native --- .../hello_imgui_test_engine_cmake.cmake | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/hello_imgui_test_engine_integration/hello_imgui_test_engine_cmake.cmake b/src/hello_imgui_test_engine_integration/hello_imgui_test_engine_cmake.cmake index 7e177179..bea86e6d 100644 --- a/src/hello_imgui_test_engine_integration/hello_imgui_test_engine_cmake.cmake +++ b/src/hello_imgui_test_engine_integration/hello_imgui_test_engine_cmake.cmake @@ -90,7 +90,16 @@ function(configure_imgui_test_engine_with_python_gil) # Development.Module is available since CMake 3.18 only, # hence the main CMakeList specifies # cmake_minimum_required(VERSION 3.18) - find_package(Python 3.8 COMPONENTS Development.Module) + if(SKBUILD) + # we only need the Development.Module component to build native modules + find_package(Python 3.8 REQUIRED COMPONENTS Interpreter Development.Module) + else() + # when building via CMake, we may need the full Development component to be able to debug the native module + # warning, Starting with CMake 3.18, the FindPython module introduced more granular components: + # Development.Module (and probably others) + find_package(Python 3.8 REQUIRED COMPONENTS Interpreter Development) + endif() + # Debug messages to verify Python detection if(Python_FOUND) message(STATUS "Python found:")