Add a new library (.so files) in project [closed]
Hi,
I need to use a library named 'lib" which contains many .so files. To use them, in CmakeList.txt I set:
target_link_libraries( NodeName ${catkin_LIBRARIES}
${PROJECT_SOURCE_DIR}/lib/first_file.so
${PROJECT_SOURCE_DIR}/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
${PROJECT_SOURCE_DIR}/lib/*.so
with a hope that this would include all .so file but it generated an error.
I also tried several ways using find_library() or add_library() but all weren't successful.
Could you please let me know your suggestion.
Thank you,
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.
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.
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.