What are the plans with CamelCase includes?

Friedrich W. H. Kossebau kossebau at kde.org
Sun Dec 29 22:23:44 UTC 2013


Am Sonntag, 29. Dezember 2013, 17:39:47 schrieb Kevin Ottens:
> On Sunday 29 December 2013 17:11:36 Friedrich W. H. Kossebau wrote:
> > So possibly something more that needs to be decided on: where should
> > plain headers end up?
> 
> Consensus was: same place. The camel cased includes and the .h ones were
> planned to live in the same folder.

To have the same pattern like Qt5 uses, I guess? Makes also sense to me.

So by example of KI18n:

Instead of

include/KF5/ki18n_version.h
include/KF5/klocalizedstring.h
include/KF5/kuitmarkup.h
include/KF5/kuitsetup.h
include/KF5/ki18n_export.h
include/KF5/KI18n/KuitSetup
include/KF5/KI18n/KLocalizedString

there should be 

include/KF5/KI18n/ki18n_version.h
include/KF5/KI18n/klocalizedstring.h
include/KF5/KI18n/kuitmarkup.h       (has KuitSetup class def.)
include/KF5/KI18n/kuitsetup.h        (forwards to kuitmarkup.h)
include/KF5/KI18n/ki18n_export.h
include/KF5/KI18n/KuitSetup
include/KF5/KI18n/KLocalizedString

right?
(kuitmarkup.h possibly was not renamed to kuitsetup.h for backward support)

And KF5I18nTargets.cmake should have both:
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/KF5"
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/KF5/KI18n"


Now, what to expect for "frameworks not using the K* prefix for their classes 
(and generally using namespaces)", by example of KParts:

Currently it is:

include/KF5/KParts/StatusBarExtension
include/KF5/KParts/ListingExtension
include/KF5/kparts/statusbarextension.h
include/KF5/kparts/browseropenorsavequestion.h
[...]

What should that become?

include/KF5/KParts/KParts/StatusBarExtension
include/KF5/KParts/KParts/ListingExtension
include/KF5/KParts/kparts/statusbarextension.h
include/KF5/KParts/kparts/browseropenorsavequestion.h
[...]
KF5PartsTargets.cmake:
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/KF5"
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/KF5/KParts"

or rather

include/KF5/KParts/StatusBarExtension
include/KF5/KParts/ListingExtension
include/KF5/kparts/statusbarextension.h
include/KF5/kparts/browseropenorsavequestion.h
[...]
KF5PartsTargets.cmake just:
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/KF5"

or else ?


More questions:

Q: Really hardcode KF5/ prefix to include path?

The KF5/ part of the include path, does it make sense in all deployments given 
that all headers are already contained in subdirs? IMHO that should be left to 
be defined by the packager/installer. For what reason would we want to enforce 
that? Will there be any files outside of the $MODULENAME/ subdirs?

kdesupport/extra-cmake-modules/kde-modules/KDEInstallDirs.cmake has right now:

_set_fancy(INCLUDE_INSTALL_DIR
	        "include/KF5"        "The install dir for header files")


Q: Add a convenience Module/Module file?

What about adding a convenience include-all file Module/Module, e.g. 
include/KF5/KI18n/KI18n, like there usually is one with each Qt module?

Cheers
Friedrich


More information about the Kde-frameworks-devel mailing list