Fixed CMake error include. Added Base Vector for TD1.
This commit is contained in:
parent
a5e2182159
commit
f299a902e8
4 changed files with 31 additions and 1 deletions
|
@ -17,7 +17,7 @@ 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${ETAPE}/include/")
|
||||
|
||||
# Adding compilation option depending on the OS
|
||||
if(MSVC)
|
||||
|
|
13
td/td1/include/vector.h
Normal file
13
td/td1/include/vector.h
Normal file
|
@ -0,0 +1,13 @@
|
|||
#ifndef HEADER_VECTOR
|
||||
#define HEADER_VECTOR
|
||||
|
||||
class Vector{
|
||||
public:
|
||||
Vector();
|
||||
~Vector();
|
||||
void Affiche();
|
||||
private:
|
||||
int _value;
|
||||
};
|
||||
|
||||
#endif //HEADER_VECTOR
|
|
@ -1,7 +1,10 @@
|
|||
#include <iostream>
|
||||
#include "../include/vector.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
Vector coolVector;
|
||||
coolVector.Affiche();
|
||||
std::cout << "Hello world!" << std::endl;
|
||||
return 0;
|
||||
}
|
14
td/td1/src/vector.cpp
Normal file
14
td/td1/src/vector.cpp
Normal file
|
@ -0,0 +1,14 @@
|
|||
#include "../include/vector.h"
|
||||
#include <iostream>
|
||||
|
||||
Vector::Vector()
|
||||
: _value(1)
|
||||
{}
|
||||
|
||||
Vector::~Vector()
|
||||
{}
|
||||
|
||||
void Vector::Affiche()
|
||||
{
|
||||
std::cout << "Vector: " << _value << std::endl;
|
||||
}
|
Loading…
Add table
Reference in a new issue