c0bc1c73a18f3e417f2d2cb3ceafaefb51b02731
[quandoparte] / application / application.pro
1 #-------------------------------------------------
2 #
3 # Project created by QtCreator 2010-11-13T19:51:39
4 #
5 #-------------------------------------------------
6
7 isEmpty(VERSION) {
8     VERSION = 0.7.0rc
9 }
10 USE_RESOURCES = 0
11
12 QT += network
13 CONFIG += qt
14 CONFIG += link_pkgconfig
15
16 lessThan(QT_MAJOR_VERSION, 5) {
17     QT += webkit
18     CONFIG += webkit mobility
19     MOBILITY = location
20 } else {
21     QT += qml quick concurrent location webkitwidgets webkit
22 }
23
24 contains(MEEGO_EDITION, harmattan) {
25    CONFIG += harmattan
26 }
27
28 sailfish {
29     PLATFORM = sailfish
30     DEFINES += TARGET_PLATFORM_SAILFISH
31     # enable booster
32 packagesExist(qdeclarative-boostable) {
33     message("Building with qdeclarative-boostable support")
34     DEFINES += HAS_BOOSTER
35     PKGCONFIG += qdeclarative-boostable
36 } else {
37     warning("qdeclarative-boostable not available; startup times will be slower")
38 }
39     QMAKE_LFLAGS += -pie -rdynamic
40     PLATFORM_SOURCES = view.cpp
41     PLATFORM_HEADERS = view.h view_qt5.h
42 }
43 harmattan {
44     QT += declarative
45     PLATFORM = harmattan
46     DEFINES += TARGET_PLATFORM_HARMATTAN
47     # enable booster
48     CONFIG += qdeclarative-boostable
49     QMAKE_CXXFLAGS += -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wno-psabi
50     QMAKE_LFLAGS += -pie -rdynamic
51     PLATFORM_SOURCES = view.cpp
52     PLATFORM_HEADERS = view.h view_qt4.h
53 }
54 maemo5 {
55     QT += maemo5
56     PLATFORM = fremantle
57     DEFINES += TARGET_PLATFORM_FREMANTLE
58     PLATFORM_SOURCES = \
59         app.cpp \
60         stationlistview.cpp \
61         stationview.cpp \
62         settingsdialog.cpp \
63         keypressforwarder.cpp
64     PLATFORM_HEADERS= \
65         app.h \
66         stationlistview.h \
67         keypressforwarder.h \
68         settingsdialog.h \
69         stationview.h
70     FORMS += \
71         settingsdialog.ui \
72         stationlistview.ui
73 }
74 !sailfish:!harmattan:!maemo5 {
75     PLATFORM = desktop
76     DEFINES += TARGET_PLATFORM_DESKTOP
77     PLATFORM_SOURCES = view.cpp
78 }
79
80 message(Compiling For:    $$PLATFORM)
81 message(Platform Sources: $$PLATFORM_SOURCES)
82 message(Qt Version:       $$QT_MAJOR_VERSION"."$$QT_MINOR_VERSION)
83 message(Qt Modules Used:  $$QT)
84 message(Building version: $$VERSION)
85
86 TARGET = quandoparte
87 TEMPLATE = app
88 VERSION_STRING = '\\"$${VERSION}\\"'
89 DEFINES += QP_VERSION=\"$${VERSION_STRING}\"
90
91 contains(USE_RESOURCES, 1) {
92     DEFINES += USE_RESOURCES=1
93     CONFIG += resources
94 }
95
96 !debug {
97     DEFINES += QT_NO_DEBUG_OUTPUT
98 }
99
100 TRANSLATIONS = resources/i18n/quandoparte_it.ts
101
102 SOURCES += \
103     $$PLATFORM_SOURCES \
104     main.cpp \
105     stationitem.cpp \
106     stationlistmodel.cpp \
107     stationlistproxymodel.cpp \
108     settings.cpp \
109     dataprovider.cpp \
110     stationschedulemodel.cpp \
111     stationscheduleitem.cpp
112
113 HEADERS += \
114     $$PLATFORM_HEADERS \
115     stationitem.h \
116     stationlistmodel.h \
117     stationlistproxymodel.h \
118     settings.h \
119     dataprovider.h \
120     stationschedulemodel.h \
121     stationscheduleitem.h
122
123 QMLSOURCES = \
124     resources/harmattan/qml/main.qml \
125     resources/harmattan/qml/StationListPage.qml \
126     resources/harmattan/qml/StationPage.qml \
127     resources/harmattan/qml/SearchBar.qml \
128     resources/harmattan/qml/PageHeader.qml \
129     resources/harmattan/qml/PageHeader.js \
130     resources/harmattan/qml/uiconstants.js \
131     resources/harmattan/qml/StationListPage.js \
132     resources/harmattan/qml/AboutPage.qml \
133     resources/harmattan/qml/InfoBar.qml \
134     resources/harmattan/qml/DroppedShadow.qml \
135     resources/harmattan/qml/DelayIndicator.qml \
136     resources/harmattan/qml/StationScheduleDelegate.qml \
137     resources/sailfish/qml/main.qml \
138     resources/sailfish/qml/pages/AboutPage.qml \
139     resources/sailfish/qml/pages/StationListPage.qml \
140     resources/sailfish/qml/pages/StationPage.qml \
141     resources/sailfish/qml/pages/components/DelayIndicator.qml \
142     resources/sailfish/qml/pages/components/StationScheduleDelegate.qml
143
144 OTHER_FILES += \
145     resources/sailfish/applications/quandoparte.desktop \
146     resources/harmattan/applications/quandoparte.desktop \
147     resources/fremantle/applications/quandoparte.desktop \
148     icons/48x48/quandoparte.png \
149     icons/64x64/quandoparte.png \
150     icons/80x80/quandoparte.png \
151     icons/scalable/quandoparte.svg \
152     icons/sailfish/90x90/quandoparte.png \
153     icons/sailfish/scalable/quandoparte.svg \
154     icons/quandoparte.png \
155     resources/quandoparte.css \
156     resources/arrivals.css \
157     resources/departures.css \
158     $$replace(TRANSLATIONS, .ts, .qm) \
159     resources/stations/stations.qpl \
160     resources/stations/generatelist.xq \
161     resources/stations/generateunclassifiedlist.xq \
162     $$QMLSOURCES \
163     resources/sailfish/qml/StationListPage.qml
164
165 isEmpty(PREFIX) {
166     maemo5 {
167         PREFIX=/opt/usr
168     }
169     harmattan {
170         PREFIX=/opt/$${TARGET}
171     }
172     sailfish {
173         PREFIX=/usr
174     }
175     !maemo5:!harmattan:!sailfish {
176         PREFIX=/usr/local
177     }
178 }
179 maemo5 {
180     DESKTOPDIR=/usr/share/applications/hildon
181 }
182 harmattan {
183     DESKTOPDIR=/usr/share/applications
184 }
185 sailfish {
186     DESKTOPDIR=$$PREFIX/share/applications
187 }
188 desktop {
189     DESKTOPDIR=$$PREFIX/share/applications
190 }
191 BINDIR=$$PREFIX/bin
192 contains(USE_RESOURCES, 1) {
193     DATADIR=":"
194 } else {
195     DATADIR=$$PREFIX/share/apps/$${TARGET}
196 }
197 DEFINES += DATADIR=\\\"$${DATADIR}\\\" PKGDATADIR=\\\"$${PKGDATADIR}\\\"
198
199 message(Installing to prefix $$PREFIX)
200 message(Executable to $$BINDIR)
201 message(Desktop file to $$DESKTOPDIR)
202 message(Data to $$DATADIR)
203 message(Extra defines $$DEFINES)
204
205 target.path = $$BINDIR
206 INSTALLS += target
207
208 unix {
209     desktopfile.files = resources/$$PLATFORM/applications/$${TARGET}.desktop
210     desktopfile.path = $$DESKTOPDIR
211     INSTALLS += desktopfile
212
213     i18n.files = $$replace(TRANSLATIONS, .ts, .qm)
214     stations.files = resources/stations/stations.qpl
215
216     i18n.path = $$DATADIR/i18n
217     stations.path = $$DATADIR/stations
218
219     INSTALLS += i18n
220     INSTALLS += stations
221 }
222
223 sailfish {
224     desktopfile.files = resources/$$PLATFORM/applications/$${TARGET}.desktop
225     desktopfile.path = $$DESKTOPDIR
226     INSTALLS += desktopfile
227
228     i18n.files = $$replace(TRANSLATIONS, .ts, .qm)
229     stations.files = resources/stations/stations.qpl
230
231     i18n.path = $$DATADIR/i18n
232     stations.path = $$DATADIR/stations
233
234     INSTALLS += i18n
235     INSTALLS += stations
236 }
237
238 desktop {
239     icon48.files = icons/48x48/$${TARGET}.png
240     icon64.files = icons/64x64/$${TARGET}.png
241     iconscalable.files = icons/scalable/$${TARGET}.svg
242
243     icon48.path = /usr/share/icons/hicolor/48x48/apps
244     icon64.path = /usr/share/icons/hicolor/64x64/apps
245     iconscalable.path = /usr/share/icons/hicolor/scalable/apps
246
247     INSTALLS += icon48
248     INSTALLS += iconscalable
249 }
250
251 maemo5 {
252     css.files = resources/$${TARGET}.css resources/arrivals.css resources/departures.css
253     css.path = $$DATADIR/css
254     !contains(USE_RESOURCES, 1) {
255         INSTALLS += css
256     }
257 }
258
259 sailfish {
260     QML_IMPORT_PATH = resources/sailfish/qml/
261     icon86.files = icons/sailfish/86x86/$${TARGET}.png
262     icon86.path = /usr/share/icons/hicolor/86x86/apps
263     INSTALLS += icon86
264 }
265
266 harmattan {
267     desktopfile.files = resources/$$PLATFORM/applications/$${TARGET}.desktop
268     desktopfile.path = $$DESKTOPDIR
269     INSTALLS += desktopfile
270
271     icon48.files = icons/48x48/$${TARGET}.png
272     icon48.path = /usr/share/icons/hicolor/48x48/apps
273     INSTALLS += icon48
274
275     icon64.files = icons/64x64/$${TARGET}.png
276     icon64.path = /usr/share/icons/hicolor/64x64/apps
277     INSTALLS += icon64
278
279     iconscalable.files = icons/scalable/$${TARGET}.svg
280     iconscalable.path = /usr/share/icons/hicolor/scalable/apps
281     INSTALLS += iconscalable
282
283     INSTALLS += i18n
284     INSTALLS += stations
285     icon80.files = icons/80x80/$${TARGET}.png
286     icon80.path = /usr/share/icons/hicolor/meegotouch/apps
287     INSTALLS += icon80
288
289     i18n.files = $$replace(TRANSLATIONS, .ts, .qm)
290     i18n.path = $$DATADIR/i18n
291     INSTALLS += i18n
292
293     stations.files = resources/stations/stations.qpl
294     stations.path = $$DATADIR/stations
295     INSTALLS += stations
296 }
297
298 !contains(USE_RESOURCES, 1) {
299     sailfish {
300         qml.files = resources/sailfish/qml/*.qml \
301                     resources/sailfish/qml/*.js \
302                     resources/sailfish/qml/pages \
303                     resources/sailfish/qml/pages/components \
304                     resources/sailfish/qml/cover
305         qml.path = $$DATADIR/qml
306         INSTALLS += qml
307     }
308     harmattan {
309         qml.files = resources/harmattan/qml/*.qml resources/harmattan/qml/*.js
310         qml.path = $$DATADIR/qml
311         INSTALLS += qml
312     }
313 }
314
315 contains(USE_RESOURCES, 1) {
316     RESOURCES += \
317         quandoparte.qrc
318 }
319
320 hack_to_fix_translations {
321     SOURCES += $$QMLSOURCES
322 }