-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathCMakeLists.txt
34 lines (29 loc) · 1.1 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
cmake_minimum_required(VERSION 3.5)
project(snake_game_opengl)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(EXTERNAL_PROJECT_VERSION_GLFW 3.2.1)
set(EXTERNAL_PROJECT_VERSION_GLM 0.9.9.0)
set(EXTERNAL_PROJECT_VERSION_GSL v1.0.0)
include(ExternalProjects.cmake)
include(GNUInstallDirs)
link_directories(${EXTERNAL_PROJECTS_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
add_executable(${PROJECT_NAME}
glad/src/glad.c
src/object/Board.cpp
src/object/Snake.cpp
src/object/Treat.cpp
src/scene/Main.cpp
src/util/ShaderProgram.cpp
src/util/Cube.cpp
src/main.cpp)
target_include_directories(${PROJECT_NAME}
PRIVATE $<BUILD_INTERFACE:${EXTERNAL_PROJECTS_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/glad/include>
PRIVATE $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src>)
if (WIN32)
target_link_libraries(${PROJECT_NAME} opengl32 glfw3)
else()
target_link_libraries(${PROJECT_NAME} GL glfw3 dl pthread X11 Xrandr Xinerama Xcursor Xxf86vm)
endif()