Add a new library (.so files) in project
Hi,
I need to use a library named 'lib" which contains many .so files. To use them, in CmakeList.txt I set:
targetlinklibraries( NodeName ${catkin_LIBRARIES}
${PROJECTSOURCEDIR}/lib/first_file.so
${PROJECTSOURCEDIR}/lib/second_file.so
)
and it worked.
The problem is that I have so many .so files in the library and it would be nightmare if we list all .so files as above. I tried to use such
${PROJECTSOURCEDIR}/lib/*.so
with a hope that this would include all .so file but it generated an error.
I also tried several ways using findlibrary() or addlibrary() but all weren't successful.
Could you please let me know your suggestion.
Thank you,
Asked by tuan on 2020-10-20 06:54:36 UTC
Comments
I'm sorry, but this is a pure CMake question, not a ROS question. In this case CMake == Catkin.
Please post your question on a more suitable forum instead.
Asked by gvdhoorn on 2020-10-20 07:14:33 UTC
Sorry if it causes any confusion. But I would confirm that this is a ROS related question and I face this problem when working on a ROS project. You can realize this in the setting of the Cmakelist file I mentioned in the question.
target_link_libraries( NodeName ${catkin_LIBRARIES}...
where NodeName is a node in the project.
Hope this clarification allows the question still in the post here.
Thanks.
Asked by tuan on 2020-10-20 07:19:35 UTC
The fact you link against
${catkin_LIBRARIES}
does not make this a ROS question, neither does the fact yourCMakeList.txt
builds a ROS node/package.Catkin does not change this either. It's really plain CMake.
target_link_libraries(..)
is basic CMake. It's not part of Catkin.You'd do yourself a favour by searching for generic CMake solutions to your problem, as you'll find there are many more resources to learn from. It does not make sense to limit your searches to ROS Answers in this case.
Asked by gvdhoorn on 2020-10-20 07:28:59 UTC