-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
use cmake native FindPython #42497
use cmake native FindPython #42497
Conversation
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.
also best to check with @kyngchaos , since he uses Python (System-wide) Framework, and we use Python from QGIS-Mac-Deps
45a6d3c
to
b71dbbb
Compare
using system Python Framework is still possible, it will just be the latest choice. |
@@ -141,7 +141,7 @@ cmake -G "%CMAKEGEN%" ^ | |||
-D SPATIALITE_LIBRARY=%O4W_ROOT%/lib/spatialite_i.lib ^ | |||
-D PYTHON_EXECUTABLE=%O4W_ROOT%/bin/python3.exe ^ | |||
-D SIP_BINARY_PATH=%PYTHONHOME:\=/%/sip.exe ^ | |||
-D PYTHON_INCLUDE_PATH=%PYTHONHOME:\=/%/include ^ | |||
-D PYTHON_INCLUDE_DIR=%PYTHONHOME:\=/%/include ^ |
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.
@jef-n following https://cmake.org/cmake/help/git-stage/module/FindPython.html#artifacts-specification I changed this line. ok for you?
this is ready to merge, if there is no objection I will merge it in a few days. |
find_package(Python ${MIN_PYTHON_VERSION} REQUIRED COMPONENTS Interpreter Development) | ||
message("-- Found Python executable: ${Python_EXECUTABLE}") | ||
message("-- Python library: ${Python_LIBRARIES}") | ||
message("-- Python site-packages: ${Python_SITEARCH}") |
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.
Can you report the python version here too?
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.
The find_package command already prints the following:
-- Found Python: /usr/bin/python3.8 (found suitable version "3.8.5", minimum required is "3.7") found components: Interpreter Development
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.
yes, but only on first run if I am right. Later on, you don't see this anymore. I completed the line.
It seems the latest changes in #42460 broke this on some system, at least for the mingw64 build, Or maybe that's just cmake not being able to compare version numbers... |
mingw64 build was passing here in the PR. It might be something else? |
Sorry wrong PR number, failure started with #42620 , but I'm curious to know if using the old approach would fix cmake on those cases. |
Ok it didn't change a thing. |
This lowers a bit the number of files we maintain.
@jef-n for windows and @PeterPetrik for macos, can you have an eye on this?
If needed, we can fine tune this process by defining variables: https://cmake.org/cmake/help/git-stage/module/FindPython.html#hints
Such as Python_FIND_FRAMEWORK for mac.