COMP: Update to find_package(Python3)#1250
Draft
hjmjohnson wants to merge 1 commit intocommontk:masterfrom
Draft
COMP: Update to find_package(Python3)#1250hjmjohnson wants to merge 1 commit intocommontk:masterfrom
hjmjohnson wants to merge 1 commit intocommontk:masterfrom
Conversation
4 tasks
c31d004 to
d573266
Compare
a62a27b to
49b8ad1
Compare
49b8ad1 to
1d15689
Compare
06b25e6 to
8fa4ea2
Compare
3ce57f4 to
3b0419f
Compare
3b0419f to
fbd075a
Compare
hjmjohnson
added a commit
to Slicer/Slicer
that referenced
this pull request
Dec 16, 2025
DO NOT COMMIT THIS UNTIL UPSTREAM CHANGES ARE FINALIZED commontk/CTK#1250
hjmjohnson
added a commit
to Slicer/Slicer
that referenced
this pull request
Dec 16, 2025
DO NOT COMMIT THIS UNTIL UPSTREAM CHANGES ARE FINALIZED commontk/CTK#1250
fbd075a to
c1cc26a
Compare
hjmjohnson
added a commit
to Slicer/Slicer
that referenced
this pull request
Jan 7, 2026
DO NOT COMMIT THIS UNTIL UPSTREAM CHANGES ARE FINALIZED commontk/CTK#1250
d7b8d6d to
5c222f2
Compare
The FindPythonInterp and FindPythonLibs modules are removed.
These modules have been deprecated since CMake 3.12.
CMake 3.27 and above prefer to not provide the modules. This policy provides
compatibility for projects that have not been ported away from them.
Projects using the FindPythonInterp and/or FindPythonLibs modules should
be updated to use one of their replacements:
FindPython3
FindPython2
FindPython
Both the Interpreter and Development checks called find_package(Python3
COMPONENTS Interpreter Development REQUIRED) independently. Combine
into a single call since find_package(Python3) should request all
needed components at once to ensure version consistency.
The old bridging code set Python3_ hints from PYTHON_ variables that
are no longer populated after the FindPython3 migration. The VTK8
path was also passing Python3_EXECUTABLE under the wrong variable name.
Fix by using find_package(Python3) results directly:
- VTK8 path: pass Python3_EXECUTABLE, Python3_INCLUDE_DIRS, and the
extracted PYTHON_LIBRARY under the old PYTHON_ variable names
- VTK9 path: pass the same values under Python3_ hint names
The superbuild export was missing Python3_INCLUDE_DIRS, Python3_LIBRARIES,
and PYTHON_EXECUTABLE. Add the modern Python3_ variables so downstream
superbuild projects using FindPython3 receive them, and re-add
PYTHON_EXECUTABLE for legacy project compatibility.
The default FindPython3 strategy (VERSION) searches all locations and
picks the newest Python3, which can find the wrong Python in
multi-version environments or when a virtualenv is active. Set
LOCATION strategy to stop at the first version found, respecting
PATH order and virtual environments.
5c222f2 to
2fa66ec
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
FindPythonInterpandFindPythonLibsmodules are removed.These modules have been deprecated since CMake 3.12.
CMake 3.27 and above prefer to not provide the modules. This policy provides compatibility for projects that have not been ported away from them.
Projects using the
FindPythonInterpand/orFindPythonLibsmodules should be updated to use one of their replacements: