summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/default_pre.prf
diff options
context:
space:
mode:
authorMarius Storm-Olsen <marius.storm-olsen@nokia.com>2010-11-24 19:56:41 -0600
committeraxis <qt-info@nokia.com>2011-04-27 12:05:46 +0200
commit94e8d3b6864ce9cd7a024d30b4f938a3ace940a2 (patch)
tree592ee54e1948e1d5eb720a22a8a0b81e08c6bf73 /mkspecs/features/default_pre.prf
parent81f7b862d626cf926e1cec5b866013122d1ddc59 (diff)
Have qmake run syncqt automatically, if sync.profile is detected
This will normally only happen for top-level pro files, and syncqt is smart enough to not touch already existing files. And in edition, syncqt uses the original file's timestamp on the fwding files.
Diffstat (limited to 'mkspecs/features/default_pre.prf')
-rw-r--r--mkspecs/features/default_pre.prf28
1 files changed, 28 insertions, 0 deletions
diff --git a/mkspecs/features/default_pre.prf b/mkspecs/features/default_pre.prf
index 2e82f03eb9..b8779c8162 100644
--- a/mkspecs/features/default_pre.prf
+++ b/mkspecs/features/default_pre.prf
@@ -1,3 +1,31 @@
load(exclusive_builds)
### Qt 5: remove "uic" and "resources" - or add "qt"
CONFIG = lex yacc warn_on debug uic resources $$CONFIG
+
+exists($$_PRO_FILE_PWD_/sync.profile) {
+ PRO_BASENAME = $$basename(_PRO_FILE_)
+
+ # Try to detect proper QTDIR path. We require QTDIR, as syncqt uses that to create qt_module.pri
+ # forwarding files. If we don't find QTDIR, we avoid creating the fwd files, since you then need
+ # to do a 'make install;' before you can use the module
+ # (ie. we don't use QT_INSTALL_DATA for fwd includes. This path needs a full copy)
+ isEmpty(QTDIR) {
+ QTDIR = $$(QTDIR)
+ isEmpty(QTDIR):QTDIR = $$QT_BUILD_TREE
+ isEmpty(QTDIR):QTDIR = $$dirname(_QMAKE_CACHE_)
+ isEmpty(QTDIR) {
+ QMAKE_BASED_QTDIR = $$dirname(QMAKE_QMAKE)
+ QMAKE_BASED_QTDIR = $$dirname(QMAKE_BASED_QTDIR)
+ exists($$QMAKE_BASED_QTDIR/mkspecs/qconfig.pri): QTDIR = $$QMAKE_BASED_QTDIR
+ unset(QMAKE_BASED_QTDIR)
+ }
+ }
+
+ isEmpty(QTDIR):QTFWD="-no-module-fwd"
+ else:QTFWD="-qtdir $$QTDIR"
+
+ message("Running syncqt for $$PRO_BASENAME in $$OUT_PWD")
+ system("$$QTDIR/bin/syncqt $$QTFWD -outdir $$OUT_PWD $$_PRO_FILE_PWD_")
+ unset(QTFWD)
+ unset(PRO_BASENAME)
+}