-
Notifications
You must be signed in to change notification settings - Fork 18
/
QBook.pro
executable file
·196 lines (161 loc) · 5.71 KB
/
QBook.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
# Set root directory
Q_ROOT = $${_PRO_FILE_PWD_}/..
ROOTFS = $$(ROOTFS)
EXTRA_LIBS = $$(EXTRA_LIBS)
HACKERS_EDITION = $$(HACKERS_EDITION)
DISABLE_ADOBE_SDK = $$(DISABLE_ADOBE_SDK)
Q_PROJECTS = \
QBookCore \
QDocView \
bqSetting \
QBookApp \
bq \
bqHAL \
bqViewer \
bqUi \
bqLibrary \
bqHome \
bqSearch \
bqBrowser \
metadata-extractor \
bqPublicServices
isEmpty(HACKERS_EDITION) {
Q_PROJECTS += bqWebStore bqWizard
}
# Set platform
message($(PLATFORM) platform)
CONFIG += $$(PLATFORM)
linux-arm-g++ { # Cross compilation for arm
message(ARM compilation)
INCLUDEPATH += $${ROOTFS}/usr/include/
CONFIG(mx508) {
LIBS += -ljpeg -lexpat -lfreetype -lz -lssl -lcrypto -lrt -lntx
} else {
LIBS += $${ROOTFS}/usr/lib/libssl.a $${ROOTFS}/usr/lib/libcrypto.a -L$${ROOTFS}/usr/lib/
}
} else { # emulation
message(Development compilation)
INCLUDEPATH += /usr/include $${ROOTFS}/usr/include/
QT_DEV_PATH = $$(QT_DEV_PATH)
LIBS += -L/usr/lib -lssl -lcrypto $${EXTRA_LIBS} -lX11
# This is needed for fonts in the emulator
DEFINES += "ROOTFS=\\\"$${ROOTFS}\\\""
}
message (--- QBookApp Project ---)
DEFINES += $$(DEFINES)
# TEST OPTIONS
BATTERY_TEST = $$(BATTERY_TEST)
SAMPLE_PERIOD = $$(SAMPLE_PERIOD)
START_POINT = $$(START_POINT)
!isEmpty(BATTERY_TEST) {
isEmpty(SAMPLE_PERIOD){
SAMPLE_PERIOD = 21600 # 6 hours
}
isEmpty(START_POINT){
START_POINT = 80 # Test start at 80% by default, until then device awake
}
message(Test build type $$BATTERY_TEST with sample period $$SAMPLE_PERIOD and start point $$START_POINT)
QMAKE_CXXFLAGS += -DBATTERY_TEST=$$BATTERY_TEST -DSAMPLE_PERIOD=$$SAMPLE_PERIOD -DSTART_POINT=$$START_POINT
}
#SHOWCASE BUILD, just to keep the device in a showcase with light on
SHOWCASE = $$(SHOWCASE)
!isEmpty(SHOWCASE){
message(Special build for showcase device)
QMAKE_CXXFLAGS += -DSHOWCASE
}
# Set application properties
TEMPLATE = app
TARGET = QBookApp
QT += network webkit gui sql xml dbus
#QTPLUGIN += qjpeg qgif qico qmng qtiff
linux-arm-g++ {
DEFINES += QT_STATICPLUGIN
DEFINES -= QT_NO_OPENSSL
} else {
DEFINES += EMULATOR
}
QT_DIR = $$(QTDIR)
# Include common properties
include(QBook.conf)
# Set unix properties
CONFIG += debug
CONFIG -= release
QMAKE_CXXFLAGS += -Wno-unused-parameter -Wno-psabi
!linux-arm-g++ {
# Remove optimization for emulator builds
QMAKE_CXXFLAGS_RELEASE -=-O2
}
CONFIG += $$(CPP_OPTIM)
CONFIG(CPP_OPT_O0){
# Remove optimization for debugging
message(C++ optimization disabled)
QMAKE_CXXFLAGS_RELEASE -=-O2
}
# Add debug info to Release build (then we will strip it)
QMAKE_CXXFLAGS_RELEASE +=-g
QMAKE_CFLAGS_RELEASE +=-g
# FIXME: currently we are striping ONLY debug symbols. We could save 2M striping ALL symbols. We need to check if that can hurts us somehow
linux-arm-g++ { # Cross compilation for arm
# We need to do this instead of proper CONFIG+=separate_debug_info becuase qmake
# expands QMAKE_INSTALL_SEPARATE_DEBUG_INFO macro to usr basename from the rootfs, and that is an arm binary
APPFILE=`/usr/bin/basename $(TARGET)`
QMAKE_POST_LINK=cd bin; /usr/bin/arm-linux-gnueabi-objcopy --only-keep-debug $${APPFILE} $${APPFILE}.debug && /usr/bin/arm-linux-gnueabi-objcopy --strip-debug $${APPFILE} && /usr/bin/arm-linux-gnueabi-objcopy --add-gnu-debuglink=$${APPFILE}.debug $${APPFILE} && chmod -x $${APPFILE}.debug
} else {
APPFILE=`/usr/bin/basename $(TARGET)`
QMAKE_POST_LINK=cd x86-bin; objcopy --only-keep-debug $${APPFILE} $${APPFILE}.debug && objcopy --strip-debug $${APPFILE} && objcopy --add-gnu-debuglink=$${APPFILE}.debug $${APPFILE} && chmod -x $${APPFILE}.debug
}
QMAKE_LFLAGS_APP += -Wl,-Map=$${DESTDIR}/$${TARGET}.map
# Remove .map at cleaning
QMAKE_DISTCLEAN += $${DESTDIR}/$${TARGET}.map
# Remove generated files at cleaning
QMAKE_DISTCLEAN += $${DESTDIR}/langs/*
QMAKE_DISTCLEAN += $${DESTDIR}/*
QMAKE_DISTCLEAN += $${OBJECTS_DIR}/*
QMAKE_DISTCLEAN += $${UI_DIR}/*
QMAKE_DISTCLEAN += $${MOC_DIR}/*
# Add project subdirs
INCLUDEPATH += ./bq
DEPENDPATH += $${Q_PROJECTS} ./bq
VPATH += $${Q_PROJECTS}
# Include projects
for(prj, Q_PROJECTS) {
INCLUDEPATH += $${prj}/inc
DEPENDPATH += $${prj}/inc
INCLUDEPATH += $${prj}/model
exists($${prj}/$${prj}.prj): include($${prj}/$${prj}.prj)
else: include($${prj}/$${prj}.pri)
exists($${prj}/tr/*.ts): TR_FILES += $${prj}/tr/*.ts
}
# Fix some uglyness of qt paths
linux-arm-g++ { # Cross compilation for arm
LIBS += -L$${ROOTFS}/usr/plugins/imageformats -lqjpeg -lqgif -lqico -lqmng -lqtiff
isEmpty(HACKERS_EDITION){
LIBS += -LConnectionManager/lib/lib -lConnectionManager -L$(PRIVATE)/bqClientServices/lib -lServices -LbqUtils/lib -lbqUtils -Lmodel/lib -lbqModelLibrary
} else {
LIBS += -LConnectionManager/lib/lib -lConnectionManager -LbqUtils/lib -lbqUtils -Lmodel/lib -lbqModelLibrary
}
} else {
isEmpty(HACKERS_EDITION) {
LIBS += -LConnectionManager/lib/x86-lib -lConnectionManager -L$(PRIVATE)/bqClientServices/x86-lib -lServices -LbqUtils/x86-lib -lbqUtils -Lmodel/x86-lib -lbqModelLibrary
} else {
LIBS += -LConnectionManager/lib/x86-lib -lConnectionManager -LbqUtils/x86-lib -lbqUtils -Lmodel/x86-lib -lbqModelLibrary
}
}
FAKE_WIFI = $$(FAKE_WIFI)
!isEmpty(FAKE_WIFI) {
DEFINES += "FAKE_WIFI=\\\"1\\\""
}
!isEmpty(HACKERS_EDITION) {
DEFINES += "HACKERS_EDITION=\\\"1\\\""
}
!isEmpty(DISABLE_ADOBE_SDK) {
DEFINES += "DISABLE_ADOBE_SDK=\\\"1\\\""
}
QRC_FILES += res/common800.qrc res/common1024.qrc res/common1448.qrc
OTHER_FILES += \
res/common_styles_generic.qss \
res/800/common_styles.qss \
res/1024/common_styles.qss \
res/1448/common_styles.qss \
QBookApp.files \
build.sh