Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix include order #1211

Merged
merged 2 commits into from
Feb 26, 2021
Merged

fix include order #1211

merged 2 commits into from
Feb 26, 2021

Conversation

fowlertADSK
Copy link
Contributor

No description provided.

@@ -86,6 +84,8 @@ if(NOT DEFINED PXR_USD_LOCATION)
endif()
endif()

include(${USD_CONFIG_FILE})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I build MayaUsd by setting the Maya and Pixar locations with an env var so this tripped me up. The pxrConfig file needs PXR_USD_LOCATION to be set, but you copy/pasted that import line to just before the code that might set it based on the env var. Just moving the include down to after that and I'm all good now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. I'm not quite seeing how anything in pxrConfig.cmake depends on PXR_USD_LOCATION. As far as I'm aware PXR_USD_LOCATION as either a CMake variable or an environment variable is only understood by maya-usd, not core USD. But you're clearly hitting an issue with this, so I don't at all mean to discount that.

Following that logic though, if there is some dependence on the value of PXR_USD_LOCATION that I'm not catching, should this include line go below the next block as well, somewhere around line 94?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might have written that incorrectly. It's in pxrTargets.cmake, which is included from pxrConfig.cmake (if I've got it straight this time).
pxrTargets has: INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;${PXR_USD_LOCATION}/include/boost-1_70"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, interesting. Yeah, I thought I was accounting for anything that might get included by pxrConfig.cmake.

That may have something to do with how core USD is getting built then. Are you specifying the path to Boost using PXR_USD_LOCATION when you build core USD? It would seem that it's injecting that path unexpanded into the pxrTargets.cmake.

For my builds, pxrTargets.cmake has the ${_IMPORT_PREFIX}/include path followed by absolute paths to the other dependencies, since I'm feeding absolute paths to the core USD build.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took a second look with Sean and we agreed that both of those chunks of logic probably aren't required, it would be most correct to just make sure that PXR_USD_LOCATION is set to wherever we found pxrConfig.cmake. Then if it was passed in through an env var, or it was possibly a hint-list, then it's always set correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd have to check with Sean about the USD build settings. I haven't built USD from source in a long time, only used the binaries they have provided us all.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added @seando-adsk so he sees your question about the USD build.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mattyjams When we build USD, we post-process the pxrTargets/pxrConfig files and replace the hard-coded paths with variables (one of them being PXR_USD_LOCATION). Then we zip this USD into what we call an artifact which our build machines download and use when building the plugin.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, ok. I think I get it now. Such a tangled web we weave. :)

In any case, great that it was possible to simplify it down to what you have now.

@fowlertADSK fowlertADSK added the build Related to building maya-usd repository label Feb 24, 2021
Copy link
Contributor

@mattyjams mattyjams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite follow the dependency on PXR_USD_LOCATION being set before pxrConfig.cmake gets included, but there's no issue with ensuring that that's the case, so seems ok to me.

I wonder though whether it should move one block further down if the value of PXR_USD_LOCATION really is important.

@@ -86,6 +84,8 @@ if(NOT DEFINED PXR_USD_LOCATION)
endif()
endif()

include(${USD_CONFIG_FILE})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. I'm not quite seeing how anything in pxrConfig.cmake depends on PXR_USD_LOCATION. As far as I'm aware PXR_USD_LOCATION as either a CMake variable or an environment variable is only understood by maya-usd, not core USD. But you're clearly hitting an issue with this, so I don't at all mean to discount that.

Following that logic though, if there is some dependence on the value of PXR_USD_LOCATION that I'm not catching, should this include line go below the next block as well, somewhere around line 94?

@mattyjams mattyjams linked an issue Feb 24, 2021 that may be closed by this pull request
@@ -86,6 +84,8 @@ if(NOT DEFINED PXR_USD_LOCATION)
endif()
endif()

include(${USD_CONFIG_FILE})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, ok. I think I get it now. Such a tangled web we weave. :)

In any case, great that it was possible to simplify it down to what you have now.

@kxl-adsk kxl-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Feb 25, 2021
@kxl-adsk kxl-adsk merged commit 1317986 into dev Feb 26, 2021
@kxl-adsk kxl-adsk deleted the fowlert/1209/fix_pxrConfig_include branch February 26, 2021 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Related to building maya-usd repository ready-for-merge Development process is finished, PR is ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PXR_USD_LOCATION not correctly set when using an Env Var
5 participants