summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@pelagicore.com>2018-04-10 17:22:42 +0200
committerRobert Griebl <robert.griebl@pelagicore.com>2018-05-16 10:39:46 +0000
commit41b5e823a10a2c87890cbd1e30af0cc793747314 (patch)
treef60fc32d0b6712a41372df6fd1887c795a11925f
parent9ffac00e032dbf2887f57b0eb8f3152967d16d16 (diff)
downloadqtapplicationmanager-41b5e823a10a2c87890cbd1e30af0cc793747314.tar.gz
Make the minidesk and monitor examples launchable from qt-creator
For project like these there is now a new qmake feature called am-systemui. This feature will copy all files and folder defined by AM_COPY_DIRECTORIES and AM_COPY_FILES to the build-folder and create a runner script which executes appman with the the arguments defined by AM_DEFAULT_ARGS. This script is setup as the qmake TARGET and can be started by qt-creator. This trick has the limitation that debugging is not supported Change-Id: If93d7971df646163e9819a3c5e8a436fc76bef21 Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
-rw-r--r--examples/minidesk/minidesk.pro11
-rw-r--r--examples/monitor/monitor.pro10
-rw-r--r--qmake-features/am-systemui.prf28
3 files changed, 47 insertions, 2 deletions
diff --git a/examples/minidesk/minidesk.pro b/examples/minidesk/minidesk.pro
index 355e10bc..42561522 100644
--- a/examples/minidesk/minidesk.pro
+++ b/examples/minidesk/minidesk.pro
@@ -1,4 +1,5 @@
-TEMPLATE = aux
+TEMPLATE = app
+CONFIG += am-systemui
OTHER_FILES += \
am-config.yaml \
@@ -12,3 +13,11 @@ OTHER_FILES += \
apps/tld.minidesk.app2/*.yaml \
apps/tld.minidesk.app2/*.qml \
apps/tld.minidesk.app2/*.png \
+
+target.path = $$[QT_INSTALL_EXAMPLES]/minidesk
+INSTALLS += target
+
+AM_COPY_DIRECTORIES += apps system-ui
+AM_COPY_FILES += am-config.yaml
+
+AM_DEFAULT_ARGS=-c am-config.yaml --start-session-dbus --verbose
diff --git a/examples/monitor/monitor.pro b/examples/monitor/monitor.pro
index baa04a61..05106336 100644
--- a/examples/monitor/monitor.pro
+++ b/examples/monitor/monitor.pro
@@ -1,4 +1,5 @@
-TEMPLATE = aux
+TEMPLATE = app
+CONFIG += am-systemui
OTHER_FILES += \
am-config.yaml \
@@ -9,3 +10,10 @@ OTHER_FILES += \
apps/tld.monitor.app/*.yaml \
apps/tld.monitor.app/*.qml
+target.path = $$[QT_INSTALL_EXAMPLES]/monitor
+INSTALLS += target
+
+AM_COPY_DIRECTORIES += apps system-ui
+AM_COPY_FILES += am-config.yaml
+
+AM_DEFAULT_ARGS=-c am-config.yaml --start-session-dbus --verbose
diff --git a/qmake-features/am-systemui.prf b/qmake-features/am-systemui.prf
new file mode 100644
index 00000000..a81a502c
--- /dev/null
+++ b/qmake-features/am-systemui.prf
@@ -0,0 +1,28 @@
+win32: {
+ TEMPLATE = aux
+ warning("Couldn't generate a appman wrapper. Please start the example as mentioned in the documentation instead.")
+} else {
+ WRAPPER_EXT=.sh
+ ORIG_TARGET=$$TARGET
+ TARGET=$${TARGET}_wrapper$${WRAPPER_EXT}
+ CONFIG-=app_bundle
+ APPMAN=$$[QT_INSTALL_BINS]/appman $$AM_DEFAULT_ARGS
+
+ QT_TOOL_NAME = $$ORIG_TARGET
+ qtAddTargetEnv(APPMAN, QT)
+
+ # Copy assets to build folder
+ for (d , AM_COPY_DIRECTORIES) {
+ win32: do_copydata.commands += $(COPY_DIR) $$shell_path($$_PRO_FILE_PWD_/$${d}) $$shell_path($$OUT_PWD/$${d}) $$escape_expand(\n\t)
+ else: do_copydata.commands += $(COPY_DIR) $$shell_path($$_PRO_FILE_PWD_/$${d}) $$shell_path($$OUT_PWD) $$escape_expand(\n\t)
+ }
+ for (f , AM_COPY_FILES) {
+ do_copydata.commands += $(COPY) $$shell_path($$_PRO_FILE_PWD_/$${f}) $$shell_path($$OUT_PWD/$${f}) $$escape_expand(\n\t)
+ }
+
+ !equals(_PRO_FILE_PWD_, $$OUT_PWD) {
+ first.depends = do_copydata
+ QMAKE_EXTRA_TARGETS += do_copydata
+ QMAKE_EXTRA_TARGETS += first
+ }
+}