source: subversion/applications/editors/merkaartor/Merkaartor.pro @ 13954

Last change on this file since 13954 was 13832, checked in by Chris Browet, 11 years ago

ADD : Allow to force the custom Qt style thru Config.pri

File size: 5.3 KB
Line 
1# external supported variables:
2# passed on commandline like "qmake NOWEBKIT=1"
3# NOUSEWEBKIT         - disable use of WebKit (Yahoo adapter)
4# TRANSDIR_MERKAARTOR - translations directory for merkaartor
5# TRANSDIR_SYSTEM     - translations directory for Qt itself
6# OUTPUT_DIR          - base directory for local output files
7# PREFIX              - base prefix for installation
8# NODEBUG             - no debug target
9# OSMARENDER          - enable osmarender
10# PROJ                - use PROJ4 library for projections
11# GDAL                - enable GDAL
12# MOBILE              - enable MOBILE
13# GEOIMAGE            - enable geotagged images (needs exiv2)
14# GPSD                - use gpsd as location provider
15# NVIDIA_HACK         - used to solve nvidia specific slowdown
16# FORCE_CUSTOM_STYLE  - force custom style (recommended on Linux until the "expanding dock" is solved upstream)
17
18#Static config
19include (Config.pri)
20
21#Custom config
22include(Custom.pri)
23
24#Qt Version
25QT_VERSION = $$[QT_VERSION]
26QT_VERSION = $$split(QT_VERSION, ".")
27QT_VER_MAJ = $$member(QT_VERSION, 0)
28QT_VER_MIN = $$member(QT_VERSION, 1)
29
30lessThan(QT_VER_MAJ, 4) | lessThan(QT_VER_MIN, 3) {
31    error(Merkaartor requires Qt 4.3 or newer but Qt $$[QT_VERSION] was detected.)
32}
33DEFINES += VERSION=\"\\\"$$VERSION\\\"\"
34DEFINES += REVISION=\"\\\"$$REVISION\\\"\"
35
36TEMPLATE = app
37TARGET = merkaartor
38
39QT += svg network xml core gui
40
41!contains(NODEBUG,1) {
42    CONFIG += debug
43    OUTPUT_DIR=$$PWD/binaries/$$(QMAKESPEC)/debug
44    OBJECTS_DIR += tmp/$$(QMAKESPEC)/obj_debug
45}
46contains(NODEBUG,1) {
47    CONFIG += release
48    DEFINES += NDEBUG
49    DEFINES += QT_NO_DEBUG_OUTPUT
50    OUTPUT_DIR=$$PWD/binaries/$$(QMAKESPEC)/release
51    OBJECTS_DIR += tmp/$$(QMAKESPEC)/obj_release
52}
53
54contains(GPSD,1) {
55    DEFINES += USEGPSD
56}
57
58contains(FORCE_CUSTOM_STYLE,1) {
59    DEFINES += FORCED_CUSTOM_STYLE
60}
61
62contains(NVIDIA_HACK,1) {
63    DEFINES += ENABLE_NVIDIA_HACK
64}
65
66DESTDIR = $$OUTPUT_DIR/bin
67
68INCLUDEPATH += . Render qextserialport GPS NameFinder
69DEPENDPATH += . Render qextserialport GPS NameFinder
70UI_DIR += tmp/$$(QMAKESPEC)
71MOC_DIR += tmp/$$(QMAKESPEC)
72RCC_DIR += tmp/$$(QMAKESPEC)
73
74TRANSLATIONS += \
75        translations/merkaartor_ar.ts \
76        translations/merkaartor_cs.ts \
77        translations/merkaartor_de.ts \
78        translations/merkaartor_es.ts \
79        translations/merkaartor_fr.ts \
80        translations/merkaartor_it.ts \
81        translations/merkaartor_pl.ts \
82        translations/merkaartor_ru.ts
83
84BINTRANSLATIONS += \
85        translations/merkaartor_ar.qm \
86        translations/merkaartor_cs.qm \
87        translations/merkaartor_de.qm \
88        translations/merkaartor_es.ts \
89        translations/merkaartor_fr.qm \
90        translations/merkaartor_it.qm \
91        translations/merkaartor_pl.qm \
92        translations/merkaartor_ru.qm
93
94#Include file(s)
95include(Merkaartor.pri)
96include(QMapControl.pri)
97include(ImportExport.pri)
98include(Render/Render.pri)
99include(qextserialport/qextserialport.pri)
100include(GPS/GPS.pri)
101include(Tools/Tools.pri)
102include(TagTemplate/TagTemplate.pri)
103include(NameFinder/NameFinder.pri)
104include(QtStyles/QtStyles.pri)
105
106unix {
107    # Prefix: base instalation directory
108    isEmpty( PREFIX ) {
109                PREFIX = /usr/local
110        }
111    target.path = $${PREFIX}/bin
112
113    isEmpty(TRANSDIR_MERKAARTOR) {
114        TRANSDIR_MERKAARTOR = $${PREFIX}/share/merkaartor/translations
115    }
116}
117
118win32 {
119        INCLUDEPATH += $$OUTPUT_DIR/include
120        LIBS += -L$$OUTPUT_DIR/lib
121        RC_FILE = Icons/merkaartor-win32.rc
122}
123
124INSTALLS += target
125
126win32-msvc* {
127    DEFINES += _USE_MATH_DEFINES
128}
129
130
131count(TRANSDIR_MERKAARTOR, 1) {
132        translations.path =  $${TRANSDIR_MERKAARTOR}
133        translations.files = $${BINTRANSLATIONS}
134        DEFINES += TRANSDIR_MERKAARTOR=\"\\\"$$translations.path\\\"\"
135        INSTALLS += translations
136}
137
138count(TRANSDIR_SYSTEM, 1) {
139        DEFINES += TRANSDIR_SYSTEM=\"\\\"$${TRANSDIR_SYSTEM}\\\"\"
140}
141
142isEmpty(NOUSEWEBKIT) {
143   greaterThan(QT_VER_MAJ, 3) : greaterThan(QT_VER_MIN, 3) {
144        DEFINES += YAHOO
145        SOURCES += QMapControl/yahoolegalmapadapter.cpp QMapControl/browserimagemanager.cpp
146        HEADERS += QMapControl/yahoolegalmapadapter.h QMapControl/browserimagemanager.h
147        QT += webkit
148    }
149}
150
151contains(MOBILE,1) {
152    DEFINES += _MOBILE
153    win32-wince* {
154      DEFINES += _WINCE
155    }
156}
157
158contains(GEOIMAGE, 1) {
159        DEFINES += GEOIMAGE
160        LIBS += -lexiv2
161        include(GeoImage.pri)
162}
163
164contains (PROJ, 1) {
165        DEFINES += USE_PROJ
166        win32-msvc*:LIBS += -lproj_i
167        !win32-msvc*:LIBS += -lproj
168}
169
170contains (GDAL, 1) {
171        DEFINES += USE_GDAL
172        win32 {
173                win32-msvc*:LIBS += -lgdal_i
174                win32-g++:LIBS += -lgdal
175                world_shp.path = share/world_shp
176        }
177        unix {
178                LIBS += -lgdal
179                world_shp.path = $${PREFIX}/share/merkaartor/world_shp
180        }
181       
182        world_shp.files = \
183                share/world_shp/world_adm0.shp \
184                share/world_shp/world_adm0.shx \
185                share/world_shp/world_adm0.dbf
186
187        DEFINES += WORLD_SHP=\"\\\"$$world_shp.path/world_adm0.shp\\\"\"
188        INSTALLS += world_shp
189}
190
191#   INCLUDEPATH += binaries/win32-g++/debug/include
192#   LIBS += -Lbinaries/win32-g++/debug/lib
193
194#   DESTDIR = binaries/win32-g++/debug/bin
195
196
197!isEmpty(TRANSLATIONS) {
198
199  isEmpty(QMAKE_LRELEASE) {
200    win32:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\lrelease.exe
201    else:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease
202  }
203
204 TS_DIR = translations
205
206  TSQM.name = lrelease ${QMAKE_FILE_IN}
207  TSQM.input = TRANSLATIONS
208  TSQM.output = $$TS_DIR/${QMAKE_FILE_BASE}.qm
209  TSQM.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN}
210  TSQM.CONFIG = no_link
211  QMAKE_EXTRA_COMPILERS += TSQM
212  PRE_TARGETDEPS += compiler_TSQM_make_all
213
214} else:message(No translation files in project)
215
216
Note: See TracBrowser for help on using the repository browser.