Generate kdebugsettings .categories file automatically
ClosedPublic

Authored by kossebau on Oct 5 2018, 11:13 PM.

Details

Summary

Done only for kdevplatform to showcase the idea. Would extend also for
plugins & app once okayed.

Things could be even more simplified by adding another wrapper macro which
avoid repeating all the patterns.

Test Plan

Generated file matches the old manually one (except comments) and is
installed to same location.
Build works as before.

Diff Detail

Repository
R32 KDevelop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kossebau created this revision.Oct 5 2018, 11:13 PM
Restricted Application added a project: KDevelop. · View Herald TranscriptOct 5 2018, 11:13 PM
Restricted Application added a subscriber: kdevelop-devel. · View Herald Transcript
kossebau requested review of this revision.Oct 5 2018, 11:13 PM
kfunk accepted this revision.Oct 7 2018, 12:12 PM
kfunk added a subscriber: kfunk.

Looks good to me in general, feel free to push to master.

cmake/modules/KDevelopMacrosInternal.cmake
101 ↗(On Diff #42953)

Would be careful with the custom target name, could easily create a name conflict.

Maybe prefixed the target name with qt_logging_category_ or sth?

set(_target "qt_logging_category_${ARGS_EXPORT}"
...
120 ↗(On Diff #42953)

Naming consistency: install_qt_logging_categories

141 ↗(On Diff #42953)

Minor: You can split strings across multiple lines in CMake: https://stackoverflow.com/a/27983206/592636

147 ↗(On Diff #42953)

Looks like the KDebugSettings format was extended a little bit, in the meantime?

https://lxr.kde.org/source/kde/kdeutils/kdebugsettings/data/kde.categories

Is there something we can use as well? (Doesn't need to part of this patch, though)

kdevplatform/project/debug.h
26 ↗(On Diff #42953)

Note for future commit: Should probably just kill that header and use the includes directly?

This revision is now accepted and ready to land.Oct 7 2018, 12:12 PM

Thanks for review,

cmake/modules/KDevelopMacrosInternal.cmake
101 ↗(On Diff #42953)

Good idea, will do.

141 ↗(On Diff #42953)

Yes, known. I am undecided which is the more ugly/easy to understand variant when it comes to seeing whether linebreaks will be added.
If you prefer implicit linebreaks, will do.

147 ↗(On Diff #42953)

Yes. Sadly the extension was done without backward compatibility. And relying on apps using that being part of kde applications as well, thus the version dependency to kdebugsettings is resolved by packaging of KA. No idea yet how to find out which version of kdebugsettings can be expected at runtime.
See also https://bugs.kde.org/show_bug.cgi?id=396959 where I failed to make the author motivated to fix the missing backwards compatibility.

This revision was automatically updated to reflect the committed changes.
kossebau marked 2 inline comments as done.