未验证 提交 01e1a714 编写于 作者: S Shenghang Tsai 提交者: GitHub

Prevent CMake from using highest version of python3 (#5034)

* Use conda python if available

* refine

* refine

* refine
Co-authored-by: Noneflow-ci-bot <69100618+oneflow-ci-bot@users.noreply.github.com>
上级 86d4a672
if (NOT DEFINED Python3_EXECUTABLE)
execute_process(
COMMAND which python3
RESULT_VARIABLE STATUS
OUTPUT_VARIABLE OUTPUT
ERROR_QUIET
)
if(STATUS EQUAL 0)
string(STRIP ${OUTPUT} STRIPPED)
message(STATUS "Using Python3 from 'which python3': ${STRIPPED}")
set(Python3_EXECUTABLE ${STRIPPED})
endif()
endif()
find_package(Python3 COMPONENTS Interpreter REQUIRED)
message(STATUS "Python3 specified. Version found: " ${Python3_VERSION})
set(Python_EXECUTABLE ${Python3_EXECUTABLE})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册