-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
65 lines (56 loc) · 1.93 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
cmake_minimum_required(VERSION 3.22)
project(
WebGPUTracer
VERSION 0.1.0
LANGUAGES CXX C
)
set(CMAKE_CXX_STANDARD 17)
# Development option
option(DEV_MODE "Set up development helper settings" ON)
add_subdirectory(glfw)
add_subdirectory(glfw3webgpu)
add_subdirectory(webgpu)
add_subdirectory(imgui)
add_executable(WebGPUTracer
src/main.cpp
src/camera.cpp
src/render.cpp
src/objects/box.cpp
src/objects/cornell_box.cpp
src/objects/triangle.cpp
src/objects/quad.cpp
src/objects/vertex.cpp
src/scene.cpp
external/implementation.cpp)
include_directories(src/include)
include_directories(glm)
include_directories("external/stb")
include_directories("external/tinyobjloader")
if (DEV_MODE)
target_compile_definitions(WebGPUTracer PRIVATE
RESOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}/resources"
)
else ()
file(COPY resources DESTINATION ${CMAKE_BINARY_DIR})
target_compile_definitions(WebGPUTracer PRIVATE
RESOURCE_DIR="./resources"
)
endif ()
target_link_libraries(WebGPUTracer PRIVATE glfw webgpu glfw3webgpu imgui)
set_target_properties(WebGPUTracer PROPERTIES
CXX_STANDARD 17
)
# Warning Settings
if (MSVC)
set_target_properties(WebGPUTracer PROPERTIES VS_DEBUGGER_ENVIRONMENT "DAWN_DEBUG_BREAK_ON_ERROR=1")
target_compile_options(WebGPUTracer PRIVATE /W4)
else ()
target_compile_options(WebGPUTracer PRIVATE -Wall -Wextra -pedantic)
endif ()
if(XCODE)
set_target_properties(WebGPUTracer PROPERTIES
XCODE_GENERATE_SCHEME ON
XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE "Metal")
endif()
# This might be unnecessary
target_copy_webgpu_binaries(WebGPUTracer)