Slicer build failed today on Arch Linux against VTK8. This trivial patch fixed the build process. I can’t know if it’s the right fix.
diff --git a/Libs/MRML/Core/vtkMRMLModelStorageNode.cxx b/Libs/MRML/Core/vtkMRMLModelStorageNode.cxx index e7e29785c7..a6851467cf 100644
--- a/Libs/MRML/Core/vtkMRMLModelStorageNode.cxx
+++ b/Libs/MRML/Core/vtkMRMLModelStorageNode.cxx
@@ -507,13 +507,17 @@ int vtkMRMLModelStorageNode::WriteDataInternal(vtkMRMLNode *refNode)
if (modelNode->GetMeshType() == vtkMRMLModelNode::PolyDataMeshType)
{
writer = vtkSmartPointer<vtkPolyDataWriter>::New();
+#if VTK_MAJOR_VERSION >= 9 || (VTK_MAJOR_VERSION >= 8 && VTK_MINOR_VERSION >= 90)
writer->SetFileVersion(42);
+#endif
writer->SetInputData(meshToWrite);
}
else
{
writer = vtkSmartPointer<vtkUnstructuredGridWriter>::New();
+#if VTK_MAJOR_VERSION >= 9 || (VTK_MAJOR_VERSION >= 8 && VTK_MINOR_VERSION >= 90)
writer->SetFileVersion(42);
+#endif
writer->SetInputData(meshToWrite);
}
diff --git a/Modules/CLI/ModelMaker/ModelMaker.cxx b/Modules/CLI/ModelMaker/ModelMaker.cxx
index 6c3b6065b1..374fad5c6c 100644
--- a/Modules/CLI/ModelMaker/ModelMaker.cxx
+++ b/Modules/CLI/ModelMaker/ModelMaker.cxx
@@ -1177,7 +1177,9 @@ int main(int argc, char * argv[])
if (SaveIntermediateModels)
{
writer = vtkSmartPointer<vtkPolyDataWriter>::New();
+#if VTK_MAJOR_VERSION >= 9 || (VTK_MAJOR_VERSION >= 8 && VTK_MINOR_VERSION >= 90)
writer->SetFileVersion(42);
+#endif
std::string commentSaveCubes = "Writing intermediate model after marching cubes " + labelName;
vtkPluginFilterWatcher watchWriter(writer,
commentSaveCubes.c_str(),
Regards.