summaryrefslogtreecommitdiff
path: root/examples/webchannel/exampleassets.pri
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@qt.io>2017-08-30 12:28:29 +0200
committerKai Koehne <kai.koehne@qt.io>2017-09-06 06:47:26 +0000
commite7f150abaa8e81d3e404e9631a49341a7f7623d1 (patch)
tree24d6360a91ee44260aa4b1f955c86c0907e308da /examples/webchannel/exampleassets.pri
parent433ac6bab18e0fa8f107b15930cb8ceafa8b21f5 (diff)
downloadqtwebchannel-e7f150abaa8e81d3e404e9631a49341a7f7623d1.tar.gz
Allow examples to be built without module sources
qwebchannel.js is used by examples, which so far tried to copy it directly from the library source directory. However, in the case of an installed prefix build of Qt, the library sources are not available. This patches therefore moves the qwebchannel.js file to the examples directory, which is installed including sources. The obvious alternative would be copying the file inside the source tree, but that causes code duplication and a maintenance burden that we want to avoid. Another alternative would have been to install qwebchannel.js into QT_INSTALL_DATA, or extract the file at build time from the Qt library. However, this requires bigger changes, and is also dubious because the use case are in particular applications _not_ using Qt. Task-number: QTBUG-57654 Change-Id: I96bc93b6e3d248e4b4facdd582d9fa53ae562924 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Diffstat (limited to 'examples/webchannel/exampleassets.pri')
-rw-r--r--examples/webchannel/exampleassets.pri14
1 files changed, 5 insertions, 9 deletions
diff --git a/examples/webchannel/exampleassets.pri b/examples/webchannel/exampleassets.pri
index bbdf656..094d4d8 100644
--- a/examples/webchannel/exampleassets.pri
+++ b/examples/webchannel/exampleassets.pri
@@ -1,12 +1,5 @@
# This adds the qwebchannel js library to an example, creating a self-contained bundle
-QTDIR_build {
- # Build from within Qt. Copy and install the reference lib.
- jslib = $$dirname(_QMAKE_CONF_)/src/webchannel/qwebchannel.js
- assetcopy.files = $$jslib
-} else {
- # This is what an actual 3rd party project would do.
- jslib = qwebchannel.js
-}
+jslib = $$PWD/shared/qwebchannel.js
# This installs all assets including qwebchannel.js, regardless of the source.
exampleassets.files += $$jslib
@@ -16,7 +9,10 @@ INSTALLS += exampleassets
!equals(_PRO_FILE_PWD_, $$OUT_PWD) {
# Shadow build, copy all example assets.
- assetcopy.files = $$exampleassets.files
+ assetcopy.files += $$exampleassets.files
+} else {
+ # Just copy jslib - other assets are already in place.
+ assetcopy.files = $$jslib
}
assetcopy.path = $$OUT_PWD