File: OpenCVFindAVIF.cmake

package info (click to toggle)
opencv 4.10.0%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 282,092 kB
  • sloc: cpp: 1,178,079; xml: 682,621; python: 49,092; lisp: 31,150; java: 25,469; ansic: 11,039; javascript: 6,085; sh: 1,214; cs: 601; perl: 494; objc: 210; makefile: 173
file content (46 lines) | stat: -rw-r--r-- 1,608 bytes parent folder | download
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
41
42
43
44
45
46
#=============================================================================
# Find AVIF library
#=============================================================================
# Find the native AVIF headers and libraries.
#
#  AVIF_INCLUDE_DIRS - where to find avif/avif.h, etc.
#  AVIF_LIBRARIES    - List of libraries when using AVIF.
#  AVIF_FOUND        - True if AVIF is found.
#=============================================================================

# Look for the header file.

unset(AVIF_FOUND)

find_package(libavif QUIET)

if(TARGET avif)
    MARK_AS_ADVANCED(AVIF_INCLUDE_DIR)
    MARK_AS_ADVANCED(AVIF_LIBRARY)

    SET(AVIF_FOUND TRUE)
    GET_TARGET_PROPERTY(AVIF_LIBRARY avif LOCATION)
    GET_TARGET_PROPERTY(AVIF_INCLUDE_DIR1 avif INCLUDE_DIRECTORIES)
    GET_TARGET_PROPERTY(AVIF_INCLUDE_DIR2 avif INTERFACE_INCLUDE_DIRECTORIES)
    set(AVIF_INCLUDE_DIR)
    if(AVIF_INCLUDE_DIR1)
        LIST(APPEND AVIF_INCLUDE_DIR ${AVIF_INCLUDE_DIR1})
    endif()
    if(AVIF_INCLUDE_DIR2)
        LIST(APPEND AVIF_INCLUDE_DIR ${AVIF_INCLUDE_DIR2})
    endif()
else()
    FIND_PATH(AVIF_INCLUDE_DIR NAMES avif/avif.h)

     # Look for the library.
    FIND_LIBRARY(AVIF_LIBRARY NAMES avif)
    MARK_AS_ADVANCED(AVIF_LIBRARY)

    # handle the QUIETLY and REQUIRED arguments and set AVIF_FOUND to TRUE if
    # all listed variables are TRUE
    INCLUDE(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
    FIND_PACKAGE_HANDLE_STANDARD_ARGS(AVIF DEFAULT_MSG AVIF_LIBRARY AVIF_INCLUDE_DIR)

    SET(AVIF_LIBRARIES ${AVIF_LIBRARY})
    SET(AVIF_INCLUDE_DIRS ${AVIF_INCLUDE_DIR})
endif()