-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
105 lines (81 loc) · 3.27 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# ----- Workspace Settings -----
cmake_minimum_required(VERSION 3.26)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_EXTENSIONS ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# ----- Crayon Project -----
project(Crayon VERSION 1.0.0)
add_library(Crayon STATIC
src/Crayon.h # File to be included inside projects
src/Crayon/Core/Base.h
src/Crayon/Core/Application.h
src/Crayon/Core/Application.cpp
src/Crayon/Core/EntryPoint.h
src/Crayon/Core/Logger.h
src/Crayon/Core/Logger.cpp
src/Crayon/Events/Event.h
src/Crayon/Events/Event.cpp
src/Crayon/Events/KeyEvent.h
src/Crayon/Events/MouseEvent.h
src/Crayon/Events/WindowEvent.h
src/Crayon/Core/Window.h
src/Crayon/Core/Window.cpp
src/Crayon/Core/Input.h
src/Crayon/Core/Input.cpp
src/Crayon/Graphics/ImGui/imgui_impl_glfw.cpp
src/Crayon/Graphics/ImGui/imgui_impl_glfw.h
src/Crayon/Graphics/ImGui/imgui_impl_opengl3.cpp
src/Crayon/Graphics/ImGui/imgui_impl_opengl3.h
src/Crayon/Graphics/ImGui/ImGuiController.h
src/Crayon/Graphics/ImGui/ImGuiController.cpp
src/Crayon/Graphics/Common.h
src/Crayon/Graphics/Core/VertexArray.h
src/Crayon/Graphics/Core/VertexArray.cpp
src/Crayon/Graphics/Core/VertexBuffer.h
src/Crayon/Graphics/Core/VertexBuffer.cpp
src/Crayon/Graphics/Core/IndexBuffer.h
src/Crayon/Graphics/Core/IndexBuffer.cpp
src/Crayon/Graphics/Core/Shader.h
src/Crayon/Graphics/Core/Shader.cpp
src/Crayon/Graphics/Core/Texture.h
src/Crayon/Graphics/Core/Texture.cpp
src/Crayon/Utils/ResourceLoader.cpp
src/Crayon/Utils/ResourceLoader.h
src/Crayon/Graphics/Utils/CommonUtils.cpp
src/Crayon/Graphics/Utils/CommonUtils.h src/Crayon/Graphics/Utils/VertexLayout.cpp src/Crayon/Graphics/Utils/VertexLayout.h)
target_include_directories(Crayon PUBLIC "src")
target_precompile_headers(Crayon PUBLIC "src/crypch.h")
# ----- Dependencies -----
set(CRAYON_VENDOR_DIR "vendor")
# spdlog
set(SPDLOG_DIR "${CRAYON_VENDOR_DIR}/spdlog")
target_include_directories(Crayon PUBLIC "${SPDLOG_DIR}/include")
# glfw
set(GLFW_DIR "${CRAYON_VENDOR_DIR}/glfw")
add_subdirectory("${GLFW_DIR}")
target_include_directories(Crayon PUBLIC "${GLFW_DIR}/include")
target_link_libraries(Crayon PRIVATE "glfw")
# glad
set(GLAD_DIR "${CRAYON_VENDOR_DIR}/glad")
add_subdirectory("${GLAD_DIR}")
target_include_directories(Crayon PUBLIC "${GLAD_DIR}/include")
target_link_libraries(Crayon PRIVATE "glad")
# imgui
set(IMGUI_DIR "${CRAYON_VENDOR_DIR}/imgui")
add_subdirectory("${IMGUI_DIR}")
target_include_directories(Crayon PUBLIC "${IMGUI_DIR}")
target_link_libraries(Crayon PRIVATE "imgui")
# debugbreak
set(DBGBRK_DIR "${CRAYON_VENDOR_DIR}/debugbreak")
target_include_directories(Crayon PUBLIC "${DBGBRK_DIR}/include")
# glm
set(GLM_DIR "${CRAYON_VENDOR_DIR}/glm")
target_include_directories(Crayon PUBLIC "${GLM_DIR}")
# stb_image
set(STB_IMAGE_DIR "${CRAYON_VENDOR_DIR}/stb_image")
target_include_directories(Crayon PUBLIC "${STB_IMAGE_DIR}/include")
# ----- Examples -----
option(CRAYON_BUILD_EXAMPLES "Crayon Build Examples" ON) # TODO test
if (CRAYON_BUILD_EXAMPLES)
add_subdirectory("examples/Sandbox")
endif ()