translations.pro 1.39 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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