[CMake] What is the prescribed way to link in dependencies for a static library

James Bigler jamesbigler at gmail.com
Tue Sep 17 13:12:33 EDT 2013


On Tue, Sep 17, 2013 at 11:05 AM, Dan Kegel <dank at kegel.com> wrote:

> On Tue, Sep 17, 2013 at 9:41 AM, James Bigler <jamesbigler at gmail.com>
> wrote:
> > I have a static library I found using find_library.  Typically with
> shared
> > libraries I just link against the library and the dependencies come along
> > for the ride.
> >
> > What is the prescribed way of doing this for static libraries?
>
> How static are you trying to be?
>
> For comparison, it's worth noting that pkg-config doesn't support
> mixed static+dynamic linking,
> https://bugs.freedesktop.org/show_bug.cgi?id=9917
> probably because it's hard to know which dependencies one wants to
> be static, and which dynamic.
>
> (Me, I think I just manually find and add the dependencies as if my
> app depended on them.)
> - Dan
>

I'm not trying to be particularly static.  I just need my symbols to be
resolved at the point where the shared library is linked.  I think I'm just
going to add the missing libraries to my library variable.

James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130917/8e885163/attachment.htm>


More information about the CMake mailing list