Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cmakelists_openvdb.txt « patches « build_environment « build_files - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: dd3e9c1a887bdfdd394d56ba5648fc1187b9d821 (plain)
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
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
# --------------------------------------------------------------------------------

cmake_minimum_required(VERSION 2.8)

# --------------------------------------------------------------------------------

project(OpenVDB)

# --------------------------------------------------------------------------------

set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")

# --------------------------------------------------------------------------------

set(CMAKE_BUILD_TYPE_INIT "Release")

# --------------------------------------------------------------------------------
# Options

option(WITH_BLOSC             "Enable Blosc support for compression" OFF)
option(WITH_LOGC4PLUS         "Enable logging" OFF)
option(WITH_OPENVDB_2_ABI     "Enable building the library to be compability with the OpenVDB 2 ABI" OFF)
option(WITH_PRINTER           "Enable building the OpenVDB print executable" OFF)
option(WITH_PYTHON            "Enable building the OpenVDB python API" OFF)
option(WITH_RENDERER          "Enable building the OpenVDB render executable" OFF)
option(WITH_UNITTEST          "Enable building the unit tests" OFF)
option(WITH_VIEWER            "Enable building the OpenVDB viewer executable" OFF)

# --------------------------------------------------------------------------------
# Find packages
#set(BOOST_LIBRARIES boost_iostreams boost_system boost_thread)

find_package(IlmBase)
find_package(OpenEXR)
find_package(TBB)
find_package(Boost)

if(WITH_BLOSC)
	find_package(Blosc)

	if(NOT BLOSC_FOUND)
		set(WITH_BLOSC OFF)
	endif()
endif()

# todo
if(WITH_VIEWER)
	set(GLFW_INCLUDE_DIRS ${GLFW_INCLUDE_PATH})
	set(GLFW_LIBRARY_DIRS ${GLFW_LIBRARY_PATH})
endif()

if(WITH_LOGC4PLUS)
	find_package(LogC4Plus)

	if(NOT LOGC4PLUS_FOUND)
		set(WITH_LOGC4PLUS OFF)
	endif()
endif()

# todo
if(WITH_PYTHON)
	set(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_PATH})
	set(PYTHON_LIBRARY_DIRS ${PYTHON_LIBRARY_PATH})
endif()

if(WITH_UNITTEST)
	find_package(CppUnit)

	if(NOT CPPUNIT_FOUND)
		set(WITH_UNITTEST OFF)
	endif()
endif()

# --------------------------------------------------------------------------------

message (STATUS "BOOST_ROOT ${BOOST_ROOT}")
message (STATUS "Boost found ${Boost_FOUND} ")
message (STATUS "Boost version      ${Boost_VERSION}")
message (STATUS "Boost include dirs ${Boost_INCLUDE_DIRS}")
message (STATUS "Boost library dirs ${Boost_LIBRARY_DIRS}")
message (STATUS "Boost libraries    ${Boost_LIBRARIES}") 

message (STATUS "ILMBase found ${ILMBASE_FOUND} ")
message (STATUS "ILMBase include dir ${ILMBASE_INCLUDE_DIR}")
message (STATUS "ILMBase libraries    ${ILMBASE_LIBRARIES}") 

message (STATUS "TBB found ${TBB_FOUND} ")
message (STATUS "TBB include dir ${TBB_INCLUDE_DIR}")
message (STATUS "TBB libraries    ${TBB_LIBRARIES}") 

if(MSVC)
    set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj" )
    set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /bigobj" )
endif()

set(OPENVDB_LIBRARIES ${BLOSC_LIBRARIES} ${BOOST_LIBRARIES} ${OPENEXR_LIBRARIES} ${ILMBASE_LIBRARIES}  ${TBB_LIBRARIES} ${ZLIB_LIBRARY} )

include_directories(. ${CMAKE_CURRENT_SOURCE_DIR}/../ ${Boost_INCLUDE_DIRS} ${ILMBASE_INCLUDE_DIR} ${OPENEXR_INCLUDE_DIR} ${TBB_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR})
link_directories(${Boost_LIBRARY_DIRS} ${OPENEXR_LIBRARY_DIRS} ${TBB_INCLUDE_DIRS})
add_definitions(-DNOMINMAX -D__TBB_NO_IMPLICIT_LINKAGE -DOPENVDB_STATICLIB -DOPENVDB_OPENEXR_STATICLIB)

if(WITH_BLOSC)
	add_definitions(-DOPENVDB_USE_BLOSC)
	include_directories(${BLOSC_INCLUDE_DIRS})
	link_directories(${BLOSC_LIBRARY_DIRS})
endif()

if(WITH_LOGC4PLUS)
	add_definitions(-DOPENVDB_USE_LOG4CPLUS)
	include_directories(${LOG4CPLUS_INCLUDE_DIRS})
	link_directories(${LOG4CPLUS_LIBRARY_DIRS})
endif()

if(WITH_OPENVDB_2_ABI)
	add_definitions(-DOPENVDB_2_ABI_COMPATIBLE)
endif()

# todo
if(WITH_OPENVDB_USE_GLFW_3)
	add_definitions(-DOPENVDB_USE_GLFW_3)
endif()

if(WITH_UNITTEST)
	include_directories(${CPPUNIT_INCLUDE_DIRS})
	link_directories(${CPPUNIT_LIBRARY_DIRS})
endif()

# --------------------------------------------------------------------------------

set(SRC_FILES
	openvdb/openvdb.cc
	openvdb/io/Compression.cc
	openvdb/io/File.cc
	openvdb/io/Queue.cc
	openvdb/io/Stream.cc
	openvdb/io/TempFile.cc
	openvdb/io/GridDescriptor.cc
	openvdb/io/Archive.cc
	openvdb/metadata/MetaMap.cc
	openvdb/metadata/Metadata.cc
	openvdb/math/Maps.cc
	openvdb/math/Transform.cc
	openvdb/math/QuantizedUnitVec.cc
	openvdb/math/Proximity.cc
	openvdb/Grid.cc
	openvdb/util/Formats.cc
	openvdb/util/Util.cc
)

set(HEADER_FILES
	openvdb/openvdb.h
	openvdb/version.h
	openvdb/PlatformConfig.h
	openvdb/Metadata.h
	openvdb/Exceptions.h
	openvdb/Grid.h
	openvdb/Types.h
	openvdb/Platform.h
	openvdb/tree/ValueAccessor.h
	openvdb/tree/NodeUnion.h
	openvdb/tree/Tree.h
	openvdb/tree/Iterator.h
	openvdb/tree/LeafNodeBool.h
	openvdb/tree/TreeIterator.h
	openvdb/tree/LeafNode.h
	openvdb/tree/NodeManager.h
	openvdb/tree/LeafManager.h
	openvdb/tree/InternalNode.h
	openvdb/tree/RootNode.h
	openvdb/tools/PointScatter.h
	openvdb/tools/VolumeAdvect.h
	openvdb/tools/LevelSetTracker.h
	openvdb/tools/Composite.h
	openvdb/tools/Morphology.h
	openvdb/tools/ValueTransformer.h
	openvdb/tools/ChangeBackground.h
	openvdb/tools/GridTransformer.h
	openvdb/tools/Prune.h
	openvdb/tools/LevelSetUtil.h
	openvdb/tools/VolumeToSpheres.h
	openvdb/tools/LevelSetAdvect.h
	openvdb/tools/Statistics.h
	openvdb/tools/LevelSetMeasure.h
	openvdb/tools/VectorTransformer.h
	openvdb/tools/RayIntersector.h
	openvdb/tools/PointPartitioner.h
	openvdb/tools/Interpolation.h
	openvdb/tools/VelocityFields.h
	openvdb/tools/PointIndexGrid.h
	openvdb/tools/LevelSetRebuild.h
	openvdb/tools/Clip.h
	openvdb/tools/SignedFloodFill.h
	openvdb/tools/MeshToVolume.h
	openvdb/tools/Dense.h
	openvdb/tools/Filter.h
	openvdb/tools/RayTracer.h
	openvdb/tools/Diagnostics.h
	openvdb/tools/VolumeToMesh.h
	openvdb/tools/PoissonSolver.h
	openvdb/tools/LevelSetFracture.h
	openvdb/tools/GridOperators.h
	openvdb/tools/DenseSparseTools.h
	openvdb/tools/ParticlesToLevelSet.h
	openvdb/tools/LevelSetSphere.h
	openvdb/tools/LevelSetMorph.h
	openvdb/tools/LevelSetFilter.h
	openvdb/tools/PointAdvect.h
	openvdb/io/Queue.h
	openvdb/io/TempFile.h
	openvdb/io/Stream.h
	openvdb/io/GridDescriptor.h
	openvdb/io/Archive.h
	openvdb/io/io.h
	openvdb/io/Compression.h
	openvdb/io/File.h
	openvdb/metadata/StringMetadata.h
	openvdb/metadata/MetaMap.h
	openvdb/metadata/Metadata.h
	openvdb/math/DDA.h
	openvdb/math/Vec2.h
	openvdb/math/FiniteDifference.h
	openvdb/math/Stencils.h
	openvdb/math/BBox.h
	openvdb/math/Mat3.h
	openvdb/math/Mat.h
	openvdb/math/Proximity.h
	openvdb/math/Ray.h
	openvdb/math/ConjGradient.h
	openvdb/math/Quat.h
	openvdb/math/Vec3.h
	openvdb/math/Vec4.h
	openvdb/math/QuantizedUnitVec.h
	openvdb/math/Coord.h
	openvdb/math/Operators.h
	openvdb/math/Stats.h
	openvdb/math/Math.h
	openvdb/math/Tuple.h
	openvdb/math/LegacyFrustum.h
	openvdb/math/Mat4.h
	openvdb/math/Maps.h
	openvdb/math/Transform.h
	openvdb/util/PagedArray.h
	openvdb/util/CpuTimer.h
	openvdb/util/Formats.h
	openvdb/util/NullInterrupter.h
	openvdb/util/Util.h
	openvdb/util/Name.h
	openvdb/util/MapsUtil.h
	openvdb/util/NodeMasks.h
	openvdb/util/logging.h
)

