@ -18,6 +18,8 @@ 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 )
option ( YUZU_USE_QT_WEB_ENGINE "Use QtWebEngine for web applet implementation" OFF )
option ( YUZU_ENABLE_BOXCAT "Enable the Boxcat service, a yuzu high-level implementation of BCAT" ON )
@ -384,17 +386,107 @@ if (NOT LIBUSB_FOUND)
set ( LIBUSB_LIBRARIES usb )
endif ( )
# U s e s y s t e m i n s t a l l e d f f m p e g .
if ( NOT MSVC )
find_package ( FFmpeg REQUIRED )
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
message ( STATUS "Using FFmpeg from externals" )
set ( FFMPEG_PREFIX ${ PROJECT_SOURCE_DIR } /externals/ffmpeg )
set ( FFMPEG_BUILD_DIR ${ PROJECT_BINARY_DIR } /externals/ffmpeg )
set ( FFMPEG_MAKEFILE ${ FFMPEG_BUILD_DIR } /Makefile )
make_directory ( ${ FFMPEG_BUILD_DIR } )
# R e a d v e r s i o n s t r i n g f r o m e x t e r n a l
file ( READ ${ FFMPEG_PREFIX } /RELEASE FFMPEG_VERSION )
set ( FFMPEG_FOUND NO )
if ( NOT FFMPEG_VERSION STREQUAL "" )
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" )
set ( FFMPEG_ ${ COMPONENT } _LIBRARY "${FFMPEG_${COMPONENT}_PREFIX}/${FFMPEG_${COMPONENT}_LIB_NAME}" )
set ( FFMPEG_LIBRARIES
$ { F F M P E G _ L I B R A R I E S }
$ { F F M P E G _ $ { C O M P O N E N T } _ L I B R A R Y }
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 )
endforeach ( )
set ( FFMPEG_INCLUDE_DIR
$ { F F M P E G _ P R E F I X }
C A C H E P A T H " P a t h t o F F m p e g h e a d e r s " F O R C E )
# ` c o n f i g u r e ` p a r a m e t e r s b u i l d s o n l y e x a c t l y w h a t y u z u n e e d s f r o m F F m p e g
# ` - - d i s a b l e - { v a a p i , v d p a u } ` i s n e e d e d t o a v o i d l i n k i n g i s s u e s
add_custom_command (
O U T P U T
$ { F F M P E G _ M A K E F I L E }
C O M M A N D
/ b i n / b a s h $ { F F M P E G _ P R E F I X } / c o n f i g u r e
- - d i s a b l e - a v d e v i c e
- - d i s a b l e - a v f i l t e r
- - d i s a b l e - a v f o r m a t
- - d i s a b l e - d o c
- - d i s a b l e - e v e r y t h i n g
- - d i s a b l e - f f m p e g
- - d i s a b l e - f f p r o b e
- - d i s a b l e - n e t w o r k
- - d i s a b l e - p o s t p r o c
- - d i s a b l e - s w r e s a m p l e
- - d i s a b l e - v a a p i
- - d i s a b l e - v d p a u
- - e n a b l e - d e c o d e r = h 2 6 4
- - e n a b l e - d e c o d e r = v p 9
W O R K I N G _ D I R E C T O R Y
$ { F F M P E G _ B U I L D _ D I R }
)
add_custom_command (
O U T P U T
$ { F F M P E G _ L I B R A R I E S }
C O M M A N D
m a k e
W O R K I N G _ D I R E C T O R Y
$ { F F M P E G _ B U I L D _ D I R }
)
# A L L m a k e s t h i s c u s t o m t a r g e t b u i l d e v e r y t i m e
# b u t i t w o n ' t a c t u a l l y b u i l d i f t h e D E P E N D S p a r a m e t e r i s u p t o d a t e
add_custom_target ( ffmpeg-build ALL DEPENDS ${ FFMPEG_LIBRARIES } )
add_custom_target ( ffmpeg-configure ALL DEPENDS ${ FFMPEG_MAKEFILE } )
if ( FFMPEG_FOUND )
message ( STATUS "Found FFmpeg version ${FFMPEG_VERSION}" )
add_dependencies ( ffmpeg-build ffmpeg-configure )
else ( )
message ( FATAL_ERROR "FFmpeg not found" )
endif ( )
else ( ) # WIN32
# U s e y u z u F F m p e g b i n a r i e s
set ( FFMPEG_EXT_NAME "ffmpeg-4.2.1" )
set ( FFMPEG_PATH "${CMAKE_BINARY_DIR}/externals/${FFMPEG_EXT_NAME}" )
download_bundled_external ( "ffmpeg/" ${ FFMPEG_EXT_NAME } "" )
set ( FFMPEG_FOUND YES )
set ( FFMPEG_INCLUDE_DIR "${FFMPEG_PATH}/include" CACHE PATH "Path to FFmpeg headers" FORCE )
set ( FFMPEG_LIBRARY_DIR "${FFMPEG_PATH}/bin" CACHE PATH "Path to FFmpeg library directory" FORCE )
set ( FFMPEG_DLL_DIR "${FFMPEG_PATH}/bin" CACHE PATH "Path to FFmpeg dll's" FORCE )
set ( FFMPEG_LIBRARIES
$ { F F M P E G _ L I B R A R Y _ D I R } / s w s c a l e . l i b
$ { F F M P E G _ L I B R A R Y _ D I R } / a v c o d e c . l i b
$ { 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 ( )
set ( FFMPEG_EXT_NAME "ffmpeg-4.2.1" )
set ( FFMPEG_PATH "${CMAKE_BINARY_DIR}/externals/${FFMPEG_EXT_NAME}" )
download_bundled_external ( "ffmpeg/" ${ FFMPEG_EXT_NAME } "" )
set ( FFMPEG_FOUND YES )
set ( FFMPEG_INCLUDE_DIR "${FFMPEG_PATH}/include" CACHE PATH "Path to FFmpeg headers" FORCE )
set ( FFMPEG_LIBRARY_DIR "${FFMPEG_PATH}/bin" CACHE PATH "Path to FFmpeg library" FORCE )
set ( FFMPEG_DLL_DIR "${FFMPEG_PATH}/bin" CACHE PATH "Path to FFmpeg dll's" FORCE )
# 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 VERSION 4.0 )
endif ( )
# 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 .