1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

make FFmpeg dependency optional

This commit is contained in:
Andrey Filipenkov 2022-09-17 14:54:22 +03:00 committed by Andrii Danylchenko
parent 45f5fc04be
commit e85f8a56bb
2 changed files with 9 additions and 2 deletions

View File

@ -226,7 +226,7 @@ if(TARGET zlib::zlib)
add_library(ZLIB::ZLIB ALIAS zlib::zlib)
endif()
find_package(ffmpeg REQUIRED COMPONENTS avutil swscale avformat avcodec)
find_package(ffmpeg COMPONENTS avutil swscale avformat avcodec)
option(FORCE_BUNDLED_MINIZIP "Force bundled Minizip library" OFF)
if(NOT FORCE_BUNDLED_MINIZIP)
find_package(minizip)

View File

@ -177,9 +177,16 @@ endif()
target_link_libraries(vcmiclient PRIVATE
vcmi SDL2::SDL2 SDL2::Image SDL2::Mixer SDL2::TTF
ffmpeg::swscale ffmpeg::avutil ffmpeg::avcodec ffmpeg::avformat
)
if(ffmpeg_LIBRARIES)
target_link_libraries(vcmiclient PRIVATE
ffmpeg::swscale ffmpeg::avutil ffmpeg::avcodec ffmpeg::avformat
)
else()
target_compile_definitions(vcmiclient PRIVATE DISABLE_VIDEO)
endif()
target_include_directories(vcmiclient
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})