@ -18,7 +18,7 @@ CMAKE_DEPENDENT_OPTION(YUZU_USE_BUNDLED_QT "Download bundled Qt binaries" ON "EN
option ( ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON )
option ( YUZU_USE_BUNDLED_FFMPEG "Download/Build bundled yuzu" ON )
CMAKE_DEPENDENT_OPTION ( YUZU_USE_BUNDLED_FFMPEG "Download/Build bundled yuzu" ON "WIN32" OFF )
option ( YUZU_USE_QT_WEB_ENGINE "Use QtWebEngine for web applet implementation" OFF )
@ -386,6 +386,32 @@ if (NOT LIBUSB_FOUND)
set ( LIBUSB_LIBRARIES usb )
endif ( )
# L i s t o f a l l F F m p e g c o m p o n e n t s r e q u i r e d
set ( FFmpeg_COMPONENTS
a v c o d e c
a v u t i l
s w s c a l e )
if ( NOT YUZU_USE_BUNDLED_FFMPEG )
# U s e s y s t e m i n s t a l l e d F F m p e g
find_package ( FFmpeg REQUIRED COMPONENTS ${ FFmpeg_COMPONENTS } )
if ( FFmpeg_FOUND )
# O v e r w r i t e a g g r e g a t e d e f i n e s f r o m F F m p e g m o d u l e t o a v o i d o v e r - l i n k i n g l i b r a r i e s .
# P r e v e n t s s h i p p i n g t o o m a n y l i b r a r i e s w i t h t h e A p p I m a g e .
set ( FFmpeg_LIBRARIES "" )
set ( FFmpeg_INCLUDE_DIR "" )
foreach ( COMPONENT ${ FFmpeg_COMPONENTS } )
set ( FFmpeg_LIBRARIES ${ FFmpeg_LIBRARIES } ${ FFmpeg_LIBRARY_${COMPONENT } } CACHE PATH "Paths to FFmpeg libraries" FORCE )
set ( FFmpeg_INCLUDE_DIR ${ FFmpeg_INCLUDE_DIR } ${ FFmpeg_INCLUDE_${COMPONENT } } CACHE PATH "Path to FFmpeg headers" FORCE )
endforeach ( )
else ( )
message ( WARNING "FFmpeg not found, falling back to externals" )
set ( YUZU_USE_BUNDLED_FFMPEG ON )
endif ( )
endif ( )
if ( YUZU_USE_BUNDLED_FFMPEG )
if ( NOT WIN32 )
# B u i l d F F m p e g f r o m e x t e r n a l s
@ -407,11 +433,6 @@ if (YUZU_USE_BUNDLED_FFMPEG)
set ( FFmpeg_FOUND YES )
endif ( )
set ( FFmpeg_COMPONENTS
a v c o d e c
a v u t i l
s w s c a l e )
foreach ( COMPONENT ${ FFmpeg_COMPONENTS } )
set ( FFmpeg_ ${ COMPONENT } _PREFIX "${FFmpeg_BUILD_DIR}/lib${COMPONENT}" )
set ( FFmpeg_ ${ COMPONENT } _LIB_NAME "lib${COMPONENT}.a" )
@ -496,14 +517,9 @@ if (YUZU_USE_BUNDLED_FFMPEG)
$ { F F m p e g _ L I B R A R Y _ D I R } / a v u t i l . l i b
C A C H E P A T H " P a t h s t o F F m p e g l i b r a r i e s " F O R C E )
endif ( )
else ( )
# U s e s y s t e m i n s t a l l e d F F m p e g
find_package ( FFmpeg REQUIRED )
endif ( )
if ( NOT FFmpeg_FOUND )
message ( FATAL_ERROR "FFmpeg not found" )
endif ( )
endif ( )
unset ( FFmpeg_COMPONENTS )
# P r e f e r t h e - p t h r e a d f l a g o n L i n u x .
set ( THREADS_PREFER_PTHREAD_FLAG ON )