Skip to content

Commit

Permalink
Make boost an optional dependency of OpenUSD
Browse files Browse the repository at this point in the history
  • Loading branch information
nvmkuruc committed Apr 1, 2024
1 parent 3858c45 commit a7e9b70
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ Dependencies
Required:
- C/C++ compiler
- [CMake](https://cmake.org/documentation/)
- [Boost](https://boost.org)
- [Intel TBB](https://www.threadingbuildingblocks.org/)

Optional:
- [Python](https://python.org)
- [Boost](https://boost.org)

See [3rd Party Library and Application Versions](VERSIONS.md) for version information.

Expand Down
7 changes: 5 additions & 2 deletions build_scripts/build_usd.py
Original file line number Diff line number Diff line change
Expand Up @@ -2257,7 +2257,10 @@ def ForceBuildDependency(self, dep):

# Determine list of dependencies that are required based on options
# user has selected.
requiredDependencies = [ZLIB, BOOST, TBB]
requiredDependencies = [ZLIB, TBB]

if any((context.buildPython, context.buildExamples)):
requiredDependencies += [BOOST]

if context.buildAlembic:
if context.enableHDF5:
Expand Down Expand Up @@ -2563,7 +2566,7 @@ def FormatBuildArguments(buildArgs):

# Ensure directory structure is created and is writable.
for dir in [context.usdInstDir, context.instDir, context.srcDir,
context.buildDir]:
context.buildDir, os.path.join(context.instDir, 'lib')]:
try:
if os.path.isdir(dir):
testFile = os.path.join(dir, "canwrite")
Expand Down
9 changes: 5 additions & 4 deletions cmake/defaults/Packages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
find_package(Threads REQUIRED)
set(PXR_THREAD_LIBS "${CMAKE_THREAD_LIBS_INIT}")

# Find Boost package before getting any boost specific components as we need to
# disable boost-provided cmake config, based on the boost version found.
find_package(Boost REQUIRED)

if(PXR_ENABLE_PYTHON_SUPPORT OR PXR_ENABLE_OPENVDB_SUPPORT OR PXR_BUILD_OPENIMAGEIO_PLUGIN OR PXR_BUILD_EXAMPLES)
# Find Boost package before getting any boost specific components as we need to
# disable boost-provided cmake config, based on the boost version found.
find_package(Boost REQUIRED)
endif()
# Boost provided cmake files (introduced in boost version 1.70) result in
# inconsistent build failures on different platforms, when trying to find boost
# component dependencies like python, etc. Refer some related
Expand Down
24 changes: 12 additions & 12 deletions pxr/base/vt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ pxr_library(vt
PUBLIC_CLASSES
array
dictionary
functions
hash
streamOut
types
value

PYTHON_PUBLIC_CLASSES
arrayPyBuffer
functions
valueFromPython
wrapArray

Expand Down Expand Up @@ -62,14 +62,14 @@ pxr_library(vt
overview.dox
)

pxr_build_test(testVtCpp
LIBRARIES
tf
gf
vt
CPPFILES
testenv/testVtCpp.cpp
)
# pxr_build_test(testVtCpp
# LIBRARIES
# tf
# gf
# vt
# CPPFILES
# testenv/testVtCpp.cpp
# )
pxr_test_scripts(
testenv/testVtArray.py
testenv/testVtValue.py
Expand All @@ -87,6 +87,6 @@ pxr_register_test(testVtFunctions
PYTHON
COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testVtFunctions"
)
pxr_register_test(testVtCpp
COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testVtCpp"
)
# pxr_register_test(testVtCpp
# COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testVtCpp"
# )

0 comments on commit a7e9b70

Please sign in to comment.