ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

The easiest way is to have the package export your include directory as Gary mentioned. The install() call is not really necessary.

You should create a folder named include/ < name of package > / where you put all the header files (*.hpp) of the package.

Then the package that exports the library should have the following in the CMakeLists to be able to export the header files:

catkin_package(
      LIBRARIES visionutil rosutil
      INCLUDE_DIRS include)

include_directories(
   include
   ${catkin_INCLUDE_DIRS})

Then the other package should then be able to see the header files as (you might have to run catkin_make or cmake first):

 #include <name_of_package/header_file.h>

In your case:

#include <proj_util/rosutil.hpp>

The easiest way is to have the package export your its include directory as Gary mentioned. The install() call is not really necessary.

You should create a folder named include/ < name of package > / (include/proj_utils in your case) where you put all the header files (*.hpp) of the package.

Then the package that exports the library should have the following in the CMakeLists to be able to export the header files:

catkin_package(
      LIBRARIES visionutil rosutil
      INCLUDE_DIRS include)

include_directories(
   include
   ${catkin_INCLUDE_DIRS})

Then the other package should then be able to see the header files as (you might have to run catkin_make or cmake first):

 #include <name_of_package/header_file.h>

In your case:

#include <proj_util/rosutil.hpp>