Help with kcoreaddons_add_plugin

christoph at cullmann.io christoph at cullmann.io
Mon Aug 12 21:48:39 BST 2024


On 2024-08-12 22:32, Tomaz Canabrava wrote:
> i forgot to say, the sourde for this mess is at
> invent.kde.org/sdk/codevis [1] on the merge request plugin v2
> 
> still in early stages

Hi,

Kate does

kcoreaddons_add_plugin(${name} INSTALL_NAMESPACE "kf6/ktexteditor")

with

const QList<KPluginMetaData> plugins = 
KPluginMetaData::findPlugins(QStringLiteral("kf6/ktexteditor"));

and just loads the first plugin found with the same name, that for me 
works 'uninstalled' in
the Kate build bin dir.

Greetings
Christoph

> 
> On Mon, 12 Aug 2024 at 18:22 Tomaz Canabrava <tcanabrava at kde.org>
> wrote:
> 
>> Hello All,
>> 
>> This e-mail is in two pars, a request for help, and a question.
>> 
>> I have a fairly strange issue while coding plugins for codevis. The
>> plugin code is similar to konsole (which I have wrote), and kate
>> (which I have contributed in the past), making me even more ignorant
>> on what's happening.
>> 
>> 1 - Request for help:
>> 
>> I am having to manually specify
>> 
>> SET(BUILD_SHARED_LIBS ON)
>> SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
>> 
>> Without the first the code compiles the library as static.
>> Without the second, the library is not linked properly.
>> 
>> 2 Question:
>> I need to load the plugins in `make test` time, but it tries to load
>> the installed plugins, what should I do?
>> 
>> The basic CMake of the plugin is:
>> 
>> kcoreaddons_add_plugin(
>> basiclayoutplugin
>> SOURCES
>> BasicLayoutPlugin.cpp
>> INSTALL_NAMESPACE
>> "codevis_plugins_v2"
>> )
>> 
>> and it looks really straightforward for me.
>> 
>> Best,
>> 
>> Tomaz
> 
> 
> Links:
> ------
> [1] http://invent.kde.org/sdk/codevis


More information about the kde-devel mailing list