[materialx] Add various features to control project options (#36015)

* [materialx] Add various features to control project options

* Revert "[materialx] Add various features to control project options"

This reverts commit 2ad6c708cab52c585a6912eb5c66a57bfb533be0.

* [materialx] Add various features to control project options
This commit is contained in:
Andréa Machizaud 2024-01-23 20:56:29 +01:00 committed by GitHub
parent 039cb74bbb
commit ef0e853dea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 48 additions and 7 deletions

View File

@ -1,16 +1,27 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO AcademySoftwareFoundation/MaterialX
REF "v${VERSION}"
SHA512 64d5b989fdddfd9d1b21f9dccf914d2674a23c9fd9d24f121ff451ab333e359dc8ab253f72827d68cd2ed59b0c03a51818cc71aa2adf5adfe74eabe0fd58c682
REF "v${VERSION}"
SHA512 64d5b989fdddfd9d1b21f9dccf914d2674a23c9fd9d24f121ff451ab333e359dc8ab253f72827d68cd2ed59b0c03a51818cc71aa2adf5adfe74eabe0fd58c682
HEAD_REF main
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
glsl-generator MATERIALX_BUILD_GEN_GLSL
mdl-generator MATERIALX_BUILD_GEN_MDL
osl-generator MATERIALX_BUILD_GEN_OSL
render MATERIALX_BUILD_RENDER
)
if ((VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_LINUX) AND MATERIALX_BUILD_RENDER)
message(WARNING "${PORT} currently requires the following libraries from the system package manager:\n libx11-dev\n\nThese can be installed on Ubuntu systems via apt-get install libx11-dev.")
endif()
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" OPTION_BUILD_SHARED_LIB)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
OPTIONS ${FEATURE_OPTIONS}
"-DMATERIALX_BUILD_SHARED_LIBS:BOOL=${OPTION_BUILD_SHARED_LIB}"
"-DMATERIALX_BUILD_JS:BOOL=NO"
"-DMATERIALX_BUILD_PYTHON:BOOL=NO"
@ -44,6 +55,16 @@ file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/LICENSE"
"${CURRENT_PACKAGES_DIR}/debug/README.md"
"${CURRENT_PACKAGES_DIR}/debug/THIRD-PARTY.md"
"${CURRENT_PACKAGES_DIR}/debug/include")
"${CURRENT_PACKAGES_DIR}/debug/include"
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
# MaterialXGenShader explicitely install resources
"${CURRENT_PACKAGES_DIR}/resources"
"${CURRENT_PACKAGES_DIR}/debug/resources"
"${CURRENT_PACKAGES_DIR}/include/MaterialXRender/External/OpenImageIO"
# Based on how OSL does it, it could be that those `.mdl` source would be better located inside `libraries/pbrlib/genmdl/**`
# But it seems that they are instead installed into `libraries/mdl`
"${CURRENT_PACKAGES_DIR}/include/MaterialXGenMdl/mdl"
)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")

View File

@ -1,6 +1,7 @@
{
"name": "materialx",
"version": "1.38.8",
"port-version": 1,
"description": "MaterialX is an open standard for the exchange of rich material and look-development content across applications and renderers.",
"homepage": "https://www.materialx.org/",
"license": "Apache-2.0",
@ -14,5 +15,19 @@
"name": "vcpkg-cmake-config",
"host": true
}
]
],
"features": {
"glsl-generator": {
"description": "Build the GLSL shader generator back-end."
},
"mdl-generator": {
"description": "Build the MDL shader generator back-end."
},
"osl-generator": {
"description": "Build the OSL shader generator back-end."
},
"render": {
"description": "Build the MaterialX Render library."
}
}
}

View File

@ -5494,7 +5494,7 @@
},
"materialx": {
"baseline": "1.38.8",
"port-version": 0
"port-version": 1
},
"mathc": {
"baseline": "2019-09-29",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "51acf72a500446d2a9d101be11fb24b86a1a18ad",
"version": "1.38.8",
"port-version": 1
},
{
"git-tree": "b8895aa1059cf4106a82265c242871ae6db5b815",
"version": "1.38.8",