diff options
Diffstat (limited to 'tradeshow/iot-sensortag/SensorTagDemo.pro')
-rw-r--r-- | tradeshow/iot-sensortag/SensorTagDemo.pro | 92 |
1 files changed, 49 insertions, 43 deletions
diff --git a/tradeshow/iot-sensortag/SensorTagDemo.pro b/tradeshow/iot-sensortag/SensorTagDemo.pro index bd79351..6be190e 100644 --- a/tradeshow/iot-sensortag/SensorTagDemo.pro +++ b/tradeshow/iot-sensortag/SensorTagDemo.pro @@ -1,33 +1,41 @@ TEMPLATE = app -QT += 3dcore 3drender 3dinput 3dquick 3dlogic core gui qml quick 3dquickextras widgets -QT += bluetooth network charts +QT += \ + bluetooth \ + core \ + charts \ + gui \ + network \ + qml \ + quick \ + widgets + CONFIG += c++11 DEFINES += QT_NO_FOREACH +# Specify UI layout to use: UI_SMALL or UI_WATCH +DEFINES += UI_WATCH + # To overcome the bug QTBUG-58648, uncomment this define # Needed at least for RPi3 and iMX #CONFIG += DEPLOY_TO_FS -# Uncomment DEVICE_TYPE and assign either UI_SMALL, UI_MEDIUM, UI_LARGE -# to force using that UI form factor. Otherwise -# the form factor is determined based on the platform -DEVICE_TYPE = UI_SMALL - -# If DEVICE_TYPE is not set manually, try to determine -# the correct device type by the used operating system -win32|linux:!android:!qnx { +win32|linux|android:!qnx { CONFIG += BLUETOOTH_HOST - isEmpty(DEVICE_TYPE) { DEVICE_TYPE = UI_SMALL } -} else:android { - isEmpty(DEVICE_TYPE) { DEVICE_TYPE = UI_MEDIUM } - ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android-sources - QMAKE_CXX_FLAGS -= -DQT_OPENGL_FORCE_SHADER_DEFINES -} else:ios { - isEmpty(DEVICE_TYPE) { DEVICE_TYPE = UI_MEDIUM } +} else { + message(Unsupported target platform) } -win32 { +# For using MQTT upload enable this config. +# This enables both, host and client mode +# CONFIG += UPDATE_TO_MQTT_BROKER + +# For using Azure cloud connectivity enable +# this config. This enabled both, host and +# client mode +# CONFIG += UPDATE_TO_AZURE + +win32:!contains(CONFIG, UPDATE_TO_MQTT_BROKER) { WASTORAGE_PATH = $$(WASTORAGE_LOCATION) isEmpty(WASTORAGE_PATH): message("Location for Azure Storage libs unknown. Please specify WASTORAGE_LOCATION") CPPRESTSDK_PATH = $$(CPPRESTSDK_LOCATION) @@ -61,11 +69,6 @@ HEADERS += \ mockdataproviderpool.h BLUETOOTH_HOST { - win32 { - !isEmpty(WASTORAGE_PATH):!isEmpty(CPPRESTSDK_LOCATION): CONFIG += UPDATE_TO_AZURE - } else { - CONFIG += UPDATE_TO_AZURE - } DEFINES += RUNS_AS_HOST SOURCES += \ @@ -83,6 +86,21 @@ BLUETOOTH_HOST { bluetoothdevice.h } +UPDATE_TO_MQTT_BROKER { + CONFIG -= UPDATE_TO_AZURE + + !qtHaveModule(mqtt): error("Could not find MQTT module for Qt version") + QT += mqtt + DEFINES += MQTT_UPLOAD + + SOURCES += mqttupdate.cpp \ + mqttdataproviderpool.cpp \ + mqttdataprovider.cpp + HEADERS += mqttupdate.h \ + mqttdataproviderpool.h \ + mqttdataprovider.h +} + UPDATE_TO_AZURE { SOURCES += cloudupdate.cpp HEADERS += cloudupdate.h @@ -100,29 +118,17 @@ UPDATE_TO_AZURE { RESOURCES += base.qrc -equals(DEVICE_TYPE, "UI_SMALL") { - DEFINES += UI_SMALL +android: ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android-sources + +contains(DEFINES, UI_SMALL) { !DEPLOY_TO_FS: RESOURCES += uismall.qrc uiVariant.files = resources/small - uiVariant.path = /opt/$${TARGET}/resources - message("Resource file for SMALL display picked") -} - -equals(DEVICE_TYPE, "UI_MEDIUM") { - DEFINES += UI_MEDIUM - !DEPLOY_TO_FS: RESOURCES += uimedium.qrc - uiVariant.files = resources/medium - uiVariant.path = /opt/$${TARGET}/resources - message("Resource file for MEDIUM display picked") -} +} else:contains(DEFINES, UI_WATCH) { + !DEPLOY_TO_FS: RESOURCES += uiwatch.qrc + uiVariant.files = resources/watch +} else: error("No layout specified") -equals(DEVICE_TYPE, "UI_LARGE") { - DEFINES += UI_LARGE - !DEPLOY_TO_FS: RESOURCES += uilarge.qrc - uiVariant.files = resources/large - uiVariant.path = /opt/$${TARGET}/resources - message("Resource file for LARGE display picked") -} +uiVariant.path = /opt/$${TARGET}/resources # Additional import path used to resolve QML modules in Qt Creator's code model QML_IMPORT_PATH = |