[CMake] Double linking / linking static libraries

Dennis Schridde devurandom at gmx.net
Wed Aug 4 03:34:35 EDT 2010


On Wednesday 04 August 2010 09:14:29 Ryan Pavlik wrote:
>   On 8/4/10 2:06
AM, Denis Scherbakov wrote:
> >>> * I also set link_directories to paths
containing the
> > 
> > libraries.
> > 
> > This is wrong. LINK_DIRECTORIES
should be a list of directories, where
> > libraries might be located, but
not the libraries itself.
> 
> Or better yet, skip the link_directories
command and use full paths to
> your libraries (as a find script should do)
as arguments to
> target_link_libraries.
> 
> Do you have any circular
dependencies?  If you do, libraries will need
> to be linked twice to get
all of the symbols resolved properly, in which
> case this is a
feature.
Shouldn't be. In fact all libraries seem to be linked two times.
This includes things like GL, GLU, Boost, Qt. I do not think there are any
dependencies involving them (except maybe Qt -> GL/GLU, but certainly not
the other way round).

> Is the double-linking actually causing a
> failure
to build?
Yes, it causes a build failure when I try to link the static
library (some DLL loader containing just two functions).

--Dennis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100804/392195f7/attachment.pgp>


More information about the CMake mailing list