FindLibLZMA¶
Finds the liblzma, a data compression library that implements the LZMA (Lempel–Ziv–Markov chain algorithm):
find_package(LibLZMA [<version>] [...])
Imported Targets¶
This module provides the following Imported Targets:
LibLZMA::LibLZMAAdded in version 3.14.
Target encapsulating the liblzma library usage requirements, available only if liblzma is found.
Result Variables¶
This module defines the following variables:
LibLZMA_FOUNDAdded in version 3.3.
Boolean indicating whether (the requested version of) liblzma was found.
LibLZMA_VERSIONAdded in version 4.2.
The version of liblzma found (available as a string, for example,
5.0.3).LIBLZMA_INCLUDE_DIRSInclude directories containing headers needed to use liblzma.
LIBLZMA_LIBRARIESLibraries needed to link against to use liblzma.
Cache Variables¶
The following cache variables may also be set:
LIBLZMA_HAS_AUTO_DECODERBoolean sanity check result indicating whether the
lzma_auto_decoder()function (automatic decoder functionality) is found in liblzma (required).LIBLZMA_HAS_EASY_ENCODERBoolean sanity check result indicating whether the
lzma_easy_encoder()function (basic encoder API) is found in liblzma (required).LIBLZMA_HAS_LZMA_PRESETBoolean sanity check result indicating whether the
lzma_lzma_preset()function (preset compression configuration) is found in liblzma (required).
Deprecated Variables¶
The following variables are provided for backward compatibility:
LIBLZMA_FOUNDDeprecated since version 4.2: Use
LibLZMA_FOUND, which has the same value.Boolean indicating whether (the requested version of) liblzma was found.
LIBLZMA_VERSIONAdded in version 3.26.
Deprecated since version 4.2: Superseded by the
LibLZMA_VERSION.The version of liblzma found.
LIBLZMA_VERSION_STRINGDeprecated since version 3.26: Superseded by the
LIBLZMA_VERSION(andLibLZMA_VERSION).The version of liblzma found.
LIBLZMA_VERSION_MAJORDeprecated since version 3.26.
The major version of liblzma found.
LIBLZMA_VERSION_MINORDeprecated since version 3.26.
The minor version of liblzma found.
LIBLZMA_VERSION_PATCHDeprecated since version 3.26.
The patch version of liblzma found.
Examples¶
Finding the liblzma library and linking it to a project target:
find_package(LibLZMA)
target_link_libraries(project_target PRIVATE LibLZMA::LibLZMA)