-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
46 lines (38 loc) · 1.24 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
cmake_minimum_required(VERSION 3.16)
project(tetris VERSION 0.1.0)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD "${CMAKE_CXX_STANDARD} -Wall -Wextra -Werror")
find_package(OpenGL REQUIRED)
find_package(glm REQUIRED)
find_package(Freetype REQUIRED)
find_package(ZLIB REQUIRED)
add_executable(
tetris
${ZLIB_TEST_SOURCES}
dependencies/glad/src/glad.c
src/engine/error.cpp
src/engine/renderer.cpp
src/engine/shader.cpp
src/engine/stb.cpp
src/game/application.cpp
src/game/game.cpp
src/game/gameRender.cpp
src/game/main.cpp
src/game/memoryReplay.cpp
src/game/processInput.cpp
src/game/settings.cpp)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
if(ZLIB_FOUND)
include_directories(${ZLIB_INCLUDE_DIRS})
endif()
include_directories(${OPENGL_INCLUDE_DIRS})
include_directories(${FREETYPE_INCLUDE_DIR_ft2build})
include_directories(dependencies/ dependencies/glad/include/ ./src/)
target_link_libraries(tetris glfw)
target_link_libraries(tetris OpenGL::GL)
target_link_libraries(tetris ${FREETYPE_LIBRARY})
target_link_libraries(tetris ${ZLIB_LIBRARIES})
add_custom_command(
TARGET tetris
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/res/ $<TARGET_FILE_DIR:tetris>/res/)