diff --git a/cMake/FreeCAD_Helpers/SetupSalomeSMESH.cmake b/cMake/FreeCAD_Helpers/SetupSalomeSMESH.cmake index c83f832654..5cf36329df 100644 --- a/cMake/FreeCAD_Helpers/SetupSalomeSMESH.cmake +++ b/cMake/FreeCAD_Helpers/SetupSalomeSMESH.cmake @@ -27,13 +27,24 @@ macro(SetupSalomeSMESH) # check which modules are available if(UNIX OR WIN32) find_package(VTK COMPONENTS vtkCommonCore REQUIRED NO_MODULE) - list(APPEND VTK_COMPONENTS vtkIOMPIParallel vtkParallelMPI vtkhdf5 vtkFiltersParallelDIY2 vtkRenderingCore vtkInteractionStyle vtkRenderingFreeType vtkRenderingOpenGL2) - foreach(_module ${VTK_COMPONENTS}) - list (FIND VTK_MODULES_ENABLED ${_module} _index) - if (${_index} GREATER -1) - list(APPEND AVAILABLE_VTK_COMPONENTS ${_module}) - endif() - endforeach() + if(${VTK_MAJOR_VERSION} LESS 9) + list(APPEND VTK_COMPONENTS vtkIOMPIParallel vtkParallelMPI vtkhdf5 vtkFiltersParallelDIY2 vtkRenderingCore vtkInteractionStyle vtkRenderingFreeType vtkRenderingOpenGL2) + foreach(_module ${VTK_COMPONENTS}) + list (FIND VTK_MODULES_ENABLED ${_module} _index) + if(${_index} GREATER -1) + list(APPEND AVAILABLE_VTK_COMPONENTS ${_module}) + endif() + endforeach() + else() + set(VTK_COMPONENTS "CommonCore;CommonDataModel;FiltersVerdict;IOXML;FiltersCore;FiltersGeneral;IOLegacy;FiltersExtraction;FiltersSources;FiltersGeometry") + list(APPEND VTK_COMPONENTS "IOMPIParallel;ParallelMPI;hdf5;FiltersParallelDIY2;RenderingCore;InteractionStyle;RenderingFreeType;RenderingOpenGL2") + foreach(_module ${VTK_COMPONENTS}) + list (FIND VTK_AVAILABLE_COMPONENTS ${_module} _index) + if(${_index} GREATER -1) + list(APPEND AVAILABLE_VTK_COMPONENTS ${_module}) + endif() + endforeach() + endif() endif() # don't check VERSION 6 as this would exclude VERSION 7