I am using ROS and I have an external library consisting of a static library foo.a
and a path with header.
Now my CmakeLists.txt looks like this:
...
include_directories(/home/foo/include/)
find_library(LIB_TO_Include foo /home/foo/lib/static) //here is the foo.a
cs_add_library(${PROJECT_NAME} src/bar.cc)
catkin_add_gtest(test_bar test/test_bar.cc
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}})
target_link_libraries(test_bar ${LIBRARY_NAME} ${LIB_TO_Include})
...
So the tests work. But when I include this package into another package I get the following errors:
bar.o undefined referenes to functions of foo
So my package does not have any executable to which I could link my external library so how would I integrate it than? How can I correctly link that external library?