-
Notifications
You must be signed in to change notification settings - Fork 353
/
CMakeLists.txt
316 lines (301 loc) · 10.6 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
# Copyright 2019, 2020, Collabora, Ltd.
# Copyright 2019, 2021, Visual Computing Lab, ISTI - Italian National Research Council
# SPDX-License-Identifier: BSL-1.0
cmake_minimum_required(VERSION 3.10)
project(VCGLib)
# Eigen options
option(VCG_ALLOW_BUNDLED_EIGEN "Allow use of bundled Eigen source" ON)
option(VCG_ALLOW_SYSTEM_EIGEN "Allow use of system-provided Eigen" ON)
# VCG options
option(VCG_HEADER_ONLY "Use VCG library in header only mode" ON)
option(VCG_BUILD_EXAMPLES "Build a set of examples of the library" OFF)
option(VCG_USE_OPENMP "Allow VCG to find and link OpenMP if detected" ON)
set (VCG_INCLUDE_DIRS ${CMAKE_CURRENT_LIST_DIR})
set (VCG_INCLUDE_DIRS ${CMAKE_CURRENT_LIST_DIR} PARENT_SCOPE)
### Build settings
set(CMAKE_CXX_STANDARD 11)
### OpenMP
if (VCG_USE_OPENMP)
find_package(OpenMP)
if (APPLE AND OPENMP_FOUND)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
endif()
### Eigen
set(VCG_EIGEN_DIR ${CMAKE_CURRENT_LIST_DIR}/eigenlib)
if(VCG_ALLOW_SYSTEM_EIGEN AND EIGEN3_INCLUDE_DIR)
message(STATUS "- Eigen - using system-provided library")
set(EIGEN_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR})
elseif(VCG_ALLOW_BUNDLED_EIGEN AND EXISTS "${VCG_EIGEN_DIR}/Eigen/Eigen")
message(STATUS "- Eigen - using bundled source")
set(EIGEN_INCLUDE_DIRS ${VCG_EIGEN_DIR})
else()
message(
FATAL_ERROR
"Eigen is required - at least one of VCG_ALLOW_SYSTEM_EIGEN or VCG_ALLOW_BUNDLED_EIGEN must be enabled and found.")
endif()
### VCGLib headers and sources
set(VCG_HEADERS
vcg/complex/append.h
vcg/complex/all_types.h
vcg/complex/complex.h
vcg/complex/allocate.h
vcg/complex/exception.h
vcg/complex/algorithms/overlap_estimation.h
vcg/complex/algorithms/dual_meshing.h
vcg/complex/algorithms/intersection.h
vcg/complex/algorithms/clip.h
vcg/complex/algorithms/geodesic.h
vcg/complex/algorithms/parametrization/poisson_solver.h
vcg/complex/algorithms/parametrization/uv_utils.h
vcg/complex/algorithms/parametrization/distortion.h
vcg/complex/algorithms/parametrization/tangent_field_operators.h
vcg/complex/algorithms/parametrization/voronoi_atlas.h
vcg/complex/algorithms/edge_collapse.h
vcg/complex/algorithms/hole.h
vcg/complex/algorithms/align_pair.h
vcg/complex/algorithms/closest.h
vcg/complex/algorithms/tetra_implicit_smooth.h
vcg/complex/algorithms/bitquad_support.h
vcg/complex/algorithms/skeleton.h
vcg/complex/algorithms/symmetry.h
vcg/complex/algorithms/voronoi_volume_sampling.h
vcg/complex/algorithms/polygon_polychord_collapse.h
vcg/complex/algorithms/inside.h
vcg/complex/algorithms/local_optimization/tri_edge_flip.h
vcg/complex/algorithms/local_optimization/quad_diag_collapse.h
vcg/complex/algorithms/local_optimization/tri_edge_collapse_quadric.h
vcg/complex/algorithms/local_optimization/tri_edge_collapse_quadric_tex.h
vcg/complex/algorithms/local_optimization/tri_edge_collapse.h
vcg/complex/algorithms/local_optimization/tetra_edge_collapse.h
vcg/complex/algorithms/polygonal_algorithms.h
vcg/complex/algorithms/inertia.h
vcg/complex/algorithms/mesh_assert.h
vcg/complex/algorithms/occupancy_grid.h
vcg/complex/algorithms/meshtree.h
vcg/complex/algorithms/align_global.h
vcg/complex/algorithms/cut_tree.h
vcg/complex/algorithms/nring.h
vcg/complex/algorithms/tetra/tetfuse_collapse.h
vcg/complex/algorithms/stat.h
vcg/complex/algorithms/ransac_matching.h
vcg/complex/algorithms/refine.h
vcg/complex/algorithms/outline_support.h
vcg/complex/algorithms/convex_hull.h
vcg/complex/algorithms/clean.h
vcg/complex/algorithms/mesh_to_matrix.h
vcg/complex/algorithms/quadrangulator.h
vcg/complex/algorithms/isotropic_remeshing.h
vcg/complex/algorithms/smooth.h
vcg/complex/algorithms/autoalign_4pcs.h
vcg/complex/algorithms/local_optimization.h
vcg/complex/algorithms/curve_on_manifold.h
vcg/complex/algorithms/clustering.h
vcg/complex/algorithms/refine_loop.h
vcg/complex/algorithms/cylinder_clipping.h
vcg/complex/algorithms/pointcloud_normal.h
vcg/complex/algorithms/bitquad_creation.h
vcg/complex/algorithms/crease_cut.h
vcg/complex/algorithms/implicit_smooth.h
vcg/complex/algorithms/voronoi_remesher.h
vcg/complex/algorithms/polygon_support.h
vcg/complex/algorithms/point_sampling.h
vcg/complex/algorithms/create/mc_lookup_table.h
vcg/complex/algorithms/create/mc_trivial_walker.h
vcg/complex/algorithms/create/extrude.h
vcg/complex/algorithms/create/resampler.h
vcg/complex/algorithms/create/ball_pivoting.h
vcg/complex/algorithms/create/readme.txt
vcg/complex/algorithms/create/zonohedron.h
vcg/complex/algorithms/create/platonic.h
vcg/complex/algorithms/create/marching_cubes.h
vcg/complex/algorithms/create/plymc/voxel.h
vcg/complex/algorithms/create/plymc/simplemeshprovider.h
vcg/complex/algorithms/create/plymc/tri_edge_collapse_mc.h
vcg/complex/algorithms/create/plymc/volume.h
vcg/complex/algorithms/create/plymc/plymc.h
vcg/complex/algorithms/create/plymc/svoxel.h
vcg/complex/algorithms/create/tetramesh_support.h
vcg/complex/algorithms/create/advancing_front.h
vcg/complex/algorithms/textcoord_optimization.h
vcg/complex/algorithms/bitquad_optimization.h
vcg/complex/algorithms/halfedge_quad_clean.h
vcg/complex/algorithms/voronoi_processing.h
vcg/complex/algorithms/update/quality.h
vcg/complex/algorithms/update/selection.h
vcg/complex/algorithms/update/fitmaps.h
vcg/complex/algorithms/update/component_ep.h
vcg/complex/algorithms/update/texture.h
vcg/complex/algorithms/update/curvature_fitting.h
vcg/complex/algorithms/update/normal.h
vcg/complex/algorithms/update/position.h
vcg/complex/algorithms/update/halfedge_topology.h
vcg/complex/algorithms/update/topology.h
vcg/complex/algorithms/update/flag.h
vcg/complex/algorithms/update/bounding.h
vcg/complex/algorithms/update/halfedge_indexed.h
vcg/complex/algorithms/update/color.h
vcg/complex/algorithms/update/curvature.h
vcg/complex/algorithms/point_outlier.h
vcg/complex/algorithms/harmonic.h
vcg/complex/algorithms/point_matching_scale.h
vcg/complex/algorithms/attribute_seam.h
vcg/complex/foreach.h
vcg/complex/base.h
vcg/complex/used_types.h
vcg/container/entries_allocation_table.h
vcg/container/container_allocation_table.h
vcg/container/derivation_chain.h
vcg/container/vector_occ.h
vcg/container/simple_temporary_data.h
vcg/space/segment2.h
vcg/space/fitting3.h
vcg/space/tetra3.h
vcg/space/triangle2.h
vcg/space/ray2.h
vcg/space/point2.h
vcg/space/point4.h
vcg/space/box2.h
vcg/space/ray3.h
vcg/space/planar_polygon_tessellation.h
vcg/space/texcoord2.h
vcg/space/point3.h
vcg/space/intersection/triangle_triangle3.h
vcg/space/distance2.h
vcg/space/point3.h
vcg/space/point.h
vcg/space/space.h
vcg/space/point.h
vcg/space/colorspace.h
vcg/space/rect_packer.h
vcg/space/triangle3.h
vcg/space/obox3.h
vcg/space/point2.h
vcg/space/smallest_enclosing.h
vcg/space/color4.h
vcg/space/polygon3.h
vcg/space/line3.h
vcg/space/index/octree.h
vcg/space/index/grid_util2d.h
vcg/space/index/grid_closest.h
vcg/space/index/grid_static_ptr.h
vcg/space/index/grid_util.h
vcg/space/index/spatial_hashing.h
vcg/space/index/closest2d.h
vcg/space/index/grid_static_obj.h
vcg/space/index/kdtree/kdtree.h
vcg/space/index/kdtree/priorityqueue.h
vcg/space/index/kdtree/kdtree_face.h
vcg/space/index/kdtree/mlsutils.h
vcg/space/index/octree_template.h
vcg/space/index/aabb_binary_tree/kclosest.h
vcg/space/index/aabb_binary_tree/closest.h
vcg/space/index/aabb_binary_tree/ray.h
vcg/space/index/aabb_binary_tree/frustum_cull.h
vcg/space/index/aabb_binary_tree/aabb_binary_tree.h
vcg/space/index/aabb_binary_tree/base.h
vcg/space/index/grid_closest2d.h
vcg/space/index/spatial_hashing2d.h
vcg/space/index/space_iterators.h
vcg/space/index/grid_static_ptr2d.h
vcg/space/index/base2d.h
vcg/space/index/base.h
vcg/space/index/perfect_spatial_hashing.h
vcg/space/index/space_iterators2d.h
vcg/space/line2.h
vcg/space/point_matching.h
vcg/space/intersection3.h
vcg/space/point4.h
vcg/space/rasterized_outline2_packer.h
vcg/space/box.h
vcg/space/plane3.h
vcg/space/outline2_packer.h
vcg/space/segment3.h
vcg/space/intersection2.h
vcg/space/sphere3.h
vcg/space/box3.h
vcg/space/distance3.h
vcg/math/quadric5.h
vcg/math/factorial.h
vcg/math/eigen_matrix_addons.h
vcg/math/quadric.h
vcg/math/perlin_noise.h
vcg/math/shot.h
vcg/math/shot.ipp
vcg/math/spherical_harmonics.h
vcg/math/eigen_matrixbase_addons.h
vcg/math/quaternion.h
vcg/math/similarity.h
vcg/math/disjoint_set.h
vcg/math/random_generator.h
vcg/math/camera.h
vcg/math/camera.ipp
vcg/math/linear.h
vcg/math/matrix44.h
vcg/math/eigen.h
vcg/math/similarity2.h
vcg/math/gen_normal.h
vcg/math/polar_decomposition.h
vcg/math/base.h
vcg/math/histogram.h
vcg/math/legendre.h
vcg/math/matrix33.h
vcg/simplex/edge/distance.h
vcg/simplex/edge/topology.h
vcg/simplex/edge/pos.h
vcg/simplex/edge/component.h
vcg/simplex/edge/base.h
vcg/simplex/tetrahedron/tetrahedron.h
vcg/simplex/tetrahedron/topology.h
vcg/simplex/tetrahedron/pos.h
vcg/simplex/tetrahedron/component.h
vcg/simplex/tetrahedron/base.h
vcg/simplex/face/component_occ.h
vcg/simplex/face/component_ep.h
vcg/simplex/face/jumping_pos.h
vcg/simplex/face/distance.h
vcg/simplex/face/component_polygon.h
vcg/simplex/face/topology.h
vcg/simplex/face/pos.h
vcg/simplex/face/component.h
vcg/simplex/face/component_ocf.h
vcg/simplex/face/base.h
vcg/simplex/vertex/component_occ.h
vcg/simplex/vertex/component_sph.h
vcg/simplex/vertex/distance.h
vcg/simplex/vertex/component.h
vcg/simplex/vertex/component_ocf.h
vcg/simplex/vertex/base.h
vcg/connectors/halfedge_pos.h
vcg/connectors/hedge.h
vcg/connectors/hedge_component.h
#wrap
wrap/callback.h
)
set(SOURCES
)
if (VCG_HEADER_ONLY)
if (NOT TARGET vcglib) # to be sure that vcglib target is created just one time
add_library(vcglib INTERFACE)
target_include_directories(
vcglib INTERFACE
${CMAKE_CURRENT_LIST_DIR}
${EIGEN_INCLUDE_DIRS})
if(OPENMP_FOUND)
target_link_libraries(vcglib INTERFACE OpenMP::OpenMP_CXX)
endif()
#just to show headers in ide
add_custom_target(vcglib_ide SOURCES ${VCG_HEADERS})
else()
message(STATUS "- VCGLib - jumped - already included")
endif()
else()
#TODO make vcglib that includes all the wrap sources, checking everytime
# if the the required targets (e.g. qt, gl, glew...) exists
endif()
if(VCG_BUILD_EXAMPLES)
#TODO make the list of samples to build
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/apps)
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/wrap)
endif()