Skip to content
Snippets Groups Projects
Commit 5f4ed8d1 authored by Lukas Güldenstein's avatar Lukas Güldenstein
Browse files

initial commit

parents
No related branches found
No related tags found
No related merge requests found
cmake_minimum_required(VERSION 3.20)
get_filename_component(TARGET_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME)
string(REPLACE " " "_" TARGET_NAME ${TARGET_NAME})
project(${TARGET_NAME})
set(CMAKE_C_STANDARD 99)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
file(GLOB sources CONFIGURE_DEPENDS "src/*.cpp")
file(GLOB sources CONFIGURE_DEPENDS "src/*.c")
add_executable(${TARGET_NAME} ${sources})
target_include_directories(
${TARGET_NAME} PRIVATE
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/include
)
# Template C Project with CMake as build system
## Configure
`cmake -B build -S . -G "Ninja Multi-Config"`
## Build
`cmake --build build [--config Debug|Release]`
#include <stdio.h>
int main(void) {
printf("Hello World!\r\n");
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment