Skip to content

Commit 6bf8842

Browse files
author
nikolai.shipilov
committed
Add missing project files
* remove dependency on mocks and signal generator * add missing link to gtest lib * fix variable names in cmake * remove useless tests
1 parent 84fe73a commit 6bf8842

32 files changed

+939
-325
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: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
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+
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
include:
14+
- os: ubuntu-latest
15+
generator: Ninja
16+
17+
- os: windows-latest
18+
generator: "Visual Studio 17 2022"
19+
20+
runs-on: ${{ matrix.os }}
21+
22+
steps:
23+
- name: Install additional dependencies
24+
if: matrix.os == 'ubuntu-latest'
25+
run: |
26+
sudo apt-get install -y --no-install-recommends mono-runtime libmono-system-json-microsoft4.0-cil libmono-system-data4.0-cil
27+
28+
- name: Checkout project repo
29+
uses: actions/checkout@v4
30+
with:
31+
ref: ${{ github.event.inputs.branch || github.event.client_payload.branch || github.ref }}
32+
33+
- name: Configure project with CMake
34+
run: cmake -B build/output -S . -G "${{ matrix.generator }}" -DLT_STREAMING_MODULES_ENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Debug
35+
36+
- name: Build project with CMake
37+
run: cmake --build build/output --config Debug
38+
39+
- name: Run project tests with CMake
40+
run: ctest --test-dir build/output --output-on-failure -C Debug
41+
42+
install-build-and-test:
43+
44+
strategy:
45+
fail-fast: false
46+
matrix:
47+
include:
48+
- os: ubuntu-latest
49+
generator: Ninja
50+
51+
- os: windows-latest
52+
generator: "Visual Studio 17 2022"
53+
54+
runs-on: ${{ matrix.os }}
55+
env:
56+
INSTALL_PREFIX: ${{ runner.temp }}/opendaq_install
57+
58+
steps:
59+
- name: Install additional dependencies
60+
if: matrix.os == 'ubuntu-latest'
61+
run: |
62+
sudo apt-get install -y --no-install-recommends mono-runtime libmono-system-json-microsoft4.0-cil libmono-system-data4.0-cil
63+
64+
- name: Setup working directories
65+
run: |
66+
mkdir opendaq
67+
mkdir module
68+
69+
- name: Checkout openDAQ
70+
uses: actions/checkout@v4
71+
with:
72+
repository: openDAQ/openDAQ
73+
ref: other/module-extract-prep
74+
path: opendaq
75+
76+
- name: Configure, build and install openDAQ
77+
working-directory: opendaq
78+
run: |
79+
cmake -B build/output -S . -G "${{ matrix.generator }}" -DOPENDAQ_ENABLE_TESTS=OFF -DCMAKE_BUILD_TYPE=Release
80+
cmake --build build/output --config Release
81+
cmake --install build/output --config Release --prefix "${{ env.INSTALL_PREFIX }}"
82+
83+
- name: Add DLL path (Windows only)
84+
if: matrix.os == 'windows-latest'
85+
run: |
86+
echo "${{ env.INSTALL_PREFIX }}\\bin" >> $env:GITHUB_PATH
87+
88+
- name: Configure project with CMake
89+
working-directory: module
90+
run: cmake -B build/output -S . -G "${{ matrix.generator }}" -DLT_STREAMING_MODULES_ENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="${{ env.INSTALL_PREFIX }}"
91+
92+
- name: Build project with CMake
93+
working-directory: module
94+
run: cmake --build build/output --config Release
95+
96+
- name: Run project tests with CMake
97+
working-directory: module
98+
run: ctest --test-dir build/output --output-on-failure -C Release

.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: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
set(CMAKE_POLICY_VERSION_MINIMUM 3.5)
2+
cmake_minimum_required(VERSION 3.25)
3+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
4+
5+
# set project variables
6+
set(REPO_NAME lt_streaming_modules)
7+
set(REPO_OPTION_PREFIX LT_STREAMING_MODULES)
8+
9+
file(READ "repo_version" repo_version)
10+
string(STRIP ${repo_version} repo_version)
11+
string(REGEX REPLACE "^([0-9]+\\.[0-9]+\\.[0-9]+).*" "\\1" repo_version_major_minor_patch "${repo_version}")
12+
set(REPO_VERSION "${repo_version_major_minor_patch}")
13+
14+
project(${REPO_NAME}
15+
LANGUAGES CXX
16+
VERSION ${REPO_VERSION}
17+
)
18+
19+
# set SDK variables
20+
set(OPENDAQ_SDK_NAME openDAQ)
21+
set(OPENDAQ_SDK_TARGET_NAME opendaq)
22+
set(OPENDAQ_SDK_TARGET_NAMESPACE daq)
23+
24+
file(READ "opendaq_version" sdk_version)
25+
string(STRIP ${sdk_version} sdk_version)
26+
string(REGEX REPLACE "^([0-9]+\\.[0-9]+\\.[0-9]+).*" "\\1" sdk_version_major_minor_patch "${sdk_version}")
27+
set(OPENDAQ_SDK_VERSION "${sdk_version_major_minor_patch}")
28+
29+
list(APPEND CMAKE_MESSAGE_CONTEXT ${REPO_NAME})
30+
set(CMAKE_MESSAGE_CONTEXT_SHOW ON CACHE BOOL "Show CMake message context")
31+
32+
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
33+
34+
get_filename_component(ROOT_DIR ${CMAKE_SOURCE_DIR} REALPATH)
35+
set(FETCHCONTENT_EXTERNALS_DIR ${ROOT_DIR}/build/__external CACHE PATH "FetchContent folder prefix")
36+
37+
add_definitions(-DFMT_HEADER_ONLY)
38+
39+
# options
40+
option(${REPO_OPTION_PREFIX}_EXAMPLE_ENABLE_APP "Enable building example application" OFF)
41+
option(${REPO_OPTION_PREFIX}_ENABLE_TESTS "Enable tests" OFF)
42+
43+
# Runtime and default 3rd party library linking options
44+
option(${REPO_OPTION_PREFIX}_LINK_RUNTIME_STATICALLY "Link the C++ runtime staticaly (embedd it)" OFF)
45+
option(${REPO_OPTION_PREFIX}_LINK_3RD_PARTY_LIBS_STATICALY "Link the 3rd party libraries staticaly (embedd it)" ON)
46+
47+
include(CommonUtils)
48+
setup_repo(${REPO_OPTION_PREFIX})
49+
50+
if (${REPO_OPTION_PREFIX}_ENABLE_TESTS)
51+
message(STATUS "Unit tests are ENABLED")
52+
enable_testing()
53+
endif()
54+
55+
add_subdirectory(external)
56+
add_subdirectory(shared)
57+
add_subdirectory(modules)
58+
if (${REPO_OPTION_PREFIX}_ENABLE_TESTS)
59+
# add_subdirectory(tests)
60+
endif()
61+
if (${REPO_OPTION_PREFIX}_EXAMPLE_ENABLE_APP)
62+
# add_subdirectory(examples)
63+
endif()
64+
#add_subdirectory(docs) # FIXME no docs infrastructure to be handled by cmake

0 commit comments

Comments
 (0)