Default behaviour for including plugins

Daan De Meyer daan.j.demeyer at gmail.com
Fri Jul 26 19:58:23 BST 2019


Alright, I can understand where you're coming from. However, I would then
suggest we should apply the current approach consistently for each plugin
by finding each plugin's dependencies in its CMake script and only building
the plugin if all its dependencies are found. I'd move all the if tests and
`set_package_properties` calls checks currently in addons/CMakeLists.txt to
their respective plugin CMake scripts, leaving addons/CMakeLists.txt as a
simple script only calling `ecm_add_optional_subdirectory` for each
subdirectory in the addons directory. Each plugin CMake script then calls
`find_package` to find its required dependencies and only continues with
the rest of its script if all its dependencies are found.

These changes should make plugin CMake scripts more consistent and
localized which makes debugging and developing new plugins easier.

Regards,

Daan

On Fri, 26 Jul 2019 at 18:02, Christoph Cullmann <christoph at cullmann.io>
wrote:

> On 2019-07-26 17:40, Daan De Meyer wrote:
> > Hi,
> >
> > I was thinking about the best way to handle plugin building during
> > further refactoring of the CMake scripts. Right now, some stuff is
> > built implicitly depending on whether certain libraries are found or
> > not (see addons/CMakeLists.txt). I was wondering if this shouldn't be
> > made explicit instead, with each plugin either being turned on/off
> > explicitly in the CMake script which determines whether it gets built
> > or not.
> >
> > Making building of plugins explicit prevents hard to trace builds
> > where a default build succeeds on two machines but may differ in
> > features from one machine to another depending on what other libraries
> > are installed.
> >
> > To achieve this, I could add an optional second parameter to
> > `ecm_add_optional_subdirectory` which takes ON/OFF as its value (just
> > like CMake's `option` command) and initializes the default value of
> > `ecm_add_optional_subdirectory`'s `BUILD_${_dir}` to that value. The
> > optional value would default to `ON` if not provided to keep backwards
> > compatibility.
> >
> > Most plugins would be enabled by default so as  to not change anything
> > substantial for users but some plugins with more exotic dependencies
> > might be disabled by default instead.
> >
> > Any thoughts?
>
> Hi,
>
> I would strongly prefer the current way. You get info which optional
> stuff is missing, no need to hide some plugins per default.
>
> Optional dependencies are common and people are used to check for that
> output but not to search for some "please enable this plugin" extra
> switches.
>
> Greetings
> Christoph
>
> >
> > Regards,
> >
> > Daan
>
> --
> Ignorance is bliss...
> https://cullmann.io | https://kate-editor.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwrite-devel/attachments/20190726/74c0fc80/attachment.html>


More information about the KWrite-Devel mailing list