1 # - Try to find libxml++-2.6
2 # Once done this will define
4 # FFMPEG_FOUND - system has libxml++
5 # FFMPEG_INCLUDE_DIRS - the libxml++ include directory
6 # FFMPEG_LIBRARIES - Link these to use libxml++
7 # FFMPEG_DEFINITIONS - Compiler switches required for using libxml++
9 # Copyright (c) 2008 Andreas Schneider <mail@cynapses.org>
10 # Modified for other libraries by Lasse Kärkkäinen <tronic>
12 # Redistribution and use is allowed according to the terms of the New
14 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
17 if (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIRS)
19 set(FFMPEG_FOUND TRUE)
20 else (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIRS)
21 # use pkg-config to get the directories and then use these values
22 # in the FIND_PATH() and FIND_LIBRARY() calls
23 find_package(PkgConfig)
25 pkg_check_modules(_FFMPEG_AVCODEC libavcodec)
26 pkg_check_modules(_FFMPEG_AVFORMAT libavformat)
27 pkg_check_modules(_FFMPEG_SWSCALE libswscale)
28 endif (PKG_CONFIG_FOUND)
30 find_path(FFMPEG_AVCODEC_INCLUDE_DIR
32 PATHS ${_FFMPEG_AVCODEC_INCLUDE_DIRS} /usr/include /usr/local/include /opt/local/include /sw/include
33 PATH_SUFFIXES ffmpeg libavcodec
36 find_path(FFMPEG_AVFORMAT_INCLUDE_DIR
38 PATHS ${_FFMPEG_AVFORMAT_INCLUDE_DIRS} /usr/include /usr/local/include /opt/local/include /sw/include
39 PATH_SUFFIXES ffmpeg libavformat
42 find_path(FFMPEG_SWSCALE_INCLUDE_DIR
44 PATHS ${_FFMPEG_SWSCALE_INCLUDE_DIRS} /usr/include /usr/local/include /opt/local/include /sw/include
45 PATH_SUFFIXES ffmpeg libswscale
48 find_library(FFMPEG_AVCODEC_LIBRARY
50 PATHS ${_FFMPEG_AVCODEC_LIBRARY_DIRS} /usr/lib /usr/local/lib /opt/local/lib /sw/lib
53 find_library(FFMPEG_AVFORMAT_LIBRARY
55 PATHS ${_FFMPEG_AVFORMAT_LIBRARY_DIRS} /usr/lib /usr/local/lib /opt/local/lib /sw/lib
58 find_library(FFMPEG_SWSCALE_LIBRARY
60 PATHS ${_FFMPEG_SWSCALE_LIBRARY_DIRS} /usr/lib /usr/local/lib /opt/local/lib /sw/lib
63 if (FFMPEG_AVCODEC_LIBRARY AND FFMPEG_AVFORMAT_LIBRARY AND FFMPEG_SWSCALE_LIBRARY)
64 set(FFMPEG_FOUND TRUE)
65 endif (FFMPEG_AVCODEC_LIBRARY AND FFMPEG_AVFORMAT_LIBRARY AND FFMPEG_SWSCALE_LIBRARY)
69 set(FFMPEG_INCLUDE_DIRS
70 ${FFMPEG_AVCODEC_INCLUDE_DIR}
71 ${FFMPEG_AVFORMAT_INCLUDE_DIR}
72 ${FFMPEG_SWSCALE_INCLUDE_DIR}
76 ${FFMPEG_AVCODEC_LIBRARY}
77 ${FFMPEG_AVFORMAT_LIBRARY}
78 ${FFMPEG_SWSCALE_LIBRARY}
84 if (NOT FFMPEG_FIND_QUIETLY)
85 message(STATUS "Found FFMPEG: ${FFMPEG_LIBRARIES}")
86 endif (NOT FFMPEG_FIND_QUIETLY)
88 if (FFMPEG_FIND_REQUIRED)
89 message(FATAL_ERROR "Could not find FFMPEG libavcodec, libavformat or libswscale")
90 endif (FFMPEG_FIND_REQUIRED)
93 # show the FFMPEG_INCLUDE_DIRS and FFMPEG_LIBRARIES variables only in the advanced view
94 mark_as_advanced(FFMPEG_INCLUDE_DIRS FFMPEG_LIBRARIES)
96 endif (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIRS)