head	1.1;
branch	1.1.1;
access;
symbols
	zlib-1-4-0:1.1.1.2
	perseant-exfatfs-base-20261102:1.1.1.1
	zlib-1-3-2:1.1.1.1
	ZLIB:1.1.1;
locks; strict;
comment	@# @;


1.1
date	2026.05.03.16.34.35;	author christos;	state Exp;
branches
	1.1.1.1;
next	;
commitid	WC5vTA5Qzr0V6oEG;

1.1.1.1
date	2026.05.03.16.34.35;	author christos;	state Exp;
branches;
next	1.1.1.2;
commitid	WC5vTA5Qzr0V6oEG;

1.1.1.2
date	2026.11.11.15.49.08;	author christos;	state Exp;
branches;
next	;
commitid	9erRToM6R4J4G33H;


desc
@@


1.1
log
@Initial revision
@
text
@cmake_minimum_required(VERSION 3.12...3.31)

project(
    zlib1-dll
    LANGUAGES C
    VERSION 1.3.2
    HOMEPAGE_URL "https://zlib.net/"
    DESCRIPTION "zlib1.dll is the legacy DLL with zlib and minizip")

# ============================================================================
# configuration
# ============================================================================

if(NOT WIN32)
    message(FATAL_ERROR "This creates zlib1.<DLL>, Nothing else")
endif(NOT WIN32)

option(ENABLE_BZIP2 "Build with bzip2 support" OFF)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)

include(CheckCSourceCompiles)
include(CheckFunctionExists)
include(CheckIncludeFile)
include(CMakePackageConfigHelpers)
include(CheckTypeSize)
include(CPack)
include(GNUInstallDirs)

if(NOT ZLIB_CONF_WRITTEN)
    set(CONF_OUT_FILE ${zlib1-dll_BINARY_DIR}/zconf.h.cmakein)
    file(READ ../../zconf.h ZCONF_CONTENT LIMIT 245)
    file(WRITE ${CONF_OUT_FILE} ${ZCONF_CONTENT})
    file(APPEND ${CONF_OUT_FILE} "#cmakedefine Z_PREFIX 1\n")
    file(APPEND ${CONF_OUT_FILE} "#cmakedefine HAVE_STDARG_H 1\n")
    file(APPEND ${CONF_OUT_FILE} "#cmakedefine HAVE_UNISTD_H 1\n")
    file(READ ../../zconf.h ZCONF_CONTENT OFFSET 244)
    set(FIRST_ITEM TRUE)

    foreach(item IN LISTS ZCONF_CONTENT)
        if(FIRST_ITEM)
            string(APPEND OUT_CONTENT ${item})
            set(FIRST_ITEM FALSE)
        else(FIRST_ITEM)
            string(APPEND OUT_CONTENT "\;" ${item})
        endif(FIRST_ITEM)
    endforeach(item IN LISTS ${ZCONF_CONTENT})

    file(APPEND ${CONF_OUT_FILE} ${OUT_CONTENT})
    set(ZLIB_CONF_WRITTEN
        TRUE
        CACHE BOOL "zconf.h.cmakein was created")
    mark_as_advanced(ZLIB_CONF_WRITTEN)
endif(NOT ZLIB_CONF_WRITTEN)

if(ENABLE_BZIP2)
    find_package(BZip2 REQUIRED)
endif(ENABLE_BZIP2)

#
# Check for fopen64
#
check_function_exists(fopen64 HAVE_FOPEN64)

#
# Check to see if we have large file support
#
set(CMAKE_REQUIRED_DEFINITIONS -D_LARGEFILE64_SOURCE=1)
check_type_size(off64_t OFF64_T)
unset(CMAKE_REQUIRED_DEFINITIONS) # clear variable

#
# Check for fseeko
#
check_function_exists(fseeko HAVE_FSEEKO)

#
# Check for stdarg.h
#
check_include_file(stdarg.h HAVE_STDARG_H)

#
# Check for unistd.h
#
check_include_file(unistd.h HAVE_UNISTD_H)

#
# Check visibility attribute is supported
#
if(MSVC)
    set(CMAKE_REQUIRED_FLAGS "-WX")
else(MSVC)
    set(CMAKE_REQUIRED_FLAGS "-Werror")
endif(MSVC)

