-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
59 lines (47 loc) · 1.48 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
50
51
52
53
54
55
56
57
58
59
cmake_minimum_required(VERSION 3.5)
SET(CMAKE_EXPORT_COMPILE_COMMANDS 1)
SET(CMAKE_CXX_STANDARD 20)
SET(CMAKE_CXX_STANDARD_REQUIRED True)
project(tpOpenGL)
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
set(SOURCES
main.cpp
gl_objects/mesh.cpp
gl_objects/shader.cpp
gl_objects/texture.cpp
world_builder.cpp
chunks/chunk.cpp
chunks/chunk_manager.cpp
chunks/chunk_dealer.cpp
SimplexNoise.cpp
utils/gl_includes.hpp
utils/debug.hpp
gl_objects/mesh.hpp
gl_objects/shader.hpp
gl_objects/texture.hpp
chunks/chunk.hpp
chunks/chunk_manager.hpp
chunks/chunk_dealer.hpp
world_builder.hpp
block_palette.hpp
camera.hpp
SimplexNoise.h
player.hpp
)
add_executable(${PROJECT_NAME} ${SOURCES})
target_sources(${PROJECT_NAME} PRIVATE dep/glad/src/glad.c)
target_include_directories(${PROJECT_NAME} PRIVATE dep/glad/include/)
add_subdirectory(dep/glfw)
target_link_libraries(${PROJECT_NAME} glfw)
add_subdirectory(dep/glm)
target_link_libraries(${PROJECT_NAME} glm)
set(JSON_BuildTests OFF CACHE INTERNAL "")
add_subdirectory(dep/json)
target_link_libraries(${PROJECT_NAME} nlohmann_json::nlohmann_json)
target_link_libraries(${PROJECT_NAME} ${CMAKE_DL_LIBS})
# Create a custom target to copy resources to the build directory (Added by Telo PHILIPPE)
add_custom_target(CopyResources
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/resources ${CMAKE_BINARY_DIR}/resources
)