feat: C++ CMake template

This commit is contained in:
2026-10-04 22:48:25 +02:00
parent 425713fb49
commit e487e66f64
38 changed files with 2385 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
cmake_minimum_required(VERSION 3.21)
project(cppcourse VERSION 0.0.0)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Add the deps directory to the module path
# Required for find_package injection
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/deps")
# Platform and compiler detection
include(Platform)
include(Flags)
# Dependencies
find_package(fmt REQUIRED)
# Main executable
add_executable(hello "hello.cpp")
target_include_directories(hello PRIVATE ".")
target_compile_features(hello PRIVATE cxx_std_23)
target_compile_options(hello PRIVATE ${BASE_OPTIONS})
target_compile_definitions(hello PRIVATE ${BASE_DEFINITIONS})
target_link_libraries(hello PRIVATE fmt::fmt)