@ -17,7 +17,7 @@ CMAKE_DEPENDENT_OPTION(YUZU_ALLOW_SYSTEM_SDL2 "Try using system SDL2 before fall
option ( ENABLE_QT "Enable the Qt frontend" ON )
option ( ENABLE_QT "Enable the Qt frontend" ON )
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" ON "ENABLE_QT;MSVC " OFF )
CMAKE_DEPENDENT_OPTION ( YUZU_USE_BUNDLED_QT "Download bundled Qt binaries" MSVC "ENABLE_QT " OFF )
option ( ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON )
option ( ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON )
@ -240,6 +240,7 @@ yuzu_find_packages()
# 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.12 )
# W e w a n t t o l o a d t h e g e n e r a t e d c o n a n q t c o n f i g s o t h a t w e g e t t h e Q T _ R O O T v a r s o t h a t w e c a n u s e t h e o f f i c i a l
# W e w a n t t o l o a d t h e g e n e r a t e d c o n a n q t c o n f i g s o t h a t w e g e t t h e Q T _ R O O T v a r s o t h a t w e c a n u s e t h e o f f i c i a l
# Q t 5 C o n f i g i n s i d e t h e r o o t f o l d e r i n s t e a d o f t h e c o n a n g e n e r a t e d o n e .
# Q t 5 C o n f i g i n s i d e t h e r o o t f o l d e r i n s t e a d o f t h e c o n a n g e n e r a t e d o n e .
if ( EXISTS ${ CMAKE_BINARY_DIR } /qtConfig.cmake )
if ( EXISTS ${ CMAKE_BINARY_DIR } /qtConfig.cmake )
@ -247,22 +248,40 @@ if(ENABLE_QT)
list ( APPEND CMAKE_MODULE_PATH "${CONAN_QT_ROOT_RELEASE}" )
list ( APPEND CMAKE_MODULE_PATH "${CONAN_QT_ROOT_RELEASE}" )
list ( APPEND CMAKE_PREFIX_PATH "${CONAN_QT_ROOT_RELEASE}" )
list ( APPEND CMAKE_PREFIX_PATH "${CONAN_QT_ROOT_RELEASE}" )
endif ( )
endif ( )
# 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 ( ${ CMAKE_SYSTEM_NAME } STREQUAL "Linux" )
if ( NOT YUZU_USE_BUNDLED_QT )
find_package ( Qt5 ${ QT_VERSION } COMPONENTS Widgets QUIET )
if ( NOT Qt5_FOUND )
set ( YUZU_USE_BUNDLED_QT ON CACHE BOOL "Download bundled Qt" FORCE )
endif ( )
endif ( )
if ( YUZU_USE_BUNDLED_QT )
# B i n a r y p a c k a g e c u r r e n t l y d o e s n o t s u p p o r t Q t w e b e n g i n e , s o m a k e s u r e i t ' s d i s a b l e d
set ( YUZU_USE_QT_WEB_ENGINE OFF CACHE BOOL "Use Qt Webengine" FORCE )
endif ( )
endif ( )
# W o r k a r o u n d f o r a n i s s u e w h e r e c o n a n t r i e s t o b u i l d Q t f r o m s c r a t c h i n s t e a d o f d o w n l o a d p r e b u i l t b i n a r i e s
# W o r k a r o u n d f o r a n i s s u e w h e r e c o n a n t r i e s t o b u i l d Q t f r o m s c r a t c h i n s t e a d o f d o w n l o a d p r e b u i l t b i n a r i e s
set ( QT_PREFIX_HINT )
set ( QT_PREFIX_HINT )
if ( YUZU_USE_BUNDLED_QT )
if ( YUZU_USE_BUNDLED_QT )
if ( ( MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1930 ) AND ARCHITECTURE_x86_64 )
if ( ( MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1930 ) AND ARCHITECTURE_x86_64 )
set ( QT_VER qt-5.12.8-msvc2017_64 )
set ( QT_BUILD qt-5.12.8-msvc2017_64 )
elseif ( ( ${ CMAKE_SYSTEM_NAME } STREQUAL "Linux" ) AND NOT MINGW AND ARCHITECTURE_x86_64 )
set ( QT_BUILD qt5_5_15_2 )
else ( )
else ( )
message ( FATAL_ERROR "No bundled Qt binaries for your toolchain. Disable YUZU_USE_BUNDLED_QT and provide your own." )
message ( FATAL_ERROR "No bundled Qt binaries for your toolchain. Disable YUZU_USE_BUNDLED_QT and provide your own." )
endif ( )
endif ( )
if ( DEFINED QT_VER )
download_bundled_external ( "qt/" ${ QT_VER } QT_PREFIX )
if ( DEFINED QT_BUILD )
download_bundled_external ( "qt/" ${ QT_BUILD } QT_PREFIX )
endif ( )
endif ( )
set ( QT_PREFIX_HINT HINTS "${QT_PREFIX}" )
set ( QT_PREFIX_HINT HINTS "${QT_PREFIX}" )
endif ( )
endif ( )
find_package ( Qt5 5.9 COMPONENTS Widgets ${ QT_PREFIX_HINT } )
find_package ( Qt5 ${ QT_VERSION } REQUIRED COMPONENTS Widgets ${ QT_PREFIX_HINT } NO_CMAKE_SYSTEM_PATH )
if ( YUZU_USE_QT_WEB_ENGINE )
if ( YUZU_USE_QT_WEB_ENGINE )
find_package ( Qt5 COMPONENTS WebEngineCore WebEngineWidgets )
find_package ( Qt5 COMPONENTS WebEngineCore WebEngineWidgets )
endif ( )
endif ( )
@ -271,6 +290,7 @@ if(ENABLE_QT)
find_package ( Qt5 REQUIRED COMPONENTS LinguistTools ${ QT_PREFIX_HINT } )
find_package ( Qt5 REQUIRED COMPONENTS LinguistTools ${ QT_PREFIX_HINT } )
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
if ( ENABLE_SDL2 )
if ( ENABLE_SDL2 )
if ( YUZU_USE_BUNDLED_SDL2 )
if ( YUZU_USE_BUNDLED_SDL2 )
@ -379,7 +399,7 @@ if (CONAN_REQUIRED_LIBS)
if ( ENABLE_QT )
if ( ENABLE_QT )
list ( APPEND CMAKE_MODULE_PATH "${CONAN_QT_ROOT_RELEASE}" )
list ( APPEND CMAKE_MODULE_PATH "${CONAN_QT_ROOT_RELEASE}" )
list ( APPEND CMAKE_PREFIX_PATH "${CONAN_QT_ROOT_RELEASE}" )
list ( APPEND CMAKE_PREFIX_PATH "${CONAN_QT_ROOT_RELEASE}" )
find_package ( Qt5 5.9 REQUIRED COMPONENTS Widgets )
find_package ( Qt5 5.12 REQUIRED COMPONENTS Widgets )
if ( YUZU_USE_QT_WEB_ENGINE )
if ( YUZU_USE_QT_WEB_ENGINE )
find_package ( Qt5 REQUIRED COMPONENTS WebEngineCore WebEngineWidgets )
find_package ( Qt5 REQUIRED COMPONENTS WebEngineCore WebEngineWidgets )
endif ( )
endif ( )