Skip to content

Commit 65b6036

Browse files
committed
Revert "fix: update Python package configuration in CMakeLists.txt"
This reverts commit 2987d68.
1 parent e946a16 commit 65b6036

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

CMakeLists.txt

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,26 @@ endif()
263263

264264
# Python
265265
find_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
#

0 commit comments

Comments
 (0)