summaryrefslogtreecommitdiff
path: root/examples/webchannel/exampleassets.pri
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@digia.com>2014-08-13 14:14:49 +0200
committerMilian Wolff <milian.wolff@kdab.com>2014-08-13 14:43:24 +0200
commit62760f579b52fbd19d85d31fa90274f9b0dc5111 (patch)
treecb348241c606632ad9dbc575e28910e9302a2cc5 /examples/webchannel/exampleassets.pri
parent150fba9166d0cd63079d8ed15af5f80a759e9549 (diff)
downloadqtwebchannel-62760f579b52fbd19d85d31fa90274f9b0dc5111.tar.gz
Doc: Fix example documentation and paths
To fix issues related to example documentation and to follow Qt convention, do the following changes: - Rename examples/qwebchannel to examples/webchannel - Move example-specific documentation to correct location(s) - Include generic 'Running the Example' instructions - Add the module name to example title, fix links This ensures that example docs are built and the example manifest file generated correctly. Change-Id: I284e0b13db95a6738d72258735018b59156cc7da Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Diffstat (limited to 'examples/webchannel/exampleassets.pri')
-rw-r--r--examples/webchannel/exampleassets.pri31
1 files changed, 31 insertions, 0 deletions
diff --git a/examples/webchannel/exampleassets.pri b/examples/webchannel/exampleassets.pri
new file mode 100644
index 0000000..035ca12
--- /dev/null
+++ b/examples/webchannel/exampleassets.pri
@@ -0,0 +1,31 @@
+# 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
+ copyfiles = $$jslib
+} else {
+ # This is what an actual 3rd party project would do.
+ jslib = qwebchannel.js
+}
+
+# This installs all assets including qwebchannel.js, regardless of the source.
+exampleassets.files += $$jslib
+INSTALLS += exampleassets
+
+# This code ensures that all assets are present in the build directory.
+
+!equals(_PRO_FILE_PWD_, $$OUT_PWD) {
+ # Shadow build, copy all example assets.
+ copyfiles = $$exampleassets.files
+}
+
+defineReplace(stripSrcDir) {
+ return($$basename(1))
+}
+
+assetcopy.input = copyfiles
+assetcopy.output = $$OUT_PWD/${QMAKE_FUNC_FILE_IN_stripSrcDir}
+assetcopy.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
+assetcopy.name = COPY ${QMAKE_FILE_IN}
+assetcopy.CONFIG = no_link target_predeps
+QMAKE_EXTRA_COMPILERS += assetcopy