cmake编译example下面的demo时出现错误,代码如下,提示找不到两个.cmake文件
CMake Error at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
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.
解决方法:在cmakelist文件中找到
find_package(.....)
在这里前一行加入(这里的路径就是之前编译源码的生成路径)
set(OpenCV_DIR /home/usr/opencv4.x/build)
再次执行cmake,成功过编译