Make pxrTargets.cmake relocatable (when built with TBB and OpenSubdiv)
Description of Change(s)
The CMake targets now use TBB and OpenSubdiv as targets instead of absolute include and library paths.
Link to proposal (if applicable)
Fixes Issue(s)
The installed OpenUSD library was not relocatable because cmake/pxrTargets.cmake contained absolute paths of include directories and library files.
This PR solves the issue partially: it changes the way oneTBB and OpenSubdiv are used, if those dependencies are found by their CMake config-scripts (as opposed to a find-module).
Therefore, if OpenUSD is built only with the oneTBB (not the old TBB) and OpenSubdiv dependencies which provide a config-script (which is the case when building with build_usd.py), with this PR the installed OpenSubdiv library will be relocatable.
Checklist
[X] I have created this PR based on the dev branch
[X] I have followed the coding conventions
[ ] I have added unit tests that exercise this functionality (Reference: testing guidelines)
[ ] I have verified that all unit tests pass with the proposed changes
[X] I have submitted a signed Contributor License Agreement (Reference: Contributor License Agreement instructions)
Filed as internal issue #USD-10483
:heavy_exclamation_mark: Please make sure that a signed CLA has been submitted!
/AzurePipelines run
Azure Pipelines successfully started running 1 pipeline(s).
I've submitted the CLA and I'll be looking into the build errors.
/AzurePipelines run
Commenter does not have sufficient privileges for PR 3441 in repo PixarAnimationStudios/OpenUSD
/AzurePipelines run
Azure Pipelines successfully started running 1 pipeline(s).
/AzurePipelines run
Azure Pipelines successfully started running 1 pipeline(s).
@pmolodo Could you please check this again, the checks pass and I addressed your suggestions.
@pmolodo @jesschimein Please let me know if you need this change, otherwise I'll close it on March 1st.
Hi Tamas! Thank you for the PR -- we think this will be useful and have an engineer slated to look at it for one of the upcoming releaseas 🙏
Cool, thanks for your reply! Just let me know if you need any further changes.
Looks good! Personally I like the
if(NOT DEFINEDchecks, but their absence isn't enough to hold this up.
Yes, I agree, rebased and fixed in https://github.com/PixarAnimationStudios/OpenUSD/commit/e59b22f35adcb037b6ab57764c838817add01271