Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
TinyTinni committed Feb 27, 2024
0 parents commit acb7099
Show file tree
Hide file tree
Showing 31 changed files with 10,085 additions and 0 deletions.
95 changes: 95 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: false
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Allman
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|isl|json)/)'
Priority: 3
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 8
UseTab: Never

72 changes: 72 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: ci
on:
pull_request:
release:
types: [published]
push:
tags:
branches:
- main
- master

jobs:
Test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
#- macos-latest
#- windows-2022
compiler:
# you can specify the version after `-` like "llvm-15.0.2".
- llvm-17
- gcc-13
generator:
- "Ninja Multi-Config"
build_type:
- Release
include:
# Windows msvc builds
- os: windows-latest
compiler: msvc
generator: "Visual Studio 17 2022"
build_type: Release

steps:
- uses: actions/checkout@v4

- name: Install dependencies (linux)
run: sudo apt install ninja-build libopencv-dev libpoco-dev
if: matrix.os == 'ubuntu-latest'
- name: Install dependencies (windows)
run: |
choco install opencv --package-parameters '/InstallationPath:C:\opencv /Environment'
echo "C:\opencv\opencv\build\x64\vc16\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
dir C:\opencv\opencv\build
dir C:\opencv\opencv\build\bin
if: matrix.os == 'windows-latest'

- name: Setup Cpp
uses: aminya/setup-cpp@v1
with:
compiler: ${{ matrix.compiler }}
vcvarsall: ${{ contains(matrix.os, 'windows' )}}

- name: Configure CMake (windows)
run: |
cmake -S . -B ./build -G "${{matrix.generator}}" -DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} -DOpenCV_DIR="C:/opencv/opencv/build/"
if: matrix.os == 'windows-latest'

- name: Configure CMake (linux)
run: |
cmake -S . -B ./build -G "${{matrix.generator}}" -DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}}
if: matrix.os == 'ubuntu-latest'

- name: Build
# Execute the build. You can specify a specific target with "--target <NAME>"
run: |
cmake --build ./build --config ${{matrix.build_type}}
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{matrix.build_type}} --output-on-failure
76 changes: 76 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# This file is used to ignore files which are generated
# ----------------------------------------------------------------------------

*~
*.autosave
*.a
*.core
*.moc
*.o
*.obj
*.orig
*.rej
*.so
*.so.*
*_pch.h.cpp
*_resource.rc
*.qm
.#*
*.*#
core
!core/
tags
.DS_Store
.directory
*.debug
Makefile*
*.prl
*.app
moc_*.cpp
ui_*.h
qrc_*.cpp
Thumbs.db
*.res
*.rc
/.qmake.cache
/.qmake.stash
build/*
.vs/*
out/*

# qtcreator generated files
*.pro.user*
CMakeLists.txt.user*

# xemacs temporary files
*.flc

# Vim temporary files
.*.swp

# Visual Studio generated files
*.ib_pdb_index
*.idb
*.ilk
*.pdb
*.sln
*.suo
*.vcproj
*vcproj.*.*.user
*.ncb
*.sdf
*.opensdf
*.vcxproj
*vcxproj.*

# MinGW generated files
*.Debug
*.Release

# Python byte code
*.pyc

# Binaries
# --------
*.dll
*.exe
65 changes: 65 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
cmake_minimum_required(VERSION 3.20)

set(PROJECT_VERSION 1.0.0)
project(FairyCam LANGUAGES CXX VERSION ${PROJECT_VERSION})

option (FAIRYCAM_ENABLE_TESTING ON "Create Testing targets")

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

#######
# dependencies

# Poco
find_package(Poco QUIET COMPONENTS Foundation Net)

if (NOT ${Poco_FOUND})
message("Poco not found. Download Poco")
include(cmake/CPM.cmake)
CPMAddPackage(
NAME Poco
VERSION 1.13.2
URL https://github.com/pocoproject/poco/archive/refs/tags/poco-1.13.2-release.tar.gz
OPTIONS
"BUILD_SHARED_LIBS OFF"
"ENABLE_FOUNDATION ON"
"ENABLE_NET ON"
"ENABLE_NETSSL OFF"
"ENABLE_XML OFF"
"ENABLE_DATA_SQLITE OFF"
"ENABLE_ENCODINGS OFF"
"ENABLE_ENCODINGS_COMPILER OFF"
"ENABLE_UTIL OFF"
"ENABLE_JSON OFF"
"ENABLE_MONGODB OFF"
"ENABLE_REDIS OFF"
"ENABLE_PROMETHEUS OFF"
"ENABLE_JWT OFF"
"ENABLE_CRYPTO OFF"
"ENABLE_DATA OFF"
"ENABLE_ACTIVERECORD OFF"
"ENABLE_ACTIVERECORD_COMPILER OFF"
"ENABLE_ZIP OFF"
"ENABLE_PAGECOMPILER OFF"
"ENABLE_PAGECOMPILER_FILE2PAGE OFF"
)
endif()

# doctest
add_library(doctest INTERFACE)
target_sources(doctest PUBLIC
FILE_SET HEADERS
BASE_DIRS doctest
FILES doctest/doctest.h
)

#######
add_subdirectory(src/)

# tests
include(CTest)
enable_testing()
if(FAIRYCAM_ENABLE_TESTING)
add_subdirectory(tests/)
endif()
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Matthias Möller

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit acb7099

Please sign in to comment.