Skip to content

Commit

Permalink
Use newer release
Browse files Browse the repository at this point in the history
  • Loading branch information
EstebanDugueperoux2 committed Sep 14, 2024
1 parent e23e22d commit c6eea8d
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 39 deletions.
7 changes: 3 additions & 4 deletions recipes/openusd/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
sources:
"24.05":
url:
- "https://github.com/PixarAnimationStudios/OpenUSD/archive/refs/tags/v24.05.tar.gz"
sha256: "0352619895588efc8f9d4aa7004c92be4e4fa70e1ccce77e474ce23941c05828"
"24.08":
url: "https://github.com/PixarAnimationStudios/OpenUSD/archive/refs/tags/v24.08.tar.gz"
sha256: "6640bb184bf602c6df14fa4a83af6ac5ae1ab8d1d38cf7bb7decfaa9a7ad5d06"
121 changes: 87 additions & 34 deletions recipes/openusd/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ class OpenUSDConan(ConanFile):
"enable_materialx_support": True,
"enable_vulkan_support": False,
"enable_gl_support": False,
"build_gpu_support": False,
"enable_ptex_support": True,
"enable_openvdb_support": False,
"build_renderman_plugin": False,
Expand All @@ -65,7 +64,7 @@ class OpenUSDConan(ConanFile):
"build_draco_plugin": True,
"enable_osl_support": False,
"build_animx_tests": False,
"enable_python_support": True,
"enable_python_support": False
}

short_paths = True
Expand All @@ -76,14 +75,19 @@ def _min_cppstd(self):

@property
def _compilers_minimum_version(self):
# as defined in https://github.com/PixarAnimationStudios/OpenUSD/blob/release/VERSIONS.md
return {
"apple-clang": "10",
"apple-clang": "13",
"clang": "7",
"gcc": "7",
"gcc": "9",
"msvc": "191",
"Visual Studio": "15",
}

@property
def _enable_ptex(self):
return self.options.enable_ptex_support and self.options.enable_gl_support and self.options.build_gpu_support

def export_sources(self):
export_conandata_patches(self)

Expand Down Expand Up @@ -115,42 +119,46 @@ def config_options(self):
def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")
self.options["opensubdiv/*"].with_opengl = self.options.enable_gl_support

def layout(self):
cmake_layout(self, src_folder="src")

def requirements(self):
self.requires("boost/1.84.0", transitive_headers=True)
if self.options.enable_python_support:
# self.requires("boost/1.86.0", transitive_headers=True)
self.requires("boost/1.86.0")
# openusd doesn't support yet recent release of onetbb, see https://github.com/PixarAnimationStudios/OpenUSD/issues/1471
self.requires("onetbb/2019_u9", transitive_headers=True)
self.requires("onetbb/2021.12.0", transitive_headers=True)

if self.options.build_imaging:
if self.options.build_openimageio_plugin and self.options.build_gpu_support:
self.requires("openimageio/2.5.12.0")
self.requires("openimageio/2.5.14.0")
if not self.options.build_openimageio_plugin and self.options.build_opencolorio_plugin and self.options.build_gpu_support and self.options.enable_gl_support:
self.requires("opencolorio/2.3.1")
self.requires("opencolorio/2.3.2")
self.requires("opensubdiv/3.6.0")
if self.options.enable_vulkan_support:
self.requires("vulkan-headers/1.3.268.0")
self.requires("vulkan-headers/1.3.290.0")
if self.options.enable_gl_support:
self.requires("opengl/system")
if self.options.enable_ptex_support:
if self._enable_ptex:
self.requires("ptex/2.4.2")
if self.options.enable_openvdb_support:
self.requires("openvdb/11.0.0")
if self.options.build_embree_plugin:
if self.options.build_embree_plugin and self.options.build_gpu_support:
self.requires("embree3/3.13.5")
# if self.options.build_renderman_plugin:
# TODO: add a recipe for renderman
# self.requires("renderman/x.y.z")
if self.options.build_alembic_plugin:
self.requires("alembic/1.8.6")
if self.options.enable_hdf5_support:
self.requires("hdf5/1.14.3")
self.requires("hdf5/1.14.4.3")
if self.options.build_draco_plugin:
self.requires("draco/1.5.6")
if self.options.enable_materialx_support:
self.requires("materialx/1.38.10", transitive_headers=True)
# self.requires("materialx/1.39.1", transitive_headers=True)
# if self.options.enable_osl_support:
# TODO: add osl to conan center (https://github.com/AcademySoftwareFoundation/OpenShadingLanguage)
# self.requires("openshadinglanguage/1.13.8.0")
Expand Down Expand Up @@ -185,17 +193,19 @@ def source(self):

