[cmake-developers] Private link depends can be public package depends

Brad King brad.king at kitware.com
Tue Sep 24 08:29:10 EDT 2013


On 09/24/2013 05:40 AM, Stephen Kelly wrote:
> Because foo contains
> 
>  IMPORTED_LINK_DEPENDENT_LIBRARIES "bar"
> 
> the 'bar' target is part of the missing target check code in 
> cmExportFileGenerator::GenerateMissingTargetsCheckCode.
> 
> If bar was part of the same export set as foo, or if bar was an imported 
> target, that would not be the case. However, then the correct -rpath-link 
> entry may not be created for 'bar'. This has previously been considered a 
> minor issue. Downstream can add a find_package for bar if it is in an 
> unusual location.
[snip]
> My preference is the latter. The patch is quite simple:
> 
>   "IMPORTED_LINK_DEPENDENT_LIBRARIES",
> - iface->SharedDeps, properties, missingTargets);
> + iface->SharedDeps, properties, dummy);

That looks fine to me.  If the dependent libraries are imported then
CMake can generate correct -rpath-link flags, but if not the link can
work without the flags in common use cases anyway.  Also it restores
the behavior before GenerateMissingTargetsCheckCode in this case IIUC.

-Brad



More information about the cmake-developers mailing list