mobile-datovka.pro 6.11 KB
Newer Older
1
QT += qml quick quickcontrols2 network xml sql widgets svg
2

3 4 5 6
android {
	QT += androidextras
}

7 8
TEMPLATE = app
APP_NAME = Datovka
9 10
# winphone|winrt target.
winphone|winrt {
Karel Slaný's avatar
Karel Slaný committed
11
    VERSION = 1.3.0.0
12
} else {
Karel Slaný's avatar
Karel Slaný committed
13
    VERSION = 1.3.0
14
}
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
DESCRIPTION = "Mobile client for ISDS"

DEFINES += \
    DEBUG=1 \
    VERSION=\\\"$${VERSION}\\\" \
    APP_NAME=\\\"$${APP_NAME}\\\"

winphone|winrt|win32 {
    RC_FILE = res/datovka.rc
    DEFINES += \
        __func__=__FUNCTION__
} else {
    QMAKE_CXXFLAGS += \
        -g -O0 -std=c++11 \
        -Wall -Wextra -pedantic
30 31
    SOURCES += \
        src/crypto/crypto.c \
32 33 34
        src/crypto/password.c \
        src/crypto/pin.c \
        src/crypto/wrapped.cpp
35 36
    HEADERS += \
        src/crypto/crypto.h \
37 38 39
        src/crypto/password.h \
        src/crypto/pin.h \
        src/crypto/wrapped.h
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
    LIBS += \
        -lcrypto
}

# Additional import path used to resolve
# QML modules in code model of Qt Creator
QML_IMPORT_PATH =

# Supported languages
LANGUAGES = en cs

TRANSLATIONS += res/locale/datovka_en.ts \
    res/locale/datovka_cs.ts

