-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
87 lines (74 loc) · 1.95 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
cmake_minimum_required(VERSION 3.16)
# Sets project name
project(path LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
# Sets C++ standard
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Specifies required Qt components
find_package(Qt6 REQUIRED COMPONENTS Core)
find_package(Qt6 REQUIRED COMPONENTS Gui)
find_package(Qt6 REQUIRED COMPONENTS Xml)
# Specifies .cpp and .h files to be passed to the compiler
add_executable(${PROJECT_NAME}
main.cpp
pathtracer.cpp
scene/scene.cpp
BVH/BBox.cpp
BVH/BVH.cpp
scene/camera.cpp
scene/basiccamera.cpp
util/CS123XmlSceneParser.cpp
scene/shape/mesh.cpp
scene/shape/triangle.cpp
pathtracer.h
scene/scene.h
BVH/BBox.h
BVH/BVH.h
BVH/IntersectionInfo.h
BVH/Log.h
BVH/Object.h
BVH/Ray.h
BVH/Stopwatch.h
scene/camera.h
scene/basiccamera.h
util/CS123Common.h
util/CS123ISceneParser.h
util/CS123SceneData.h
util/CS123XmlSceneParser.h
scene/shape/Sphere.h
scene/shape/mesh.h
scene/shape/triangle.h
util/tiny_obj_loader.h
BVH/vector3.h
)
target_link_libraries(${PROJECT_NAME} PRIVATE
Qt::Core
Qt::Gui
Qt::Xml
)
#include openmp
find_package(OpenMP)
if(OpenMP_CXX_FOUND)
target_link_libraries(${PROJECT_NAME} PUBLIC OpenMP::OpenMP_CXX)
endif()
file(GLOB EIGEN_DIR_CONTENTS ${CMAKE_CURRENT_LIST_DIR}/Eigen/*)
list(LENGTH EIGEN_DIR_CONTENTS EIGEN_DIR_SIZE)
if(EIGEN_DIR_SIZE EQUAL 0)
message(FATAL_ERROR "Eigen dependency not pulled, please run `git submodule update --init --recursive`")
endif()
# This allows you to `#include <Eigen/...>`
target_include_directories(${PROJECT_NAME} PRIVATE
Eigen
)
# Set this flag to silence warnings on Windows
if (MSVC OR MSYS OR MINGW)
set(CMAKE_CXX_FLAGS "-Wno-volatile")
endif()
# Set this flag to silence warnings on MacOS
if (APPLE)
set(CMAKE_CXX_FLAGS "-Wno-deprecated-volatile")
endif()