Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Build] Make examples+tutorials optional. #594

Merged
merged 1 commit into from
Apr 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions build_scripts/build_usd.py
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,16 @@ def InstallUSD(context, force, buildArgs):
extraArgs.append('-DPXR_BUILD_TESTS=ON')
else:
extraArgs.append('-DPXR_BUILD_TESTS=OFF')

if context.buildExamples:
extraArgs.append('-DPXR_BUILD_EXAMPLES=ON')
else:
extraArgs.append('-DPXR_BUILD_EXAMPLES=OFF')

if context.buildTutorials:
extraArgs.append('-DPXR_BUILD_TUTORIALS=ON')
else:
extraArgs.append('-DPXR_BUILD_TUTORIALS=OFF')

if context.buildImaging:
extraArgs.append('-DPXR_BUILD_IMAGING=ON')
Expand Down Expand Up @@ -1122,6 +1132,16 @@ def InstallUSD(context, force, buildArgs):
subgroup.add_argument("--no-tests", dest="build_tests", action="store_false",
help="Do not build unit tests (default)")
subgroup = group.add_mutually_exclusive_group()
subgroup.add_argument("--examples", dest="build_examples", action="store_true",
default=False, help="Build examples")
subgroup.add_argument("--no-examples", dest="build_examples", action="store_false",
help="Do not build examples (default)")
subgroup = group.add_mutually_exclusive_group()
subgroup.add_argument("--tutorials", dest="build_tutorials", action="store_true",
default=False, help="Build tutorials")
subgroup.add_argument("--no-tutorials", dest="build_tutorials", action="store_false",
help="Do not build tutorials (default)")
subgroup = group.add_mutually_exclusive_group()
subgroup.add_argument("--docs", dest="build_docs", action="store_true",
default=False, help="Build documentation")
subgroup.add_argument("--no-docs", dest="build_docs", action="store_false",
Expand Down Expand Up @@ -1299,6 +1319,8 @@ def __init__(self, args):
self.buildTests = args.build_tests
self.buildDocs = args.build_docs
self.buildPython = args.build_python
self.buildExamples = args.build_examples
self.buildTutorials = args.build_tutorials

# - Imaging
self.buildImaging = (args.build_imaging == IMAGING or
Expand Down Expand Up @@ -1520,6 +1542,8 @@ def ForceBuildDependency(self, dep):
Python support {buildPython}
Documentation {buildDocs}
Tests {buildTests}
Examples {buildExamples}
Tutorials {buildTutorials}
Alembic Plugin {buildAlembic}
HDF5 support: {enableHDF5}
MaterialX Plugin {buildMaterialX}
Expand Down Expand Up @@ -1566,6 +1590,8 @@ def FormatBuildArguments(buildArgs):
buildPython=("On" if context.buildPython else "Off"),
buildDocs=("On" if context.buildDocs else "Off"),
buildTests=("On" if context.buildTests else "Off"),
buildExamples=("On" if context.buildExamples else "Off"),
buildTutorials=("On" if context.buildTutorials else "Off"),
buildAlembic=("On" if context.buildAlembic else "Off"),
buildMaterialX=("On" if context.buildMaterialX else "Off"),
enableHDF5=("On" if context.enableHDF5 else "Off"),
Expand Down
9 changes: 6 additions & 3 deletions extras/usd/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
add_subdirectory(examples)
add_subdirectory(tutorials)

if (PXR_BUILD_TUTORIALS)
add_subdirectory(tutorials)
endif()
if (PXR_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()