Changeset 9948 for OpenSceneGraph/trunk/CMakeModules/FindFFmpeg.cmake
- Timestamp:
- 03/23/09 16:48:19 (4 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/CMakeModules/FindFFmpeg.cmake
r9866 r9948 10 10 # Created by Robert Osfield. 11 11 12 13 #In ffmpeg code, old version use "#include <header.h>" and newer use "#include <libname/header.h>" 14 #In OSG ffmpeg plugin, we use "#include <header.h>" for compatibility with old version of ffmpeg 15 16 #We have to search the path which contain the header.h (usefull for old version) 17 #and search the path which contain the libname/header.h (usefull for new version) 18 19 #Then we need to include ${FFMPEG_libname_INCLUDE_DIRS} (in old version case, use by ffmpeg header and osg plugin code) 20 # (in new version case, use by ffmpeg header) 21 #and ${FFMPEG_libname_INCLUDE_DIRS/libname} (in new version case, use by osg plugin code) 22 23 12 24 # Macro to find header and lib directories 13 25 # example: FFMPEG_FIND(AVFORMAT avformat avformat.h) 14 15 26 MACRO(FFMPEG_FIND varname shortname headername) 16 # First try to find header directly in include directory 27 # old version of ffmpeg put header in $prefix/include/[ffmpeg] 28 # so try to find header in include directory 17 29 FIND_PATH(FFMPEG_${varname}_INCLUDE_DIRS ${headername} 30 PATHS 18 31 ${FFMPEG_ROOT}/include 19 32 $ENV{FFMPEG_DIR}/include … … 23 36 /Library/Frameworks 24 37 /usr/local/include 25 /usr/include /38 /usr/include 26 39 /sw/include # Fink 27 40 /opt/local/include # DarwinPorts … … 29 42 /opt/include 30 43 /usr/freeware/include 44 PATH_SUFFIXES ffmpeg 45 DOC "Location of FFMPEG Headers" 31 46 ) 32 47 33 # If not found, try to find it in a subdirectory. Tanguy's build has 34 # avformat.h in include/libavformat, so this catches that case. If that's 35 # standard, perhaps we can keep just this case. 48 # newer version of ffmpeg put header in $prefix/include/[ffmpeg/]lib${shortname} 49 # so try to find lib${shortname}/header in include directory 36 50 IF(NOT FFMPEG_${varname}_INCLUDE_DIRS) 37 51 FIND_PATH(FFMPEG_${varname}_INCLUDE_DIRS lib${shortname}/${headername} … … 49 63 /opt/include 50 64 /usr/freeware/include 51 ) 52 ENDIF(NOT FFMPEG_${varname}_INCLUDE_DIRS) 53 54 55 # If not found, try to find it in a subdirectory. Tanguy's build has 56 # avformat.h in include/libavformat, so this catches that case. If that's 57 # standard, perhaps we can keep just this case. 58 IF(NOT FFMPEG_${varname}_INCLUDE_DIRS) 59 FIND_PATH(FFMPEG_${varname}_INCLUDE_DIRS ffmpeg/${headername} 60 ${FFMPEG_ROOT}/include 61 $ENV{FFMPEG_DIR}/include 62 $ENV{OSGDIR}/include 63 $ENV{OSG_ROOT}/include 64 ~/Library/Frameworks 65 /Library/Frameworks 66 /usr/local/include 67 /usr/include/ 68 /sw/include # Fink 69 /opt/local/include # DarwinPorts 70 /opt/csw/include # Blastwave 71 /opt/include 72 /usr/freeware/include 65 PATH_SUFFIXES ffmpeg 66 DOC "Location of FFMPEG Headers" 73 67 ) 74 68 ENDIF(NOT FFMPEG_${varname}_INCLUDE_DIRS) … … 92 86 /opt/lib 93 87 /usr/freeware/lib64 88 DOC "Location of FFMPEG Libraries" 94 89 ) 95 90 96 IF (FFMPEG_${varname}_LIBRARIES AND FFMPEG_${varname}_INCLUDE_DIRS)91 IF (FFMPEG_${varname}_LIBRARIES AND FFMPEG_${varname}_INCLUDE_DIRS) 97 92 SET(FFMPEG_${varname}_FOUND 1) 98 93 ENDIF(FFMPEG_${varname}_LIBRARIES AND FFMPEG_${varname}_INCLUDE_DIRS)
