File: Findsvt.cmake

package info (click to toggle)
libavif 1.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 20,956 kB
  • sloc: ansic: 29,303; cpp: 13,260; sh: 1,145; xml: 1,040; java: 307; makefile: 51
file content (48 lines) | stat: -rw-r--r-- 1,798 bytes parent folder | download | duplicates (3)
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
47
48
# - Try to find svt_av1
# Once done this will define
#
#  SVT_FOUND - system has svt_av1
#  SVT_INCLUDE_DIR - the svt_av1 include directory
#  SVT_LIBRARIES - Link these to use svt_av1
#
#=============================================================================
#  Copyright (c) 2020 Andreas Schneider <asn@cryptomilk.org>
#
#  Distributed under the OSI-approved BSD License (the "License");
#  see accompanying file Copyright.txt for details.
#
#  This software is distributed WITHOUT ANY WARRANTY; without even the
#  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#  See the License for more information.
#=============================================================================
#

find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
    pkg_check_modules(_SVT SvtAv1Enc)
endif(PKG_CONFIG_FOUND)

find_path(SVT_INCLUDE_DIR NAMES svt-av1/EbSvtAv1Enc.h PATHS ${_SVT_INCLUDEDIR})

find_library(SVT_LIBRARY NAMES SvtAv1Enc PATHS ${_SVT_LIBDIR})

if(SVT_LIBRARY)
    set(SVT_LIBRARIES ${SVT_LIBRARIES} ${SVT_LIBRARY})
endif(SVT_LIBRARY)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(svt REQUIRED_VARS SVT_LIBRARY SVT_LIBRARIES SVT_INCLUDE_DIR VERSION_VAR _SVT_VERSION)

# show the SVT_INCLUDE_DIR, SVT_LIBRARY and SVT_LIBRARIES variables only
# in the advanced view
mark_as_advanced(SVT_INCLUDE_DIR SVT_LIBRARY SVT_LIBRARIES)

if(SVT_LIBRARY)
    if("${SVT_LIBRARY}" MATCHES "\\${CMAKE_STATIC_LIBRARY_SUFFIX}$")
        add_library(SvtAv1Enc STATIC IMPORTED GLOBAL)
    else()
        add_library(SvtAv1Enc SHARED IMPORTED GLOBAL)
    endif()
    set_target_properties(SvtAv1Enc PROPERTIES IMPORTED_LOCATION "${SVT_LIBRARY}" IMPORTED_IMPLIB "${SVT_LIBRARY}")
    target_include_directories(SvtAv1Enc INTERFACE ${SVT_INCLUDE_DIR})
endif()