def generate(self):
tc = CMakeToolchain(self)
# Use variables in documented in https://github.com/PixarAnimationStudios/OpenUSD/blob/release/BUILDING.md
tc.variables["PXR_BUILD_TESTS"] = False
tc.variables["PXR_BUILD_EXAMPLES"] = False
tc.variables["PXR_BUILD_TUTORIALS"] = False
tc.variables["PXR_BUILD_HTML_DOCUMENTATION"] = False
tc.variables["PXR_ENABLE_PYTHON_SUPPORT"] = self.options.enable_python_support
tc.variables["PXR_BUILD_USD_TOOLS"] = self.options.build_usd_tools

tc.variables["OPENSUBDIV_LIBRARIES"] = "opensubdiv::opensubdiv"
tc.variables["OPENSUBDIV_LIBRARIES"] = self.dependencies['opensubdiv'].cpp_info.libdirs[0]
tc.variables["OPENSUBDIV_INCLUDE_DIR"] = self.dependencies['opensubdiv'].cpp_info.includedirs[0]

tc.variables["TBB_tbb_LIBRARY"] = "TBB::tbb"

tc.variables["OPENVDB_LIBRARY"] = "OpenVDB::openvdb"

tc.variables["PXR_ENABLE_MATERIALX_SUPPORT"] = self.options.enable_materialx_support
Expand All @@ -205,25 +215,45 @@ def generate(self):
tc.variables["PXR_BUILD_IMAGING"] = True
tc.variables["PXR_ENABLE_GL_SUPPORT"] = self.options.enable_gl_support
tc.variables["PXR_ENABLE_VULKAN_SUPPORT"] = self.options.enable_vulkan_support
tc.variables["PXR_ENABLE_PTEX_SUPPORT"] = self.options.enable_ptex_support

if self._enable_ptex:
tc.variables["PXR_ENABLE_PTEX_SUPPORT"] = True
tc.variables["PTEX_LIBRARY"] = self.dependencies['ptex'].cpp_info.libdirs[0]
tc.variables["PTEX_INCLUDE_DIR"] = self.dependencies['ptex'].cpp_info.includedirs[0]

tc.variables["PXR_ENABLE_OPENVDB_SUPPORT"] = self.options.enable_openvdb_support
tc.variables["PXR_BUILD_OPENIMAGEIO_PLUGIN"] = self.options.build_openimageio_plugin and self.options.build_gpu_support
tc.variables["PXR_BUILD_COLORIO_PLUGIN"] = self.options.build_opencolorio_plugin and self.options.enable_gl_support and self.options.build_gpu_support
tc.variables["PXR_BUILD_EMBREE_PLUGIN"] = self.options.build_embree_plugin
tc.variables["EMBREE_FOUND"] = self.options.build_embree_plugin

if self.options.build_embree_plugin and self.options.build_gpu_support:
tc.variables["PXR_BUILD_EMBREE_PLUGIN"] = self.options.build_embree_plugin
tc.variables["EMBREE_LIBRARY"] = self.dependencies['embree3'].cpp_info.libdirs[0]
tc.variables["EMBREE_INCLUDE_DIR"] = self.dependencies['embree3'].cpp_info.includedirs[0]

if self.options.build_usd_imaging:
tc.variables["PXR_BUILD_USD_IMAGING"] = True
if self.options.build_usdview:
tc.variables["PXR_BUILD_USDVIEW"] = True

tc.variables["PXR_BUILD_PRMAN_PLUGIN"] = self.options.build_renderman_plugin
tc.variables["PXR_BUILD_ALEMBIC_PLUGIN"] = self.options.build_alembic_plugin
tc.variables["ALEMBIC_FOUND"] = self.options.build_alembic_plugin

if self.options.build_alembic_plugin:
tc.variables["PXR_BUILD_ALEMBIC_PLUGIN"] = True
tc.variables["ALEMBIC_LIBRARY_DIR"] = self.dependencies['alembic'].cpp_info.libdirs[0]
tc.variables["ALEMBIC_INCLUDE_DIR"] = self.dependencies['alembic'].cpp_info.includedirs[0]

tc.variables["PXR_ENABLE_HDF5_SUPPORT"] = self.options.build_alembic_plugin and self.options.enable_hdf5_support
tc.variables["PXR_BUILD_DRACO_PLUGIN"] = self.options.build_draco_plugin

if self.options.build_draco_plugin:
tc.variables["PXR_BUILD_DRACO_PLUGIN"] = True
tc.variables["DRACO_LIBRARY"] = self.dependencies['draco'].cpp_info.libdirs[0]
tc.variables["DRACO_INCLUDES"] = self.dependencies['draco'].cpp_info.includedirs[0]

tc.variables["PXR_ENABLE_OSL_SUPPORT"] = self.options.enable_osl_support
tc.variables["PXR_BUILD_ANIMX_TESTS"] = self.options.build_animx_tests

tc.variables["MaterialX_DIR"] = self.options.build_animx_tests

tc.generate()

tc = CMakeDeps(self)
Expand Down Expand Up @@ -296,18 +326,14 @@ def package_info(self):

if self.options.enable_gl_support:
self.cpp_info.components["usd_garch"].libs = ["usd_garch"]
self.cpp_info.components["usd_garch"].requires = ["usd_arch", "usd_tf"]
# ${X11_LIBRARIES}
# ${OPENGL_gl_LIBRARY}
# ${GARCH_PLATFORM_LIBRARIES}
self.cpp_info.components["usd_garch"].requires = ["usd_arch", "usd_tf", "opengl::opengl"]

self.cpp_info.components["usd_geomUtil"].libs = ["usd_geomUtil"]
self.cpp_info.components["usd_geomUtil"].requires = ["usd_arch", "usd_gf", "usd_tf", "usd_vt", "usd_pxOsd"]

if self.options.enable_gl_support:
self.cpp_info.components["usd_glf"].libs = ["usd_glf"]
self.cpp_info.components["usd_glf"].requires = ["usd_ar", "usd_arch", "usd_garch", "usd_gf", "usd_hf", "usd_hio", "usd_plug", "usd_tf", "usd_trace", "usd_sdf", "opengl::opengl"]
# ${X11_LIBRARIES}

self.cpp_info.components["usd_hd"].libs = ["usd_hd"]
self.cpp_info.components["usd_hd"].requires = ["usd_plug", "usd_tf", "usd_trace", "usd_vt", "usd_work", "usd_sdf", "usd_cameraUtil", "usd_hf", "usd_pxOsd", "usd_sdr", "onetbb::libtbb"]
Expand All @@ -334,7 +360,7 @@ def package_info(self):
self.cpp_info.components["usd_hdSt"].requires = ["usd_hio", "usd_garch", "usd_glf", "usd_hd", "usd_hdsi", "usd_hgiGL", "usd_hgiInterop", "usd_sdr", "usd_tf", "usd_trace", "opensubdiv::opensubdiv"]
if self.options.enable_materialx_support:
self.cpp_info.components["usd_hdSt"].requires.extend(["materialx::MaterialXGenShader", "materialx::MaterialXRender", "materialx::MaterialXCore", "materialx::MaterialXFormat", "materialx::MaterialXGenGlsl", "usd_hdMtlx"])
if self.options.enable_ptex_support:
if self._enable_ptex:
self.cpp_info.components["usd_hdSt"].requires.append("ptex::ptex")

if self.options.enable_gl_support and self.options.build_gpu_support:
Expand Down Expand Up @@ -374,24 +400,31 @@ def package_info(self):

