Commit 6ccaa87b authored by Ben Boeckel's avatar Ben Boeckel
Browse files

paraviewpluginsexternal: add support for external plugins

Fixes #39.
parent 399610c0
......@@ -32,6 +32,7 @@ function (superbuild_find_projects var)
set(projects
cxx11
paraview
paraviewpluginsexternal
python)
option(USE_NONFREE_COMPONENTS "Enable the non-free parts of the superbuild" OFF)
......
......@@ -137,6 +137,21 @@ This directory may then be copied to a non-networked machine and pointed at
using the `superbuild_download_location` variable (or placed in the default
location).
## External plugins
The superbuild supports building more plugins into ParaView using the
`paraviewexternalplugins` project. As an example, to build two external
plugins `a` and `b`, the following settings should be used:
* `enable_paraviewexternalplugins:BOOL=ON`: Enables building using external
plugins.
* `paraview_PLUGINS_EXTERNAL:STRING=a;b`: The list of plugins to build.
* `paraview_PLUGIN_a_PATH:PATH=/path/to/plugin/a`: The path to plugin `a`'s
source directory. It must contain a `plugins.cmake` to be picked up by
ParaView.
* `paraview_PLUGIN_b_PATH:PATH=/path/to/plugin/b`: Same as above, but for
plugin `b`.
## CMake Variables
### Style Guide
......
......@@ -56,3 +56,39 @@ function (paraview_add_plugin _name)
"${${_name}_arguments}"
PARENT_SCOPE)
endfunction ()
function (paraview_add_plugins_external)
set(paraview_PLUGINS_EXTERNAL ""
CACHE STRING "List of plugins to build externally")
set(plugin_cmake_args)
set(plugin_paths)
foreach (plugin IN LISTS paraview_PLUGINS_EXTERNAL)
set("paraview_PLUGIN_${plugin}_PATH" ""
CACHE PATH "Path to the source directory of the ${name} plugin")
if (NOT EXISTS "${paraview_PLUGIN_${plugin}_PATH}")
message(FATAL_ERROR
"The path for the ${plugin} plugin does not exist: "
"${paraview_PLUGIN_${plugin}_PATH}.")
endif ()
list(APPEND plugin_cmake_args
"-DPARAVIEW_BUILD_PLUGIN_${plugin}:BOOL=ON")
list(APPEND plugin_paths
"${paraview_PLUGIN_${plugin}_PATH}")
endforeach ()
superbuild_add_dummy_project(paraviewpluginsexternal)
superbuild_add_extra_cmake_args(${plugin_cmake_args})
if (NOT superbuild_build_phase)
set_property(GLOBAL
PROPERTY
paraview_plugin_dirs_external "${plugin_paths}")
endif ()
set(paraviewpluginsexternal_arguments
"${paraviewpluginsexternal_arguments}"
PARENT_SCOPE)
endfunction ()
......@@ -45,8 +45,11 @@ set(paraview_all_plugins
if (superbuild_build_phase)
get_property(paraview_plugins GLOBAL
PROPERTY paraview_plugins)
get_property(paraview_plugin_dirs_external GLOBAL
PROPERTY paraview_plugin_dirs_external)
set(paraview_plugin_dirs)
set(paraview_plugin_dirs
"${paraview_plugin_dirs_external}")
foreach (paraview_plugin IN LISTS paraview_plugins)
if (${paraview_plugin}_enabled AND TARGET "${paraview_plugin}")
set(plugin_source_dir "<SOURCE_DIR>")
......@@ -111,6 +114,7 @@ superbuild_add_project(paraview
xdmf3 ospray vrpn tbb netcdf
paraviewusersguide paraviewgettingstartedguide
paraviewtutorial paraviewtutorialdata paraviewweb
paraviewpluginsexternal
${paraview_all_plugins}
${paraviews_platform_dependencies}
${PARAVIEW_EXTERNAL_PROJECTS}
......
paraview_add_plugins_external()
Supports Markdown
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