-
Notifications
You must be signed in to change notification settings - Fork 7
/
app.pro
285 lines (231 loc) · 7.77 KB
/
app.pro
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
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
PREFIX = harbour
NAME = foilauth
openrepos {
DEFINES += OPENREPOS
CONFIG += app_settings
}
TARGET = $${PREFIX}-$${NAME}
CONFIG += sailfishapp link_pkgconfig
PKGCONFIG += sailfishapp keepalive mlite5 glib-2.0 gobject-2.0
QT += qml sql quick dbus multimedia concurrent
QMAKE_CXXFLAGS += -Wno-unused-parameter
QMAKE_CFLAGS += -Wno-unused-parameter
app_settings {
# This path is hardcoded in jolla-settings
TRANSLATIONS_PATH = /usr/share/translations
} else {
TRANSLATIONS_PATH = /usr/share/$${TARGET}/translations
}
CONFIG(debug, debug|release) {
DEFINES += DEBUG HARBOUR_DEBUG
}
equals(QT_ARCH, arm64){
message(Linking with OpenSSL)
PKGCONFIG += libcrypto
}
# Fix libfoil compilation warnings:
DEFINES += GLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32
DEFINES += GLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_MAX_ALLOWED
# Directories
FOIL_UI_REL = foil-ui
FOIL_UI_DIR = $${_PRO_FILE_PWD_}/$${FOIL_UI_REL}
FOIL_UI_QML = $${FOIL_UI_DIR}
HARBOUR_LIB_REL = harbour-lib
HARBOUR_LIB_DIR = $${_PRO_FILE_PWD_}/$${HARBOUR_LIB_REL}
HARBOUR_LIB_INCLUDE = $${HARBOUR_LIB_DIR}/include
HARBOUR_LIB_SRC = $${HARBOUR_LIB_DIR}/src
HARBOUR_LIB_QML = $${HARBOUR_LIB_DIR}/qml
LIBGLIBUTIL_DIR = $${_PRO_FILE_PWD_}/libglibutil
LIBGLIBUTIL_INCLUDE = $${LIBGLIBUTIL_DIR}/include
FOIL_DIR = $${_PRO_FILE_PWD_}/foil
LIBFOIL_DIR = $${FOIL_DIR}/libfoil
LIBFOIL_INCLUDE = $${LIBFOIL_DIR}/include
LIBFOIL_SRC = $${LIBFOIL_DIR}/src
LIBFOILMSG_DIR = $${FOIL_DIR}/libfoilmsg
LIBFOILMSG_INCLUDE = $${LIBFOILMSG_DIR}/include
LIBFOILMSG_SRC = $${LIBFOILMSG_DIR}/src
LIBQRENCODE_DIR = $${_PRO_FILE_PWD_}/libqrencode
ZBAR_DIR = $${_PRO_FILE_PWD_}/zbar/zbar
# Libraries
LIBS += libqrencode.a -ldl
OTHER_FILES += \
*.desktop \
qml/*.js \
qml/*.qml \
qml/images/*.svg \
qml/images/*.png \
icons/*.svg \
translations/*.ts
INCLUDEPATH += \
src \
$${LIBFOIL_SRC} \
$${LIBFOIL_INCLUDE} \
$${LIBFOILMSG_INCLUDE} \
$${LIBGLIBUTIL_INCLUDE} \
$${LIBQRENCODE_DIR}
HEADERS += \
src/FoilAuth.h \
src/FoilAuthDefs.h \
src/FoilAuthFavoritesModel.h \
src/FoilAuthGroupModel.h \
src/FoilAuthImportModel.h \
src/FoilAuthModel.h \
src/FoilAuthSettings.h \
src/FoilAuthToken.h \
src/FoilAuthTypes.h \
src/QrCodeDecoder.h \
src/QrCodeScanner.h \
src/SailOTP.h
SOURCES += \
src/FoilAuth.cpp \
src/FoilAuthFavoritesModel.cpp \
src/FoilAuthGroupModel.cpp \
src/FoilAuthImportModel.cpp \
src/FoilAuthModel.cpp \
src/FoilAuthSettings.cpp \
src/FoilAuthToken.cpp \
src/main.cpp \
src/QrCodeDecoder.cpp \
src/QrCodeScanner.cpp \
src/SailOTP.cpp
SOURCES += \
$${LIBFOIL_SRC}/*.c \
$${LIBFOIL_SRC}/openssl/*.c \
$${LIBFOILMSG_SRC}/*.c \
$${LIBGLIBUTIL_DIR}/src/*.c
HEADERS += \
$${LIBFOIL_INCLUDE}/*.h \
$${LIBFOILMSG_INCLUDE}/*.h \
$${LIBGLIBUTIL_INCLUDE}/*.h
# foil-ui
FOIL_UI_COMPONENTS = \
$${FOIL_UI_QML}/FoilUiAppsWarning.qml \
$${FOIL_UI_QML}/FoilUiChangePasswordPage.qml \
$${FOIL_UI_QML}/FoilUiConfirmPasswordDialog.qml \
$${FOIL_UI_QML}/FoilUiEnterPasswordView.qml \
$${FOIL_UI_QML}/FoilUiGenerateKeyPage.qml \
$${FOIL_UI_QML}/FoilUiGenerateKeyView.qml \
$${FOIL_UI_QML}/FoilUiGenerateKeyWarning.qml \
$${FOIL_UI_QML}/FoilUiGeneratingKeyView.qml
FOIL_UI_IMAGES = $${FOIL_UI_QML}/images/*.svg
OTHER_FILES += $${FOIL_UI_COMPONENTS}
foil_ui_components.files = $${FOIL_UI_COMPONENTS}
foil_ui_components.path = /usr/share/$${TARGET}/qml/foil-ui
INSTALLS += foil_ui_components
OTHER_FILES += $${FOIL_UI_IMAGES}
foil_ui_images.files = $${FOIL_UI_IMAGES}
foil_ui_images.path = /usr/share/$${TARGET}/qml/foil-ui/images
INSTALLS += foil_ui_images
# harbour-lib
INCLUDEPATH += \
$${HARBOUR_LIB_INCLUDE}
HEADERS += \
$${HARBOUR_LIB_INCLUDE}/HarbourBase32.h \
$${HARBOUR_LIB_INCLUDE}/HarbourDebug.h \
$${HARBOUR_LIB_INCLUDE}/HarbourOrganizeListModel.h \
$${HARBOUR_LIB_INCLUDE}/HarbourProcessState.h \
$${HARBOUR_LIB_INCLUDE}/HarbourProtoBuf.h \
$${HARBOUR_LIB_INCLUDE}/HarbourQrCodeGenerator.h \
$${HARBOUR_LIB_INCLUDE}/HarbourQrCodeImageProvider.h \
$${HARBOUR_LIB_INCLUDE}/HarbourSelectionListModel.h \
$${HARBOUR_LIB_INCLUDE}/HarbourSingleImageProvider.h \
$${HARBOUR_LIB_INCLUDE}/HarbourSystemState.h \
$${HARBOUR_LIB_INCLUDE}/HarbourTask.h \
$${HARBOUR_LIB_INCLUDE}/HarbourWakeupTimer.h \
$${HARBOUR_LIB_SRC}/HarbourMce.h
SOURCES += \
$${HARBOUR_LIB_SRC}/HarbourBase32.cpp \
$${HARBOUR_LIB_SRC}/HarbourMce.cpp \
$${HARBOUR_LIB_SRC}/HarbourOrganizeListModel.cpp \
$${HARBOUR_LIB_SRC}/HarbourProcessState.cpp \
$${HARBOUR_LIB_SRC}/HarbourProtoBuf.cpp \
$${HARBOUR_LIB_SRC}/HarbourQrCodeGenerator.cpp \
$${HARBOUR_LIB_SRC}/HarbourQrCodeImageProvider.cpp \
$${HARBOUR_LIB_SRC}/HarbourSelectionListModel.cpp \
$${HARBOUR_LIB_SRC}/HarbourSingleImageProvider.cpp \
$${HARBOUR_LIB_SRC}/HarbourSystemState.cpp \
$${HARBOUR_LIB_SRC}/HarbourTask.cpp \
$${HARBOUR_LIB_SRC}/HarbourWakeupTimer.cpp
HARBOUR_QML_COMPONENTS = \
$${HARBOUR_LIB_QML}/HarbourBadge.qml \
$${HARBOUR_LIB_QML}/HarbourFitLabel.qml \
$${HARBOUR_LIB_QML}/HarbourHighlightIcon.qml \
$${HARBOUR_LIB_QML}/HarbourIconTextButton.qml \
$${HARBOUR_LIB_QML}/HarbourInvertEffect.qml \
$${HARBOUR_LIB_QML}/HarbourHintIconButton.qml \
$${HARBOUR_LIB_QML}/HarbourPasswordInputField.qml \
$${HARBOUR_LIB_QML}/HarbourPressEffect.qml \
$${HARBOUR_LIB_QML}/HarbourShakeAnimation.qml \
$${HARBOUR_LIB_QML}/HarbourTextFlip.qml
OTHER_FILES += $${HARBOUR_QML_COMPONENTS}
qml_components.files = $${HARBOUR_QML_COMPONENTS}
qml_components.path = /usr/share/$${TARGET}/qml/harbour
INSTALLS += qml_components
# openssl
!equals(QT_ARCH, arm64){
SOURCES += \
$${HARBOUR_LIB_SRC}/libcrypto.c
}
# zbar
INCLUDEPATH += \
$${ZBAR_DIR}/include \
$${ZBAR_DIR}/zbar
LIBS += zbar/libzbar.a
# Icons
ICON_SIZES = 86 108 128 172 256
for(s, ICON_SIZES) {
icon_target = icon$${s}
icon_dir = icons/$${s}x$${s}
$${icon_target}.files = $${icon_dir}/$${TARGET}.png
$${icon_target}.path = /usr/share/icons/hicolor/$${s}x$${s}/apps
INSTALLS += $${icon_target}
}
# Settings
app_settings {
settings_json.files = settings/$${TARGET}.json
settings_json.path = /usr/share/jolla-settings/entries/
settings_qml.files = settings/*.qml
settings_qml.path = /usr/share/$${TARGET}/qml/settings/
INSTALLS += settings_qml settings_json
}
OTHER_FILES += \
settings/*.qml \
settings/*.json
# Translations
TRANSLATION_IDBASED=-idbased
TRANSLATION_SOURCES = \
$${_PRO_FILE_PWD_}/qml \
$${_PRO_FILE_PWD_}/settings
defineTest(addTrFile) {
rel = translations/$${1}
OTHER_FILES += $${rel}.ts
export(OTHER_FILES)
in = $${_PRO_FILE_PWD_}/$$rel
out = $${OUT_PWD}/$$rel
s = $$replace(1,-,_)
lupdate_target = lupdate_$$s
qm_target = qm_$$s
$${lupdate_target}.commands = lupdate -noobsolete -locations none $${TRANSLATION_SOURCES} -ts \"$${in}.ts\" && \
mkdir -p \"$${OUT_PWD}/translations\" && [ \"$${in}.ts\" != \"$${out}.ts\" ] && \
cp -af \"$${in}.ts\" \"$${out}.ts\" || :
$${qm_target}.path = $$TRANSLATIONS_PATH
$${qm_target}.depends = $${lupdate_target}
$${qm_target}.commands = lrelease $$TRANSLATION_IDBASED \"$${out}.ts\" && \
$(INSTALL_FILE) \"$${out}.qm\" $(INSTALL_ROOT)$${TRANSLATIONS_PATH}/
QMAKE_EXTRA_TARGETS += $${lupdate_target} $${qm_target}
INSTALLS += $${qm_target}
export($${lupdate_target}.commands)
export($${qm_target}.path)
export($${qm_target}.depends)
export($${qm_target}.commands)
export(QMAKE_EXTRA_TARGETS)
export(INSTALLS)
}
LANGUAGES = de fr hu pl ru sv zh_CN
addTrFile($${TARGET})
for(l, LANGUAGES) {
addTrFile($${TARGET}-$$l)
}
qm.path = $$TRANSLATIONS_PATH
qm.CONFIG += no_check_exist
INSTALLS += qm