Skip to content

Commit 94f08b7

Browse files
author
rt-labs bot
committed
chore: catchup to c473e96
c473e96 Add publishing configuration d8d13ed Rename cmake project to COPEN 927784a Use separate build testing option 597d779 Add cmake user presets to ignore 8beefb2 Correct spelling in documentation 092ac92 Add build of c-open on jenkins Based-On-Commit: c473e962176e1fbe2793224a7720cd1535d33116 Change-Id: I49fe317be3be4d9f3123b5a514b09d918ac6e0f0
1 parent a05a8a7 commit 94f08b7

File tree

9 files changed

+161
-141
lines changed

9 files changed

+161
-141
lines changed

.github/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Evaluation version
2+
3+
This repository contains an evaluation version of **C-Open**, a CANopen
4+
stack for both master and slaves. It is especially well suited for
5+
embedded systems where resources are limited and efficiency is crucial.
6+
It is written in C and can be run on an RTOS such as rt-kernel, FreeRTOS,
7+
or on Linux.
8+
9+
It does not contain any ports and cannot be built without adding additional sources.
10+
11+
See:
12+
13+
- [Readme](../README.md) for more information on the complete version of the stack.
14+
- [Releases](https://github.com/rtlabs-com/c-open/releases) for binary downloads for common targets.
15+
- [Product](https://rt-labs.com/product/c-open/) for license information as well as complete documentation.
16+
17+
This version of C-Open can be used for evaluation purposes
18+
only. Contact <[email protected]> if you intend to use this stack in a
19+
product or if you need assistance during evaluation. The commercial
20+
version of this stack is supplied with full sources.

.github/workflows/build.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/codeql-analysis.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ build*/
33
*#
44
CMakeFiles/
55
CMakeCache.txt
6+
CMakeUserPresets.json
67
install
78
docs/_build
89

CMakeLists.txt

Lines changed: 39 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@
1616
cmake_minimum_required (VERSION 3.14)
1717
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
1818
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/tools")
19-
project (CANOPEN VERSION 0.1.0)
19+
project (COPEN VERSION 1.0.0)
2020

2121
# Default settings if this is the main project
22-
if (CMAKE_PROJECT_NAME STREQUAL CANOPEN)
22+
if (CMAKE_PROJECT_NAME STREQUAL COPEN)
2323
include(CTest)
2424

2525
# Make option visible in ccmake, cmake-gui
2626
option (BUILD_SHARED_LIBS "Build shared library" OFF)
27+
option (COPEN_BUILD_DOCS "Build documentation" ON)
2728

2829
# Default to release build with debug info
2930
if (NOT CMAKE_BUILD_TYPE)
@@ -34,7 +35,7 @@ if (CMAKE_PROJECT_NAME STREQUAL CANOPEN)
3435

3536
# Default to installing in build directory
3637
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
37-
set(CMAKE_INSTALL_PREFIX ${CANOPEN_BINARY_DIR}/install
38+
set(CMAKE_INSTALL_PREFIX ${COPEN_BINARY_DIR}/install
3839
CACHE PATH "Default install path" FORCE)
3940
endif()
4041

@@ -43,6 +44,7 @@ if (CMAKE_PROJECT_NAME STREQUAL CANOPEN)
4344
message(STATUS "Building for ${CMAKE_SYSTEM_NAME}")
4445
endif()
4546

47+
include(CMakeDependentOption)
4648
include(AddOsal)
4749
include(GenerateExportHeader)
4850
include(CMakeDependentOption)
@@ -115,103 +117,110 @@ set(CO_THREAD_PRIO "10"
115117
set(CO_THREAD_STACK_SIZE "4096"
116118
CACHE STRING "stack size of main thread")
117119

120+
cmake_dependent_option (COPEN_BUILD_TESTING
121+
"Build testing on ${PROJECT_NAME}" ON
122+
"BUILD_TESTING" OFF
123+
)
124+
118125
# Generate version numbers
119126
configure_file (
120127
version.h.in
121-
${CANOPEN_BINARY_DIR}/src/version.h
128+
${COPEN_BINARY_DIR}/src/version.h
122129
)
123130

124131
# Generate config options
125132
configure_file (
126133
co_options.h.in
127-
${CANOPEN_BINARY_DIR}/include/co_options.h
134+
${COPEN_BINARY_DIR}/include/co_options.h
128135
)
129136
configure_file (
130137
options.h.in
131-
${CANOPEN_BINARY_DIR}/src/options.h
138+
${COPEN_BINARY_DIR}/src/options.h
132139
)
133140

134141
# Add platform-dependent targets early, so they can be configured by
135142
# platform
136-
add_library(canopen "")
143+
add_library(copen "")
137144
add_executable (slave "")
138145
add_executable (slaveinfo "")
139146

140-
if (CMAKE_PROJECT_NAME STREQUAL CANOPEN AND BUILD_TESTING)
147+
if (COPEN_BUILD_TESTING)
141148
add_executable(co_test "")
142149
endif()
143150

144151
# Platform configuration
145152
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/${CMAKE_SYSTEM_NAME}.cmake)
146153

147-
generate_export_header(canopen
154+
generate_export_header(copen
148155
BASE_NAME co
149-
EXPORT_FILE_NAME ${CANOPEN_BINARY_DIR}/include/co_export.h
156+
EXPORT_FILE_NAME ${COPEN_BINARY_DIR}/include/co_export.h
150157
)
151158

152-
set_target_properties (canopen slave slaveinfo
159+
set_target_properties (copen slave slaveinfo
153160
PROPERTIES
154161
C_STANDARD 99
155162
)
156163

157-
target_compile_features(canopen PUBLIC c_std_99)
164+
target_compile_features(copen PUBLIC c_std_99)
158165

159-
target_include_directories(canopen
166+
target_include_directories(copen
160167
PUBLIC
161-
$<BUILD_INTERFACE:${CANOPEN_SOURCE_DIR}/include>
162-
$<BUILD_INTERFACE:${CANOPEN_BINARY_DIR}/include>
168+
$<BUILD_INTERFACE:${COPEN_SOURCE_DIR}/include>
169+
$<BUILD_INTERFACE:${COPEN_BINARY_DIR}/include>
163170
$<INSTALL_INTERFACE:include>
164171
PRIVATE
165-
${CANOPEN_BINARY_DIR}/src
172+
${COPEN_BINARY_DIR}/src
166173
src
167174
)
168175

169-
target_link_libraries(canopen PUBLIC osal)
176+
target_link_libraries(copen PUBLIC osal)
170177

171178
install (
172-
TARGETS canopen
173-
EXPORT CanOpenConfig
179+
TARGETS copen
180+
EXPORT COpenConfig
174181
DESTINATION lib
175182
)
176183

177184
install(
178-
EXPORT CanOpenConfig
185+
EXPORT COpenConfig
179186
DESTINATION cmake
180187
)
181188

182189
install (FILES
183190
include/co_api.h
184191
include/co_obj.h
185-
${CANOPEN_BINARY_DIR}/include/co_export.h
186-
${CANOPEN_BINARY_DIR}/include/co_options.h
192+
${COPEN_BINARY_DIR}/include/co_export.h
193+
${COPEN_BINARY_DIR}/include/co_options.h
187194
DESTINATION include
188195
)
189196

190197
add_subdirectory (src)
191198
add_subdirectory (util)
192199

193-
if (CMAKE_PROJECT_NAME STREQUAL CANOPEN AND BUILD_TESTING)
200+
if (COPEN_BUILD_TESTING)
194201
add_subdirectory (test)
195202
include(AddGoogleTest)
196203
add_gtest(co_test)
197204
endif()
198205

199-
if (CMAKE_PROJECT_NAME STREQUAL CANOPEN)
206+
if (COPEN_BUILD_DOCS)
200207
add_subdirectory(docs)
201208

202209
add_custom_target(codespell
203210
COMMAND codespell
204-
${CANOPEN_SOURCE_DIR}/include/
205-
${CANOPEN_SOURCE_DIR}/docs/
206-
${CANOPEN_SOURCE_DIR}/src/
207-
${CANOPEN_SOURCE_DIR}/test/
211+
${COPEN_SOURCE_DIR}/include/
212+
${COPEN_SOURCE_DIR}/docs/
213+
${COPEN_SOURCE_DIR}/src/
214+
${COPEN_SOURCE_DIR}/test/
208215
--skip *_build*
209216
COMMENT "Running spell check on source code"
210217
)
211218
endif()
212219

213220

214221
include (InstallRequiredSystemLibraries)
215-
set (CPACK_RESOURCE_FILE_LICENSE "${CANOPEN_SOURCE_DIR}/LICENSE.md")
216-
set (CPACK_PACKAGE_CONTACT [email protected])
222+
set (CPACK_RESOURCE_FILE_LICENSE "${COPEN_SOURCE_DIR}/LICENSE.md")
223+
set (CPACK_PACKAGE_CONTACT [email protected])
224+
set (CPACK_PACKAGE_NAME c-open)
225+
set (CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
217226
include (CPack)

CMakePresets.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"version": 6,
3+
"configurePresets": [
4+
{
5+
"name": "base",
6+
"hidden": true,
7+
"generator": "Ninja",
8+
"binaryDir": "build/${presetName}"
9+
},
10+
{
11+
"name": "linux",
12+
"inherits" : "base",
13+
"cacheVariables": {
14+
"COPEN_BUILD_TESTING": true
15+
}
16+
},
17+
{
18+
"name": "docs",
19+
"inherits" : "base",
20+
"cacheVariables": {
21+
"COPEN_BUILD_DOCS": true
22+
}
23+
}
24+
],
25+
"buildPresets": [
26+
{
27+
"name": "linux",
28+
"configurePreset": "linux"
29+
},
30+
{
31+
"name": "docs",
32+
"targets": ["sphinx-html", "sphinx-spelling", "codespell"],
33+
"configurePreset": "docs"
34+
}
35+
],
36+
"packagePresets": [
37+
{
38+
"name": "linux",
39+
"configurePreset": "linux",
40+
"generators": [
41+
"ZIP"
42+
]
43+
}
44+
],
45+
"testPresets": [
46+
{
47+
"name": "linux",
48+
"configurePreset": "linux",
49+
"output": {
50+
"outputOnFailure": true
51+
},
52+
"execution": {
53+
"noTestsAction": "error",
54+
"stopOnFailure": true
55+
}
56+
}
57+
]
58+
}

0 commit comments

Comments
 (0)