How to build single kcm and debug it?

Hello,

I’m trying to look into an issue related to one of pages in System Settings. Is there a way to build and debug a single “kcm” and debug it?

I was trying to build whole kwin, but got stuck at KNightLight dependency, as Fedora seems to be missing this package.

Any hint or a nudge in the right direction will be appreciated.

How are you building the kcm? With kde-builder?

There is a flag to build it without the dependencies if you are using kde-builder or kdesrc-build

kde-builder --no-include-dependencies

See also: 4.3. Supported command-line parameters — KDE Builder documentation

I was trying to build using cmake. I’ll try using kde-builder.

I specified incorrect name for missing dependency - it is KNightTime (Needed for Night Light).

Finally figured it out. Installed kde-builder and built kwin project. Somehow ended up using CLion, but tried a few other IDEs too.

Probably not the best way, but I got where I needed to be: I can set breakpoints and debug kcm application. Settings for CLion “Run/Debug Configuration”:

Executable: ~/kde/usr/bin/kcmshell6

Program arguments: $CMakeCurrentProductFile$

Working directory: $CMakeCurrentLocalBuildDir$

This is more of a reminder to myself in the future. Please share comments if I did something wrong, or could’ve done better. All feedback is appreciated.