I wand to implement in CMake a functionality that would enable the installation of a single binary/target through a make install-TARGET
command. This is fairly straightforward to do with a custom target. However, when the target binary in question is linked dynamically against other libs of the project (BUILD_SHARED_LIBS=ON
), I need to install the receptive libs as well. Is there any way to somehow query the list of libraries?
I've looked at the target properties, but haven't found anything relevant.
Tips on how to get the list of libs and/or other ways to implement the above described functionality would be very much appreciated!
[Edit]
Example:
Let's assume that there the project MyProj
has a CMake target "myprog" which generates the binary myprog
. I want to install only this binary with make install-myprog
. However myprog
links against libmy1.so
and the latter links against libmy2.so
, both part of MyProj
.
I need a mechanism to figure out that I need to install both libmy1.so
and libmy2.so
along myprog
.