# Install rules for external plugins in ParaView 5.7

**URL:** https://discourse.paraview.org/t/install-rules-for-external-plugins-in-paraview-5-7/2387
**Category:** Development
**Created:** [August 9, 2019, 10:09am UTC](https://discourse.paraview.org/t/install-rules-for-external-plugins-in-paraview-5-7/2387 "2019-08-09T10:09:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![lhofmann](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/l/9e8a1a/32.png) [@lhofmann](https://discourse.paraview.org/u/lhofmann)
#### Post date: [August 9, 2019, 10:09am UTC](https://discourse.paraview.org/t/install-rules-for-external-plugins-in-paraview-5-7/2387/1 "2019-08-09T10:09:38Z")

</div>

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

```auto
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,

```auto
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

```auto
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?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [August 9, 2019, 11:23am UTC](https://discourse.paraview.org/t/install-rules-for-external-plugins-in-paraview-5-7/2387/2 "2019-08-09T11:23:03Z")

</div>

Just use PV\_PLUGIN\_CONFIG\_FILE env var.

[https://www.paraview.org/Wiki/ParaView/Plugin\_HowTo#Using\_Plugins](https://www.paraview.org/Wiki/ParaView/Plugin_HowTo#Using_Plugins)

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [August 9, 2019, 6:58pm UTC](https://discourse.paraview.org/t/install-rules-for-external-plugins-in-paraview-5-7/2387/3 "2019-08-09T18:58:30Z")

</div>

How does ParaView find the plugin if it is just in that directory? AFAIK, ParaView doesn’t list the directory itself.

In any case, further work for better exporting plugins in underway in [https://gitlab.kitware.com/paraview/paraview/merge\_requests/3454](https://gitlab.kitware.com/paraview/paraview/merge_requests/3454). It won’t help with ParaView using external plugins so much (but will help clients wanting to use plugins from other packages a lot). Better installation of plugins is also in there, but mostly related to the `find_package` side of the installation.
