RFC Rules for installation of header files

Kevin Ottens ervin at kde.org
Sun Nov 10 16:27:57 UTC 2013


Hello,

On Wednesday 06 November 2013 08:52:29 Aurélien Gâteau wrote:
> Yesterday frameworks meeting spawned a discussion regarding folders in
> header files.

I think there's an aspect missing in your proposal. There's the convention we 
want for #include and where we install. That's in the end two different things 
even though related.

I think, that for all the frameworks, headers should be installed in:
$PREFIX/include/KF5/FrameworkName/

FrameworkName would then contain both the regular .h headers and the 
convenience camel case ones. If we go for that, we get something consistent 
install wise and easy to deal with. Then the distinction you make below is 
just about the include path we want when someone pulls a framework in.

> 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.

I think in a case like that we still want the includes installed in 
$PREFIX/include/KF5/FrameworkName/ (convenience or not). But when someone 
pulls the framework as a dependency then both $PREFIX/include/KF5/ and 
$PREFIX/include/KF5/FrameworkName/  are added in the include path, thus 
supporting the #include <kfoo.h> and #include <KFoo> styles.

> 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}.

I think in a case like that we still want the includes installed in 
$PREFIX/include/KF5/FrameworkName/ (convenience or not). But when someone 
pulls the framework as a dependency then only $PREFIX/include/KF5/ is added in 
the include path, thus supporting the #include <FrameworkName/foo.h> and 
#include <FrameworkName/Foo> styles.

> Some special files should still go in include:
> 
>     {lowercaseframework}_export.h
>     {lowercaseframework}_version.h

Make that $PREFIX/include/KF5/ instead of just include and I agree.

I think it departs quite a bit from your initial proposal, making it slightly 
more complicated on the include path side, but it has pros like:
 * making it more homogeneous on the installation side;
 * allows co-installability of major releases in the future.

Opinions?

Cheers.
-- 
Kévin Ottens, http://ervin.ipsquad.net

KDAB - proud supporter of KDE, http://www.kdab.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20131110/43c9ea6c/attachment-0001.sig>


More information about the Kde-frameworks-devel mailing list