summaryrefslogtreecommitdiff
path: root/examples/applicationmanager/custom-appman
diff options
context:
space:
mode:
Diffstat (limited to 'examples/applicationmanager/custom-appman')
-rw-r--r--examples/applicationmanager/custom-appman/CMakeLists.txt4
-rw-r--r--examples/applicationmanager/custom-appman/custom-appman.pro3
-rw-r--r--examples/applicationmanager/custom-appman/doc/src/custom-appman.qdoc8
3 files changed, 15 insertions, 0 deletions
diff --git a/examples/applicationmanager/custom-appman/CMakeLists.txt b/examples/applicationmanager/custom-appman/CMakeLists.txt
index c3627257..972295d4 100644
--- a/examples/applicationmanager/custom-appman/CMakeLists.txt
+++ b/examples/applicationmanager/custom-appman/CMakeLists.txt
@@ -20,6 +20,10 @@ find_package(Qt6 COMPONENTS AppManMainPrivate)
qt_add_executable(custom-appman
custom-appman.cpp
)
+
+# This define flags us as an "appman" and allows us to link against the AppMan's private libraries
+target_compile_definitions(custom-appman PRIVATE AM_COMPILING_APPMAN)
+
set_target_properties(custom-appman PROPERTIES
WIN32_EXECUTABLE FALSE
MACOSX_BUNDLE FALSE
diff --git a/examples/applicationmanager/custom-appman/custom-appman.pro b/examples/applicationmanager/custom-appman/custom-appman.pro
index e1ebab9e..f6f4e294 100644
--- a/examples/applicationmanager/custom-appman/custom-appman.pro
+++ b/examples/applicationmanager/custom-appman/custom-appman.pro
@@ -6,6 +6,9 @@ CONFIG -= app_bundle qml_debug
DEFINES += QT_MESSAGELOGCONTEXT
+# This define flags us as an "appman" and allows us to link against the AppMan's private libraries
+DEFINES *= AM_COMPILING_APPMAN
+
QT = appman_main-private
SOURCES = custom-appman.cpp
diff --git a/examples/applicationmanager/custom-appman/doc/src/custom-appman.qdoc b/examples/applicationmanager/custom-appman/doc/src/custom-appman.qdoc
index 0b74c1c9..dc16c90e 100644
--- a/examples/applicationmanager/custom-appman/doc/src/custom-appman.qdoc
+++ b/examples/applicationmanager/custom-appman/doc/src/custom-appman.qdoc
@@ -25,6 +25,14 @@ If you still require this behavior, this example provides a starting point that
custom implementation upon. Keep in mind, that this custom application manager executable needs a
System UI to display something on the screen, just like the standard \c appman executable.
+Linking against those application manager modules is prohibited by default to prevent
+potential problems with duplicate symbols coming from QML plugins. However here building against
+them is both intended and required, so we need to set the define \c AM_COMPILING_APPMAN:
+
+\quotefromfile applicationmanager/custom-appman/CMakeLists.txt
+\skipuntil /allows us to link against/
+\printuntil /AM_COMPILING_APPMAN/
+
The following is a breakdown of the minimal code necessary:
\quotefromfile applicationmanager/custom-appman/custom-appman.cpp