OpenCV cmake错误
Posted
技术标签:
【中文标题】OpenCV cmake错误【英文标题】:OpenCV cmake error 【发布时间】: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.
谁能给我一个分步解决方案。
【问题讨论】:
cmake is not working in opencv c++ project的可能重复 【参考方案1】:使用 vcpkg.exe 即时构建开源 Windows 项目,包括 OpenCV。从 github 下载 vcpkg 并构建 vcpkg.exe。 CMake 下载和交叉编译(如果有)将自动执行。在管理模式下打开 Powershell 窗口并输入 .\vcpkg install opencv 。成功安装后,在 Powershell 命令提示符下输入 .\vcpkg 集成安装。您的项目已准备就绪,库将自动插入到您的项目中。您可以选择 x86 或 x84 或静态/动态构建。
【讨论】:
以上是关于OpenCV cmake错误的主要内容,如果未能解决你的问题,请参考以下文章