What causes a library (.so) to be copied to devel/lib
Hi guys,
I've got a project comprising approximately 30 packages. Some of these packages define libraries in the CMakeLists, using the add_library and target_link_libraries functions. I am wondering why only some of these packages create shared objects in devel/lib while others aren't.
Example: I've got a package (for simplicity say package "a") which defines a library. This package is referenced as <runtime_dep> by another package (b). Sadly, when running catkin build, no shared object is copied to devel/lib, resulting in runtime failure in node b.
EDIT: Thank you for your answers, but that doesn't seem to be what I am looking for.
I am using catkin_tools to build my project. I configure my build with catkin config --no-install, hence no install targets are executed.
Still, catkin puts some libraries in devel/lib. If I look at the $LD_LIBRARY_PATH after the build, I can see that the devel/lib directory is included there. My problem is that I don't know which statement causes a defined library to be copied there at build time.
All packages define the libraries using add_library, target_link_libraries and catkin_package(... LIBRARIES <xyz>), still some of them are not copied to devel/lib
Package definition of a package which doesn't create a shared object in devel/lib:
...
add_library(m_controllers
src/general.cpp
src/passthrough.cpp )
add_dependencies(m_controllers ${catkin_EXPORTED_TARGETS})
target_link_libraries(m_controllers ${catkin_LIBRARIES})
catkin_package(
CATKIN_DEPENDS
....
INCLUDE_DIRS include
LIBRARIES m_controllers
)
...
To add to @Akif's answer: note that for things to work in a devel workspace, you don't actually need to have any
install(..)
rules, just properly setupcatkin_package(.. LIBRARIES ..)
statements.Seeing your other question, can you describe how you setup your workspace(s), and how you interact with them?