-
-
Notifications
You must be signed in to change notification settings - Fork 686
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
ENH: When using cmake > 3.12 use FindPython3 module #1536
ENH: When using cmake > 3.12 use FindPython3 module #1536
Conversation
The FindPython3 module is more robust for ensuring that python 3 or greater is found. The FindPythonInterp and FindPythonLib modules are deprecated in cmake greater than 3.12.0 The GoogleTest framework uses the deprecated FindPythonInterp, so this patch uses the FindPython3 module, and then uses that more robust information to set the FindPythonInterp cmake variables so that wrapping, google tests, documentation generation, etc.. all use the same found version of Python 3.
75fbf66
to
2ed74bc
Compare
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.
Looks good
I am now getting a configuration error on my Mac system because it only finds py2 and not py3. Python 3 is not required for the Doxygen, or HeaderTests. OSX, and and many linux based systems still come with Python 2 by default. And this patch breaks the builds. |
@blowekamp I thought that it was already established that we would only support Python3 (for wrapping at least). From a maintenance standpoint, it would be easier if we simply require python3 for any use of python in ITK. I think that Doxygen and HeaderTests are both "developer-level" features that are OK to require Python3 (even if they don't strictly need them). I know we could provide support for python2, but I want to ensure that the extra complexity and maintenance burden will be worth that level of complexity. (If Doxygen and not wrapping, then python2, else python3 is required). My motivation for this change is that during the configuration of cmake with ITK I was finding that several versions of Python were being found and in some cases overwriting the intended version. I found it really confusing when multiple versions of the python executable were identified for different parts of the code base. I'm willing to re-add python2 support for developer builds that only use HeaderTests or Doxygen tests if that is the consensus, but I think it is important to have a conversation regarding the pros/cons of the added complexity. Let me know what you think. Hans |
On a new configuration this is the error I'm getting:
I don't even have Doxygen enabled. The options are:
|
@blowekamp could you please try the following: We would also need to add 'if(Python3_Interpreter_FOUND ` to line 550. |
@blowekamp I'm working on a solution. it is almost ready for option #1 given above. I've removed python3 from one of my (slower) computers and I am testing the build now. |
The FindPython3 module is more robust for ensuring that python 3 or greater is found.
The FindPythonInterp and FindPythonLib modules are deprecated
in cmake greater than 3.12.0
The GoogleTest framework uses the deprecated FindPythonInterp, so this
the patch uses the FindPython3 module, and then uses that more robust
information to set the FindPythonInterp cmake variables so that
wrapping, google tests, documentation generation, etc.. all use the
same found a version of Python 3.
PR Checklist