How to include my own libraries in cmake to compile with rosmake?
Hi there, I am working in a thesis where I have to use ROS within a system (and the other way round). So far, what I have changed in the CMakeLists.txt is including the following lines:
rosbuild_add_executable(ROSPublisher2MaCIClient ROSPublisher2MaCIClient.cpp)
include_directories(../../../../include/utils)
target_link_libraries(${GIMUtils} ../../../../lib/libGIMutils.a)
include_directories(../../../../include/MaCI)
target_link_libraries(${MaCI} ../../../../lib/libMaCI.a)
include_directories(../../../../include/GIMI)
include_directories(../../../../include/GIMnetAP)
include_directories(../../../../include)
target_link_libraries(${GIMI} ../../../../lib/libGIMI.a)
include_directories(/usr/include/libxml2)
TARGET_LINK_LIBRARIES(xml2)
add_definitions(-DLINUX_OS)
But there's no way it's working. I get a lot of "undefined reference" errors and I don't have an idea of how to fix it. That's why I was wondering: Is this the way to do it? (at least, so far the lines I have included in the CMakeLists.txt or is there something I'm missing (or some other file I have to update to make it all work with rosmake).
Cheers,
@jlo The character limit is to encourage most information to be in the question and in a curated answer. Usually it's recommended for the original poster to update their question instead of replying in the comments. .