【发布时间】:2020-06-02 06:09:24
【问题描述】:
我尝试将 ROS 与 opencv 一起使用,但是当我“catkin-make”时,它给了我这个:
CMake Error at /opt/ros/kinetic/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. If "OpenCV"
provides a separate development package or SDK, be sure it has been
installed.
Call Stack (most recent call first):
fls_package/CMakeLists.txt:10 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/vered/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/vered/catkin_ws/build/CMakeFiles/CMakeError.log".
Makefile:318: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
使用 cmake-gui,我定义了: 1. CMAKE_PREFIX_PATH = /home/vered/opencv/build(OpenCVConfig.cmake 所在的位置) 2. OpenCV_DIR = /usr/local/include/opencv4/opencv2(opencv.hpp在哪里)
配置,生成,然后 sudo make install,
当 catkin-make 时,我也遇到了同样的问题。 有什么想法吗?
【问题讨论】:
-
不应该
CMAKE_PREFIX_PATH包含包含OpenCVConfig.cmake文件的目录吗? -
你说得对,已编辑:) 仍然无法正常工作
-
消息
Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH表示变量CMAKE_PREFIX_PATH应该指定目录,您在配置OpenCV 时已将其传递给cmake。消息...set "OpenCV_DIR" to a directory containing one of the above files.表示在OpenCV_DIR变量中指定的目录应包含OpenCVConfig.cmake或opencv-config.cmake文件。