[cmake-developers] Setting the link interface and dependencies in one command

Stephen Kelly steveire at gmail.com
Sat Oct 1 09:41:43 EDT 2011


Hi David, 

This is related to my patch to set the link_interface_libraries to empty and 
to:

http://thread.gmane.org/gmane.comp.kde.devel.buildsystem/6622/focus=72030

Quoting:

> Setting LINK_INTERFACE_LIBRARIES to empty is still needed and wanted.
> By default, all libraries a target is linked agaonst are in the
> LINK_INTERFACE, which leads to unnecessary dependencies and increased load
> time.
> The alternative would be not to set it to empty, and expect our developers
> to take care of it. I think this is not realistic.
> So I'm quite sure we still want that


David Cole wrote: 
> I'm going to say wait until Brad replies here, but I do not see a
> problem with that, *if* it's actually necessary. (Other than the
> obvious problem, which is that LINK_INTERFACE and
> LINK_INTERFACE_LIBRARIES are very close to each other and people will
> get them confused, and constantly be looking at the documentation to
> try to figure out which is which... A distinguishing naming
> difference, if you could come up with one, would be better. i.e.,
> names where you can tell what the meaning is for each, without
> referring to the documentation...)

set_target_libraries(foo
  bar baz
  LINK_DEPENDENCY_LIBRARIES
  bat mar
)

So bat and mar do not become part of the link interface libraries?

This is analogous to the IMPORTED_LINK_DEPENDENCY_LIBRARIES I think.

> 
> I guess I don't fully understand what you're doing here. If the
> libraries are necessary as actual dependencies, then why do they also
> have to be in the "link interface libraries" list...? I thought that
> list was just to indicate that you need the libraries, but that things
> that link to your library do not need them. 

Actually, I think the opposite is true. Things in the "link interface 
libraries" list are not actually linked against.

By putting things in the "link interface libraries" list you indicate that 
things that use your library also need to link against the things in the 
"link interface libraries" list.

> If they are actual, hard
> dependencies, then how could things that link to your library *not*
> need them, too?

Is this still an issue, given the above?

Thanks,

Steve.





More information about the cmake-developers mailing list