Commit 6e113ad4 authored by Haocheng LIU's avatar Haocheng LIU
Browse files

Rewrite all public&private dependency in module.cmake file

The current dependency relationship in vtk is unclear and misleading.
This MR tries to rewrite them based on header files inclusion of headers
and source files in each module. Corner cases are considered and
modules are sorted in alphabetical order to facilitate future reference.
See details in my gitlab python based script project. In future we can continue
using this script to clean the VTK Dependency easily from
time to time.
parent 44b2711e
...@@ -2,12 +2,6 @@ if(NOT VTK_LEGACY_REMOVE) ...@@ -2,12 +2,6 @@ if(NOT VTK_LEGACY_REMOVE)
vtk_module(vtkAcceleratorsDax vtk_module(vtkAcceleratorsDax
IMPLEMENTS IMPLEMENTS
vtkFiltersCore vtkFiltersCore
DEPENDS
vtkCommonCore
vtkCommonDataModel
vtkCommonExecutionModel
vtkFiltersCore
vtkFiltersGeometry
TEST_DEPENDS TEST_DEPENDS
vtkTestingCore vtkTestingCore
vtkTestingRendering vtkTestingRendering
...@@ -17,5 +11,9 @@ if(NOT VTK_LEGACY_REMOVE) ...@@ -17,5 +11,9 @@ if(NOT VTK_LEGACY_REMOVE)
vtkIOXML vtkIOXML
vtkImagingSources vtkImagingSources
EXCLUDE_FROM_ALL EXCLUDE_FROM_ALL
DEPENDS
vtkCommonCore
vtkCommonDataModel
vtkFiltersCore
) )
endif() endif()
\ No newline at end of file
if(NOT VTK_LEGACY_REMOVE) if(NOT VTK_LEGACY_REMOVE)
vtk_module(vtkAcceleratorsPiston vtk_module(vtkAcceleratorsPiston
DEPENDS
vtkCommonCore
vtkCommonDataModel
vtkCommonExecutionModel
vtkRenderingCore
vtkRenderingOpenGL
vtkIOImage #from piston
vtkImagingHybrid #from piston
TEST_DEPENDS TEST_DEPENDS
vtkTestingRendering vtkTestingRendering
vtkInteractionStyle vtkInteractionStyle
...@@ -17,5 +9,11 @@ if(NOT VTK_LEGACY_REMOVE) ...@@ -17,5 +9,11 @@ if(NOT VTK_LEGACY_REMOVE)
vtkParallelMPI vtkParallelMPI
vtkRenderingParallel vtkRenderingParallel
EXCLUDE_FROM_ALL EXCLUDE_FROM_ALL
DEPENDS
vtkCommonCore
vtkCommonDataModel
vtkCommonExecutionModel
vtkRenderingCore
vtkRenderingOpenGL
) )
endif() endif()
\ No newline at end of file
vtk_module(vtkChartsCore vtk_module(vtkChartsCore
GROUPS GROUPS
StandAlone StandAlone
DEPENDS
vtkRenderingContext2D
vtksys
PRIVATE_DEPENDS
vtkCommonColor
vtkInfovisCore # Needed for plot parallel coordinates vtkStringToCategory
TEST_DEPENDS TEST_DEPENDS
vtkTestingCore vtkTestingCore
vtkTestingRendering vtkTestingRendering
...@@ -14,4 +8,16 @@ vtk_module(vtkChartsCore ...@@ -14,4 +8,16 @@ vtk_module(vtkChartsCore
vtkRenderingContext${VTK_RENDERING_BACKEND} vtkRenderingContext${VTK_RENDERING_BACKEND}
#vtkIOExport #vtkIOExport
vtkIOInfovis vtkIOInfovis
) DEPENDS
vtkCommonCore
vtkCommonDataModel
vtkFiltersGeneral
vtkRenderingContext2D
vtkRenderingCore
vtksys
PRIVATE_DEPENDS
vtkCommonColor
vtkCommonExecutionModel
vtkCommonTransforms
vtkInfovisCore
)
\ No newline at end of file
vtk_module(vtkCommonColor vtk_module(vtkCommonColor
DEPENDS
vtkCommonDataModel # For vtkColor
TEST_DEPENDS TEST_DEPENDS
vtkIOImage vtkIOImage
vtkCommonExecutionModel vtkCommonExecutionModel
...@@ -10,4 +8,7 @@ vtk_module(vtkCommonColor ...@@ -10,4 +8,7 @@ vtk_module(vtkCommonColor
vtkInteractionStyle vtkInteractionStyle
KIT KIT
vtkCommon vtkCommon
) DEPENDS
vtkCommonCore
vtkCommonDataModel
)
\ No newline at end of file
vtk_module(vtkCommonComputationalGeometry vtk_module(vtkCommonComputationalGeometry
GROUPS GROUPS
StandAlone StandAlone
DEPENDS
vtkCommonSystem
vtkCommonMath
vtkCommonDataModel
TEST_DEPENDS TEST_DEPENDS
vtkTestingCore vtkTestingCore
vtkRendering${VTK_RENDERING_BACKEND} vtkRendering${VTK_RENDERING_BACKEND}
KIT KIT
vtkCommon vtkCommon
) DEPENDS
vtkCommonCore
vtkCommonDataModel
)
\ No newline at end of file
vtk_module(vtkCommonCore vtk_module(vtkCommonCore
GROUPS GROUPS
StandAlone StandAlone
DEPENDS
vtkkwiml
PRIVATE_DEPENDS
vtksys
TEST_DEPENDS TEST_DEPENDS
vtkTestingCore vtkTestingCore
vtkCommonSystem vtkCommonSystem
...@@ -12,4 +8,8 @@ vtk_module(vtkCommonCore ...@@ -12,4 +8,8 @@ vtk_module(vtkCommonCore
vtksys vtksys
KIT KIT
vtkCommon vtkCommon
) DEPENDS
vtkkwiml
PRIVATE_DEPENDS
vtksys
)
\ No newline at end of file
vtk_module(vtkCommonDataModel vtk_module(vtkCommonDataModel
GROUPS GROUPS
StandAlone StandAlone
DEPENDS
vtkCommonSystem
vtkCommonMath
vtkCommonMisc
vtkCommonTransforms
PRIVATE_DEPENDS
vtksys
TEST_DEPENDS TEST_DEPENDS
vtkTestingCore vtkTestingCore
vtkTestingRendering vtkTestingRendering
...@@ -22,4 +15,12 @@ vtk_module(vtkCommonDataModel ...@@ -22,4 +15,12 @@ vtk_module(vtkCommonDataModel
vtkRendering${VTK_RENDERING_BACKEND} vtkRendering${VTK_RENDERING_BACKEND}
KIT KIT
vtkCommon vtkCommon
) DEPENDS
vtkCommonCore
vtkCommonMath
vtkCommonTransforms
PRIVATE_DEPENDS
vtkCommonMisc
vtkCommonSystem
vtksys
)
\ No newline at end of file
vtk_module(vtkCommonExecutionModel vtk_module(vtkCommonExecutionModel
GROUPS GROUPS
StandAlone StandAlone
DEPENDS
vtkCommonDataModel
COMPILE_DEPENDS COMPILE_DEPENDS
vtkCommonMisc vtkCommonMisc
TEST_DEPENDS TEST_DEPENDS
...@@ -13,4 +11,10 @@ vtk_module(vtkCommonExecutionModel ...@@ -13,4 +11,10 @@ vtk_module(vtkCommonExecutionModel
vtkIOLegacy vtkIOLegacy
KIT KIT
vtkCommon vtkCommon
) DEPENDS
vtkCommonCore
vtkCommonDataModel
PRIVATE_DEPENDS
vtkCommonMisc
vtkCommonSystem
)
\ No newline at end of file
vtk_module(vtkCommonMath vtk_module(vtkCommonMath
DEPENDS
vtkCommonCore
TEST_DEPENDS TEST_DEPENDS
vtkTestingCore vtkTestingCore
vtkCommonSystem vtkCommonSystem
vtkCommonTransforms vtkCommonTransforms
KIT KIT
vtkCommon vtkCommon
) DEPENDS
vtkCommonCore
)
\ No newline at end of file
vtk_module(vtkCommonMisc vtk_module(vtkCommonMisc
GROUPS GROUPS
StandAlone StandAlone
DEPENDS
vtkCommonMath
TEST_DEPENDS TEST_DEPENDS
vtkTestingCore vtkTestingCore
KIT KIT
vtkCommon vtkCommon
) DEPENDS
vtkCommonCore
vtkCommonMath
)
\ No newline at end of file
vtk_module(vtkCommonSystem vtk_module(vtkCommonSystem
GROUPS GROUPS
StandAlone StandAlone
TEST_DEPENDS
vtkTestingCore
KIT
vtkCommon
DEPENDS DEPENDS
vtkCommonCore vtkCommonCore
PRIVATE_DEPENDS PRIVATE_DEPENDS
vtksys vtksys
TEST_DEPENDS )
vtkTestingCore \ No newline at end of file
KIT
vtkCommon
)
vtk_module(vtkCommonTransforms vtk_module(vtkCommonTransforms
GROUPS GROUPS
StandAlone StandAlone
DEPENDS
# Explicitely list (rather than transiently through
# vtkCommonMath) because it allows us to turn of wrapping
# of vtkCommonMath off but still satisfy API dependcy.
vtkCommonCore
vtkCommonMath
TEST_DEPENDS TEST_DEPENDS
vtkTestingCore vtkTestingCore
vtkRendering${VTK_RENDERING_BACKEND} vtkRendering${VTK_RENDERING_BACKEND}
KIT KIT
vtkCommon vtkCommon
) DEPENDS
vtkCommonCore
vtkCommonMath
)
\ No newline at end of file
if(VTK_RENDERING_BACKEND STREQUAL "OpenGL2") if(VTK_RENDERING_BACKEND STREQUAL "OpenGL2")
set(extra_opengl_depend vtkDomainsChemistry${VTK_RENDERING_BACKEND}) set(extra_opengl_depend vtkDomainsChemistry${VTK_RENDERING_BACKEND})
endif() endif()
vtk_module(vtkDomainsChemistry vtk_module(vtkDomainsChemistry
GROUPS GROUPS
StandAlone StandAlone
DEPENDS
vtkCommonDataModel
vtkRenderingCore
PRIVATE_DEPENDS
vtkIOXML
vtkFiltersSources
vtksys
TEST_DEPENDS TEST_DEPENDS
vtkIOGeometry
vtkIOLegacy vtkIOLegacy
vtkTestingCore vtkTestingCore
vtkTestingRendering vtkTestingRendering
vtkInteractionStyle vtkInteractionStyle
vtkRendering${VTK_RENDERING_BACKEND} vtkRendering${VTK_RENDERING_BACKEND}
${extra_opengl_depend} ${extra_opengl_depend}
DEPENDS
vtkCommonCore
vtkCommonDataModel
vtkCommonExecutionModel
vtkIOLegacy
vtkIOXMLParser
vtkRenderingCore
PRIVATE_DEPENDS
vtkCommonTransforms
vtkFiltersCore
vtkFiltersGeneral
vtkFiltersSources
vtksys
) )
vtk_module(vtkDomainsChemistryOpenGL2 vtk_module(vtkDomainsChemistryOpenGL2
TCL_NAME TCL_NAME
vtkRenderingChemistryOpenGLII vtkRenderingChemistryOpenGLII
DEPENDS
vtkRenderingOpenGL2
IMPLEMENTS IMPLEMENTS
vtkDomainsChemistry vtkDomainsChemistry
BACKEND BACKEND
OpenGL2 OpenGL2
IMPLEMENTATION_REQUIRED_BY_BACKEND IMPLEMENTATION_REQUIRED_BY_BACKEND
PRIVATE_DEPENDS
vtkglew
KIT KIT
vtkOpenGL vtkOpenGL
TEST_DEPENDS TEST_DEPENDS
vtkIOGeometry
vtkTestingCore vtkTestingCore
vtkTestingRendering vtkTestingRendering
vtkInteractionStyle vtkInteractionStyle
vtkRendering${VTK_RENDERING_BACKEND} vtkRendering${VTK_RENDERING_BACKEND}
${extra_opengl_depend} ${extra_opengl_depend}
) DEPENDS
vtkCommonCore
vtkDomainsChemistry
vtkRenderingOpenGL2
PRIVATE_DEPENDS
vtkCommonDataModel
vtkCommonExecutionModel
vtkCommonMath
vtkRenderingCore
vtkglew
)
\ No newline at end of file
vtk_module(vtkDomainsMicroscopy vtk_module(vtkDomainsMicroscopy
DESCRIPTION "Readers and writers supporting whole slide images for microscopy domain" DESCRIPTION "Readers and writers supporting whole slide images for microscopy domain"
DEPENDS
vtkCommonDataModel
vtkCommonExecutionModel
vtkIOImage
PRIVATE_DEPENDS
vtkIOXML
vtkFiltersSources
TEST_DEPENDS TEST_DEPENDS
vtkTestingCore vtkTestingCore
vtkTestingRendering vtkTestingRendering
vtkInteractionImage vtkInteractionImage
vtkRenderingContext${VTK_RENDERING_BACKEND} vtkRenderingContext${VTK_RENDERING_BACKEND}
EXCLUDE_FROM_ALL EXCLUDE_FROM_ALL
) DEPENDS
vtkIOImage
PRIVATE_DEPENDS
vtkCommonCore
vtkCommonDataModel
vtkCommonExecutionModel
)
\ No newline at end of file
...@@ -12,6 +12,7 @@ find_package(VTK COMPONENTS ...@@ -12,6 +12,7 @@ find_package(VTK COMPONENTS
vtkCommonCore vtkCommonCore
vtkIOLegacy vtkIOLegacy
vtkIOXML vtkIOXML
vtkIOGeometry
vtkTestingRendering vtkTestingRendering
vtksys vtksys
) )
......
vtk_module(vtkFiltersAMR vtk_module(vtkFiltersAMR
GROUPS GROUPS
StandAlone StandAlone
DEPENDS
vtkParallelCore
vtkFiltersGeneral
TEST_DEPENDS TEST_DEPENDS
vtkImagingCore vtkImagingCore
vtkIOAMR vtkIOAMR
...@@ -11,4 +8,14 @@ vtk_module(vtkFiltersAMR ...@@ -11,4 +8,14 @@ vtk_module(vtkFiltersAMR
vtkTestingRendering vtkTestingRendering
KIT KIT
vtkParallel vtkParallel
) DEPENDS
vtkCommonDataModel
vtkCommonExecutionModel
PRIVATE_DEPENDS
vtkCommonCore
vtkCommonMath
vtkCommonSystem
vtkFiltersCore
vtkIOXML
vtkParallelCore
)
\ No newline at end of file
vtk_module(vtkFiltersCore vtk_module(vtkFiltersCore
GROUPS GROUPS
StandAlone StandAlone
DEPENDS
vtkCommonExecutionModel
vtkCommonSystem
vtkCommonMisc
vtkCommonTransforms
vtkCommonMath
TEST_DEPENDS TEST_DEPENDS
vtkTestingRendering vtkTestingRendering
vtkInteractionStyle vtkInteractionStyle
...@@ -18,4 +12,13 @@ vtk_module(vtkFiltersCore ...@@ -18,4 +12,13 @@ vtk_module(vtkFiltersCore
vtkRenderingVolume${VTK_RENDERING_BACKEND} vtkRenderingVolume${VTK_RENDERING_BACKEND}
KIT KIT
vtkFilters vtkFilters
DEPENDS
vtkCommonCore
vtkCommonDataModel
vtkCommonExecutionModel
vtkCommonMisc
PRIVATE_DEPENDS
vtkCommonMath
vtkCommonSystem
vtkCommonTransforms
) )
vtk_module(vtkFiltersExtraction vtk_module(vtkFiltersExtraction
GROUPS GROUPS
StandAlone StandAlone
DEPENDS
vtkCommonDataModel
vtkCommonExecutionModel
vtkFiltersCore
vtkFiltersGeneral
vtkFiltersStatistics
TEST_DEPENDS TEST_DEPENDS
vtkIOLegacy vtkIOLegacy
vtkIOXML vtkIOXML
...@@ -15,4 +9,12 @@ vtk_module(vtkFiltersExtraction ...@@ -15,4 +9,12 @@ vtk_module(vtkFiltersExtraction
vtkInteractionStyle vtkInteractionStyle
KIT KIT
vtkFilters vtkFilters
) DEPENDS
vtkCommonExecutionModel
vtkFiltersGeneral
PRIVATE_DEPENDS
vtkCommonCore
vtkCommonDataModel
vtkFiltersCore
vtkFiltersStatistics
)
\ No newline at end of file
vtk_module(vtkFiltersFlowPaths vtk_module(vtkFiltersFlowPaths
GROUPS GROUPS
StandAlone StandAlone
DEPENDS
vtkCommonExecutionModel
vtkFiltersGeneral
vtkFiltersSources
vtkIOCore
TEST_DEPENDS TEST_DEPENDS
vtkFiltersAMR vtkFiltersAMR
vtkFiltersImaging vtkFiltersImaging
...@@ -13,4 +8,13 @@ vtk_module(vtkFiltersFlowPaths ...@@ -13,4 +8,13 @@ vtk_module(vtkFiltersFlowPaths
vtkTestingRendering vtkTestingRendering
vtkInteractionStyle vtkInteractionStyle
vtkRendering${VTK_RENDERING_BACKEND} vtkRendering${VTK_RENDERING_BACKEND}
) DEPENDS
vtkCommonCore
vtkCommonDataModel
vtkCommonExecutionModel
vtkCommonMath
PRIVATE_DEPENDS
vtkFiltersCore
vtkFiltersSources
vtkIOCore
)
\ No newline at end of file
vtk_module(vtkFiltersGeneral vtk_module(vtkFiltersGeneral
GROUPS GROUPS
StandAlone StandAlone
DEPENDS
vtkCommonComputationalGeometry
vtkFiltersCore
TEST_DEPENDS TEST_DEPENDS
vtkFiltersFlowPaths vtkFiltersFlowPaths
vtkFiltersModeling vtkFiltersModeling
vtkIOGeometry
vtkIOLegacy vtkIOLegacy