add_library(openvdb STATIC ${SRC_FILES} ${HEADER_FILES})

# --------------------------------------------------------------------------------

target_link_libraries(openvdb ${OPENVDB_LIBRARIES})

set(OPENVDB_VERSION_MAJOR 3)
set(OPENVDB_VERSION_MINOR 1)
set(OPENVDB_VERSION_PATCH 0)
set(OPENVDB_VERSION_STRING ${OPENVDB_VERSION_MAJOR}.${OPENVDB_VERSION_MINOR}.${OPENVDB_VERSION_PATCH})

set_target_properties(openvdb PROPERTIES VERSION ${OPENVDB_VERSION_STRING} SOVERSION ${OPENVDB_VERSION_MAJOR})

install(TARGETS openvdb DESTINATION lib)

install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include COMPONENT Development FILES_MATCHING PATTERN "*.h"
        PATTERN ".git" EXCLUDE PATTERN "build" EXCLUDE PATTERN "cmake" EXCLUDE)

# --------------------------------------------------------------------------------

if(WITH_PRINTER)
	set(PRINT_SRC
		openvdb/cmd/openvdb_print/main.cc
	)

	add_executable(vdb_print ${PRINT_SRC})
	target_link_libraries(vdb_print openvdb)
	install(TARGETS vdb_print RUNTIME DESTINATION bin)
endif()

if(WITH_RENDER)
	set(RENDER_SRC
		openvdb/cmd/openvdb_render/main.cc
	)

	add_executable(vdb_render ${RENDER_SRC})
	target_link_libraries(vdb_render openvdb)
	install(TARGETS vdb_render RUNTIME DESTINATION bin)
endif()

# todo
if(WITH_VIEWER)
	set(VIEWER_SRC
		openvdb/viewer/Camera.cc
		openvdb/viewer/ClipBox.cc
		openvdb/viewer/Font.cc
		openvdb/viewer/RenderModules.cc
		openvdb/viewer/Viewer.cc

		openvdb/viewer/Camera.h
		openvdb/viewer/ClipBox.h
		openvdb/viewer/Font.h
		openvdb/viewer/RenderModules.h
		openvdb/viewer/Viewer.h
		openvdb/cmd/openvdb_viewer/main.cc
	)

	include_directories(${GLFW_INCLUDE_DIRS})
	link_directories(${GLFW_LIBRARY_DIRS})

	add_executable(vdb_viewer ${VIEWER_SRC})
	target_link_libraries(vdb_viewer openvdb)
	install(TARGETS vdb_viewer RUNTIME DESTINATION bin)
