I recently was debugging KDE Bug #401579 and wanted to build just the Task Manager QML widget and C++ plugin by itself.
Normally you would need to compile the entire plasma-desktop project, which isn’t a huge hurdle once you’ve gotten the development packages installed. The much more annoying problem is testing. Installing plasma-desktop without rebuilding and installing all the dependencies like plasma-workspace and plasma-frameworks could break your Plasma installation. To properly build it, you’d use the kdesrc-build scripts, but we want to avoid that.
To build it by itself, we just need to edit the
applets/taskmanager/CMakeLists.txt so it thinks it’s the “root”
CMakeList.txt so we can avoid compiling everything else.
First lets download the plasma-desktop repo.
Then we’ll open up
applets/taskmanager/CMakeLists.txt and some of the stuff from the missing info which is mostly taken from the
CMakeLists.txt in plasma-desktop’s root directory.
Next we can try compiling just the
applets/taskmanager folder. We create a new “build” directory and enter it. Then we run cmake using the source code from the parent directory (
cmake will check if all the dependencies mentioned in
CMakeLists.txt are installed.
Then we run
make which actually compiles your code. If you missed mentioning a dependency using
find_package() in the
make might throw an error. Further down in
CMakeLists.txt will be a
target_link_libraries() function you can use as a reference for populating
If everything compiled correctly, we can install it to test it.
Then in another terminal, run the following to restart
Now that you’ve setup a test environment, you can start poking around the Task Manager C++ plugin.