Install and load the grantlee plugin the right way.
This should hopefully solve the issues with the installation and loading
of grantlee_skroogefilters once and for all.
Long story short: grantlee plugins are Qt plugins, and thus it makes the
most sense to install them into ${PLUGIN_INSTALL_DIR}/plugins/whatever,
so that the QT_PLUGIN_PATH environment variable can be used to let
QCoreApplication::libraryPaths() automatically find it. To err on the
safe side, we also add the paths via Grantlee::Engine::addPluginPath so
the plugin is found even is QT_PLUGIN_PATH is not properly set.
Below is an account of the troubles we've had so far:
- Commit 87baaf5a hardcoded the installation to ${PLUGIN_INSTALL_DIR}/../grantlee/0.1, and it was wrong because it assumed a certain directory layout and installed above PLUGIN_INSTALL_DIR.
- Commit a2b5f2ab later changed that to ${PLUGIN_INSTALL_DIR}/../grantlee/<GRANTLEE MAJOR>.<GRANTLEE MINOR>, which was only slightly better.
- Commit 2be99742 then installed the plugin into ${DATA_INSTALL_DIR}/skrooge/plugins/grantlee/<GRANTLEE MAJOR>.<GRANTLEE MINOR> and added some C++ code to add this directory to Grantlee's plugin search path. ${DATA_INSTALL_DIR} is not the right place to install plugins, though.
- Commit 8eb59377 fixed the issue by installing the plugin into ${LIB_INSTALL_DIR}/grantlee/<GRANTLEE MAJOR>.<GRANTLEE MINOR>. For some unfortunate reason, this commit also removed the C++ code added in the previous commit.
Reviewed-by: Guillaume DE BURE
CCMAIL: guillaume.debure@gmail.com
CCMAIL: stephane@mankowski.fr