ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A answers.ros.org
Ask Your Question
4

catkin can't find PCLConfig.cmake

asked 2013-09-19 17:27:15 -0500

ndepalma gravatar image

updated 2013-09-19 17:54:21 -0500

So I did the standard catkin_create_pkg with PCL as a dependency and I'm getting this with catkin_make:

CMake Error at /opt/ros/hydro/share/catkin/cmake/catkinConfig.cmake:72 (find_package):
  Could not find a configuration file for package PCL.

  Set PCL_DIR to the directory containing a CMake configuration file for PCL.
  The file will have one of the following names:

    PCLConfig.cmake
    pcl-config.cmake

Call Sta-name>ck (most recent call first):
  <proj/CMakeLists.txt:8 (find_package)


-- Configuring incomplete, errors occurred!
Invoking "cmake" failed

Just doing some basic file searching, I believe that all of the cmake config files are in /opt/ros/hydro/share - is that correct?

If so - here are a couple of directories that seem relevant:

ls -l /opt/ros/hydro/share/pcl
total 4
-rw-r--r-- 1 root root 1480 Jul 23 18:43 package.xml

ls -l /opt/ros/hydro/share/pcl-1.7/
total 32
-rw-r--r-- 1 root root 27024 Aug 23 15:37 PCLConfig.cmake
-rw-r--r-- 1 root root   431 Aug 23 15:37 PCLConfigVersion.cmake

What should I do to catkin to make it realize these files are in front of its face?

Alternatively - how do I do the short term thing and night PCL_DIR? I tried this at one point above the find_packages line in my CMakeLists.txt :

set(pcl_DIR "/opt/ros/hydro/share/pcl-1.7/")

but it didn't do anything :(

Thanks for any help!

edit retag flag offensive close merge delete

Comments

1

You need to update your packages and explicitly remove the `ros-hydro-pcl` package, as of the official Hydro release the pcl debs should be `libpcl-1.7-all` and `libpcl-1.7-all-dev` rather than the old `ros-hydro-pcl` deb. You'll know you have the right one because files like the `PCLConfig.cmake` will be in `/usr/share` rather than `/opt/ros/hydro/share`.

William gravatar imageWilliam ( 2013-09-19 18:48:36 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted
5

answered 2013-09-19 18:46:25 -0500

William gravatar image

catkin_create_pkg does not take non-catkin packages as arguments by default, you must pass them as parameters to the --sys-deps argument. PCL is not a catkin package it is a system dependency on par with Boost and other external dependencies.

You can, however, depend on pcl_ros which pulls in PCL as a transitive dependency.

Otherwise, you will need to depend on PCL like this:

find_package(PCL REQUIRED)
...
include_directories(${PCL_INCLUDE_DIRS})
...
link_directories(${PCL_LIBRARY_DIRS})
....
target_link_libraries(YOUR_TARGET ${PCL_LIBRARIES})

The pcl_ros package's CMakeLists.txt is a good example of this:

https://github.com/ros-perception/perception_pcl/blob/hydro-devel/pcl_ros/CMakeLists.txt

edit flag offensive delete link more

Comments

Side question: what is keeping catkin from understanding how to find system level dependencies vs ros packages? Is this just to keep from getting into dependency hell?

ndepalma gravatar imagendepalma ( 2013-09-24 08:10:38 -0500 )edit

There is no consistency for finding system level packages. Some use `pkg-config`, others `cmake` and when they do use `cmake` they use widely different variable names and so we can't assume anything about system level dependencies, for example we can't know if the package provides us with `<pkg>_INCLUDE_DIRS` or `<pkg>_INCLUDE_DIR`.

William gravatar imageWilliam ( 2013-09-24 14:16:00 -0500 )edit
0

answered 2015-07-24 10:23:32 -0500

vahidz gravatar image

libpcl-all works for me.

edit flag offensive delete link more
0

answered 2013-09-19 18:15:36 -0500

ndepalma gravatar image

I kind of figured it out but the answer doesn't make any sense. I removed PCL in the find_package() line and it worked. I think this is because it is installed locally and the linking is covered by ros_pcl and the includes are on the standard path: /usr/include.

But if I keep PCL on find_package() line - shouldn't it still be fine? I don't know, I think there is still a canonical answer waiting out there. Let me know if someone has an idea.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-09-19 17:27:15 -0500

Seen: 10,342 times

Last updated: Sep 19 '13