summaryrefslogtreecommitdiff
path: root/mkspecs
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@qt.io>2019-10-07 16:38:48 +0200
committerDominik Holland <dominik.holland@qt.io>2019-10-29 17:26:28 +0100
commit25ba2939cace6bfbc065f3c8ea8cfe6d72eb5c17 (patch)
treed2475a26e8ed1332ee9abd83f70b17d05f52234a /mkspecs
parent25b1d344d1f5b5fe791f9c9893adfc59a8db60e5 (diff)
downloadqtivi-25ba2939cace6bfbc065f3c8ea8cfe6d72eb5c17.tar.gz
ivigenerator: Add support to import other modules
When importing another module from within a QFace file, the generator now searches within the QFace import path. If this module is found, the information is then used to generate code that includes types from this module. The QFace import path can be set in the autogenerator similar to qmlscene by using the -I option; in qmake it can be set using QFACE_IMPORT_PATH. The generator makes sure to generate correct code, but the developer still needs to setup the .pro files correctly to add the imported module to the INCLUDEPATH and also link to the generated library. Fixes: AUTOSUITE-1158 Change-Id: I0e9fa714d4c893a4bf17c5f7db34c62d84932c94 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
Diffstat (limited to 'mkspecs')
-rw-r--r--mkspecs/features/ivigenerator.prf10
1 files changed, 8 insertions, 2 deletions
diff --git a/mkspecs/features/ivigenerator.prf b/mkspecs/features/ivigenerator.prf
index 90f04c5..3330fdc 100644
--- a/mkspecs/features/ivigenerator.prf
+++ b/mkspecs/features/ivigenerator.prf
@@ -79,17 +79,23 @@ IVI_GENERATOR_OPTIONS = --format=$$QFACE_FORMAT --force
for (ANNOTATION, QFACE_ANNOTATIONS) {
file = $$absolute_path($$ANNOTATION, $$_PRO_FILE_PWD_)
- IVI_GENERATOR_OPTIONS += -A $$system_path($$file)
+ IVI_GENERATOR_OPTIONS += -A $$system_quote($$system_path($$file))
qface_sources.depends += $$file
OTHER_FILES += $$file
}
+for (IMPORT, QFACE_IMPORT_PATH) {
+ dir = $$absolute_path($$IMPORT, $$_PRO_FILE_PWD_)
+
+ IVI_GENERATOR_OPTIONS += -I $$system_quote($$system_path($$dir))
+}
+
# Windows doesn't offer any other way to sleep for a time inside non-interactive scripts
equals(QMAKE_HOST.os, Windows): SLEEP = ping -n 2 127.0.0.1 >nul
else: SLEEP = sleep 1
qface_sources.target = $$relative_path($$PRI, $$OUT_PWD)
-qface_sources.commands = $$SLEEP && $$ENV $$system_path($$IVI_GENERATOR) $$IVI_GENERATOR_OPTIONS $$system_path($$QFACE_ABS_PWD/$${QFACE_FILE}) $$system_path($$QFACE_OUTPUT_DIR)
+qface_sources.commands = $$SLEEP && $$ENV $$system_path($$IVI_GENERATOR) $$IVI_GENERATOR_OPTIONS $$system_quote($$system_path($$QFACE_ABS_PWD/$${QFACE_FILE})) $$system_quote($$system_path($$QFACE_OUTPUT_DIR))
qface_sources.depends = $$IVI_GENERATOR_PATH/generate.py
qface_sources.depends += $$QFACE_ABS_PWD/$${QFACE_FILE}
qface_sources.depends += $$files($$IVI_GENERATOR_PATH/common/*)