-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
74 lines (64 loc) · 2.12 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
cmake_minimum_required(VERSION 3.30)
project(vk-deferred LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_MODULE_STD 1)
# ----------------
# External dependencies.
# ----------------
find_package(glfw3 CONFIG REQUIRED)
find_package(glm CONFIG REQUIRED)
find_package(vku CONFIG REQUIRED)
# ----------------
# Module configurations for external dependencies.
# ----------------
if (NOT TARGET glm_module)
add_library(glm_module)
target_sources(glm_module PUBLIC
FILE_SET CXX_MODULES
BASE_DIRS extlibs
FILES extlibs/module-ports/glm.cppm
)
target_link_libraries(glm_module PUBLIC glm::glm)
target_compile_definitions(glm_module PUBLIC
GLM_GTC_INLINE_NAMESPACE
GLM_FORCE_DEPTH_ZERO_TO_ONE
GLM_FORCE_XYZW_ONLY
)
add_library(glm::module ALIAS glm_module)
endif()
# ----------------
# Project targets.
# ----------------
add_executable(vk-deferred main.cpp)
target_sources(vk-deferred PRIVATE
FILE_SET CXX_MODULES
FILES
interface/mod.cppm
interface/MainApp.cppm
interface/vulkan/attachment_group/DeferredLighting.cppm
interface/vulkan/attachment_group/GBuffer.cppm
interface/vulkan/attachment_group/Swapchain.cppm
interface/vulkan/descriptor_set_layout/GBufferInput.cppm
interface/vulkan/descriptor_set_layout/HdrInput.cppm
interface/vulkan/Frame.cppm
interface/vulkan/Gpu.cppm
interface/vulkan/mesh/Floor.cppm
interface/vulkan/mesh/Sphere.cppm
interface/vulkan/buffer/FloorTransforms.cppm
interface/vulkan/buffer/LightInstances.cppm
interface/vulkan/buffer/SphereTransforms.cppm
interface/vulkan/pipeline/DeferredLightRenderer.cppm
interface/vulkan/pipeline/GBufferRenderer.cppm
interface/vulkan/pipeline/ToneMappingRenderer.cppm
interface/vulkan/render_pass/Deferred.cppm
interface/vulkan/SharedData.cppm
)
target_link_libraries(vk-deferred PRIVATE
glfw
glm::module
vku::vku
)
target_compile_definitions(vk-deferred PRIVATE
GLFW_INCLUDE_NONE
COMPILED_SHADER_DIR="${CMAKE_CURRENT_SOURCE_DIR}/shaders"
)