Skip to content

Commit 2aa64e3

Browse files
Project initial version (#1)
1 parent 1980919 commit 2aa64e3

36 files changed

+662
-340
lines changed

.clang-format

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
BasedOnStyle: Chromium
3+
AccessModifierOffset: -4
4+
AlignAfterOpenBracket: Align
5+
#AllowAllArgumentsOnNextLine: 'false'
6+
#AlignConsecutiveAssignments: None
7+
#AlignConsecutiveDeclarations: None
8+
AlignEscapedNewlines: Left
9+
AlignOperands: true
10+
AllowAllParametersOfDeclarationOnNextLine: true
11+
#AllowShortBlocksOnASingleLine: Never
12+
AllowShortCaseLabelsOnASingleLine: false
13+
AllowShortFunctionsOnASingleLine: None
14+
AllowShortIfStatementsOnASingleLine: false
15+
AllowShortLoopsOnASingleLine: false
16+
AlwaysBreakAfterReturnType: None
17+
AlwaysBreakBeforeMultilineStrings: false
18+
#AlwaysBreakTemplateDeclarations: Yes
19+
BinPackArguments: false
20+
BinPackParameters: false
21+
BreakBeforeBinaryOperators: None
22+
BreakBeforeBraces: Allman
23+
BreakBeforeTernaryOperators: true
24+
BreakConstructorInitializersBeforeComma: true
25+
ColumnLimit: 140
26+
CommentPragmas: '^ IWYU pragma:'
27+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
28+
ConstructorInitializerIndentWidth: 4
29+
ContinuationIndentWidth: 4
30+
IndentCaseLabels: true
31+
IndentWidth: 4
32+
KeepEmptyLinesAtTheStartOfBlocks: false
33+
Language: Cpp
34+
MaxEmptyLinesToKeep: 1
35+
NamespaceIndentation: All
36+
ObjCBlockIndentWidth: 4
37+
PenaltyBreakBeforeFirstCallParameter: 1
38+
PenaltyBreakComment: 300
39+
PenaltyBreakFirstLessLess: 120
40+
PenaltyBreakString: 1000
41+
PenaltyExcessCharacter: 1000000
42+
PenaltyReturnTypeOnItsOwnLine: 200
43+
PointerAlignment: Left
44+
#SortIncludes: Never
45+
SpaceAfterCStyleCast: true
46+
SpaceBeforeAssignmentOperators: true
47+
SpaceBeforeParens: ControlStatements
48+
SpacesBeforeTrailingComments: 2
49+
Standard: Auto
50+
TabWidth: 4
51+
UseTab: Never
52+
#NamespaceMacros:
53+
# - DECLARE_TEMPLATED_OPENDAQ_INTERFACE_T
54+
# - DECLARE_TEMPLATED_OPENDAQ_INTERFACE_T_U
55+
# - DECLARE_OPENDAQ_INTERFACE_EX
56+
# - DECLARE_OPENDAQ_INTERFACE
57+
FixNamespaceComments: false
58+
#MacroBlockBegin: "^BEGIN_NAMESPACE_OPENDAQ$"
59+
#MacroBlockEnd: "^END_NAMESPACE_OPENDAQ"
60+
#IndentPPDirectives: BeforeHash
61+
#SeparateDefinitionBlocks: Always
62+
...

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[{*.{cpp,h},CMakeLists.txt,*.rtclass,*.cmake,*.json}]
4+
indent_style = space
5+
indent_size = 4
6+
tab_size = 4
7+
insert_final_newline = true
8+
trim_trailing_whitespace = true
9+
10+
[*.yml]
11+
ident_style = space
12+
ident_size = 2
13+
tab_size = 2
14+
insert_final_newline = true
15+
trim_trailing_whitespace = true

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* text=auto
2+
*.[tT][xX][tT] text
3+
*.[sS][hH] text eol=lf

.github/workflows/ci.yml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: Build and Test
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, synchronize, ready_for_review]
6+
7+
jobs:
8+
build-and-test:
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
include:
13+
- os: ubuntu-latest
14+
generator: Ninja
15+
- os: windows-latest
16+
generator: "Visual Studio 17 2022"
17+
18+
runs-on: ${{ matrix.os }}
19+
20+
steps:
21+
- name: Install additional dependencies
22+
if: matrix.os == 'ubuntu-latest'
23+
run: |
24+
sudo apt-get install -y --no-install-recommends mono-runtime libmono-system-json-microsoft4.0-cil libmono-system-data4.0-cil
25+
26+
- name: Checkout project repo
27+
uses: actions/checkout@v4
28+
with:
29+
ref: ${{ github.event.inputs.branch || github.event.client_payload.branch || github.ref }}
30+
31+
- name: Configure project with CMake
32+
run: cmake -B build/output -S . -G "${{ matrix.generator }}" -DDAQMODULES_LT_STREAMING_ENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Release
33+
34+
- name: Build project with CMake
35+
run: cmake --build build/output --config Release
36+
37+
- name: Run project tests with CMake
38+
run: ctest --test-dir build/output --output-on-failure -C Release
39+
40+
install-build-and-test:
41+
strategy:
42+
fail-fast: false
43+
matrix:
44+
include:
45+
- os: ubuntu-latest
46+
generator: Ninja
47+
- os: windows-latest
48+
generator: "Visual Studio 17 2022"
49+
50+
runs-on: ${{ matrix.os }}
51+
env:
52+
INSTALL_PREFIX: ${{ github.workspace }}/opendaq_install
53+
54+
steps:
55+
- name: Install additional dependencies
56+
if: matrix.os == 'ubuntu-latest'
57+
run: |
58+
sudo apt-get install -y --no-install-recommends mono-runtime libmono-system-json-microsoft4.0-cil libmono-system-data4.0-cil
59+
60+
- name: Checkout module
61+
uses: actions/checkout@v4
62+
with:
63+
ref: ${{ github.event.inputs.branch || github.event.client_payload.branch || github.ref }}
64+
path: module
65+
66+
- name: Read openDAQ version
67+
shell: bash
68+
working-directory: module
69+
run: |
70+
opendaq_ref=$(cat opendaq_ref)
71+
echo "OPENDAQ_REF=$opendaq_ref" >> $GITHUB_ENV
72+
73+
- name: Checkout openDAQ
74+
uses: actions/checkout@v4
75+
with:
76+
repository: openDAQ/openDAQ
77+
ref: ${{ env.OPENDAQ_REF }}
78+
path: opendaq
79+
80+
- name: Configure, build and install openDAQ
81+
working-directory: opendaq
82+
run: |
83+
cmake -B build/output -S . -G "${{ matrix.generator }}" -DOPENDAQ_ENABLE_TESTS=OFF -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX="${{ env.INSTALL_PREFIX }}"
84+
cmake --build build/output --config Debug
85+
cmake --install build/output --config Debug
86+
87+
- name: Add DLL path (Windows only)
88+
if: matrix.os == 'windows-latest'
89+
run: echo "${{ env.INSTALL_PREFIX }}/lib" >> $env:GITHUB_PATH
90+
91+
- name: Configure project with CMake
92+
working-directory: module
93+
run: cmake -B build/output -S . -G "${{ matrix.generator }}" -DDAQMODULES_LT_STREAMING_ENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -DopenDAQ_DIR="${{ env.INSTALL_PREFIX }}/lib/cmake/opendaq/"
94+
95+
- name: Build project with CMake
96+
working-directory: module
97+
run: cmake --build build/output --config Debug
98+
99+
- name: Run project tests with CMake
100+
working-directory: module
101+
run: ctest --test-dir build/output --output-on-failure -C Debug

