File: FindLzo2.cmake

package info (click to toggle)
kodi 2%3A20.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 143,820 kB
  • sloc: cpp: 664,925; xml: 68,398; ansic: 37,223; python: 6,903; sh: 4,209; javascript: 2,325; makefile: 1,754; perl: 969; java: 513; cs: 390; objc: 340
file content (37 lines) | stat: -rw-r--r-- 1,044 bytes parent folder | download | duplicates (4)
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
34
35
36
37
#.rst:
# FindLzo2
# --------
# Finds the Lzo2 library
#
# This will define the following variables::
#
# LZO2_FOUND - system has Lzo2
# LZO2_INCLUDE_DIRS - the Lzo2 include directory
# LZO2_LIBRARIES - the Lzo2 libraries
#
# and the following imported targets::
#
#   Lzo2::Lzo2   - The Lzo2 library

find_path(LZO2_INCLUDE_DIR NAMES lzo1x.h
                           PATH_SUFFIXES lzo)

find_library(LZO2_LIBRARY NAMES lzo2 liblzo2)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Lzo2
                                  REQUIRED_VARS LZO2_LIBRARY LZO2_INCLUDE_DIR)

if(LZO2_FOUND)
  set(LZO2_LIBRARIES ${LZO2_LIBRARY})
  set(LZO2_INCLUDE_DIRS ${LZO2_INCLUDE_DIR})

  if(NOT TARGET Lzo2::Lzo2)
    add_library(Lzo2::Lzo2 UNKNOWN IMPORTED)
    set_target_properties(Lzo2::Lzo2 PROPERTIES
                                     IMPORTED_LOCATION "${LZO2_LIBRARY}"
                                     INTERFACE_INCLUDE_DIRECTORIES "${LZO2_INCLUDE_DIR}")
  endif()
endif()

mark_as_advanced(LZO2_INCLUDE_DIR LZO2_LIBRARY)