diff --git a/CMakeLists.txt b/CMakeLists.txt index c201ebd..41d8412 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,14 +1,20 @@ -# project settings +# General project settings cmake_minimum_required(VERSION 3.22) -project(FloatPUMP VERSION 2.0.0 LANGUAGES C CXX ASM ) +project(FloatPUMP VERSION 2.0.0 LANGUAGES C CXX ASM) +# Custom options +option(ENABLE_UNITTESTS "Activates the unittesting framework" OFF) +# General language considerations set(CMAKE_CXX_STANDARD 17) set(CMAKE_C_STANDARD 11) # General Project add_subdirectory(floatpump) -# All UnitTest Related stuff -add_subdirectory(Catch2) -add_subdirectory(Tests) \ No newline at end of file +# Testing Project +if(ENABLE_UNITTESTS) + message(STATUS "Enabled Unit Tests") + add_subirectory(Catch2) + add_subdirectory(Tests) +endif() \ No newline at end of file diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 0000000..7f3442b --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,33 @@ +{ + "configurePresets": [ + { + "name": "debug@firmware", + "description": "Firmware Debug Build", + "generator": "Ninja", + "cacheVariables": { + "CMAKE_TOOLCHAIN_FILE": "toolchain/arm-none-eabi-stm32f411ceu6-toolchain.cmake", + "CMAKE_BUILD_TYPE": "Debug" + }, + "binaryDir": "build/debug@firmware" + }, + { + "name": "debug@tests", + "description": "UnitTests Debug Buil", + "generator": "Ninja", + "cacheVariables": { + "ENABLE_UNITTESTS": "ON" + } + } + ], + "buildPresets": [ + { + "name": "build-debug@firmware", + "description": "Builds the debugging firmware", + "cleanFirst": false, + "configuration": "debug@firmware", + "targets": [ + "FloatPUMP.elf" + ] + } + ] +} \ No newline at end of file