-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPlugin.cmake
85 lines (73 loc) · 2.47 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
# ~~~
# Summary: Local, non-generic plugin setup
# Copyright (c) 2024 ALec Leamas
# License: GPLv3+
# ~~~
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# -------- Options ----------
set(OCPN_TEST_REPO
"alec-leamas/opencpn-plugins-unstable"
CACHE STRING "Default repository for untagged builds"
)
set(OCPN_BETA_REPO
"alec-leamas/opencpn-plugins-unstable"
CACHE STRING
"Default repository for tagged builds matching 'beta'"
)
set(OCPN_RELEASE_REPO
"alec-leamas/opencpn-plugins-stable"
CACHE STRING
"Default repository for tagged builds not matching 'beta'"
)
#
#
# ------- Plugin setup --------
#
set(PKG_NAME manual_pi)
set(PKG_VERSION 0.0.1)
set(PKG_PRERELEASE "") # Empty, or a tag like 'beta'
set(DISPLAY_NAME Manual) # Dialogs, installer artifacts, ...
set(PLUGIN_API_NAME manual) # As of GetCommonName() in plugin API
set(PKG_SUMMARY "Plugin and developer manual")
set(PKG_DESCRIPTION [=[
Off-line copies of the user, plugin and developer manuals
available at https://opencpn-manuals.github.io/main
This is a large download, currently around 170 Mb.
]=])
set(PKG_AUTHOR "Alec Leamas")
set(PKG_IS_OPEN_SOURCE "yes")
set(PKG_HOMEPAGE https://opencpn-manuals.github.io/main)
set(PKG_INFO_URL https://opencpn-manuals.github.io/main)
set(SRC
src/manual_pi.h
src/manual_pi.cpp
src/plug_utils.cpp
src/plug_utils.h
)
set(PKG_API_LIB api-18) # A dir in opencpn-libs/ e. g., api-17 or api-16
macro(late_init)
# Perform initialization after the PACKAGE_NAME library, compilers
# and ocpn::api is available.
add_subdirectory("${CMAKE_SOURCE_DIR}/libs/std_filesystem")
target_link_libraries(${PACKAGE_NAME} ocpn::filesystem)
if (UNIX AND NOT APPLE AND NOT QT_ANDROID)
# Linux. including Flatpak
install(DIRECTORY doc DESTINATION "share/opencpn/plugins/${PACKAGE_NAME}")
elseif (APPLE)
install(
DIRECTORY doc
DESTINATION "OpenCPN.app/Contents/SharedSupport/plugins/${PACKAGE_NAME}"
)
elseif (WIN32)
install(DIRECTORY doc DESTINATION "plugins/${PACKAGE_NAME}")
endif ()
if (APPLE) ## FIXME (leamas) This should go to the library
target_compile_definitions(${PACKAGE_NAME} PUBLIC OCPN_GHC_FILESYSTEM)
endif ()
endmacro ()
macro(add_plugin_libraries)
# Add libraries required by this plugin
endmacro ()