OpenUSD icon indicating copy to clipboard operation
OpenUSD copied to clipboard

Make pxrTargets.cmake relocatable (when built with TBB and OpenSubdiv)

Open tamaskenez opened this issue 1 year ago • 15 comments

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)

tamaskenez avatar Nov 30 '24 17:11 tamaskenez

Filed as internal issue #USD-10483

:heavy_exclamation_mark: Please make sure that a signed CLA has been submitted!

jesschimein avatar Dec 02 '24 18:12 jesschimein

/AzurePipelines run

jesschimein avatar Dec 02 '24 18:12 jesschimein

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Dec 02 '24 18:12 azure-pipelines[bot]

I've submitted the CLA and I'll be looking into the build errors.

tamaskenez avatar Dec 02 '24 20:12 tamaskenez

/AzurePipelines run

tamaskenez avatar Dec 02 '24 20:12 tamaskenez

Commenter does not have sufficient privileges for PR 3441 in repo PixarAnimationStudios/OpenUSD

azure-pipelines[bot] avatar Dec 02 '24 20:12 azure-pipelines[bot]

/AzurePipelines run

pixar-oss avatar Dec 02 '24 21:12 pixar-oss

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Dec 02 '24 21:12 azure-pipelines[bot]

/AzurePipelines run

jesschimein avatar Dec 03 '24 17:12 jesschimein

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Dec 03 '24 17:12 azure-pipelines[bot]

@pmolodo Could you please check this again, the checks pass and I addressed your suggestions.

tamaskenez avatar Dec 19 '24 11:12 tamaskenez

@pmolodo @jesschimein Please let me know if you need this change, otherwise I'll close it on March 1st.

tamaskenez avatar Feb 20 '25 07:02 tamaskenez

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 🙏

jesschimein avatar Feb 20 '25 17:02 jesschimein

Cool, thanks for your reply! Just let me know if you need any further changes.

tamaskenez avatar Feb 20 '25 21:02 tamaskenez

Looks good! Personally I like the if(NOT DEFINED checks, but their absence isn't enough to hold this up.

Yes, I agree, rebased and fixed in https://github.com/PixarAnimationStudios/OpenUSD/commit/e59b22f35adcb037b6ab57764c838817add01271

tamaskenezlego avatar Feb 20 '25 21:02 tamaskenezlego