-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
68 lines (56 loc) · 1.5 KB
/
CMakeLists.txt
File metadata and controls
68 lines (56 loc) · 1.5 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
cmake_minimum_required(VERSION 2.6)
project(vx2)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif(NOT CMAKE_BUILD_TYPE)
add_subdirectory(src)
add_subdirectory(lt)
add_subdirectory(thirdparty)
include_directories(src thirdparty lt/src)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
if(CMAKE_BUILD_TYPE MATCHES Debug)
add_definitions(-DLT_DEBUG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer")
endif(CMAKE_BUILD_TYPE MATCHES Debug)
if(CMAKE_BUILD_TYPE MATCHES Release)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Wall -Wextra")
endif(CMAKE_BUILD_TYPE MATCHES Release)
add_executable(dr
src/main.cpp
src/application.cpp
src/camera.cpp
src/renderer.cpp
src/landscape.cpp
src/resource_manager.cpp
src/pool_allocator.cpp
src/io_task_manager.cpp
src/io_task.cpp
src/shader.cpp
src/world.cpp
src/font.cpp
src/texture.cpp
src/gl_resources.cpp
src/resource_file.cpp
src/skybox.cpp
src/stb_rect_pack.cpp
src/stb_truetype.cpp
src/stb_image.cpp
src/vertex_buffer.cpp
lt/src/lt_math.cpp
lt/src/lt_fs.cpp
thirdparty/glad/glad.cpp
thirdparty/open-simplex-noise.cpp
)
target_link_libraries(dr -ldl -lm)
# GLFW 3
find_package(glfw3 REQUIRED)
include_directories(${GLFW_INCLUDE_DIR})
target_link_libraries(dr glfw)
# OpenGL
find_package(OpenGL REQUIRED)
include_directories(${OPENGL_INCLUDE_DIR})
target_link_libraries(dr ${OPENGL_gl_LIBRARY})
target_link_libraries(dr -lGL)
if (UNIX)
target_link_libraries(dr -pthread)
endif (UNIX)