-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
61 lines (45 loc) · 1.46 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
cmake_minimum_required(VERSION 3.22)
project(VulkanEngine)
find_package(Vulkan REQUIRED)
include(FetchContent)
FetchContent_Declare(
glm
GIT_REPOSITORY "https://github.com/g-truc/glm"
GIT_TAG "1.0.1"
GIT_SHALLOW TRUE
)
FetchContent_MakeAvailable(glm)
FetchContent_Declare(
spdlog
GIT_REPOSITORY "https://github.com/gabime/spdlog.git"
GIT_TAG "v1.14.1"
GIT_SHALLOW TRUE
)
FetchContent_MakeAvailable(spdlog)
FetchContent_Declare(
glfw
GIT_REPOSITORY "https://github.com/glfw/glfw"
GIT_TAG "3.4"
GIT_SHALLOW TRUE
)
FetchContent_MakeAvailable(glfw)
FetchContent_Declare(
microsoft-gsl
GIT_REPOSITORY "https://github.com/microsoft/GSL.git"
GIT_TAG "v4.0.0"
GIT_SHALLOW TRUE
)
FetchContent_MakeAvailable(microsoft-gsl)
file(GLOB_RECURSE VulkanEngineSources CONFIGURE_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/src/*.h"
)
add_executable(VulkanEngine ${VulkanEngineSources})
target_link_libraries(VulkanEngine PRIVATE Vulkan::Vulkan)
target_link_libraries(VulkanEngine PRIVATE glm)
target_link_libraries(VulkanEngine PRIVATE glfw)
target_link_libraries(VulkanEngine PRIVATE Microsoft.GSL::GSL)
target_link_libraries(VulkanEngine PRIVATE spdlog)
target_include_directories(VulkanEngine PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src")
target_compile_features(VulkanEngine PRIVATE cxx_std_20)
target_precompile_headers(VulkanEngine PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src/precomp.h")