X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=extras%2Fbuildsystem%2Fcmake%2Finclude%2FFindFFmpeg.cmake;h=832947861433ad8fbabfaf6a581c7d4ae484c50a;hb=81472e4236ea52e5432765fe1e0e08328efe3ac6;hp=7784b665c910c1388c0a9112ec434724e092ce19;hpb=5458d5a1adc85f7c1887408e578b0e734a954234;p=vlc diff --git a/extras/buildsystem/cmake/include/FindFFmpeg.cmake b/extras/buildsystem/cmake/include/FindFFmpeg.cmake index 7784b665c9..8329478614 100644 --- a/extras/buildsystem/cmake/include/FindFFmpeg.cmake +++ b/extras/buildsystem/cmake/include/FindFFmpeg.cmake @@ -5,7 +5,6 @@ # FFmpeg_LIBRARIES - Link these to use FFmpeg. # FFmpeg_CFLAGS - Link these to use FFmpeg. - if (NOT FFmpeg_SEARCHED) include(CheckLibraryExists) @@ -19,31 +18,37 @@ if (NOT FFmpeg_SEARCHED) foreach (library ffmpeg avcodec avformat avutil postproc swscale) find_library( ${library}_LIBRARY ${library} ) if (${library}_LIBRARY) - pkg_check_modules(${library}_LIBRARY lib${library}) - set(FFmpeg_CFLAGS "${FFmpeg_CFLAGS} ${${library}_LIBRARY_CFLAGS}") - set(FFmpeg_LIBRARIES "${library};${FFmpeg_LIBRARIES}") - set(FFmpeg_FOUND TRUE CACHE INTERNAL "") + pkg_check_modules(${library}_LIBRARY lib${library}) + set(FFmpeg_LIBRARIES "${library};${FFmpeg_LIBRARIES}") + + if (${library}_LIBRARY_CFLAGS) + set(FFmpeg_CFLAGS ${FFmpeg_CFLAGS} ${${library}_LIBRARY_CFLAGS}) + endif (${library}_LIBRARY_CFLAGS) + set(FFmpeg_FOUND TRUE CACHE INTERNAL "") endif (${library}_LIBRARY) endforeach (library) foreach (library a52 faac lame z png mp3lame twolame) find_library( ${library}_LIBRARY ${library} ) if (${library}_LIBRARY) - pkg_check_modules(${library}_LIBRARY lib${library}) - set(FFmpeg_CFLAGS "${FFmpeg_CFLAGS} ${${library}_LIBRARY_CFLAGS}") - set(FFmpeg_LIBRARIES "${library};${FFmpeg_LIBRARIES}") + pkg_check_modules(${library}_LIBRARY lib${library}) + set(FFmpeg_LIBRARIES "${library};${FFmpeg_LIBRARIES}") + + if (${library}_LIBRARY_CFLAGS) + set(FFmpeg_CFLAGS ${FFmpeg_CFLAGS} ${${library}_LIBRARY_CFLAGS}) + endif (${library}_LIBRARY_CFLAGS) endif (${library}_LIBRARY) endforeach (library) set(FFmpeg_LIBRARIES "${FFmpeg_LIBRARIES}" CACHE INTERNAL STRING) endif (NOT FFmpeg_FOUND) if (FFmpeg_FOUND) - if (NOT FFmpeg_FIND_QUIETLY) - message(STATUS "Found FFmpeg in: ${FFmpeg_LIBRARIES}") - endif (NOT FFmpeg_FIND_QUIETLY) + if (NOT FFmpeg_FIND_QUIETLY) + message(STATUS "Found FFmpeg in: ${FFmpeg_LIBRARIES}") + endif (NOT FFmpeg_FIND_QUIETLY) else (FFmpeg_FOUND) - if (FFmpeg_FIND_REQUIRED) - message(FATAL_ERROR "Could not find the library containing FFmpeg") - endif (FFmpeg_FIND_REQUIRED) + if (FFmpeg_FIND_REQUIRED) + message(FATAL_ERROR "Could not find the library containing FFmpeg") + endif (FFmpeg_FIND_REQUIRED) endif (FFmpeg_FOUND) mark_as_advanced(FFmpeg_LIBRARIES)