Skip to content

Commit

Permalink
configure_imgui_test_engine_with_python_gil: handle python for skbuil…
Browse files Browse the repository at this point in the history
…d vs native
  • Loading branch information
pthom committed Nov 15, 2024
1 parent 2d82a81 commit 47b3ef5
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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:")
Expand Down

0 comments on commit 47b3ef5

Please sign in to comment.