Changeset 9948
- Timestamp:
- 03/23/09 16:48:19 (4 years ago)
- Location:
- OpenSceneGraph/trunk
- Files:
-
- 2 modified
-
CMakeModules/FindFFmpeg.cmake (modified) (5 diffs)
-
src/osgPlugins/ffmpeg/CMakeLists.txt (modified) (1 diff)
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) -
OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/CMakeLists.txt
r9854 r9948 1 1 # INCLUDE_DIRECTORIES( ${FFMPEG_INCLUDE_DIRS} ) 2 3 4 INCLUDE_DIRECTORIES( 5 ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS} ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}/libavformat 6 ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS} ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS}/libavdevice 7 ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS} ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS}/libavcodec 8 ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS} ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS}/libavcodec 9 ) 10 11 LINK_DIRECTORIES(${FFMPEG_LIBRARY_DIRS}) 12 13 SET(TARGET_EXTERNAL_LIBRARIES ${FFMPEG_LIBRARIES} ) 14 15 2 16 3 17 IF (FFMPEG_LIBSWSCALE_FOUND) 4 18 5 INCLUDE_DIRECTORIES( 6 ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS} ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}/libavformat ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}/ffmpeg 7 ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS} ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS}/libavdevice ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS}/ffmpeg 8 ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS} ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS}/libavcodec ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS}/ffmpeg 9 ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS} ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS}/libavcodec ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS}/ffmpeg 10 ${FFMPEG_LIBSWSCALE_INCLUDE_DIRS} ${FFMPEG_LIBSWSCALE_INCLUDE_DIRS}/libswscale ${FFMPEG_LIBSWSCALE_INCLUDE_DIRS}/ffmpeg 11 ) 19 INCLUDE_DIRECTORIES( ${FFMPEG_LIBSWSCALE_INCLUDE_DIRS} ${FFMPEG_LIBSWSCALE_INCLUDE_DIRS}/libswscale ) 12 20 13 21 ADD_DEFINITIONS(-DUSE_SWSCALE) 14 22 15 LINK_DIRECTORIES(${FFMPEG_LIBRARY_DIRS})16 17 23 SET(TARGET_EXTERNAL_LIBRARIES ${FFMPEG_LIBRARIES} ${FFMPEG_LIBSWSCALE_LIBRARIES}) 18 19 ELSE(FFMPEG_LIBSWSCALE_FOUND)20 21 INCLUDE_DIRECTORIES(22 ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS} ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}/libavformat ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}/ffmpeg23 ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS} ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS}/libavdevice ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS}/ffmpeg24 ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS} ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS}/libavcodec ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS}/ffmpeg25 ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS} ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS}/libavcodec ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS}/ffmpeg26 )27 28 LINK_DIRECTORIES(${FFMPEG_LIBRARY_DIRS})29 30 SET(TARGET_EXTERNAL_LIBRARIES ${FFMPEG_LIBRARIES} )31 24 32 25 ENDIF()
