[mdl-sdk] Add "materialx" feature (#50255)

This commit is contained in:
jreichel-nvidia 2026-03-03 21:38:01 +01:00 committed by GitHub
parent 42a91624b2
commit dfefa2e7ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 65 additions and 1 deletions

View File

@ -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
$<IF:$<CONFIG:Debug>,${MaterialXGenMdl_DEBUG},${MaterialXGenMdl_RELEASE}>

View File

@ -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
)

View File

@ -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": [

View File

@ -10,6 +10,7 @@
"features": [
"dds",
"df-vulkan",
"materialx",
"openimageio"
]
},

View File

@ -6314,7 +6314,7 @@
},
"mdl-sdk": {
"baseline": "2025.0.5",
"port-version": 0
"port-version": 1
},
"mdns": {
"baseline": "1.4.3",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "65cdbda10aa574ad1187710463b0856b828bf87e",
"version": "2025.0.5",
"port-version": 1
},
{
"git-tree": "ce707c0c26ac1cfb75b403ba5b91f755155974b8",
"version": "2025.0.5",