Compare commits

..

5 Commits

11 changed files with 487 additions and 0 deletions

321
.clang-tidy Normal file
View File

@ -0,0 +1,321 @@
---
Checks: '-*,
bugprone-*,
clang-analyzer-*,
cppcoreguidelines-*,
google-*,
llvm-*,
misc-*,
modernize-*,
readability-*,
performance-*,
portability-*,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-readability-magic-numbers,
-readability-else-after-return,
-modernize-use-trailing-return-type,
-modernize-avoid-c-arrays,
-performance-no-automatic-move,
'
CheckOptions:
- key: readability-identifier-naming.AbstractClassCase
value: CamelCase
- key: readability-identifier-naming.AbstractClassPrefix
value: ''
- key: readability-identifier-naming.AbstractClassSuffix
value: ''
- key: readability-identifier-naming.ClassCase
value: CamelCase
- key: readability-identifier-naming.ClassPrefix
value: ''
- key: readability-identifier-naming.ClassSuffix
value: ''
- key: readability-identifier-naming.ClassConstantCase
value: CamelCase
- key: readability-identifier-naming.ClassConstantPrefix
value: 'k_'
- key: readability-identifier-naming.ClassConstantSuffix
value: ''
- key: readability-identifier-naming.ClassMemberCase
value: camelBack
- key: readability-identifier-naming.ClassMemberPrefix
value: ''
- key: readability-identifier-naming.ClassMemberSuffix
value: ''
- key: readability-identifier-naming.ClassMethodCase
value: camelBack
- key: readability-identifier-naming.ClassMethodPrefix
value: ''
- key: readability-identifier-naming.ClassMethodSuffix
value: ''
- key: readability-identifier-naming.ConstantCase
value: CamelCase
- key: readability-identifier-naming.ConstantPrefix
value: 'k_'
- key: readability-identifier-naming.ConstantSuffix
value: POST
- key: readability-identifier-naming.ConstantMemberCase
value: 'lower_case'
- key: readability-identifier-naming.ConstantMemberPrefix
value: ''
- key: readability-identifier-naming.ConstantMemberSuffix
value: ''
- key: readability-identifier-naming.ConstantParameterCase
value: camelBack
- key: readability-identifier-naming.ConstantParameterPrefix
value: ''
- key: readability-identifier-naming.ConstantParameterSuffix
value: ''
- key: readability-identifier-naming.ConstantPointerParameterCase
value: camelBack
- key: readability-identifier-naming.ConstantPointerParameterPrefix
value: ''
- key: readability-identifier-naming.ConstantPointerParameterSuffix
value: ''
- key: readability-identifier-naming.ConstexprFunctionCase
value: camelBack
- key: readability-identifier-naming.ConstexprFunctionPrefix
value: ''
- key: readability-identifier-naming.ConstexprFunctionSuffix
value: ''
- key: readability-identifier-naming.ConstexprMethodCase
value: camelBack
- key: readability-identifier-naming.ConstexprMethodPrefix
value: ''
- key: readability-identifier-naming.ConstexprMethodSuffix
value: ''
- key: readability-identifier-naming.ConstexprVariableCase
value: lower_case
- key: readability-identifier-naming.ConstexprVariablePrefix
value: ''
- key: readability-identifier-naming.ConstexprVariableSuffix
value: ''
- key: readability-identifier-naming.EnumCase
value: CamelCase
- key: readability-identifier-naming.EnumPrefix
value: ''
- key: readability-identifier-naming.EnumSuffix
value: ''
- key: readability-identifier-naming.EnumConstantCase
value: CamelCase
- key: readability-identifier-naming.EnumConstantPrefix
value: 'k_'
- key: readability-identifier-naming.EnumConstantSuffix
value: ''
- key: readability-identifier-naming.FunctionCase
value: camelBack
- key: readability-identifier-naming.FunctionPrefix
value: ''
- key: readability-identifier-naming.FunctionSuffix
value: ''
- key: readability-identifier-naming.GlobalConstantCase
value: CamelCase
- key: readability-identifier-naming.GlobalConstantPrefix
value: 'k_'
- key: readability-identifier-naming.GlobalConstantSuffix
value: ''
- key: readability-identifier-naming.GlobalConstantPointerCase
value: lower_case
- key: readability-identifier-naming.GlobalConstantPointerPrefix
value: ''
- key: readability-identifier-naming.GlobalConstantPointerSuffix
value: ''
- key: readability-identifier-naming.GlobalFunctionCase
value: lower_case
- key: readability-identifier-naming.GlobalFunctionPrefix
value: ''
- key: readability-identifier-naming.GlobalFunctionSuffix
value: ''
- key: readability-identifier-naming.GlobalPointerCase
value: lower_case
- key: readability-identifier-naming.GlobalPointerPrefix
value: ''
- key: readability-identifier-naming.GlobalPointerSuffix
value: ''
- key: readability-identifier-naming.GlobalVariableCase
value: lower_case
- key: readability-identifier-naming.GlobalVariablePrefix
value: ''
- key: readability-identifier-naming.GlobalVariableSuffix
value: ''
- key: readability-identifier-naming.IgnoreMainLikeFunctions
value: 1
- key: readability-identifier-naming.InlineNamespaceCase
value: lower_case
- key: readability-identifier-naming.InlineNamespacePrefix
value: ''
- key: readability-identifier-naming.InlineNamespaceSuffix
value: ''
- key: readability-identifier-naming.LocalConstantCase
value: camelBack
- key: readability-identifier-naming.LocalConstantPrefix
value: 'k_'
- key: readability-identifier-naming.LocalConstantSuffix
value: ''
- key: readability-identifier-naming.LocalConstantPointerCase
value: camelBack
- key: readability-identifier-naming.LocalConstantPointerPrefix
value: ''
- key: readability-identifier-naming.LocalConstantPointerSuffix
value: ''
- key: readability-identifier-naming.LocalPointerCase
value: camelBack
- key: readability-identifier-naming.LocalPointerPrefix
value: ''
- key: readability-identifier-naming.LocalPointerSuffix
value: ''
- key: readability-identifier-naming.LocalVariableCase
value: camelBack
- key: readability-identifier-naming.LocalVariablePrefix
value: ''
- key: readability-identifier-naming.LocalVariableSuffix
value: ''
- key: readability-identifier-naming.MemberCase
value: UPPER_CASE
- key: readability-identifier-naming.MemberPrefix
value: PRE
- key: readability-identifier-naming.MemberSuffix
value: POST
- key: readability-identifier-naming.MethodCase
value: UPPER_CASE
- key: readability-identifier-naming.MethodPrefix
value: PRE
- key: readability-identifier-naming.MethodSuffix
value: POST
- key: readability-identifier-naming.NamespaceCase
value: lower_case
- key: readability-identifier-naming.NamespacePrefix
value: ''
- key: readability-identifier-naming.NamespaceSuffix
value: ''
- key: readability-identifier-naming.ParameterCase
value: camelBack
- key: readability-identifier-naming.ParameterPrefix
value: ''
- key: readability-identifier-naming.ParameterSuffix
value: ''
- key: readability-identifier-naming.ParameterPackCase
value: camelBack
- key: readability-identifier-naming.ParameterPackPrefix
value: ''
- key: readability-identifier-naming.ParameterPackSuffix
value: ''
- key: readability-identifier-naming.PointerParameterCase
value: camelBack
- key: readability-identifier-naming.PointerParameterPrefix
value: ''
- key: readability-identifier-naming.PointerParameterSuffix
value: ''
- key: readability-identifier-naming.PrivateMemberCase
value: camelBack
- key: readability-identifier-naming.PrivateMemberPrefix
value: 'm_'
- key: readability-identifier-naming.PrivateMemberSuffix
value: ''
- key: readability-identifier-naming.PrivateMethodCase
value: camelBack
- key: readability-identifier-naming.PrivateMethodPrefix
value: ''
- key: readability-identifier-naming.PrivateMethodSuffix
value: ''
- key: readability-identifier-naming.ProtectedMemberCase
value: camelBack
- key: readability-identifier-naming.ProtectedMemberPrefix
value: ''
- key: readability-identifier-naming.ProtectedMemberSuffix
value: ''
- key: readability-identifier-naming.ProtectedMethodCase
value: camelBack
- key: readability-identifier-naming.ProtectedMethodPrefix
value: ''
- key: readability-identifier-naming.ProtectedMethodSuffix
value: ''
- key: readability-identifier-naming.PublicMemberCase
value: camelBack
- key: readability-identifier-naming.PublicMemberPrefix
value: ''
- key: readability-identifier-naming.PublicMemberSuffix
value: ''
- key: readability-identifier-naming.PublicMethodCase
value: camelBack
- key: readability-identifier-naming.PublicMethodPrefix
value: ''
- key: readability-identifier-naming.PublicMethodSuffix
value: ''
- key: readability-identifier-naming.StaticConstantCase
value: camelBack
- key: readability-identifier-naming.StaticConstantPrefix
value: 'k_'
- key: readability-identifier-naming.StaticConstantSuffix
value: ''
- key: readability-identifier-naming.StaticVariableCase
value: camelBack
- key: readability-identifier-naming.StaticVariablePrefix
value: ''
- key: readability-identifier-naming.StaticVariableSuffix
value: ''
- key: readability-identifier-naming.StructCase
value: CamelCase
- key: readability-identifier-naming.StructPrefix
value: ''
- key: readability-identifier-naming.StructSuffix
value: ''
- key: readability-identifier-naming.TemplateParameterCase
value: camelBack
- key: readability-identifier-naming.TemplateParameterPrefix
value: ''
- key: readability-identifier-naming.TemplateParameterSuffix
value: ''
- key: readability-identifier-naming.TemplateTemplateParameterCase
value: camelBack
- key: readability-identifier-naming.TemplateTemplateParameterPrefix
value: ''
- key: readability-identifier-naming.TemplateTemplateParameterSuffix
value: ''
- key: readability-identifier-naming.TypeAliasCase
value: CamelCase
- key: readability-identifier-naming.TypeAliasPrefix
value: ''
- key: readability-identifier-naming.TypeAliasSuffix
value: ''
- key: readability-identifier-naming.TypedefCase
value: lower_case
- key: readability-identifier-naming.TypedefPrefix
value: ''
- key: readability-identifier-naming.TypedefSuffix
value: ''
- key: readability-identifier-naming.TypeTemplateParameterCase
value: CamelCase
- key: readability-identifier-naming.TypeTemplateParameterPrefix
value: ''
- key: readability-identifier-naming.TypeTemplateParameterSuffix
value: ''
- key: readability-identifier-naming.UnionCase
value: CamelCase
- key: readability-identifier-naming.UnionPrefix
value: ''
- key: readability-identifier-naming.UnionSuffix
value: ''
- key: readability-identifier-naming.ValueTemplateParameterCase
value: camelBack
- key: readability-identifier-naming.ValueTemplateParameterPrefix
value: ''
- key: readability-identifier-naming.ValueTemplateParameterSuffix
value: ''
- key: readability-identifier-naming.VariableCase
value: lower_case
- key: readability-identifier-naming.VariablePrefix
value: ''
- key: readability-identifier-naming.VariableSuffix
value: ''
- key: readability-identifier-naming.VirtualMethodCase
value: camelBack
- key: readability-identifier-naming.VirtualMethodPrefix
value: ''
- key: readability-identifier-naming.VirtualMethodSuffix
value: ''
...

