diff options
author | Jake Petroules <jake.petroules@qt.io> | 2017-09-20 18:54:40 -0700 |
---|---|---|
committer | Jake Petroules <jake.petroules@qt.io> | 2017-11-01 17:01:27 +0000 |
commit | 6cb626668a0f5062afbd89a971dcc9488a6188d1 (patch) | |
tree | 4490a4102fca47560e7808707857071a9b626737 /static-res.pro | |
parent | 2e97dd0b29d17c0f81d6f2ad2dd947ba3f0ef2b9 (diff) | |
download | qbs-6cb626668a0f5062afbd89a971dcc9488a6188d1.tar.gz |
Automatically generate the QML type descriptions as part of the build
This guarantees that clients (such as Qt Creator) will always have up
to date information.
Change-Id: I1fe7d8ae8cd6960681f41e78635576cde3f17083
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'static-res.pro')
-rw-r--r-- | static-res.pro | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/static-res.pro b/static-res.pro new file mode 100644 index 000000000..6ceae11cb --- /dev/null +++ b/static-res.pro @@ -0,0 +1,59 @@ +TEMPLATE = aux + +!isEmpty(QBS_APPS_DESTDIR): qbsbindir = $${QBS_APPS_DESTDIR} +else: qbsbindir = ../../../bin +qbsbindir = $$clean_path(src/app/qbs/$$qbsbindir) + +builddirname = qbsres +typedescdir = share/qbs/qml-type-descriptions +typedescdir_src = $$builddirname/default/install-root/$$typedescdir +!isEmpty(QBS_RESOURCES_BUILD_DIR): \ + typedescdir_dst = $$QBS_RESOURCES_BUILD_DIR/$$typedescdir +else: \ + typedescdir_dst = $$typedescdir + +qbsres.target = $$builddirname/default/default.bg +qbsres.commands = \ + $$shell_quote($$shell_path($$qbsbindir/qbs)) \ + setup-qt \ + --settings-dir $$shell_quote($$builddirname/settings) \ + $(QMAKE) qt $$escape_expand(\\n\\t) \ + $$shell_quote($$shell_path($$qbsbindir/qbs)) \ + build \ + --settings-dir $$shell_quote($$builddirname/settings) \ + -f $$shell_quote($$PWD/qbs.qbs) \ + -d $$shell_quote($$builddirname) \ + -p $$shell_quote("qbs resources") \ + profile:qt + +qbsqmltypes.target = $$typedescdir_dst/qbs.qmltypes +qbsqmltypes.commands = \ + $$sprintf($$QMAKE_MKDIR_CMD, \ + $$shell_quote($$shell_path($$typedescdir_dst))) $$escape_expand(\\n\\t) \ + $$QMAKE_COPY \ + $$shell_quote($$shell_path($$typedescdir_src/qbs.qmltypes)) \ + $$shell_quote($$shell_path($$typedescdir_dst/qbs.qmltypes)) +qbsqmltypes.depends += qbsres + +qbsbundle.target = $$typedescdir_dst/qbs-bundle.json +qbsbundle.commands = \ + $$sprintf($$QMAKE_MKDIR_CMD, \ + $$shell_quote($$shell_path($$typedescdir_dst))) $$escape_expand(\\n\\t) \ + $$QMAKE_COPY \ + $$shell_quote($$shell_path($$typedescdir_src/qbs-bundle.json)) \ + $$shell_quote($$shell_path($$typedescdir_dst/qbs-bundle.json)) +qbsbundle.depends += qbsres + +QMAKE_EXTRA_TARGETS += qbsres qbsqmltypes qbsbundle + +PRE_TARGETDEPS += $$qbsqmltypes.target $$qbsbundle.target + +include(src/install_prefix.pri) + +qbstypedescfiles.files = $$qbsqmltypes.target $$qbsbundle.target +!isEmpty(QBS_RESOURCES_INSTALL_DIR): \ + installPrefix = $${QBS_RESOURCES_INSTALL_DIR} +else: \ + installPrefix = $${QBS_INSTALL_PREFIX} +qbstypedescfiles.path = $${installPrefix}/$$typedescdir +INSTALLS += qbstypedescfiles |