[CMake] How to obtain a list of target dependencies

Robert Dailey rcdailey.lists at gmail.com
Mon Mar 12 16:03:30 EDT 2018


Sometimes I need to manually take action on the dependencies of my
targets. Without keeping track of the dependencies externally using
global or custom target properties, is there a way to obtain the list
of targets that a target depends on? This would be the same list of
targets passed to `target_link_libraries()`. For bonus points I'd like
a flattened list of transitive dependencies, to avoid recursively
building this list myself.


More information about the CMake mailing list