赞
踩
这CMakeLists.txt是我正在使用的文件的开头:
cmake_minimum_required(VERSION3.12)project(hello-pyext)find_package(Python3COMPONENTSInterpreterDevelopment)message(STATUS"Python: version=${Python3_VERSION} interpreter=${Python3_EXECUTABLE}")if(NOTPython3_FOUNDANDPython3_Development_FOUND)# find_package() will not abort the build if anything's missing.string(JOIN"\n"errmsg" Python3 and/or development libs not found."" - Python3_FOUND=${Python3_FOUND}"" - Python3_Development_FOUND=${Python3_Development_FOUND}")message(FATAL_ERROR ${errmsg})endif()
当内置cmake-3.12.4-Linux-x86_64(从下载cmake.org)在Linux上,它工作正常,发现通过安装两个Python3解释和开发头文件/库apt-get。(系统上还安装了Python2,但我已经确认它找到的解释器是Python3。)
但是,在Windows 10上,它将找到开发标头/库,但找不到解释器,并打印:
-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.14393.
-- Could NOT find Python3 (m
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。