summaryrefslogtreecommitdiffstats
path: root/basicsuite/shared/shared.pri
diff options
context:
space:
mode:
Diffstat (limited to 'basicsuite/shared/shared.pri')
-rw-r--r--basicsuite/shared/shared.pri120
1 files changed, 86 insertions, 34 deletions
diff --git a/basicsuite/shared/shared.pri b/basicsuite/shared/shared.pri
index 9277275..86bc7de 100644
--- a/basicsuite/shared/shared.pri
+++ b/basicsuite/shared/shared.pri
@@ -1,48 +1,100 @@
-# widget dependecy is required by QtCharts demo
-QT += quick widgets quickcontrols2
+QT += quickcontrols2
-qtHaveModule(webengine) {
- DEFINES += USE_QTWEBENGINE
- QT += webengine
+#Use only for desktop or if target Qt does not support fontconfg
+DEFINES += FONTS_AS_RESOURCES
+
+defineTest(b2qtdemo_deploy_defaults) {
+ # Just backward compatibility do nothing
}
-DESTPATH = /data/user/qt/$$TARGET
-target.path = $$DESTPATH
+# copies the given files to the destination directory
+defineTest(copyToDestDir) {
+ files = $$1
+ dir = $$2
-SOURCES += $$PWD/main.cpp \
- $$PWD/engine.cpp
+ for(file, files) {
+ QMAKE_POST_LINK += $$QMAKE_COPY_DIR $$shell_quote($$file) $$shell_quote($$dir) $$escape_expand(\\n\\t)
+ }
-HEADERS += $$PWD/engine.h
+ export(QMAKE_POST_LINK)
+}
+
+CONFIG(cross_compile) {
+ message("Building for target")
+ DESTPATH = /data/user/qt/$$TARGET
+ target.path = $$DESTPATH
+} else {
+ message("Building for Desktop")
+ DESTPATH = $$OUT_PWD
+ target.path = $$DESTPATH
+ COPIES += commonFiles content images style
+}
+
+# Common fonts if app does not explicitly add it's own
+fonts.files += \
+ $$PWD/fonts/TitilliumWeb-Black.ttf \
+ $$PWD/fonts/TitilliumWeb-Bold.ttf \
+ $$PWD/fonts/TitilliumWeb-ExtraLight.ttf \
+ $$PWD/fonts/TitilliumWeb-Light.ttf \
+ $$PWD/fonts/TitilliumWeb-Regular.ttf \
+ $$PWD/fonts/TitilliumWeb-SemiBold.ttf
+
+contains(DEFINES, FONTS_AS_RESOURCES) {
+ !contains(DEFINES, USE_APP_FONTS) {
+ # Common fonts
+ RESOURCES += $$PWD/shared_fonts.qrc
+ }
+
+ # Application defined fonts
+ APP_FONTS=$${_PRO_FILE_PWD_}/fonts.qrc
+ exists($${APP_FONTS}) {
+ RESOURCES += $${APP_FONTS}
+ }
+} else {
+ fonts.path = $$DESTPATH/fonts
+ INSTALLS += fonts
+
+ CONFIG(cross_compile) {
+ QT_FOR_CONFIG += gui-private
+
+ qtConfig(fontconfig) {
+ #use fontconfig to provide fonts on target
+ fonts.path = /usr/share/fonts/truetype
+ }
+ } else {
+ COPIES += fonts
+ }
+}
+
+contains(DEFINES, STANDALONE) {
+ message("Building as Standalone")
+} else {
+ message("Building for B2Qt Launcher")
+ SOURCES += $$PWD/main.cpp \
+ $$PWD/engine.cpp
+
+ HEADERS += $$PWD/engine.h
-defineTest(b2qtdemo_deploy_defaults) {
commonFiles.files = \
- ../shared/SharedMain.qml \
+ $$PWD/SharedMain.qml \
+ # Resides on each application own source directory
preview_l.jpg \
demo.xml
+
commonFiles.path = $$DESTPATH
OTHER_FILES += $${commonFiles.files}
INSTALLS += commonFiles
- export(commonFiles.files)
- export(commonFiles.path)
- export(OTHER_FILES)
- export(INSTALLS)
}
-DISTFILES += $$PWD/fonts/TitilliumWeb-Black.ttf \
- $$PWD/fonts/TitilliumWeb-Bold.ttf \
- $$PWD/fonts/TitilliumWeb-ExtraLight.ttf \
- $$PWD/fonts/TitilliumWeb-Light.ttf \
- $$PWD/fonts/TitilliumWeb-Regular.ttf \
- $$PWD/fonts/TitilliumWeb-SemiBold.ttf \
- $$PWD/fonts/ebike-fonts/fontawesome-webfont.ttf \
- $$PWD/fonts/ebike-fonts/Montserrat-Bold.ttf \
- $$PWD/fonts/ebike-fonts/Montserrat-Light.ttf \
- $$PWD/fonts/ebike-fonts/Montserrat-Medium.ttf \
- $$PWD/fonts/ebike-fonts/Montserrat-Regular.ttf \
- $$PWD/fonts/ebike-fonts/Teko-Bold.ttf \
- $$PWD/fonts/ebike-fonts/Teko-Light.ttf \
- $$PWD/fonts/ebike-fonts/Teko-Medium.ttf \
- $$PWD/fonts/ebike-fonts/Teko-Regular.ttf
-
-RESOURCES += \
- $$PWD/fonts.qrc
+# Common for all projects that include this file. Only redefine in your project file
+# if different destination folder that default is preferred
+content.path = $$DESTPATH
+OTHER_FILES += $${content.files}
+
+images.path = $$DESTPATH/images
+OTHER_FILES += $${images.files}
+
+style.path = $$DESTPATH/Style
+OTHER_FILES += $${style.files}
+
+INSTALLS += target content images style