forked from larpon/QtFirebase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qtfirebase_target.pri
244 lines (190 loc) · 6.37 KB
/
qtfirebase_target.pri
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
message("QtFirebase: configuring build for supported Firebase target platform...")
isEmpty(QTFIREBASE_SDK_PATH){
QTFIREBASE_SDK_PATH = $$PWD/firebase_cpp_sdk
message("No QTFIREBASE_SDK_PATH path sat. Using default (firebase_cpp_sdk) $$QTFIREBASE_SDK_PATH")
} else {
message("Using QTFIREBASE_SDK_PATH ($$QTFIREBASE_SDK_PATH)")
}
QML_IMPORT_PATH += $$PWD
INCLUDEPATH += $$PWD
INCLUDEPATH += \
$$QTFIREBASE_SDK_PATH/include \
\
HEADERS += \
$$PWD/src/platformutils.h \
$$PWD/src/qtfirebase.h \
$$PWD/src/qtfirebaseservice.h \
\
SOURCES += \
$$PWD/src/qtfirebase.cpp \
$$PWD/src/qtfirebaseservice.cpp \
\
contains(QTPLUGIN,qtfirebase) {
HEADERS += $$PWD/src/qtfirebase_plugin.h
SOURCES += $$PWD/src/qtfirebase_plugin.cpp
}
!ios: {
SOURCES += \
$$PWD/src/platformutils.cpp \
\
}
RESOURCES += \
$$PWD/qtfirebase.qrc \
\
android: {
# Setup tips
#
# Add services to xml file
# https://github.com/firebase/quickstart-cpp/blob/e8c20f678a06a28ebb73132abcd79d93b27622d9/messaging/testapp/AndroidManifest.xml
#
# Add the 'onNewIntent' function to your Qt Activity
# https://github.com/firebase/quickstart-cpp/blob/e8c20f678a06a28ebb73132abcd79d93b27622d9/messaging/testapp/src/android/java/com/google/firebase/example/TestappNativeActivity.java
message("QtFirebase Android base")
QT += androidextras gui-private
QTFIREBASE_SDK_LIBS_PATH = $$QTFIREBASE_SDK_PATH/libs/android/$$ANDROID_TARGET_ARCH/gnustl
DEPENDPATH += $$QTFIREBASE_SDK_LIBS_PATH
}
ios: {
# Setup tips
#
# Download the Google Firebase Framework link for Ios
# and extract the files to this folder $$PWD/src/ios/Firebase/
# or use your own folder QTFIREBASE_FRAMEWORKS_ROOT = YOUR/PWD
# https://firebase.google.com/docs/ios/setup#frameworks
message("QtFirebase iOS base")
QT += gui_private
QTFIREBASE_SDK_LIBS_PATH = $$QTFIREBASE_SDK_PATH/libs/ios/universal/
QTFIREBASE_FRAMEWORKS_ROOT = $$PWD/src/ios/Firebase/
QMAKE_LFLAGS += -ObjC
HEADERS += \
$$PWD/src/ios/AppDelegate.h \
\
OBJECTIVE_SOURCES += \
$$PWD/src/ios/platformutils.mm \
$$PWD/src/ios/AppDelegate.mm \
\
LIBS += \
-ObjC \
-lsqlite3 \
-lz \
-L$$QTFIREBASE_SDK_LIBS_PATH \
-framework MediaPlayer \
-framework CoreMotion \
-framework CoreTelephony \
-framework MessageUI \
-framework GLKit \
-framework AddressBook \
-framework UIKit \
\
INCLUDEPATH += \
$$QTFIREBASE_SDK_PATH/include \
$$PWD/src \
$$PWD/src/ios \
\
}
# NOTE the order of linking is important!
PRE_TARGETDEPS += $$QTFIREBASE_SDK_LIBS_PATH/libapp.a
LIBS += -L$$QTFIREBASE_SDK_LIBS_PATH -lapp
# AdMob
contains(DEFINES,QTFIREBASE_BUILD_ADMOB) {
message( "QtFirebase including AdMob" )
ios: {
LIBS += \
-F$$QTFIREBASE_FRAMEWORKS_ROOT/AdMob \
-framework GoogleMobileAds \
-framework AdSupport \
-framework StoreKit \
\
}
HEADERS += $$PWD/src/qtfirebaseadmob.h
SOURCES += $$PWD/src/qtfirebaseadmob.cpp
PRE_TARGETDEPS += $$QTFIREBASE_SDK_LIBS_PATH/libadmob.a
LIBS += -L$$QTFIREBASE_SDK_LIBS_PATH -ladmob
}
# Remote Config
contains(DEFINES,QTFIREBASE_BUILD_REMOTE_CONFIG) {
message( "QtFirebase including RemoteConfig" )
ios: {
LIBS += \
-F$$QTFIREBASE_FRAMEWORKS_ROOT/RemoteConfig \
-framework FirebaseABTesting \ # Required for Firebase iOS >= 4.5.0
-framework FirebaseRemoteConfig \
-framework Protobuf \
\
}
HEADERS += $$PWD/src/qtfirebaseremoteconfig.h
SOURCES += $$PWD/src/qtfirebaseremoteconfig.cpp
PRE_TARGETDEPS += $$QTFIREBASE_SDK_LIBS_PATH/libremote_config.a
LIBS += -L$$QTFIREBASE_SDK_LIBS_PATH -lremote_config
}
# Messaging
contains(DEFINES,QTFIREBASE_BUILD_MESSAGING) {
message( "QtFirebase including Messaging" )
ios: {
message( "QtFirebase Messaging requires iOS v10.x to build. Setting QMAKE_IOS_DEPLOYMENT_TARGET = 10.0" )
QMAKE_IOS_DEPLOYMENT_TARGET = 10.0
LIBS += \
-F$$QTFIREBASE_FRAMEWORKS_ROOT/Messaging \
-framework FirebaseMessaging \
-framework Protobuf \
-framework UserNotifications \
\
}
HEADERS += $$PWD/src/qtfirebasemessaging.h
SOURCES += $$PWD/src/qtfirebasemessaging.cpp
PRE_TARGETDEPS += $$QTFIREBASE_SDK_LIBS_PATH/libmessaging.a
LIBS += -L$$QTFIREBASE_SDK_LIBS_PATH -lmessaging
}
# Analytics
contains(DEFINES,QTFIREBASE_BUILD_ANALYTICS) {
message( "QtFirebase including Analytics" )
ios: {
LIBS += \
-F$$QTFIREBASE_FRAMEWORKS_ROOT/Analytics \
-framework FirebaseAnalytics \
-framework FirebaseCore \
-framework FirebaseCoreDiagnostics \
-framework FirebaseInstanceID \
-framework FirebaseNanoPB \
-framework GoogleToolboxForMac \
-framework nanopb \
\
}
HEADERS += $$PWD/src/qtfirebaseanalytics.h
SOURCES += $$PWD/src/qtfirebaseanalytics.cpp
PRE_TARGETDEPS += $$QTFIREBASE_SDK_LIBS_PATH/libanalytics.a
LIBS += -L$$QTFIREBASE_SDK_LIBS_PATH -lanalytics
}
# Auth
contains(DEFINES,QTFIREBASE_BUILD_AUTH) {
message( "QtFirebase including Auth" )
ios: {
LIBS += \
-F$$QTFIREBASE_FRAMEWORKS_ROOT/Auth \
-framework FirebaseAuth \
-framework GTMSessionFetcher \
-framework SafariServices \ # Required for Firebase iOS >= 4.4.0
\
}
HEADERS += $$PWD/src/qtfirebaseauth.h
SOURCES += $$PWD/src/qtfirebaseauth.cpp
PRE_TARGETDEPS += $$QTFIREBASE_SDK_LIBS_PATH/libauth.a
LIBS += -L$$QTFIREBASE_SDK_LIBS_PATH -lauth
}
# Database
contains(DEFINES,QTFIREBASE_BUILD_DATABASE) {
message( "QtFirebase including Database" )
ios: {
LIBS += \
-licucore \
-F$$QTFIREBASE_FRAMEWORKS_ROOT/Database \
-framework FirebaseDatabase \
-framework leveldb-library \
\
}
HEADERS += $$PWD/src/qtfirebasedatabase.h
SOURCES += $$PWD/src/qtfirebasedatabase.cpp
PRE_TARGETDEPS += $$QTFIREBASE_SDK_LIBS_PATH/libdatabase.a
LIBS += -L$$QTFIREBASE_SDK_LIBS_PATH -ldatabase
}
LIBS += -L$$QTFIREBASE_SDK_LIBS_PATH -lapp