问题描述:
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" 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.
解决方案:
首先使用指令搜索OpenCVConfig.cmake文件的路径:
locate OpenCVConfig.cmake
然后,在CmakeLists.txt中添加:
set(OpenCV_DIR home/haha/opencv)
说明:home/haha/opencv 为OpenCVConfig.cmake所在路径
更多《计算机视觉与图形学》知识,可关注下方公众号: