autodesk-forks / MaterialX

MaterialX C++ and Python libraries
http://www.materialx.org/
Apache License 2.0
107 stars 23 forks source link

MaterialX install is not relocatable #1347

Closed JGamache-autodesk closed 2 years ago

JGamache-autodesk commented 2 years ago

This means a MaterialX install done to a staging area using -DCMAKE_INSTALL_PREFIX=/my/stage can not be packaged and installed somewhere else.

Problem is in /my/stage/lib/cmake/MaterialX/MaterialXTargets.cmake which will contain the line:

set(_IMPORT_PREFIX "/my/stage")

There is a mechanism in CMake to keep the MaterialX generated CMake file relocatable and it hinges on keeping all install paths relative.

I would recommend centralizing the library creation into a CMake function that would insure all path are local, this is what is done in USD and it generates a relocatable CMake file.

JGamache-autodesk commented 2 years ago

Fixed via PR #1350 in this repo. Merged back to ILM repo via materialx/MaterialX#805