Changeset 1369

Show
Ignore:
Timestamp:
03/20/08 03:37:34 (8 months ago)
Author:
timdewhirst
Message:

openlibraries
- ensure all ffmpeg libs are linked

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/FindFFMPEG.cmake

    r1368 r1369  
    44#  FFMPEG_FOUND        - system has FFMPEG 
    55#  FFMPEG_INCLUDE_DIR  - the include directory 
     6#  FFMPEG_LIBRARY_DIR  - the directory containing the libraries 
    67#  FFMPEG_LIBRARIES    - Link these to use FFMPEG 
    78#    
    89 
    9 SET( FFMPEG_NAMES avformat avcodec avutil avdevice swscale ) 
    1010SET( FFMPEG_HEADERS avformat.h avcodec.h avutil.h avdevice.h swscale.h ) 
    1111if( WIN32 ) 
     12   SET( FFMPEG_LIBRARIES avformat.lib avcodec.lib avutil.lib avdevice.lib swscale.lib ) 
    1213   FIND_PATH( FFMPEG_INCLUDE_DIR ${FFMPEG_HEADERS} 
    1314              PATHS $ENV{FFMPEGDIR}/include/ffmpeg ) 
    14    FIND_LIBRARY( FFMPEG_LIBRARIES 
    15                  NAMES ${FFMPEG_NAMES} 
    16                  PATHS $ENV{FFMPEGDIR}/lib ) 
     15   FIND_PATH( FFMPEG_LIBRARY_DIR ${FFMPEG_LIBRARIES} 
     16              PATHS $ENV{FFMPEGDIR}/lib ) 
    1717else( WIN32 ) 
     18   SET( FFMPEG_LIBRARIES avformat.* avcodec.* avutil.* avdevice.* swscale.* ) 
    1819   FIND_PATH( FFMPEG_INCLUDE_DIR ${FFMPEG_HEADERS} 
    1920              PATHS /usr/local/include/ffmpeg /usr/include/ffmpeg ) 
    20    FIND_LIBRARY( FFMPEG_LIBRARIES 
    21                  NAMES ${FFMPEG_NAMES} 
    22                  PATHS /usr/lib /usr/local/lib ) 
     21   FIND_PATH( FFMPEG_LIBRARY_DIR ${FFMPEG_LIBRARIES} 
     22              PATHS /usr/lib /usr/local/lib ) 
    2323endif( WIN32 ) 
    2424 
    25 IF (FFMPEG_INCLUDE_DIR AND FFMPEG_LIBRARIES) 
     25IF (FFMPEG_INCLUDE_DIR AND FFMPEG_LIBRARY_DIR) 
    2626   SET(FFMPEG_FOUND TRUE) 
    27 ELSE (FFMPEG_INCLUDE_DIR AND FFMPEG_LIBRARIES) 
     27   FOREACH( l ${FFMPEG_LIBRARIES} ) 
     28        SET( TMP ${TMP} ${FFMPEG_LIBRARY_DIR}/${l} ) 
     29   ENDFOREACH( l ) 
     30   SET( FFMPEG_LIBRARIES ${TMP} ) 
     31ELSE (FFMPEG_INCLUDE_DIR AND FFMPEG_LIBRARY_DIR) 
    2832   SET( FFMPEG_FOUND FALSE ) 
    2933   SET( FFMPEG_LIBRARY_DIR ) 
    30 ENDIF (FFMPEG_INCLUDE_DIR AND FFMPEG_LIBRARIES) 
     34ENDIF (FFMPEG_INCLUDE_DIR AND FFMPEG_LIBRARY_DIR) 
    3135 
    3236MARK_AS_ADVANCED( 
    33   FFMPEG_LIBRARIES 
     37  FFMPEG_LIBRARY_DIR 
    3438  FFMPEG_INCLUDE_DIR 
    3539) 
  • trunk/src/openmedialib/plugins/avformat/CMakeLists.txt

    r1368 r1369  
    2424find_package( FFMPEG ) 
    2525if( FFMPEG_FOUND ) 
    26    message( "found FFMPEG: ${FFMPEG_INCLUDE_DIR}" ) 
     26   message( "found FFMPEG: ${FFMPEG_INCLUDE_DIR} ${FFMPEG_LIBRARY_DIR}" ) 
    2727   include_directories( ${FFMPEG_INCLUDE_DIR} ) 
    2828   target_link_libraries( ${NAME} ${FFMPEG_LIBRARIES} ) 
    2929endif( FFMPEG_FOUND ) 
     30 
     31# kill some warnings 
     32if ( WIN32 ) 
     33   set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4244" ) 
     34endif( WIN32 ) 
    3035 
    3136# required links