check_c_source_compiles(
    "
        #include <stdlib.h>
        static void f(void) __attribute__ ((visibility(\"hidden\")));
        int main(void) {return 0;}
    "
    HAVE___ATTR__VIS_HIDDEN)

unset(CMAKE_COMPILE_FLAGS)
configure_file(${zlib1-dll_BINARY_DIR}/zconf.h.cmakein ${zlib1-dll_BINARY_DIR}/zconf.h)

# ============================================================================
# zlib1-dll
# ============================================================================
set(ZLIB1-DLL_PUBLIC_HDRS
    ${zlib1-dll_BINARY_DIR}/zconf.h
    ../../zlib.h
    ../minizip/crypt.h
    ../minizip/ints.h
    ../minizip/ioapi.h
    ../minizip/mztools.h
    ../minizip/unzip.h
    ../minizip/zip.h)

set(ZLIB1-DLL_PRIVATE_HDRS
    ../../crc32.h
    ../../deflate.h
    ../../gzguts.h
    ../../inffast.h
    ../../inffixed.h
    ../../inflate.h
    ../../inftrees.h
    ../../trees.h
    ../../zutil.h)

set(ZLIB1-DLL_SRCS
    ../../adler32.c
    ../../compress.c
    ../../crc32.c
    ../../deflate.c
    ../../gzclose.c
    ../../gzlib.c
    ../../gzread.c
    ../../gzwrite.c
    ../../inflate.c
    ../../infback.c
    ../../inftrees.c
    ../../inffast.c
    ../../trees.c
    ../../uncompr.c
    ../../win32/zlib1.rc
    ../../zutil.c
    ../minizip/ioapi.c
    ../minizip/mztools.c
    ../minizip/unzip.c
    ../minizip/zip.c)

add_library(zlib1 SHARED ${ZLIB1-DLL_SRCS}
                         ${ZLIB1-DLL_PUBLIC_HDRS}
                         ${ZLIB1-DLL_PRIVATE_HDRS})

#taget_include_directories doesn't like relative paths
include_directories(../../
                    ../minizip
                    ${CMAKE_CURRENT_BINARY_DIR})

target_compile_definitions(zlib1
    PRIVATE ZLIB_BUILD
            $<$<BOOL:NOT:${HAVE_FSEEKO}>:NO_FSEEKO>
            $<$<BOOL:${HAVE_UNISTD_H}>:HAVE_UNISTD_H=1>
            $<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>
            $<$<BOOL:${MSVC}>:_CRT_SECURE_NO_DEPRECATE>
            $<$<BOOL:${MSVC}>:_CRT_NONSTDC_NO_DEPRECATE>
    PUBLIC $<$<BOOL:${HAVE_OFF64_T}>:_LARGEFILE64_SOURCE=1>
           $<$<BOOL:${BZIP2_FOUND}>:HAVE_BZIP2=1>
           $<$<BOOL:NOT:${HAVE_FOPEN64}>:USE_FILE32API=1>)

target_link_libraries(zlib1
    PUBLIC $<$<BOOL:${BZIP2_FOUND}>:BZip2::BZip2>)

if(NOT CYGWIN)
    set_target_properties(zlib1 PROPERTIES
        SOVERSION ${zlib1-dll_VERSION_MAJOR}
        VERSION ${zlib1-dll_VERSION})
endif(NOT CYGWIN)

set_target_properties(zlib1 PROPERTIES
    DEFINE_SYMBOL ZLIB_DLL)

install(
    TARGETS zlib1
    ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
    RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
    LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")

install(
    FILES ${ZLIB1-DLL_PUBLIC_HDRS}
    DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")

install(
    FILES ../../LICENSE
    DESTINATION "${CMAKE_INSTALL_DOCDIR}/zlib1-dll")
@


1.1.1.1
log
@import zlib-1.3.2 (previous was 1.3.1)


Version 1.3.2 has these key updates from 1.3.1:

    Address findings of the 7ASecurity audit of zlib.
	Check for negative lengths in crc32_combine functions.
	Copy only the initialized window contents in inflateCopy.
	Prevent the use of insecure functions without an explicit request.
	Add compressBound_z and deflateBound_z functions for large values.
	Use atomics to build inflate fixed tables once.
	Add --undefined option to ./configure for UBSan checker.
	Copy only the initialized deflate state in deflateCopy.
	Zero inflate state on allocation.
	Add compress_z and uncompress_z functions.
    Complete rewrite of cmake support.
    Remove untgz from contrib.
    Vectorize the CRC-32 calculation on the s390x.
    Remove vstudio projects in lieu of cmake-generated projects.
    Add zipAlreadyThere() to minizip zip.c to help avoid duplicates.
    Add deflateUsed() function to get the used bits in the last byte.
    Fix bug in inflatePrime() for 16-bit ints.
    Add a "G" option to force gzip, disabling transparency in gzread().
    Return all available uncompressed data on error in gzread.c.
    Support non-blocking devices in the gz* routines.
@
text
@@


1.1.1.2
log
@Import zlib-1.4.0 (previous was 1.3.2) to address CVE-2026-85091

Breaking changes
- CMake:
  - The minimum CMake version is now 3.15, up from 3.12.
  - Library file names changed on MSVC: z is now libz, as in libz.dll,
    libz.lib, and the static libzs.lib. minizip's libraries changed the
    same way.
  - On Cygwin, the libraries now use the lib prefix.
  - Contrib targets and tests built as part of zlib are now prefixed with
    zlib_. Several test targets were renamed to one scheme, for example
    zlib_examplestatic and minigzipstatic.
  - The zlib1.dll option ENABLE_BZIP2 is now ZLIB1_DLL_ENABLE_BZIP2.
- When not otherwise determined, z_off_t is again long, as in 1.3.1, instead
  of 1.3.2's long long. Windows applications built with 1.3.2 headers should
  be recompiled; see Enhancements for 64-bit offsets.
- deflateReset() now resets the gzip header set by deflateSetHeader(), as
  zlib.h has always said. Code relying on the header persisting must set
  it again.
- Raw deflate that completes exactly at the end of the output buffer now
  returns Z_STREAM_END instead of Z_OK, as documented.
- gzopen() with "x" now fails where O_EXCL isn't available, instead of
  truncating an existing file (Trail of Bits TOB-ZLIB-009).
- gzip reading now delivers the data decompressed before a read error, and
  only then reports the error.

Security fixes
- Non-blocking gzwrite() had a buffer overflow; CVE-2026-85091 (reported by
  mat-mo; also TOB-ZLIB-003).
- inflateGetDictionary() could write up to 8 MB past the caller's 32K buffer
  (Theorem THM-ZLIB-001). This took a zlib header with an invalid window
  size, then inflateReset() or inflateSync(). Affects 1.2.8 through 1.3.2.
- inflateSync() before the window size was known allocated a one-byte
  window that could later be overrun (TOB-ZLIB-004).
- inflatePrime() could lead inflate() to read before the start of the input
  (TOB-ZLIB-014).
- Repeated deflatePrime() calls could write past the pending buffer
  (TOB-ZLIB-013).
- inflateBack() failed to detect distances too far back, and copied
  uninitialized memory to the output (reported by Kornel Lesiński).
- gzseek() forward before any data was written could write uninitialized
  memory to the gzip output (found by Claude Opus 5.5).
- deflateResetKeep() used mid-stream could read outside the window
  (reported by Jason Gross).
- gzdopen() now sets close-on-exec with the correct flag (TOB-ZLIB-008).
- minizip:
  - A double free in block_central_name() (reported by Oculytic), and a
    NULL dereference on repeated zipAlreadyThere() calls after a bad central
    directory (reported by Naveed Khan).
  - Validation of extra-field sizes, plus portable, alignment-safe reading,
    in zipRemoveExtraInfoBlock() (reported by Naveed Khan and jmestwa-coder).
  - unzip no longer reads Zip64 values from outside their extra-field
    record (reported by Mohamed Elnady). It also uses only the Zip64 locator
    immediately before the end of central directory record (reported by
    snajafov). Crafted archives could make minizip report different entries
    than other readers.
  - miniunz could create directories outside the extraction directory
    (reported by Naveed Khan), and on Windows write files anywhere
    (reported by Trail of Bits). Fixed by Naveed Khan. Path names are now
    processed by component.
- contrib/infback9: removed out-of-bounds pointer arithmetic in inftree9.c;
  CVE-2026-4738 (fix by npt-1707, submitted by CrossVR). The pointers return
  in bounds before use and no known compiler mishandles this, so the
  critical rating overstates it, though it could trap on capability hardware
  such as CHERI.

Bug fixes
- gzip reading:
  - Restored the detection of truncated gzip streams, part of which was lost
    in 1.3.2. Also fixed a complete stream being reported as truncated.
  - An error in the first member is no longer treated as trailing garbage.
  - Corrected pending-skip handling in gz_skip(), gzdirect() and forced
    seeks at EOF.
  - gzgets() now returns an empty string when promised.
- gzip writing:
  - Successive SEEK_CUR seeks no longer lose zero fill.
  - Zero fill is now handled correctly after a write error.
  - gzprintf() is now all-or-nothing when blocked, and is no longer a stub
    when compiled as C++.
  - gzseek() leaves the position unchanged on failure.
  - gzopen_w() now works with paths not representable in the locale.
- inflate:
  - total_in was short six bytes on Z_NEED_DICT.
  - inflateReset() now restores the requested window size, and the wrap
    after inflateSync().
  - inflateSetDictionary() rejects a null dictionary.
  - With PKZIP_BUG_WORKAROUND, the code tables were slightly too small.
- deflate:
  - A bad deflateSetDictionary() call is now detected as promised.
  - A failed deflateCopy() or inflateCopy() leaves the destination safe to
    end.
  - Removed a possible overflow in deflate_stored() comparisons.
- Undefined behavior removed in gzwrite.c, gzseek, gz_vacate() and mztools.c.
- minizip:
  - zip.c no longer writes corrupt headers when a Zip64 field overflows an
    extra field (reported by mzfr and itsgaldoron), or for Zip64 entries
    with file comments.
  - zipOpen3() no longer leaks memory or returns a freed comment pointer on
    failure.
  - Added allocation checks.
- Build:
  - configure now builds the shared library with linkers such as lld that
    reject undefined symbols in zlib.map, including for --solo.
  - zlib.h no longer depends on NULL being defined.
  - zip.c builds with NO_ADDFILEINEXISTINGZIP.
  - The test programs use the generated zconf.h when building out of tree.
- Many CMake fixes: pkg-config files, installation of headers and of
  minizip's configuration, symbol prefixing, assembler detection, and
  parallel testing. It also works with CMake 4.

Enhancements
- 64-bit offsets on Windows with MSVC or MinGW, by compiling the
  application with _FILE_OFFSET_BITS=64 or _LARGEFILE64_SOURCE. The library
  itself needs no changes.
- Platforms:
  - Android large file support.
  - An export list on AIX.
  - -Wno-psabi, only where the PowerPC note would appear.
  - s390x VGFMAFLAG in configure.
  - Win32 Makefile.msc builds for ARM64.
  - minigzip's mmap code uses POSIX types.
- CMake:
  - Package components, with _FOUND variables.
  - Installation and export of zlib1.dll and zlibwapi.dll.
  - Contribs build standalone, with zlib's defaults.
  - Tests consolidated, and tests on Windows.
- minizip:
  - The traditional encryption header uses a PCG generator instead of
    rand().
  - Fewer compiler warnings.
- Documentation:
  - Clarified that undocumented functions are not part of the API.
  - inflateGetHeader() header reuse.
  - deflateBound() and deflateSetDictionary() ordering.
  - The application's responsibilities in unzip.h.

Known issues
- contrib/iostream2 is unsafe on untrusted input (reported by Trail of
  Bits). When reading a string, it uses the length stored in the compressed
  data without checking it, so a crafted file can write past the end of the
  destination buffer. Use contrib/iostream3 instead.
@
text
@d1 1
a1 1
cmake_minimum_required(VERSION 3.20...3.31)
d6 1
a6 1
    VERSION 1.4
d14 1
a14 3
if(WIN32)
    set(CMAKE_DEBUG_POSTFIX "d")
else(WIN32)
d16 1
a16 1
endif(WIN32)
d18 1
a18 13
if(ZLIB_BUILD_ZLIB1_DLL)
    set(ZLIB1_DLL_BUILD_TESTING ${ZLIB_BUILD_TESTING} CACHE BOOL "")
    set(ZLIB1_DLL_ENABLE_BZIP2 ${MINIZIP_ENABLE_BZIP2} CACHE BOOL "")
    set(ZLIB1_DLL_INSTALL ${ZLIB_INSTALL} CACHE BOOL "")
    set(ZLIB1_DLL_PREFIX "${ZLIB_PREFIX}" CACHE STRING
    "prefix for all types and library functions, see zconf.h.in")
endif(ZLIB_BUILD_ZLIB1_DLL)

option(ZLIB1_DLL_ENABLE_BZIP2 "Build with bzip2 support" OFF)
option(ZLIB1_DLL_INSTALL "Install zlib1.dll" ON)
option(ZLIB1_DLL_BUILD_TESTING "Build and run tests for zlib1.dll" ON)
set(ZLIB1_DLL_PREFIX "" CACHE STRING
    "prefix for all types and library functions, see zconf.h.in")
d22 1
a22 1
include(CheckSymbolExists)
d26 1
a28 4
if(NOT CPACK_INCLUDED)
    include(CPack)
endif(NOT CPACK_INCLUDED)

d33 1
a33 1
    file(APPEND ${CONF_OUT_FILE} "#cmakedefine Z_PREFIX @@Z_PREFIX@@\n")
a52 2

    set(ZCONF_IN_ZLIB1 True CACHE INTERNAL "find zconf.h in zlib1-dll")
d55 1
a55 3
set(Z_PREFIX "${ZLIB1_DLL_PREFIX}")

if(ZLIB1_DLL_ENABLE_BZIP2)
d57 1
a57 1
endif(ZLIB1_DLL_ENABLE_BZIP2)
d62 1
a62 1
check_symbol_exists(fopen64 stdio.h HAVE_FOPEN64)
d74 1
a74 1
check_symbol_exists(fseeko stdio.h HAVE_FSEEKO)
d104 1
a104 8

if(ZCONF_IN_ZLIB1)
    configure_file(${zlib1-dll_BINARY_DIR}/zconf.h.cmakein
                   ${zlib1-dll_BINARY_DIR}/zconf.h)
    set(ZCONF_H "${zlib1-dll_BINARY_DIR}/zconf.h")
else(ZCONF_IN_ZLIB1)
    set(ZCONF_H "${zlib1-dll_BINARY_DIR}/../../zconf.h")
endif(ZCONF_IN_ZLIB1)
d110 1
a110 1
    ${ZCONF_H}
d145 1
d152 8
a159 16
cmake_path(SET p1 "../../")
cmake_path(SET p2 "../../")
cmake_path(ABSOLUTE_PATH "p1" OUTPUT_VARIABLE DOTDOT)
cmake_path(ABSOLUTE_PATH "p2" OUTPUT_VARIABLE DOTMINIZIP)

add_library(${ZLIB_CONTRIB_PREFIX}zlib1 SHARED
    ${ZLIB1-DLL_SRCS}
    ${ZLIB1-DLL_PUBLIC_HDRS}
    ${ZLIB1-DLL_PRIVATE_HDRS}
    zlib1.rc)

add_library(ZLIB1DLL::ZLIB1DLL ALIAS ${ZLIB_CONTRIB_PREFIX}zlib1)

set_target_properties(${ZLIB_CONTRIB_PREFIX}zlib1
    PROPERTIES
        OUTPUT_NAME zlib1)
d161 1
a161 1
target_compile_definitions(${ZLIB_CONTRIB_PREFIX}zlib1
a167 1
            $<$<BOOL:${ZLIB1_DLL_PREFIX}>:Z_PREFIX=${ZLIB1_DLL_PREFIX}>
d172 1
a172 44
target_include_directories(${ZLIB_CONTRIB_PREFIX}zlib1
    PUBLIC $<BUILD_INTERFACE:${DOTDOT}>
           $<BUILD_INTERFACE:${DOTMINIZIP}>
           $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
           $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)

target_link_libraries(${ZLIB_CONTRIB_PREFIX}zlib1
    PUBLIC $<$<BOOL:${BZIP2_FOUND}>:BZip2::BZip2>)

set_target_properties(${ZLIB_CONTRIB_PREFIX}zlib1 PROPERTIES
    DEFINE_SYMBOL ZLIB_DLL
    EXPORT_NAME ZLIB1DLL)

add_library(${ZLIB_CONTRIB_PREFIX}zlibwapi SHARED
    ${ZLIB1-DLL_SRCS}
    ${ZLIB1-DLL_PUBLIC_HDRS}
    ${ZLIB1-DLL_PRIVATE_HDRS}
    zlibwapi.rc)

add_library(ZLIB1DLL::ZLIBWAPI ALIAS ${ZLIB_CONTRIB_PREFIX}zlibwapi)

set_target_properties(${ZLIB_CONTRIB_PREFIX}zlibwapi
    PROPERTIES
        OUTPUT_NAME zlibwapi)

target_include_directories(${ZLIB_CONTRIB_PREFIX}zlibwapi
    PUBLIC $<BUILD_INTERFACE:${DOTDOT}>
           $<BUILD_INTERFACE:${DOTMINIZIP}>
           $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
           $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)

target_compile_definitions(${ZLIB_CONTRIB_PREFIX}zlibwapi
    PRIVATE ZLIB_BUILD
            $<$<BOOL:NOT:${HAVE_FSEEKO}>:NO_FSEEKO>
            $<$<BOOL:${HAVE_UNISTD_H}>:HAVE_UNISTD_H=1>
            $<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>
            $<$<BOOL:${MSVC}>:_CRT_SECURE_NO_DEPRECATE>
            $<$<BOOL:${MSVC}>:_CRT_NONSTDC_NO_DEPRECATE>
    PUBLIC $<$<BOOL:${HAVE_OFF64_T}>:_LARGEFILE64_SOURCE=1>
           $<$<BOOL:${BZIP2_FOUND}>:HAVE_BZIP2=1>
           $<$<BOOL:NOT:${HAVE_FOPEN64}>:USE_FILE32API=1>
           ZLIB_WINAPI)

target_link_libraries(${ZLIB_CONTRIB_PREFIX}zlibwapi
d176 3
a178 8
    set_target_properties(${ZLIB_CONTRIB_PREFIX}zlib1
        PROPERTIES
            SOVERSION ${zlib1-dll_VERSION_MAJOR}
            VERSION ${zlib1-dll_VERSION})
    set_target_properties(${ZLIB_CONTRIB_PREFIX}zlibwapi
        PROPERTIES
            SOVERSION ${zlib1-dll_VERSION_MAJOR}
            VERSION ${zlib1-dll_VERSION})
d181 16
a196 54
set_target_properties(${ZLIB_CONTRIB_PREFIX}zlibwapi PROPERTIES
    DEFINE_SYMBOL ZLIB_DLL
    EXPORT_NAME ZLIBWAPI)

if(ZLIB1_DLL_INSTALL)
    install(
        TARGETS ${ZLIB_CONTRIB_PREFIX}zlib1 ${ZLIB_CONTRIB_PREFIX}zlibwapi
        COMPONENT Runtime
        EXPORT zlibDllExport
        ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
        RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
        LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")

    install(
        EXPORT zlibDllExport
        FILE ZLIB1DLLTargets.cmake
        NAMESPACE ZLIB1DLL::
        DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/zlib1dll)

    install(
        FILES $<TARGET_PDB_FILE:${ZLIB_CONTRIB_PREFIX}zlib1>
              $<TARGET_PDB_FILE:${ZLIB_CONTRIB_PREFIX}zlibwapi>
        COMPONENT Runtime
        DESTINATION ${CMAKE_INSTALL_BINDIR}
        CONFIGURATIONS Debug OR RelWithDebInfo
        OPTIONAL)

    configure_package_config_file(
        ${zlib1-dll_SOURCE_DIR}/zlib1dllConfig.cmake.in
        ${zlib1-dll_BINARY_DIR}/ZLIB1DLLConfig.cmake
        INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/zlib)

    write_basic_package_version_file(
        "${zlib1-dll_BINARY_DIR}/ZLIB1DLLConfigVersion.cmake"
        VERSION "${zlib1-dll_VERSION}"
        COMPATIBILITY AnyNewerVersion)

    install(FILES ${zlib1-dll_BINARY_DIR}/ZLIB1DLLConfig.cmake
                  ${zlib1-dll_BINARY_DIR}/ZLIB1DLLConfigVersion.cmake
            DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/zlib1dll)

    install(
        FILES ${ZLIB1-DLL_PUBLIC_HDRS}
        DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")

    install(
        FILES ../../LICENSE
        DESTINATION "${CMAKE_INSTALL_DOCDIR}/zlib1-dll")
endif(ZLIB1_DLL_INSTALL)

if(ZLIB1_DLL_BUILD_TESTING)
    enable_testing()
    add_subdirectory(test)
endif(ZLIB1_DLL_BUILD_TESTING)
@

