@ -19,6 +19,9 @@ CMAKE_DEPENDENT_OPTION(YUZU_USE_BUNDLED_SDL2 "Download bundled SDL2 binaries" ON
CMAKE_DEPENDENT_OPTION ( YUZU_USE_EXTERNAL_SDL2 "Compile external SDL2" ON "ENABLE_SDL2;NOT MSVC" OFF )
CMAKE_DEPENDENT_OPTION ( YUZU_USE_EXTERNAL_SDL2 "Compile external SDL2" ON "ENABLE_SDL2;NOT MSVC" OFF )
option ( ENABLE_QT "Enable the Qt frontend" ON )
option ( ENABLE_QT "Enable the Qt frontend" ON )
option ( ENABLE_QT6 "Allow usage of Qt6 to be attempted" OFF )
set ( QT6_LOCATION "" CACHE PATH "Additional Location to search for Qt6 libraries like C:/Qt/6.3.1/msvc2019_64/" )
option ( ENABLE_QT_TRANSLATION "Enable translations for the Qt frontend" OFF )
option ( ENABLE_QT_TRANSLATION "Enable translations for the Qt frontend" OFF )
CMAKE_DEPENDENT_OPTION ( YUZU_USE_BUNDLED_QT "Download bundled Qt binaries" "${MSVC}" "ENABLE_QT" OFF )
CMAKE_DEPENDENT_OPTION ( YUZU_USE_BUNDLED_QT "Download bundled Qt binaries" "${MSVC}" "ENABLE_QT" OFF )
@ -28,6 +31,8 @@ option(YUZU_USE_BUNDLED_LIBUSB "Compile bundled libusb" OFF)
option ( YUZU_USE_BUNDLED_FFMPEG "Download/Build bundled FFmpeg" "${WIN32}" )
option ( YUZU_USE_BUNDLED_FFMPEG "Download/Build bundled FFmpeg" "${WIN32}" )
option ( YUZU_USE_QT_MULTIMEDIA "Use QtMultimedia for Camera" OFF )
option ( YUZU_USE_QT_WEB_ENGINE "Use QtWebEngine for web applet implementation" OFF )
option ( YUZU_USE_QT_WEB_ENGINE "Use QtWebEngine for web applet implementation" OFF )
option ( ENABLE_CUBEB "Enables the cubeb audio backend" ON )
option ( ENABLE_CUBEB "Enables the cubeb audio backend" ON )
@ -213,21 +218,64 @@ if (MINGW)
find_library ( MSWSOCK_LIBRARY mswsock REQUIRED )
find_library ( MSWSOCK_LIBRARY mswsock REQUIRED )
endif ( )
endif ( )
# P l e a s e c o n s i d e r t h i s a s a s t u b
if ( ENABLE_QT6 AND Qt6_LOCATION )
list ( APPEND CMAKE_PREFIX_PATH "${Qt6_LOCATION}" )
endif ( )
function ( set_yuzu_qt_components )
# B e s t p r a c t i c e i s t o a s k f o r a l l c o m p o n e n t s a t o n c e , s o t h e y a r e f r o m t h e s a m e v e r s i o n
set ( YUZU_QT_COMPONENTS2 Core Widgets Concurrent )
if ( ${ CMAKE_SYSTEM_NAME } STREQUAL "Linux" )
list ( APPEND YUZU_QT_COMPONENTS2 DBus )
endif ( )
if ( YUZU_USE_QT_MULTIMEDIA )
list ( APPEND YUZU_QT_COMPONENTS2 Multimedia )
endif ( )
if ( YUZU_USE_QT_WEB_ENGINE )
list ( APPEND YUZU_QT_COMPONENTS2 WebEngineCore WebEngineWidgets )
endif ( )
if ( ENABLE_QT_TRANSLATION )
list ( APPEND YUZU_QT_COMPONENTS2 LinguistTools )
endif ( )
set ( YUZU_QT_COMPONENTS ${ YUZU_QT_COMPONENTS2 } PARENT_SCOPE )
endfunction ( set_yuzu_qt_components )
# Q t 5 r e q u i r e s t h a t w e f i n d c o m p o n e n t s , s o i t d o e s n ' t f i t o u r p r e t t y l i t t l e f i n d p a c k a g e f u n c t i o n
# Q t 5 r e q u i r e s t h a t w e f i n d c o m p o n e n t s , s o i t d o e s n ' t f i t o u r p r e t t y l i t t l e f i n d p a c k a g e f u n c t i o n
if ( ENABLE_QT )
if ( ENABLE_QT )
set ( QT_VERSION 5.15 )
set ( QT_VERSION 5.15 )
# T h e s e a r e u s e d t o s p e c i f y m i n i m u m v e r s i o n s
set ( QT5_VERSION 5.15 )
set ( QT6_VERSION 6.3.1 )
set_yuzu_qt_components ( )
if ( ENABLE_QT6 )
find_package ( Qt6 ${ QT6_VERSION } COMPONENTS ${ YUZU_QT_COMPONENTS } )
endif ( )
if ( Qt6_FOUND )
message ( STATUS "yuzu/CMakeLists.txt: Qt6Widgets_VERSION ${Qt6Widgets_VERSION}, setting QT_VERSION" )
set ( QT_VERSION ${ Qt6Widgets_VERSION } )
set ( QT_MAJOR_VERSION 6 )
# Q t 6 s e t s c x x _ s t d _ 1 7 a n d w e n e e d t o u n d o t h a t
set_target_properties ( Qt6::Platform PROPERTIES INTERFACE_COMPILE_FEATURES "" )
else ( )
message ( STATUS "yuzu/CMakeLists.txt: Qt6 not found/not selected, trying for Qt5" )
# W h e n Q t 6 p a r t i a l l y f o u n d , n e e d t h i s s e t t o u s e Q t 5 w h e n n o t s p e c i f y i n g v e r s i o n
set ( QT_DEFAULT_MAJOR_VERSION 5 )
set ( QT_MAJOR_VERSION 5 )
set ( YUZU_USE_QT_MULTIMEDIA ON )
# C h e c k f o r s y s t e m Q t o n L i n u x , f a l l b a c k t o b u n d l e d Q t
# C h e c k f o r s y s t e m Q t o n L i n u x , f a l l b a c k t o b u n d l e d Q t
if ( UNIX AND NOT APPLE )
if ( UNIX AND NOT APPLE )
if ( NOT YUZU_USE_BUNDLED_QT )
if ( NOT YUZU_USE_BUNDLED_QT )
find_package ( Qt5 ${ QT_VERSION } COMPONENTS Widgets DBus Multimedia )
find_package ( Qt5 ${ QT 5 _VERSION} COMPONENTS Widgets DBus Multimedia )
endif ( )
endif ( )
if ( ${ CMAKE_SYSTEM_NAME } STREQUAL "Linux" AND ( NOT Qt5_FOUND OR YUZU_USE_BUNDLED_QT ) )
if ( ${ CMAKE_SYSTEM_NAME } STREQUAL "Linux" AND ( NOT Qt5_FOUND OR YUZU_USE_BUNDLED_QT ) )
# C h e c k f o r d e p e n d e n c i e s , t h e n e n a b l e b u n d l e d Q t d o w n l o a d
# C h e c k f o r d e p e n d e n c i e s , t h e n e n a b l e b u n d l e d Q t d o w n l o a d
# C h e c k t h a t t h e s y s t e m G L I B C X X v e r s i o n i s c o m p a t i b l e
# C h e c k t h a t t h e s y s t e m G L I B C X X v e r s i o n i s c o m p a t i b l e
find_program ( OBJDUMP objdump )
find_program ( OBJDUMP objdump )
if ( "${OBJDUMP}" STREQUAL "OBJDUMP-NOTFOUND" )
if ( NOT OBJDUMP )
message ( FATAL_ERROR "Required program `objdump` not found." )
message ( FATAL_ERROR "Required program `objdump` not found." )
endif ( )
endif ( )
find_library ( LIBSTDCXX libstdc++.so.6 )
find_library ( LIBSTDCXX libstdc++.so.6 )
@ -285,7 +333,7 @@ if(ENABLE_QT)
set ( UNRESOLVED_QT_DEPS "" )
set ( UNRESOLVED_QT_DEPS "" )
foreach ( REQUIREMENT ${ BUNDLED_QT_REQUIREMENTS } )
foreach ( REQUIREMENT ${ BUNDLED_QT_REQUIREMENTS } )
find_library ( BUNDLED_QT_ ${ REQUIREMENT } ${ REQUIREMENT } )
find_library ( BUNDLED_QT_ ${ REQUIREMENT } ${ REQUIREMENT } )
if ( "${BUNDLED_QT_${REQUIREMENT}}" STREQUAL "BUNDLED_QT_${REQUIREMENT}-NOTFOUND" )
if ( NOT BUNDLED_QT_ ${ REQUIREMENT } )
set ( UNRESOLVED_QT_DEPS ${ UNRESOLVED_QT_DEPS } ${ REQUIREMENT } )
set ( UNRESOLVED_QT_DEPS ${ UNRESOLVED_QT_DEPS } ${ REQUIREMENT } )
endif ( )
endif ( )
unset ( BUNDLED_QT_ ${ REQUIREMENT } )
unset ( BUNDLED_QT_ ${ REQUIREMENT } )
@ -322,19 +370,14 @@ if(ENABLE_QT)
set ( QT_PREFIX_HINT HINTS "${QT_PREFIX}" )
set ( QT_PREFIX_HINT HINTS "${QT_PREFIX}" )
set ( YUZU_QT_NO_CMAKE_SYSTEM_PATH "NO_CMAKE_SYSTEM_PATH" )
set ( YUZU_QT_NO_CMAKE_SYSTEM_PATH "NO_CMAKE_SYSTEM_PATH" )
endif ( )
# B i n a r y p a c k a g e f o r Q t 5 h a s Q t M u l t i m e d i a
if ( UNIX AND NOT APPLE AND YUZU_USE_BUNDLED_QT )
set ( YUZU_USE_QT_MULTIMEDIA ON CACHE BOOL "Use Qt Multimedia" FORCE )
find_package ( Qt5 ${ QT_VERSION } REQUIRED COMPONENTS Widgets Concurrent Multimedia DBus ${ QT_PREFIX_HINT } ${ YUZU_QT_NO_CMAKE_SYSTEM_PATH } )
else ( )
find_package ( Qt5 ${ QT_VERSION } REQUIRED COMPONENTS Widgets Concurrent Multimedia ${ QT_PREFIX_HINT } ${ YUZU_QT_NO_CMAKE_SYSTEM_PATH } )
endif ( )
if ( YUZU_USE_QT_WEB_ENGINE )
find_package ( Qt5 REQUIRED COMPONENTS WebEngineCore WebEngineWidgets )
endif ( )
endif ( )
if ( ENABLE_QT_TRANSLATION )
set_yuzu_qt_components ( )
find_package ( Qt5 REQUIRED COMPONENTS LinguistTools ${ QT_PREFIX_HINT } )
find_package ( Qt5 ${ QT5_VERSION } COMPONENTS ${ YUZU_QT_COMPONENTS } ${ QT_PREFIX_HINT } ${ YUZU_QT_NO_CMAKE_SYSTEM_PATH } )
endif ( )
endif ( )
endif ( )
endif ( )
# f i n d S D L 2 e x p o r t s a b u n c h o f v a r i a b l e s t h a t a r e n e e d e d , s o i t s e a s i e r t o d o t h i s o u t s i d e o f t h e y u z u _ f i n d _ p a c k a g e
# f i n d S D L 2 e x p o r t s a b u n c h o f v a r i a b l e s t h a t a r e n e e d e d , s o i t s e a s i e r t o d o t h i s o u t s i d e o f t h e y u z u _ f i n d _ p a c k a g e