[CMake] link-interface-libs not empty (or auto-filled)

Alexander Neundorf a.neundorf-work at gmx.net
Thu Sep 2 12:53:33 EDT 2010


On Thursday 02 September 2010, Andreas Pakulat wrote:
> Hi,
>
> I've got a small problem here, I'm building an installing a static
> library which links (among other things) against QtCore. I'm also using
> the cmake install(TARGETS .. EXPORT) stuff to export a Target.cmake file
> with the library as imported target. Last but not least this lib has
> some deps in its public API and hence I'm using LINK_INTERFACE_LIBRARIES
> to add those. Unfortunately for some reason QtCore is also added which
> I'd like to avoid (as it creates a dependency upon an absolute path to
> Qt in the installed stuff). I've already tried setting the target
> property to "", but its still added automatically by cmake.
>
> Anybody knows of something in cmake that would explain this?

This is a static lib ?
IIRC for static libs the link interface is always full, since you always need 
the full list of libs (static libs are not actually linked). When your 
libfoo.a is created, this libfoo.a is not "linked" against QtCore, but still 
it references it. So QtCore has to be kept in the linker interface.

Alex


More information about the CMake mailing list