Skip to content

Commit 4d0cbae

Browse files
author
Mostafa Ziad FRD XAXE13
committed
Initial commit for the temlate project
0 parents  commit 4d0cbae

42 files changed

Lines changed: 1164 additions & 0 deletions

Some content is hidden

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

.clang-format

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
AccessModifierOffset: -2
2+
AlignAfterOpenBracket: DontAlign
3+
AlignConsecutiveAssignments: false
4+
AlignConsecutiveDeclarations: false
5+
AlignEscapedNewlines: Left
6+
AlignOperands: true
7+
AlignTrailingComments: false
8+
AllowAllParametersOfDeclarationOnNextLine: false
9+
AllowShortBlocksOnASingleLine: true
10+
AllowShortCaseLabelsOnASingleLine: false
11+
AllowShortFunctionsOnASingleLine: All
12+
AllowShortIfStatementsOnASingleLine: true
13+
AllowShortLoopsOnASingleLine: true
14+
AlwaysBreakAfterDefinitionReturnType: None
15+
AlwaysBreakAfterReturnType: None
16+
AlwaysBreakBeforeMultilineStrings: true
17+
AlwaysBreakTemplateDeclarations: false
18+
BinPackArguments: false
19+
BinPackParameters: false
20+
BraceWrapping:
21+
AfterClass: true
22+
AfterControlStatement: false
23+
AfterEnum: false
24+
AfterFunction: true
25+
AfterNamespace: false
26+
AfterObjCDeclaration: false
27+
AfterStruct: true
28+
AfterUnion: false
29+
BeforeCatch: false
30+
BeforeElse: false
31+
IndentBraces: false
32+
SplitEmptyFunction: false
33+
SplitEmptyNamespace: true
34+
SplitEmptyRecord: true
35+
BreakAfterJavaFieldAnnotations: true
36+
BreakBeforeBinaryOperators: NonAssignment
37+
BreakBeforeBraces: Custom
38+
BreakBeforeInheritanceComma: true
39+
BreakBeforeTernaryOperators: true
40+
BreakConstructorInitializers: BeforeColon
41+
BreakConstructorInitializersBeforeComma: false
42+
BreakStringLiterals: true
43+
ColumnLimit: 0
44+
CommentPragmas: '^ IWYU pragma:'
45+
CompactNamespaces: false
46+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
47+
ConstructorInitializerIndentWidth: 2
48+
ContinuationIndentWidth: 2
49+
Cpp11BracedListStyle: false
50+
DerivePointerAlignment: false
51+
DisableFormat: false
52+
ExperimentalAutoDetectBinPacking: true
53+
FixNamespaceComments: true
54+
ForEachMacros:
55+
- foreach
56+
- Q_FOREACH
57+
- BOOST_FOREACH
58+
IncludeCategories:
59+
- Priority: 2
60+
Regex: ^"(llvm|llvm-c|clang|clang-c)/
61+
- Priority: 3
62+
Regex: ^(<|"(gtest|gmock|isl|json)/)
63+
- Priority: 1
64+
Regex: .*
65+
IncludeIsMainRegex: (Test)?$
66+
IndentCaseLabels: false
67+
IndentWidth: 2
68+
IndentWrappedFunctionNames: true
69+
JavaScriptQuotes: Leave
70+
JavaScriptWrapImports: true
71+
KeepEmptyLinesAtTheStartOfBlocks: true
72+
Language: Cpp
73+
MacroBlockBegin: ''
74+
MacroBlockEnd: ''
75+
MaxEmptyLinesToKeep: 2
76+
NamespaceIndentation: Inner
77+
ObjCBlockIndentWidth: 7
78+
ObjCSpaceAfterProperty: true
79+
ObjCSpaceBeforeProtocolList: false
80+
PointerAlignment: Right
81+
ReflowComments: true
82+
SortIncludes: false
83+
SortUsingDeclarations: false
84+
SpaceAfterCStyleCast: false
85+
SpaceAfterTemplateKeyword: false
86+
SpaceBeforeAssignmentOperators: true
87+
SpaceBeforeParens: ControlStatements
88+
SpaceInEmptyParentheses: false
89+
SpacesBeforeTrailingComments: 0
90+
SpacesInAngles: false
91+
SpacesInCStyleCastParentheses: false
92+
SpacesInContainerLiterals: true
93+
SpacesInParentheses: false
94+
SpacesInSquareBrackets: false
95+
Standard: Cpp11
96+
TabWidth: 8
97+
UseTab: Never
98+

.clang-tidy

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
Checks: '*,-fuchsia-*,-google-*,-zircon-*,-abseil-*,-modernize-use-trailing-return-type,-llvm-*'
3+
WarningsAsErrors: '*'
4+
HeaderFilterRegex: ''
5+
FormatStyle: none
6+
7+

.cmake-format.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
additional_commands:
2+
foo:
3+
flags:
4+
- BAR
5+
- BAZ
6+
kwargs:
7+
DEPENDS: '*'
8+
HEADERS: '*'
9+
SOURCES: '*'
10+
bullet_char: '*'
11+
dangle_parens: false
12+
enum_char: .
13+
line_ending: unix
14+
line_width: 120
15+
max_subargs_per_line: 3
16+
separate_ctrl_name_with_space: false
17+
separate_fn_name_with_space: false
18+
tab_size: 2
19+

.travis.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
language: cpp
2+
3+
install:
4+
- pip install --user conan cmake
5+
6+
jobs:
7+
include:
8+
- os: osx
9+
compiler: gcc
10+
osx_image: xcode11.2 # includes gcc-9 by default
11+
env:
12+
# Conan is at: ${HOME}/Library/Python/2.7/bin: we need this in the path
13+
- PATH="${HOME}/Library/Python/2.7/bin:${PATH}"
14+
- GCC_VER="9"
15+
- MATRIX_EVAL="CC=gcc-${GCC_VER} && CXX=g++-${GCC_VER}"
16+
after_script:
17+
- bash <(curl -s https://codecov.io/bash) -x /usr/bin/gcov-${GCC_VER}
18+
- os: osx
19+
compiler: clang
20+
osx_image: xcode11.2
21+
env:
22+
- PATH="${HOME}/Library/Python/2.7/bin:${PATH}"
23+
- MATRIX_EVAL=""
24+
- os: linux
25+
dist: bionic
26+
compiler: gcc
27+
env:
28+
- GCC_VER="9"
29+
- MATRIX_EVAL="CC=gcc-${GCC_VER} && CXX=g++-${GCC_VER}"
30+
31+
addons:
32+
apt:
33+
sources:
34+
- ubuntu-toolchain-r-test
35+
packages:
36+
# I couldn't get ${GCC_VER} in here successfully
37+
- gcc-9
38+
- g++-9
39+
- doxygen
40+
after_script:
41+
- bash <(curl -s https://codecov.io/bash) -x /usr/bin/gcov-${GCC_VER}
42+
- os: linux
43+
dist: bionic
44+
compiler: clang
45+
env:
46+
- MATRIX_EVAL="CC=clang && CXX=clang++"
47+
addons: { apt: { packages: ['doxygen'] } }
48+
49+
50+
before_script:
51+
- eval "${MATRIX_EVAL}"
52+
53+
script:
54+
- cmake -D ENABLE_COVERAGE:BOOL=TRUE .
55+
- cmake --build . -- -j2
56+
- ctest -j2
57+
58+
59+

CMakeLists.txt

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
cmake_minimum_required(VERSION 3.15)
2+
3+
# Set the project name to your project name, my project isn't very descriptive
4+
project(myproject CXX)
5+
include(cmake/StandardProjectSettings.cmake)
6+
7+
# Link this 'library' to set the c++ standard / compile-time options requested
8+
add_library(project_options INTERFACE)
9+
target_compile_features(project_options INTERFACE cxx_std_17)
10+
11+
if(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
12+
option(ENABLE_BUILD_WITH_TIME_TRACE "Enable -ftime-trace to generate time tracing .json files on clang" OFF)
13+
if (ENABLE_BUILD_WITH_TIME_TRACE)
14+
add_compile_definitions(project_options INTERFACE -ftime-trace)
15+
endif()
16+
endif()
17+
18+
# Link this 'library' to use the warnings specified in CompilerWarnings.cmake
19+
add_library(project_warnings INTERFACE)
20+
21+
# standard compiler warnings
22+
include(cmake/CompilerWarnings.cmake)
23+
set_project_warnings(project_warnings)
24+
25+
# sanitizer options if supported by compiler
26+
include(cmake/Sanitizers.cmake)
27+
enable_sanitizers(project_options)
28+
29+
# enable doxygen
30+
include(cmake/Doxygen.cmake)
31+
enable_doxygen()
32+
33+
# allow for static analysis options
34+
include(cmake/StaticAnalyzers.cmake)
35+
36+
option(BUILD_SHARED_LIBS "Enable compilation of shared libraries" OFF)
37+
option(ENABLE_TESTING "Enable Test Builds" ON)
38+
39+
# Very basic PCH example
40+
option(ENABLE_PCH "Enable Precompiled Headers" OFF)
41+
if (ENABLE_PCH)
42+
# This sets a global PCH parameter, each project will build its own PCH, which
43+
# is a good idea if any #define's change
44+
#
45+
# consider breaking this out per project as necessary
46+
target_precompile_headers(project_options INTERFACE <vector> <string> <map> <utility>)
47+
endif()
48+
49+
50+
# Set up some extra Conan dependencies based on our needs
51+
# before loading Conan
52+
set(CONAN_EXTRA_REQUIRES "")
53+
set(CONAN_EXTRA_OPTIONS "")
54+
55+
if(CPP_STARTER_USE_IMGUI)
56+
set(CONAN_EXTRA_REQUIRES ${CONAN_EXTRA_REQUIRES}
57+
imgui-sfml/2.1@bincrafters/stable)
58+
59+
# set(CONAN_EXTRA_OPTIONS ${CONAN_EXTRA_OPTIONS} sfml:shared=False
60+
# sfml:graphics=True sfml:audio=False sfml:window=True
61+
# libalsa:disable_python=True)
62+
endif()
63+
64+
if(CPP_STARTER_USE_SDL)
65+
set(CONAN_EXTRA_REQUIRES ${CONAN_EXTRA_REQUIRES}
66+
sdl2/2.0.10@bincrafters/stable)
67+
# set(CONAN_EXTRA_OPTIONS ${CONAN_EXTRA_OPTIONS} sdl2:wayland=True)
68+
endif()
69+
70+
71+
include(cmake/Conan.cmake)
72+
run_conan()
73+
74+
if(ENABLE_TESTING)
75+
enable_testing()
76+
message(
77+
"Building Tests. Be sure to check out test/constexpr_tests for constexpr testing"
78+
)
79+
add_subdirectory(test)
80+
endif()
81+
82+
if(ENABLE_FUZZING)
83+
message(
84+
"Building Fuzz Tests, using fuzzing sanitizer https://www.llvm.org/docs/LibFuzzer.html"
85+
)
86+
add_subdirectory(fuzz_test)
87+
endif()
88+
89+
90+
add_subdirectory(src)
91+
92+
93+
option(ENABLE_UNITY "Enable Unity builds of projects" OFF)
94+
if (ENABLE_UNITY)
95+
# Add for any project you want to apply unity builds for
96+
set_target_properties(intro PROPERTIES UNITY_BUILD ON)
97+
endif()
98+
99+

LICENSE

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
This is free and unencumbered software released into the public domain.
2+
3+
Anyone is free to copy, modify, publish, use, compile, sell, or
4+
distribute this software, either in source code form or as a compiled
5+
binary, for any purpose, commercial or non-commercial, and by any
6+
means.
7+
8+
In jurisdictions that recognize copyright laws, the author or authors
9+
of this software dedicate any and all copyright interest in the
10+
software to the public domain. We make this dedication for the benefit
11+
of the public at large and to the detriment of our heirs and
12+
successors. We intend this dedication to be an overt act of
13+
relinquishment in perpetuity of all present and future rights to this
14+
software under copyright law.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22+
OTHER DEALINGS IN THE SOFTWARE.
23+
24+
For more information, please refer to <https://unlicense.org>

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Data structure and Algorithms
2+
3+
This C++ project is for projects implementations from `Datastructure and Algorithms` specialization from **Coursera** [https://www.coursera.org/specializations/data-structures-algorithms]
4+
5+
The cmake project template has been forked from **lefticus** `cpp_starter_project `

appveyor.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
image:
2+
- Visual Studio 2019
3+
clone_folder: c:\projects\source
4+
build_script:
5+
- cmd: >-
6+
mkdir build
7+
8+
cd build
9+
10+
pip install --user conan
11+
12+
set PATH=%PATH%;C:\Users\appveyor\AppData\Roaming\Python\Scripts
13+
14+
cmake c:\projects\source -G "Visual Studio 16 2019" -DCMAKE_BUILD_TYPE:STRING=Release
15+
16+
cmake --build . --config "Release"
17+
18+
test_script:
19+
- cmd: ctest -C Debug
20+

0 commit comments

Comments
 (0)