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