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

MAYA-113002 - Create USD and Maya-USD plugin artifacts built with Pyt… #1668

Merged
merged 1 commit into from
Sep 1, 2021

Conversation

seando-adsk
Copy link
Collaborator

MAYA-113002 - Create USD and Maya-USD plugin artifacts built with Python 3.9

  • Added support for python 3.9.

@seando-adsk seando-adsk added the build Related to building maya-usd repository label Aug 31, 2021
CMakeLists.txt Outdated
Comment on lines 82 to 86
# We support two versions of python 3 (3.7/3.9).
find_package(Python 3.9 EXACT QUIET COMPONENTS Interpreter)
if (NOT Python_FOUND)
find_package(Python 3.7 EXACT REQUIRED COMPONENTS Interpreter)
endif()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

First search for python 3.9 with quiet option so if not found, no message or error will be output. Then if python was not found we search again for 3.7 with required (will error if not found). This case is for our internal build system where we send in the exact python to use via the variables (line 77).

Comment on lines 60 to 64
# We support two versions of python 3 (3.7/3.9).
find_package(Python 3.9 EXACT QUIET COMPONENTS Interpreter)
if (NOT Python_FOUND)
find_package(Python 3.7 EXACT REQUIRED COMPONENTS Interpreter)
endif()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Same as above, but this code is only used when no python (via vars) was sent in. Called from CMakeLists.txt (above) line 95.

@seando-adsk seando-adsk force-pushed the donnels/MAYA-113002/update_for_python_39 branch from fe6077a to 1bdda33 Compare August 31, 2021 19:53
@@ -79,7 +80,7 @@ if (DEFINED PYTHON_INCLUDE_DIR AND DEFINED PYTHON_LIBRARIES AND DEFINED Python_E
SET(PYTHONLIBS_FOUND TRUE)
# Use the Python module to find the python lib.
if(BUILD_WITH_PYTHON_3)
find_package(Python 3.7 EXACT REQUIRED COMPONENTS Interpreter)
find_package(Python ${BUILD_WITH_PYTHON_3_VERSION} EXACT REQUIRED COMPONENTS Interpreter)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I reworked my solution as the preflight failed. I realized that you cannot call find_package twice with the same component (in this case Python) because it caches internal variables and actually overwrites the output ones. In my previous case when trying (and failing) to find py 3.9 it would set "Python_EXECUTABLE" to NOT-FOUND. And thus the call to find py 3.7 would also fail. So now I set a cache variable with the py 3 version to find (default is 3.7). Then from our build when we update to 3.9 we can set this.

@kxl-adsk kxl-adsk merged commit de524fb into dev Sep 1, 2021
@kxl-adsk kxl-adsk deleted the donnels/MAYA-113002/update_for_python_39 branch September 1, 2021 15:35
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.

3 participants