Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
franneck94 committed Mar 4, 2024
1 parent b63c596 commit b89c8ef
Show file tree
Hide file tree
Showing 8 changed files with 248 additions and 171 deletions.
10 changes: 3 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
################################
########### FILES ############
################################
TODO*.*
*.pptx
*.pdf
CMakeUserPresets.json

################################
########### FOLDERS ############
################################
build/
build-*/
html/
lectures/
.mypy_cache/
.ruff_cache/

################################
############ C/C++ #############
Expand Down Expand Up @@ -63,7 +58,8 @@ lectures/
################################
########### VS CODE ############
################################
.vscode
.vscode/settings.json
.vscode/c_cpp_properties.json
*.code-workspace
.history

Expand Down
37 changes: 37 additions & 0 deletions .vscode/cmake-kits.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[
{
"name": "linux-default",
"compilers": {
"C": "gcc",
"CXX": "g++"
}
},
{
"name": "mac-default",
"compilers": {
"C": "clang",
"CXX": "clang++"
}
},
{
"name": "win32-default",
"visualStudio": "1ad26ee0",
"visualStudioArchitecture": "x86_amd64"
},
{
"name": "arm32-cross",
"toolchainFile": "${workspaceFolder}/cmake/toolchains/arm32-cross-toolchain.cmake"
},
{
"name": "arm32-native",
"toolchainFile": "${workspaceFolder}/cmake/toolchains/arm32-native-toolchain.cmake"
},
{
"name": "x86-64-mingw",
"toolchainFile": "${workspaceFolder}/cmake/toolchains/x86-64-mingw-toolchain.cmake"
},
{
"name": "x86-64-native",
"toolchainFile": "${workspaceFolder}/cmake/toolchains/x86-64-native-toolchain.cmake"
}
]
24 changes: 24 additions & 0 deletions .vscode/cmake-variants.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"buildType": {
"default": "Debug",
"description": "Enable debug or release build",
"choices": {
"Debug": {
"short": "Debug",
"long": "Build with no optimizations and debugging information",
"buildType": "Debug",
"settings": {
"CMAKE_CXX_FLAGS_DEBUG": "-g3 -O0"
}
},
"Release": {
"short": "Release",
"long": "Build with optimizations and some debuging information",
"buildType": "Release",
"settings": {
"CMAKE_CXX_FLAGS_RELEASE": "-g -O3"
}
}
}
}
}
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"${workspaceFolder}/app/test.json"
],
"externalConsole": true
}
},
"cmake.buildDirectory": "${workspaceFolder}/build-${buildKit}"
}
60 changes: 48 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ add_clang_format_target()

if(ENABLE_SANITIZE_ADDR OR ENABLE_SANITIZE_UNDEF)
include(Sanitizer)
add_sanitizer_flags()
add_sanitizer_flags(ENABLE_SANITIZE_ADDR ENABLE_SANITIZE_UNDEF)
endif()

if(ENABLE_COVERAGE)
Expand All @@ -69,30 +69,66 @@ endif()

# EXTERNAL LIBRARIES

if(USE_CONAN)
if(USE_CPM)
message(STATUS "Using CPM")
include(CPM)
cpmaddpackage("gh:nlohmann/json#v3.11.3")
cpmaddpackage("gh:fmtlib/fmt#10.2.1")
cpmaddpackage("gh:gabime/spdlog#v1.13.0")
cpmaddpackage("gh:jarro2783/cxxopts#v3.1.1")
cpmaddpackage("gh:catchorg/Catch2#v2.13.9")
elseif(USE_CONAN)
message(STATUS "Using Conan")
include(${CMAKE_BINARY_DIR}/conan_toolchain.cmake)
find_package(nlohmann_json REQUIRED)
find_package(fmt REQUIRED)
find_package(spdlog REQUIRED)
find_package(Catch2 REQUIRED)
find_package(cxxopts REQUIRED)
find_package(Catch2 REQUIRED)
elseif(USE_VCPKG)
message(STATUS "Using VCPKG")
include(${CMAKE_SOURCE_DIR}/external/vcpkg/scripts/buildsystems/vcpkg.cmake)
find_package(nlohmann_json REQUIRED)
find_package(fmt REQUIRED)
find_package(spdlog REQUIRED)
find_package(Catch2 REQUIRED)
find_package(cxxopts REQUIRED)
else(USE_CPM)
message(STATUS "Using CPM")
include(CPM)
cpmaddpackage("gh:fmtlib/fmt#9.1.0")
cpmaddpackage("gh:nlohmann/[email protected]")
cpmaddpackage("gh:catchorg/[email protected]")
cpmaddpackage("gh:jarro2783/[email protected]")
cpmaddpackage("gh:gabime/[email protected]")
find_package(Catch2 REQUIRED)
else()
message(STATUS "Using FetchContent")
FetchContent_Declare(
nlohmann_json
GIT_REPOSITORY https://github.com/nlohmann/json
GIT_TAG v3.11.3
GIT_SHALLOW TRUE)
FetchContent_MakeAvailable(nlohmann_json)

FetchContent_Declare(
fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt
GIT_TAG 10.2.1
GIT_SHALLOW TRUE)
FetchContent_MakeAvailable(fmt)

FetchContent_Declare(
spdlog
GIT_REPOSITORY https://github.com/gabime/spdlog
GIT_TAG v1.13.0
GIT_SHALLOW TRUE)
FetchContent_MakeAvailable(spdlog)

FetchContent_Declare(
cxxopts
GIT_REPOSITORY https://github.com/jarro2783/cxxopts
GIT_TAG v3.1.1
GIT_SHALLOW TRUE)
FetchContent_MakeAvailable(cxxopts)

FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2
GIT_TAG v2.13.9
GIT_SHALLOW TRUE)
FetchContent_MakeAvailable(Catch2)
endif()

# SUB DIRECTORIES
Expand Down
Loading

0 comments on commit b89c8ef

Please sign in to comment.