-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
25 lines (18 loc) · 986 Bytes
/
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
cmake_minimum_required(VERSION 3.19)
project(gather-sun C)
set(CMAKE_C_STANDARD 11)
add_executable(gather-sun main.c window.h window.c graphics.c graphics.h sprite.h scene.c scene.h vec.h renderer.c renderer.h entity.h player.h font.c font.h ui.h ui.c event.c event.h state.c state.h camera.c camera.h)
# GLAD CMake project requires python3 + jinja2
find_package(Python3 COMPONENTS Interpreter jinja2)
add_subdirectory(lib/glad/cmake)
glad_add_library(glad_glcore_46 API gl:core=4.6)
set(GLFW_INSTALL OFF)
add_subdirectory(lib/glfw)
add_subdirectory(lib/cglm)
set(ENABLE_CJSON_TEST Off)
set(ENABLE_TARGET_EXPORT Off)
add_subdirectory(lib/cJSON)
target_include_directories(gather-sun PRIVATE lib/stb)
target_include_directories(gather-sun PRIVATE lib/cJSON)
target_link_libraries(gather-sun PRIVATE glad_glcore_46 glfw cglm cjson)
add_custom_command(TARGET gather-sun PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/res/ $<TARGET_FILE_DIR:gather-sun>/res)