Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions build_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
scikit-build-core
vtk-sdk-python-wheel-helper
cmake
ninja==1.11.1.4
pytest
virtualenv
vtk-sdk==9.6.2
vtk==9.6.2
2 changes: 1 addition & 1 deletion common.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Baseline Slicer repository, change this when rebasing
GIT_URL = "https://github.com/Slicer/Slicer.git"
GIT_REVISION = "55f38b57fc9d9a80da0fce51aa12d82064c101cc"
GIT_REVISION = "9a54dda46fdd0db1438711adb7add9ba85bce331" # 2026/09/25

# Directories used by the scripts
SLICER_DIR = "Slicer"
Expand Down
2 changes: 1 addition & 1 deletion generate_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,5 @@ def main() -> None:
try:
main()
except Exception as e:
print(f"Error occured while generation patch:\n{e}")
print(f"Error occured while generating patch:\n{e}")
exit(1)
1 change: 1 addition & 0 deletions patch/Libs/MRML/Core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ set(classes
vtkDataIOManager
vtkDataTransfer
vtkEventBroker
vtkImageMapToWindowLevelAddon
vtkImageMathematicsAddon
vtkImplicitInvertableBoolean
vtkMRMLAbstractLayoutNode
Expand Down
1 change: 1 addition & 0 deletions patch/Libs/MRML/DisplayableManager/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ set(classes
vtkMRMLVolumeGlyphSliceDisplayableManager

# DisplayableManager common between ThreeDView and SliceView
vtkMRMLAccuratePicker
vtkMRMLOrientationMarkerDisplayableManager
vtkMRMLRulerDisplayableManager
vtkMRMLScalarBarDisplayableManager
Expand Down
4 changes: 2 additions & 2 deletions patch/SlicerCore/CMake/SlicerCoreSuperbuild.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# We need to normalize paths because CMake on Windows gives us paths with backslashes
# ExternalProject cache files contain `set("some\path")` which is badly interpreted...
find_package(Python3 REQUIRED COMPONENTS Interpreter Development.Module)
cmake_path(CONVERT ${Python3_EXECUTABLE} TO_CMAKE_PATH_LIST Python3_EXECUTABLE NORMALIZE)
cmake_path(CONVERT ${Python3_INCLUDE_DIR} TO_CMAKE_PATH_LIST Python3_INCLUDE_DIR NORMALIZE)
cmake_path(CONVERT "${Python3_EXECUTABLE}" TO_CMAKE_PATH_LIST Python3_EXECUTABLE NORMALIZE)
cmake_path(CONVERT "${Python3_INCLUDE_DIR}" TO_CMAKE_PATH_LIST Python3_INCLUDE_DIR NORMALIZE)

if(UNIX AND NOT APPLE AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
# use the right as VTK enforces it
Expand Down
8 changes: 5 additions & 3 deletions patch/SuperBuild/External_vtkAddon.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,19 @@ if(NOT DEFINED vtkAddon_DIR AND NOT Slicer_USE_SYSTEM_${proj})

ExternalProject_SetIfNotDefined(
Slicer_${proj}_GIT_REPOSITORY
"${EP_GIT_PROTOCOL}://github.com/AlexyPellegrini/vtkAddon.git"
"${EP_GIT_PROTOCOL}://github.com/Slicer/vtkAddon.git"
QUIET
)

ExternalProject_SetIfNotDefined(
Slicer_${proj}_GIT_TAG
"python-dev-cmake"
"main"
QUIET
)

set(EXTERNAL_PROJECT_OPTIONAL_CMAKE_CACHE_ARGS
"-DCMAKE_PREFIX_PATH:PATH=${CMAKE_PREFIX_PATH}"
"-DvtkAddon_INSTALL_NO_DEVELOPMENT:BOOL=OFF"
"-DvtkAddon_WRAP_PYTHON:BOOL=ON"
"-DPYTHON_EXECUTABLE:FILEPATH=${Python3_EXECUTABLE}"
"-DPYTHON_INCLUDE_DIRS:PATH=${Python3_INCLUDE_DIR}"
Expand Down Expand Up @@ -65,14 +66,15 @@ if(NOT DEFINED vtkAddon_DIR AND NOT Slicer_USE_SYSTEM_${proj})
"-DCMAKE_INSTALL_RPATH:STRING=${install_rpath}"
-DVTK_WRAP_PYTHON_FIND_LIBS:BOOL=OFF
-DVTK_DIR:PATH=${VTK_DIR}
-DVTK_UNDEFINED_SYMBOLS_ALLOWED:BOOL=ON
${EXTERNAL_PROJECT_OPTIONAL_CMAKE_CACHE_ARGS}
DEPENDS
${${proj}_DEPENDENCIES}
)

ExternalProject_GenerateProjectDescription_Step(${proj})

set(vtkAddon_DIR ${EP_INSTALL_DIR}/lib/CMake/vtkAddon)
set(vtkAddon_DIR ${EP_INSTALL_DIR}/vtkAddon/lib/cmake/vtkAddon)
set(vtkAddon_PYTHON_DIR "${EP_INSTALL_DIR}/${python_destination}")

# Add path to SlicerLauncherSettings.ini
Expand Down
22 changes: 13 additions & 9 deletions set_vtk_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,22 @@

# This is a simple regex that matches most valid python package version
VERSION_PATTERN = r'([1-9][0-9]*!)?(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))*((a|b|rc)(0|[1-9][0-9]*))?(\.post(0|[1-9][0-9]*))?(\.dev(0|[1-9][0-9]*))?'
# List of package name to replace version in given file
FILES = {
"vtk": Path(SLICER_DIR) / "SlicerCore" / "pyproject.toml",
"vtk-sdk": Path(SLICER_DIR) / "SlicerCore" / "pyproject.toml",
"vtk-sdk": Path(SLICER_DIR) / "SlicerCore" / "tests" / "packages" / "build_module" / "pyproject.toml",
"vtk-sdk": Path(SLICER_DIR) / "SlicerCore" / "tests" / "packages" / "find_package" / "pyproject.toml",
"vtk-sdk": Path(SLICER_DIR) / "SlicerCoreSDK" / "pyproject.toml",
}
# List of (package name, file) pairs to replace version in
FILES = [
("vtk", Path(SLICER_DIR) / "SlicerCore" / "pyproject.toml"),
("vtk-sdk", Path(SLICER_DIR) / "SlicerCore" / "pyproject.toml"),
("vtk-sdk", Path(SLICER_DIR) / "SlicerCore" / "tests" / "packages" / "build_module" / "pyproject.toml"),
("vtk-sdk", Path(SLICER_DIR) / "SlicerCore" / "tests" / "packages" / "find_package" / "pyproject.toml"),
("vtk", Path(SLICER_DIR) / "SlicerCoreSDK" / "pyproject.toml"),
("vtk-sdk", Path(SLICER_DIR) / "SlicerCoreSDK" / "pyproject.toml"),
("vtk", Path(__file__).parent / "build_requirements.txt"),
("vtk-sdk", Path(__file__).parent / "build_requirements.txt"),
]


def patch_version(pyproject: Path, name: str, version: str):
"""Replace occurence of {name}==X.Y.Z with {name}=={version} in file {pyproject}"""
print(f"Replacing occurence of {name}==X.Y.Z with {name}=={version} in file {pyproject}")
new_content = ""
with open(pyproject, "r") as file:
new_content = re.sub(f"{name}=={VERSION_PATTERN}", f"{name}=={version}", file.read())
Expand All @@ -35,7 +39,7 @@ def main():
print(f"Given version, {version}, is not a valid version identifier")
exit(1)

for package, file in FILES.items():
for package, file in FILES:
patch_version(file, package, version)


Expand Down
Loading