summaryrefslogtreecommitdiffstats
path: root/cmake/modules/FindQATzip.cmake
blob: 364cb7359148c06f3b64eb32bd591a662585a047 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# - Find QATzip
# Find the QATzip compression library and includes
#
# QATzip_INCLUDE_DIR - where to find QATzip.h, etc.
# QATzip_LIBRARIES - List of libraries when using QATzip.
# QATzip_FOUND - True if QATzip found.

find_package(PkgConfig QUIET)
pkg_search_module(PC_QATzip qatzip QUIET)

find_path(QATzip_INCLUDE_DIR
  NAMES qatzip.h
  HINTS ${PC_QATzip_INCLUDE_DIRS})

find_library(QATzip_LIBRARIES
  NAMES qatzip
  HINTS ${PC_QATzip_LIBRARY_DIRS})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(QATzip DEFAULT_MSG QATzip_LIBRARIES QATzip_INCLUDE_DIR)

mark_as_advanced(
  QATzip_LIBRARIES
  QATzip_INCLUDE_DIR)

if(QATzip_FOUND AND NOT TARGET QAT::zip)
  add_library(QAT::zip SHARED IMPORTED)
  set_target_properties(QAT::zip PROPERTIES
    INTERFACE_INCLUDE_DIRECTORIES "${QATzip_INCLUDE_DIR}"
    INTERFACE_LINK_LIBRARIES "${QATzip_INTERFACE_LINK_LIBRARIES}"
    IMPORTED_LINK_INTERFACE_LANGUAGES "C"
    IMPORTED_LOCATION "${QATzip_LIBRARIES}")
endif()