Skip to content

Commit

Permalink
Combined both binary format codes into one rep.
Browse files Browse the repository at this point in the history
  • Loading branch information
hhawley committed Mar 18, 2024
0 parents commit 9578c07
Show file tree
Hide file tree
Showing 19 changed files with 1,848 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# SBCBinaryFormat

Here you will find all the code required to build and read a SBC binary format.

Languages supported:

* C++
* Python
35 changes: 35 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
cmake_minimum_required(VERSION 3.14...3.22)

# ---- Project ----

# Note: update this to your new project's name and version
project(
SBCBinaryFormat
VERSION 0.5.0
LANGUAGES CXX C
)

option(SBC_BINARY_FORMAT_TESTS "Enable" OFF)

# Note: globbing sources is considered bad practice as CMake's generators may not detect new files
# automatically. Keep that in mind when changing files, or explicitly mention them here.
file(GLOB_RECURSE headers CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/include/*.h")

# ---- Create library ----

# Note: for header-only libraries change all PUBLIC flags to INTERFACE and create an interface
# target: add_library(${PROJECT_NAME} INTERFACE)
add_library(${PROJECT_NAME} ${headers} INTERFACE)

target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_20)
#set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 20)

target_include_directories(
${PROJECT_NAME} INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
)

add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})

if(SBC_BINARY_FORMAT_TESTS)
add_subdirectory(test)
endif()
24 changes: 24 additions & 0 deletions cpp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# C++ SBC Binary Format driver

A header-only library for the SBC binary format.

To install this library, there are two options:

1. Copy everything inside the "include" folder into your project include folder.
Done!
2. Clone this github repository anywhere in your project and in your
"CMakeLists.txt" add a line called `add_subdirectory
(LOCATION_OF_THIS_LIBRARY)`. Then, in `target_link_libraries` add
`RedDigitizer++::RedDigitizer++`. Done!

# Examples

There are tests (or examples) inside "test/source/basic_test.cpp" that can be compiled to test the library works. Its original intent is to make sure the code can compile in your computer and actually run with little to no bugs.

It uses a library called doctest, so it has some code that might look unusual.

# TODO:

* Better examples.
* Complete tests.
* Bug hunt, are there bugs?
Loading

0 comments on commit 9578c07

Please sign in to comment.