Create and link ROS library
Hi, I have implemented a ROS library and I have "mylibrary.so" file. Now I want to use this library in another external project and I don't know how to do this. I have in my new project a CMakeLists.txt and in it I link my library in the following way:
INCLUDE_DIRECTORIES("path_to_include_directory")
ADD_EXECUTABLE(foo main.cpp)
TARGET_LINK_LIBRARIES(foo "path_to_my_library.so")
But this doesn't work and I get undefined reference to the implemented functions. My new project is not created with "catkin_init_workspace" since it's not a 100% ROS project, so... If I want to use my ros library, my new project (that is not a 100% ROS project, only uses my ros library for 2 little tasks) must be created with the catkin_init_workspace and create in it a node that uses this library? or are there any way to use my ros library into my new project without the catkin_workspace / node architecture?, I mean, creating something like:
-Project
|-build
|-src
|-CMakeLists.txt
|-main.cpp
And inside CMakeLists.txt something like:
TARGET_LINK_LIBRARIES(executable "path_to_my_library.so")