kdelibs/cmake/modules/FindLibLZMA.cmake

38 lines
1.1 KiB
CMake
Raw Normal View History

# Try to find the LibLZMA, once done this will define:
#
# LIBLZMA_FOUND - system has LibLZMA
# LIBLZMA_INCLUDE_DIRS - the LibLZMA include directory
# LIBLZMA_LIBRARIES - the libraries needed to use LibLZMA
#
# 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.
find_package(PkgConfig REQUIRED)
pkg_check_modules(PC_LIBLZMA QUIET liblzma)
2014-11-13 01:04:59 +02:00
set(LIBLZMA_INCLUDE_DIR ${PC_LIBLZMA_INCLUDE_DIRS})
set(LIBLZMA_LIBRARIES ${PC_LIBLZMA_LIBRARIES})
set(LIBLZMA_VERSION ${PC_LIBLZMA_VERSION})
2014-11-13 01:04:59 +02: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
find_library(LIBLZMA_LIBRARIES
NAMES lzma
HINTS $ENV{LIBLZMADIR}/lib
)
endif()
2014-11-13 01:04:59 +02: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
mark_as_advanced(LIBLZMA_INCLUDE_DIR LIBLZMA_LIBRARIES)