|
|
|
@ -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)
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
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_QT_MULTIMEDIA "Use QtMultimedia for Camera" OFF)
|
|
|
|
|
|
|
|
|
|
option(YUZU_USE_QT_WEB_ENGINE "Use QtWebEngine for web applet implementation" OFF)
|
|
|
|
|
|
|
|
|
|
option(ENABLE_CUBEB "Enables the cubeb audio backend" ON)
|
|
|
|
@ -213,21 +218,64 @@ if (MINGW)
|
|
|
|
|
find_library(MSWSOCK_LIBRARY mswsock REQUIRED)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
# Please consider this as a stub
|
|
|
|
|
if(ENABLE_QT6 AND Qt6_LOCATION)
|
|
|
|
|
list(APPEND CMAKE_PREFIX_PATH "${Qt6_LOCATION}")
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
function(set_yuzu_qt_components)
|
|
|
|
|
# Best practice is to ask for all components at once, so they are from the same version
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
|
|
# Qt5 requires that we find components, so it doesn't fit our pretty little find package function
|
|
|
|
|
if(ENABLE_QT)
|
|
|
|
|
set(QT_VERSION 5.15)
|
|
|
|
|
# These are used to specify minimum versions
|
|
|
|
|
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)
|
|
|
|
|
# Qt6 sets cxx_std_17 and we need to undo that
|
|
|
|
|
set_target_properties(Qt6::Platform PROPERTIES INTERFACE_COMPILE_FEATURES "")
|
|
|
|
|
else()
|
|
|
|
|
message(STATUS "yuzu/CMakeLists.txt: Qt6 not found/not selected, trying for Qt5")
|
|
|
|
|
# When Qt6 partially found, need this set to use Qt5 when not specifying version
|
|
|
|
|
set(QT_DEFAULT_MAJOR_VERSION 5)
|
|
|
|
|
set(QT_MAJOR_VERSION 5)
|
|
|
|
|
|
|
|
|
|
set(YUZU_USE_QT_MULTIMEDIA ON)
|
|
|
|
|
# Check for system Qt on Linux, fallback to bundled Qt
|
|
|
|
|
if (UNIX AND NOT APPLE)
|
|
|
|
|
if (NOT YUZU_USE_BUNDLED_QT)
|
|
|
|
|
find_package(Qt5 ${QT_VERSION} COMPONENTS Widgets DBus Multimedia)
|
|
|
|
|
find_package(Qt5 ${QT5_VERSION} COMPONENTS Widgets DBus Multimedia)
|
|
|
|
|
endif()
|
|
|
|
|
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND (NOT Qt5_FOUND OR YUZU_USE_BUNDLED_QT))
|
|
|
|
|
# Check for dependencies, then enable bundled Qt download
|
|
|
|
|
|
|
|
|
|
# Check that the system GLIBCXX version is compatible
|
|
|
|
|
find_program(OBJDUMP objdump)
|
|
|
|
|
if ("${OBJDUMP}" STREQUAL "OBJDUMP-NOTFOUND")
|
|
|
|
|
if (NOT OBJDUMP)
|
|
|
|
|
message(FATAL_ERROR "Required program `objdump` not found.")
|
|
|
|
|
endif()
|
|
|
|
|
find_library(LIBSTDCXX libstdc++.so.6)
|
|
|
|
@ -285,7 +333,7 @@ if(ENABLE_QT)
|
|
|
|
|
set(UNRESOLVED_QT_DEPS "")
|
|
|
|
|
foreach (REQUIREMENT ${BUNDLED_QT_REQUIREMENTS})
|
|
|
|
|
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})
|
|
|
|
|
endif()
|
|
|
|
|
unset(BUNDLED_QT_${REQUIREMENT})
|
|
|
|
@ -322,19 +370,14 @@ if(ENABLE_QT)
|
|
|
|
|
set(QT_PREFIX_HINT HINTS "${QT_PREFIX}")
|
|
|
|
|
|
|
|
|
|
set(YUZU_QT_NO_CMAKE_SYSTEM_PATH "NO_CMAKE_SYSTEM_PATH")
|
|
|
|
|
endif()
|
|
|
|
|
if (UNIX AND NOT APPLE AND YUZU_USE_BUNDLED_QT)
|
|
|
|
|
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)
|
|
|
|
|
# Binary package for Qt5 has Qt Multimedia
|
|
|
|
|
set(YUZU_USE_QT_MULTIMEDIA ON CACHE BOOL "Use Qt Multimedia" FORCE)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if (ENABLE_QT_TRANSLATION)
|
|
|
|
|
find_package(Qt5 REQUIRED COMPONENTS LinguistTools ${QT_PREFIX_HINT})
|
|
|
|
|
set_yuzu_qt_components()
|
|
|
|
|
find_package(Qt5 ${QT5_VERSION} COMPONENTS ${YUZU_QT_COMPONENTS} ${QT_PREFIX_HINT} ${YUZU_QT_NO_CMAKE_SYSTEM_PATH})
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
# find SDL2 exports a bunch of variables that are needed, so its easier to do this outside of the yuzu_find_package
|
|
|
|
|