Fwd: [CMake] creating static library with references to other .lib files

Jesper Eskilson jesper at eskilson.se
Wed Jun 13 13:57:10 EDT 2007


Forgot to cc the list.

---------- Forwarded message ----------
From: Jesper Eskilson <jesper at eskilson.se>
Date: 2007-jun-13 19:56
Subject: Re: [CMake] creating static library with references to other .lib files
To: Brandon Van Every <bvanevery at gmail.com>


2007/6/13, Brandon Van Every <bvanevery at gmail.com>:

> Ok, so MSVC can do it, but AR can't.  So I guess you only care about MSVC.

Yes. Sorry, I forgot to say that.

> > > What you're asking for seems kinda weird.  What's the motive?
> > >
> >
> > foo.obj and bar.obj uses symbols in mydll.dll, and I want to allow users of
> > mystatic.lib to just have to link with mystaticlib.lib, and not with
> > mydll.lib.
>
> But why don't you just ship your users a dynamic lib?  As far as I
> know, there are no restrictions on dynamic libs including static libs.

That is an alternative, but it requires a non-trivial amount of work,
testing, documentation fixes etc., which I'd prefer not to embark on
at the moment.

I'm actually happy if I just can get hold of a CMake variable where I
can put extra flags to pass to lib when creating a static lib.
Something like

set(CMAKE_STATIC_LINKER_FLAGS "...")

--
/Jesper


-- 
/Jesper


More information about the CMake mailing list