SUMMARY Any client that attempts to consume KF5CoreAddons statically will fail on Linux due to: "KF5CoreAddons could not be found because dependency Inotify could not be found." See e.g. https://invent.kde.org/frameworks/kconfigwidgets/-/jobs/538225 for an example
This one is odd. I tried debugging this previously and the problem appears to be with find-modules/FindInotify.cmake from ECM. Specifically, by looking into CMake trace, I saw that: 1) the first time find_path(Inotify_INCLUDE_DIRS sys/inotify.h) is executed, it finds the path just fine, and the if(Inotify_INCLUDE_DIRS) block executes as expected 2) the second time FindInotify.cmake is run (it escapes me why is it run consecutive time at all), it appears that it uses a cached `Inotify_INCLUDE_DIRS` value, which somehow ends up empty, though, since the code in the if(Inotify_INCLUDE_DIRS) block is *not* executed. I cannot pinpoint the exact reason behind this behavior. This is most likely the FindInotify.cmake's fault, which would make this extra-cmake-modules' bug, but I am leaving it here for the context.
One workaround would be to replace if(@Inotify_FOUND@) with if(@Inotify_LIBRARIES@). Looking at the FindInotify, it only needs to link against anything if inotify library is located, as opposed to Inotify support built into the OS kernel.
(Reassigning this to extra-cmake-modules, as kcoreaddons doesn't do anything out of ordinary in how it uses it, so it's unlikely its fault)
OK, this is actually a duplicate of https://bugs.kde.org/show_bug.cgi?id=441604 — which I somehow thought it was fixed, but it wasn't, as the solution explained there fixed another issue. It was also discussed here: https://invent.kde.org/frameworks/kcoreaddons/-/merge_requests/129
Git commit 8d839531cf99fb49789f583e541096f094718f12 by Dawid Wróbel. Committed on 29/12/2022 at 00:02. Pushed by wrobelda into branch 'master'. Config.cmake.in: workaround Inotify static issue M +6 -1 KF5CoreAddonsConfig.cmake.in https://invent.kde.org/frameworks/kcoreaddons/commit/8d839531cf99fb49789f583e541096f094718f12