-
-
Notifications
You must be signed in to change notification settings - Fork 3k
/
CMakeLists.txt
266 lines (235 loc) · 6.81 KB
/
CMakeLists.txt
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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
SET(QGIS_APP_SRCS
main.cpp
qgisapp.cpp
qgisappinterface.cpp
qgsabout.cpp
qgsaddattrdialog.cpp
qgsattributeactiondialog.cpp
qgsattributedialog.cpp
qgsattributetable.cpp
qgsattributetabledisplay.cpp
qgsbookmarkitem.cpp
qgsbookmarks.cpp
qgsclipboard.cpp
qgscontinuouscolordialog.cpp
qgscustomprojectiondialog.cpp
qgsdbfilterproxymodel.cpp
qgsdbtablemodel.cpp
qgsdelattrdialog.cpp
qgsgeomtypedialog.cpp
qgsgraduatedsymboldialog.cpp
qgshelpviewer.cpp
qgsidentifyresults.cpp
qgslabeldialog.cpp
qgsludialog.cpp
qgsmaptooladdfeature.cpp
qgsmaptooladdvertex.cpp
qgsmaptooladdisland.cpp
qgsmaptooladdring.cpp
qgsmaptoolcapture.cpp
qgsmaptooldeletevertex.cpp
qgsmaptooledit.cpp
qgsmaptoolidentify.cpp
qgsmaptoolmovefeature.cpp
qgsmaptoolmovevertex.cpp
qgsmaptoolselect.cpp
qgsmaptoolsplitfeatures.cpp
qgsmaptoolvertexedit.cpp
qgsmeasuredialog.cpp
qgsmeasuretool.cpp
qgsnewhttpconnection.cpp
qgsnumericsortlistviewitem.cpp
qgsoptions.cpp
qgspastetransformations.cpp
qgspluginitem.cpp
qgspluginmanager.cpp
qgspluginmetadata.cpp
qgspluginregistry.cpp
qgspythondialog.cpp
qgsprojectproperties.cpp
qgsrasterlayerproperties.cpp
qgssearchquerybuilder.cpp
qgsserversourceselect.cpp
qgssinglesymboldialog.cpp
qgssnappingdialog.cpp
qgsuniquevaluedialog.cpp
qgsvectorlayerproperties.cpp
composer/qgscomposer.cpp
composer/qgscomposeritemwidget.cpp
composer/qgscomposerlabelwidget.cpp
composer/qgscomposerpicturewidget.cpp
composer/qgscomposermapwidget.cpp
composer/qgscomposerscalebarwidget.cpp
composer/qgscomposerlegenditemdialog.cpp
composer/qgscomposerlegendwidget.cpp
composer/qgscompositionwidget.cpp
composer/qgsitempositiondialog.cpp
legend/qgslegendgroup.cpp
legend/qgslegend.cpp
legend/qgslegenditem.cpp
legend/qgslegendlayer.cpp
legend/qgslegendlayerfile.cpp
legend/qgslegendlayerfilegroup.cpp
legend/qgslegendpropertygroup.cpp
legend/qgslegendpropertyitem.cpp
legend/qgslegendsymbologygroup.cpp
legend/qgslegendsymbologyitem.cpp
legend/qgslegendvectorsymbologyitem.cpp
)
SET (QGIS_APP_MOC_HDRS
qgisapp.h
qgisappinterface.h
qgsabout.h
qgsaddattrdialog.h
qgsattributeactiondialog.h
qgsattributedialog.h
qgsattributetabledisplay.h
qgsattributetable.h
qgsbookmarks.h
qgscontinuouscolordialog.h
qgscustomprojectiondialog.h
qgsdelattrdialog.h
qgsgeomtypedialog.h
qgsgraduatedsymboldialog.h
qgshelpviewer.h
qgsidentifyresults.h
qgslabeldialog.h
qgsludialog.h
qgsmaptoolidentify.h
qgsmaptoolsplitfeatures.h
qgsmaptoolvertexedit.h
qgsmaptooladdfeature.h
qgsmaptooladdisland.h
qgsmaptooladdring.h
qgsmaptoolmovefeature.h
qgsmaptoolselect.h
qgsmeasuretool.h
qgsmeasuredialog.h
qgsnewhttpconnection.h
qgsoptions.h
qgspastetransformations.h
qgspluginmanager.h
qgspythondialog.h
qgsprojectproperties.h
qgsrasterlayerproperties.h
qgssearchquerybuilder.h
qgsserversourceselect.h
qgssinglesymboldialog.h
qgssnappingdialog.h
qgsuniquevaluedialog.h
qgsvectorlayerproperties.h
qgsdbtablemodel.h
composer/qgscomposer.h
composer/qgscomposeritemwidget.h
composer/qgscomposerlabelwidget.h
composer/qgscomposerlegendwidget.h
composer/qgscomposermapwidget.h
composer/qgscomposerpicturewidget.h
composer/qgscomposerscalebarwidget.h
composer/qgscompositionwidget.h
composer/qgsitempositiondialog.h
legend/qgslegend.h
legend/qgslegendlayer.h
legend/qgslegendlayerfile.h
)
IF (POSTGRES_FOUND)
IF(HAVE_PGCONFIG)
ADD_DEFINITIONS(-DHAVE_PGCONFIG=1)
ENDIF(HAVE_PGCONFIG)
SET (QGIS_APP_SRCS ${QGIS_APP_SRCS}
qgsdbsourceselect.cpp
qgsnewconnection.cpp
qgspgquerybuilder.cpp
)
SET (QGIS_APP_MOC_HDRS ${QGIS_APP_MOC_HDRS}
qgsdbsourceselect.h
qgsnewconnection.h
qgspgquerybuilder.h
)
ENDIF (POSTGRES_FOUND)
QT4_WRAP_CPP(QGIS_APP_MOC_SRCS ${QGIS_APP_MOC_HDRS})
IF (WIN32)
IF (MSVC)
SET (QGIS_APP_SRCS ${QGIS_APP_SRCS} ${CMAKE_CURRENT_SOURCE_DIR}/qgis_win32.rc)
ELSE(MSVC)
# Icon for windows MINGW
# Note: can't include .rc directly to source files
# as it's ignored when used MinGW
IF (NOT WINDRES)
FIND_PROGRAM(WINDRES windres)
IF (NOT WINDRES)
MESSAGE(FATAL_ERROR "windres not found - aborting")
ENDIF (NOT WINDRES)
ENDIF (NOT WINDRES)
#############################################################
# application icon
# resource compilation for MinGW
ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/icon.o
COMMAND ${WINDRES} -I${CMAKE_CURRENT_SOURCE_DIR} -i${CMAKE_CURRENT_SOURCE_DIR}/qgis_win32.rc
-o ${CMAKE_CURRENT_BINARY_DIR}/icon.o )
SET(QGIS_APP_SRCS ${QGIS_APP_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/icon.o)
ENDIF (MSVC)
ENDIF (WIN32)
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR} composer legend
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/../ui
../core
../core/composer ../core/raster ../core/renderer ../core/symbology
../gui
../plugins
../python
${PROJ_INCLUDE_DIR}
${SQLITE3_INCLUDE_DIR}
${GEOS_INCLUDE_DIR}
${GDAL_INCLUDE_DIR}
)
IF (POSTGRES_FOUND)
INCLUDE_DIRECTORIES(${POSTGRES_INCLUDE_DIR})
ENDIF (POSTGRES_FOUND)
#############
IF (WIN32)
# 'WIN32' removes console, which is Bad when debugging
IF (CMAKE_BUILD_TYPE MATCHES Debug)
ADD_EXECUTABLE(qgis ${QGIS_APP_SRCS} ${QGIS_APP_MOC_SRCS} ${IMAGE_RCC_SRCS})
ELSE (CMAKE_BUILD_TYPE MATCHES Debug)
ADD_EXECUTABLE(qgis WIN32 ${QGIS_APP_SRCS} ${QGIS_APP_MOC_SRCS} ${IMAGE_RCC_SRCS})
ENDIF (CMAKE_BUILD_TYPE MATCHES Debug)
ELSE (WIN32)
ADD_EXECUTABLE(qgis ${QGIS_APP_SRCS} ${QGIS_APP_MOC_SRCS} ${IMAGE_RCC_SRCS})
ENDIF (WIN32)
TARGET_LINK_LIBRARIES(qgis
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${QT_QTXML_LIBRARY}
${QT_QTSVG_LIBRARY}
${QT_QTNETWORK_LIBRARY}
${QT_QTSQL_LIBRARY}
#should only be needed for win
${QT_QTMAIN_LIBRARY}
qgis_core
qgis_gui
)
IF (${QTVERSION} STRLESS "4.3.0")
TARGET_LINK_LIBRARIES(qgis ${QT_QT3SUPPORT_LIBRARY} )
ENDIF (${QTVERSION} STRLESS "4.3.0")
IF (APPLE)
TARGET_LINK_LIBRARIES(qgis ${APP_SERVICES_LIBRARY} )
ENDIF (APPLE)
SET_TARGET_PROPERTIES(qgis PROPERTIES
INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${QGIS_LIB_DIR}
INSTALL_RPATH_USE_LINK_PATH true
)
IF (POSTGRES_FOUND)
TARGET_LINK_LIBRARIES (qgis ${POSTGRES_LIBRARY})
ENDIF (POSTGRES_FOUND)
IF (APPLE)
# For Mac OS X, the executable must be at the root of the bundle's executable folder
INSTALL(TARGETS qgis RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX})
ELSE (APPLE)
INSTALL(TARGETS qgis RUNTIME DESTINATION ${QGIS_BIN_DIR})
ENDIF (APPLE)
########## Install headers for developers to use against qgis libs
#commented out since app classes dont go into any lib there is little point
#INSTALL(FILES ${CMAKE_BINARY_DIR}/src/ui/ui_qgsmeasurebase.h DESTINATION ${QGIS_INCLUDE_DIR})
#INSTALL(FILES ${QGIS_APP_MOC_HDRS} DESTINATION ${QGIS_INCLUDE_DIR})