-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
59 lines (50 loc) · 1.44 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
cmake_minimum_required(VERSION 3.15)
# set the project name
project(vpathtracer)
# Disable building extras we won't need (pure C++ project)
set(NANOGUI_BUILD_EXAMPLE OFF CACHE BOOL " " FORCE)
set(NANOGUI_BUILD_PYTHON OFF CACHE BOOL " " FORCE)
set(NANOGUI_INSTALL OFF CACHE BOOL " " FORCE)
# Add the configurations from nanogui
add_subdirectory(ext/nanogui)
# For reliability of parallel build, make the NanoGUI targets dependencies
set_property(TARGET glfw glfw_objects nanogui PROPERTY FOLDER "dependencies")
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/include
)
add_executable(${PROJECT_NAME}
# headers
include/common.h
include/application.h
include/renderer.h
include/obj_loader.h
include/scene.h
include/object.h
include/triangle.h
include/ray.h
include/material.h
include/hit_record.h
include/camera.h
include/accel_structure.h
include/utils.h
# sources
src/main.cpp
src/application.cpp
src/renderer.cpp
src/scene.cpp
src/object.cpp
src/triangle.cpp
src/material.cpp
src/camera.cpp
src/accel_structure.cpp
src/utils.cpp
)
find_package(Threads REQUIRED)
target_link_libraries(${PROJECT_NAME} PUBLIC nanogui Threads::Threads)
target_include_directories(${PROJECT_NAME} PUBLIC
ext/nanogui/include
ext/nanogui/ext/nanovg/src
ext/nanogui/ext/nanovg/example
ext/glm/include
)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)