Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use FindMaterialX to find imported targets in pxrConfig.cmake
Change 2230560 introduced the use of imported targets to link against MaterialX instead of plain library paths. These imported targets are listed as INTERFACE_LINK_LIBRARIES for dependent libraries (like usdMtlx) in pxrConfig.cmake, but they aren't defined in that file. This meant that anyone using pxrConfig.cmake to configure a project to build against USD would miss the MaterialX dependencies, potentially leading to linker errors later on. This was a regression; previously the paths to the MaterialX libraries that were used in the USD build were also copied into pxrConfig.cmake, so any projects building against USD would link to those same libraries. This change attempts to address the issue by calling find_package in pxrConfig.cmake to ensure the MaterialX targets are defined. By default this invokes the same FindMaterialX.cmake module that was used by the USD build, but this can be overridden by specifying MaterialX_DIR when building the project that depends on USD. TL;DR: a project that uses pxrConfig.cmake to build against a MaterialX-enabled USD build should once again automatically pick up the same MaterialX libraries that were used by that USD build. Fixes #1955 (Internal change: 2245213)
- Loading branch information