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

Dan Kegel dank at kegel.com
Tue Sep 17 13:05:52 EDT 2013


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


More information about the CMake mailing list