-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCMakeLists.txt
43 lines (36 loc) · 1.28 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
cmake_minimum_required (VERSION 3.11)
# Define an executable target
project(vulkan_renderer)
add_executable(vulkan_renderer)
target_compile_definitions(vulkan_renderer
PUBLIC _CRT_SECURE_NO_WARNINGS
PUBLIC GLFW_INCLUDE_NONE)
# Specify the required C standard
set_target_properties(vulkan_renderer PROPERTIES C_STANDARD 99)
set_target_properties(vulkan_renderer PROPERTIES CMAKE_C_STANDARD_REQUIRED True)
# Add all of the source code for the renderer itself
add_subdirectory(src)
# Add dear imgui source code
include_directories(ext/imgui)
include_directories(ext/imgui/backends)
target_sources(vulkan_renderer PRIVATE
ext/imgui/imgui.cpp
ext/imgui/imgui_draw.cpp
ext/imgui/imgui_widgets.cpp
ext/imgui/imgui_tables.cpp
ext/imgui/backends/imgui_impl_glfw.cpp
)
# Add VMA
add_subdirectory(ext/VMA)
include_directories(ext/VMA/include)
target_sources(vulkan_renderer PRIVATE ext/VMA/src/VmaUsage.cpp)
# Add Vulkan as dependency
find_package(Vulkan REQUIRED)
# Add GLFW as dependency that will be compiled alongside this project
set(GLFW_BUILD_DOCS False)
set(GLFW_BUILD_EXAMPLES False)
set(GLFW_BUILD_TESTS False)
set(GLFW_VULKAN_STATIC True)
add_subdirectory(ext/glfw)
include_directories(ext/glfw/include)
target_link_libraries(vulkan_renderer PRIVATE Vulkan::Vulkan VulkanMemoryAllocator glfw)