ROS"catkin_make"找不到OpenCVConfig.cmake [英] ROS "catkin_make" cannot find OpenCVConfig.cmake

查看:198
本文介绍了ROS"catkin_make"找不到OpenCVConfig.cmake的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用"catkin_make"命令构建一个需要OpenCV的ROS软件包.

I'm trying to build a ROS package which requires OpenCV using the "catkin_make" command.

尝试构建时,CMakeList命令"find_package(需要OpenCV)"出现以下错误:

Upon trying to build, I get the following error for CMakeList command "find_package(OpenCV REQUIRED)":

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.

我在/usr/share/OpenCV/中找到了"OpenCVConfig.cmake"文件,并在"OpenCV_DIR" env变量中设置了此位置.尽管如此,我仍然收到上面列出的错误.

I found the "OpenCVConfig.cmake" file at /usr/share/OpenCV/ and have set this location within the "OpenCV_DIR" env variable. Despite this, I still get the error listed above.

有什么想法吗?

知道我正在尝试将OpenCV4Tegra与Jetson TX1上的软件包链接起来可能很有用

It might be useful to know that I'm trying to link OpenCV4Tegra with the package on a Jetson TX1

推荐答案

通过在 find_package()之前添加行 set(OpenCV_DIR/usr/share/OpenCV/)来解决此问题.命令放在我的cmakelists文件中.

Fixed the problem by adding the line set(OpenCV_DIR /usr/share/OpenCV/) before the find_package() command in my cmakelists file.

这篇关于ROS"catkin_make"找不到OpenCVConfig.cmake的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