blt
blt copied to clipboard
blt_print_target_info(): Add ability to print children target info
This would be helpful to track down where an inherited flag came from. Something like
blt_print_target_info(NAME foo CHILDREN true)
[Foo: CMake Target] ...lots of info about Foo... [Foo -> Bar] [Bar: CMake Target] ...lots of info about Bar...
Good idea @white238
Since ~~blt_print_target_info
~~ blt_print_target_properties()
dumps a ton of info, it might be more generally useful to instead always add two lines to the output:
- a one line list of all of its direct upstream dependencies (parents) and
- a one line list of its direct downstream dependencies (children)
e.g.
[Foo: CMake Target]
...
[Foo Depends on: Bar1 Bar2 Bar3 ... ]
[Foo Dependents: Baz1 Baz2 Baz3 ... ]
Or were you think that this would be recursive, and dump all info about children, grandchildren, great-grandchildren, ... ?
EDIT: Fixed typos and clarified.
Also, assuming we can track/access the direct parents and children of a target, it would be useful to expose a blt macro that outputs the parents and/or children of a target to a LIST
(with optional support for transitive dependencies).
I think adding tracking and printing of dependencies would be easy and that should be step one. Then adding a recursive ability to print all children info (or all known targets) to the screen with the previously information. This came up with helping GEOSX track down where a flag was coming from.
Fixed in #590