endif()

# todo
if(WITH_PYTHON)
#	add_library(pyopenvdb SHARED )
endif()

set(UNITTEST_SRC
	openvdb/unittest/main.cc
	openvdb/unittest/TestBBox.cc
	openvdb/unittest/TestConjGradient.cc
	openvdb/unittest/TestCoord.cc
	openvdb/unittest/TestCpt.cc
	openvdb/unittest/TestCurl.cc
	openvdb/unittest/TestDense.cc
	openvdb/unittest/TestDenseSparseTools.cc
	openvdb/unittest/TestDiagnostics.cc
	openvdb/unittest/TestDivergence.cc
	openvdb/unittest/TestDoubleMetadata.cc
	openvdb/unittest/TestExceptions.cc
	openvdb/unittest/TestFile.cc
	openvdb/unittest/TestFloatMetadata.cc
	openvdb/unittest/TestGradient.cc
	openvdb/unittest/TestGrid.cc
	openvdb/unittest/TestGridBbox.cc
	openvdb/unittest/TestGridDescriptor.cc
	openvdb/unittest/TestGridIO.cc
	openvdb/unittest/TestGridTransformer.cc
	openvdb/unittest/TestInit.cc
	openvdb/unittest/TestInt32Metadata.cc
	openvdb/unittest/TestInt64Metadata.cc
	openvdb/unittest/TestInternalOrigin.cc
	openvdb/unittest/TestLaplacian.cc
	openvdb/unittest/TestLeaf.cc
	openvdb/unittest/TestLeafBool.cc
	openvdb/unittest/TestLeafIO.cc
	openvdb/unittest/TestLeafOrigin.cc
	openvdb/unittest/TestLevelSetRayIntersector.cc
	openvdb/unittest/TestLevelSetUtil.cc
	openvdb/unittest/TestLinearInterp.cc
	openvdb/unittest/TestMaps.cc
	openvdb/unittest/TestMat4Metadata.cc
	openvdb/unittest/TestMath.cc
	openvdb/unittest/TestMeanCurvature.cc
	openvdb/unittest/TestMeshToVolume.cc
	openvdb/unittest/TestMetadata.cc
	openvdb/unittest/TestMetadataIO.cc
	openvdb/unittest/TestMetaMap.cc
	openvdb/unittest/TestName.cc
	openvdb/unittest/TestNodeIterator.cc
	openvdb/unittest/TestNodeMask.cc
	openvdb/unittest/TestParticlesToLevelSet.cc
	openvdb/unittest/TestPointIndexGrid.cc
	openvdb/unittest/TestPointPartitioner.cc
	openvdb/unittest/TestPoissonSolver.cc
	openvdb/unittest/TestPrePostAPI.cc
	openvdb/unittest/TestQuadraticInterp.cc
	openvdb/unittest/TestQuantizedUnitVec.cc
	openvdb/unittest/TestQuat.cc
	openvdb/unittest/TestRay.cc
	openvdb/unittest/TestStats.cc
	openvdb/unittest/TestStream.cc
	openvdb/unittest/TestStringMetadata.cc
	openvdb/unittest/TestTools.cc
	openvdb/unittest/TestTransform.cc
	openvdb/unittest/TestTree.cc
	openvdb/unittest/TestTreeCombine.cc
	openvdb/unittest/TestTreeGetSetValues.cc
	openvdb/unittest/TestTreeIterators.cc
	openvdb/unittest/TestTreeVisitor.cc
	openvdb/unittest/TestUtil.cc
	openvdb/unittest/TestValueAccessor.cc
	openvdb/unittest/TestVec2Metadata.cc
	openvdb/unittest/TestVec3Metadata.cc
	openvdb/unittest/TestVolumeRayIntersector.cc
	openvdb/unittest/TestVolumeToMesh.cc
)

# todo
if(WITH_UNITTEST)
	add_executable(test ${UNITTEST_SRC} ${HEADER_FILES})
	target_link_libraries(test openvdb ${CPPUNIT_LIBRARIES})
endif()