From a952d3daa4af294edd21570f52b9cd5b7f2ca055 Mon Sep 17 00:00:00 2001 From: Slava Monich Date: Fri, 6 Aug 2021 04:06:17 +0300 Subject: [PATCH] [build] Tweaked .qm file generation --- app/app.pro | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/app/app.pro b/app/app.pro index 76e841e..da105c5 100644 --- a/app/app.pro +++ b/app/app.pro @@ -252,6 +252,7 @@ equals(PREFIX, "openrepos") { } # Translations +TRANSLATION_IDBASED=-idbased TRANSLATION_SOURCES = \ $${_PRO_FILE_PWD_}/qml \ $${_PRO_FILE_PWD_}/settings @@ -259,33 +260,33 @@ TRANSLATION_SOURCES = \ defineTest(addTrFile) { rel = translations/harbour-$${1} OTHER_FILES += $${rel}.ts + export(OTHER_FILES) - in = $${_PRO_FILE_PWD_}/$$rel - out = $${OUT_PWD}/translations/$${PREFIX}-$$1 + in = $${_PRO_FILE_PWD_}/$${rel} + out = $${OUT_PWD}/translations/$${PREFIX}-$${1} s = $$replace(1,-,_) lupdate_target = lupdate_$$s - lrelease_target = lrelease_$$s + qm_target = qm_$$s - $${lupdate_target}.commands = lupdate -noobsolete $${TRANSLATION_SOURCES} -ts \"$${in}.ts\" && \ + $${lupdate_target}.commands = lupdate -noobsolete -locations none $${TRANSLATION_SOURCES} -ts \"$${in}.ts\" && \ mkdir -p \"$${OUT_PWD}/translations\" && [ \"$${in}.ts\" != \"$${out}.ts\" ] && \ cp -af \"$${in}.ts\" \"$${out}.ts\" || : - $${lrelease_target}.target = $${out}.qm - $${lrelease_target}.depends = $${lupdate_target} - $${lrelease_target}.commands = lrelease -idbased \"$${out}.ts\" + $${qm_target}.path = $$TRANSLATIONS_PATH + $${qm_target}.depends = $${lupdate_target} + $${qm_target}.commands = lrelease $$TRANSLATION_IDBASED \"$${out}.ts\" && \ + $(INSTALL_FILE) \"$${out}.qm\" $(INSTALL_ROOT)$${TRANSLATIONS_PATH}/ + + QMAKE_EXTRA_TARGETS += $${lupdate_target} $${qm_target} + INSTALLS += $${qm_target} - QMAKE_EXTRA_TARGETS += $${lrelease_target} $${lupdate_target} - PRE_TARGETDEPS += $${out}.qm - qm.files += $${out}.qm export($${lupdate_target}.commands) - export($${lrelease_target}.target) - export($${lrelease_target}.depends) - export($${lrelease_target}.commands) + export($${qm_target}.path) + export($${qm_target}.depends) + export($${qm_target}.commands) export(QMAKE_EXTRA_TARGETS) - export(PRE_TARGETDEPS) - export(OTHER_FILES) - export(qm.files) + export(INSTALLS) } LANGUAGES = de fi hu nl pl pt ru sv es zh_CN @@ -294,7 +295,3 @@ addTrFile($${NAME}) for(l, LANGUAGES) { addTrFile($${NAME}-$$l) } - -qm.path = $$TRANSLATIONS_PATH -qm.CONFIG += no_check_exist -INSTALLS += qm