[cmake-developers] Setting target properties before the target is defined ?
Stephen Kelly
steveire at gmail.com
Wed Mar 27 08:54:50 EDT 2013
Brad King <brad.king at ...> writes:
>
> On 02/20/2013 03:57 PM, Alexander Neundorf wrote:
> > On Wednesday 20 February 2013, Brad King wrote:
> >> Alex, does this do what you want?
> >
> > Looks good.
> > But shouldn't the IMPORTED_LINK_DEPENDENT_LIBRARIES libs be also taken into
> > account ?
>
> I think so, so the iface->SharedDeps list needs to be included in
> IMPORTED_LINK_INTERFACE_TARGETS_≤CONFIG> also.
The problem with this is that it will break working code. Not-found entries in
the LINK_DEPENDENT_LIBRARIES do not currently cause a build error. The only
effect (as far as I know) is that the target location is not available for
generating the correct RPATH information, which downstreams may or may not use.
I also find it unfortunate that the internal implementation detail dependencies
of a package would need to be found by the package. Eg, if I have
IMPORTED_LINK_DEPENDENT_LIBRARIES_RELWITHDEBINFO "Qt5::Script"
IMPORTED_LINK_INTERFACE_LIBRARIES_RELWITHDEBINFO "Qt5::Core"
in MyTarget, then MyTargetConfig.cmake will have to find_package(Qt5Script),
even though callers only need that to be found if they want the RPATH
information from it. Is there a better solution?
To avoid misunderstanding, I'm still just a reviewer on this topic. I'm not
'taking over responsibility for it'.
Thanks,
Steve.
More information about the cmake-developers
mailing list