ROS package building using Snapcraft giving error for finding system libraries like PCL and OpenCV
System: OS: Ubuntu 16.04 ROS version: kinetic.
Hello All, I am beginner into ROS and have been following ROS tutorial. I have created "beginner_tutorials" and further trying to create SNAP package using below link. http://wiki.ros.org/ROS/Tutorials/Pac...
As per tutorial it will create snap but when I adds some more libraries dependency into beginner_tutorials's CMakeList.txt file, then running "snapcarft" is giving error and snapcraft is not finding system installed PCL and OpenCV libraries.
Below is the Error:
""" .... .... -- Boost version: 1.58.0 -- Found the following Boost libraries: -- system CMake Warning at CMakeLists.txt:11 (find_package): By not providing "FindPCL.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "PCL", but CMake did not find one.
Could not find a package configuration file provided by "PCL" with any of the following names:
PCLConfig.cmake
pcl-config.cmake
Add the installation prefix of "PCL" to CMAKE_PREFIX_PATH or set "PCL_DIR" to a directory containing one of the above files. If "PCL" provides a separate development package or SDK, be sure it has been installed.
CMake Error at CMakeLists.txt:12 (find_package): 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.
-- Configuring incomplete, errors occurred! See also "/root/parts/workspace/build/build_isolated/beginner_tutorials/CMakeFiles/CMakeOutput.log". Makefile:742: recipe for target 'cmake_check_build_system' failed make: * [cmake_check_build_system] Error 1
"""
Similar project will compile fine when I run using "catkin_make" here it is able to find PCL and OpenCV without any problem, but snapcraft is not. I have installed PCL 1.9 version in my machine from git compiled from source and deployed. cmake find_package() is able to find PCL for any other projects only snapcraft is giving error.
Let me know what am I missing ? or how to fix this. My goal is create ROS packages using SNAP that will have dependency to system libraries like PCL and OpenCV.
Below is my modified CMakeLists.txt:
""
%Tag(FULLTEXT)%
cmake_minimum_required(VERSION 2.8.3) project(beginner_tutorials)
Find catkin and any catkin packages
find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs genmsg)
set(PCL_DIR "/usr/local/share/pcl-1.9/")
find_package(Boost REQUIRED COMPONENTS system) find_package(PCL 1.9 REQUIRED) find_package(OpenCV REQUIRED)
Declare ROS messages and services
add_message_files(FILES Num.msg) add_service_files(FILES AddTwoInts.srv)
Generate added messages and services
generate_messages(DEPENDENCIES std_msgs)
Declare a catkin package
catkin_package()
Build talker and listener
include_directories(include ${catkin_INCLUDE_DIRS})
add_executable(talker src/talker.cpp) target_link_libraries(talker ${catkin_LIBRARIES}) add_dependencies(talker beginner_tutorials_generate_messages_cpp)
add_executable(listener src/listener.cpp) target_link_libraries(listener ${catkin_LIBRARIES}) add_dependencies(listener beginner_tutorials_generate_messages_cpp)
Install talker and listener
install(TARGETS talker ...