FindLibArchive¶
Finds the libarchive library and include directories. Libarchive is a multi-format archive and compression library.
Import Targets¶
This module defines the following Imported Targets:
LibArchive::LibArchive
在 3.17 版被加入.
A target for linking against libarchive.
結果變數¶
This module defines the following variables:
LibArchive_FOUND
Boolean indicating whether libarchive was found.
LibArchive_INCLUDE_DIRS
Include search path for using libarchive.
LibArchive_LIBRARIES
Libraries to link against libarchive.
LibArchive_VERSION
A 3-component version string (
major.minor.patch
) of libarchive found.在 3.6 版被加入: Support for a new libarchive version string format. Starting from libarchive version 3.2, a different preprocessor macro is used in the header to define the version. In CMake 3.5 and earlier, this variable will be set only for libarchive versions 3.1 and earlier. In CMake 3.6 and newer, this variable will be set for all libarchive versions.
範例¶
Finding LibArchive and linking it to a project target:
find_package(LibArchive)
target_link_libraries(project_target PRIVATE LibArchive::LibArchive)