-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
154 lines (136 loc) · 4.65 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
149
150
151
152
153
154
cmake_minimum_required(VERSION 3.10)
project(lajolla)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# set(CMAKE_BUILD_TYPE RelWithDebInfo)
set(CMAKE_BUILD_TYPE Release)
if(MSVC)
add_compile_options(/Wall)
else()
add_compile_options(-Wall)
endif()
find_package(Embree REQUIRED)
include_directories(${EMBREE_INCLUDE_PATH})
link_libraries(${EMBREE_LIBRARY})
include_directories(${CMAKE_SOURCE_DIR}/src)
set(SRCS src/3rdparty/miniz.h
src/3rdparty/miniz.c
src/3rdparty/pugiconfig.hpp
src/3rdparty/pugixml.hpp
src/3rdparty/pugixml.cpp
src/3rdparty/stb_image.h
src/3rdparty/tinyexr.h
src/3rdparty/tinyply.h
src/filters/box.inl
src/filters/gaussian.inl
src/filters/tent.inl
src/lights/diffuse_area_light.inl
src/lights/envmap.inl
src/materials/lambertian.inl
src/materials/roughdielectric.inl
src/materials/roughplastic.inl
src/materials/disney_diffuse.inl
src/materials/disney_metal.inl
src/materials/disney_glass.inl
src/materials/disney_clearcoat.inl
src/materials/disney_sheen.inl
src/materials/disney_bsdf.inl
src/media/homogeneous.inl
src/media/heterogeneous.inl
src/parsers/load_serialized.h
src/parsers/parse_obj.h
src/parsers/parse_ply.h
src/parsers/parse_scene.h
src/phase_functions/isotropic.inl
src/phase_functions/henyeygreenstein.inl
src/shapes/sphere.inl
src/shapes/triangle_mesh.inl
src/camera.h
src/filter.h
src/flexception.h
src/frame.h
src/image.h
src/intersection.h
src/lajolla.h
src/light.h
src/material.h
src/matrix.h
src/medium.h
src/microfacet.h
src/mipmap.h
src/parallel.h
src/path_tracing.h
src/phase_function.h
src/vol_path_tracing.h
src/volume.h
src/point_and_normal.h
src/ray.h
src/render.h
src/scene.h
src/shape.h
src/spectrum.h
src/table_dist.h
src/texture.h
src/transform.h
src/vector.h
src/parsers/load_serialized.cpp
src/parsers/parse_obj.cpp
src/parsers/parse_ply.cpp
src/parsers/parse_scene.cpp
src/camera.cpp
src/filter.cpp
src/image.cpp
src/intersection.cpp
src/light.cpp
src/material.cpp
src/medium.cpp
src/parallel.cpp
src/phase_function.cpp
src/render.cpp
src/scene.cpp
src/shape.cpp
src/table_dist.cpp
src/transform.cpp
src/volume.cpp)
add_library(lajolla_lib STATIC ${SRCS})
add_executable(lajolla src/main.cpp)
target_link_libraries(lajolla lajolla_lib)
if(MSVC)
add_custom_command(TARGET lajolla POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${PROJECT_SOURCE_DIR}/embree/bin"
$<TARGET_FILE_DIR:lajolla>)
endif()
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
target_link_libraries(lajolla Threads::Threads)
enable_testing()
add_executable(test_filter src/tests/filter.cpp)
target_link_libraries(test_filter lajolla_lib)
add_test(filter test_filter)
set_tests_properties(filter PROPERTIES PASS_REGULAR_EXPRESSION "SUCCESS")
add_executable(test_frame src/tests/frame.cpp)
target_link_libraries(test_frame lajolla_lib)
add_test(frame test_frame)
set_tests_properties(frame PROPERTIES PASS_REGULAR_EXPRESSION "SUCCESS")
add_executable(test_image src/tests/image.cpp)
target_link_libraries(test_image lajolla_lib)
add_test(image test_image)
set_tests_properties(image PROPERTIES PASS_REGULAR_EXPRESSION "SUCCESS")
add_executable(test_intersection src/tests/intersection.cpp)
target_link_libraries(test_intersection lajolla_lib)
add_test(intersection test_intersection)
set_tests_properties(intersection PROPERTIES PASS_REGULAR_EXPRESSION "SUCCESS")
add_executable(test_materials src/tests/materials.cpp)
target_link_libraries(test_materials lajolla_lib)
add_test(materials test_materials)
set_tests_properties(materials PROPERTIES PASS_REGULAR_EXPRESSION "SUCCESS")
add_executable(test_matrix src/tests/matrix.cpp)
target_link_libraries(test_matrix lajolla_lib)
add_test(matrix test_matrix)
set_tests_properties(matrix PROPERTIES PASS_REGULAR_EXPRESSION "SUCCESS")
add_executable(test_mipmap src/tests/mipmap.cpp)
target_link_libraries(test_mipmap lajolla_lib)
add_test(mipmap test_mipmap)
set_tests_properties(mipmap PROPERTIES PASS_REGULAR_EXPRESSION "SUCCESS")