Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 11 additions & 10 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@ BasedOnStyle: Google
# "int& foo" for this project:
DerivePointerAlignment: false
PointerAlignment: Left
ColumnLimit: 120

# Rules for includes
# IncludeBlocks: IBS_Regroup # Requires clang-format 6.0+
# Ordering of includes, higher priority lower in list
IncludeCategories:
- Regex: '^\"unit/'
Priority: 5999
- Regex: '^\"'
Priority: 4000
- Regex: '^<.*/.*'
Priority: 2000
- Regex: '^<[^\/.]*>'
Priority: 1000
- Regex: '^<.*.h>'
Priority: 500
- Regex: '^\"unit/'
Priority: 5999
- Regex: '^\"'
Priority: 4000
- Regex: "^<.*/.*"
Priority: 2000
- Regex: '^<[^\/.]*>'
Priority: 1000
- Regex: "^<.*.h>"
Priority: 500
5 changes: 1 addition & 4 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# -readability-function-cognitive-complexity disallows large functions
# -readability-identifier-length allows short variable names
# To be corrected:
Checks: '-*, bugprone-*, clang-*, google-readability-*, misc-*, modernize-*, readability-*, performance-*, -clang-analyzer-cplusplus*, -google-readability-namespace-comments, -bugprone-easily-swappable-parameters, -bugprone-suspicious-include, -readability-function-cognitive-complexity, -readability-identifier-length, -modernize-use-trailing-return-type'
Checks: '-*, bugprone-*, clang-*, google-readability-*, misc-*, modernize-*, readability-*, performance-*, -clang-analyzer-cplusplus*, -readability-identifier-naming, -google-readability-namespace-comments, -bugprone-easily-swappable-parameters, -bugprone-suspicious-include, -readability-function-cognitive-complexity, -readability-identifier-length, -modernize-use-trailing-return-type'
# Most warnings should be errors
WarningsAsErrors: 'bugprone-*, clang-*, google-*, misc-*, modernize-*, readability-*, performance-*'
# Overall format style, Google Style Guide w/ extra restrictions
Expand All @@ -18,7 +18,6 @@ CheckOptions:
- { key: readability-identifier-naming.ClassCase, value: CamelCase }
- { key: readability-identifier-naming.StructCase, value: CamelCase }
- { key: readability-identifier-naming.TemplateParameterCase, value: CamelCase }
- { key: readability-identifier-naming.FunctionCase, value: CamelCase }
- { key: readability-identifier-naming.NamespaceCase, value: lower_case }
- { key: readability-identifier-naming.VariableCase, value: lower_case }
- { key: readability-identifier-naming.LocalConstantCase, value: lower_case }
Expand All @@ -33,8 +32,6 @@ CheckOptions:
- { key: readability-identifier-naming.ProtectedMemberCase, value: lower_case }
- { key: readability-identifier-naming.ConstexprVariableCase, value: CamelCase }
- { key: readability-identifier-naming.ConstexprVariablePrefix, value: k }
- { key: readability-identifier-naming.EnumConstantCase, value: CamelCase }
- { key: readability-identifier-naming.EnumConstantPrefix, value: k }
- { key: readability-identifier-naming.MemberConstantCase, value: CamelCase }
- { key: readability-identifier-naming.MemberConstantPrefix, value: k }
- { key: readability-identifier-naming.StaticConstantCase, value: CamelCase }
Expand Down
64 changes: 25 additions & 39 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,52 +1,38 @@
cmake_minimum_required(VERSION 3.22)

