# set minimum cmake version
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
# project name and language
project(recipe-01 LANGUAGES NONE)
# detect python
find_package(PythonInterp REQUIRED)
# Execute a tiny Python script
execute_process(
COMMAND
${PYTHON_EXECUTABLE} "-c" "print('Hello, world!')"
RESULT_VARIABLE _status
OUTPUT_VARIABLE _hello_world
ERROR_QUIET
OUTPUT_
cmake 调用 python
最新推荐文章于 2023-03-27 19:47:41 发布