19
.gitignore vendored Normal file
View File

@ -0,0 +1,19 @@
# Каталог для результатов сборки проекта
_build
# Каталог для тестирование установки
_output
# Файлы, создаваемые QtCreator
CMakeLists.txt.user*
*.autosave
# Файлы настроек, редактируемые во время отладки,
# за исключением шаблонных файлов
files/etc/*.conf
!files/etc/*.example.conf
# Каталоги, в которые разрешена запись данных во время работы программы
files/lib/*
files/log/*

21
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,21 @@
include:
- local: .gitlab-ci/scheduled.yml
smolensk15-nightly:
variables:
UPDATE_CMD: apt-get update
INSTALL_CMD: apt-get -y install cmake
extends: .scheduled-smolensk15
orel212-nightly:
extends: .scheduled-orel212
bionic-nightly:
extends: .scheduled-bionic
focal-nightly:
extends: .scheduled-focal
elbrus-nightly:
extends: .scheduled-elbrus

78
.gitlab-ci/scheduled.yml Normal file
View File

@ -0,0 +1,78 @@
variables:
GIT_SUBMODULE_STRATEGY: recursive
GET_SOURCES_ATTEMPTS: 10
.scheduled-test:
only:
refs:
- schedules
cache:
paths: ['*.status']
before_script:
- >
if [ -f "${CI_JOB_NAME}.status" ]; then
if [ "$(cat ${CI_JOB_NAME}.status)" == "${CI_COMMIT_SHA}" ]; then
echo "=== Commit ${CI_COMMIT_SHORT_SHA} already tested with job ${CI_JOB_NAME} ==="
exit 0
fi
fi
- >
if [ -n "${UPDATE_CMD}" ]; then
${UPDATE_CMD}
fi
- >
if [ -n "${INSTALL_CMD}" ]; then
${INSTALL_CMD}
fi
script:
- >
if [ -f "${CI_JOB_NAME}.status" ]; then
if [ "$(cat ${CI_JOB_NAME}.status)" == "${CI_COMMIT_SHA}" ]; then
echo "=== Commit ${CI_COMMIT_SHORT_SHA} already tested with job ${CI_JOB_NAME} ==="
exit 0
fi
fi
- rm -f ${CI_JOB_NAME}.status
- mkdir build
- cd build
- cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=_output -DCPACK_PACKAGING_INSTALL_PREFIX=/opt/rtis ..
- ninja
- >
if [ -z "${CI_SHARED_ENVIRONMENT+x}" ]; then
ninja install
ninja package
ninja package_source
fi
- echo "${CI_COMMIT_SHA}" > "../${CI_JOB_NAME}.status"
artifacts:
paths:
- build/*.xz
- build/*.deb
when: on_success
expire_in: 10 days
.scheduled-smolensk15:
extends: .scheduled-test
image: smolensk15-dev
tags: ['docker']
.scheduled-orel212:
extends: .scheduled-test
image: orel212-dev
tags: ['docker']
.scheduled-bionic:
extends: .scheduled-test
image: bionic-dev
tags: ['docker']
.scheduled-focal:
extends: .scheduled-test
image: focal-dev
tags: ['docker']
.scheduled-elbrus:
extends: .scheduled-test
tags: ['elbrus']

20
CMakeLists.txt Normal file
View File

@ -0,0 +1,20 @@
# Минимальная версия CMake
cmake_minimum_required(VERSION 3.3)
# Предпочтительно следовать стандартам принятым в указанном диапазоне версий
cmake_policy(VERSION 3.0.2..3.7)
# Название и версия проекта и используемые языки программирования
project(cmlib-example-library VERSION 0.2.0 LANGUAGES C CXX)
# В каталоге cmake/cmlib находятся файлы с библиотечными функциями
if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/cmake/cmlib)
list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/cmlib)
else()
message(FATAL_ERROR "CMake library directory does not exist")
endif()
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/find)
include(CMLibCommon)

28
cmake/etc/Variables.cmake Normal file
View File

@ -0,0 +1,28 @@
set(ORGANIZATION_NAME "org")
set(AUTHOR_NAME "John Doe")
set(DOXYGEN_PROJECT_TITLE "Пример проекта для библиотеки")
set(DOXYGEN_GENERATE_LATEX YES)
set(DOXYGEN_GENERATE_HTML YES)
set(CPACK_GENERATOR "TXZ;DEB")
set(CPACK_PACKAGE_CONTACT "John Doe <box@mail.domain>")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CMake library project example")
set(CPACK_DEBIAN_PACKAGE_SECTION "misc")
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
set(CPACK_SOURCE_IGNORE_FILES
${CMAKE_BINARY_DIR}
.git/
.git$
.gitlab-ci/
_output/
files/lib
files/log
.clang-tidy
.cmake-format
.gitignore
.gitmodules
.gitlab-ci.yml
CMakeLists.txt.user.*
~$
\\\\..*\\\\.swp$)

0
doc/breathe/index.md.in Normal file
View File

View File

View File

View File

View File