-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
116 lines (93 loc) · 4.26 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
111
cmake_minimum_required(VERSION 3.12)
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake"
CACHE STRING "Vcpkg toolchain file")
execute_process(COMMAND ./vcpkg install assimap meshoptimizer WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/vcpkg)
project(PBRTEditor LANGUAGES CXX C)
# Get the absolute path of the current source directory
get_filename_component(PROJECT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE)
message(STATUS "Project source directory: ${PROJECT_SOURCE_DIR}")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# For sanitizers
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}/cmake")
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message (STATUS "Setting build type to 'Release' as none was specified.")
set (CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
set_property (CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
"MinSizeRel" "RelWithDebInfo")
endif ()
find_package(Threads)
find_package(Vulkan REQUIRED)
find_package(assimp CONFIG REQUIRED)
find_package(meshoptimizer CONFIG REQUIRED)
if(${Vulkan_FOUND})
message("find vulkan version : " ${Vulkan_VERSION})
endif ()
if(MSVC)
message("")
endif ()
if(APPLE)
message("Build on Apple platform")
endif ()
# for external
set(BUILD_SHARED_LIBS OFF)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/ext)
include_directories(src/ext)
include_directories(src/ext/glm)
include_directories(src/ext/glfw/include)
include_directories(src/ext/tinyobjloader)
include_directories(src/ext/imgui/include)
include_directories(src/ext/stb)
include_directories(src/ext/vma)
include_directories(src/ext/spirv_reflect)
add_executable(editor_exe src/pbrt_scene_editor/main.cpp
src/pbrt_scene_editor/viewer.cpp
src/pbrt_scene_editor/window.cpp
src/pbrt_scene_editor/window.h
src/pbrt_scene_editor/window_config.h
src/pbrt_scene_editor/VkBootstrap.cpp
src/pbrt_scene_editor/VkBootstrap.h
src/pbrt_scene_editor/VkBootstrapDispatch.h
src/pbrt_scene_editor/editorGUI.h
src/pbrt_scene_editor/editorGUI.cpp
src/pbrt_scene_editor/VulkanExtension.h
src/pbrt_scene_editor/AssetFileTree.cpp
src/pbrt_scene_editor/sceneViewer.cpp
src/pbrt_scene_editor/sceneGraphEditor.cpp
src/pbrt_scene_editor/AssetManager.cpp
src/pbrt_scene_editor/Insepctor.cpp
src/pbrt_scene_editor/PBRTParser.h
src/pbrt_scene_editor/PBRTParser.cpp
src/pbrt_scene_editor/TokenParser.cpp
src/pbrt_scene_editor/LoggerGUI.cpp
src/pbrt_scene_editor/GlobalLogger.h
src/pbrt_scene_editor/SceneBuilder.hpp
src/pbrt_scene_editor/SceneBuilder.cpp
src/pbrt_scene_editor/Insepctor.cpp
src/pbrt_scene_editor/RenderScene.h
src/pbrt_scene_editor/RenderScene.cpp
src/pbrt_scene_editor/GPUFrame.hpp
src/pbrt_scene_editor/GPUFrame.cpp
src/pbrt_scene_editor/FrameGraphResourceDef.hpp
src/pbrt_scene_editor/FrameGraph.hpp
src/pbrt_scene_editor/FrameGraph.cpp
src/pbrt_scene_editor/GPUPass.h
src/pbrt_scene_editor/GPUPass.cpp
src/pbrt_scene_editor/ShaderManager.cpp
src/pbrt_scene_editor/ShaderManager.h
src/pbrt_scene_editor/Singleton.h
src/pbrt_scene_editor/VulkanExtension.cpp
src/pbrt_scene_editor/ApplicationConfig.h
src/pbrt_scene_editor/ThreadPool.h
src/pbrt_scene_editor/offlineRender.hpp
src/pbrt_scene_editor/offlineRender.cpp
src/pbrt_scene_editor/PassDefinition.cpp)
target_compile_definitions(editor_exe PRIVATE EDITOR_PROJECT_SOURCE_DIR="${PROJECT_SOURCE_DIR}")
target_link_libraries(editor_exe PRIVATE Vulkan::Vulkan)
target_link_libraries(editor_exe PRIVATE glfw)
target_link_libraries(editor_exe PRIVATE imgui)
target_link_libraries(editor_exe PRIVATE stb)
target_link_libraries(editor_exe PRIVATE vma)
target_link_libraries(editor_exe PRIVATE assimp::assimp)
target_link_libraries(editor_exe PRIVATE meshoptimizer::meshoptimizer)
target_link_libraries(editor_exe PRIVATE spirv_reflect)