Skip to content

CMP0028: Improve messages and backtraces

Brad King requested to merge brad.king/cmake:improve-CMP0028-messages into master

Since !6805 (merged) we have proper backtraces for link items both from LINK_LIBRARIES and INTERFACE_LINK_LIBRARIES. Use these to provide backtraces in CMP0028 messages that point to where the offending item is added rather than to the consuming target's creation.

Also report the target name whose link interface has an offending item, rather than the consuming target. Previously items linked via the link interface of a dependency were reported in CMP0028 messages as if directly linked by a target. Clarify the messages to indicate that an offending item is actually in the link interface of a given target, regardless of its consumer.

Move the check to the end of generation and look through the final set of link implementations and link interfaces that were used for generation. This avoids repeating messages on link interfaces that have multiple consumers.

Merge request reports