ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
When trying to create a header only catkin package you need to do two things.
This looks like the following in the CMakeLists.txt file
catkin_package(
INCLUDE_DIRS include
)
install(DIRECTORY include/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)
I believe the above is all you need, but if you run into issues you can also try adding the following between your catkin_package and install tags.
include_directories(
include
)
Once your header package is good to go you just need to add it as a dependency for your executable
find_package(catkin REQUIRED COMPONENTS
my_package
)
add_executable( my_executable_name src/my_source.cpp)
add_dependencies(my_executable_name ${catkin_EXPORTED_TARGETS})
Don't forget to also add it in the package.xml