This repository has been archived by the owner on Jul 31, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
148 lines (120 loc) · 3.13 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
cmake_minimum_required(VERSION 2.8)
# ---------------------------------------------
# Project settings and dependencies.
# ---------------------------------------------
project(Couscous-raytracer)
find_package (Qt4 REQUIRED)
find_package (OpenGL REQUIRED)
find_package(assimp REQUIRED)
set (QT_USE_QTOPENGL TRUE)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
# ---------------------------------------------
# Project files.
# ---------------------------------------------
set (sources
src/main.cpp
)
list (APPEND couscous_sources
${sources})
set (renderer_sources
src/renderer/aabb.cpp
src/renderer/aabb.h
src/renderer/camera.cpp
src/renderer/camera.h
src/renderer/gridaccelerator.cpp
src/renderer/gridaccelerator.h
src/renderer/material.cpp
src/renderer/material.h
src/renderer/photonMapping.cpp
src/renderer/photonMapping.h
src/renderer/ray.cpp
src/renderer/ray.h
src/renderer/render.cpp
src/renderer/render.h
src/renderer/rng.cpp
src/renderer/rng.h
src/renderer/samplegenerator.cpp
src/renderer/samplegenerator.h
src/renderer/visualobject.cpp
src/renderer/visualobject.h
src/renderer/utility.cpp
src/renderer/utility.h
)
list (APPEND couscous_sources
${renderer_sources})
set (gui_sources
src/gui/dialogmaterial.cpp
src/gui/dialogmaterial.h
src/gui/dialogmaterial.ui
src/gui/dialogmeshfile.cpp
src/gui/dialogmeshfile.h
src/gui/dialogmeshfile.ui
src/gui/dialogobject.cpp
src/gui/dialogobject.h
src/gui/dialogobject.ui
src/gui/frameviewer.cpp
src/gui/frameviewer.h
src/gui/mainwindow.cpp
src/gui/mainwindow.h
src/gui/mainwindow.ui
src/gui/scene.cpp
src/gui/scene.h
)
list (APPEND couscous_sources
${gui_sources})
set (io_sources
src/io/filereader.cpp
src/io/filereader.h
)
list (APPEND couscous_sources
${io_sources})
set (common_sources
src/common/logger.cpp
src/common/logger.h
)
list (APPEND couscous_sources
${common_sources})
set (test_sources
src/test/catch.hpp
src/test/test.cpp
src/test/test.h
)
list (APPEND couscous_sources
${test_sources})
set (resources
icons/icons.qrc
)
# ---------------------------------------------
# Compiler options.
# ---------------------------------------------
if (CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
if (CMAKE_BUILD_TYPE EQUAL "RELEASE")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
endif()
endif()
# ---------------------------------------------
# Compie Qt files.
# ---------------------------------------------
QT4_ADD_RESOURCES (couscous_resource_files
${resources}
)
# ---------------------------------------------
# Create executable.
# ---------------------------------------------
include (${QT_USE_FILE})
include_directories(
src
${ASSIMP_INCLUDE_DIR}
distant)
add_executable(${PROJECT_NAME} ${couscous_sources} ${couscous_resource_files})
target_link_libraries (${PROJECT_NAME}
Qt4::QtGui
Qt4::QtCore
Qt4::QtOpenGL
Qt4::QtMultimedia
${OPENGL_LIBRARIES}
${ASSIMP_LIBRARIES}
)