Enable cmake for model

This commit is contained in:
manzerbredes 2015-04-29 19:34:01 +02:00
parent 674563203b
commit 9fbd4e0fed
8 changed files with 23 additions and 10 deletions

2
.gitignore vendored
View file

@ -1,4 +1,6 @@
CMakeFiles CMakeFiles
*.a
*.o
cmake_install.cmake cmake_install.cmake
Makefile Makefile
CMakeCache.txt CMakeCache.txt

View file

@ -7,9 +7,11 @@ add_executable(
#Find all libraries #Find all libraries
find_package(SFML 2.2 COMPONENTS system window graphics audio REQUIRED) 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 "Includes" and "Libraries"
include_directories(${SFML_INCLUDE_DIR}) include_directories(${SFML_INCLUDE_DIR})
target_link_libraries(2P11 ${SFML_LIBRARIES}) target_link_libraries(2P11 ${SFML_LIBRARIES})
message("${SFML_LIBRARIES}") add_subdirectory(./Model)

8
src/Model/CMakeLists.txt Normal file
View file

@ -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})

View file

@ -19,9 +19,9 @@ Cell::~Cell()
} }
// Description // Description
/*
void Cell::description() void Cell::description()
{ {
return m_value; return m_value;
} }
*/

View file

@ -21,7 +21,7 @@ class Cell
~Cell(); ~Cell();
// Describes the cell in a terminal // Describes the cell in a terminal
std::string description(); //std::string description();
}; };

View file

@ -1,5 +1,6 @@
#include "Grid.h" #include "Grid.hpp"
/*
Grid::Grid(int size) Grid::Grid(int size)
{ {
m_table = std::vector<std::vector<Cell*>>(size); m_table = std::vector<std::vector<Cell*>>(size);
@ -34,4 +35,4 @@ void Grid::description()
std::cout << std::endl; std::cout << std::endl;
} }
} }
*/

View file

@ -11,7 +11,7 @@
#include <vector> #include <vector>
#include "Cell.hpp" #include "Cell.hpp"
/*
class Grid class Grid
{ {
private: private:
@ -22,6 +22,6 @@ class Grid
~Grid(); ~Grid();
void description(); void description();
}; };
*/
#endif #endif

View file

@ -5,9 +5,9 @@
int main() int main()
{ {
Grid * grid = new Grid(); // Grid * grid = new Grid();
grid->description(); // grid->description();
return 0; return 0;
} }