Added multiple tp management. Moved tp to tp1. Created tp2 with simple Hello World program.
This commit is contained in:
parent
81982350e8
commit
b8fe134405
9 changed files with 13 additions and 5 deletions
|
@ -10,6 +10,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
# Set the etape value
|
# Set the etape value
|
||||||
set(ETAPE "1" CACHE STRING "Entrez l'exercice a compiler.")
|
set(ETAPE "1" CACHE STRING "Entrez l'exercice a compiler.")
|
||||||
set(TD "1" CACHE STRING "Entrez le td a compiler.")
|
set(TD "1" CACHE STRING "Entrez le td a compiler.")
|
||||||
|
set(TP "1" CACHE STRING "Entrez le td a compiler.")
|
||||||
|
|
||||||
# Etapes exercice
|
# Etapes exercice
|
||||||
file(GLOB SOURCES_EXE "${PROJECT_SOURCE_DIR}/exercice/etape${ETAPE}/*.cpp")
|
file(GLOB SOURCES_EXE "${PROJECT_SOURCE_DIR}/exercice/etape${ETAPE}/*.cpp")
|
||||||
|
@ -18,12 +19,12 @@ add_executable(${EXERCICE_TARGET} ${SOURCES_EXE})
|
||||||
# TD
|
# TD
|
||||||
file(GLOB SOURCES_TD "${PROJECT_SOURCE_DIR}/td/td${TD}/src/*.cpp")
|
file(GLOB SOURCES_TD "${PROJECT_SOURCE_DIR}/td/td${TD}/src/*.cpp")
|
||||||
add_executable(${TD_TARGET} ${SOURCES_TD})
|
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
|
#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})
|
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
|
# Adding compilation option depending on the OS
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
|
|
|
@ -12,9 +12,9 @@ mkdir build
|
||||||
cd 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
|
### Lancer la compilation
|
||||||
|
|
||||||
|
|
7
tp/tp2/src/main.cpp
Normal file
7
tp/tp2/src/main.cpp
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
std::cout << "Hello TP2 !" << std::endl;
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue