blt icon indicating copy to clipboard operation
blt copied to clipboard

blt_print_target_info(): Add ability to print children target info

Open white238 opened this issue 4 years ago • 3 comments

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...

white238 avatar Mar 05 '20 23:03 white238

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.

kennyweiss avatar Mar 06 '20 00:03 kennyweiss

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).

kennyweiss avatar Mar 06 '20 00:03 kennyweiss

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.

white238 avatar Mar 06 '20 22:03 white238

Fixed in #590

white238 avatar Jun 06 '23 05:06 white238