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 May 29, 2024
1 parent cdabf17 commit 36a74e6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 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 context.buildPython or 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

0 comments on commit 36a74e6

Please sign in to comment.