Show
Ignore:
Timestamp:
06/24/09 12:26:48 (5 years ago)
Author:
robert
Message:

Refactored the FFmpeg find script and the pdd CMakeLists.txt to improve the automatic detection of the required facilities

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/CMakeModules/FindFFmpeg.cmake

    r10391 r10395  
    2929    FIND_PATH(FFMPEG_${varname}_INCLUDE_DIRS ${headername} 
    3030        PATHS 
     31        ${FFMPEG_ROOT}/include/lib${shortname} 
     32        $ENV{FFMPEG_DIR}/include/lib${shortname} 
     33        ~/Library/Frameworks/lib${shortname} 
     34        /Library/Frameworks/lib${shortname} 
     35        /usr/local/include/lib${shortname} 
     36        /usr/include/lib${shortname} 
     37        /sw/include/lib${shortname} # Fink 
     38        /opt/local/include/lib${shortname} # DarwinPorts 
     39        /opt/csw/include/lib${shortname} # Blastwave 
     40        /opt/include/lib${shortname} 
     41        /usr/freeware/include/lib${shortname} 
     42        PATH_SUFFIXES ffmpeg 
     43        DOC "Location of FFMPEG Headers" 
     44    ) 
     45 
     46    FIND_PATH(FFMPEG_${varname}_INCLUDE_DIRS ${headername} 
     47        PATHS 
    3148        ${FFMPEG_ROOT}/include 
    3249        $ENV{FFMPEG_DIR}/include 
     
    4360        DOC "Location of FFMPEG Headers" 
    4461    ) 
    45  
    46     # newer version of ffmpeg put header in $prefix/include/[ffmpeg/]lib${shortname} 
    47     # so try to find lib${shortname}/header in include directory 
    48     IF(NOT FFMPEG_${varname}_INCLUDE_DIRS) 
    49         FIND_PATH(FFMPEG_${varname}_INCLUDE_DIRS lib${shortname}/${headername} 
    50             ${FFMPEG_ROOT}/include 
    51             $ENV{FFMPEG_DIR}/include 
    52             ~/Library/Frameworks 
    53             /Library/Frameworks 
    54             /usr/local/include 
    55             /usr/include/ 
    56             /sw/include # Fink 
    57             /opt/local/include # DarwinPorts 
    58             /opt/csw/include # Blastwave 
    59             /opt/include 
    60             /usr/freeware/include 
    61             PATH_SUFFIXES ffmpeg 
    62             DOC "Location of FFMPEG Headers" 
    63         ) 
    64     ENDIF(NOT FFMPEG_${varname}_INCLUDE_DIRS) 
    6562 
    6663    FIND_LIBRARY(FFMPEG_${varname}_LIBRARIES 
     
    9289 
    9390# find stdint.h 
    94 FIND_PATH(FFMPEG_STDINT_INCLUDE_DIR stdint.h 
    95     PATHS 
    96     ${FFMPEG_ROOT}/include 
    97     $ENV{FFMPEG_DIR}/include 
    98     ~/Library/Frameworks 
    99     /Library/Frameworks 
    100     /usr/local/include 
    101     /usr/include 
    102     /sw/include # Fink 
    103     /opt/local/include # DarwinPorts 
    104     /opt/csw/include # Blastwave 
    105     /opt/include 
    106     /usr/freeware/include 
    107     PATH_SUFFIXES ffmpeg 
    108     DOC "Location of FFMPEG stdint.h Header" 
    109 ) 
     91IF(WIN32) 
     92 
     93    FIND_PATH(FFMPEG_STDINT_INCLUDE_DIR stdint.h 
     94        PATHS 
     95        ${FFMPEG_ROOT}/include 
     96        $ENV{FFMPEG_DIR}/include 
     97        ~/Library/Frameworks 
     98        /Library/Frameworks 
     99        /usr/local/include 
     100        /usr/include 
     101        /sw/include # Fink 
     102        /opt/local/include # DarwinPorts 
     103        /opt/csw/include # Blastwave 
     104        /opt/include 
     105        /usr/freeware/include 
     106        PATH_SUFFIXES ffmpeg 
     107        DOC "Location of FFMPEG stdint.h Header" 
     108    ) 
     109 
     110    IF (FFMPEG_STDINT_INCLUDE_DIR) 
     111        SET(STDINT_OK TRUE) 
     112    ENDIF() 
     113 
     114ELSE() 
     115 
     116    # SET(STDINT_OK TRUE) 
     117 
     118ENDIF() 
    110119 
    111120FFMPEG_FIND(LIBAVFORMAT avformat avformat.h) 
     
    117126SET(FFMPEG_FOUND "NO") 
    118127# Note we don't check FFMPEG_LIBSWSCALE_FOUND here, it's optional. 
    119 IF   (FFMPEG_LIBAVFORMAT_FOUND AND FFMPEG_LIBAVDEVICE_FOUND AND FFMPEG_LIBAVCODEC_FOUND AND FFMPEG_LIBAVUTIL_FOUND AND FFMPEG_STDINT_INCLUDE_DIR) 
     128IF   (FFMPEG_LIBAVFORMAT_FOUND AND FFMPEG_LIBAVDEVICE_FOUND AND FFMPEG_LIBAVCODEC_FOUND AND FFMPEG_LIBAVUTIL_FOUND AND STDINT_OK) 
    120129 
    121130    SET(FFMPEG_FOUND "YES")