From c455198fff134b4da5287b183ba94dda5230819a Mon Sep 17 00:00:00 2001 From: Esteban DUGUEPEROUX Date: Sun, 8 Sep 2024 11:35:51 +0200 Subject: [PATCH] Use newer release --- recipes/openusd/all/conandata.yml | 7 +- recipes/openusd/all/conanfile.py | 148 ++++++++++++------ .../openusd/all/test_package/test_package.cpp | 2 +- recipes/openusd/config.yml | 2 +- 4 files changed, 106 insertions(+), 53 deletions(-) diff --git a/recipes/openusd/all/conandata.yml b/recipes/openusd/all/conandata.yml index 4d6b556615cff7..012ee38d47b33f 100644 --- a/recipes/openusd/all/conandata.yml +++ b/recipes/openusd/all/conandata.yml @@ -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" diff --git a/recipes/openusd/all/conanfile.py b/recipes/openusd/all/conanfile.py index 224d1071e25c41..014c8e103919f3 100644 --- a/recipes/openusd/all/conanfile.py +++ b/recipes/openusd/all/conanfile.py @@ -56,34 +56,38 @@ 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, - "build_alembic_plugin": True, + "build_alembic_plugin": False, "enable_hdf5_support": True, - "build_draco_plugin": True, + "build_draco_plugin": False, "enable_osl_support": False, "build_animx_tests": False, - "enable_python_support": True, + "enable_python_support": False } short_paths = True - @property + @property def _min_cppstd(self): return 17 @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) @@ -115,30 +119,33 @@ 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 @@ -146,18 +153,19 @@ def requirements(self): 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") # if self.options.build_animx_tests: # TODO: add animx to conan center (https://github.com/Autodesk/animx/) # self.requires("animx/x.y.z") - 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: + 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.requires("imath/3.1.9") def validate(self): @@ -185,45 +193,69 @@ 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 - + tc.variables["PXR_BUILD_IMAGING"] = self.options.build_imaging if self.options.build_imaging: 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_FOUND"] = True + tc.variables["ALEMBIC_LIBRARIES"] = "Alembic::Alembic" + 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"] = "draco::draco" + 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) @@ -296,18 +328,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"] @@ -320,7 +348,6 @@ def package_info(self): self.cpp_info.components["usd_hdsi"].libs = ["usd_hdsi"] self.cpp_info.components["usd_hdsi"].requires = ["usd_plug", "usd_tf", "usd_trace", "usd_vt", "usd_work", "usd_sdf", "usd_cameraUtil", "usd_geomUtil", "usd_hf", "usd_hd", "usd_pxOsd"] - if self.options.enable_materialx_support: self.cpp_info.components["usd_hdMtlx"].libs = ["usd_hdMtlx"] @@ -334,7 +361,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: @@ -365,7 +392,7 @@ def package_info(self): self.cpp_info.components["usd_hgiMetal"].libs = ["usd_hgiMetal"] self.cpp_info.components["usd_hgiMetal"].requires = ["usd_arch", "usd_hgi", "usd_tf", "usd_trace"] - if self.options.build_gpu_support and self.options.enable_vulkan_support: + if self.options.build_gpu_support and self.options.enable_vulkan_support: self.cpp_info.components["usd_hgiVulkan"].libs = ["usd_hgiVulkan"] self.cpp_info.components["usd_hgiVulkan"].requires = ["usd_arch", "usd_hgi", "usd_tf", "usd_trace"] @@ -374,24 +401,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"] @@ -401,7 +435,7 @@ def package_info(self): self.cpp_info.components["usd_usdSkelImaging"].libs = ["usd_usdSkelImaging"] self.cpp_info.components["usd_usdSkelImaging"].requires = ["usd_hio", "usd_hd", "usd_usdImaging", "usd_usdSkel"] - + if self.options.build_usdview: self.cpp_info.components["usd_usdviewq"].libs = ["usd_usdviewq"] self.cpp_info.components["usd_usdviewq"].requires = ["usd_tf", "usd_usd", "usd_usdGeom", "usd_hd"] @@ -411,7 +445,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"] @@ -429,7 +463,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"] @@ -473,3 +507,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/usd/") + + if self.options.build_draco_plugin: + self.cpp_info.components["usdDraco"].libs = ["usdDraco"] + self.cpp_info.components["usdDraco"].requires = ["usd_tf", "usd_gf", "usd_sdf", "usd_usd", "usd_usdGeom", "draco::draco"] + + if self.options.build_alembic_plugin: + self.cpp_info.components["usdAbc"].libs = ["usdAbc"] + self.cpp_info.components["usdAbc"].requires = ["usd_tf", "usd_work", "usd_sdf", "usd_usd", "usd_usdGeom", "alembic::alembic"] + if self.options.enable_hdf5_support: + self.cpp_info.components["usdAbc"].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"] diff --git a/recipes/openusd/all/test_package/test_package.cpp b/recipes/openusd/all/test_package/test_package.cpp index 01a1b3ba58466a..97cbd3ac0632c3 100644 --- a/recipes/openusd/all/test_package/test_package.cpp +++ b/recipes/openusd/all/test_package/test_package.cpp @@ -25,7 +25,7 @@ int main(int argc, char *argv[]) { UsdGeomMesh mesh = UsdGeomMesh::Define(stage, SdfPath("/root/mesh")); stage->SetDefaultPrim(xform.GetPrim()); - stage->GetRootLayer()->Save(); + // stage->GetRootLayer()->Save(); return EXIT_SUCCESS; } diff --git a/recipes/openusd/config.yml b/recipes/openusd/config.yml index f315de0685de9f..b046e391a8a0c4 100644 --- a/recipes/openusd/config.yml +++ b/recipes/openusd/config.yml @@ -1,3 +1,3 @@ versions: - "24.05": + "24.08": folder: all