Skip to content

Commit b6f6532

Browse files
committed
Added RawDev files
1 parent 209f63f commit b6f6532

File tree

196 files changed

+155900
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

196 files changed

+155900
-0
lines changed

.clang-format

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
BasedOnStyle: LLVM
3+
Language: Cpp
4+
5+
#===========================================#
6+
# Style options should remain sorted #
7+
# to enable better orientation and search. #
8+
#===========================================#
9+
10+
AccessModifierOffset: -4
11+
AlignAfterOpenBracket: DontAlign
12+
AlignArrayOfStructures: None
13+
AlignEscapedNewlines: Left
14+
AllowShortLambdasOnASingleLine: None
15+
AlwaysBreakTemplateDeclarations: Yes
16+
BreakBeforeBraces: Stroustrup
17+
ColumnLimit: 0 # Repsect my breaks...
18+
IndentWidth: 4
19+
KeepEmptyLinesAtTheStartOfBlocks: false
20+
PointerAlignment: Left
21+
SortIncludes: Never
22+
SpaceAfterTemplateKeyword: false
23+
...
24+
25+
#==================#
26+
# Other code rules #
27+
#==================#
28+
29+
# * File encoding UTF-8 without BOM.
30+
# * Column count should not exceed 80 characters.
31+
# * Be aware of auto merging long expressions into signle line.
32+
# To prevent this, make a hard newline AFTER suitable operator!
33+
# * Use spaces for indenting. Not tabs!

.clang-tidy

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
## clang-tidy configuration for RawDev
2+
3+
Checks: >
4+
-*,
5+
clang-analyzer-*,
6+
bugprone-*,
7+
readability-*,
8+
-readability-identifier-length,
9+
-readability-magic-numbers,
10+
-readability-isolate-declaration,
11+
modernize-*,
12+
-modernize-use-trailing-return-type,
13+
-modernize-avoid-c-arrays,
14+
cppcoreguidelines-*,
15+
-cppcoreguidelines-pro-bounds-constant-array-index,
16+
-cppcoreguidelines-avoid-magic-numbers,
17+
-cppcoreguidelines-avoid-c-arrays,
18+
portability-*,
19+
performance-*,
20+
-performance-avoid-endl
21+
22+
## openmp-* checks intentionally omitted!
23+
24+
CheckOptions:
25+
readability-identifier-naming.ClassCase: 'CamelCase'
26+
readability-identifier-naming.ClassConstantCase: 'camelBack'
27+
readability-identifier-naming.ClassConstantPrefix: 'k_'
28+
readability-identifier-naming.ClassMemberCase: 'CamelCase'
29+
readability-identifier-naming.ClassMethodCase: 'CamelCase'
30+
readability-identifier-naming.EnumCase: 'CamelCase'
31+
readability-identifier-naming.EnumConstantCase: 'CamelCase'
32+
readability-identifier-naming.FunctionCase: 'camelBack'
33+
readability-identifier-naming.GlobalConstantCase: 'camelBack'
34+
readability-identifier-naming.GlobalConstantPrefix: 'k_'
35+
readability-identifier-naming.MacroDefinitionCase: 'UPPER_CASE'
36+
readability-identifier-naming.MemberCase: 'camelBack'
37+
readability-identifier-naming.MethodCase: 'camelBack'
38+
readability-identifier-naming.NamespaceCase: 'CamelCase'
39+
readability-identifier-naming.PrivateMemberCase: 'camelBack'
40+
readability-identifier-naming.PrivateMemberPrefix: 'm_'
41+
readability-identifier-naming.ProtectedMemberCase: 'camelBack'
42+
readability-identifier-naming.ProtectedMemberPrefix: 'm_'
43+
readability-identifier-naming.TemplateParameterCase: 'CamelCase'
44+
readability-identifier-naming.TypeAliasCase: 'CamelCase'
45+
readability-identifier-naming.TypedefCase: 'CamelCase'
46+
readability-identifier-naming.VariableCase: 'camelBack'

BUILD.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
How to build and install RawDev
2+
===============================
3+
4+
Prerequisites
5+
-------------
6+
RawDev itself has no dependencies, but for testing,
7+
GoogleTest is used.
8+
9+
What we need:
10+
* Git for cloning the repository.
11+
* CMake from version 3.20 upwards.
12+
* C++20 and CMake-compatible compiler.
13+
* Internet connection for downloading GoogleTest by CMake.
14+
15+
Build with CMake
16+
----------------
17+
This is the recommended build method for Windows
18+
and Unix-like systems.
19+
20+
1) Git clone the repository.
21+
```
22+
git clone https://github.com/petrk23/RawDev.git
23+
```
24+
2) Go to the project root directory.
25+
```
26+
cd RawDev
27+
```
28+
3) Configure the project with CMake:
29+
```
30+
cmake -B build -DCMAKE_BUILD_TYPE=Release
31+
```
32+
4) Then build it:
33+
```
34+
cmake --build build
35+
```
36+
That was it! The code should be build and the result
37+
is in the `build` directory.
38+
39+
Run automated tests
40+
-------------------
41+
This step is optional for normal users.
42+
43+
Go to `build` directory and run `ctest`. All available tests
44+
will be run. All of them must pass!
45+
46+
Installing
47+
----------
48+
RawDev is a single executable. So the installation is done by
49+
simply copying to the target destination. On Windows, I recommend
50+
using `Program Files` as destination.
51+
52+
Alternative for Windows
53+
-----------------------
54+
In the `vsproj` directory there are Visual Studio project files
55+
and solution, which can be used to build in Visual Studio or by
56+
the `msbuild` tool. Select release target and build...
57+
58+
Problems with 32bit architectures
59+
---------------------------------
60+
We can use it, but with high-megapixel cameras, we run out of memory.
61+
Therefore, available memory limits the usability.
62+
63+
Tips and tricks
64+
---------------
65+
* In the configuration stage, use Ninja build tool (`-G Ninja`).
66+
This makes the build much faster.
67+
* We can use different compilers by using
68+
`-DCMAKE_CXX_COMPILER=compiler` in the configuration stage.
69+
* For clean configuration, use the `--fresh` switch or remove
70+
the `build` directory.
71+
* To clean the solution run `cmake --build build -t clean`.

CMakeLists.txt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
## RawDev project root CMake file
2+
3+
cmake_minimum_required(VERSION 3.20)
4+
project(RawDev VERSION 2.0 LANGUAGES CXX)
5+
6+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
7+
include(NoInSourceBuilds)
8+
9+
find_package(OpenMP REQUIRED)
10+
if(NOT OpenMP_FOUND)
11+
message(FATAL_ERROR "OpenMP support is required for this project.")
12+
endif()
13+
14+
set(CMAKE_CXX_STANDARD 20)
15+
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
16+
set(CMAKE_CXX_EXTENSIONS OFF)
17+
18+
include(EnableIPO)
19+
if(MSVC)
20+
add_compile_options(/permissive- /W4 /sdl /fp:precise
21+
"$<$<CONFIG:Release>:/Gy;/Oy;/Oi;/Ot>")
22+
else()
23+
add_compile_options(-Wall -Wextra -pedantic)
24+
endif()
25+
26+
include_directories(src)
27+
add_subdirectory(src)
28+
29+
## Main executable
30+
add_executable(RawDev src/Main.cpp)
31+
target_link_libraries(RawDev PRIVATE RawDevLib)
32+
33+
enable_testing()
34+
add_subdirectory(test)

0 commit comments

Comments
 (0)