summaryrefslogtreecommitdiffstats
path: root/src/plugins/sensors/ios/ios.pro
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@qt.io>2016-09-30 18:33:12 -0700
committerJake Petroules <jake.petroules@qt.io>2016-10-05 23:17:53 +0000
commit8065e461421ea17a942ea09d67aaa053a136a54e (patch)
treec9ac30308a2e7686d584b7337ee41485f50b5363 /src/plugins/sensors/ios/ios.pro
parentdf3374bd4bb8af1494f6a35b1102f15cfe9633e0 (diff)
Port the iOS sensors plugin to the other UIKit platformsv5.8.0-beta1
watchOS supports accelerometer, gyroscope, and magnetometer. tvOS supports only the proximity sensor. No sensors are available on macOS yet, but the plugin is still built there because many of the underlying APIs are available cross platform and so some macOS sensors can appear here in the future. Change-Id: I1668d81f09c745e60c1906be621a74f969841566 Reviewed-by: Mike Krus <mike.krus@kdab.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Diffstat (limited to 'src/plugins/sensors/ios/ios.pro')
-rw-r--r--src/plugins/sensors/ios/ios.pro56
1 files changed, 40 insertions, 16 deletions
diff --git a/src/plugins/sensors/ios/ios.pro b/src/plugins/sensors/ios/ios.pro
index 17ff0095..91ec3ae0 100644
--- a/src/plugins/sensors/ios/ios.pro
+++ b/src/plugins/sensors/ios/ios.pro
@@ -3,22 +3,46 @@ QT = core sensors
OTHER_FILES = plugin.json
-HEADERS += iosaccelerometer.h \
- iosmotionmanager.h \
- iosgyroscope.h \
- iosmagnetometer.h \
- ioscompass.h \
- iosproximitysensor.h
-
-OBJECTIVE_SOURCES += main.mm \
- iosaccelerometer.mm \
- iosmotionmanager.mm \
- iosgyroscope.mm \
- iosmagnetometer.mm \
- ioscompass.mm \
- iosproximitysensor.mm
-
-LIBS += -framework UIKit -framework CoreMotion -framework CoreLocation
+OBJECTIVE_SOURCES += main.mm
+LIBS += -framework Foundation
+
+uikit {
+ ios {
+ HEADERS += \
+ ioscompass.h
+ OBJECTIVE_SOURCES += \
+ ioscompass.mm
+
+ DEFINES += HAVE_COMPASS
+ LIBS += -framework CoreLocation
+ }
+
+ !tvos {
+ HEADERS += \
+ iosaccelerometer.h \
+ iosgyroscope.h \
+ iosmagnetometer.h \
+ iosmotionmanager.h
+ OBJECTIVE_SOURCES += \
+ iosaccelerometer.mm \
+ iosgyroscope.mm \
+ iosmagnetometer.mm \
+ iosmotionmanager.mm
+
+ DEFINES += HAVE_COREMOTION
+ LIBS += -framework CoreMotion
+ }
+
+ !watchos {
+ HEADERS += \
+ iosproximitysensor.h
+ OBJECTIVE_SOURCES += \
+ iosproximitysensor.mm
+
+ DEFINES += HAVE_UIDEVICE
+ LIBS += -framework UIKit
+ }
+}
PLUGIN_TYPE = sensors
PLUGIN_CLASS_NAME = IOSSensorPlugin