File: FindSWScale.cmake

package info (click to toggle)
performous 1.1%2Bgit20181118-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 11,736 kB
  • sloc: cpp: 30,008; ansic: 2,751; sh: 801; xml: 464; python: 374; makefile: 36
file content (44 lines) | stat: -rw-r--r-- 1,293 bytes parent folder | download | duplicates (5)
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
# - Try to find FFMPEG libswscale
# Once done, this will define
#
#  SWScale_FOUND - the library is available
#  SWScale_INCLUDE_DIRS - the include directories
#  SWScale_LIBRARIES - the libraries
#  SWScale_INCLUDE - the file to include (may be used in config.h)
#
# See documentation on how to write CMake scripts at
# http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries

include(LibFindMacros)

libfind_package(SWScale AVUtil)

libfind_pkg_check_modules(SWScale_PKGCONF libswscale)

find_path(SWScale_INCLUDE_DIR
  NAMES libswscale/swscale.h ffmpeg/swscale.h swscale.h
  HINTS ${SWScale_PKGCONF_INCLUDE_DIRS}
  PATH_SUFFIXES ffmpeg
)

if(SWScale_INCLUDE_DIR)
  foreach(suffix libswscale/ ffmpeg/ "")
    if(NOT SWScale_INCLUDE)
      if(EXISTS "${SWScale_INCLUDE_DIR}/${suffix}swscale.h")
        set(SWScale_INCLUDE "${suffix}swscale.h")
      endif(EXISTS "${SWScale_INCLUDE_DIR}/${suffix}swscale.h")
    endif(NOT SWScale_INCLUDE)
  endforeach(suffix)

  if(NOT SWScale_INCLUDE)
    message(FATAL_ERROR "Found swscale.h include dir, but not the header file. Maybe you need to clear CMake cache?")
  endif(NOT SWScale_INCLUDE)
endif(SWScale_INCLUDE_DIR)

find_library(SWScale_LIBRARY
  NAMES libswscale.dll.a swscale
  HINTS ${SWScale_PKGCONF_LIBRARY_DIRS}
)

libfind_process(SWScale)