Updates will be applied on October 27th between 12pm - 12:45pm EDT (UTC-0400). Gitlab may be slow during the maintenance window.

Commit 83befb5e authored by Ben Boeckel's avatar Ben Boeckel Committed by Kitware Robot
Browse files

Merge topic 'plugin-debugging-logs'

b0c11a45 ParaViewPluginDebugging: expose options to debug plugins
887f335a ParaViewPlugin: add a debugging facility
833f1b2c Documentation/dev/build: document CMake debugging tools
e51f6536

 Documentation/dev/build: document VTK module debug flags
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !5012
parents b831aa45 b0c11a45
Pipeline #235124 failed with stages
in 229 minutes and 2 seconds
......@@ -7,6 +7,35 @@ set(_ParaViewPlugin_cmake_dir "${CMAKE_CURRENT_LIST_DIR}")
#]==]
#[==[
## Conditionally output debug statements
The `_paraview_plugin_debug` function is provided to assist in debugging. It is
controlled by the `_paraview_plugin_log` variable which contains a list of
"domains" to debug.
~~~
_paraview_plugin_debug(<domain> <format>)
~~~
If the `domain` is enabled for debugging, the `format` argument is configured
and printed. It should contain `@` variable expansions to replace rather than
it being done outside. This helps to avoid the cost of generating large strings
when debugging is disabled.
#]==]
function (_paraview_plugin_debug domain format)
if (NOT _paraview_plugin_log STREQUAL "ALL" AND
NOT domain IN_LIST _paraview_plugin_log)
return ()
endif ()
string(CONFIGURE "${format}" _paraview_plugin_debug_msg)
if (_paraview_plugin_debug_msg)
message(STATUS
"ParaView plugin debug ${domain}: ${_paraview_plugin_debug_msg}")
endif ()
endfunction ()
#[==[.md
## Finding plugins
......@@ -170,6 +199,7 @@ function (paraview_plugin_scan)
# Use argument splitting.
string(REGEX REPLACE "( |\n)+" ";" _paraview_scan_plugin_args "${_paraview_scan_plugin_args}")
_paraview_plugin_parse_args(_paraview_scan_plugin_name ${_paraview_scan_plugin_args})
_paraview_plugin_debug(plugin "@_paraview_scan_plugin_name@ declared by @_paraview_scan_plugin_file@")
list(APPEND _paraview_scan_all_plugins
"${_paraview_scan_plugin_name}")
......@@ -195,11 +225,13 @@ function (paraview_plugin_scan)
PROPERTY
TYPE INTERNAL)
endif ()
_paraview_plugin_debug(plugin "@_paraview_scan_plugin_name@ hidden by its `CONDITION`")
continue ()
endif ()
endif ()
if (_paraview_scan_enable_${_paraview_scan_plugin_name})
_paraview_plugin_debug(plugin "@_paraview_scan_plugin_name@ requested via cache value")
list(APPEND _paraview_scan_provided_plugins
"${_paraview_scan_plugin_name}")
list(APPEND _paraview_scan_required_modules
......@@ -416,6 +448,8 @@ function (paraview_plugin_build)
"The requested ${_paraview_build_plugin} plugin is not a ParaView plugin.")
endif ()
_paraview_plugin_debug(building "@_paraview_build_plugin@ is being built")
# Make a variable for where the plugin should go.
set(_paraview_build_plugin_directory
"${_paraview_build_plugin_destination}/${_paraview_build_plugin}")
......
option(ParaView_DEBUG_PLUGINS "Debug plugin logic in ParaView" OFF)
mark_as_advanced(ParaView_DEBUG_PLUGINS)
set(_paraview_plugin_log)
include(CMakeDependentOption)
cmake_dependent_option(ParaView_DEBUG_PLUGINS_ALL "Enable all debugging" OFF
"ParaView_DEBUG_PLUGINS" OFF)
mark_as_advanced(ParaView_DEBUG_PLUGINS_ALL)
if (ParaView_DEBUG_PLUGINS_ALL)
set(_paraview_plugin_log "ALL")
else ()
set(_builtin_domains
building
plugin)
foreach (_domain IN LISTS _builtin_domains _debug_domains)
cmake_dependent_option("ParaView_DEBUG_PLUGINS_${_domain}" "Enable debugging of ${_domain} logic" OFF
"ParaView_DEBUG_PLUGINS" OFF)
mark_as_advanced("ParaView_DEBUG_PLUGINS_${_domain}")
if (ParaView_DEBUG_PLUGINS_${_domain})
list(APPEND _paraview_plugin_log
"${_domain}")
endif ()
endforeach ()
unset(_domain)
unset(_builtin_domains)
endif ()
......@@ -85,6 +85,7 @@ include(ParaViewServerManager)
include(ParaViewTesting)
include(ParaViewClient)
include(ParaViewPlugin)
include(ParaViewPluginDebugging)
include(vtkModuleWrapClientServer)
include(CTest)
set_property(CACHE BUILD_TESTING
......
......@@ -461,6 +461,7 @@ These variables should be documented once they're effective again.
VTK. Note that ParaView has fairly narrow requirements for the VTK it can
use, so only very recent versions are likely to work.
-->
## Building editions
A typical ParaView build includes several modules and dependencies. While these
......@@ -478,6 +479,54 @@ this using the `PARAVIEW_BUILD_EDITION` setting. Supported values for this setti
* `CATALYST_RENDERING`: Same as `CATALYST` but with rendering supported added.
* `CANONICAL` (default): Build modules necessary for standard ParaView build.
## Debugging facilities
ParaView's build is fairly complicated, so a few debugging facilities are
provided.
### General CMake
CMake provides the `--trace-expand` flag which causes CMake to log all commands
that it executes with variables expanded. This can help to trace logic and data
through the configure step.
Debugging `Find` modules can be done using the `--debug-find` flag (introduced
in CMake 3.17) to determine what CMake's `find_` commands are doing.
### VTK Modules
VTK's module system debugging facilities may be controlled by using the
following flags:
* `ParaView_DEBUG_MODULE` (default `OFF`): If enabled, debugging is enabled.
Specific portions of the module system may be debugged using the other
flags.
* `ParaView_DEBUG_MODULE_ALL` (default `OFF`): Enable all debugging messages.
* `ParaView_DEBUG_MODULE_building` (default `OFF`): Log when modules are
being built.
* `ParaView_DEBUG_MODULE_enable` (default `OFF`): Log why modules are
enabled.
* `ParaView_DEBUG_MODULE_kit` (default `OFF`): Log information about
discovered kits.
* `ParaView_DEBUG_MODULE_module` (default `OFF`): Log information about
discovered modules.
* `ParaView_DEBUG_MODULE_provide` (default `OFF`): Log why a module is being
built or not.
* `ParaView_DEBUG_MODULE_testing` (default `OFF`): Log testing for VTK
modules.
### ParaView Plugins
ParaView's plugin system has a similar setup:
* `ParaView_DEBUG_PLUGINS` (default `OFF`): If enabled, debugging is enabled.
Specific portions of the plugin system may be debugged using the other
flags.
* `ParaView_DEBUG_PLUGINS_ALL` (default `OFF`): Enable all debugging messages.
* `ParaView_DEBUG_PLUGINS_building` (default `OFF`): Log when plugins are
being built.
* `ParaView_DEBUG_PLUGINS_plugin` (default `OFF`): Log information about
discovered plugins.
### Building documentation
......
# ParaView Plugin debugging
New CMake options to debug plugin discovery and building has been added. The
`ParaView_DEBUG_PLUGINS`, `ParaView_DEBUG_PLUGINS_ALL`,
`ParaView_DEBUG_PLUGINS_building`, and `ParaView_DEBUG_PLUGINS_plugin` flags
may be used to enable various logging for plugins.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment