Finds the BZip2 data compression library (libbz2):
find_package(BZip2 [<version>] [...])
This module provides the following Imported Targets:
BZip2::BZip2Added in version 3.12.
Target encapsulating the usage requirements of BZip2 library. This target is available only when BZip2 is found.
This module defines the following variables:
BZip2_FOUNDAdded in version 3.3.
Boolean indicating whether the (requested version of) BZip2 library was found.
BZip2_VERSIONAdded in version 4.2.
The version of BZip2 found.
BZIP2_INCLUDE_DIRSAdded in version 3.12.
Include directories needed to use BZip2 library.
BZIP2_LIBRARIESLibraries needed for linking to use BZip2.
The following cache variables may also be set:
BZIP2_INCLUDE_DIRThe directory containing the BZip2 headers.
BZIP2_LIBRARY_RELEASEThe path to the BZip2 library for release configurations.
BZIP2_LIBRARY_DEBUGThe path to the BZip2 library for debug configurations.
BZIP2_NEED_PREFIXBoolean indicating whether BZip2 functions are prefixed with BZ2_
(e.g., BZ2_bzCompressInit()). Versions of BZip2 prior to 1.0.0 used
unprefixed function names (e.g., bzCompressInit()).
The following variables are provided for backward compatibility:
BZIP2_FOUNDDeprecated since version 4.2: Use BZip2_FOUND, which has the same value.
Boolean indicating whether the (requested version of) BZip2 library was found.
BZIP2_VERSION_STRINGDeprecated since version 3.26: Superseded by the BZIP2_VERSION (and BZip2_VERSION).
The version of BZip2 found.
BZIP2_VERSIONAdded in version 3.26.
Deprecated since version 4.2: Superseded by the BZip2_VERSION.
The version of BZip2 found.
Finding BZip2 library and linking it to a project target:
find_package(BZip2)
target_link_libraries(project_target PRIVATE BZip2::BZip2)