ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Unfortunately, the default CMake install location is /usr/local, not a good destination for ROS packages. So, you need to configure your catkin workspace, somewhat like this example:
$ cd ~/catkin_ws/build
$ cmake ../src -DCMAKE_INSTALL_PREFIX=../install
Then, you need to add CMake install() commands to your CMakeLists.txt.
For example, if you need to install C++ headers where they can be found by other packages:
install(DIRECTORY include/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)
2 | No.2 Revision |
Unfortunately, the default CMake install location is /usr/local, not a good destination for ROS packages. So, you need to configure your catkin workspace, somewhat like this example:
$ cd ~/catkin_ws/build
$ cmake ../src -DCMAKE_INSTALL_PREFIX=../install
Then, you need to add CMake install() commands to your CMakeLists.txt.
For example, if you need to install C++ headers where they can be found by other packages:
install(DIRECTORY include/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)
Similarly, if there is a shared libraries needed by other packages at runtime:
install(
TARGETS your_shared_library
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
)
Note that catkin library names have system-wide scope, so make sure they clearly describe their role. Include names are less of an issue, since they are usually in a subdirectory under your package name.