-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
156 lines (136 loc) · 3.56 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
cmake_minimum_required(VERSION 3.12)
project(f3d-superbuild)
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
list(INSERT CMAKE_MODULE_PATH 0
"${CMAKE_CURRENT_LIST_DIR}/cmake")
macro (superbuild_setup_variables)
include(SuperbuildVersionMacros)
if (f3d_SOURCE_SELECTION STREQUAL "git")
# Assuming master; just use the latest version, but let the user set their
# own version in case it is actually a branch from some other version.
set(F3D_VERSION_DEFAULT "2.0.0"
CACHE STRING "The default version of F3D to use if it cannot be detected")
mark_as_advanced(F3D_VERSION_DEFAULT)
set(f3d_default_version "${F3D_VERSION_DEFAULT}")
elseif (f3d_SOURCE_SELECTION STREQUAL "source")
# If it is a git repo, we'll get it that way.
set(f3d_default_version "")
else ()
# The selection is the version number; use it.
set(f3d_default_version "${f3d_SOURCE_SELECTION}")
endif()
superbuild_set_version_variables(f3d "${f3d_default_version}" "f3d-version.cmake")
endmacro ()
function (superbuild_find_projects var)
list(APPEND projects
alembic
assimp
boost
cxx11
cxx17
draco
embree
exodus
f3d
hdf5
imath
imgui
ispc
lz4
netcdf
occt
openexr
openimagedenoise
openvdb
openvkl
ospray
ospraymaterials
png
pybind11
python3
rkcommon
sqlite
szip
tbb
openusd
vtk
xz
blosc
zstd
zlib)
if (UNIX)
list(APPEND projects
bzip2
ffi)
if (NOT APPLE)
list(APPEND projects
egl
osmesa)
endif ()
endif ()
if (WIN32)
list(APPEND projects
pywin32)
endif ()
set("${var}"
${projects}
PARENT_SCOPE)
endfunction ()
function (superbuild_add_packaging)
# Packaging tests
if (WIN32)
set(generators
ZIP
NSIS)
elseif (APPLE)
set(generators
DragNDrop)
else ()
set(generators
TGZ
TXZ
DEB)
endif ()
foreach (generator IN LISTS generators)
superbuild_add_extra_package_test(f3d "${generator}"
LABELS "F3D"
TIMEOUT 6400)
endforeach ()
endfunction ()
if (${CMAKE_OSX_ARCHITECTURES} MATCHES "arm64" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm64")
set(boost_extra_options
architecture=arm)
endif ()
set(boost_libraries
iostreams # Required by openvdb
system)
function (superbuild_add_tests)
add_subdirectory("${CMAKE_SOURCE_DIR}/testing" "${CMAKE_BINARY_DIR}/Testing")
endfunction ()
list(APPEND superbuild_version_files
"${CMAKE_CURRENT_LIST_DIR}/versions.cmake")
list(APPEND superbuild_project_roots
"${CMAKE_CURRENT_LIST_DIR}/projects")
# set the default arguments used for "git clone"
set(_git_clone_arguments_default --progress)
# build F3D and all its optional dependencies by default
set(_superbuild_default_f3d ON)
set(_superbuild_default_alembic ON)
set(_superbuild_default_assimp ON)
set(_superbuild_default_draco ON)
set(_superbuild_default_exodus ON)
set(_superbuild_default_imgui ON)
set(_superbuild_default_occt ON)
set(_superbuild_default_openvdb ON)
set(_superbuild_default_openexr ON)
set(_superbuild_default_ospray ON)
set(_superbuild_default_pybind11 OFF)
set(_superbuild_default_tbb ON)
set(_superbuild_default_openusd ON)
set(_superbuild_ospray_default_selection "2.7.1")
if (NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/superbuild/CMakeLists.txt")
message(FATAL_ERROR "It appears as though the superbuild infrastructure "
"is missing; did you forget to do `git submodule init` "
"and `git submodule update`?")
endif ()
add_subdirectory(superbuild)