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

PART II: CMake clean ups under lib/mayaUsd and lib/usd #389

Conversation

HamedSabri-adsk
Copy link
Contributor

@HamedSabri-adsk HamedSabri-adsk commented Mar 27, 2020

  1. All sub directories under lib/mayaUsd and lib/usd get their own CMakeLists.txt
  2. fix build/usage requirements for mayaUsdUtils and mayaUsd_Translators, testMayaUsdUI
  3. don't rely on ${PROJECT_NAME} in lib/usd/schemas because of the folder restructure
  4. use promote header mechanism across the project

…eLists.txt.

- fix build/usage requirements for mayaUsdUtils and mayaUsd_Translators, testMayaUsdUI
- don't rely on ${PROJECT_NAME} because of the folder restructure.
@HamedSabri-adsk HamedSabri-adsk changed the base branch from dev to sabrih/MAYA-104002/clean_up_part_1 March 27, 2020 12:13
@HamedSabri-adsk HamedSabri-adsk added the build Related to building maya-usd repository label Mar 27, 2020
Copy link
Contributor

@pmolodo pmolodo left a comment

Choose a reason for hiding this comment

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

Looks great!

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.

Looks good to me!

Two questions though:

  • There are some private headers in ufe that we're promoting/installing?
  • I think I get the change from ${PROJECT_NAME} to mayaUsd under the lib/usd dir, but it looks like there's still some usage of `${PROJECT_NAME} in there?

Then just a few other nit-picks about file ordering.

Comment on lines 14 to 24
# -----------------------------------------------------------------------------
# promoted headers
# -----------------------------------------------------------------------------
mayaUsd_promoteHeaderList(HEADERS ${headers} SUBDIR ufe/private)

# -----------------------------------------------------------------------------
# install
# -----------------------------------------------------------------------------
install(FILES ${headers}
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME}/ufe/private
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems a little weird that we're promoting and installing headers from a directory called "private"? Wouldn't the preprocessor find them without doing this since they're included with relative paths?

Copy link
Contributor Author

@HamedSabri-adsk HamedSabri-adsk Mar 28, 2020

Choose a reason for hiding this comment

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

Ah, that's my mistake. ufe/private is not supposed to be installed.
Fixed in fb592d1

@HamedSabri-adsk
Copy link
Contributor Author

HamedSabri-adsk commented Mar 28, 2020

@mattyjams CMake can generate graphviz files that could show the dependencies between the targets in a project, libraries which are linked against, etc..

The different dependency types PUBLIC, PRIVATE and INTERFACE are represented as solid, dashed and dotted edges.

I use it from time to time for sake of visualization. Here is the graphviz only for mayaUsd. You need to zoom in :)

mayaUsd_graph_visualization

@@ -23,5 +23,5 @@ mayaUsd_promoteHeaderList(HEADERS ${headers} SUBDIR render/px_vp20)
# install
# -----------------------------------------------------------------------------
install(FILES ${headers}
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/mayaUsd/render/px_vp20
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME}/render/px_vp20
Copy link
Collaborator

Choose a reason for hiding this comment

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

We have a lot of these, which are kind of hard-coded paths. I wonder if there is a cmake variable or way to use the relative path from project_name? Such that we could replace "${PROJECT_NAME}/render/px_vp20" with a variable.

Comment on lines +21 to +35
basisCurves.h
bboxGeom.h
debugCodes.h
draw_item.h
instancer.h
material.h
mesh.h
proxyRenderDelegate.h
render_delegate.h
render_param.h
render_pass.h
resource_registry.h
sampler.h
task_commit.h
tokens.h
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, just noticed this, but it looks like we're now going to be installing all of these headers, not just promoting them. We previously only installed proxyRenderDelegate.h. Maybe we need two variables to separate those that are promoted only versus those that are promoted and installed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @mattyjams . Great catch. I will fix it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mattyjams please see de407da

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems odd to have headers that are promoted, but not installed. That would make them in a bit of a gray area between public and private. Are we sure they need to promoted?

I took a random look at one header - draw_item.h - and it seems like it should be fine being not promoted - it's always brought in via #include "draw_item.h", and only from .cpp files in the same directory.

Have we tried not promoting any of these, other than proxyRenderDelegate.h?

Copy link
Contributor

@pmolodo pmolodo left a comment

Choose a reason for hiding this comment

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

I think the only remaining issue I have here is the unnecessary promotion of headers in vp2RenderDelegate, brought to my attention my @mattyjams here:

#389 (comment)

@HamedSabri-adsk HamedSabri-adsk merged commit 2a3104f into sabrih/MAYA-104002/clean_up_part_1 Apr 6, 2020
@HamedSabri-adsk HamedSabri-adsk deleted the sabrih/MAYA-104002/clean_up_part_2 branch April 6, 2020 20:20
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants