From 57c32eea584abccf0848117b9ebaa78d84e70817 Mon Sep 17 00:00:00 2001 From: Syping Date: Thu, 3 Sep 2020 00:03:04 +0200 Subject: [PATCH] QMake: No need for 'make depend' anymore --- .ci/debian_build.sh | 1 - .ci/osx_build.sh | 1 - .ci/windows_build.sh | 3 +-- .ci/wininstall_build.sh | 3 +-- CMakeLists.txt | 2 +- README.md | 1 - gta5view.pro | 24 ++++++++++++++++-------- main.cpp | 4 ---- res/{app_cmake.qrc => app.qrc} | 0 res/app_qmake.qrc | 34 ---------------------------------- res/gta5sync.ts | 14 +++++++------- res/gta5sync_de.ts | 14 +++++++------- res/gta5sync_en_US.ts | 14 +++++++------- res/gta5sync_fr.ts | 14 +++++++------- res/gta5sync_ko.ts | 14 +++++++------- res/gta5sync_ru.ts | 14 +++++++------- res/gta5sync_uk.ts | 14 +++++++------- res/gta5sync_zh_TW.ts | 14 +++++++------- 18 files changed, 75 insertions(+), 110 deletions(-) rename res/{app_cmake.qrc => app.qrc} (100%) delete mode 100644 res/app_qmake.qrc diff --git a/.ci/debian_build.sh b/.ci/debian_build.sh index a0c5baf..a6fd66b 100755 --- a/.ci/debian_build.sh +++ b/.ci/debian_build.sh @@ -31,6 +31,5 @@ checkinstall -D --default --nodoc --install=no --pkgname=gta5view-qt5 --pkgversi cd .. && \ cd qt4 && \ qmake -qt=4 GTA5SYNC_PREFIX=/usr QMAKE_CXXFLAGS+=-std=gnu++11 ${QMAKE_FLAGS_QT4} ${QMAKE_BUILD_TYPE} "DEFINES+=GTA5SYNC_BUILDCODE=\\\\\\\"${PACKAGE_CODE}\\\\\\\"" "DEFINES+=GTA5SYNC_APPVER=\\\\\\\"${APPLICATION_VERSION}\\\\\\\"" DEFINES+=GTA5SYNC_QCONF ../../gta5view.pro && \ -make depend && \ make -j 4 && \ checkinstall -D --default --nodoc --install=no --pkgname=gta5view-qt4 --pkgversion=${PACKAGE_VERSION} --pkgrelease=${PACKAGE_BUILD} --pkggroup=utility --maintainer="Syping \" --requires=libqtcore4,libqtgui4,libqt4-network,libqt4-svg,qtcore4-l10n --conflicts=gta5view,gta5view-qt5 --replaces=gta5view,gta5view-qt5 --pakdir=${PROJECT_DIR}/assets diff --git a/.ci/osx_build.sh b/.ci/osx_build.sh index 368164c..095a952 100755 --- a/.ci/osx_build.sh +++ b/.ci/osx_build.sh @@ -9,7 +9,6 @@ mkdir -p assets && \ cd build && \ /usr/local/opt/qt/bin/qmake ${QMAKE_FLAGS_QT5} ${QMAKE_BUILD_TYPE} "DEFINES+=GTA5SYNC_BUILDCODE=\\\\\\\"${PACKAGE_CODE}\\\\\\\"" "DEFINES+=GTA5SYNC_APPVER=\\\\\\\"${APPLICATION_VERSION}\\\\\\\"" "DEFINES+=GTA5SYNC_COMMIT=\\\\\\\"${APPLICATION_COMMIT}\\\\\\\"" DEFINES+=GTA5SYNC_TELEMETRY "DEFINES+=GTA5SYNC_TELEMETRY_WEBURL=\\\\\\\"https://dev.syping.de/gta5view-userstats/\\\\\\\"" ../gta5view.pro && \ -make depend && \ make -j 4 && \ /usr/local/opt/qt/bin/macdeployqt gta5view.app -dmg && \ cp -Rf gta5view.dmg ../assets/gta5view-osx_${APPLICATION_VERSION}.dmg diff --git a/.ci/windows_build.sh b/.ci/windows_build.sh index b390c4b..ad8ee9f 100755 --- a/.ci/windows_build.sh +++ b/.ci/windows_build.sh @@ -12,8 +12,7 @@ mkdir -p assets && \ # Starting build cd build && \ -qmake-static ${QMAKE_FLAGS_QT5} ${QMAKE_BUILD_TYPE} "DEFINES+=GTA5SYNC_BUILDCODE=\\\\\\\"${PACKAGE_CODE}\\\\\\\"" "DEFINES+=GTA5SYNC_APPVER=\\\\\\\"${APPLICATION_VERSION}\\\\\\\"" "DEFINES+=GTA5SYNC_COMMIT=\\\\\\\"${APPLICATION_COMMIT}\\\\\\\"" DEFINES+=GTA5SYNC_TELEMETRY "DEFINES+=GTA5SYNC_TELEMETRY_WEBURL=\\\\\\\"https://dev.syping.de/gta5view-userstats/\\\\\\\"" DEFINES+=GTA5SYNC_DONATION "DEFINES+=GTA5SYNC_DONATION_EMAIL=\\\\\\\"paypal/at/syping.de\\\\\\\"" ../gta5view.pro && \ -make depend && \ +qmake-static ${QMAKE_FLAGS_QT5} ${QMAKE_BUILD_TYPE} "DEFINES+=GTA5SYNC_BUILDCODE=\\\\\\\"${PACKAGE_CODE}\\\\\\\"" "DEFINES+=GTA5SYNC_APPVER=\\\\\\\"${APPLICATION_VERSION}\\\\\\\"" "DEFINES+=GTA5SYNC_COMMIT=\\\\\\\"${APPLICATION_COMMIT}\\\\\\\"" DEFINES+=GTA5SYNC_TELEMETRY "DEFINES+=GTA5SYNC_TELEMETRY_WEBURL=\\\\\\\"https://dev.syping.de/gta5view-userstats/\\\\\\\"" ../gta5view.pro && \ make -j 4 && \ cp -Rf release/*.exe ${PROJECT_DIR}/assets/${GTA5VIEW_EXECUTABLE} && \ cd ${PROJECT_DIR}/assets diff --git a/.ci/wininstall_build.sh b/.ci/wininstall_build.sh index 8936ee0..fe9a9e9 100755 --- a/.ci/wininstall_build.sh +++ b/.ci/wininstall_build.sh @@ -12,8 +12,7 @@ mkdir -p assets && \ # Starting build cd build && \ -qmake ${QMAKE_FLAGS_QT5} ${QMAKE_BUILD_TYPE} "DEFINES+=GTA5SYNC_BUILDCODE=\\\\\\\"${PACKAGE_CODE}\\\\\\\"" "DEFINES+=GTA5SYNC_APPVER=\\\\\\\"${APPLICATION_VERSION}\\\\\\\"" "DEFINES+=GTA5SYNC_COMMIT=\\\\\\\"${APPLICATION_COMMIT}\\\\\\\"" DEFINES+=GTA5SYNC_TELEMETRY "DEFINES+=GTA5SYNC_TELEMETRY_WEBURL=\\\\\\\"https://dev.syping.de/gta5view-userstats/\\\\\\\"" DEFINES+=GTA5SYNC_DONATION "DEFINES+=GTA5SYNC_DONATION_EMAIL=\\\\\\\"paypal/at/syping.de\\\\\\\"" DEFINES+=GTA5SYNC_QCONF DEFINES+=GTA5SYNC_INLANG='\\\"RUNDIR:SEPARATOR:lang\\\"' DEFINES+=GTA5SYNC_LANG='\\\"RUNDIR:SEPARATOR:lang\\\"' DEFINES+=GTA5SYNC_PLUG='\\\"RUNDIR:SEPARATOR:plugins\\\"' "LIBS+=-ljpeg" ../gta5view.pro && \ -make depend && \ +qmake ${QMAKE_FLAGS_QT5} ${QMAKE_BUILD_TYPE} "DEFINES+=GTA5SYNC_BUILDCODE=\\\\\\\"${PACKAGE_CODE}\\\\\\\"" "DEFINES+=GTA5SYNC_APPVER=\\\\\\\"${APPLICATION_VERSION}\\\\\\\"" "DEFINES+=GTA5SYNC_COMMIT=\\\\\\\"${APPLICATION_COMMIT}\\\\\\\"" DEFINES+=GTA5SYNC_TELEMETRY "DEFINES+=GTA5SYNC_TELEMETRY_WEBURL=\\\\\\\"https://dev.syping.de/gta5view-userstats/\\\\\\\"" DEFINES+=GTA5SYNC_QCONF DEFINES+=GTA5SYNC_INLANG='\\\"RUNDIR:SEPARATOR:lang\\\"' DEFINES+=GTA5SYNC_LANG='\\\"RUNDIR:SEPARATOR:lang\\\"' DEFINES+=GTA5SYNC_PLUG='\\\"RUNDIR:SEPARATOR:plugins\\\"' ../gta5view.pro && \ make -j 4 && \ cd ${PROJECT_DIR}/assets && \ makensis -NOCD ${PROJECT_DIR}/.ci/gta5view.nsi && \ diff --git a/CMakeLists.txt b/CMakeLists.txt index a432622..f028be6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -126,7 +126,7 @@ set(GTA5VIEW_DEFINES ) set(GTA5VIEW_RESOURCES - res/app_cmake.qrc + res/app.qrc res/global.qrc ) set_property(SOURCE res/global.qrc PROPERTY AUTORCC_OPTIONS "-threshold;0;-compress;9") diff --git a/README.md b/README.md index ec8b8ba..5068550 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,6 @@ Grand Theft Auto V Savegame and Snapmatic viewer/editor docker run --rm -v ${PWD}:/gta5view -it sypingauto/gta5view-build:1.8-static cd /gta5view && mkdir -p build && cd build qmake-static ../gta5view.pro - make depend make -j $(nproc --all) #### Build gta5view for Debian/Ubuntu diff --git a/gta5view.pro b/gta5view.pro index 9a9b3fc..db2c77e 100644 --- a/gta5view.pro +++ b/gta5view.pro @@ -16,7 +16,7 @@ #* along with this program. If not, see . #*****************************************************************************/ -QT += core gui network svg +QT += core gui network svg greaterThan(QT_MAJOR_VERSION, 4): QT += widgets greaterThan(QT_MAJOR_VERSION, 4): greaterThan(QT_MINOR_VERSION, 1): win32: QT += winextras @@ -69,7 +69,7 @@ SOURCES += main.cpp \ uimod/UiModLabel.cpp \ uimod/UiModWidget.cpp -HEADERS += \ +HEADERS += \ AboutDialog.h \ AppEnv.h \ CrewDatabase.h \ @@ -112,7 +112,7 @@ HEADERS += \ uimod/UiModLabel.h \ uimod/UiModWidget.h -FORMS += \ +FORMS += \ AboutDialog.ui \ ExportDialog.ui \ ImportDialog.ui \ @@ -139,8 +139,8 @@ TRANSLATIONS += \ res/gta5sync_zh_TW.ts RESOURCES += \ - res/tr_g5p.qrc \ - res/app_qmake.qrc + res/app.qrc \ + res/tr_g5p.qrc DISTFILES += \ res/gta5view-16.png \ @@ -217,9 +217,11 @@ isEqual(QT_MAJOR_VERSION, 5): GTA5SYNC_RCC = $$[QT_HOST_BINS]/rcc # RESOURCE COMPILATION -depend.depends += $$PWD/res/global.qrc -depend.commands += $$GTA5SYNC_RCC -binary -threshold 0 -compress 9 $$PWD/res/global.qrc -o $$PWD/res/global.rcc -QMAKE_EXTRA_TARGETS += depend +system($$GTA5SYNC_RCC -threshold 0 -compress 9 $$PWD/res/global.qrc -o $$OUT_PWD/qrc_global.cpp) { + SOURCES += $$OUT_PWD/qrc_global.cpp +} else { + message("Failed to generate qrc_global.cpp") +} # PROJECT INSTALLATION @@ -253,3 +255,9 @@ contains(DEFINES, GTA5SYNC_QCONF){ HEADERS -= TelemetryClass.h \ tmext/TelemetryClassAuthenticator.h } + +# CMAKE BASED STUFF + +unix: greaterThan(QT_MAJOR_VERSION, 4) { + message("Building non-Windows gta5view with QMake is deprecated, please use CMake instead!") +} diff --git a/main.cpp b/main.cpp index 8da8242..f08ab01 100644 --- a/main.cpp +++ b/main.cpp @@ -74,10 +74,6 @@ int main(int argc, char *argv[]) a.setApplicationVersion(GTA5SYNC_APPVER); a.setQuitOnLastWindowClosed(false); -#ifdef GTA5SYNC_QMAKE - QResource::registerResource(":/global/global.rcc"); -#endif - QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR); settings.beginGroup("Startup"); diff --git a/res/app_cmake.qrc b/res/app.qrc similarity index 100% rename from res/app_cmake.qrc rename to res/app.qrc diff --git a/res/app_qmake.qrc b/res/app_qmake.qrc deleted file mode 100644 index 5b80b70..0000000 --- a/res/app_qmake.qrc +++ /dev/null @@ -1,34 +0,0 @@ - - - add.svgz - avatararea.png - avatarareaimport.png - back.svgz - empty1x16.png - gta5view-16.png - gta5view-24.png - gta5view-32.png - gta5view-40.png - gta5view-48.png - gta5view-64.png - gta5view-96.png - gta5view-128.png - gta5view-256.png - mappreview.jpg - next.svgz - pointmaker-8.png - pointmaker-16.png - pointmaker-24.png - pointmaker-32.png - savegame.svgz - watermark_1b.png - watermark_2b.png - watermark_2r.png - - - global.rcc - - - template.g5e - - diff --git a/res/gta5sync.ts b/res/gta5sync.ts index 6da1dc1..9510eff 100644 --- a/res/gta5sync.ts +++ b/res/gta5sync.ts @@ -1622,17 +1622,17 @@ Press 1 for Default View QApplication - + Font - + Selected Font: %1 - + <h4>Welcome to %1!</h4>You want to configure %1 before you start using it? @@ -2209,22 +2209,22 @@ Press 1 for Default View TelemetryDialog - + You want help %1 to improve in the future by including personal usage data in your submission? - + %1 User Statistics - + Yes, I want include personal usage data. - + &OK diff --git a/res/gta5sync_de.ts b/res/gta5sync_de.ts index 482fb5d..8b00064 100644 --- a/res/gta5sync_de.ts +++ b/res/gta5sync_de.ts @@ -1645,17 +1645,17 @@ Drücke 1 für Standardmodus QApplication - + Font Schrift - + Selected Font: %1 Ausgewähle Schrift: %1 - + <h4>Welcome to %1!</h4>You want to configure %1 before you start using it? <h4>Willkommen zu %1!</h4>Möchtest du %1 einstellen bevor du es nutzt? @@ -2234,22 +2234,22 @@ Drücke 1 für Standardmodus TelemetryDialog - + %1 User Statistics %1 Benutzerstatistik - + You want help %1 to improve in the future by including personal usage data in your submission? Sollen bei Einreichungen Persönliche Nutzungsdaten einbezogen werden um %1 in der Zukunft zu unterstützen? - + Yes, I want include personal usage data. Ja, ich möchte Persönliche Nutzungsdaten einbeziehen. - + &OK &OK diff --git a/res/gta5sync_en_US.ts b/res/gta5sync_en_US.ts index 7a192f3..386924d 100644 --- a/res/gta5sync_en_US.ts +++ b/res/gta5sync_en_US.ts @@ -1622,17 +1622,17 @@ Press 1 for Default View QApplication - + Font - + Selected Font: %1 - + <h4>Welcome to %1!</h4>You want to configure %1 before you start using it? @@ -2209,22 +2209,22 @@ Press 1 for Default View TelemetryDialog - + You want help %1 to improve in the future by including personal usage data in your submission? - + %1 User Statistics - + Yes, I want include personal usage data. - + &OK diff --git a/res/gta5sync_fr.ts b/res/gta5sync_fr.ts index d2121b8..891d5f2 100644 --- a/res/gta5sync_fr.ts +++ b/res/gta5sync_fr.ts @@ -1646,17 +1646,17 @@ Appuyer sur 1 pour le mode par défaut QApplication - + Font Police - + Selected Font: %1 Police sélectionnée : %1 - + <h4>Welcome to %1!</h4>You want to configure %1 before you start using it? <h4>Bienvenue sur %1!</h4>Voulez-vous configurer %1 avant de l'utiliser t? @@ -2237,22 +2237,22 @@ Appuyer sur 1 pour le mode par défaut TelemetryDialog - + You want help %1 to improve in the future by including personal usage data in your submission? Voulez-vous aider au développement de %1 en transmettant vos données d'utilisation ? - + %1 User Statistics Statistiques utilisateurs %1 - + Yes, I want include personal usage data. Oui, je veux partager mes données d'utilisation. - + &OK &OK diff --git a/res/gta5sync_ko.ts b/res/gta5sync_ko.ts index dec894a..7e71a0b 100644 --- a/res/gta5sync_ko.ts +++ b/res/gta5sync_ko.ts @@ -1665,17 +1665,17 @@ Press 1 for Default View QApplication - + Font 폰트 - + Selected Font: %1 선택된 폰트: %1 - + <h4>Welcome to %1!</h4>You want to configure %1 before you start using it? <h4>%1에 오신 것을 환영합니다!</h4>%1을 사용하기 전에 구성하시겠습니까? @@ -2259,22 +2259,22 @@ Press 1 for Default View TelemetryDialog - + You want help %1 to improve in the future by including personal usage data in your submission? 개인 사용 데이터를 제출에 포함시켜 %1이(가) 개선되기를 원합니까? - + %1 User Statistics %1 사용자 통계 - + Yes, I want include personal usage data. 예, 개인 사용 데이터를 포함시키고 싶습니다. - + &OK 확인(&O) diff --git a/res/gta5sync_ru.ts b/res/gta5sync_ru.ts index 4135f62..797cc8b 100644 --- a/res/gta5sync_ru.ts +++ b/res/gta5sync_ru.ts @@ -1660,17 +1660,17 @@ Press 1 for Default View QApplication - + Font Шрифт - + Selected Font: %1 Выбранный шрифт: %1 - + <h4>Welcome to %1!</h4>You want to configure %1 before you start using it? <h4>Добро пожаловать в %1!</h4>Хочешь изменить настройки %1 перед использованием? @@ -2249,22 +2249,22 @@ Press 1 for Default View TelemetryDialog - + You want help %1 to improve in the future by including personal usage data in your submission? Разрешишь нам собирать статистику о пользовании тобой %1? Это поможет нам в разработке. - + %1 User Statistics %1 Пользовательская статистика - + Yes, I want include personal usage data. Да, передавать данные о пользовании программой. - + &OK &ОК diff --git a/res/gta5sync_uk.ts b/res/gta5sync_uk.ts index 9a41f32..2115c75 100644 --- a/res/gta5sync_uk.ts +++ b/res/gta5sync_uk.ts @@ -1650,17 +1650,17 @@ Press 1 for Default View QApplication - + Font Шрифт - + Selected Font: %1 Вибраний шрифт:%1 - + <h4>Welcome to %1!</h4>You want to configure %1 before you start using it? <h4>Ласкаво просимо до %1!</h4>Ви хочете налаштувати %1 перед використанням? @@ -2239,22 +2239,22 @@ Press 1 for Default View TelemetryDialog - + You want help %1 to improve in the future by including personal usage data in your submission? Ви хочете допомогти %1 покращитись у майбутньому, включивши дані особистого користування? - + %1 User Statistics %1 Статистика користувачів - + Yes, I want include personal usage data. Так, я хочу включити дані особистого користування. - + &OK &OK &OK diff --git a/res/gta5sync_zh_TW.ts b/res/gta5sync_zh_TW.ts index efdc141..670f5ff 100644 --- a/res/gta5sync_zh_TW.ts +++ b/res/gta5sync_zh_TW.ts @@ -1640,17 +1640,17 @@ Press 1 for Default View QApplication - + Font 字體 - + Selected Font: %1 選擇的字體: %1 - + <h4>Welcome to %1!</h4>You want to configure %1 before you start using it? <h4>歡迎使用 %1!</h4> 你想在開始前先設定 %1 嗎? @@ -2229,22 +2229,22 @@ Press 1 for Default View TelemetryDialog - + You want help %1 to improve in the future by including personal usage data in your submission? 你希望通過收集資料來幫助改善 %1 嗎? - + %1 User Statistics %1 使用者統計 - + Yes, I want include personal usage data. 是的,我想幫忙. - + &OK 確定(&O)