Hi,
I have been spending some time working on improvements to our build
system. Part of this is making the prospect of writing external plugins
compiled outside of the Avogadro source directory simpler. So you will
notice some changes being pushed soon to make Avogadro easily
discoverable when using CMake as your build system.
This brings the question of standard locations to install contributed
plugins. I think one should be system wide, and one should be in the
users home directory. One application currently doing something similar
is ParaView [1], and so I thought we might take some inspiration from there.
They use HOME/.config/ParaView/ParaView<version>/Plugins for
Unix/Linux/Mac and %APPDATA\ParaView\ParaView\Plugins for
Windows. Does this seem reasonable? I would propose the system wide
location be,
$ORIGIN/…/$LIB_INSTALL_DIR/avogadro/contrib
-> /usr/local/lib/avogadro/contrib (default on Linux - using relative
pathing)
Then the user specific ones could be,
$HOME/.config/Avogadro/plugins
-> HOME/.config/Avogadro-0.9/plugins (using major and minor version)
%APPDATA\Avogadro\Avogadro\plugins
-> %APPDATA$\Avogadro\Avogadro-0.9\plugins (as above)
The code changes would be quite minimal, but I think it is important
that we agree on a convention and stick to it. Currently we do not load
anything outside of the system installed plugins.
Another point is ensuring users of the Avogadro library can load custom
plugins. I was thinking of adding PluginManager::loadFactories(const
QString& dir) that would take a plugin directory as an argument and load
the plugins in there.
Thanks,
Marcus