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:
parent
45f5fc04be
commit
e85f8a56bb
@ -226,7 +226,7 @@ if(TARGET zlib::zlib)
|
|||||||
add_library(ZLIB::ZLIB ALIAS zlib::zlib)
|
add_library(ZLIB::ZLIB ALIAS zlib::zlib)
|
||||||
endif()
|
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)
|
option(FORCE_BUNDLED_MINIZIP "Force bundled Minizip library" OFF)
|
||||||
if(NOT FORCE_BUNDLED_MINIZIP)
|
if(NOT FORCE_BUNDLED_MINIZIP)
|
||||||
find_package(minizip)
|
find_package(minizip)
|
||||||
|
@ -177,9 +177,16 @@ endif()
|
|||||||
|
|
||||||
target_link_libraries(vcmiclient PRIVATE
|
target_link_libraries(vcmiclient PRIVATE
|
||||||
vcmi SDL2::SDL2 SDL2::Image SDL2::Mixer SDL2::TTF
|
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
|
target_include_directories(vcmiclient
|
||||||
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user