Take a look at vcpkg. It is a package manger for the Windows platform. It builds and installs many open source libraries for Windows. libzip is mentioned specifically as one of the ports.

Answer from catbacker on Stack Overflow
🌐
GitHub
github.com › nih-at › libzip › blob › main › CMakeLists.txt
libzip/CMakeLists.txt at main · nih-at/libzip
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ... install(EXPORT ${PROJECT_NAME}-bin-targets NAMESPACE libzip:: FILE ${PROJECT_NAME}-bin-targets.cmake
Author   nih-at
🌐
Libzip
libzip.org › INSTALL
INSTALL · libzip
CFLAGS=-DMY_CUSTOM_FLAG cmake ..
🌐
Libzip
libzip.org › news
News · libzip
CMake usage best practice cleanups. ... Fixes warnings reported by PVS-Studio. Add LIBZIP_DO_INSTALL build setting to make it easier to use libzip as subproject.
🌐
Fossies
fossies.org › linux › libzip › CMakeLists.txt
libzip: CMakeLists.txt | Fossies
1 cmake_minimum_required(VERSION 3.10) 2 3 list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) 4 if (${CMAKE_VERSION} VERSION_LESS "3.17.0") 5 list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake-compat) 6 endif() 7 8 project(libzip 9 VERSION 1.11.4 10 LANGUAGES C) 11 12 if(NOT libzip_VERSION_PATCH) 13 set(libzip_VERSION_PATCH 0) 14 endif() 15 16 option(ENABLE_COMMONCRYPTO "Enable use of CommonCrypto" ON) 17 option(ENABLE_GNUTLS "Enable use of GnuTLS" ON) 18 option(ENABLE_MBEDTLS "Enable use of mbed TLS" ON) 19 option(ENABLE_OPENSSL "Enable use of OpenSSL" ON) 20 option
🌐
GitHub
github.com › nih-at › libzip › blob › main › INSTALL.md
libzip/INSTALL.md at main · nih-at/libzip
This guide shows how to build libzip from source. It assumes basic familiarity with using the command line and building software from source. This guide uses cmake to invoke all required commands to be platform-independent.
Author   nih-at
🌐
CERN
root-forum.cern.ch › t › libzip-mess-root-cmake-problem › 48503
Libzip mess (ROOT cmake problem) - ROOT - ROOT Forum
January 22, 2022 - Hi, building ROOT from source (git head) find_package(ZLIB REQUIRED) from core/zip/CMakeLists.txt returns ZIP lib from my Postgre14 installation (cause it’s in the $PATH) which is wrong. How to avoid this mess and to force to use the “builtin ZIP”? Why “the builtin ZIP” is not a default ...
🌐
Debian
sources.debian.org › src › libzip › 1.7.3-1 › libzip-config.cmake.in
File: libzip-config.cmake.in | Debian Sources
February 3, 2026 - sources / libzip / 1.7.3-1 / libzip-config.cmake.in · package info (click to toggle) libzip 1.7.3-1 · links: PTS, VCS · area: main · in suites: bookworm, bullseye · size: 7,760 kB ·
Find elsewhere
🌐
Stack Exchange
unix.stackexchange.com › questions › 480563 › libzip-linux-cross-compile-configuration
compiling - libzip Linux cross-compile configuration - Unix & Linux Stack Exchange
November 8, 2018 - [ 92%] Building C object regress/CMakeFiles/tryopen.dir/tryopen.c.o [ 94%] Building C object src/CMakeFiles/zipcmp.dir/zipcmp.c.o [ 94%] Linking C executable add_from_filep [ 94%] Linking C executable fopen_unchanged [ 94%] Linking C executable tryopen [ 94%] Building C object regress/CMakeFiles/hole.dir/source_hole.c.o [ 94%] Linking C executable zipmerge ../lib/libzip.so.5.0: undefined reference to `inflate' ../lib/libzip.so.5.0: undefined reference to `crc32' ../lib/libzip.so.5.0: undefined reference to `zError' ../lib/libzip.so.5.0: undefined reference to `deflate' ../lib/libzip.so.5.0: un
🌐
GitHub
github.com › ctabin › libzippp
GitHub - ctabin/libzippp: C++ wrapper for libzip · GitHub
Example: -DCMAKE_PREFIX_PATH=/home/user/libzip-1.11.4:/home/user/zlib-1.3.2 ... Windows: Open generated project in MSVC. Build the INSTALL target to install. Set via commandline as cmake -DNAME=VALUE <other opts> or via CMake GUI or CCMake Add Cache Entry.
Starred by 454 users
Forked by 97 users
Languages   C++ 86.8% | CMake 5.9% | Makefile 4.5% | Batchfile 2.8%
🌐
GitHub
github.com › microsoft › vcpkg › issues › 2973
cmake find_package(libzip) support · Issue #2973 · microsoft/vcpkg
March 6, 2018 - It would be nice if find_package(libzip REQUIRED) would work after vcpkg.exe install libzip. Installing something like the attached files to the installed \share\libzip when installing libzip should do it. libzip-config.cmak...
Author   microsoft
🌐
CMake
cmake.org › cmake › help › latest › module › FindZLIB.html
FindZLIB — CMake 4.3.3 Documentation
Finds the native zlib data compression library: · This module provides the following Imported Targets:
🌐
GitHub
github.com › TheImagingSource › tiscamera › blob › master › cmake › modules › FindLibZip.cmake
tiscamera/cmake/modules/FindLibZip.cmake at master · TheImagingSource/tiscamera
# Locate libzip · # This module defines · # LIBZIP_LIBRARY · # LIBZIP_FOUND, if false, do not try to link to libzip · # LIBZIP_INCLUDE_DIR, where to find the headers · # · FIND_PATH(LIBZIP_INCLUDE_DIR zip.h · $ENV{LIBZIP_DIR}/include · $ENV{LIBZIP_DIR} /usr/local/include ·
Author   TheImagingSource
🌐
Fossies
fossies.org › linux › libzip › INSTALL.md
libzip: INSTALL.md | Fossies
May 23, 2025 - DOCUMENTATION_FORMAT: choose one of man, mdoc, and html for the installed documentation (default: decided by cmake depending on available tools) LIBZIP_DO_INSTALL: If you include libzip as a subproject, link it statically and do not want to let it install its files, set this variable to OFF.
🌐
GitHub
github.com › ctabin › libzippp › blob › master › README.md
libzippp/README.md at master · ctabin/libzippp
December 8, 2019 - Example: -DCMAKE_PREFIX_PATH=/home/user/libzip-1.11.4:/home/user/zlib-1.3.2 ... Windows: Open generated project in MSVC. Build the INSTALL target to install. Set via commandline as cmake -DNAME=VALUE <other opts> or via CMake GUI or CCMake Add Cache Entry.
Author   ctabin
Top answer
1 of 8
29

Edit:

Before starting on the answer provided here, it appears that this may no longer be an issue going by @Thomas Klausner's answer below.


The following should get you a VS10 solution:

  1. If you've not already done so, install CMake

  2. Download and extract zlib to e.g. C:\devel. The download links are about halfway down the homepage. Currently this provides zlib version 1.2.7.

    • To work around this CMake bug which affects 64-bit Windows only, add

      if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND MSVC)
        set_target_properties(zlibstatic PROPERTIES STATIC_LIBRARY_FLAGS "/machine:x64")
      endif()
      

      to the end of C:\devel\zlib-1.2.7\CMakeLists.txt

  3. Download and extract libzip to e.g. C:\devel

  4. In a VS10 command prompt, cd C:\devel\zlib-1.2.7

  5. mkdir build && cd build

  6. cmake .. -G"Visual Studio 10" -DCMAKE_INSTALL_PREFIX="C:\devel\installed\zlib" This sets the install path to C:\devel\installed\zlib rather than the default C:\Program Files\zlib. For 64-bit Windows, use "Visual Studio 10 Win64" as the -G parameter.

  7. msbuild /P:Configuration=Debug INSTALL.vcxproj

  8. msbuild /P:Configuration=Release INSTALL.vcxproj

  9. cd C:\devel\libzip-0.10.1

  10. mkdir build && cd build

  11. cmake .. -G"Visual Studio 10" -DCMAKE_PREFIX_PATH="C:\devel\installed\zlib" Set the path to wherever you installed zlib so that CMake can find zlib's include files and libs. Again, for 64-bit Windows, use "Visual Studio 10 Win64" as the -G parameter.

This should result in C:\devel\libzip-0.10.1\build\libzip.sln. It looks like there are a few POSIX-specific problems in the code, but they should hopefully be fairly easy to resolve (e.g. in zipconf.h #include <inttypes.h> needs replaced with #include <stdint.h>; there are some snprintf calls needing replaced e.g. with _snprintf).

2 of 8
4

I can't comment, so just in addition to Fraser's answer: In the last days, libzip's latest repository version should compile on VS without additional patches. Please try it out and let the developers know if parts are still missing.

🌐
Vcpkg
vcpkg.io › en › package › libzip.html
vcpkg package - libzip
June 19, 2025 - portfile.cmake · use-requires.patch · vcpkg.json · BSD-3-Clause · 2025-06-19 · This package supports the following triplets: Supported on all triplets · Unavailable · https://github.com/nih-at/libzip · In classic mode, run the following vcpkg command: vcpkg install libzip ·
🌐
Arch Linux
archlinux.org › packages › extra › x86_64 › libzip › files
Arch Linux - libzip 1.11.4-1 (x86_64) - File List
usr/lib/cmake/libzip/libzip-targets.cmake · usr/lib/cmake/libzip/modules/ usr/lib/cmake/libzip/modules/FindMbedTLS.cmake · usr/lib/cmake/libzip/modules/FindNettle.cmake · usr/lib/cmake/libzip/modules/Findzstd.cmake · usr/lib/libzip.so · usr/lib/libzip.so.5 ·
🌐
Stack Overflow
stackoverflow.com › questions › 67180256 › building-libzip-on-macos-with-cmake-unable-to-find-right-package
Building Libzip on MacOS with Cmake unable to find right package - Stack Overflow
wget -c https://github.com/nih-at/libzip/releases/download/v1.7.3/libzip-1.7.3.tar.gz tar -zxf libzip-1.7.3.tar.gz cd libzip-1.7.3 mkdir build && cd build ... I had previously installed libbz2 [and other dependencies like GnuTLS, Nettle, XZ, etc.] in /usr/local, and I can verify that libbz2.dylib is in /usr/local/lib. I've tried setting CMAKE_PREFIX_PATH speifically to /usr/local.