summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormanzerbredes <loic.guegan_secondary@yahoo.fr>2015-04-29 19:34:01 +0200
committermanzerbredes <loic.guegan_secondary@yahoo.fr>2015-04-29 19:34:01 +0200
commit9fbd4e0fedea42a206843981dffeb87095797581 (patch)
tree557c45099cb732ed298633d2a1a9e60bfe472998
parent674563203b5653238a2ae6ef4a0a267a7661607b (diff)
Enable cmake for model
-rw-r--r--.gitignore2
-rw-r--r--src/CMakeLists.txt4
-rw-r--r--src/Model/CMakeLists.txt8
-rw-r--r--src/Model/Cell.cpp4
-rw-r--r--src/Model/Cell.hpp2
-rw-r--r--src/Model/Grid.cpp5
-rw-r--r--src/Model/Grid.hpp4
-rw-r--r--src/main.cpp4
8 files changed, 23 insertions, 10 deletions
diff --git a/.gitignore b/.gitignore
index 8f10546..5c15316 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,6 @@
CMakeFiles
+*.a
+*.o
cmake_install.cmake
Makefile
CMakeCache.txt
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b30833e..a946644 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -7,9 +7,11 @@ add_executable(
#Find all libraries
find_package(SFML 2.2 COMPONENTS system window graphics audio REQUIRED)
+set_property(GLOBAL PROPERTY SFML_LIBRARIES "${SFML_LIBRARIES}")
+set_property(GLOBAL PROPERTY SFML_INCLUDE_DIR "${SFML_INCLUDE_DIR}")
#Include "Includes" and "Libraries"
include_directories(${SFML_INCLUDE_DIR})
target_link_libraries(2P11 ${SFML_LIBRARIES})
-message("${SFML_LIBRARIES}")
+add_subdirectory(./Model)
diff --git a/src/Model/CMakeLists.txt b/src/Model/CMakeLists.txt
new file mode 100644
index 0000000..c9cfb6e
--- /dev/null
+++ b/src/Model/CMakeLists.txt
@@ -0,0 +1,8 @@
+#Retrieve crypto++ libraries
+get_property(SFML_LIBRARIES GLOBAL PROPERTY SFML_LIBRARIES)
+
+#Make CryptClass lib
+add_library(Model ./Cell.cpp ./Game.cpp ./Grid.cpp)
+
+#Add crypto++ to CryptClass
+target_link_libraries(Model ${SFML_LIBRARIES})
diff --git a/src/Model/Cell.cpp b/src/Model/Cell.cpp
index 24fc53c..a0729f7 100644
--- a/src/Model/Cell.cpp
+++ b/src/Model/Cell.cpp
@@ -19,9 +19,9 @@ Cell::~Cell()
}
// Description
-
+/*
void Cell::description()
{
return m_value;
}
-
+*/
diff --git a/src/Model/Cell.hpp b/src/Model/Cell.hpp
index 7775bf5..dd946ab 100644
--- a/src/Model/Cell.hpp
+++ b/src/Model/Cell.hpp
@@ -21,7 +21,7 @@ class Cell
~Cell();
// Describes the cell in a terminal
- std::string description();
+ //std::string description();
};
diff --git a/src/Model/Grid.cpp b/src/Model/Grid.cpp
index 94ef5d7..d7d3f15 100644
--- a/src/Model/Grid.cpp
+++ b/src/Model/Grid.cpp
@@ -1,5 +1,6 @@
-#include "Grid.h"
+#include "Grid.hpp"
+/*
Grid::Grid(int size)
{
m_table = std::vector<std::vector<Cell*>>(size);
@@ -34,4 +35,4 @@ void Grid::description()
std::cout << std::endl;
}
}
-
+*/
diff --git a/src/Model/Grid.hpp b/src/Model/Grid.hpp
index a9c6c86..304e436 100644
--- a/src/Model/Grid.hpp
+++ b/src/Model/Grid.hpp
@@ -11,7 +11,7 @@
#include <vector>
#include "Cell.hpp"
-
+/*
class Grid
{
private:
@@ -22,6 +22,6 @@ class Grid
~Grid();
void description();
};
+*/
#endif
-
diff --git a/src/main.cpp b/src/main.cpp
index 597ce39..689767a 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -5,9 +5,9 @@
int main()
{
- Grid * grid = new Grid();
+// Grid * grid = new Grid();
- grid->description();
+// grid->description();
return 0;
}