File: FindGIF.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 (40 lines) | stat: -rw-r--r-- 1,165 bytes parent folder | download | duplicates (2)
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
38
39
40
#.rst:
# FindGIF
# -------
# Finds the libgif library
#
# This will define the following variables::
#
# GIF_FOUND - system has libgif
# GIF_INCLUDE_DIRS - the libgif include directory
# GIF_LIBRARIES - the libgif libraries
#
# and the following imported targets::
#
#   GIF::GIF   - The libgif library

find_path(GIF_INCLUDE_DIR gif_lib.h)

include(FindPackageHandleStandardArgs)
find_library(GIF_LIBRARY NAMES gif)
find_package_handle_standard_args(GIF
                                  REQUIRED_VARS GIF_LIBRARY GIF_INCLUDE_DIR)

if(GIF_FOUND)
  set(GIF_LIBRARIES ${GIF_LIBRARY})
  set(GIF_INCLUDE_DIRS ${GIF_INCLUDE_DIR})
  set(GIF_DEFINITIONS -DHAVE_LIBGIF=1)

  if(NOT TARGET GIF::GIF)
    add_library(GIF::GIF UNKNOWN IMPORTED)
    if(GIF_LIBRARY)
      set_target_properties(GIF::GIF PROPERTIES
                                     IMPORTED_LOCATION "${GIF_LIBRARY}")
    endif()
    set_target_properties(GIF::GIF PROPERTIES
                                   INTERFACE_INCLUDE_DIRECTORIES "${GIF_INCLUDE_DIR}"
                                   INTERFACE_COMPILE_DEFINITIONS HAVE_LIBGIF=1)
  endif()
endif()

mark_as_advanced(GIF_INCLUDE_DIR GIF_LIBRARY)