forked from AcademySoftwareFoundation/openvdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
84 lines (63 loc) · 2.41 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
## Copyright Contributors to the OpenVDB Project
# SPDX-License-Identifier: MPL-2.0
#
#[=======================================================================[
CMake Configuration for OpenVDB Binaries
#]=======================================================================]
cmake_minimum_required(VERSION 3.18)
project(OpenVDBBinaries LANGUAGES CXX)
include(GNUInstallDirs)
###### OpenVDB Binary Component Options
option(OPENVDB_BUILD_VDB_PRINT "Build vdb_print" ON)
option(OPENVDB_BUILD_VDB_LOD "Build vdb_lod" OFF)
option(OPENVDB_BUILD_VDB_RENDER "Build vdb_render" OFF)
option(OPENVDB_BUILD_VDB_VIEW "Build vdb_view" OFF)
option(OPENVDB_BUILD_VDB_TOOL "Build vdb_tool" OFF)
option(OPENVDB_BUILD_VDB_AX "Build the OpenVDB AX command line binary" OFF)
if(OPENVDB_BUILD_AX_BINARIES)
message(DEPRECATION "OPENVDB_BUILD_AX_BINARIES is deprecated. Use OPENVDB_BUILD_VDB_AX.")
set(OPENVDB_BUILD_VDB_AX ON)
endif()
#########################################################################
message(STATUS "----------------------------------------------------")
message(STATUS "----------- Configuring OpenVDBBinaries ------------")
message(STATUS "----------------------------------------------------")
##########################################################################
# Collect lib dependencies shared by all binaries
if(NOT OPENVDB_BUILD_CORE)
# @note Could also use the openvdb_je target here, but we just opt to
# handle the value of CONCURRENT_MALLOC outside of this branching for
# both cases
set(OPENVDB_LIB OpenVDB::openvdb)
else()
set(OPENVDB_LIB openvdb)
endif()
set(OPENVDB_BINARIES_DEPENDENT_LIBS
${OPENVDB_LIB}
)
if(CONCURRENT_MALLOC STREQUAL "Jemalloc")
find_package(Jemalloc REQUIRED)
list(APPEND OPENVDB_BINARIES_DEPENDENT_LIBS Jemalloc::jemalloc)
elseif(CONCURRENT_MALLOC STREQUAL "Tbbmalloc")
find_package(TBB ${MINIMUM_TBB_VERSION} REQUIRED COMPONENTS tbbmalloc)
list(APPEND OPENVDB_BINARIES_DEPENDENT_LIBS TBB::tbbmalloc)
endif()
##########################################################################
if (OPENVDB_BUILD_VDB_PRINT)
add_subdirectory(vdb_print)
endif()
if (OPENVDB_BUILD_VDB_LOD)
add_subdirectory(vdb_lod)
endif()
if (OPENVDB_BUILD_VDB_RENDER)
add_subdirectory(vdb_render)
endif()
if (OPENVDB_BUILD_VDB_TOOL)
add_subdirectory(vdb_tool)
endif()
if (OPENVDB_BUILD_VDB_VIEW)
add_subdirectory(vdb_view)
endif()
if (OPENVDB_BUILD_VDB_AX)
add_subdirectory(vdb_ax)
endif()