diff --git a/CMakeLists.txt b/CMakeLists.txt index 14da7ac95..fb3f643c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -311,6 +311,7 @@ FIND_PACKAGE(ITK) FIND_PACKAGE(LibVNCServer) FIND_PACKAGE(OurDCMTK) FIND_PACKAGE(XUL) +FIND_PACKAGE(FFmpeg) #use pkg-config to find various modues INCLUDE(FindPkgConfig OPTIONAL) diff --git a/CMakeModules/FindFFmpeg.cmake b/CMakeModules/FindFFmpeg.cmake new file mode 100644 index 000000000..e42561497 --- /dev/null +++ b/CMakeModules/FindFFmpeg.cmake @@ -0,0 +1,41 @@ +# Locate gdal +# This module defines +# FFMPEG_LIBRARIES +# FFMPEG_FOUND, if false, do not try to link to gdal +# FFMPEG_INCLUDE_DIR, where to find the headers +# +# $FFMPEG_DIR is an environment variable that would +# correspond to the ./configure --prefix=$FFMPEG_DIR +# +# Created by Robert Osfield. + +#use pkg-config to find various modues +INCLUDE(FindPkgConfig OPTIONAL) + +IF(PKG_CONFIG_FOUND) + + INCLUDE(FindPkgConfig) + + pkg_check_modules(FFMPEG_LIBAVFORMAT libavformat) + pkg_check_modules(FFMPEG_LIBAVDEVICE libavdevice) + pkg_check_modules(FFMPEG_LIBAVCODEC libavcodec) + pkg_check_modules(FFMPEG_LIBAVUTIL libavutil) + +ENDIF(PKG_CONFIG_FOUND) + +SET(FFMPEG_FOUND "NO") +IF (FFMPEG_LIBAVFORMAT_FOUND AND FFMPEG_LIBAVDEVICE_FOUND AND FFMPEG_LIBAVCODEC_FOUND AND FFMPEG_LIBAVUTIL_FOUND) + + SET(FFMPEG_FOUND "YES") + + SET(FFMPEG_INCLUDE_DIRS ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}) + + SET(FFMPEG_LIBRARIES + ${FFMPEG_LIBAVFORMAT_LIBRARIES} + ${FFMPEG_LIBAVDEVICE_LIBRARIES} + ${FFMPEG_LIBAVCODEC_LIBRARIES} + ${FFMPEG_LIBAVUTIL_LIBRARIES}) + +ENDIF(FFMPEG_LIBAVFORMAT_FOUND AND FFMPEG_LIBAVDEVICE_FOUND AND FFMPEG_LIBAVCODEC_FOUND AND FFMPEG_LIBAVUTIL_FOUND) + + diff --git a/src/osgPlugins/CMakeLists.txt b/src/osgPlugins/CMakeLists.txt index ea6c03385..1580d6f07 100644 --- a/src/osgPlugins/CMakeLists.txt +++ b/src/osgPlugins/CMakeLists.txt @@ -196,6 +196,10 @@ IF(XINE_FOUND) ADD_SUBDIRECTORY(xine) ENDIF(XINE_FOUND) +IF(FFMPEG_FOUND) + ADD_SUBDIRECTORY(ffmpeg) +ENDIF(FFMPEG_FOUND) + IF(QUICKTIME_FOUND) ADD_SUBDIRECTORY(quicktime) ENDIF(QUICKTIME_FOUND)