Commit c38cb83d authored by Oswald Buddenhagen's avatar Oswald Buddenhagen

revamp the build system regarding translations

parent 13f04d84
......@@ -12,11 +12,3 @@ CONFIG += ordered
SUBDIRS = src share
unix:!macx:!equals(_PRO_FILE_PWD_, $$OUT_PWD):SUBDIRS += bin
# for Qt Creator translations
QTC_BUILD_ROOT = $$PWD
QTC_INSTALL_TRANSLATIONS = $$PWD/translations
include(translations/translations.pri)
translations.path = $$QTC_INSTALL_TRANSLATIONS
translations.files = $$QTC_INSTALL_TRANSLATIONS/*.qm
IDE_BUILD_TREE = $$OUT_PWD/../../..
include(../../../qtcreator.pri)
TRANSLATIONS = de
# var, prepend, append
defineReplace(prependAll) {
for(a,$$1):result += $$2$${a}$$3
return($$result)
}
LUPDATE = $$targetPath($$[QT_INSTALL_PREFIX]/bin/lupdate) -locations relative -no-ui-lines
LRELEASE = $$targetPath($$[QT_INSTALL_PREFIX]/bin/lrelease)
TS_FILES = $$prependAll(TRANSLATIONS, $$PWD/qtcreator_,.ts)
ts.commands = (cd $$IDE_SOURCE_TREE && $$LUPDATE src -ts $$TS_FILES)
QMAKE_EXTRA_TARGETS += ts
contains(TEMPLATE, vc.*)|contains(TEMPLATE_PREFIX, vc):vcproj = 1
TEMPLATE = app
TARGET = phony_target2
updateqm.target = $$IDE_DATA_DIR/translations
updateqm.input = TS_FILES
updateqm.output = ${QMAKE_FILE_BASE}.qm
isEmpty(vcproj):updateqm.variable_out = PRE_TARGETDEPS
updateqm.commands = $$LRELEASE ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_OUT}
updateqm.name = LRELEASE ${QMAKE_FILE_IN}
updateqm.CONFIG += no_link
QMAKE_EXTRA_COMPILERS += updateqm
isEmpty(vcproj) {
QMAKE_LINK = : IGNORE REST
OBJECTS_DIR =
win32:CONFIG -= embed_manifest_exe
} else {
PHONY_DEPS = .
phony_src.input = PHONY_DEPS
phony_src.output = phony.c
phony_src.commands = echo int main() { return 0; } > phony.c
phony_src.CONFIG += combine
QMAKE_EXTRA_COMPILERS += phony_src
}
qmfiles.files = $$prependAll(TRANSLATIONS, $$OUT_PWD/qtcreator_,.qm)
qmfiles.path = /share/qtcreator/translations
INSTALLS += qmfiles
TEMPLATE = subdirs
SUBDIRS = qtcreator/static.pro
SUBDIRS = qtcreator/static.pro qtcreator/translations
defineReplace(prependAll) {
prepend = $$1
arglist = $$2
append = $$3
for(a,arglist) {
result += $${prepend}$${a}$${append}
}
return ($$result)
}
defineReplace(fixPath) {
WIN {
return ($$replace($$1, /, \))
} ELSE {
return ($$1)
}
}
LUPDATE = $$fixPath($$[QT_INSTALL_PREFIX]/bin/lupdate) -locations relative -no-ui-lines
LRELEASE = $$fixPath($$[QT_INSTALL_PREFIX]/bin/lrelease)
###### Qt Creator
QTC_TS = de fr zh_CN untranslated ar es iw ja_JP pl pt ru sk sv uk zh_TW
ts.commands = (cd $$QTC_BUILD_ROOT && \
$$LUPDATE share src \
-ts $$prependAll($$QTC_INSTALL_TRANSLATIONS/qtcreator_,$$QTC_TS,.ts))
qm.commands = $$LRELEASE $$prependAll($$QTC_INSTALL_TRANSLATIONS/qtcreator_,$$QTC_TS,.ts)
QMAKE_EXTRA_TARGETS += ts qm
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment