forked from wjakob/nori
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
148 lines (137 loc) · 3.76 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
148
cmake_minimum_required (VERSION 3.2)
project(nori)
add_subdirectory(ext ext_build)
find_package(OpenCV REQUIRED)
include_directories(
# OpenCV
${OpenCV_INCLUDE_DIRS}
# Nori include files
${CMAKE_CURRENT_SOURCE_DIR}/include
# tinyformat string formatting library
${TFM_INCLUDE_DIR}
# Eigen linear algebra library
SYSTEM ${EIGEN_INCLUDE_DIR}
# OpenEXR high dynamic range bitmap library
SYSTEM ${OPENEXR_INCLUDE_DIRS}
# Intel Thread Building Blocks
SYSTEM ${TBB_INCLUDE_DIR}
# Pseudorandom number generator
${PCG32_INCLUDE_DIR}
# PugiXML parser
${PUGIXML_INCLUDE_DIR}
# Helper functions for statistical hypothesis tests
${HYPOTHESIS_INCLUDE_DIR}
# GLFW library for OpenGL context creation
SYSTEM ${GLFW_INCLUDE_DIR}
# GLEW library for accessing OpenGL functions
SYSTEM ${GLEW_INCLUDE_DIR}
# NanoVG drawing library
SYSTEM ${NANOVG_INCLUDE_DIR}
# NanoGUI user interface library
SYSTEM ${NANOGUI_INCLUDE_DIR}
SYSTEM ${NANOGUI_EXTRA_INCS}
# Portable filesystem API
SYSTEM ${FILESYSTEM_INCLUDE_DIR}
# STB Image Write
SYSTEM ${STB_IMAGE_WRITE_INCLUDE_DIR}
)
# The following lines build the main executable. If you add a source
# code file to Nori, be sure to include it in this list.
add_executable(nori
# Header files
include/nori/bbox.h
include/nori/bitmap.h
include/nori/block.h
include/nori/bsdf.h
# include/nori/accel.h
include/nori/camera.h
include/nori/color.h
include/nori/common.h
include/nori/dpdf.h
include/nori/frame.h
include/nori/integrator.h
include/nori/emitter.h
include/nori/mesh.h
include/nori/object.h
include/nori/parser.h
include/nori/proplist.h
include/nori/ray.h
include/nori/rfilter.h
include/nori/sampler.h
include/nori/scene.h
include/nori/timer.h
include/nori/transform.h
include/nori/vector.h
include/nori/warp.h
include/nori/bvh.h
include/nori/texture.h
# Source code files
src/bitmap.cpp
src/block.cpp
# src/accel.cpp
src/chi2test.cpp
src/common.cpp
src/diffuse.cpp
src/gui.cpp
src/independent.cpp
src/main.cpp
src/mesh.cpp
src/obj.cpp
src/object.cpp
src/parser.cpp
src/perspective.cpp
src/proplist.cpp
src/rfilter.cpp
src/scene.cpp
src/ttest.cpp
src/warp.cpp
src/microfacet.cpp
src/mirror.cpp
src/dielectric.cpp
src/normals.cpp
src/simple.cpp
src/ao.cpp
src/area.cpp
src/whitted.cpp
src/bvh.cpp
src/path_mats.cpp
src/path_ems.cpp
src/path_mis.cpp
src/texture.cpp
src/oren_nayar.cpp
)
add_definitions(${NANOGUI_EXTRA_DEFS})
# The following lines build the warping test application
add_executable(warptest
include/nori/warp.h
include/nori/texture.h
src/warp.cpp
src/warptest.cpp
src/microfacet.cpp
src/object.cpp
src/proplist.cpp
src/common.cpp
src/texture.cpp
)
if (WIN32)
target_link_libraries(nori tbb_static pugixml IlmImf nanogui ${NANOGUI_EXTRA_LIBS} zlibstatic)
else()
target_link_libraries(nori tbb_static pugixml IlmImf nanogui ${NANOGUI_EXTRA_LIBS})
endif()
target_link_libraries(warptest tbb_static nanogui ${NANOGUI_EXTRA_LIBS} ${OpenCV_LIBRARIES})
target_link_libraries(nori ${OpenCV_LIBRARIES})
# Force colored output for the ninja generator
if (CMAKE_GENERATOR STREQUAL "Ninja")
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fcolor-diagnostics")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics")
elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always")
endif()
endif()
target_compile_features(warptest PRIVATE cxx_std_17)
target_compile_features(nori PRIVATE cxx_std_17)
# set(CMAKE_BUILD_TYPE Release)
# target_compile_options(nori PUBLIC -ffast-math -march=native)
# vim: set et ts=2 sw=2 ft=cmake nospell: