[CMake] Get all required shared libs from a target

Alexander Neundorf a.neundorf-work at gmx.net
Sat Sep 5 13:49:31 EDT 2009


On Friday 28 August 2009, Michael Jackson wrote:
> If you pull the boost 1.39.0 sources there is an experimental CMake
> based build system. In those cmake files the developers have somehow
> figured out how to do what you want. For a given library, you can get
> all the dependencies.

Maybe you can file a feature request, so that you can do 
get_target_properties(libs yourlib LINK_INTERFACE_LIBRARIES)
works if you have set LINK_INTERFACE_LIBRARIES using TARGET_LINK_LIBRARIES(... 
LINK_INTERFACE_LIBRARIES)

If you haven't done that, it returns NOTFOUND. Maybe you could file a feature 
request that get_target_property(<var> <target> LINK_INTERFACE_LIBRARIES) 
should return the full set of linked libraries (which will be the link 
interface libraries) if LINK_INTERFACE_LIBRARIES has not explicitely been 
set.

For libraries you can also have a look at the <target>_LIB_DEPENDS variable, 
maybe that helps.

Alex


More information about the CMake mailing list