From b8fe134405a5ee2190d41256e4b4f1d1fe184f89 Mon Sep 17 00:00:00 2001 From: Yohan Boujon Date: Wed, 6 Dec 2023 19:58:31 +0100 Subject: [PATCH] Added multiple tp management. Moved tp to tp1. Created tp2 with simple Hello World program. --- CMakeLists.txt | 7 ++++--- README.md | 4 ++-- tp/{ => tp1}/include/coloriable.h | 0 tp/{ => tp1}/include/figure.h | 0 tp/{ => tp1}/include/file.h | 0 tp/{ => tp1}/include/polygone.h | 0 tp/{ => tp1}/src/main.cpp | 0 tp/{ => tp1}/src/polygone.cpp | 0 tp/tp2/src/main.cpp | 7 +++++++ 9 files changed, 13 insertions(+), 5 deletions(-) rename tp/{ => tp1}/include/coloriable.h (100%) rename tp/{ => tp1}/include/figure.h (100%) rename tp/{ => tp1}/include/file.h (100%) rename tp/{ => tp1}/include/polygone.h (100%) rename tp/{ => tp1}/src/main.cpp (100%) rename tp/{ => tp1}/src/polygone.cpp (100%) create mode 100644 tp/tp2/src/main.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 3fe2942..87b77c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Set the etape value set(ETAPE "1" CACHE STRING "Entrez l'exercice a compiler.") set(TD "1" CACHE STRING "Entrez le td a compiler.") +set(TP "1" CACHE STRING "Entrez le td a compiler.") # Etapes exercice file(GLOB SOURCES_EXE "${PROJECT_SOURCE_DIR}/exercice/etape${ETAPE}/*.cpp") @@ -18,12 +19,12 @@ add_executable(${EXERCICE_TARGET} ${SOURCES_EXE}) # TD file(GLOB SOURCES_TD "${PROJECT_SOURCE_DIR}/td/td${TD}/src/*.cpp") add_executable(${TD_TARGET} ${SOURCES_TD}) -target_include_directories(${TD_TARGET} PUBLIC "${PROJECT_SOURCE_DIR}/td/td${ETAPE}/include/") +target_include_directories(${TD_TARGET} PUBLIC "${PROJECT_SOURCE_DIR}/td/td${TD}/include/") #TP -file(GLOB SOURCES_TP "${PROJECT_SOURCE_DIR}/tp/src/*.cpp") +file(GLOB SOURCES_TP "${PROJECT_SOURCE_DIR}/tp/tp${TP}/src/*.cpp") add_executable(${TP_TARGET} ${SOURCES_TP}) -target_include_directories(${TP_TARGET} PUBLIC "${PROJECT_SOURCE_DIR}/tp/include") +target_include_directories(${TP_TARGET} PUBLIC "${PROJECT_SOURCE_DIR}/tp/tp${TP}/include") # Adding compilation option depending on the OS if(MSVC) diff --git a/README.md b/README.md index c6df14d..b338c47 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,9 @@ mkdir build cd build ``` ``` -cmake -DETAPE=2 -DTD=1 .. +cmake -DETAPE=2 -DTD=1 -DTP=1 .. ``` -_Dans cet exemple, l'étape 2 et le td 1 seront construits. Le tp lui n'a pas besoin de nombre particulier._ +_Dans cet exemple, l'étape 2 du dossier exercice, le td 1 du dossier td et le tp 1 du dossier tp seront construits._ ### Lancer la compilation diff --git a/tp/include/coloriable.h b/tp/tp1/include/coloriable.h similarity index 100% rename from tp/include/coloriable.h rename to tp/tp1/include/coloriable.h diff --git a/tp/include/figure.h b/tp/tp1/include/figure.h similarity index 100% rename from tp/include/figure.h rename to tp/tp1/include/figure.h diff --git a/tp/include/file.h b/tp/tp1/include/file.h similarity index 100% rename from tp/include/file.h rename to tp/tp1/include/file.h diff --git a/tp/include/polygone.h b/tp/tp1/include/polygone.h similarity index 100% rename from tp/include/polygone.h rename to tp/tp1/include/polygone.h diff --git a/tp/src/main.cpp b/tp/tp1/src/main.cpp similarity index 100% rename from tp/src/main.cpp rename to tp/tp1/src/main.cpp diff --git a/tp/src/polygone.cpp b/tp/tp1/src/polygone.cpp similarity index 100% rename from tp/src/polygone.cpp rename to tp/tp1/src/polygone.cpp diff --git a/tp/tp2/src/main.cpp b/tp/tp2/src/main.cpp new file mode 100644 index 0000000..bdabeec --- /dev/null +++ b/tp/tp2/src/main.cpp @@ -0,0 +1,7 @@ +#include + +int main(void) +{ + std::cout << "Hello TP2 !" << std::endl; + return 0; +} \ No newline at end of file