Add a shared library to a catkin package
Hello,
I have compiled a third-party library from a non-catkin package and I would like to use this library in my project. I have already seen how to link a library against an executable as explained here and here, but there is still something I do not quite understand. As far as I know, in order to use the shared library in my nodes, I need the header files, so I can "#include" them in my .cpp file. But none of the mentioned sources seem to take care of that.
Should I add all the headers to the include_directories() macro in the CMakeLists?
i.e: The library I intend to use is libLanelet, so I compiled it using SCons and I obtained the library libLanelet.so. I copied this library into "package_path/libs". In my CMakeLists I have
target_link_libraries(node ${catkin_LIBRARIES} ${PROJECT_SOURCE_DIR}/libs/libLanelet.so)
Should I copy all .hpp files inside, say, "package_path/include" and then in the CMakeLists add
include_directories(${PROJECT_SOURCE_DIR}/include) ?
In case this is right is this the proper way to do it?
I have just started to "get my hands dirty" writing ROS code and I recently started learning C++, so many concepts are still unclear to me.
Regards