-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
74 lines (55 loc) · 2.15 KB
/
CMakeLists.txt
File metadata and controls
74 lines (55 loc) · 2.15 KB
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.16)
project(renderEngine)
set(CMAKE_CXX_STANDARD 20)
# Engine src
set(SRC "src/main.cpp" "src/renderEngine.cpp" "src/windowManager.cpp" "src/SceneManager.cpp" "src/geometry.cpp")
set(HEADER "include/renderEngine.h" "include/windowManager.h" "include/geometry.h" "include/common.h")
# vulkan module src
set(VULKAN_SRC "src/vulkanWrapper.cpp" "include/vulkanWrapper.h")
# d3d11 module src
set(D3D11_SRC "src/d3d11Wrapper.cpp" "include/d3d11Wrapper.h")
# logger module src
set(LOGGER_SRC "src/logger.cpp" "include/logger.h")
#imgui
set(IMGUI_SRC
"thirdparty/imgui/imgui.cpp"
"thirdparty/imgui/imgui_demo.cpp"
"thirdparty/imgui/imgui_draw.cpp"
"thirdparty/imgui/imgui_tables.cpp"
"thirdparty/imgui/imgui_widgets.cpp"
"thirdparty/imgui/backends/imgui_impl_dx11.cpp" "thirdparty/imgui/backends/imgui_impl_sdl2.cpp")
# required external libs
find_package(Vulkan REQUIRED)
find_package(glfw3 CONFIG REQUIRED)
find_package(glm CONFIG REQUIRED)
find_package(SDL2 CONFIG REQUIRED)
find_package(Tracy CONFIG REQUIRED)
find_package(Stb REQUIRED)
# imgui module library
add_library(imgui_module STATIC ${IMGUI_SRC})
target_include_directories(imgui_module PUBLIC "thirdparty/imgui")
target_link_libraries(imgui_module PUBLIC
$<TARGET_NAME_IF_EXISTS:SDL2::SDL2main> # SDL2
$<IF:$<TARGET_EXISTS:SDL2::SDL2>,SDL2::SDL2,SDL2::SDL2-static>
)
# logger module library
add_library(logger_module STATIC ${LOGGER_SRC})
target_link_libraries(logger_module PUBLIC)
# vulkan module library
add_library(Vulkan_module STATIC ${VULKAN_SRC})
target_link_libraries(Vulkan_module PUBLIC glfw glm::glm Vulkan::Vulkan logger_module)
# d3d11 module library
add_library(D3D11_module STATIC ${D3D11_SRC})
target_link_libraries(D3D11_module PUBLIC glm::glm d3d11.lib d3dcompiler.lib dxguid.lib imgui_module)
# render engine exe.
add_executable(${PROJECT_NAME} ${SRC} ${HEADER})
target_link_libraries(${PROJECT_NAME}
$<TARGET_NAME_IF_EXISTS:SDL2::SDL2main> # SDL2
$<IF:$<TARGET_EXISTS:SDL2::SDL2>,SDL2::SDL2,SDL2::SDL2-static>
# Vulkan_module
D3D11_module
logger_module
Tracy::TracyClient
)
target_include_directories(${PROJECT_NAME} PRIVATE ${Stb_INCLUDE_DIR})
add_definitions(/arch:AVX2)