RFC Rules for installation of header files
Aurélien Gâteau
agateau at kde.org
Wed Nov 6 13:52:29 UTC 2013
Yesterday frameworks meeting spawned a discussion regarding folders in
header files.
I think the consensus is there should be two different situations:
1. 'k' prefixed header files
If the header files of a framework are prefixed with a 'k', then headers
should be installed in include and convenience headers should be
installed in include/KDE.
2. Non-prefixed header files
If the header files of a framework are not prefixed, then they should be
installed in include/{lowercaseframework} and convenience headers should
be installed in include/KDE/{CamelCaseFramework}.
In this situation, framework users are expected to use the framework
name in their #include directives. For example, code using the Sonnet
ConfigDialog class should use:
#include <Sonnet/ConfigDialog>
Some special files should still go in include:
{lowercaseframework}_export.h
{lowercaseframework}_version.h
This means the CMake target for the framework should always define its
include dirs as include and include/KDE, regardless of whether the
framework include files are grouped in a folder or not.
Do these rules make sense to you?
# Current situation
I wrote a quick script to list files which do not satisfy those rules.
(See attached, run it in the include dir, preferably after running 'make
install DESTDIR=/somewhere' to avoid finding headers from other
projects)
## Most likely needed for SC
Those headers were already there in KDE4.
- conversion_check.h
- fixx11h.h
- kgenericfactory.tcc
- netwm_def.h
- netwm.h
- predicateproperties.h
- threadweaver installs headers as {lowercase}/{CamelCase}.h, instead of
{lowercase}/{lowercase}.h
- KDE/kdbgstream
- KDE/kndbgstream
- KDE/NET
- KDE/NETRootInfo
- KDE/NETWinInfo
- KDE/OrgKdeKDirNotifyInterface
- KDE/PtyProcess: this one comes from kdesu, but there is also
KPtyProcess (from kpty). That is potentially confusing.
- KDE/SshProcess
- KDE/StubProcess
- KDE/SuProcess
- KDE/ThumbCreator
- khtml installs CamelCase headers in KDE/khtml, instead of KDE/KHTML.
## Fixable
- config-kwindowsystem.h: Should not be installed
- kfilewrite.desktop: (!?) Most likely a typo. KDE4 version is in
share/kde4/servicetypes/
- KJsEmbed/kjsembed_export.h: Should be installed in include. Or should
not be installed at all since KJsEmbed does not install any other
header (!?)
- lineediturldropeventfilter.h: New in 5.0. Class should be prefixed
with 'K', file should be prefixed with 'k'.
kjs and wtf install some headers as {lowercase}/{CamelCase}.h instead of
{lowercase}/{lowercase}.h. Those headers were not installed before so
this could be fixed without breaking SC.
Aurélien
-------------- next part --------------
A non-text attachment was scrubbed...
Name: check.sh
Type: text/x-sh
Size: 882 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20131106/f64d2ab3/attachment.bin>
More information about the Kde-frameworks-devel
mailing list