summaryrefslogtreecommitdiff
path: root/mkspecs
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@pelagicore.com>2017-05-23 10:50:51 +0200
committerDominik Holland <dominik.holland@pelagicore.com>2017-05-29 07:58:54 +0000
commit89f9f12e0876d40fecfbd040c311fcce77692722 (patch)
tree28325a4525abc4e63df127cf9e0c8702aecc70b4 /mkspecs
parent5eef3b72e8d250b5dd65fd532b702b03733a8519 (diff)
downloadqtivi-89f9f12e0876d40fecfbd040c311fcce77692722.tar.gz
ivigenerator: Add more dependencies to the compiler step
Added all template_files, the generator itself and the yaml file as a compiler step dependency Task-number: QTAUTO-449 Change-Id: I532133a57c73406561921e37c12da2d0bc2da9fc Reviewed-by: Mike Krus <mike.krus@kdab.com>
Diffstat (limited to 'mkspecs')
-rw-r--r--mkspecs/features/ivigenerator.prf23
1 files changed, 18 insertions, 5 deletions
diff --git a/mkspecs/features/ivigenerator.prf b/mkspecs/features/ivigenerator.prf
index 9847880..346ade9 100644
--- a/mkspecs/features/ivigenerator.prf
+++ b/mkspecs/features/ivigenerator.prf
@@ -2,7 +2,7 @@
#
# Example input:
# QFACE_SOURCES += my.foo.qface [required]
-# QFACE_MODULE_NAME = my_module_name [required]
+# QFACE_MODULE_NAME = my_module_name
# QFACE_FORMAT = frontend (or backend, simulator... -- defaults to "frontend")
# QFACE_OUTPUT_DIR = my_output_dir (defaults to current build dir)
#
@@ -16,14 +16,12 @@ isEmpty(QFACE_SOURCES): error("QFACE_SOURCES must be set!")
}
QFACE_PWD = $$dirname(QFACE_SOURCES)
+QFACE_ABS_PWD = $$absolute_path($$QFACE_PWD, $$_PRO_FILE_PWD_)
QFACE_FILE = $$basename(QFACE_SOURCES)
QFACE_BASE_NAME = $$replace(QFACE_FILE, .qface, )
+QFACE_YAML = $$QFACE_ABS_PWD/$${QFACE_BASE_NAME}.yaml
isEmpty(QFACE_MODULE_NAME): QFACE_MODULE_NAME = $$QFACE_BASE_NAME
-exists($$_PRO_FILE_PWD_/$${QFACE_BASE_NAME}.yaml) {
- OTHER_FILES += $$_PRO_FILE_PWD_/$${QFACE_BASE_NAME}.yaml
-}
-
# Detect whether we are using the feature inside the qtivi repository
isEmpty(QTIVI_BUILD_ROOT): VIRTUALENV_PATH = $$[QT_HOST_BINS]/ivigenerator/qtivi_qface_virtualenv
else: VIRTUALENV_PATH = $$QTIVI_BUILD_ROOT/src/tools/ivigenerator/qtivi_qface_virtualenv
@@ -39,10 +37,25 @@ IVI_GENERATOR = $$VIRTUALENV_ACTIVATION python3 $$IVI_GENERATOR_PATH/generate.py
qface_sources.output = $$QFACE_OUTPUT_DIR/$${QFACE_MODULE_NAME}.pri
qface_sources.commands = $$IVI_GENERATOR -f $$QFACE_FORMAT ${QMAKE_FILE_NAME} $$QFACE_OUTPUT_DIR
qface_sources.input = QFACE_SOURCES
+qface_sources.depends = $$IVI_GENERATOR_PATH/generate.py
qface_sources.CONFIG += target_predeps no_link
+# Add all templates of the generator format as dependency
+QFACE_TEMPLATE_PWD = $$IVI_GENERATOR_PATH/templates_$${QFACE_FORMAT}
+exists($$QFACE_TEMPLATE_PWD) {
+ qface_sources.depends += $$files($${QFACE_TEMPLATE_PWD}/*)
+}
+
+# Add the configuration yaml as dependency and to other files
+exists($$QFACE_YAML) {
+ qface_sources.depends += $$QFACE_YAML
+ OTHER_FILES += $$QFACE_YAML
+}
+
# Reevaluate the Makefile after the generation has finished
Makefile.target = $$MAKEFILE
+# The relative_path is needed here as qmake will use a relative_path for the output files
+# when using a QMAKE_EXTRA_COMPILER
Makefile.depends = $$relative_path($$qface_sources.output, $$OUT_PWD)
# After the generation, this should exists and qmake can create the correct build tree