Static libzip with Visual Studio 2012

I am trying to create a small application using the libzip library. I downloaded and compiled libzip using this article:

libzip with Visual Studio 2010

The problem is that it compiles libraries dynamically, requiring the presence of both zlib.dll and zip.dll. I want to fully compile the application, so no additional DLLs are required. Does anyone know how I can do this?

Thanks!

+6
source share
1 answer

Ok ... here's the deal:

You need to go to lib \ CMakeLists.txt and add to the end (line in black)

ADD_LIBRARY (zip SHARED $ {LIBZIP_SOURCES} $ {LIBZIP_EXTRA_FILES})

ADD_LIBRARY (zipstatic STATIC $ {LIBZIP_SOURCES} $ {LIBZIP_EXTRA_FILES})

SET_TARGET_PROPERTIES (zip PROPERTIES VERSION 3.0 SOVERSION 3) TARGET_LINK_LIBRARIES (zip $ {ZLIB_LIBRARY})

INSTALL (NUMBERS zip ARCHIVE PURPOSE lib LIBRARY DESTINATION lib)

+7
source

All Articles