add a custom library?
Hi there!
I am a robotics hobbyist and just started with ROS. I have a custom library (lets call it customLibrary-1.0) that I would like to integrate in my first ROS node. It is my first time using cmake (I am used to autotools) so I am a bit lost with it.
Usually to compile a program that uses the custom library I would do something like:
g++ -o myprogram myprogram.cpp `pkg-config customLibrary-1.0 --cflags --libs`
The only special thing about customLibrary-1.0 is that it depends on otherCustomLibrary-3.0, but pkg-config takes care of that for me. The result of the pkg-config command would be something like:
-I/usr/local/include/customLibrary-1.0 -I/usr/local/include/otherCustomLibrary-3.0 -L/usr/local/lib -lcustomLibrary-1.0 -lotherCustomLibrary-3.0
How can I add that library into cmake? I have been reading other posts and surfed the web, but I am confused. Some people suggest using the macros: include_directories() and target_link_libraries(). In other places I read that I should write a file named findCustomLibrary-1.0.cmake full with a lot of macros. How do grown-ups do it? :D
Thanks in advance and sorry for the newbie question.