public_dependencies target property?


I’m trying to make sense of this cmake code in the probably vain hope of cleanly it up a bit:

The problem is, I can’t find ‘public_dependencies’ in the cmake docs here:

I basically get what it’s doing I just don’t understand the ${_input_link_libraries} parameter. The routine actually mostly works, it just seems to bundle a lot of extra stuff I suspect it doesn’t need to, and suspect the problem may be here-ish.

I’m also a bit confused by the use of LINK_LIBRARIES/INTERFACE_LINK_LIBRARIES stuff a few lines above - why don’t these have a ‘$’ prefix? Do they return all link libraries for all targets? Why are they here then?!?


public_dependencies is the variable to store the result of the property query.

These are property names. They’re stored in the _input_link_libraries variable so that get_target_property gets the “right” one.

It probably should stop when it finds a SHARED_LIBRARY and not recurse there as those libraries are already bundled into that library. Other than that, the nested function definition is odd…

Aha, so it’s collecting either the LINK_LIBRARIES or INTERFACE_LINK_LIBRARIES property of the given target into the target_dependencies var - simpler than I thought, must have been having a ‘senior moment’…