File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -263,10 +263,26 @@ endif()
263263
264264# Python
265265find_package (
266- Python
266+ Python3
267267 COMPONENTS Interpreter Development.Module
268268 REQUIRED )
269- include_directories (SYSTEM PRIVATE ${Python_INCLUDE_DIRS} )
269+ include_directories (SYSTEM PRIVATE ${Python3_INCLUDE_DIRS} )
270+
271+ # Ensure Python::Module target exists (needed for nanobind on Windows)
272+ if (NOT TARGET Python::Module)
273+ if (NOT TARGET Python::Python)
274+ add_library (Python::Python INTERFACE IMPORTED )
275+ set_target_properties (
276+ Python::Python
277+ PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${Python3_INCLUDE_DIRS} "
278+ INTERFACE_LINK_LIBRARIES "${Python3_LIBRARIES} " )
279+ endif ()
280+ add_library (Python::Module INTERFACE IMPORTED )
281+ # cmake-format: off
282+ set_target_properties (
283+ Python::Module PROPERTIES INTERFACE_LINK_LIBRARIES "Python::Python" )
284+ # cmake-format: on
285+ endif ()
270286
271287# BLAS
272288#
You can’t perform that action at this time.
0 commit comments