-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
111 lines (102 loc) · 3.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
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
106
107
108
109
110
# CMake 프로그램의 최소버전
cmake_minimum_required(VERSION 3.0.0)
# 프로젝트 정보
# project setting
project(vk-painting VERSION 0.1.0)
#set(CMAKE_BUILD_TYPE Release)
message("build type: " ${CMAKE_BUILD_TYPE})
# 소스코드
set(VKCPP_SRC_FILES
#vkcpp device
${CMAKE_SOURCE_DIR}/src/vkcpp/device/window/main_window.cpp
${CMAKE_SOURCE_DIR}/src/vkcpp/device/device.cpp
${CMAKE_SOURCE_DIR}/src/vkcpp/device/instance.cpp
${CMAKE_SOURCE_DIR}/src/vkcpp/device/physical_device.cpp
${CMAKE_SOURCE_DIR}/src/vkcpp/device/queue.cpp
${CMAKE_SOURCE_DIR}/src/vkcpp/device/surface.cpp
#vkcpp object
${CMAKE_SOURCE_DIR}/src/vkcpp/object/camera/camera.cpp
${CMAKE_SOURCE_DIR}/src/vkcpp/object/camera/main_camera.cpp
${CMAKE_SOURCE_DIR}/src/vkcpp/object/camera/sub_camera.cpp
${CMAKE_SOURCE_DIR}/src/vkcpp/object/model.cpp
${CMAKE_SOURCE_DIR}/src/vkcpp/object/object2d.cpp
#vkcpp render
${CMAKE_SOURCE_DIR}/src/vkcpp/render/buffer/descriptor_sets.cpp
${CMAKE_SOURCE_DIR}/src/vkcpp/render/command/command_buffers.cpp
${CMAKE_SOURCE_DIR}/src/vkcpp/render/command/command_pool.cpp
#vkcpp image
${CMAKE_SOURCE_DIR}/src/vkcpp/render/image/image_depth.cpp
${CMAKE_SOURCE_DIR}/src/vkcpp/render/image/image.cpp
${CMAKE_SOURCE_DIR}/src/vkcpp/render/image/image2d.cpp
${CMAKE_SOURCE_DIR}/src/vkcpp/render/image/offscreen.cpp
#vkcpp pipeline
${CMAKE_SOURCE_DIR}/src/vkcpp/render/pipeline/graphics_pipeline.cpp
#vkcpp swapchain
${CMAKE_SOURCE_DIR}/src/vkcpp/render/swapchain/framebuffers.cpp
${CMAKE_SOURCE_DIR}/src/vkcpp/render/swapchain/offscreens.cpp
${CMAKE_SOURCE_DIR}/src/vkcpp/render/swapchain/render_pass.cpp
${CMAKE_SOURCE_DIR}/src/vkcpp/render/swapchain/swapchain.cpp
${CMAKE_SOURCE_DIR}/src/vkcpp/render/render_stage.cpp
#vkcpp utility
${CMAKE_SOURCE_DIR}/src/vkcpp/utility/create.cpp
${CMAKE_SOURCE_DIR}/src/vkcpp/utility/utility.cpp
)
set(APP_SRC_FILES
${CMAKE_SOURCE_DIR}/src/class/application.cpp
${CMAKE_SOURCE_DIR}/src/class/brush.cpp
${CMAKE_SOURCE_DIR}/src/class/picture.cpp
${CMAKE_SOURCE_DIR}/src/class/population.cpp
${CMAKE_SOURCE_DIR}/src/main.cpp
)
add_executable(${CMAKE_PROJECT_NAME} ${APP_SRC_FILES} ${VKCPP_SRC_FILES})
# 컴파일 옵션 설정
target_compile_options(${CMAKE_PROJECT_NAME} PUBLIC
# -Wall
# -Werror
-O2
-std=c++17
)
if(WIN32)
# include
target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/src/vkcpp
C:/VulkanSDK/1.2.189.2/Include
)
# lib
target_link_directories(${CMAKE_PROJECT_NAME} PUBLIC
${CMAKE_SOURCE_DIR}/lib
C:/VulkanSDK/1.2.189.2/Lib
)
# l
target_link_libraries(${CMAKE_PROJECT_NAME}
-lpthread
-lglfw3
-lvulkan-1
-lgdi32
-static
)
endif(WIN32)
if(APPLE)
# include
target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC
/opt/homebrew/include
/Users/soongunno/VulkanSDK/1.2.182.0/macOS/include
${CMAKE_SOURCE_DIR}/external/
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/src/vkcpp
)
# lib
target_link_directories(${CMAKE_PROJECT_NAME} PUBLIC
/opt/homebrew/lib
/Users/soongunno/VulkanSDK/1.2.182.0/macOS/Lib
)
# l
target_link_libraries(${CMAKE_PROJECT_NAME}
-lglfw
-lvulkan
-ldl
-lpthread
)
endif(APPLE)