-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
186 lines (140 loc) · 5.92 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
################################################################################
#
# (c) 2020 Copyright, Real-Time Innovations, Inc. (RTI)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################
cmake_minimum_required(VERSION 3.9)
################################################################################
project(nano-client
LANGUAGES C
VERSION 0.1.0
DESCRIPTION "An XRCE Client API")
################################################################################
if(NOT TARGET nano::nanocore)
add_subdirectory(core)
endif()
################################################################################
include(core/resource/cmake/nano-build.cmake)
################################################################################
set(EXAMPLES sensor
shape)
set(PREFIX_PATH ${PROJECT_BINARY_DIR}/core)
set(AUTHOR "Real-Time Innovations")
set(COPYRIGHT "2020, Real-Time Innovations, Inc.")
set(GIT_REPO "https://github.com/rticommunity/nano-client.git")
set(LICENSE "Apache-2.0")
################################################################################
nano_project()
################################################################################
nano_project_option(
ENABLE_EXAMPLES
"Enable Examples"
OFF
"build the included examples")
nano_project_option(
ENABLE_TRANSPORT_ALL
"All Transport Plugins"
ON
"build all of the included transport plugins")
nano_project_option(
ENABLE_TRANSPORT_UDPV4
"UDPv4 Transport Plugins"
${${PROJECT_NAME}_ENABLE_TRANSPORT_ALL}
"build the included UDPv4 transport plugin")
nano_project_option(
ENABLE_TRANSPORT_SERIAL
"Serial Transport Plugins"
${${PROJECT_NAME}_ENABLE_TRANSPORT_ALL}
"build the included Serial transport plugin")
################################################################################
# "client" component
################################################################################
set(NANO_CLIENT_INCLUDE_FILES_PUBLIC
include/nano/nano_client.h
include/nano/nano_client_config.h)
set(NANO_CLIENT_SOURCE_FILES
src/Client.c)
set(NANO_CLIENT_LIBS nano::nanocore)
set(NANO_CLIENT_LIBRARY client)
nano_component(NANO_CLIENT)
# Unset these variables so that they may be picked up from the cache
unset(NANO_CLIENT_INCLUDE_FILES_PUBLIC)
nano_component_library(NANO_CLIENT)
nano_component_install(NANO_CLIENT)
################################################################################
# "clientudpv4" component
################################################################################
set(NANO_CLIENT_UDPV4_INCLUDE_FILES_PUBLIC
include/nano/nano_client_udpv4.h)
set(NANO_CLIENT_UDPV4_SOURCE_FILES
src/ClientUdp.c)
set(NANO_CLIENT_UDPV4_LIBS nano::nanoclient
nano::nanotransportudpv4)
set(NANO_CLIENT_UDPV4_LIBRARY clientudpv4)
if (${PROJECT_NAME}_ENABLE_TRANSPORT_UDPV4)
nano_component(NANO_CLIENT_UDPV4)
nano_component_library(NANO_CLIENT_UDPV4)
nano_component_install(NANO_CLIENT_UDPV4)
# Unset these variables so that they may be picked up from the cache
unset(NANO_CLIENT_UDPV4_INCLUDE_FILES_PUBLIC)
endif()
################################################################################
# "clientserial" component
################################################################################
set(NANO_CLIENT_SERIAL_INCLUDE_FILES_PUBLIC
include/nano/nano_client_serial.h)
set(NANO_CLIENT_SERIAL_SOURCE_FILES
src/ClientSerial.c)
set(NANO_CLIENT_SERIAL_LIBS nano::nanoclient
nano::nanotransportserial)
set(NANO_CLIENT_SERIAL_LIBRARY clientserial)
if (${PROJECT_NAME}_ENABLE_TRANSPORT_SERIAL)
nano_component(NANO_CLIENT_SERIAL)
nano_component_library(NANO_CLIENT_SERIAL)
nano_component_install(NANO_CLIENT_SERIAL)
# Unset these variables so that they may be picked up from the cache
unset(NANO_CLIENT_SERIAL_INCLUDE_FILES_PUBLIC)
endif()
################################################################################
if (${PROJECT_NAME}_BUILD_DOCS)
set(DOC_INPUT_DIRS ${PROJECT_SOURCE_DIR}/include/
${PROJECT_SOURCE_DIR}/core/include)
set(DOC_INPUT_SRC ${NANO_CLIENT_INCLUDE_FILES_PUBLIC}
${NANO_CORE_INCLUDE_FILES_PUBLIC}
${NANO_TRANSPORT_UDPV4_INCLUDE_FILES_PUBLIC}
${NANO_TRANSPORT_SERIAL_INCLUDE_FILES_PUBLIC})
set(DOC_SOURCES index.rst
installation.rst
building.rst
xrce.rst
api_manual.rst
platform.rst
transport.rst
vars.rst
api_ref.rst
api_ref_c.rst
api_ref_cpp.rst
api_ref_arduino.rst)
# set(DOC_ROOT_INDEX index.html)
nano_project_docs()
endif()
################################################################################
nano_project_install()
################################################################################
if(${PROJECT_NAME}_ENABLE_EXAMPLES)
nano_project_examples()
endif()
################################################################################
nano_project_summary()