【问题标题】:OpenCV cmake errorOpenCV cmake错误
【发布时间】:2018-01-31 07:31:59
【问题描述】:

我是 CMake 的 OpenCV 新手,我是第一次在 Windows 上使用它,遇到了一些我在下面提到的问题。

CMake Error at CMakeLists.txt:10 (find_package):
  By not providing "FindOpenCV.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "OpenCV", but
  CMake did not find one.

  Could not find a package configuration file provided by "OpenCV" (requested
  version 3.1.0) with any of the following names:

    OpenCVConfig.cmake
    opencv-config.cmake

  Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set
  "OpenCV_DIR" to a directory containing one of the above files.  If "OpenCV"
  provides a separate development package or SDK, be sure it has been
  installed.

谁能给我一个分步解决方案。

【问题讨论】:

标签: visual-c++ cmake opencv3.1


【解决方案1】:

使用 vcpkg.exe 即时构建开源 Windows 项目,包括 OpenCV。从 github 下载 vcpkg 并构建 vcpkg.exe。 CMake 下载和交叉编译(如果有)将自动执行。在管理模式下打开 Powershell 窗口并输入 .\vcpkg install opencv 。成功安装后,在 Powershell 命令提示符下输入 .\vcpkg 集成安装。您的项目已准备就绪,库将自动插入到您的项目中。您可以选择 x86 或 x84 或静态/动态构建。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-26
    • 2013-05-25
    • 2020-05-29
    • 2015-06-17
    • 1970-01-01
    • 2020-11-02
    相关资源
    最近更新 更多