Finds the XML processing library (libxml2):
find_package(LibXml2 [<version>] [...])
This module provides the following Imported Targets:
LibXml2::LibXml2Added in version 3.12.
Target encapsulating the libxml2 library usage requirements, available only if library is found.
LibXml2::xmllintAdded in version 3.17.
Target encapsulating the xmllint command-line executable, available only if xmllint executable is found.
This module defines the following variables:
LibXml2_FOUNDAdded in version 3.3.
Boolean indicating whether the (requested version of) libxml2 library was found.
LibXml2_VERSIONAdded in version 4.2.
The version of the libxml2 found.
LIBXML2_INCLUDE_DIRSInclude directories needed to use the libxml2 library.
LIBXML2_LIBRARIESLibraries needed to link against to use the libxml2 library.
LIBXML2_DEFINITIONSThe compiler switches required for using libxml2.
LibXml2_USE_STATIC_LIBSAdded in version 4.3.
Set to TRUE to use static libraries. Default is FALSE.
The following cache variables may also be set:
LIBXML2_INCLUDE_DIRThe include directory containing libxml2 headers.
LIBXML2_LIBRARYThe path to the libxml2 library.
LIBXML2_XMLLINT_EXECUTABLEThe path to the XML checking tool xmllint coming with libxml2.
The following variables are provided for backward compatibility:
LIBXML2_FOUNDDeprecated since version 4.2: Use LibXml2_FOUND, which has the same value.
Boolean indicating whether the (requested version of) libxml2 library was found.
LIBXML2_VERSION_STRINGDeprecated since version 4.2: Superseded by the LibXml2_VERSION.
The version of the libxml2 found.
Finding the libxml2 library and linking it to a project target:
find_package(LibXml2)
target_link_libraries(project_target PRIVATE LibXml2::LibXml2)