Skip to content

Commit

Permalink
Fix mac ffmpeg version check
Browse files Browse the repository at this point in the history
  • Loading branch information
taoboyang committed Dec 14, 2023
1 parent 8b13e07 commit e9e319b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion cmake/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ if(BMF_ENABLE_FFMPEG)
set(BMF_FFMPEG_TARGETS
ffmpeg::avcodec ffmpeg::avformat ffmpeg::avfilter
ffmpeg::avdevice ffmpeg::avutil ffmpeg::swscale ffmpeg::swresample)
add_definitions(-DBMF_FFMPEG_VERSION=${BMF_FFMPEG_VERSION})
else()
set(BMF_FFMPEG_TARGETS)
message(WARNING "FFMPEG libraries not found, disable it")
Expand Down
6 changes: 5 additions & 1 deletion cmake/ffmpeg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ if(FFMPEG_LIBRARY_DIR AND FFMPEG_INCLUDE_DIR)

if(TARGET ffmpeg::avcodec)
find_ffmpeg_version(${FFMPEG_INCLUDE_DIR}/libavutil BMF_FFMPEG_VERSION)
add_definitions(-DBMF_FFMPEG_VERSION=${BMF_FFMPEG_VERSION})
set(FFMPEG_FOUND TRUE)
else()
set(FFMPEG_FOUND FALSE)
Expand All @@ -93,6 +94,10 @@ else()
set_property(TARGET ffmpeg::${ARGV0} PROPERTY INTERFACE_LINK_LIBRARIES
${LIBRARY_LINK_LIBRARIES})
unset(LIBRARY CACHE)
if("${ARGV0}" STREQUAL "avutil")
find_ffmpeg_version(${LIBRARY_INCLUDE_DIRS}/libavutil BMF_FFMPEG_VERSION)
add_definitions(-DBMF_FFMPEG_VERSION=${BMF_FFMPEG_VERSION})
endif()
endif()
endfunction()

Expand All @@ -106,7 +111,6 @@ else()
define_ffmpeg_target(swresample)

if(TARGET ffmpeg::avcodec)
find_ffmpeg_version(${FFMPEG_INCLUDE_DIR}/libavutil BMF_FFMPEG_VERSION)
set(FFMPEG_FOUND TRUE)
else()
set(FFMPEG_FOUND FALSE)
Expand Down

0 comments on commit e9e319b

Please sign in to comment.