Fwd: [CMake] Generating static and shared libs

Christian Ehrlicher Ch.Ehrlicher at gmx.de
Tue Nov 13 15:56:51 EST 2007


Alexander Camek schrieb:
> Hi,
> 
>>> I am using here MinGW C and C++ source code to build some libraries.
>>>
>>> Now what me wonders is that I am getting sometimes static libraries
>>> additional to my dynamic libraries.
>>
>> I think you are talking about the "import library"
>>
>> http://www.mingw.org/MinGWiki/index.php/sample%20DLL
> 
> Nope, I don't talk about that.
> 
> I am talking about the problem, that when I use ADD_LIBRARY(libname
> SHARED ${SOURCE}) and I let all my files create in a common directory
> setted with LIBRARY_OUTPUT_PATH, then sometimes both are created.
> 
> So as an example I find there both kind of files.
> I have got there a libname.dll and a libname.dll.a.
> 
> If this is a desired result, then why both the .dll and .dll.a are not
> generated.
> 
.dll.a is not a static lib in the way you know it. It's a static import
lib. See below.
> 
>> I don't know MinGW well but I think its different from static libs.
>>
>>> Although I always build shared libraries.
>>>
>>> What is the strategy when to build only the dynamic libraries and when
>>> to build both?
>>
>> I think you'll find answers in MinGW docs and not in CMake
> 
> I think this is a CMake problem ;).
> 
No, you *really* should read on www.mingw.org and inform you about
import libs.


Christian


More information about the CMake mailing list