ros indigo版本需要手动安装opencv3
sudo apt-get install ros-indigo-opencv3
但在编译whycon时,出现错误
CMake Error in whycon/CMakeLists.txt:
Imported target "opencv_xphoto" includes non-existent path
"/usr/include/opencv-3.1.0-dev/opencv"
in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
* The path was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and references files it does not
provide.
CMake Error in whycon/CMakeLists.txt:
Imported target "opencv_xphoto" includes non-existent path
"/usr/include/opencv-3.1.0-dev/opencv"
in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
* The path was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and references files it does not
provide.
-- Generating done
-- Build files have been written to: /home/ubuntu/catkin_whycon/build
Invoking "cmake" failed
可以看到"/usr/include/opencv-3.1.0-dev/opencv"路径并不存在。
解决方案:
修改/opt/ros/indigo/share/OpenCV-3.1.0-dev中的OpenCVConfig.cmake文件,修改如下:
113:get_filename_component(OpenCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH CACHE)
改成
113:get_filename_component(OpenCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH )
即可编译通过
参考链接:http://community.bwbot.org/topic/153/kinetic-opencv-cmake-conf-%E6%96%87%E4%BB%B6%E7%9A%84bug%E4%BF%AE%E5%A4%8D/2
---------------------
作者:sunyoop
来源:CSDN
原文:https://blog.csdn.net/sunyoop/article/details/79940885
版权声明:本文为博主原创文章,转载请附上博文链接!