diff --git a/ports/mdl-sdk/fix_find_materialx.diff b/ports/mdl-sdk/fix_find_materialx.diff new file mode 100644 index 0000000000..e8ff0dc97c --- /dev/null +++ b/ports/mdl-sdk/fix_find_materialx.diff @@ -0,0 +1,43 @@ +diff --git a/cmake/find/find_materialx.cmake b/cmake/find/find_materialx.cmake +--- a/cmake/find/find_materialx.cmake ++++ b/cmake/find/find_materialx.cmake +@@ -29,6 +29,15 @@ + set(_MX_LIBS ${_MX_LIBS} PARENT_SCOPE) + endfunction() + ++# Try IMPLIB first for DLLs on DLL platforms. Otherwise, use LOCATION. ++function(GET_IMPLIB_OR_LOCATION_PROPERTY LIB_NAME _CONFIG) ++ get_target_property(_TMP ${LIB_NAME} IMPORTED_IMPLIB_${_CONFIG}) ++ if(NOT _TMP) ++ get_target_property(_TMP ${LIB_NAME} IMPORTED_LOCATION_${_CONFIG}) ++ endif() ++ set(${LIB_NAME}_${_CONFIG} ${_TMP} PARENT_SCOPE) ++endfunction() ++ + function(FIND_MATERIALX) + + set(MATERIALX_DIR "NOT-SPECIFIED" CACHE PATH "Path to a downloaded and extracted MaterialX pre-built package.") +@@ -66,14 +75,15 @@ + # collect information required for the build from imported targets + get_target_property(_MX_INCLUDE MaterialXCore INTERFACE_INCLUDE_DIRECTORIES) + +- get_target_property(MaterialXCore_DEBUG MaterialXCore IMPORTED_LOCATION_DEBUG) +- get_target_property(MaterialXCore_RELEASE MaterialXCore IMPORTED_LOCATION_RELEASE) +- get_target_property(MaterialXFormat_DEBUG MaterialXFormat IMPORTED_LOCATION_DEBUG) +- get_target_property(MaterialXFormat_RELEASE MaterialXFormat IMPORTED_LOCATION_RELEASE) +- get_target_property(MaterialXGenShader_DEBUG MaterialXGenShader IMPORTED_LOCATION_DEBUG) +- get_target_property(MaterialXGenShader_RELEASE MaterialXGenShader IMPORTED_LOCATION_RELEASE) +- get_target_property(MaterialXGenMdl_DEBUG MaterialXGenMdl IMPORTED_LOCATION_DEBUG) +- get_target_property(MaterialXGenMdl_RELEASE MaterialXGenMdl IMPORTED_LOCATION_RELEASE) ++ # need CMake >= 3.28.0 on non-DLL platforms ++ get_implib_or_location_property(MaterialXCore DEBUG) ++ get_implib_or_location_property(MaterialXCore RELEASE) ++ get_implib_or_location_property(MaterialXFormat DEBUG) ++ get_implib_or_location_property(MaterialXFormat RELEASE) ++ get_implib_or_location_property(MaterialXGenShader DEBUG) ++ get_implib_or_location_property(MaterialXGenShader RELEASE) ++ get_implib_or_location_property(MaterialXGenMdl DEBUG) ++ get_implib_or_location_property(MaterialXGenMdl RELEASE) + + set(_MX_LIBS + $,${MaterialXGenMdl_DEBUG},${MaterialXGenMdl_RELEASE}> diff --git a/ports/mdl-sdk/portfile.cmake b/ports/mdl-sdk/portfile.cmake index 5e8e330db3..423517bfc6 100644 --- a/ports/mdl-sdk/portfile.cmake +++ b/ports/mdl-sdk/portfile.cmake @@ -83,6 +83,8 @@ vcpkg_from_github( REF 2025.0.5 SHA512 aa7c41c51195630c0cd7c119d448c1aea69b5110fd4f065617d7452061c21b341831d3afc21d4d03656633b495ec213fbf86730b1815715792dfba264ec3cf1d HEAD_REF master + PATCHES + fix_find_materialx.diff ) vcpkg_find_acquire_program(PYTHON3) @@ -92,6 +94,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS dds MDL_BUILD_DDS_PLUGIN df-vulkan MDL_BUILD_SDK_EXAMPLES df-vulkan MDL_ENABLE_VULKAN_EXAMPLES + materialx MDL_ENABLE_MATERIALX openimageio MDL_BUILD_OPENIMAGEIO_PLUGIN ) diff --git a/ports/mdl-sdk/vcpkg.json b/ports/mdl-sdk/vcpkg.json index d8c47f1748..b58c229bf0 100644 --- a/ports/mdl-sdk/vcpkg.json +++ b/ports/mdl-sdk/vcpkg.json @@ -1,6 +1,7 @@ { "name": "mdl-sdk", "version": "2025.0.5", + "port-version": 1, "description": "NVIDIA Material Definition Language SDK", "homepage": "https://github.com/NVIDIA/MDL-SDK", "license": "BSD-3-Clause", @@ -35,6 +36,17 @@ "vulkan-validationlayers" ] }, + "materialx": { + "description": "Enables MaterialX support", + "dependencies": [ + { + "name": "materialx", + "features": [ + "mdl-generator" + ] + } + ] + }, "openimageio": { "description": "Build image plugin for various image formats using OpenImageIO", "dependencies": [ diff --git a/scripts/test_ports/vcpkg-ci-mdl-sdk/vcpkg.json b/scripts/test_ports/vcpkg-ci-mdl-sdk/vcpkg.json index e4d8ece3b9..393294c2b5 100644 --- a/scripts/test_ports/vcpkg-ci-mdl-sdk/vcpkg.json +++ b/scripts/test_ports/vcpkg-ci-mdl-sdk/vcpkg.json @@ -10,6 +10,7 @@ "features": [ "dds", "df-vulkan", + "materialx", "openimageio" ] }, diff --git a/versions/baseline.json b/versions/baseline.json index ec8f593bfb..5429881e11 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6314,7 +6314,7 @@ }, "mdl-sdk": { "baseline": "2025.0.5", - "port-version": 0 + "port-version": 1 }, "mdns": { "baseline": "1.4.3", diff --git a/versions/m-/mdl-sdk.json b/versions/m-/mdl-sdk.json index ade29e85a3..5c790b5e80 100644 --- a/versions/m-/mdl-sdk.json +++ b/versions/m-/mdl-sdk.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "65cdbda10aa574ad1187710463b0856b828bf87e", + "version": "2025.0.5", + "port-version": 1 + }, { "git-tree": "ce707c0c26ac1cfb75b403ba5b91f755155974b8", "version": "2025.0.5",