-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
49 lines (39 loc) · 1.41 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
47
48
49
cmake_minimum_required (VERSION 3.11)
project(gym)
set (CMAKE_CXX_STANDARD 17)
set(CMAKE_BUILD_TYPE Debug)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
OPTION(USERDIR_RESOURCES "Allow using local userdirectory resources" ON)
set(CMAKE_CXX_FLAGS "-fpermissive -no-pie -ggdb")
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
file (GLOB common_sources
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
glad.c)
list(REMOVE_DUPLICATES common_sources)
# Add OpenGL
find_package(OpenGL)
link_libraries(${OpenGL_LIBRARIES})
include_directories(${OpenGL_INCLUDE_DIR})
# Add rendering external libs
find_library(GLFW3 glfw ${CMAKE_CURRENT_SOURCE_DIR}/external/glfw/)
find_library(GLAD glad ${CMAKE_CURRENT_SOURCE_DIR}/external/glad/)
find_library(GLM glm_static ${CMAKE_CURRENT_SOURCE_DIR}/external/glm/)
find_library(FREETYPE freetype ${CMAKE_CURRENT_SOURCE_DIR}/external/freetype/lib/)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/external/glm/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/external/glad/include/)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/external/glfw/include/)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/external/freetype/include/freetype2/)
# For stb_image.h and other libs there
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/external/)
add_executable(game ${common_sources})
target_link_libraries(game
${GLFW3}
${GLAD}
${GLM}
${FREETYPE}
"-lX11"
"-lGL"
"-ldl"
"-lpthread"
"-lm"
)