if self.options.enable_openvdb_support and self.options.build_gpu_support:
self.cpp_info.components["usd_hioOpenVDB"].libs = ["usd_hioOpenVDB"]
self.cpp_info.components["usd_hioOpenVDB"].requires = ["usd_ar", "usd_gf", "usd_hio", "usd_tf", "usd_usd", "imath::imath", "openvdb::openvdb"]
self.cpp_info.components["usd_hioOpenVDB"].requires = ["usd_ar", "usd_gf", "usd_hio", "usd_tf", "usd_usd", "openvdb::openvdb"]
if self.options.build_imaging and (self.options.build_openimageio_plugin and self.options.build_gpu_support or self.options.enable_openvdb_support) or self.options.build_alembic_plugin or self.options.enable_osl_support:
self.cpp_info.components["usd_hioOpenVDB"].requires.append("imath::imath")

# plugins
if self.options.build_openimageio_plugin and self.options.build_gpu_support:
self.cpp_info.components["usd_hioOiio"].libs = ["usd_hioOiio"]
self.cpp_info.components["usd_hioOiio"].requires = ["usd_ar", "usd_arch", "usd_gf", "usd_hio", "usd_tf", "openimageio::openimageio", "imath::imath"]
self.cpp_info.components["usd_hioOiio"].requires = ["usd_ar", "usd_arch", "usd_gf", "usd_hio", "usd_tf", "openimageio::openimageio"]
if self.options.build_imaging and (self.options.build_openimageio_plugin and self.options.build_gpu_support or self.options.enable_openvdb_support) or self.options.build_alembic_plugin or self.options.enable_osl_support:
self.cpp_info.components["usd_hioOiio"].requires.append("imath::imath")

if self.options.build_embree_plugin and self.options.build_gpu_support:
self.cpp_info.components["usd_hdEmbree"].libs = ["usd_hdEmbree"]
self.cpp_info.components["usd_hdEmbree"].requires = ["usd_plug", "usd_tf", "usd_vt", "usd_gf", "usd_work", "usd_hf", "usd_hd", "usd_hdx", "onetbb::libtbb", "embree::embree"]
self.cpp_info.components["usd_hdEmbree"].requires = ["usd_plug", "usd_tf", "usd_vt", "usd_gf", "usd_work", "usd_hf", "usd_hd", "usd_hdx", "onetbb::libtbb", "embree3::embree3"]

if self.options.build_usd_imaging:
self.cpp_info.components["usd_usdImaging"].libs = ["usd_usdImaging"]
self.cpp_info.components["usd_usdImaging"].requires = ["usd_gf", "usd_tf", "usd_plug", "usd_trace", "usd_vt", "usd_work", "usd_geomUtil", "usd_hd", "usd_hdar", "usd_hio", "usd_pxOsd", "usd_sdf", "usd_usd", "usd_usdGeom", "usd_usdLux", "usd_usdRender", "usd_usdShade", "usd_usdVol", "usd_ar", "onetbb::libtbb"]

if self.options.enable_gl_support and self.options.build_gpu_support:
self.cpp_info.components["usd_usdImaging"].libs = ["usd_usdImaging"]
self.cpp_info.components["usd_usdImaging"].requires = ["usd_gf", "usd_tf", "usd_plug", "usd_trace", "usd_vt", "usd_work", "usd_hio", "usd_garch", "usd_glf", "usd_hd", "usd_hdsi", "usd_hdx", "usd_pxOsd", "usd_sdf", "usd_sdr", "usd_usd", "usd_usdGeom", "usd_usdHydra", "usd_usdShade", "usd_usdImaging", "usd_ar", "onetbb::libtbb"]
if self.options.build_gpu_support:
self.cpp_info.components["usd_usdAppUtils"].libs = ["usd_usdAppUtils"]
self.cpp_info.components["usd_usdAppUtils"].requires = ["usd_garch", "usd_gf", "usd_hio", "usd_sdf", "usd_tf", "usd_usd", "usd_usdGeom", "usd_usdImagingGL"]

