|
1 | | -cmake_minimum_required(VERSION 3.10) |
| 1 | +cmake_minimum_required(VERSION 3.19) |
2 | 2 |
|
3 | 3 | # ############################################################################## |
4 | 4 | # Import CMake modules |
@@ -272,36 +272,11 @@ endif() |
272 | 272 |
|
273 | 273 | # Python |
274 | 274 | find_package( |
275 | | - Python3 |
| 275 | + Python |
276 | 276 | COMPONENTS Interpreter Development.Module |
| 277 | + OPTIONAL_COMPONENTS Development.SABIModule |
277 | 278 | REQUIRED) |
278 | | -include_directories(SYSTEM PRIVATE ${Python3_INCLUDE_DIRS}) |
279 | | - |
280 | | -# Ensure Python::Interpreter target exists (needed by nanobind to avoid |
281 | | -# re-resolving a different Python interpreter). |
282 | | -if(NOT TARGET Python::Interpreter) |
283 | | - add_executable(Python::Interpreter IMPORTED) |
284 | | - # cmake-format: off |
285 | | - set_target_properties(Python::Interpreter PROPERTIES |
286 | | - IMPORTED_LOCATION "${Python3_EXECUTABLE}") |
287 | | - # cmake-format: on |
288 | | -endif() |
289 | | - |
290 | | -# Ensure Python::Module target exists (needed for nanobind on Windows) |
291 | | -if(NOT TARGET Python::Module) |
292 | | - if(NOT TARGET Python::Python) |
293 | | - add_library(Python::Python INTERFACE IMPORTED) |
294 | | - set_target_properties( |
295 | | - Python::Python |
296 | | - PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${Python3_INCLUDE_DIRS}" |
297 | | - INTERFACE_LINK_LIBRARIES "${Python3_LIBRARIES}") |
298 | | - endif() |
299 | | - add_library(Python::Module INTERFACE IMPORTED) |
300 | | - # cmake-format: off |
301 | | - set_target_properties( |
302 | | - Python::Module PROPERTIES INTERFACE_LINK_LIBRARIES "Python::Python") |
303 | | - # cmake-format: on |
304 | | -endif() |
| 279 | +include_directories(SYSTEM PRIVATE ${Python_INCLUDE_DIRS}) |
305 | 280 |
|
306 | 281 | # BLAS |
307 | 282 | # |
@@ -560,7 +535,7 @@ set(CONFIG_LINES |
560 | 535 | "BLAS: ${BLA_VENDOR}" |
561 | 536 | "Code Coverage: ${CODE_COVERAGE_LINE}" |
562 | 537 | "Clang-Tidy: ${CLANG_TIDY_LINE}" |
563 | | - "Python3: ${Python3_VERSION}" |
| 538 | + "Python: ${Python_VERSION}" |
564 | 539 | "======================================================================") |
565 | 540 |
|
566 | 541 | foreach(line ${CONFIG_LINES}) |
|
0 commit comments