Skip to content

Commit

Permalink
Merge pull request FreeRDP#741 from bmiklautz/issue_740
Browse files Browse the repository at this point in the history
build: check libavcodec api version
  • Loading branch information
awakecoding committed Sep 26, 2012
2 parents 94dfdf5 + 06720e2 commit 4937d74
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cmake/FindFFmpeg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
# FFMPEG_INCLUDE_DIRS - combined include directories
# FFMPEG_LIBRARIES - combined libraries to link

set(REQUIRED_AVCODEC_VERSION 0.8)
set(REQUIRED_AVCODEC_API_VERSION 53.25.0)

include(FindPkgConfig)

if (PKG_CONFIG_FOUND)
Expand All @@ -31,6 +34,14 @@ endif()

FIND_PACKAGE_HANDLE_STANDARD_ARGS(FFmpeg DEFAULT_MSG AVUTIL_FOUND AVCODEC_FOUND)

if (AVCODEC_VERSION)
if (${AVCODEC_VERSION} VERSION_LESS ${REQUIRED_AVCODEC_API_VERSION})
message(FATAL_ERROR "libavcodec version >= ${REQUIRED_AVCODEC_VERSION} (API >= ${REQUIRED_AVCODEC_API_VERSION}) is required")
endif()
else()
message("Note: To build libavcodec version >= ${REQUIRED_AVCODEC_VERSION} (API >= ${REQUIRED_AVCODEC_API_VERSION}) is required")
endif()

if(FFMPEG_FOUND)
set(FFMPEG_INCLUDE_DIRS ${AVCODEC_INCLUDE_DIR} ${AVUTIL_INCLUDE_DIR})
set(FFMPEG_LIBRARIES ${AVCODEC_LIBRARY} ${AVUTIL_LIBRARY})
Expand Down

0 comments on commit 4937d74

Please sign in to comment.