ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
If you have the library source files you can add a library to your workspace adding the following lines to the CMakeLists.txt of the node you want to use the library.
#Declare a cpp library
add_library(my_library directory/of/source/my_library.cpp)
#This line has to be after the add_executable()
target_link_libraries(my_node my_library)
Since the library is loaded in the workspace, you only need to add_library() once. For next nodes only use target_link_linbraries()