# ----------------------------------------------------------------------------
# Copyright (c) 2026 Huawei Technologies Co., Ltd.
# ----------------------------------------------------------------------------
# find python
# Honour caller-provided Python (from setup.py -DPython3_EXECUTABLE=...), else auto-detect.
if(NOT Python3_EXECUTABLE AND DEFINED ENV{PYTHON_EXECUTABLE})
set(Python3_EXECUTABLE $ENV{PYTHON_EXECUTABLE})
endif()
set(Python3_FIND_STRATEGY LOCATION)
find_package(Python3 REQUIRED COMPONENTS Interpreter Development REQUIRED)
message(STATUS "Found Python3: ${Python3_EXECUTABLE} (found version ${Python3_VERSION})")
message(STATUS "Python3 include dir: ${Python3_INCLUDE_DIRS}")
message(STATUS "Python3 libraries: ${Python3_LIBRARIES}")