[CMake] Get all targets a target depends on

Matthew Woehlke matthew.woehlke at kitware.com
Fri Nov 29 11:25:42 EST 2013


On 2013-11-29 03:07, Dominik Bernhardt wrote:
> is it possible to get a list of all targets on which a particular target
> depends on. The only idea I have so far is to query the LINK_LIBRARIES
> target property. However that would only allow to get the libraries I'm
> linking with and for example no custom targets.
> Any ideas how to accomplish this task?

I guess you want to make use of this information in CMake, and are not 
just curious?

If you just want to know for your own information, you could use the 
Ninja generator; ninja has the ability to output a dependency graph as a 
dot file.

-- 
Matthew



More information about the CMake mailing list