I would like to have install
rules for my external plugins, such that I can simply run cmake --build --target install
and have the plugins installed into a directory, where ParaView automatically loads them (i.e., I set CMAKE_PREFIX_PATH
to ParaView’s install directory).
In ParaView versions before 5.7, I used CMake code like
add_paraview_plugin(MyPlugin ...)
install(TARGETS MyPlugin DESTINATION ${CMAKE_INSTALL_LIBDIR}/plugins)
However, in ParaView 5.7, the paraview_add_plugin
command already creates an install rule. For example,
paraview_plugin_build(
PLUGINS ${my_plugins}
LIBRARY_DESTINATION "${CMAKE_INSTALL_BINDIR}"
LIBRARY_SUBDIRECTORY "plugins")
would install a plugin MyPlugin
into the directory bin/plugins/MyPlugin/Myplugin.so
, and ParaView would not load this automatically, since it only seems to look for plugins in bin/plugins
, but not in subdirectories.
My current workaround adds a second install rule
paraview_add_plugin(MyPlugin ...)
install(TARGETS MyPlugin DESTINATION ${CMAKE_INSTALL_BINDIR}/plugins)
but this would install the plugin twice.
paraview_plugin_build
can also create a .plugins
file, such as the one in lib/paraview-5.7/plugins
, but as far as I know, there is no way to load such a file from an external location.
Is there an intended way to create install rules for external plugins?