building a ROS1 node that depends on a shared precompiled library
Hello,
this may be an easy question for the CMake experts I guess.
So I am writing a cpp ROS1 node that depends on a certain Optimization library. I want my node to build just fine when I run the catkin_make
command.
To build a cpp code (not part of a ROS node) that depends on that library I run the following commands
g++ -O -I$SNOPT/include -c sntoya.cpp -o sntoya.o
g++ -O sntoya.o -o sntoya -L$SNOPT/lib -lsnopt7_cpp
How I can have those commands done while building a ROS node. I believe I have to write something in the CMakeLists.txt
but I am not really sure where to start or what exactly to do.
I would appreciate some guidance and help.
Thank you :D
you already seem to recognise this is a CMake question. Technically we should close your question here, as it really is a CMake question, not a ROS one. Catkin (and even Ament) does not change anything here.
Limiting yourself to this ROS forum for answers is not necessary and is just going to take longer for you to get answers.
If you really want to keep it open here, please search the site (using Google: append
site:answers.ros.org
) for previous Q&As about this and mention them here in a comment. That way we can avoid suggesting things you've already seen and tried.As a start: #q208850.