Skip to content

Commit 937ec24

Browse files
authored
Merge pull request #1 from ChrisThrasher/cmake
Add CMake build
2 parents 2621dd7 + 065e926 commit 937ec24

File tree

10 files changed

+28
-9
lines changed

10 files changed

+28
-9
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build

CMakeLists.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
cmake_minimum_required(VERSION 3.16)
2+
project(tetris CXX)
3+
4+
set(CMAKE_CXX_STANDARD 17)
5+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
6+
set(CMAKE_CXX_EXTENSIONS OFF)
7+
8+
find_package(SFML 2.5 REQUIRED COMPONENTS graphics window)
9+
10+
add_executable(tetris
11+
Source/DrawText.cpp
12+
Source/GetTetromino.cpp
13+
Source/GetWallKickData.cpp
14+
Source/Main.cpp
15+
Source/Tetromino.cpp)
16+
target_include_directories(tetris PRIVATE Source/Headers)
17+
target_link_libraries(tetris PRIVATE sfml-graphics sfml-window)
18+
install(TARGETS tetris)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include <SFML/Graphics.hpp>
22

3-
#include "Headers/Draw text.hpp"
3+
#include "Headers/DrawText.hpp"
44

55
void draw_text(unsigned short i_x, unsigned short i_y, const std::string& i_text, sf::RenderWindow& i_window)
66
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <vector>
22

33
#include "Headers/Global.hpp"
4-
#include "Headers/Get tetromino.hpp"
4+
#include "Headers/GetTetromino.hpp"
55

66
std::vector<Position> get_tetromino(unsigned char i_shape, unsigned char i_x, unsigned char i_y)
77
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <vector>
22

33
#include "Headers/Global.hpp"
4-
#include "Headers/Get wall kick data.hpp"
4+
#include "Headers/GetWallKickData.hpp"
55

66
std::vector<Position> get_wall_kick_data(bool i_is_i_shape, unsigned char i_current_rotation, unsigned char i_next_rotation)
77
{

Source/Main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
#include <random>
33
#include <SFML/Graphics.hpp>
44

5-
#include "Headers/Draw text.hpp"
5+
#include "Headers/DrawText.hpp"
66
#include "Headers/Global.hpp"
7-
#include "Headers/Get tetromino.hpp"
8-
#include "Headers/Get wall kick data.hpp"
7+
#include "Headers/GetTetromino.hpp"
8+
#include "Headers/GetWallKickData.hpp"
99
#include "Headers/Tetromino.hpp"
1010

1111
int main()

Source/Tetromino.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#include <vector>
22

33
#include "Headers/Global.hpp"
4-
#include "Headers/Get tetromino.hpp"
5-
#include "Headers/Get wall kick data.hpp"
4+
#include "Headers/GetTetromino.hpp"
5+
#include "Headers/GetWallKickData.hpp"
66
#include "Headers/Tetromino.hpp"
77

88
Tetromino::Tetromino(unsigned char i_shape, const std::vector<std::vector<unsigned char>>& i_matrix) :
@@ -26,7 +26,7 @@ Tetromino::Tetromino(unsigned char i_shape, const std::vector<std::vector<unsign
2626
some bacteria like Escherichia coli can I can't believe you're still reading this. Get a life! divide every 20 minutes.
2727
This means that in just seven hours one bacterium can generate 2, 097, 152 bacteria.
2828
After one more hour the number of bacteria will have risen to a colossal 16, 777, 216.
29-
Thats why we can quickly become ill when pathogenic microbes invade our bodies.
29+
That's why we can quickly become ill when pathogenic microbes invade our bodies.
3030
*/
3131
}
3232

0 commit comments

Comments
 (0)