From 56330d5b2908a4f184a5341dcf15eea591fad088 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 4 Mar 2009 16:35:08 +0000 Subject: [PATCH] Added search for headers in ffmpeg directory --- CMakeModules/FindFFmpeg.cmake | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/CMakeModules/FindFFmpeg.cmake b/CMakeModules/FindFFmpeg.cmake index c569aa46a..0c3117d18 100644 --- a/CMakeModules/FindFFmpeg.cmake +++ b/CMakeModules/FindFFmpeg.cmake @@ -11,6 +11,7 @@ # Macro to find header and lib directories # example: FFMPEG_FIND(AVFORMAT avformat avformat.h) + MACRO(FFMPEG_FIND varname shortname headername) # First try to find header directly in include directory FIND_PATH(FFMPEG_${varname}_INCLUDE_DIRS ${headername} @@ -50,6 +51,28 @@ MACRO(FFMPEG_FIND varname shortname headername) ) ENDIF(NOT FFMPEG_${varname}_INCLUDE_DIRS) + + # If not found, try to find it in a subdirectory. Tanguy's build has + # avformat.h in include/libavformat, so this catches that case. If that's + # standard, perhaps we can keep just this case. + IF(NOT FFMPEG_${varname}_INCLUDE_DIRS) + FIND_PATH(FFMPEG_${varname}_INCLUDE_DIRS ffmpeg/${headername} + ${FFMPEG_ROOT}/include + $ENV{FFMPEG_DIR}/include + $ENV{OSGDIR}/include + $ENV{OSG_ROOT}/include + ~/Library/Frameworks + /Library/Frameworks + /usr/local/include + /usr/include/ + /sw/include # Fink + /opt/local/include # DarwinPorts + /opt/csw/include # Blastwave + /opt/include + /usr/freeware/include + ) + ENDIF(NOT FFMPEG_${varname}_INCLUDE_DIRS) + FIND_LIBRARY(FFMPEG_${varname}_LIBRARIES NAMES ${shortname} PATHS