Added source file and cmake.
This commit is contained in:
parent
f9bcb7e592
commit
90c3e807f6
3 changed files with 37 additions and 0 deletions
30
CMakeLists.txt
Normal file
30
CMakeLists.txt
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
# Project Setup
|
||||||
|
cmake_minimum_required(VERSION 3.21)
|
||||||
|
project(
|
||||||
|
projet
|
||||||
|
VERSION 1.0.0
|
||||||
|
DESCRIPTION "CI/CD Test"
|
||||||
|
HOMEPAGE_URL "https://www.etheryo.fr/"
|
||||||
|
LANGUAGES C
|
||||||
|
)
|
||||||
|
set(TARGET out)
|
||||||
|
|
||||||
|
# Source files
|
||||||
|
set(SOURCES "${PROJECT_SOURCE_DIR}/src")
|
||||||
|
add_executable(${TARGET}
|
||||||
|
${SOURCES}/main.c
|
||||||
|
)
|
||||||
|
|
||||||
|
# Setting target properties for output directories
|
||||||
|
set_target_properties(${TARGET}
|
||||||
|
PROPERTIES
|
||||||
|
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
|
||||||
|
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
|
||||||
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Including the include folder
|
||||||
|
target_include_directories(${TARGET} PUBLIC "${PROJECT_SOURCE_DIR}/include")
|
||||||
|
|
||||||
|
# Compilation
|
||||||
|
target_compile_options(${TARGET} PUBLIC -Wall -Wextra -Wpedantic -Werror)
|
BIN
build/out
Executable file
BIN
build/out
Executable file
Binary file not shown.
7
src/main.c
Normal file
7
src/main.c
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
printf("Hello world\n");
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue