1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-25 20:22:39 +01:00

Fix Qt 5 compilation

This commit is contained in:
Elias Steurer 2021-06-25 12:06:43 +02:00
parent a577decdc9
commit 0ab4e2e42f
5 changed files with 13 additions and 10 deletions

View File

@ -6,12 +6,12 @@ set(CMAKE_AUTOMOC ON)
find_package(
QT NAMES Qt6 Qt5
COMPONENTS Quick Widgets Gui LinguistTools WebSockets
COMPONENTS Quick Widgets Gui LinguistTools WebSockets WebEngine QuickCompiler
REQUIRED)
find_package(
Qt${QT_VERSION_MAJOR}
COMPONENTS Quick Widgets Gui LinguistTools WebSockets
COMPONENTS Quick Widgets Gui LinguistTools WebSockets WebEngine QuickCompiler
REQUIRED)
message(STATUS "[PROJECT] QT_VERSION_MAJOR = ${QT_VERSION_MAJOR}")
@ -106,6 +106,7 @@ target_link_libraries(
Qt${QT_VERSION_MAJOR}::Widgets
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::WebSockets
Qt${QT_VERSION_MAJOR}::WebEngine
ScreenPlaySDK
ScreenPlayUtil
benchmark::benchmark

View File

@ -36,6 +36,7 @@
#include <QApplication>
#include <QCommandLineParser>
#include <QDebug>
#include <QtWebEngine/QtWebEngine>
#ifdef Q_OS_WIN
#include <sentry.h>
#endif
@ -45,7 +46,7 @@
int main(int argc, char* argv[])
{
QtWebEngine::initialize();
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication::setAttribute(Qt::AA_ShareOpenGLContexts);

View File

@ -5,11 +5,11 @@ set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOMOC ON)
find_package(
QT NAMES Qt6 Qt5
COMPONENTS Quick Widgets Gui
COMPONENTS Quick Widgets Gui WebEngine QuickCompiler
REQUIRED)
find_package(
Qt${QT_VERSION_MAJOR}
COMPONENTS Quick Widgets Gui WebEngine
COMPONENTS Quick Widgets Gui WebEngine QuickCompiler
REQUIRED)
if(WIN32)
@ -27,7 +27,7 @@ set(src main.cpp src/basewindow.cpp)
set(headers src/basewindow.h)
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
set(resources SPWResources.qrc)
qt_add_resources(resources SPWResources.qrc)
else()
qtquick_compiler_add_resources(resources SPWResources.qrc)
endif()

View File

@ -3,7 +3,7 @@
#include <QStringList>
#include <QVector>
#include <QtGlobal>
#include <QtWebEngine>
#include <QtWebEngine/QtWebEngine>
#include "ScreenPlayUtil/util.h"
@ -19,6 +19,7 @@ int main(int argc, char* argv[])
{
//QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
QtWebEngine::initialize();
QApplication app(argc, argv);

View File

@ -5,11 +5,11 @@ set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOMOC ON)
find_package(
QT NAMES Qt6 Qt5
COMPONENTS Quick Widgets Gui
COMPONENTS Quick Widgets Gui WebEngine QuickCompiler
REQUIRED)
find_package(
Qt${QT_VERSION_MAJOR}
COMPONENTS Quick Widgets Gui WebEngine
COMPONENTS Quick Widgets Gui WebEngine QuickCompiler
REQUIRED)
set(src main.cpp src/widgetwindow.cpp)
@ -17,7 +17,7 @@ set(src main.cpp src/widgetwindow.cpp)
set(headers src/widgetwindow.h)
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
set(resources SPWidgetResources.qrc)
qt_add_resources(resources SPWidgetResources.qrc)
else()
qtquick_compiler_add_resources(resources SPWidgetResources.qrc)
endif()