project(libsersi
VERSION 0.1.0
if(NOT PROJECT_NAME)
set(PROJECT_NAME sersi)
endif()

if(NOT PROJECT_VERSION)
set(PROJECT_VERSION 0.2.0)
endif()

project(${PROJECT_NAME}
VERSION ${PROJECT_VERSION}
DESCRIPTION "IEEE 1278.1-2012 Distributed Interactive Simulation library"
LANGUAGES CXX
)

include(${CMAKE_SOURCE_DIR}/cmake/libsersi-api.cmake)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

libsersi_project_defaults()
# Export compile commands
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# Define library
add_library(sersi "")
# Add CXX build flags for robust warning and error checking during compilation
if (NOT MSVC)
add_compile_options(-Wall -Wextra -pedantic -Werror)
endif()

# Add src/ to the include directories to libsersi
target_include_directories(sersi
PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:${INSTALL_INCLUDE_DIR}>
)
target_include_directories(sersi SYSTEM
PUBLIC $<BUILD_INTERFACE:${PROJECT_BINARY_DIR/src}>
$<INSTALL_INTERFACE:${INSTALL_INCLUDE_DIR}>
PRIVATE $<BUILD_INTERFACE:${CMRC_INCLUDE_DIR}>
)
include(GNUInstallDirs)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR})

# Add source directories
add_subdirectory(include)
add_subdirectory(src)

# Configure install target (i.e. what files to install)
install(TARGETS sersi
EXPORT libsersi-targets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(EXPORT libsersi-targets
NAMESPACE libsersi::
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/libsersi")

# Add cmake configuration
add_subdirectory(cmake)

# configure package target (i.e. Package Types, and meta data)
set(CPACK_GENERATOR "DEB" "RPM" "TXZ" "TGZ")
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
set(CPACK_PACKAGE_NAME "libsersi")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The libsersi library")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}.${CMAKE_SYSTEM_PROCESSOR}")
set(CPACK_PACKAGE_RPM_DIR "${CMAKE_CURRENT_BINARY_DIR}/_CPack_Packages/Linux/RPM")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Cameron Howell <jango.djarin@proton.me>")
set(CPACK_PACKAGE_PACKAGER $ENV{USER})
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The libsersi library")
include(CPack)
9 changes: 9 additions & 0 deletions CMakeUserPresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"version": 4,
"vendor": {
"conan": {}
},
"include": [
"build/CMakePresets.json"
]
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 2-Clause License

Copyright (c) 2024, Cameron
Copyright (c) 2026, Cameron

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Expand Down
35 changes: 29 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
width="0px"
/>
libsersi</br>
(IEEE 1278.1a-1998)
(IEEE 1278.1-2012)
<img
src="https://raw.githubusercontent.com/catppuccin/catppuccin/main/assets/misc/transparent.png"
height="30"
Expand Down Expand Up @@ -42,44 +42,67 @@
<a href="#">
<img
alt="Maintained"
src="https://img.shields.io/maintenance/yes/2024?style=for-the-badge&color=98971a&labelColor=282a36"
src="https://img.shields.io/maintenance/yes/2026?style=for-the-badge&color=98971a&labelColor=282a36"
/>
</a>
</p>

&nbsp;

## 💭 About
C++ implementation of the IEEE 1278.1a-1998 Distributed Interactive Simulation (DIS) application protocol. This library was implemented according to the IEEE Std 1278.1a-1998 publication. The name `libsersi` is derived from the words "*ser*ialize" and "*si*mulation".

C++ implementation of the IEEE 1278.1-2012 Distributed Interactive Simulation (DIS) application protocol. This library was implemented according to the IEEE Std 1278.1-2012 publication. The name `libsersi` is derived from the words "*ser*ialize" and "*si*mulation".

## 📕 Documentation

Will add Doxygen documentation in a future patch.

## 🔰 Getting Started

This library can be manually built and installed with CMake and make tools, or it can be imported
from the Conan Center.

### Building from Source

#### With CMake

To build from source, CMake 3.22+ is required. On Linux, run the following commands to build and install:

```bash
mkdir build
cd build
cmake ..
make
```

To build Linux package files, run

```bash
make package
```

To install the library into your `CMAKE_INSTALL_PREFIX`, run

```
make install
```

### Importing with Conan
Conan 2.x is required to import this library.
#### With Conan

To build the library with Conan:

```bash
conan build . -of build --build=missing
```

To create the Conan package from source:

```bash
conan create .
```

<p align="center">
Copyright &copy; 2024-present
Copyright &copy; 2026
<a href="https://github.com/crhowell3" target="_blank">Cameron Howell</a>
</p>
<p align="center">
Expand Down
45 changes: 0 additions & 45 deletions cmake/CMakeLists.txt

This file was deleted.

Loading
Loading