[CMake] linking libraries statically

Omar Souka cmake at souka.com
Thu Feb 1 14:19:22 EST 2007


I'm building a shared library that links some external libraries
statically.  Something like this:

ADD_LIBRARY(foo SHARED ${SRC})
TARGET_LINK_LIBRARIES(foo
        /a/b/c/abc.a
        /d/e/f/def.a
)

This works fine.  I then have an executable that links to this library

ADD_EXECUTABLE(app ${CODE})
TARGET_LINK_LIBRARIES(app foo)

When the application is linked, it links in the same static libraries as the
shared library.  This seems like a bug to link the libraries twice.  Am I
doing something wrong?

Thanks,

Omar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20070201/2fa60322/attachment.htm


More information about the CMake mailing list