The template of libdnf5 plugin described on this web page:
https://dnf5.readthedocs.io/en/latest/templates/template-libdnf5-plugin.html
is not possible to compile with current version of libdnf5.
The CmakeFiles.txt is also intended for plugins that are part of dnf5 repository.
I created my own repository with this template to demonstrate these issues and I created PR with unmodified template.cpp:
jirihnidek/libdnf5-plugin-template#1
and then I created another PR showing what is necessary to change in the code:
jirihnidek/libdnf5-plugin-template#2