CMake complain about missing KF6Plasma

Hi, I’m on EndeavourOS and trying to port/rewrite an KF5/Kirigami application to KF6/Plasma 6 applets, as that is more fitting with the scope of what the application does (monitoring in the system tray). Currently, I’m not planning to make anything concrete, but just want to play around a bit with the new stuffs. However, I’m hitting a roadblock with CMake unable to find KF6Plasma module.

For the system, I have:

  • Enabled the kde-unstable repo, and I’m on the Plasma 6 Beta 1.
  • Set up kdesrc-build with the KF6 and have built the workspace group.

For the project, I set it up from the Kdevelop template Plasma QML Applet with QML extension (Qt6).

At first, when I configured the project in Kdevelop with system package from Arch repo, CMake complained:

-- Could NOT find KF6Plasma (missing: KF6Plasma_DIR)
-- Could NOT find KF6Plasma: found neither KF6PlasmaConfig.cmake nor kf6plasma-config.cmake 
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find KF6 (missing: Plasma) (found version "5.246.0")
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/ECM/find-modules/FindKF6.cmake:93 (find_package_handle_standard_args)
  CMakeLists.txt:19 (find_package)

Then I tried with kdesrc-build, following this guide, CMake spitted out similar message:

-- Could NOT find KF6Plasma (missing: KF6Plasma_DIR)
-- Could NOT find KF6Plasma: found neither KF6PlasmaConfig.cmake nor kf6plasma-config.cmake 
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find KF6 (missing: Plasma) (found version "5.247.0")
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  /data/KDE/usr/share/ECM/find-modules/FindKF6.cmake:93 (find_package_handle_standard_args)
  CMakeLists.txt:19 (find_package)

Note: /data/KDE is where I put kdesrc-build related stuffs.

Does the Arch package from the unstable repo miss something? Or, did I mess up some configs? Any help would be appreciated, thanks.

Well, look at that! I went to make myself a drink, came back and decided to look over some other Plasma repos and immediately realized that I forgot Plasma is still in Beta and haven’t bumped version to 6 yet.

The solution from those repos is rather than following Kdevelop’s template, just change this:

find_package(KF6 REQUIRED COMPONENTS
    Plasma
    # Some other modules
)

To this:

find_package(KF6 REQUIRED COMPONENTS
    # Some other modules
)

find_package(Plasma 5.90.0 REQUIRED) # Plasma 6 Beta 1.

Let hope that I don’t find more problems.

1 Like