forked from PixarAnimationStudios/OpenUSD
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathOptions.cmake
More file actions
234 lines (214 loc) · 8.48 KB
/
Options.cmake
File metadata and controls
234 lines (214 loc) · 8.48 KB
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
#
# Copyright 2016 Pixar
#
# Licensed under the terms set forth in the LICENSE.txt file available at
# https://openusd.org/license.
#
option(PXR_STRICT_BUILD_MODE "Turn on additional warnings. Enforce all warnings as errors." OFF)
option(PXR_VALIDATE_GENERATED_CODE "Validate script generated code" OFF)
option(PXR_HEADLESS_TEST_MODE "Disallow GUI based tests, useful for running under headless CI systems." OFF)
option(PXR_BUILD_TESTS "Build tests" ON)
option(PXR_BUILD_EXAMPLES "Build examples" ON)
option(PXR_BUILD_TUTORIALS "Build tutorials" ON)
option(PXR_BUILD_USD_TOOLS "Build commandline tools" ON)
option(PXR_BUILD_IMAGING "Build imaging components" ON)
option(PXR_BUILD_EMBREE_PLUGIN "Build embree imaging plugin" OFF)
option(PXR_BUILD_OPENIMAGEIO_PLUGIN "Build OpenImageIO plugin" OFF)
option(PXR_BUILD_OPENCOLORIO_PLUGIN "Build OpenColorIO plugin" OFF)
option(PXR_BUILD_USD_IMAGING "Build USD imaging components" ON)
option(PXR_BUILD_USDVIEW "Build usdview" ON)
option(PXR_BUILD_ALEMBIC_PLUGIN "Build the Alembic plugin for USD" OFF)
option(PXR_BUILD_DRACO_PLUGIN "Build the Draco plugin for USD" OFF)
option(PXR_BUILD_PRMAN_PLUGIN "Build the PRMan imaging plugin" OFF)
option(PXR_ENABLE_MATERIALX_SUPPORT "Enable MaterialX support" OFF)
option(PXR_BUILD_DOCUMENTATION "Generate doxygen documentation" OFF)
option(PXR_BUILD_PYTHON_DOCUMENTATION "Generate Python documentation" OFF)
option(PXR_BUILD_HTML_DOCUMENTATION "Generate HTML documentation if PXR_BUILD_DOCUMENTATION is ON" ON)
option(PXR_ENABLE_PYTHON_SUPPORT "Enable Python based components for USD" ON)
option(PXR_USE_DEBUG_PYTHON "Build with debug python" OFF)
option(PXR_USE_BOOST_PYTHON "Use boost::python for Python bindings" ON)
option(PXR_ENABLE_HDF5_SUPPORT "Enable HDF5 backend in the Alembic plugin for USD" OFF)
option(PXR_ENABLE_OSL_SUPPORT "Enable OSL (OpenShadingLanguage) based components" OFF)
option(PXR_ENABLE_PTEX_SUPPORT "Enable Ptex support" OFF)
option(PXR_ENABLE_OPENVDB_SUPPORT "Enable OpenVDB support" OFF)
option(PXR_BUILD_MAYAPY_TESTS "Build mayapy spline tests" OFF)
option(PXR_BUILD_ANIMX_TESTS "Build AnimX spline tests" OFF)
option(PXR_ENABLE_NAMESPACES "Enable C++ namespaces." ON)
option(PXR_PREFER_SAFETY_OVER_SPEED
"Enable certain checks designed to avoid crashes or out-of-bounds memory reads with malformed input files. These checks may negatively impact performance."
ON)
if(APPLE)
# Cross Compilation detection as defined in CMake docs
# Required to be handled here so it can configure options later on
# https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-for-ios-tvos-visionos-or-watchos
# Note: All these SDKs may not be supported by OpenUSD, but are all listed here for future proofing
set(PXR_APPLE_EMBEDDED OFF)
if (CMAKE_SYSTEM_NAME MATCHES "iOS"
OR CMAKE_SYSTEM_NAME MATCHES "tvOS"
OR CMAKE_SYSTEM_NAME MATCHES "visionOS"
OR CMAKE_SYSTEM_NAME MATCHES "watchOS")
set(PXR_APPLE_EMBEDDED ON)
if(${PXR_BUILD_USD_TOOLS})
MESSAGE(STATUS "Setting PXR_BUILD_USD_TOOLS=OFF because they are not supported on Apple embedded platforms")
set(PXR_BUILD_USD_TOOLS OFF)
endif()
endif ()
endif()
# Determine GFX api
# Metal only valid on Apple platforms
set(pxr_enable_metal "OFF")
if(APPLE)
set(pxr_enable_metal "ON")
endif()
option(PXR_ENABLE_METAL_SUPPORT "Enable Metal based components" "${pxr_enable_metal}")
option(PXR_ENABLE_VULKAN_SUPPORT "Enable Vulkan based components" OFF)
option(PXR_ENABLE_GL_SUPPORT "Enable OpenGL based components" ON)
if (PXR_APPLE_EMBEDDED)
set(PXR_ENABLE_GL_SUPPORT OFF)
endif ()
# Precompiled headers are a win on Windows, not on gcc.
set(pxr_enable_pch "OFF")
if(MSVC)
set(pxr_enable_pch "ON")
endif()
option(PXR_ENABLE_PRECOMPILED_HEADERS "Enable precompiled headers." "${pxr_enable_pch}")
set(PXR_PRECOMPILED_HEADER_NAME "pch.h"
CACHE
STRING
"Default name of precompiled header files"
)
set(PXR_INSTALL_LOCATION ""
CACHE
STRING
"Intended final location for plugin resource files."
)
set(PXR_OVERRIDE_PLUGINPATH_NAME ""
CACHE
STRING
"Name of the environment variable that will be used to get plugin paths."
)
set(PXR_TEST_RUN_TEMP_DIR_PREFIX ""
CACHE
STRING
"Prefix for test run temporary directory names. \
Setting this option to \"foo-\" will create directories like \
\"<temp dir>/foo-<test dir>\"."
)
set(PXR_ALL_LIBS ""
CACHE
INTERNAL
"Aggregation of all built libraries."
)
set(PXR_STATIC_LIBS ""
CACHE
INTERNAL
"Aggregation of all built explicitly static libraries."
)
set(PXR_CORE_LIBS ""
CACHE
INTERNAL
"Aggregation of all built core libraries."
)
set(PXR_OBJECT_LIBS ""
CACHE
INTERNAL
"Aggregation of all core libraries built as OBJECT libraries."
)
string(CONCAT helpstr
"Prefix for built library filenames. If unspecified, defaults "
"to 'libusd_' on Linux/macOS and 'usd_' on Windows, or '' for "
"monolithic builds."
)
set(PXR_LIB_PREFIX ""
CACHE
STRING
"${helpstr}"
)
option(BUILD_SHARED_LIBS "Build shared libraries." ON)
option(PXR_BUILD_MONOLITHIC "Build a monolithic library." OFF)
set(PXR_MONOLITHIC_IMPORT ""
CACHE
STRING
"Path to cmake file that imports a usd_ms target"
)
set(PXR_EXTRA_PLUGINS ""
CACHE
INTERNAL
"Aggregation of extra plugin directories containing a plugInfo.json.")
# Resolve options that depend on one another so that subsequent .cmake scripts
# all have the final value for these options.
if (${PXR_BUILD_USD_IMAGING} AND NOT ${PXR_BUILD_IMAGING})
message(STATUS
"Setting PXR_BUILD_USD_IMAGING=OFF because PXR_BUILD_IMAGING=OFF")
set(PXR_BUILD_USD_IMAGING "OFF" CACHE BOOL "" FORCE)
endif()
if (${PXR_ENABLE_METAL_SUPPORT})
if (NOT APPLE)
message(STATUS
"Setting PXR_ENABLE_METAL_SUPPORT=OFF because Metal is only supported on macOS")
set(PXR_ENABLE_METAL_SUPPORT "OFF" CACHE BOOL "" FORCE)
endif()
endif()
if (${PXR_ENABLE_GL_SUPPORT} OR ${PXR_ENABLE_METAL_SUPPORT} OR ${PXR_ENABLE_VULKAN_SUPPORT})
set(PXR_BUILD_GPU_SUPPORT "ON")
else()
set(PXR_BUILD_GPU_SUPPORT "OFF")
endif()
if (${PXR_BUILD_USDVIEW})
if (NOT ${PXR_BUILD_USD_IMAGING})
message(STATUS
"Setting PXR_BUILD_USDVIEW=OFF because "
"PXR_BUILD_USD_IMAGING=OFF")
set(PXR_BUILD_USDVIEW "OFF" CACHE BOOL "" FORCE)
elseif (NOT ${PXR_ENABLE_PYTHON_SUPPORT})
message(STATUS
"Setting PXR_BUILD_USDVIEW=OFF because "
"PXR_ENABLE_PYTHON_SUPPORT=OFF")
set(PXR_BUILD_USDVIEW "OFF" CACHE BOOL "" FORCE)
elseif (NOT ${PXR_BUILD_GPU_SUPPORT})
message(STATUS
"Setting PXR_BUILD_USDVIEW=OFF because "
"PXR_BUILD_GPU_SUPPORT=OFF")
set(PXR_BUILD_USDVIEW "OFF" CACHE BOOL "" FORCE)
endif()
endif()
if (${PXR_BUILD_EMBREE_PLUGIN})
if (NOT ${PXR_BUILD_IMAGING})
message(STATUS
"Setting PXR_BUILD_EMBREE_PLUGIN=OFF because PXR_BUILD_IMAGING=OFF")
set(PXR_BUILD_EMBREE_PLUGIN "OFF" CACHE BOOL "" FORCE)
elseif (NOT ${PXR_BUILD_GPU_SUPPORT})
message(STATUS
"Setting PXR_BUILD_EMBREE_PLUGIN=OFF because "
"PXR_BUILD_GPU_SUPPORT=OFF")
set(PXR_BUILD_EMBREE_PLUGIN "OFF" CACHE BOOL "" FORCE)
endif()
endif()
if (${PXR_BUILD_PRMAN_PLUGIN})
if (NOT ${PXR_BUILD_IMAGING})
message(STATUS
"Setting PXR_BUILD_PRMAN_PLUGIN=OFF because PXR_BUILD_IMAGING=OFF")
set(PXR_BUILD_PRMAN_PLUGIN "OFF" CACHE BOOL "" FORCE)
endif()
endif()
# Error out if user is building monolithic library on windows with draco plugin
# enabled. This currently results in missing symbols.
if (${PXR_BUILD_DRACO_PLUGIN} AND ${PXR_BUILD_MONOLITHIC} AND WIN32)
message(FATAL_ERROR
"Draco plugin can not be enabled for monolithic builds on Windows")
endif()
# Make sure PXR_BUILD_DOCUMENTATION and PXR_ENABLE_PYTHON_SUPPORT are enabled
# if PXR_BUILD_PYTHON_DOCUMENTATION is enabled
if (${PXR_BUILD_PYTHON_DOCUMENTATION})
if (NOT ${PXR_BUILD_DOCUMENTATION})
message(STATUS
"Setting PXR_BUILD_PYTHON_DOCUMENTATION=OFF because "
"PXR_BUILD_DOCUMENTATION=OFF")
set(PXR_BUILD_PYTHON_DOCUMENTATION "OFF" CACHE BOOL "" FORCE)
elseif (NOT ${PXR_ENABLE_PYTHON_SUPPORT})
message(STATUS
"Setting PXR_BUILD_PYTHON_DOCUMENTATION=OFF because "
"PXR_ENABLE_PYTHON_SUPPORT=OFF")
set(PXR_BUILD_PYTHON_DOCUMENTATION "OFF" CACHE BOOL "" FORCE)
endif()
endif()