PRIVATE dependency propageted if CMP0079 applies
Policy CMP0079 (introduced in 3.13) allows to use target_link_libraries in a different directory. But a PRIVATE dependency gets propageted as if it was PUBLIC.
The attached example has a library named a
on toplevel, and b1
, b2
, c1
and c2
in a subdirectory.
The dependency a->b1->c1
shows the correct behavior, because b1->c1
was defined in the subdirectory.
The dependency a->b2->c2
shows the problem, because b2->c2
was defined in the toplevel file.
This example uses a compiler define and the property INTERFACE_LINK_LIBRARIES
to show the problem, but I assume that any property is affected.