-
Notifications
You must be signed in to change notification settings - Fork 202
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
Conversation
CMakeLists.txt
Outdated
# 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() |
There was a problem hiding this comment.
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).
cmake/python.cmake
Outdated
# 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() |
There was a problem hiding this comment.
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.
…hon 3.9 * Added support for python 3.9.
fe6077a
to
1bdda33
Compare
@@ -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) |
There was a problem hiding this comment.
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.
MAYA-113002 - Create USD and Maya-USD plugin artifacts built with Python 3.9