Skip to content

Commit

Permalink
python: generate a target to make the paraview package available
Browse files Browse the repository at this point in the history
  • Loading branch information
mathstuf committed Feb 19, 2025
1 parent 06fcd7a commit bfd1bab
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
33 changes: 32 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,8 @@ if (PARAVIEW_USE_PYTHON)
USE_DEBUG_SUFFIX "${PARAVIEW_WINDOWS_PYTHON_DEBUGGABLE}"
HEADERS_DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/paraview${paraview_version_suffix}/vtkpythonmodules"
WRAPPED_MODULES vtk_python_wrapped_modules
TARGET VTK::vtkpythonmodules)
TARGET VTK::vtkpythonmodules
WRAP_TARGET vtkpythonmodules-wrap)

add_subdirectory(VTK/Wrapping/Python)

Expand Down Expand Up @@ -1057,6 +1058,7 @@ if (PARAVIEW_USE_PYTHON)
HEADERS_DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/paraview${paraview_version_suffix}/pvpythonmodules"
WRAPPED_MODULES paraview_python_wrapped_modules
TARGET ParaView::pvpythonmodules
WRAP_TARGET pvpythonmodules-wrap
DEPENDS VTK::vtkpythonmodules)

vtk_module_wrap_python(
Expand All @@ -1071,8 +1073,37 @@ if (PARAVIEW_USE_PYTHON)
HEADERS_DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/paraview${paraview_version_suffix}/pvincubatorpythonmodules"
WRAPPED_MODULES paraview_incubator_python_wrapped_modules
TARGET ParaView::pvincubatorpythonmodules
WRAP_TARGET pvincubatorpythonmodules-wrap
DEPENDS VTK::vtkpythonmodules)

set(paraview_python_targets)
if (NOT PARAVIEW_USE_EXTERNAL_VTK)
list(APPEND paraview_python_targets
vtkpythonmodules-wrap
vtk_python_copy)
if (TARGET VTK::WebPython)
list(APPEND paraview_python_targets
WebPython-vtkmodules.web)
endif ()
endif ()
if (TARGET ParaView::PVWebPython)
list(APPEND paraview_python_targets
PVWebPython-paraview.web)
endif ()
if (TARGET ParaView::CinemaSci)
list(APPEND paraview_python_targets
CinemaSci-paraview.tpl.cinemasci)
endif ()

add_custom_target(paraview_all_python_modules
DEPENDS
pvpythonmodules-wrap
pvincubatorpythonmodules-wrap
paraview_python_copy
${paraview_python_targets}
COMMENT
"Ensure all Python modules of ParaView exist")

if (PARAVIEW_INSTALL_DEVELOPMENT_FILES)
export(
EXPORT ParaViewPython
Expand Down
7 changes: 7 additions & 0 deletions Documentation/dev/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,13 @@ ParaView's plugin system has a similar setup:
* `ParaView_DEBUG_PLUGINS_plugin` (default `OFF`): Log information about
discovered plugins.

### Building Python

The following target is provided to ensure that everything needed under `import
paraview` is available:

* `paraview_all_python_modules`

### Building documentation

The following targets are used to build documentation for ParaView:
Expand Down
4 changes: 4 additions & 0 deletions Documentation/release/dev/add-paraview_all_python_modules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## add-paraview\_all\_python\_modules

* There is now a `paraview_all_python_modules` build target to ensure that
`import paraview` is ready.

0 comments on commit bfd1bab

Please sign in to comment.