2021-03-07 02:40:21 +02:00
|
|
|
# Try to find the LibLZMA, once done this will define:
|
2020-02-21 17:44:22 +00:00
|
|
|
#
|
|
|
|
# LIBLZMA_FOUND - system has LibLZMA
|
|
|
|
# LIBLZMA_INCLUDE_DIRS - the LibLZMA include directory
|
|
|
|
# LIBLZMA_LIBRARIES - the libraries needed to use LibLZMA
|
|
|
|
#
|
2021-03-07 02:40:21 +02:00
|
|
|
# Copyright (c) 2020 Ivailo Monev <xakepa10@gmail.com>
|
2014-11-13 01:04:59 +02:00
|
|
|
#
|
|
|
|
# Redistribution and use is allowed according to the terms of the BSD license.
|
|
|
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
|
|
|
|
2022-10-02 10:46:46 +03:00
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
pkg_check_modules(PC_LIBLZMA QUIET liblzma)
|
2014-11-13 01:04:59 +02:00
|
|
|
|
2022-10-02 10:46:46 +03:00
|
|
|
set(LIBLZMA_INCLUDE_DIR ${PC_LIBLZMA_INCLUDE_DIRS})
|
|
|
|
set(LIBLZMA_LIBRARIES ${PC_LIBLZMA_LIBRARIES})
|
2020-02-21 17:44:22 +00:00
|
|
|
set(LIBLZMA_VERSION ${PC_LIBLZMA_VERSION})
|
2014-11-13 01:04:59 +02:00
|
|
|
|
2020-02-21 17:44:22 +00:00
|
|
|
if(NOT LIBLZMA_INCLUDE_DIR OR NOT LIBLZMA_LIBRARIES)
|
|
|
|
find_path(LIBLZMA_INCLUDE_DIR
|
|
|
|
NAMES lzma.h
|
|
|
|
HINTS $ENV{LIBLZMADIR}/include
|
|
|
|
)
|
2014-11-13 01:04:59 +02:00
|
|
|
|
2020-02-21 17:44:22 +00:00
|
|
|
find_library(LIBLZMA_LIBRARIES
|
|
|
|
NAMES lzma
|
|
|
|
HINTS $ENV{LIBLZMADIR}/lib
|
|
|
|
)
|
|
|
|
endif()
|
2014-11-13 01:04:59 +02:00
|
|
|
|
2020-02-21 17:44:22 +00:00
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(LibLZMA
|
|
|
|
VERSION_VAR LIBLZMA_VERSION
|
|
|
|
REQUIRED_VARS LIBLZMA_LIBRARIES LIBLZMA_INCLUDE_DIR
|
|
|
|
)
|
2014-11-13 01:04:59 +02:00
|
|
|
|
2020-02-21 17:44:22 +00:00
|
|
|
mark_as_advanced(LIBLZMA_INCLUDE_DIR LIBLZMA_LIBRARIES)
|