forked from jongough/ocpn_draw_pi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
361 lines (321 loc) · 11 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
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
##---------------------------------------------------------------------------
# Author: jongough aka. Jon Gough
## Copyright:
## License: wxWidgets License
##---------------------------------------------------------------------------
# define minimum cmake version
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.2)
PROJECT(ocpn_draw_pi)
SET(PACKAGE_NAME ocpn_draw_pi)
SET(VERBOSE_NAME ocpn_draw)
SET(TITLE_NAME OCPNDRAW)
SET(CPACK_PACKAGE_CONTACT "Jon Gough")
SET(VERSION_MAJOR "0")
SET(VERSION_MINOR "4")
SET(VERSION_PATCH "617")
SET(VERSION_DATE "16/01/2016")
SET(BUNDLE_DATA FALSE)
#SET(CMAKE_BUILD_TYPE "Debug")
#SET(CMAKE_BUILD_TYPE "Release")
#SET(CMAKE_BUILD_TYPE "RelWithDebInfo")
IF( NOT CMAKE_BUILD_TYPE )
SET( CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE )
ENDIF( NOT CMAKE_BUILD_TYPE )
MESSAGE (STATUS "Build type: ${CMAKE_BUILD_TYPE}")
SET(CMAKE_VERBOSE_MAKEFILE ON)
#SET_DIRECTORY_PROPERTIES(dummy ADDITIONAL_MAKE_CLEAN_FILES ${CMAKE_SOURCE_DIR}/include/version.h)
INCLUDE("cmake/PluginConfigure.cmake")
ADD_DEFINITIONS(-DUSE_S57)
SET(SRCS
src/ocpn_draw_pi.cpp
src/Boundary.cpp
src/BoundaryMan.cpp
src/BoundaryProp.cpp
src/BoundaryPoint.cpp
src/DR.cpp
src/DRProp.cpp
src/EBL.cpp
src/EBLProp.cpp
src/PointMan.cpp
src/ODSelect.cpp
src/PathMan.cpp
src/pathmanagerdialog.cpp
src/ODPath.cpp
src/ODPoint.cpp
src/ODConfig.cpp
src/ODdc.cpp
src/ODDRDialogDef.cpp
src/ODDRDialogImpl.cpp
src/ODEventHandler.cpp
src/ODicons.cpp
src/ODNavObjectChanges.cpp
src/ODPropertiesDialogDef.cpp
src/ODPropertiesDialogImpl.cpp
src/ODPathPropertiesDialogDef.cpp
src/ODPathPropertiesDialogImpl.cpp
src/ODPointPropertiesDialog.cpp
src/ODPointPropertiesImpl.cpp
src/ODPositionParser.cpp
src/ODRolloverWin.cpp
src/ODToolbarDef.cpp
src/ODToolbarImpl.cpp
src/ODUtils.cpp
src/TextPoint.cpp
)
SET(HDRS
include/ocpn_draw_pi.h
include/Boundary.h
include/BoundaryMan.h
include/BoundaryProp.h
include/BoundaryPoint.h
include/DR.h
include/DRProp.h
include/EBL.h
include/EBLProp.h
include/PointMan.h
include/ODSelect.h
include/PathMan.h
include/pathmanagerdialog.h
include/ODPath.h
include/ODPoint.h
include/ODConfig.h
include/ODdc.h
include/ODDRDialogDef.h
include/ODDRDialogImpl.h
include/ODEventHandler.h
include/ODNavObjectChanges.h
include/ODPropertiesDialogDef.h
include/ODPropertiesDialogImpl.h
include/ODPathPropertiesDialogDef.h
include/ODPathPropertiesDialogImpl.h
include/ODPointPropertiesDialog.h
include/ODPointPropertiesImpl.h
include/ODPositionParser.h
include/ODRolloverWin.h
include/ODToolbarDef.h
include/ODToolbarImpl.h
include/ODUtils.h
include/ODvector2D.h
include/ODicons.h
include/TextPoint.h
include/version.h
)
SET(OCPNSRC
ocpnsrc/bbox.cpp
ocpnsrc/cutil.cpp
ocpnsrc/geodesic.cpp
ocpnsrc/georef.cpp
ocpnsrc/Hyperlink.cpp
ocpnsrc/Layer.cpp
ocpnsrc/pugixml.cpp
ocpnsrc/SelectItem.cpp
ocpnsrc/wxJSON/jsonreader.cpp
ocpnsrc/wxJSON/jsonval.cpp
ocpnsrc/wxJSON/jsonwriter.cpp
)
SET(OCPNHDRS
ocpninclude/AISTargetAlertDialog.h
ocpninclude/AISTargetQueryDialog.h
ocpninclude/apb.hpp
ocpninclude/bbox.h
ocpninclude/canvasMenu.h
ocpninclude/chart1.h
ocpninclude/chartbarwin.h
ocpninclude/chartbase.h
ocpninclude/chartdbs.h
ocpninclude/chcanv.h
ocpninclude/CM93DSlide.h
ocpninclude/ConnectionParams.h
ocpninclude/cutil.h
ocpninclude/datastream.h
ocpninclude/dsPortType.h
ocpninclude/dychart.h
ocpninclude/emboss_data.h
ocpninclude/geodesic.h
ocpninclude/georef.h
ocpninclude/gga.hpp
ocpninclude/gll.hpp
ocpninclude/GoToPositionDialog.h
ocpninclude/GPwpl.hpp
ocpninclude/gpxdocument.h
ocpninclude/gsv.hpp
ocpninclude/hdg.hpp
ocpninclude/hdm.hpp
ocpninclude/hdt.hpp
ocpninclude/Hyperlink.h
ocpninclude/IDX_entry.h
ocpninclude/LatLong.hpp
ocpninclude/Layer.h
ocpninclude/LinkPropDlg.h
ocpninclude/MarkIcon.h
ocpninclude/navutil.h
ocpninclude/nmea0183.h
ocpninclude/nmea0183.hpp
ocpninclude/ocpCursor.h
ocpninclude/OCPNPlatform.h
ocpninclude/OCPNRegion.h
ocpninclude/ocpn_plugin.h
ocpninclude/ocpn_types.h
ocpninclude/pluginmanager.h
ocpninclude/pugiconfig.hpp
ocpninclude/pugixml.hpp
ocpninclude/Quilt.h
ocpninclude/Response.hpp
ocpninclude/RMB.hpp
ocpninclude/RMC.HPP
ocpninclude/RolloverWin.h
ocpninclude/Route.h
ocpninclude/RoutePoint.h
ocpninclude/routeprop.h
ocpninclude/rte.hpp
ocpninclude/s52s57.h
ocpninclude/s57chart.h
ocpninclude/S57ClassRegistrar.h
ocpninclude/S57Light.h
ocpninclude/S57QueryDialog.h
ocpninclude/s57RegistrarMgr.h
ocpninclude/S57Sector.h
ocpninclude/scrollingdialog.h
ocpninclude/SelectItem.h
ocpninclude/Sentence.hpp
ocpninclude/styles.h
ocpninclude/TexFont.h
ocpninclude/timers.h
ocpninclude/undo.h
ocpninclude/vector2D.h
ocpninclude/viewport.h
ocpninclude/vtg.hpp
ocpninclude/wpl.hpp
ocpninclude/xte.hpp
ocpninclude/GL/gl.h
ocpninclude/GL/gl_private.h
ocpninclude/GL/glext.h
ocpninclude/GL/glu.h
ocpninclude/wx/json_defs.h
ocpninclude/wx/jsonreader.h
ocpninclude/wx/jsonval.h
ocpninclude/wx/jsonwriter.h
)
SET(EXTSRC
extsrc/clipper.cpp
)
SET(EXTINCLUDE
extinclude/clipper.hpp
)
OPTION(OD_USE_SVG "Use SVG graphics" ON)
IF(OD_USE_SVG)
MESSAGE(STATUS "SVG support enabled...")
IF(NOT QT_ANDROID)
IF(NOT WIN32)
#Find Cairo
IF( CAIRO_INCLUDE_DIR )
# Already in cache, be silent
SET( CAIRO_FIND_QUIETLY TRUE )
ENDIF( CAIRO_INCLUDE_DIR )
FIND_PATH( CAIRO_INCLUDE_DIR cairo.h
PATHS /usr/local/include /usr/include
PATH_SUFFIXES cairo/ libcairo/ cairo/libcairo/ )
SET( CAIRO_NAMES libcairo cairo )
FIND_LIBRARY( CAIRO_LIBRARY
NAMES ${CAIRO_NAMES}
PATHS /usr/lib /usr/local/lib /usr/lib/i386-linux-gnu)
GET_FILENAME_COMPONENT( CAIRO_LIBRARY_DIR ${CAIRO_LIBRARY} PATH )
# handle the QUIETLY and REQUIRED arguments and set CAIRO_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE( "FindPackageHandleStandardArgs" )
FIND_PACKAGE_HANDLE_STANDARD_ARGS( "CAIRO" DEFAULT_MSG CAIRO_INCLUDE_DIR CAIRO_LIBRARY )
MARK_AS_ADVANCED( CAIRO_INCLUDE_DIR CAIRO_LIBRARY )
if ( NOT CAIRO_FOUND )
message(FATAL_ERROR "Cairo component required, but not found!")
endif()
IF(NOT WIN32 AND NOT APPLE)
OPTION(OCPN_FORCE_GTK3 "Force the build to use GTK3" OFF)
IF(NOT OCPN_FORCE_GTK3)
FIND_PACKAGE(GTK2)
ENDIF(NOT OCPN_FORCE_GTK3)
IF(GTK2_FOUND)
INCLUDE_DIRECTORIES(${GTK2_INCLUDE_DIRS})
SET(GTK_LIBRARIES ${GTK2_LIBRARIES})
MESSAGE(STATUS "Building against GTK2...")
ELSE(GTK2_FOUND)
FIND_PACKAGE(GTK3)
INCLUDE_DIRECTORIES(${GTK3_INCLUDE_DIRS})
SET(GTK_LIBRARIES ${GTK3_LIBRARIES})
MESSAGE(STATUS "Building against GTK3...")
ENDIF(GTK2_FOUND)
ENDIF(NOT WIN32 AND NOT APPLE)
# Find FFMPEG - we have it disabled in our wxSVG
#set(FFmpeg_FIND_COMPONENTS AVCODEC AVFORMAT AVUTIL SWSCALE SWRESAMPLE AVRESAMPLE)
#unset(FFMPEG_LIBRARIES CACHE)
#find_package(FFmpeg)
#if ( NOT AVCODEC_FOUND OR NOT AVFORMAT_FOUND OR NOT AVUTIL_FOUND OR NOT SWSCALE_FOUND )
# message(FATAL_ERROR "FFmpeg component required, but not found!")
#endif()
#set(VIDEO_FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${SWSCALE_LIBRARIES})
FIND_PACKAGE(EXPAT REQUIRED)
ELSE(NOT WIN32)
#On Windows, we have our own expat
SET(EXPAT_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/buildwin/expat-2.1.0/include)
INCLUDE_DIRECTORIES(${EXPAT_INCLUDE_DIR})
#And cairo
SET(CAIRO_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/buildwin/gtk/include)
ENDIF(NOT WIN32)
INCLUDE_DIRECTORIES(${CAIRO_INCLUDE_DIR})
IF(APPLE)
INCLUDE_DIRECTORIES(${CAIRO_INCLUDE_DIR}/..)
ENDIF(APPLE)
#INCLUDE_DIRECTORIES(${FFMPEG_INCLUDE_DIRS})
ADD_DEFINITIONS(-DUSE_RENDER_CAIRO)
ADD_DEFINITIONS(-DODraw_USE_SVG)
IF(WIN32)
SET(SVG_LIBS
${CMAKE_SOURCE_DIR}/buildwin/gtk/cairo.lib
${CMAKE_SOURCE_DIR}/buildwin/expat-2.1.0/expat.lib
)
# FILE(GLOB gtkdll_files "${CMAKE_CURRENT_SOURCE_DIR}/buildwin/gtk/*.dll")
# INSTALL(FILES ${gtkdll_files} DESTINATION ".")
# FILE(GLOB expatdll_files "${CMAKE_CURRENT_SOURCE_DIR}/buildwin/expat-2.1.0/*.dll")
# INSTALL(FILES ${expatdll_files} DESTINATION ".")
# MESSAGE(STATUS "GTK and Expat DLLs bundled into the installer package...")
ELSE(WIN32)
SET(SVG_LIBS ${CAIRO_LIBRARY} ${EXPAT_LIBRARIES} ${GTK_LIBRARIES})
ENDIF(WIN32)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/ocpninclude/wxsvg)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/ocpninclude/wxSVGXML)
IF(WIN32)
SET(EXTRA_LIBS ${EXTRA_LIBS} WXSVG expat cairo)
ENDIF(WIN32)
ENDIF(NOT QT_ANDROID)
ENDIF(OD_USE_SVG)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/mygdal )
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/ocpninclude)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/extinclude)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/ocpninclude/wxcurl)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/ocpninclude/wxcurl/include)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/ocpnsrc/lz4)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/ocpnsrc/bitmaps)
IF(UNIX)
INCLUDE("cmake/FindTinyXML.cmake")
FIND_PACKAGE(TinyXML QUIET)
ENDIF(UNIX)
IF(TINYXML_FOUND)
message (STATUS "Building with system tinyxml")
INCLUDE_DIRECTORIES(${TINYXML_INCLUDE_DIR})
ADD_LIBRARY(${PACKAGE_NAME} SHARED ${SRCS} ${HDRS} ${OCPNSRC} ${EXTSRC})
TARGET_LINK_LIBRARIES(${PACKAGE_NAME} ${TINYXML_LIBRARIES})
ELSE(TINYXML_FOUND)
message (STATUS "Building with embedded tinyxml")
INCLUDE_DIRECTORIES(src/tinyxml/)
SET(SRC_LTINYXML
src/tinyxml/tinyxml.cpp
src/tinyxml/tinyxmlparser.cpp
src/tinyxml/tinyxmlerror.cpp
)
ADD_LIBRARY(${PACKAGE_NAME} SHARED ${SRCS} ${HDRS} ${OCPNSRC} ${EXTSRC} ${SRC_LTINYXML})
ENDIF(TINYXML_FOUND)
ADD_DEFINITIONS(-DTIXML_USE_STL)
INCLUDE("cmake/PluginInstall.cmake")
INCLUDE("cmake/PluginLocalization.cmake")
INCLUDE("cmake/PluginPackage.cmake")