-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
67 lines (49 loc) · 1.84 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
60
61
62
63
64
65
66
67
cmake_minimum_required(VERSION 3.5)
project(ChessOpenGL)
if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/dependencies/cglm OR IS_DIRECTORY ${CMAKE_SOURCE_DIR}/dependencies/glfw)
else()
message("\n==================================================================================================")
message(SEND_ERROR "Did you forget to git clone --recurse-submodules https://github.com/hxajk/ChessOpenGL ?")
message("==================================================================================================")
endif()
if(WIN32)
find_package(glfw3 REQUIRED PATHS "${CMAKE_SOURCE_DIR}/dependencies/glfw/Windows/")
elseif(UNIX)
find_package(glfw3 REQUIRED PATHS "${CMAKE_SOURCE_DIR}/dependencies/glfw/Linux/")
endif()
find_package(cglm PATHS "${CMAKE_SOURCE_DIR}/dependencies/cglm")
find_package(glad REQUIRED PATHS "${CMAKE_SOURCE_DIR}/dependencies/GLAD/")
message(${CMAKE_SOURCE_DIR})
option(DEBUG "Debug mode" OFF)
if(DEBUG)
find_package(imgui PATHS "C:/Deps/ImGui/")
endif()
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/
${CMAKE_CURRENT_SOURCE_DIR}/dependencies/stb_image
)
set(SOURCES
${CMAKE_SOURCE_DIR}/main.c
# gfx folder
${CMAKE_SOURCE_DIR}/Chess/gfx/vao.c
${CMAKE_SOURCE_DIR}/Chess/gfx/vbo.c
${CMAKE_SOURCE_DIR}/Chess/gfx/shader.c
${CMAKE_SOURCE_DIR}/Chess/gfx/texture.c
${CMAKE_SOURCE_DIR}/Chess/gfx/window.c
# core folder
${CMAKE_SOURCE_DIR}/Chess/core/board.c
${CMAKE_SOURCE_DIR}/Chess/core/piece.c
${CMAKE_SOURCE_DIR}/Chess/core/module.c
# util folder
${CMAKE_SOURCE_DIR}/Chess/util/data.c
${CMAKE_SOURCE_DIR}/Chess/util/parser.c
)
add_executable(run ${SOURCES})
target_link_libraries(run glfw glad cglm::cglm)
if(DEBUG)
#[[ add_custom_command(OUTPUT Debug...
COMMAND "./run.exe"
DEPENDS run)
add_custom_target(Debug ALL
DEPENDS Debug...) ]]
endif()