Finds the native zlib data compression library.
This module provides the following Imported Targets:
ZLIB::ZLIBAdded in version 3.1.
Target that encapsulates the zlib usage requirements. It is available only when zlib is found.
This module defines the following variables:
ZLIB_INCLUDE_DIRSInclude directories containing zlib.h and other headers needed to use
zlib.
ZLIB_LIBRARIESList of libraries needed to link to zlib.
Changed in version 3.4: Debug and Release library variants can be now found separately.
ZLIB_FOUNDTrue if zlib is found.
ZLIB_VERSIONAdded in version 3.26.
The version of zlib found.
The following variables are provided for backward compatibility:
ZLIB_VERSION_MAJORThe major version of zlib.
Changed in version 3.26: Superseded by ZLIB_VERSION.
ZLIB_VERSION_MINORThe minor version of zlib.
Changed in version 3.26: Superseded by ZLIB_VERSION.
ZLIB_VERSION_PATCHThe patch version of zlib.
Changed in version 3.26: Superseded by ZLIB_VERSION.
ZLIB_VERSION_TWEAKThe tweak version of zlib.
Changed in version 3.26: Superseded by ZLIB_VERSION.
ZLIB_VERSION_STRINGThe version of zlib found (x.y.z).
Changed in version 3.26: Superseded by ZLIB_VERSION.
ZLIB_MAJOR_VERSIONThe major version of zlib. Superseded by ZLIB_VERSION_MAJOR.
ZLIB_MINOR_VERSIONThe minor version of zlib. Superseded by ZLIB_VERSION_MINOR.
ZLIB_PATCH_VERSIONThe patch version of zlib. Superseded by ZLIB_VERSION_PATCH.
This module accepts the following variables:
ZLIB_ROOTA user may set this variable to a zlib installation root to help locate zlib in custom installation paths.
ZLIB_USE_STATIC_LIBSAdded in version 3.24.
Set this variable to ON before calling find_package(ZLIB) to look for
static libraries. Default is OFF.
Finding zlib and linking it to a project target:
find_package(ZLIB)
target_link_libraries(project_target PRIVATE ZLIB::ZLIB)