summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorkh1 <karsten.heimrich@nokia.com>2012-03-22 13:01:52 +0100
committerKarsten Heimrich <karsten.heimrich@nokia.com>2012-03-22 16:20:52 +0100
commitc8850489678471038ea73a748f41d7ad77625aec (patch)
tree575f06dde76e2f6cea2aeb22a2beca36354851e6 /src
parent497f8431ea151853526bf377f02fd42cda970944 (diff)
Build and compile the resource on the fly.
Copy over the qt qm files. Run lupdate on our ts files. Run rcc and generate the qrc_*.cpp file used to compile. Change-Id: Ib726dde084643848d5edab700476b133326c54d7 Reviewed-by: Niels Weber <niels.2.weber@nokia.com> Reviewed-by: Tim Jenssen <tim.jenssen@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/sdk/sdk.pro68
-rw-r--r--src/src.pro2
2 files changed, 57 insertions, 13 deletions
diff --git a/src/sdk/sdk.pro b/src/sdk/sdk.pro
index 44930f7a0..bdf515949 100644
--- a/src/sdk/sdk.pro
+++ b/src/sdk/sdk.pro
@@ -11,21 +11,65 @@ QT += network script
CONFIG -= app_bundle
DESTDIR = $$IFW_APP_PATH
-QM_FILES = qt_de.qm de_de.qm en_us.qm
-defineTest(testQmFiles) {
- for(file, QM_FILES) {
- !exists($$PWD/translations/$$file) {
- message("File $$PWD/translations/$$file not found!")
- return(false)
+if (exists($$LRELEASE)) {
+ QT_LANGUAGES = qt_de
+ IB_LANGUAGES = de_de en_us
+ defineReplace(prependAll) {
+ for(a,$$1):result += $$2$${a}$$3
+ return($$result)
+ }
+
+ defineTest(testFiles) {
+ for(file, $$1) {
+ !exists($$file):return(false)
}
+ return(true)
}
- return(true)
-}
-if (testQmFiles()) {
- RESOURCES += installerbase.qrc
-}
+ SUCCESS = false
+ IB_TRANSLATIONS = $$prependAll(IB_LANGUAGES, $$PWD/translations/,.ts)
+ QT_TRANSLATIONS = $$prependAll(QT_LANGUAGES, $$[QT_INSTALL_TRANSLATIONS]/,.ts)
+ if (!testFiles(QT_TRANSLATIONS)) {
+ QT_COMPILED_TRANSLATIONS = $$prependAll(QT_LANGUAGES, $$[QT_INSTALL_TRANSLATIONS]/,.qm)
+ if (testFiles(QT_COMPILED_TRANSLATIONS)) {
+ SUCCESS = true
+ copyqm.input = QT_COMPILED_TRANSLATIONS
+ copyqm.output = $$PWD/translations/${QMAKE_FILE_BASE}.qm
+ unix:copyqm.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
+ win32:copyqm.commands = $$QMAKE_COPY \"${QMAKE_FILE_IN}\" \"${QMAKE_FILE_OUT}\"
+ copyqm.name = COPY ${QMAKE_FILE_IN}
+ copyqm.CONFIG += no_link target_predeps
+ QMAKE_EXTRA_COMPILERS += copyqm
+ }
+ } else {
+ SUCCESS = true
+ IB_TRANSLATIONS += $$QT_TRANSLATIONS
+ }
+
+ if (!isEmpty(SUCCESS)) {
+ updateqm.input = IB_TRANSLATIONS
+ updateqm.output = $$PWD/translations/${QMAKE_FILE_BASE}.qm
+ updateqm.commands = $$LRELEASE ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_OUT}
+ updateqm.name = LRELEASE ${QMAKE_FILE_IN}
+ updateqm.CONFIG += no_link target_predeps
+ QMAKE_EXTRA_COMPILERS += updateqm
+
+ if (exists($$RCC)) {
+ RESOURCE_IB_TRANSLATIONS = $$prependAll(IB_LANGUAGES, $$PWD/translations/,.qm)
+ RESOURCE_QT_TRANSLATIONS = $$prependAll(QT_LANGUAGES, $$PWD/translations/,.qm)
+ RESOURCE = $$PWD/installerbase.qrc
+ runrcc.input = RESOURCE
+ runrcc.output = $$PWD/qrc_installerbase.cpp
+ runrcc.commands = $$RCC -name ${QMAKE_FILE_BASE} ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
+ runrcc.name = RCC ${QMAKE_FILE_IN}
+ runrcc.CONFIG += no_link explicit_dependencies
+ runrcc.depends = $$RESOURCE_IB_TRANSLATIONS $$RESOURCE_QT_TRANSLATIONS
+ runrcc.variable_out = SOURCES
+ QMAKE_EXTRA_COMPILERS += runrcc
+ }
+ }
+}
FORMS += settingsdialog.ui
HEADERS += installerbase_p.h \
@@ -41,7 +85,7 @@ SOURCES = installerbase.cpp \
win32:RC_FILE = installerbase.rc
win32-msvc2005 {
- CONFIG += embed_manifest_exe #msvc2008 is doing this automaticaly
+ CONFIG += embed_manifest_exe #msvc2008 is doing this automatically
}
embed_manifest_exe:win32-msvc2005 {
diff --git a/src/src.pro b/src/src.pro
index 02e8eaf85..92ee0cf9b 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -1,4 +1,4 @@
CONFIG += ordered
TEMPLATE = subdirs
SUBDIRS += libs sdk
-TRANSLATIONS += sdk/translations/de_de.ts sdk/translations/en_us.ts \ No newline at end of file
+TRANSLATIONS += sdk/translations/de_de.ts sdk/translations/en_us.ts