translations.pro 2.06 KB
Newer Older
1
2
include(../../../qtcreator.pri)

con's avatar
con committed
3
LANGUAGES = cs de es fr hu it ja pl ru sl
4
5
6
7
8
9
10

# var, prepend, append
defineReplace(prependAll) {
    for(a,$$1):result += $$2$${a}$$3
    return($$result)
}

11
XMLPATTERNS = $$targetPath($$[QT_INSTALL_BINS]/xmlpatterns)
12
LUPDATE = $$targetPath($$[QT_INSTALL_BINS]/lupdate) -locations relative -no-ui-lines -no-sort
13
LRELEASE = $$targetPath($$[QT_INSTALL_BINS]/lrelease)
14

15
TRANSLATIONS = $$prependAll(LANGUAGES, $$PWD/qtcreator_,.ts)
16

17
18
19
20
21
22
23
24
25
26
27
28
29
MIME_TR_H = $$IDE_DATA_PATH/translations/mime_tr.h

contains(QT_VERSION, ^4\.[0-5]\..*) {
    ts.commands = @echo This Qt version is too old for the ts target. Need Qt 4.6+.
} else {
    for(dir, $$list($$files($$IDE_SOURCE_TREE/src/plugins/*))):MIMETYPES_FILES += $$files($$dir/*.mimetypes.xml)
    MIMETYPES_FILES = \"$$join(MIMETYPES_FILES, \", \")\"
    QMAKE_SUBSTITUTES += extract-mimetypes.xq.in
    ts.commands += \
        $$XMLPATTERNS -output $$MIME_TR_H $$PWD/extract-mimetypes.xq && \
        (cd $$IDE_SOURCE_TREE && $$LUPDATE src $$MIME_TR_H -ts $$TRANSLATIONS) && \
        $$QMAKE_DEL_FILE $$MIME_TR_H
}
30
31
32
33
QMAKE_EXTRA_TARGETS += ts

TEMPLATE = app
TARGET = phony_target2
34
CONFIG -= qt
35
36
QT =
LIBS =
37

38
updateqm.input = TRANSLATIONS
39
updateqm.output = $$IDE_DATA_PATH/translations/${QMAKE_FILE_BASE}.qm
40
41
42
43
44
45
46
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) {
47
    QMAKE_LINK = @: IGNORE THIS LINE
48
49
50
    OBJECTS_DIR =
    win32:CONFIG -= embed_manifest_exe
} else {
51
    CONFIG += console
52
53
54
    PHONY_DEPS = .
    phony_src.input = PHONY_DEPS
    phony_src.output = phony.c
55
    phony_src.variable_out = GENERATED_SOURCES
56
    phony_src.commands = echo int main() { return 0; } > phony.c
57
    phony_src.name = CREATE phony.c
58
59
60
61
    phony_src.CONFIG += combine
    QMAKE_EXTRA_COMPILERS += phony_src
}

62
qmfiles.files = $$prependAll(LANGUAGES, $$OUT_PWD/qtcreator_,.qm)
63
qmfiles.path = /share/qtcreator/translations
64
qmfiles.CONFIG += no_check_exist
65
INSTALLS += qmfiles