lupdate_only {
SOURCES += qml/*.qml \
56
    qml/components/*.qml \
Martin Straka's avatar
Martin Straka committed
57
    qml/dialogues/*.qml \
58 59 60 61 62 63 64 65 66
    qml/pages/*.qml
}

# run LRELEASE to generate the qm files
qtPrepareTool(LRELEASE, lrelease)
command = $$LRELEASE mobile-datovka.pro
system($$command)|error("Failed to run: $$command")

# Copy translation files at qmake invocation.
67 68 69 70 71 72 73 74
win32|winphone|winrt|android {
    message(Copying Qt translation from $$shell_path($$[QT_INSTALL_DATA]).)
    system($$QMAKE_COPY $$shell_path($$[QT_INSTALL_DATA])\translations\qtbase_cs.qm res\locale\qtbase_cs.qm)
    system($$QMAKE_COPY $$shell_path($$[QT_INSTALL_DATA])\translations\qtbase_en.qm res\locale\qtbase_en.qm)
} else:macx|osx|ios|unix {
    message(Copying Qt translation from $$[QT_INSTALL_DATA].)
    system($$QMAKE_COPY $$[QT_INSTALL_DATA]/translations/qtbase_cs.qm res/locale/qtbase_cs.qm)
    system($$QMAKE_COPY $$[QT_INSTALL_DATA]/translations/qtbase_en.qm res/locale/qtbase_en.qm)
75
} else {
76
    message(For this target you must copy Qt translation (qtbase_cs.qm) from $$[QT_INSTALL_DATA]/translations/.)
77 78 79 80 81 82 83 84 85 86
}

TRANSLATIONS_FILES += \
    res/locale/qtbase_cs.qm \
    res/locale/qtbase_en.qm \
    res/locale/datovka_cs.qm \
    res/locale/datovka_en.qm

SOURCES += \
    src/accounts.cpp \
87
    src/dialogues/dialogues.cpp \
88 89
    src/dialogues/qml_dialogue_helper.cpp \
    src/dialogues/qml_input_dialogue.cpp \
90
    src/dialogues/qml_message_dialogue.cpp \
91
    src/dialogues/widget_input_dialogue.cpp \
92
    src/dialogues/widget_message_dialogue.cpp \
93 94 95 96
    src/files.cpp \
    src/io/filesystem.cpp \
    src/io/sqlite/db.cpp \
    src/io/sqlite/table.cpp \
Karel Slaný's avatar
Karel Slaný committed
97
    src/locker.cpp \
98 99 100 101
    src/log/log.cpp \
    src/main.cpp \
    src/messages.cpp \
    src/models/accountmodel.cpp \
102
    src/models/databoxmodel.cpp \
103
    src/models/filemodel.cpp \
104
    src/models/list_sort_filter_proxy_model.cpp \
105
    src/models/messagemodel.cpp \
Martin Straka's avatar
Martin Straka committed
106 107 108 109 110
    src/net/db_wrapper.cpp \
    src/net/isds_session.cpp \
    src/net/isds_wrapper.cpp \
    src/net/net_layer.cpp \
    src/net/xml_layer.cpp \
111
    src/qml_interaction/interaction_filesystem.cpp \
112
    src/qml_interaction/interaction_zfo_file.cpp \
113
    src/qml_interaction/message_info.cpp \
114
    src/settings.cpp \
Martin Straka's avatar
Martin Straka committed
115
    src/setwrapper.cpp \
116 117 118 119 120 121 122
    src/sqlite/account_db.cpp \
    src/sqlite/dbs.cpp \
    src/sqlite/db_tables.cpp \
    src/sqlite/file_db_container.cpp \
    src/sqlite/file_db.cpp \
    src/sqlite/message_db_container.cpp \
    src/sqlite/message_db.cpp \
123
    src/worker/emitter.cpp \
124 125
    src/worker/pool.cpp \
    src/worker/task.cpp \
126
    src/worker/task_change_password.cpp \
127 128
    src/worker/task_download_account_info.cpp \
    src/worker/task_download_delivery_info.cpp \
129 130
    src/worker/task_download_message.cpp \
    src/worker/task_download_message_list.cpp \
131
    src/worker/task_find_databox.cpp \
132 133
    src/worker/task_keep_alive.cpp \
    src/worker/task_send_sms.cpp
134 135 136 137

HEADERS += \
    src/accounts.h \
    src/common.h \
138
    src/dialogues/dialogues.h \
139 140
    src/dialogues/qml_dialogue_helper.h \
    src/dialogues/qml_input_dialogue.h \
141
    src/dialogues/qml_message_dialogue.h \
142
    src/dialogues/widget_input_dialogue.h \
143
    src/dialogues/widget_message_dialogue.h \
144 145 146 147
    src/files.h \
    src/io/filesystem.h \
    src/io/sqlite/db.h \
    src/io/sqlite/table.h \
Karel Slaný's avatar
Karel Slaný committed
148
    src/locker.h \
149 150 151
    src/log/log.h \
    src/messages.h \
    src/models/accountmodel.h \
152
    src/models/databoxmodel.h \
153
    src/models/filemodel.h \
154
    src/models/list_sort_filter_proxy_model.h \
155
    src/models/messagemodel.h \
Martin Straka's avatar
Martin Straka committed
156 157 158 159 160 161
    src/net/db_wrapper.h \
    src/net/isds_const.h \
    src/net/isds_session.h \
    src/net/isds_wrapper.h \
    src/net/net_layer.h \
    src/net/xml_layer.h \
162
    src/qml_interaction/interaction_filesystem.h \
163
    src/qml_interaction/interaction_zfo_file.h \
164
    src/qml_interaction/message_info.h \
165
    src/settings.h \
Martin Straka's avatar
Martin Straka committed
166
    src/setwrapper.h \
167 168 169 170 171 172 173
    src/sqlite/account_db.h \
    src/sqlite/dbs.h \
    src/sqlite/db_tables.h \
    src/sqlite/file_db_container.h \
    src/sqlite/file_db.h \
    src/sqlite/message_db_container.h \
    src/sqlite/message_db.h \
174
    src/worker/emitter.h \
175 176
    src/worker/pool.h \
    src/worker/task.h \
177
    src/worker/task_change_password.h \
178 179
    src/worker/task_download_account_info.h \
    src/worker/task_download_delivery_info.h \
180 181
    src/worker/task_download_message.h \
    src/worker/task_download_message_list.h \
182
    src/worker/task_find_databox.h \
183 184
    src/worker/task_keep_alive.h \
    src/worker/task_send_sms.h
185

186 187 188 189 190 191 192 193
android {
	SOURCES += \
	    src/os_android.cpp

	HEADERS += \
	    src/os_android.h
}

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
RESOURCES += \
    res/qml.qrc \
    res/translations.qrc

# osx target.
osx: ICON = res/datovka.icns

# linux target.
linux: ICON = res/datovka.png

# ios target.
ios: system(sed -e "s/@VERSION@/$${VERSION}/g" "ios/Info.tmp" > "ios/Info.plist")
ios: include(ios/ios.pri)

# android target.
android: system(sed.exe -e "s/@VERSION@/$${VERSION}/g" "android/AndroidManifest.tmp" > "android/AndroidManifest.xml")
android: ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
android: include(android/android.pri)

# winphone|winrt target.
winphone|winrt: include(winrt/winrt.pri)

# Default rules for deployment.
include(deployment.pri)

OTHER_FILES +=