FindBZip2¶
Finds the BZip2 data compression library (libbz2):
find_package(BZip2 [<version>] [...])
Imported Targets¶
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.
Result Variables¶
This module defines the following variables:
BZip2_FOUNDBoolean indicating whether the BZip2 library is found. For backward compatibility, the
BZIP2_FOUNDvariable is also set to the same value.BZIP2_INCLUDE_DIRSAdded in version 3.12.
Include directories needed to use BZip2 library.
BZIP2_LIBRARIESLibraries needed for linking to use BZip2.
BZIP2_VERSIONAdded in version 3.26.
The version of BZip2 found.
Cache Variables¶
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()).
Legacy Variables¶
The following variables are provided for backward compatibility:
BZIP2_VERSION_STRINGChanged in version 3.26: Superseded by
BZIP2_VERSION.The version of BZip2 found.
Examples¶
Finding BZip2 library and linking it to a project target:
find_package(BZip2)
target_link_libraries(project_target PRIVATE BZip2::BZip2)