天天看點

“FindPython3.cmake“找不到的解決方案

在cmake中常見以下錯誤:

By not providing "FindPython3.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Python3", but
  CMake did not find one.

  Could not find a package configuration file provided by "Python3" with any
  of the following names:

    Python3Config.cmake
    python3-config.cmake
           

在確定find_package指令沒寫錯的情況下(find_package(Python3 COMPONENTS Interpreter Development REQUIRED),檢查一下cmake版本,cmake版本要在3.12以上才支援。

如果不懂如何更新cmake,可以參考這個:

cmake更新方法

繼續閱讀