Skip to content

CMake: use separate host Python interpreter and target development artifacts when cross-compiling - #67302

Open
ar-jan wants to merge 1 commit into
qgis:masterfrom
ar-jan:cross-python
Open

ar-jan wants to merge 1 commit into
qgis:masterfrom
ar-jan:cross-python

Conversation

@ar-jan

@ar-jan ar-jan commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Description

Cross-compiling QGIS with a recent version of CMake fails at find_package(Python 3.11 REQUIRED COMPONENTS Interpreter Development), because it expects lookups for separate host Python interpreter and target development artifacts (CMP0190 is NEW, starting from CMake 4.1.).

This patch makes it so when CMP0190=NEW and CMAKE_CROSSCOMPILING are both detected, separate host Python interpreter and target development artifacts are set. Otherwise, the lookup is unchanged.

This would remove the need for patching QGIS when packaging for distributions that support cross-compiling, like I used for Void Linux here.

I've manually tested a native x86_64 build and a cross-compiled aarch64 build.

I'm admittedly not familiar with how much coordination there is around downstream packaging of QGIS, but this seems to me like a helpful change.

I think backporting would also be helpful to support packaging efforts.

AI tool usage

  • [x ] AI tool(s) (Copilot, Claude, or something similar) supported my development of this PR. See our policy about AI tool use. Use of AI tools must be indicated. Failure to be honest might result in banning.

I used gpt-5.6-sol for implementing the patch.

…s when cross-compiling

Gated on CMP0190 NEW, available from CMake 4.1+.
@github-actions github-actions Bot added this to the 4.4.0 milestone Sep 5, 2026
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
To execute locally, unzip the downloaded zip file and run bin\qgis-bin.exe in the extracted directory.
You might be prompted by Windows Defender click "Run anyway"
(Built from commit 8c01a50)

🍎 MacOS Qt6 builds

Download MacOS Qt6 builds of this PR for testing.
This app is not notarized, run sudo xattr -d com.apple.quarantine /Applications/QGIS*.app to avoid the warning
(Built from commit 8c01a50)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant