-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathPlugin.cmake
175 lines (138 loc) · 4.65 KB
/
Plugin.cmake
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
# ~~~
# 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})
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__)
endif(OCPN_BUILD_USE_GLEW)
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/DepthFont.cpp
src/piScreenLog.cpp
src/s57RegistrarMgr.cpp
src/sha256.c
src/uKey.cpp
src/validator.cpp
src/viewport.cpp
libs/gdal/src/s57classregistrar.cpp
)
if(QT_ANDROID)
set(SRC ${SRC} src/androidSupport.cpp)
endif(QT_ANDROID)
if(NOT QT_ANDROID)
add_compile_definitions( ocpnUSE_GLSL )
add_compile_definitions( ocpnUSE_GL )
endif(NOT 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)
# 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 "late_init: ${OCPN_TARGET_TUPLE}.")
if ( (NOT "${_lc_target}" MATCHES "debian;10;x86_64") AND
(NOT "${_lc_target}" MATCHES "android*") )
add_definitions(-D__OCPN_USE_CURL__)
endif()
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/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)
if (MSVC)
add_subdirectory("libs/WindowsHeaders")
target_link_libraries(${PACKAGE_NAME} _windows_headers)
endif ()
# add_subdirectory("libs/opencpn-glu")
# target_link_libraries(${PACKAGE_NAME} opencpn::glu)
add_subdirectory("libs/wxcurl")
target_link_libraries(${PACKAGE_NAME} ocpn::wxcurl)
add_subdirectory("libs/oeserverd")
endmacro ()