CMake: Support Qt6 build

1.9.x
Syping 2 years ago
parent fcbe264d63
commit 6af5f94d70
  1. 2
      .drone.yml
  2. 2
      .gitlab-ci.yml
  3. 2
      .travis.yml
  4. 27
      CMakeLists.txt
  5. 2
      config.h
  6. 5
      gta5view.pro
  7. 8
      res/app.rc
  8. 0
      res/qt5/qtbase_de.qm
  9. 0
      res/qt5/qtbase_fr.qm
  10. 0
      res/qt5/qtbase_ko.qm
  11. 0
      res/qt5/qtbase_ru.qm
  12. 0
      res/qt5/qtbase_uk.qm
  13. 0
      res/qt5/qtbase_zh_TW.qm
  14. BIN
      res/qt6/qtbase_de.qm
  15. BIN
      res/qt6/qtbase_fr.qm
  16. BIN
      res/qt6/qtbase_ko.qm
  17. BIN
      res/qt6/qtbase_ru.qm
  18. BIN
      res/qt6/qtbase_uk.qm
  19. BIN
      res/qt6/qtbase_zh_TW.qm
  20. BIN
      res/qtbase_en_GB.qm
  21. 16447
      res/qtbase_en_GB.ts
  22. 12
      res/tr_qt5.qrc
  23. 11
      res/tr_qt6.qrc

@ -2,7 +2,7 @@ kind: pipeline
type: docker
environment:
BUILD_TYPE: "REL"
BUILD_TYPE: "DEV"
steps:
- name: Windows Installer

@ -2,7 +2,7 @@ stages:
- build
variables:
BUILD_TYPE: "REL"
BUILD_TYPE: "DEV"
Windows Installer:
stage: build

@ -8,7 +8,7 @@ service:
env:
global:
- BUILD_TYPE=REL
- BUILD_TYPE=DEV
matrix:
include:

