Adds support for linking with some of the dependencies of a USD
build instead of the precompiled libraries from Blender, specifically
OpenSubdiv, OpenVDB and TBB. Other dependencies keep using the
precompiled libraries from Blender, since they are linked statically
anyway so it does't matter as much. Plus they have interdependencies
that are difficult to resolve when only using selected libraries from
the USD build and can't simply assume that USD was built with all
of them.
This patch also makes building the Hydra render delegate via the
standalone repository work and fixes various small issues I ran into
in general on Windows (e.g. the use of both fixed paths and
find_package did not seem to work correctly). Building both the
standalone Cycles application and the Hydra render delegate at the
same time is supported now as well (the paths in the USD plugin JSON
file are updated accordingly).
All that needs to be done now to build is to specify a PXR_ROOT
or USD_ROOT CMake variable pointing to the USD installation,
everything else is taken care of automatically (CMake targets are
loaded from the pxrTargets.cmake of USD and linked into the
render delegate and OpenSubdiv, OpenVDB and TBB are replaced
with those from USD when they exist).
I have tested building this way with various USD builds (both with
and without Python) on Windows and Linux and via both the Blender
repository and the standalone Cycles repository.
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./bin -DWITH_BLENDER=OFF -DWITH_CYCLES_HYDRA_RENDER_DELEGATE=ON -DPXR_ROOT=/usr/local/USD -DCMAKE_POSITION_INDEPENDENT_CODE=ON ..