1 # - Find library containing FFmpeg()
2 # The following variables are set if FFmpeg is found. If FFmpeg is not
3 # found, FFmpeg_FOUND is set to false.
4 # FFmpeg_FOUND - System has FFmpeg.
5 # FFmpeg_LIBRARIES - Link these to use FFmpeg.
6 # FFmpeg_CFLAGS - Link these to use FFmpeg.
9 if (NOT FFmpeg_SEARCHED)
10 include(CheckLibraryExists)
12 set(FFmpeg_SEARCHED TRUE CACHE INTERNAL "")
13 set(FFmpeg_FOUND FALSE CACHE INTERNAL "")
15 pkg_check_modules(FFmpeg libffmpeg)
18 set(FFmpeg_LIBRARIES "")
19 foreach (library ffmpeg avcodec avformat avutil postproc swscale)
20 find_library( ${library}_LIBRARY ${library} )
21 if (${library}_LIBRARY)
22 set(FFmpeg_LIBRARIES "${library};${FFmpeg_LIBRARIES}")
23 set(FFmpeg_FOUND TRUE CACHE INTERNAL "")
24 endif (${library}_LIBRARY)
26 foreach (library a52 faac lame z png mp3lame twolame)
27 find_library( ${library}_LIBRARY ${library} )
28 if (${library}_LIBRARY)
29 set(FFmpeg_LIBRARIES "${library};${FFmpeg_LIBRARIES}")
30 endif (${library}_LIBRARY)
32 set(FFmpeg_LIBRARIES "${FFmpeg_LIBRARIES}" CACHE INTERNAL STRING)
33 endif (NOT FFmpeg_FOUND)
36 if (NOT FFmpeg_FIND_QUIETLY)
37 message(STATUS "Found FFmpeg in: ${FFmpeg_LIBRARIES}")
38 endif (NOT FFmpeg_FIND_QUIETLY)
40 if (FFmpeg_FIND_REQUIRED)
41 message(FATAL_ERROR "Could not find the library containing FFmpeg")
42 endif (FFmpeg_FIND_REQUIRED)
45 mark_as_advanced(FFmpeg_LIBRARIES)
46 endif(NOT FFmpeg_SEARCHED)