-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathPlugin.cmake
More file actions
217 lines (172 loc) · 5.78 KB
/
Plugin.cmake
File metadata and controls
217 lines (172 loc) · 5.78 KB
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
# ~~~
# Author: bdcat <Dave Register>
# Copyright:
# License: GPLv2+
# ~~~
# -------- Cmake setup ---------
#
set(OCPN_TEST_REPO
"david-register/ocpn-plugins-unstable"
CACHE STRING "Default repository for untagged builds"
)
set(OCPN_BETA_REPO
"opencpn/o-charts-beta"
CACHE STRING
"Default repository for tagged builds matching 'beta'"
)
set(OCPN_RELEASE_REPO
"opencpn/o-charts-prod"
CACHE STRING
"Default repository for tagged builds not matching 'beta'"
)
set(OCPN_TARGET_TUPLE "" CACHE STRING
"Target spec: \"platform;version;arch\""
)
# ------- Plugin setup --------
#
include("VERSION.cmake")
set(PKG_NAME o-charts_pi)
set(PKG_VERSION ${OCPN_VERSION})
project(${PKG_NAME} VERSION ${PKG_VERSION})
set(VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(VERSION_PATCH ${PROJECT_VERSION_PATCH})
if (PROJECT_VERSION_TWEAK STREQUAL "")
set(PROJECT_VERSION_TWEAK 0)
endif ()
set(PKG_PRERELEASE "") # Empty, or a tag like 'beta'
set(DISPLAY_NAME o-charts) # Dialogs, installer artifacts, ...
set(PLUGIN_API_NAME o-charts) # As of GetCommonName() in plugin API
set(CPACK_PACKAGE_CONTACT "Dave Register")
set(PKG_SUMMARY
"Encrypted Vector Charts from o-charts.org"
)
set(PKG_DESCRIPTION [=[
OpenCPN Vector Charts licensed and sourced from chart providers like
Hydrographic Offices.
While the charts are not officially approved official ENC charts they
are based on the same data -- the legal conditions are described in the
EULA. The charts has world-wide coverage and provides a cost-effective
way to access the national chart databases. Charts are encrypted and
can only be used after purchasing decryption keys from o-charts.org.
o-charts can handle all charts previously handled by the oesenc and
oernc plugins. It thus obsoletes these two plugins.
]=])
set(PKG_HOMEPAGE https://github.com/bdbcat/o-charts_pi)
set(PKG_INFO_URL https://o-charts.org/)
set(PKG_AUTHOR "Dave register")
if(NOT QT_ANDROID AND NOT APPLE)
set(OCPN_BUILD_USE_GLEW ON)
else(NOT QT_ANDROID AND NOT APPLE)
set(OCPN_BUILD_USE_GLEW OFF)
endif(NOT QT_ANDROID AND NOT APPLE)
if(OCPN_BUILD_USE_GLEW)
add_definitions(-D__OCPN_USE_GLEW__)
include_directories("/app/extensions/o-charts_pi/include")
#if (CMAKE_HOST_WIN32)
# include_directories("${CMAKE_CURRENT_SOURCE_DIR}/buildwin/include/glew")
# link_libraries(${CMAKE_SOURCE_DIR}/buildwin/glew32.lib )
#endif (CMAKE_HOST_WIN32)
endif(OCPN_BUILD_USE_GLEW)
if (CMAKE_HOST_WIN32)
add_definitions(-D__MSVC__)
endif (CMAKE_HOST_WIN32)
set(SRC
src/chart.cpp
src/cutil.cpp
src/eSENCChart.cpp
src/eSENCChart.h
src/fpr.cpp
src/georef.cpp
src/InstallDirs.cpp
src/InstallDirs.h
src/ochartShop.cpp
src/ochartShop.h
src/o-charts_pi.cpp
src/o-charts_pi.h
src/OCPNRegion.cpp
src/oernc_inStream.cpp
src/Osenc.cpp
src/Osenc.h
src/piScreenLog.cpp
src/s57RegistrarMgr.cpp
src/sha256.c
src/uKey.cpp
src/validator.cpp
src/viewport.cpp
libs/gdal/src/s57classregistrar.cpp
src/tpm/tpmUtil.cpp
src/WinJobObj.h
)
if(QT_ANDROID)
set(SRC ${SRC}
src/androidSupport.cpp)
endif(QT_ANDROID)
if(QT_ANDROID AND (${ARM_ARCH} MATCHES "aarch64"))
set(SRC ${SRC}
src/comparetf2.c
src/androidDeviceSupport.c)
endif()
if(NOT QT_ANDROID)
add_compile_definitions( ocpnUSE_GLSL )
add_compile_definitions( ocpnUSE_GL )
endif(NOT QT_ANDROID)
if(QT_ANDROID)
add_definitions(-D__OCPN__ANDROID__)
endif(QT_ANDROID)
set(PKG_API_LIB api-17) # A directory in libs/ e. g., api-17 or api-16
macro(late_init)
# Perform initialization after the PACKAGE_NAME library, compilers
# and ocpn::api is available.
target_include_directories(${PACKAGE_NAME} PRIVATE libs/gdal/src src)
endmacro ()
macro(add_plugin_libraries)
add_subdirectory("libs/cpl")
target_link_libraries(${PACKAGE_NAME} ocpn::cpl)
add_subdirectory("libs/dsa")
target_link_libraries(${PACKAGE_NAME} ocpn::dsa)
add_subdirectory("libs/wxJSON")
target_link_libraries(${PACKAGE_NAME} ocpn::wxjson)
add_subdirectory("libs/iso8211")
target_link_libraries(${PACKAGE_NAME} ocpn::iso8211)
add_subdirectory("libs/tinyxml")
target_link_libraries(${PACKAGE_NAME} ocpn::tinyxml)
add_subdirectory("libs/zlib")
target_link_libraries(${PACKAGE_NAME} ocpn::zlib)
add_subdirectory("libs/glew")
target_link_libraries(${PACKAGE_NAME} glew2::glew2)
add_subdirectory(libs/s52plib)
target_link_libraries(${PACKAGE_NAME} ocpn::s52plib)
add_subdirectory(libs/geoprim)
target_link_libraries(${PACKAGE_NAME} ocpn::geoprim)
add_subdirectory(libs/pugixml)
target_link_libraries(${PACKAGE_NAME} ocpn::pugixml)
add_subdirectory("libs/wxcurl")
target_link_libraries(${PACKAGE_NAME} ocpn::wxcurl)
add_subdirectory("libs/oeserverd")
if(QT_ANDROID)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/includeAndroid")
endif(QT_ANDROID)
# Some code has alignment problems on ARMHF
# mygeom63.cpp, s63chart.cpp
# Make sure to set the correct compile definition
if(NOT APPLE)
if (${ARCH} MATCHES "armhf")
message(STATUS "Building for armhf")
ADD_DEFINITIONS( -DARMHF )
endif()
endif(NOT APPLE)
# A specific target requires special handling
# When OCPN core is a ubuntu-bionic build, and the debian-10 plugin is loaded,
# then there is conflict between wxCurl in core, vs plugin
# So, in this case, disable the plugin's use of wxCurl directly, and revert to
# plugin API for network access.
# And, Android always uses plugin API for network access
string(TOLOWER "${OCPN_TARGET_TUPLE}" _lc_target)
message(STATUS "add_plugin_libraries: ${_lc_target}.")
if ( (NOT "${_lc_target}" MATCHES "debian;10;x86_64") AND
(NOT "${_lc_target}" MATCHES "android*"))
message(STATUS "add_plugin_libraries: Using CURL.")
add_definitions(-D__OCPN_USE_CURL__)
endif()
endmacro ()