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

use cmake native FindPython #42497

Merged
merged 16 commits into from
Mar 28, 2021
Merged

use cmake native FindPython #42497

merged 16 commits into from
Mar 28, 2021

Conversation

3nids
Copy link
Member

@3nids 3nids commented Mar 26, 2021

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.

@3nids 3nids requested a review from m-kuhn March 26, 2021 06:06
Copy link
Contributor

@PeterPetrik PeterPetrik left a 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

@3nids 3nids force-pushed the cmake-simpler-python branch from 45a6d3c to b71dbbb Compare March 26, 2021 08:03
@3nids 3nids added Build/Install Related to compiling or installing QGIS Squash! Remember to squash this PR, instead of merging or rebasing labels Mar 26, 2021
@3nids
Copy link
Member Author

3nids commented Mar 26, 2021

also best to check with @kyngchaos , since he uses Python (System-wide) Framework, and we use Python from QGIS-Mac-Deps

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 ^
Copy link
Member Author

Choose a reason for hiding this comment

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

@3nids 3nids removed the request for review from m-kuhn March 26, 2021 09:36
@github-actions github-actions bot added this to the 3.20.0 milestone Mar 26, 2021
@3nids
Copy link
Member Author

3nids commented Mar 26, 2021

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}")
Copy link
Collaborator

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?

Copy link
Member

@m-kuhn m-kuhn Mar 28, 2021

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 

Copy link
Member Author

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.

@3nids 3nids merged commit 555f516 into qgis:master Mar 28, 2021
@3nids 3nids deleted the cmake-simpler-python branch March 28, 2021 19:49
domi4484 pushed a commit to domi4484/QGIS that referenced this pull request Mar 31, 2021
@roya0045
Copy link
Contributor

roya0045 commented Apr 2, 2021

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...

@3nids
Copy link
Member Author

3nids commented Apr 2, 2021

mingw64 build was passing here in the PR. It might be something else?

@roya0045
Copy link
Contributor

roya0045 commented Apr 2, 2021

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.

@roya0045
Copy link
Contributor

roya0045 commented Apr 2, 2021

Ok it didn't change a thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build/Install Related to compiling or installing QGIS Squash! Remember to squash this PR, instead of merging or rebasing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants