FindBZip2¶
Finds the BZip2 data compression library (libbz2):
find_package(BZip2 [<version>] [...])
Imported Targets¶
This module provides the following Imported Targets:
BZip2::BZip2
在 3.12 版被加入.
Target encapsulating the usage requirements of BZip2 library. This target is available only when BZip2 is found.
結果變數¶
該模組定義了以下變數:
BZip2_FOUND
在 3.3 版被加入.
Boolean indicating whether the (requested version of) BZip2 library was found.
BZip2_VERSION
在 4.2 版被加入.
The version of BZip2 found.
BZIP2_INCLUDE_DIRS
在 3.12 版被加入.
Include directories needed to use BZip2 library.
BZIP2_LIBRARIES
Libraries needed for linking to use BZip2.
快取變數¶
The following cache variables may also be set:
BZIP2_INCLUDE_DIR
The directory containing the BZip2 headers.
BZIP2_LIBRARY_RELEASE
The path to the BZip2 library for release configurations.
BZIP2_LIBRARY_DEBUG
The path to the BZip2 library for debug configurations.
BZIP2_NEED_PREFIX
Boolean 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_FOUND
在 4.2 版之後被棄用: Use
BZip2_FOUND
, which has the same value.Boolean indicating whether the (requested version of) BZip2 library was found.
BZIP2_VERSION_STRING
在 3.26 版之後被棄用: Superseded by the
BZIP2_VERSION
(andBZip2_VERSION
).The version of BZip2 found.
BZIP2_VERSION
在 3.26 版被加入.
在 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)