self.cpp_info.components["usd_usdImagingGL"].libs = ["usd_usdImagingGL"]
self.cpp_info.components["usd_usdImagingGL"].requires = ["usd_gf", "usd_tf", "usd_plug", "usd_trace", "usd_vt", "usd_work", "usd_hio", "usd_garch", "usd_glf", "usd_hd", "usd_hdsi", "usd_hdx", "usd_pxOsd", "usd_sdf", "usd_sdr", "usd_usd", "usd_usdGeom", "usd_usdHydra", "usd_usdShade", "usd_usdImaging", "usd_ar", "onetbb::libtbb"]

self.cpp_info.components["usd_usdProcImaging"].libs = ["usd_usdProcImaging"]
self.cpp_info.components["usd_usdProcImaging"].requires = ["usd_usdImaging", "usd_usdProc"]
Expand All @@ -411,7 +444,7 @@ def package_info(self):

# usd
self.cpp_info.components["usd_ar"].libs = ["usd_ar"]
self.cpp_info.components["usd_ar"].requires = ["usd_arch", "usd_js", "usd_tf", "usd_plug", "usd_vt"]
self.cpp_info.components["usd_ar"].requires = ["usd_arch", "usd_js", "usd_tf", "usd_plug", "usd_vt", "onetbb::onetbb"]

self.cpp_info.components["usd_kind"].libs = ["usd_kind"]
self.cpp_info.components["usd_kind"].requires = ["usd_tf", "usd_plug"]
Expand All @@ -429,7 +462,7 @@ def package_info(self):
self.cpp_info.components["usd_sdr"].requires = ["usd_tf", "usd_vt", "usd_ar", "usd_ndr", "usd_sdf"]

self.cpp_info.components["usd_usd"].libs = ["usd_usd"]
self.cpp_info.components["usd_usd"].requires = ["usd_arch", "usd_kind", "usd_pcp", "usd_sdf", "usd_ar", "usd_plug", "usd_tf", "usd_trace", "usd_vt", "usd_work", "boost::boost", "onetbb::libtbb"]
self.cpp_info.components["usd_usd"].requires = ["usd_arch", "usd_kind", "usd_pcp", "usd_sdf", "usd_ar", "usd_plug", "usd_tf", "usd_trace", "usd_vt", "usd_work", "onetbb::libtbb"]

self.cpp_info.components["usd_usdGeom"].libs = ["usd_usdGeom"]
self.cpp_info.components["usd_usdGeom"].requires = ["usd_js", "usd_tf", "usd_plug", "usd_vt", "usd_sdf", "usd_trace", "usd_usd", "usd_work", "onetbb::libtbb"]
Expand Down Expand Up @@ -473,3 +506,23 @@ def package_info(self):

self.cpp_info.components["usd_usdVol"].libs = ["usd_usdVol"]
self.cpp_info.components["usd_usdVol"].requires = ["usd_tf", "usd_usd", "usd_usdGeom"]

# plugins
self.cpp_info.libdirs.append("plugin")

if self.options.build_draco_plugin:
self.cpp_info.components["usd_Draco"].libs = ["usd_Draco"]
self.cpp_info.components["usd_Draco"].requires = ["usd_tf", "usd_gf", "usd_sdf", "usd_usd", "usd_usdGeom", "draco::draco"]

if self.options.build_alembic_plugin:
self.cpp_info.components["usd_Alembic"].libs = ["usd_Alembic"]
self.cpp_info.components["usd_Alembic"].requires = ["usd_tf", "usd_work", "usd_sdf", "usd_usd", "usd_usdGeom", "alembic::alembic"]
if self.options.enable_hdf5_support:
self.cpp_info.components["usd_Alembic"].requires.append("hdf5::hdf5")

if self.options.build_usd_imaging and not self.options.build_imaging:
self.cpp_info.components["usd_usdShaders"].libs = ["usdShaders"]
self.cpp_info.components["usd_usdShaders"].requires = ["usd_ar", "usd_ndr", "usd_sdr", "usd_usdShade"]

self.cpp_info.components["usd_sdrGlslfx"].libs = ["sdrGlslfx"]
self.cpp_info.components["usd_sdrGlslfx"].requires = ["usd_ar", "usd_ndr", "usd_sdr", "usd_hio"]
2 changes: 1 addition & 1 deletion recipes/openusd/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
versions:
"24.05":
"24.08":
folder: all

0 comments on commit c6eea8d

Please sign in to comment.