Switch OpenUSD build to CMAKE_PREFIX_PATH

main
Stephan Menzel 2025-06-26 13:41:55 +02:00
parent ab11f36e72
commit 2b12ddd653
1 changed files with 15 additions and 12 deletions

View File

@ -6,7 +6,7 @@ from pathlib import Path
from build_functions.build_utils import print_banner from build_functions.build_utils import print_banner
from common.azure import write_package_version_batch from common.azure import write_package_version_batch
from common.cmake import cmake_build_install from common.cmake import cmake_build_install, assemble_prefix_path
import common.settings import common.settings
from common.git_helpers import clone_git_tag from common.git_helpers import clone_git_tag
from common.settings import temporarily_set_shared from common.settings import temporarily_set_shared
@ -22,10 +22,14 @@ def build_openusd(prefix: Path | str, sbom: dict):
# I mistook boost for a direct dependency but it turned out to be an indirect one. # I mistook boost for a direct dependency but it turned out to be an indirect one.
# Various other, optional, dependencies such as OpenImageIO use it. # Various other, optional, dependencies such as OpenImageIO use it.
# We don't have them in here yet but I keep boost to prepare for that # We don't have them in here yet but I keep boost to prepare for that
boost_install_path = package_info.dependency_path("boost") deps = [
hdf5_install_path = package_info.dependency_path("hdf5") package_info.dependency("boost"),
onetbb_install_path = package_info.dependency_path("onetbb") package_info.dependency("hdf5"),
opensubdiv_install_path = package_info.dependency_path("opensubdiv") package_info.dependency("onetbb"),
package_info.dependency("opensubdiv"),
package_info.dependency("zlib")
]
zlib_install_path = package_info.dependency_path("zlib") zlib_install_path = package_info.dependency_path("zlib")
# OpenUSD definately doesn't want to be build static. Only errors. DLL it is then. # OpenUSD definately doesn't want to be build static. Only errors. DLL it is then.
@ -36,14 +40,13 @@ def build_openusd(prefix: Path | str, sbom: dict):
("PXR_BUILD_EXAMPLES:BOOL", "ON"), ("PXR_BUILD_EXAMPLES:BOOL", "ON"),
("PXR_BUILD_TESTS:BOOL", "OFF"), ("PXR_BUILD_TESTS:BOOL", "OFF"),
("PXR_BUILD_TUTORIALS:BOOL", "ON"), ("PXR_BUILD_TUTORIALS:BOOL", "ON"),
("PXR_BUILD_HTML_DOCUMENTATION:BOOL", "OFF"), ("PXR_BUILD_HTML_DOCUMENTATION:BOOL", "ON"),
("hdf5_DIR:PATH", str(hdf5_install_path / "cmake")), # This will pull in the Vulkan SDK. We're probably going to need it at some point
("Boost_ROOT:PATH", str(boost_install_path)), ("PXR_ENABLE_VULKAN_SUPPORT:BOOL", "OFF"),
("Boost_DIR:PATH", str(boost_install_path / "lib" / "cmake" / "Boost-1.88.0")),
("TBB_DIR:PATH", str(onetbb_install_path / "lib" / "cmake" / "TBB")), ("CMAKE_PREFIX_PATH:STRING", assemble_prefix_path(deps)),
("OpenSubdiv_DIR:PATH", str(opensubdiv_install_path / "lib" / "cmake" / "OpenSubdiv")), ("ZLIB_ROOT:PATH", str(zlib_install_path.as_posix())),
("ZLIB_ROOT:PATH", str(zlib_install_path)),
("ZLIB_USE_STATIC_LIBS:BOOL", "ON"), # doesn't appear to do its job ("ZLIB_USE_STATIC_LIBS:BOOL", "ON"), # doesn't appear to do its job
("ZLIB_LIBRARY_RELEASE:FILEPATH", str(zlib_install_path / "lib" / common.settings.zlib_static_lib_name)), ("ZLIB_LIBRARY_RELEASE:FILEPATH", str(zlib_install_path / "lib" / common.settings.zlib_static_lib_name)),
("ZLIB_LIBRARY_DEBUG:FILEPATH", str(zlib_install_path / "lib" / common.settings.zlib_static_lib_name)) ("ZLIB_LIBRARY_DEBUG:FILEPATH", str(zlib_install_path / "lib" / common.settings.zlib_static_lib_name))