.gitignore

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# file types
2+
*.bin
3+
*.bak
4+
*.cache
5+
*.check_cache
6+
*.db
7+
*.dcu
8+
*.depend
9+
*.exp
10+
*.filters
11+
*.idb
12+
*.ilk
13+
*.list
14+
*.log
15+
*.obj
16+
*.orig
17+
*.pdb
18+
*.pyc
19+
*.rule
20+
*.rsm
21+
*.stamp
22+
*.stat
23+
*.suo
24+
*.tlog
25+
*.user
26+
27+
# IDE files
28+
.idea/
29+
.idea_/
30+
.vs/
31+
.vscode/
32+
__history/
33+
__recovery/
34+
__pycache__/
35+
36+
# build and backup folders
37+
/_build*
38+
/build*
39+
/build_win
40+
/cmake-build*
41+
/out*
42+
bckp
43+
44+
# cmake
45+
CMakeUserPresets.json
46+
CMakeSettings.json

CMakeLists.txt

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
set(CMAKE_POLICY_VERSION_MINIMUM 3.5)
2+
cmake_minimum_required(VERSION 3.25)
3+
4+
set(REPO_NAME LtStreamingModulesModern)
5+
set(REPO_OPTION_PREFIX DAQMODULES_LT_STREAMING)
6+
7+
list(APPEND CMAKE_MESSAGE_CONTEXT ${REPO_NAME})
8+
add_subdirectory(cmake)
9+
10+
opendaq_read_file_contents("${CMAKE_CURRENT_LIST_DIR}/module_version" module_version)
11+
opendaq_get_version_major_minor_patch("${module_version}" ${REPO_OPTION_PREFIX}_VERSION)
12+
13+
# 32-bit Linux cross-compilation setup (must be before any project())
14+
if (NOT DEFINED PROJECT_SOURCE_DIR AND OPENDAQ_FORCE_COMPILE_32BIT AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
15+
opendaq_32bit_build_linux_early_setup()
16+
endif()
17+
18+
project(${REPO_NAME} VERSION ${${REPO_OPTION_PREFIX}_VERSION} LANGUAGES CXX)
19+
20+
opendaq_common_early_setup()
21+
22+
if (PROJECT_IS_TOP_LEVEL)
23+
message(STATUS "Building ${REPO_NAME} version ${${REPO_OPTION_PREFIX}_VERSION} standalone")
24+
else()
25+
message(STATUS "Building ${REPO_NAME} version ${${REPO_OPTION_PREFIX}_VERSION} as submodule")
26+
endif()
27+
28+
# options
29+
opendaq_setup_common_build_options()
30+
opendaq_setup_project_specific_build_options(${REPO_OPTION_PREFIX})
31+
option(${REPO_OPTION_PREFIX}_ENABLE_EXAMPLE_APP "Enable ${REPO_NAME} example applications" ${PROJECT_IS_TOP_LEVEL})
32+
option(${REPO_OPTION_PREFIX}_ENABLE_TESTS "Enable ${REPO_NAME} testing" ${PROJECT_IS_TOP_LEVEL})
33+
option(${REPO_OPTION_PREFIX}_ENABLE_CLIENT "Enable ${REPO_NAME} client module" ${PROJECT_IS_TOP_LEVEL})
34+
option(${REPO_OPTION_PREFIX}_ENABLE_SERVER "Enable ${REPO_NAME} server module" ${PROJECT_IS_TOP_LEVEL})
35+
36+
opendaq_common_compile_targets_settings()
37+
opendaq_setup_compiler_flags(${REPO_OPTION_PREFIX})
38+
39+
if (${REPO_OPTION_PREFIX}_ENABLE_TESTS)
40+
message(STATUS "Unit tests in ${REPO_NAME} are ENABLED")
41+
enable_testing()
42+
else()
43+
message(STATUS "Unit tests in ${REPO_NAME} are DISABLED")
44+
endif()
45+
46+
include("${PROJECT_SOURCE_DIR}/external/boost/Boost.cmake")
47+
if (NOT TARGET "${OPENDAQ_SDK_TARGET_NAMESPACE}::${OPENDAQ_SDK_TARGET_NAME}")
48+
if (PROJECT_IS_TOP_LEVEL)
49+
find_package(${OPENDAQ_SDK_NAME} GLOBAL)
50+
endif()
51+
if (NOT ${OPENDAQ_SDK_NAME}_FOUND)
52+
include(FetchContent)
53+
set(OPENDAQ_ENABLE_TESTS OFF CACHE BOOL "")
54+
55+
opendaq_read_file_contents("${CMAKE_CURRENT_LIST_DIR}/opendaq_ref" OPENDAQ_REF)
56+
opendaq_get_custom_fetch_content_params(${OPENDAQ_SDK_NAME} FC_PARAMS)
57+
58+
FetchContent_Declare(
59+
${OPENDAQ_SDK_NAME}
60+
GIT_REPOSITORY https://github.com/openDAQ/openDAQ.git
61+
GIT_TAG ${OPENDAQ_REF}
62+
GIT_PROGRESS ON
63+
${FC_PARAMS}
64+
)
65+
FetchContent_MakeAvailable(${OPENDAQ_SDK_NAME})
66+
else()
67+
message(STATUS "Found installed ${OPENDAQ_SDK_NAME} version: ${${OPENDAQ_SDK_NAME}_VERSION}")
68+
endif()
69+
endif()
70+
add_subdirectory(external/boost)
71+
72+
add_subdirectory(external)
73+
add_subdirectory(shared)
74+
add_subdirectory(modules)
75+

0 commit comments

Comments
 (0)