initial commit

This commit is contained in:
dl92
2026-01-06 15:05:27 +00:00
parent a94f174a39
commit 62ab80b1d6
25 changed files with 1291 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
cmake_minimum_required(VERSION 3.15)
project(Tutorial1 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Find dependencies
find_package(spdlog CONFIG REQUIRED)
find_package(GTest CONFIG REQUIRED)
# Create a library for our application code
# This allows us to share the code between the main app and the tests
add_library(MyLib src/calculator.cpp src/calculator.h)
target_include_directories(MyLib PUBLIC src)
# Define our main executable
add_executable(App src/main.cpp)
# Link our App against spdlog and our library
target_link_libraries(App PRIVATE spdlog::spdlog MyLib)
# Enable testing with CTest (CMake's testing framework)
enable_testing()
# Define the test executable
add_executable(RunTests test/test_calculator.cpp)
# Link our test executable against GTest and our library
target_link_libraries(RunTests PRIVATE GTest::gtest_main MyLib)
# Add the test to CTest
include(GoogleTest)
gtest_add_tests(TARGET RunTests)