kcoreaddons_add_plugin executable/plugin directory conflict

Daniel Vrátil dvratil at kde.org
Mon May 11 09:21:10 BST 2020


Hi all,

I'm moving some plugins in kaddressbook and I ran into a problem with 
kcoreaddons_add_plugin:

I have this in the plugin CMakeLists.txt:

kaddressbook_add_plugin(
	kaddressbook_importexportvcardplugin
	JSON kaddressbook_importexportvcardplugin.json
	SOURCES ${kaddressbook_importexport_vcard_SRCS}
	INSTALL_NAMESPACE kaddressbook/importexportplugin
)

When I run make on the entire project, it fails with

[ 65%] Linking CXX shared module ../../../../bin/kaddressbook/
importexportplugin/kaddressbook_importexportvcardplugin.so
ld: error: cannot open output file ../../../../bin/kaddressbook/
importexportplugin/kaddressbook_importexportvcardplugin.so: Not a directory

Alternatively, if a plugin gets created first, it fails on

[ 96%] Linking CXX executable ../bin/kaddressbook
ld: error: cannot open output file ../bin/kaddressbook: Is a directory

I realized the problem is that CMake is unable to create the plugin in 
$BUILDDIR/bin/kaddressbook/importexportplugin/ directory, because there's 
already $BUILDDIR/bin/kaddressbook executable (or vice versa).

I would assume this is a very common problem - having plugins "namespaced" in 
the same directory as is the name of the program (and executable). Should the 
macro maybe put the plugins into "$BUILDDIR/bin/plugins/$INSTALL_NAMESPACE/"? 
Would that make the lookup any more complicated?

Is there some known solution/workaround to this? I'd prefer not to have to 
rename the executable or the plugins namespaces, since having different name 
for the program and the plugin "namespace" somewhat defeats the purpose of a 
namespace...

/Dan

-- 
Daniel Vrátil
www.dvratil.cz | dvratil at kde.org
IRC: dvratil on Freenode (#kde, #kontact, #akonadi, #fedora-kde)

GPG Key: 0x4D69557AECB13683
Fingerprint: 0ABD FA55 A4E6 BEA9 9A83 EA97 4D69 557A ECB1 3683
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200511/67f1bc8f/attachment.sig>


More information about the Kde-frameworks-devel mailing list