@ -11,13 +11,20 @@ set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Qt5 COMPONENTS Network Svg Widgets REQUIRED)
find_package(Qt5 COMPONENTS LinguistTools QUIET)
option(QT6_BUILD "Build gta5view with Qt6" OFF)
if(QT6_BUILD)
set(QT_VERSION_MAJOR 6)
else()
set(QT_VERSION_MAJOR 5)
endif()
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Network Svg Widgets REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS LinguistTools QUIET)
if(WIN32)
find_package(Qt5 COMPONENTS WinExtras REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS WinExtras REQUIRED)
list(APPEND GTA5VIEW_LIBS
Qt5::WinExtras
Qt${QT_VERSION_MAJOR}::WinExtras
)
list(APPEND GTA5VIEW_DEFINES
-DUNICODE
@ -179,7 +186,7 @@ if(QCONF_BUILD)
else()
list(APPEND GTA5VIEW_RESOURCES
res/tr_g5p.qrc
res/tr_qt5.qrc
res/tr_qt${QT_VERSION_MAJOR}.qrc
)
endif()
@ -194,6 +201,7 @@ endif()
option(WITH_MOTD "Developer message system directed to users" OFF)
if(WITH_MOTD)
set(MOTD_WEBURL "" CACHE STRING "Messages WebURL")
list(APPEND GTA5VIEW_HEADERS
MessageThread.h
)
@ -212,6 +220,11 @@ endif()
option(WITH_TELEMETRY "Hardware survey and basic telemetry system" OFF)
if(WITH_TELEMETRY)
set(TELEMETRY_AUTHID "" CACHE STRING "Telemetry AuthID")
set(TELEMETRY_AUTHPW "" CACHE STRING "Telemetry AuthPW")
set(TELEMETRY_PUSHURL "" CACHE STRING "Telemetry PushURL")
set(TELEMETRY_REGURL "" CACHE STRING "Telemetry RegURL")
set(TELEMETRY_WEBURL "" CACHE STRING "Telemetry WebURL")
list(APPEND GTA5VIEW_HEADERS
TelemetryClass.h
tmext/TelemetryClassAuthenticator.h
@ -332,11 +345,13 @@ endif()
if(Qt5Core_VERSION VERSION_GREATER_EQUAL "5.14.0")
qt5_import_plugins(gta5view INCLUDE Qt5::QSvgPlugin)
elseif(Qt6Core_VERSION VERSION_GREATER_EQUAL "6.0")
qt6_import_plugins(gta5view INCLUDE Qt6::QSvgPlugin)
endif()
target_compile_definitions(gta5view PRIVATE ${GTA5VIEW_DEFINES})
target_include_directories(gta5view PRIVATE ${GTA5VIEW_INCLUDEDIR})
target_link_libraries(gta5view PRIVATE Qt5::Network Qt5::Svg Qt5::Widgets ${GTA5VIEW_LIBS})
target_link_libraries(gta5view PRIVATE Qt${QT_VERSION_MAJOR}::Network Qt${QT_VERSION_MAJOR}::Svg Qt${QT_VERSION_MAJOR}::Widgets ${GTA5VIEW_LIBS})
install(TARGETS gta5view DESTINATION bin)
install(FILES res/de.syping.gta5view.desktop DESTINATION share/applications)

@ -44,7 +44,7 @@
#endif
#ifndef GTA5SYNC_APPVER
#define GTA5SYNC_APPVER "1.8.0"
#define GTA5SYNC_APPVER "1.9.0"
#endif
#if __cplusplus

@ -217,6 +217,10 @@ isEqual(QT_MAJOR_VERSION, 5): RESOURCES += res/tr_qt5.qrc
greaterThan(QT_MAJOR_VERSION, 4): GTA5SYNC_RCC = $$[QT_HOST_BINS]/rcc
# QT6 ONLY STUFF
isEqual(QT_MAJOR_VERSION, 6): RESOURCES += res/tr_qt6.qrc
# RESOURCE COMPILATION
system($$GTA5SYNC_RCC -threshold 0 -compress 9 $$PWD/res/global.qrc -o $$OUT_PWD/qrc_global.cpp) {
@ -241,6 +245,7 @@ INSTALLS += target pixmaps appfiles
contains(DEFINES, GTA5SYNC_QCONF) {
isEqual(QT_MAJOR_VERSION, 4): RESOURCES -= res/tr_qt4.qrc
isEqual(QT_MAJOR_VERSION, 5): RESOURCES -= res/tr_qt5.qrc
isEqual(QT_MAJOR_VERSION, 6): RESOURCES -= res/tr_qt6.qrc
!contains(DEFINES, GTA5SYNC_QCONF_IN) {
RESOURCES -= res/tr_g5p.qrc
langfiles.path = $$GTA5SYNC_PREFIX/share/gta5view/translations

@ -4,8 +4,8 @@ IDI_ICON1 ICON DISCARDABLE "5sync.ico"
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "gta5view.exe.manifest"
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1, 8, 0, 0
PRODUCTVERSION 1, 8, 0, 0
FILEVERSION 1, 9, 0, 0
PRODUCTVERSION 1, 9, 0, 0
FILEFLAGSMASK 0x3fL
FILEFLAGS 0
FILEOS VOS_NT_WINDOWS32
@ -22,12 +22,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "Syping"
VALUE "FileDescription", "gta5view"
VALUE "FileVersion", "1.8.0"
VALUE "FileVersion", "1.9.0"
VALUE "InternalName", "gta5view"
VALUE "LegalCopyright", "Copyright © 2016-2020 Syping"
VALUE "OriginalFilename", "gta5view.exe"
VALUE "ProductName", "gta5view"
VALUE "ProductVersion", "1.8.0"
VALUE "ProductVersion", "1.9.0"
END
END
END

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

@ -1,11 +1,11 @@
<RCC>
<qresource prefix="/tr">
<file>qtbase_en_GB.qm</file>
<file>qtbase_de.qm</file>
<file>qtbase_fr.qm</file>
<file>qtbase_ko.qm</file>
<file>qtbase_ru.qm</file>
<file>qtbase_uk.qm</file>
<file>qtbase_zh_TW.qm</file>
<file>qt5/qtbase_de.qm</file>
<file>qt5/qtbase_fr.qm</file>
<file>qt5/qtbase_ko.qm</file>
<file>qt5/qtbase_ru.qm</file>
<file>qt5/qtbase_uk.qm</file>
<file>qt5/qtbase_zh_TW.qm</file>
</qresource>
</RCC>

@ -0,0 +1,11 @@
<RCC>
<qresource prefix="/tr">
<file>qtbase_en_GB.qm</file>
<file>qt6/qtbase_de.qm</file>
<file>qt6/qtbase_fr.qm</file>
<file>qt6/qtbase_ko.qm</file>
<file>qt6/qtbase_ru.qm</file>
<file>qt6/qtbase_uk.qm</file>
<file>qt6/qtbase_zh_TW.qm</file>
</qresource>
</RCC>
Loading…
Cancel
Save