root/OpenSceneGraph/trunk/CMakeModules/FindFFmpeg.cmake @ 9854

Revision 9854, 1.3 kB (checked in by robert, 6 years ago)

Added support for using libswscale

RevLine 
[9840]1# Locate ffmpeg
[9817]2# This module defines
3# FFMPEG_LIBRARIES
[9840]4# FFMPEG_FOUND, if false, do not try to link to ffmpeg
[9817]5# FFMPEG_INCLUDE_DIR, where to find the headers
6#
7# $FFMPEG_DIR is an environment variable that would
8# correspond to the ./configure --prefix=$FFMPEG_DIR
9#
10# Created by Robert Osfield.
11
[9840]12#use pkg-config to find various modes
[9817]13INCLUDE(FindPkgConfig OPTIONAL)
14
15IF(PKG_CONFIG_FOUND)
16
17    INCLUDE(FindPkgConfig)
18
19    pkg_check_modules(FFMPEG_LIBAVFORMAT libavformat)
20    pkg_check_modules(FFMPEG_LIBAVDEVICE libavdevice)
21    pkg_check_modules(FFMPEG_LIBAVCODEC libavcodec)
22    pkg_check_modules(FFMPEG_LIBAVUTIL libavutil)
[9854]23    pkg_check_modules(FFMPEG_LIBSWSCALE libswscale)
[9817]24
25ENDIF(PKG_CONFIG_FOUND)
26
27SET(FFMPEG_FOUND "NO")
28IF   (FFMPEG_LIBAVFORMAT_FOUND AND FFMPEG_LIBAVDEVICE_FOUND AND FFMPEG_LIBAVCODEC_FOUND AND FFMPEG_LIBAVUTIL_FOUND)
29   
30    SET(FFMPEG_FOUND "YES")
31
32    SET(FFMPEG_INCLUDE_DIRS ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS})
[9840]33
34    SET(FFMPEG_LIBRARY_DIRS ${FFMPEG_LIBAVFORMAT_LIBRARY_DIRS})
35
[9817]36    SET(FFMPEG_LIBRARIES
37        ${FFMPEG_LIBAVFORMAT_LIBRARIES}
38        ${FFMPEG_LIBAVDEVICE_LIBRARIES}
39        ${FFMPEG_LIBAVCODEC_LIBRARIES}
40        ${FFMPEG_LIBAVUTIL_LIBRARIES})
[9840]41   
[9817]42ENDIF(FFMPEG_LIBAVFORMAT_FOUND AND FFMPEG_LIBAVDEVICE_FOUND AND FFMPEG_LIBAVCODEC_FOUND AND FFMPEG_LIBAVUTIL_FOUND)
43
44
Note: See TracBrowser for help on using the browser.