[CMake] Installing only a library dll and not the .lib file

Nils Gladitz nilsgladitz at gmail.com
Sat May 24 11:01:30 EDT 2014


On 24.05.2014 16:51, Rick McGuire wrote:
> Our project creates a number of dlls that get installed as part of the 
> core component and also has a development library that's an optional 
> install piece.  The .lib files only get installed if the development 
> library is selected.
>
> I'm able to get these pieces in different components by specifying the 
> component for both the LIBRARY and ARCHIVE destinations.  That seems 
> to work ok.  However, we don't want to include .lib files for all of 
> the dlls in the development kit, only those that implement official 
> APIs of the product.  If I omit the ARCHIVE designation on the 
> install() command, I get the following error:
>
>
> CMake Error at CMakeLists.txt:887 (install):
>   install Library TARGETS given no DESTINATION!
>
> How can I install just the .dll file, or failing that cause the 
> ARCHIVE file portion of the install to end up in a bit-bucket so that 
> NSIS never physically installs it?
>

SHARED libraries on Windows have a RUNTIME (.dll) and ARCHIVE (.lib) 
portion.
You can omit one but not both.

On Windows the LIBRARY destination is only used for MODULE libraries.

Nils




More information about the CMake mailing list