forked from konnibe/polar_pi
-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
346 lines (287 loc) · 11.5 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
##---------------------------------------------------------------------------
## Author: nohal aka. Pavel Kalian
## Copyright:
## License: wxWidgets License
##---------------------------------------------------------------------------
## Frontend2 Author: Jon Gough 1.0.238.0 09/06/2023") # DD/MM/YYYY format
## buildCI:yes useODAPI:no validateJSON:no
## ---------------------------------------------------------------------------
## ----- When changing this file do NOT change the order in which sections occur ----- ##
## ----- Changes should only be made between the section blocks that identify where ----- ##
## ----- these changes should be. The whole configuration process relies on this ----- ##
## ----- sequence to be successful ----- ##
##
##
## ----- Modify section below to include all the details for your plugin ----- ##
##
set(CMLOC "CMakeLists: ")
# define minimum cmake version
cmake_minimum_required(VERSION 3.5.1)
if(COMMAND cmake_policy)
if(POLICY CMP0043)
cmake_policy(SET CMP0043 NEW)
endif(POLICY CMP0043)
cmake_policy(SET CMP0048 NEW)
# Need cmake 3.13 to implement this, but raspbian builds are at 3.7.2 and bionic at 3.10 and xenial builds at 3.5.1
# cmake_policy(SET CMP0076 NEW)
if(POLICY CMP0077)
cmake_policy(SET CMP0077 NEW)
endif(POLICY CMP0077)
endif(COMMAND cmake_policy)
# define plugin name, owner and versions
set(VERBOSE_NAME "polar")
set(COMMON_NAME "Polar") # Search "getcommonname"in <plugin_pi>.cpp
set(TITLE_NAME "Polar")
set(PACKAGE_CONTACT "Peter Tulp")
set(PACKAGE "polar")
set(SHORT_DESCRIPTION "Polar Plugin makes polar diagrams for Weather Routing Predictions")
set(LONG_DESCRIPTION "Polar Plugin reads VDR data files directly, reads from Opencpn input Nmea channel (Record Start/Stop at bottom) and direct from LogBoookKonni records, to creates a polar diagram which can then be edited manually, saved or loaded as a Boat Polar file. The LogbookKonni selection has several options.")
set(VERSION_MAJOR "1")
set(VERSION_MINOR "2")
set(VERSION_PATCH "5")
set(VERSION_TWEAK "0")
set(VERSION_DATE "10/06/2023")# DD/MM/YYYY format
set(OCPN_MIN_VERSION "ov58")
set(OCPN_API_VERSION_MAJOR "1")
set(OCPN_API_VERSION_MINOR "16")
set(TP_COMMENT " * Release for O571 or O58 using CI")
set(PARENT "opencpn")
#Used to set up a local webserver with git loaded, for testing purposes.
#Now set in plugin configure, needed to build flatpak, also locally.
#set(GIT_REPOSITORY_SERVER "github.com")
#No longer needed, queried.
# set(GIT_USER "rgleason")
# set(GIT_REPOSITORY_NAME "polar_pi")
# Specifies Cloudsmith upload repository suffix for each catalog
set(PROD "prod") #Standard Repos
set(BETA "beta") #Standard Repos
set(ALPHA "alpha") #Standard Repos
# Set if your Cloudsmith Base Repository name does not match your Git repository name.
# set(CLOUDSMITH_BASE_REPOSITORY "${GIT_REPOSITORY_NAME}")
set (CLOUDSMITH_BASE_REPOSITORY "polar") #without the pi
set(CLOUDSMITH_USER "opencpn")
#set(CLOUDSMITH_USER "rick-gleason")
set(XML_INFO_URL "https://opencpn.org/OpenCPN/plugins/polar.html")
set(XML_SUMMARY ${SHORT_DESCRIPTION})
set(XML_DESCRIPTION ${LONG_DESCRIPTION})
## ----- Modify section above to include all the details for your plugin ----- ##
## ----- Modify section below if there are special requirements for the plugin ----- ##
option(PLUGIN_USE_SVG "Use SVG graphics" ON)
set(CMAKE_CXX_STANDARD 11)
# Use local version of GLU library
#set(USE_LOCAL_GLU TRUE)
# Prefer libGL.so to libOpenGL.so, see CMP0072
set(OpenGL_GL_PREFERENCE "LEGACY")
# Don't use local version of GLU library
set(USE_LOCAL_GLU FALSE)
option(USE_GL "Enable OpenGL support" OFF)
message(STATUS "${CMLOC}USE_GL: ${USE_GL}")
if("${CMAKE_BUILD_TYPE}" STREQUAL "")
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build" FORCE)
endif("${CMAKE_BUILD_TYPE}" STREQUAL "")
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "" "Debug" "Release" "RelWithDebInfo" "MinSizeRel")
message(STATUS "${CMLOC}Build type: ${CMAKE_BUILD_TYPE}")
## ----- The statements below are used to setup standard variables that are required by the CMAKE process - do not remove ----- ##
project(${PACKAGE})
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
##======================================
include("PluginSetup")
##======================================
## The above is used to setup standard variables that are required by the CMAKE process - do not remove ----- ##
## Modify section below if there are special requirements for the plugin ----- ##
set(CMAKE_VERBOSE_MAKEFILE "Activate verbose mode for make files" ON)
option(Plugin_CXX11 "Use c++11" OFF)
## Modify section above if there are special requirements for the plugin ----- ##
## do not change next section - needed to configure build process ----- ##
##======================================
include("PluginConfigure")
##======================================
## do not change section above - needed to configure build process ----- ##
##Change below to match project requirements for source, headers, etc. ----- ##
add_definitions(-DUSE_S57)
SET(SRCS
src/polar_pi.h
src/polar_pi.cpp
src/PolarGui.h
src/PolarGui.cpp
src/PolarDialog.h
src/PolarDialog.cpp
src/Options.h
src/Polar.h
src/Polar.cpp
src/icons.h
src/icons.cpp
# src/jsonreader.h
# src/jsonreader.cpp
# src/jsonwriter.h
# src/jsonwriter.cpp
# src/jsonval.h
# src/jsonval.cpp
# src/json_defs.h
)
SET(HDRS
src/polar_pi.h
src/PolarGui.h
src/PolarDialog.h
src/Options.h
src/Polar.h
src/icons.h
# src/jsonreader.h
# src/jsonwriter.h
# src/jsonval.h
# src/json_defs.h
)
#set(OCPNSRC
# ocpnsrc/cutil.cpp
# ocpnsrc/TexFont.cpp
#)
#set(OCPNHDRS
# ocpninclude/cutil.h
# ocpninclude/ocpn_plugin.h
# ocpninclude/pluginmanager.h
# ocpninclude/shaders.h
# ocpninclude/TexFont.h
# ocpninclude/vector2D.h
# libs/ocpn-api/ocpn_plugin.h
#)
#set(EXTSRC
#)
#set(EXTINCLUDE
# extinclude/ODAPI.h
# extinclude/ODJSONSchemas.h
#)
set(LIBSSRC libs/wxJSON/src/jsonreader.cpp libs/wxJSON/src/jsonval.cpp libs/wxJSON/src/jsonwriter.cpp)
set(LIBHDRS
libs/GL/gl.h
libs/GL/gl_private.h
libs/GL/glext.h
libs/GL/glu.h
libs/wxJSON/include/json_defs.h
libs/wxJSON/include/jsonreader.h
libs/wxJSON/include/jsonval.h
libs/wxJSON/include/jsonwriter.h)
# Tried to use Standard libs/nmea0183 but it is different
# Also causes errors "m_nmea0183" not defined, etc.
SET(SRC_LNMEA0183
src/nmea0183/LatLong.hpp
src/nmea0183/latlong.cpp
src/nmea0183/long.cpp
src/nmea0183/nmea0183.cpp
src/nmea0183/nmea0183.hpp
src/nmea0183/Response.hpp
src/nmea0183/response.cpp
src/nmea0183/RMB.hpp
src/nmea0183/rmb.cpp
src/nmea0183/Sentence.hpp
src/nmea0183/sentence.cpp
src/nmea0183/talkerid.cpp
src/nmea0183/RMC.HPP
src/nmea0183/rmc.cpp
src/nmea0183/hexvalue.cpp
src/nmea0183/lat.cpp
src/nmea0183/expid.cpp
src/nmea0183/wpl.hpp
src/nmea0183/wpl.cpp
src/nmea0183/rte.hpp
src/nmea0183/rte.cpp
src/nmea0183/hdt.hpp
src/nmea0183/hdt.cpp
src/nmea0183/hdg.hpp
src/nmea0183/hdg.cpp
src/nmea0183/hdm.hpp
src/nmea0183/hdm.cpp
src/nmea0183/gll.hpp
src/nmea0183/gll.cpp
src/nmea0183/vtg.hpp
src/nmea0183/vtg.cpp
src/nmea0183/gga.hpp
src/nmea0183/gga.cpp
src/nmea0183/gsv.hpp
src/nmea0183/gsv.cpp
src/nmea0183/dbt.cpp
src/nmea0183/dbt.hpp
src/nmea0183/dpt.cpp
src/nmea0183/dpt.hpp
src/nmea0183/mtw.cpp
src/nmea0183/mtw.hpp
src/nmea0183/mwv.cpp
src/nmea0183/mwv.hpp
src/nmea0183/vhw.hpp
src/nmea0183/vhw.cpp
src/nmea0183/vwr.cpp
src/nmea0183/vwr.hpp
src/nmea0183/vwt.cpp
src/nmea0183/vwt.hpp
src/nmea0183/zda.cpp
src/nmea0183/zda.hpp
src/nmea0183/rsa.hpp
src/nmea0183/rsa.cpp
src/nmea0183/SatInfo.h
)
add_definitions(-DPLUGIN_USE_SVG)
# =================================================
set(EXTINCLUDE_DIR ${EXTINCLUDE_DIR} extinclude libs/ocpn-api/)
# =================================================
#
# ----- If using JSON validation in plugin section below is needed ----- ##
#
# Not doing JSON Validation
#
# ----- If using JSON validation in plugin section above is needed ----- ##
#
#include_directories(BEFORE ${PROJECT_SOURCE_DIR}/include)
#include_directories(BEFORE ${PROJECT_SOURCE_DIR}/ocpninclude)
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/${EXTINCLUDE_DIR})
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/libs/)
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/libs/GL)
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/libs/ocpn-api)
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/libs/wxJSON/include)
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/src/nmea0183)
# Tried but causes errors m_nmea0183 not defined, etc.
# include_directories(BEFORE ${PROJECT_SOURCE_DIR}/libs/nmea0183)
## ----- Change below to match project requirements for android build ----- ##
#if(QT_ANDROID)
# include_directories( ${PROJECT_SOURCE_DIR}/extinclude/GLES2)
#endif(QT_ANDROID)
## ----- Change above to match project requirements for android build ----- ##
## Adjust statement below to collect all the set( headers and SRCS
#target_sources(${PACKAGE_NAME} PUBLIC ${SRC_POLAR} ${SRC_LNMEA0183} ${EXTSRC} ${LIBSSRC})
## target_sources(${PACKAGE_NAME} PUBLIC ${SRCS} ${HDRS} ${OCPNSRC} ${EXTSRC} ${LIBSSRC})
#target_sources(${PACKAGE_NAME} PUBLIC ${SRCS} ${HDRS} ${OCPNSRC} ${EXTSRC} ${LIBSSRC} ${SRC_LNMEA0183} )
##=================================================
target_sources(${PACKAGE_NAME} PUBLIC ${SRCS} ${HDRS} ${EXTSRC} ${LIBSSRC} ${SRC_LNMEA0183})
##=================================================
if(NOT OCPN_FLATPAK_CONFIG)
# Build environment not available when flatpak is being configured so following statements will not work
message(STATUS "${CMLOC}Adding target link libraries to ${PACKAGE_NAME}")
# add_subdirectory(libs/tinyxml)
# add_subdirectory(libs/nmea0183)
# target_link_libraries(${PACKAGE_NAME} ocpn::tinyxml)
# target_link_libraries(${PACKAGE_NAME} ocpn::nmea0183)
endif(NOT OCPN_FLATPAK_CONFIG)
add_definitions(-DTIXML_USE_STL)
#
# ----- If using JSON validation in plugin section below is needed ----- ##
#
# Not using Json Schema Validator
#
# ----- If using JSON validation in plugin section above is needed ----- ##
#
## ----- Change above to match project requirements ----- ##
## ----- do not change next section - needed to configure build process ----- ##
# Needed for android builds
if(QT_ANDROID)
include_directories(BEFORE ${qt_android_include})
endif(QT_ANDROID)
# Needed for all builds
##======================================
include("PluginInstall")
include("PluginLocalization")
include("PluginPackage")
##======================================
## ----- do not change section above - needed to configure build process ----- ##
message(STATUS "${CMLOC}include directories: ")
get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
foreach(dir ${dirs})
message(STATUS "${CMLOC}dir='${dir}'")
endforeach()