Bug 441266

Summary: Build now broken if project doesn't configure extra-cmake-modules
Product: [Frameworks and Libraries] frameworks-kwindowsystem Reporter: Janet Blackquill <uhhadd>
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: kde, nicolas.fella
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Janet Blackquill 2021-08-20 22:08:38 UTC
61cfaf3b7389daf7f00da050da7a44b41d4b7632 and cb40e3d63fa849ed3cec6f7420cf7420e8206e0a now require the user of KWindowSystem to explicitly depend on and adjust CMake's module path as per standard for ECM, where this wasn't needed before.

This breaks projects that depended on it without configuring ECM.
Comment 1 David Edmundson 2021-08-20 22:17:47 UTC
I don't understand what you're saying the bug is.
Comment 2 Janet Blackquill 2021-08-20 22:19:42 UTC
Projects need to depend on ECM and adjust the CMAKE_MODULE_PATH like so, in order to depend on KWindowSystem:

find_package(ECM REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})

If they don't, the build fails with this error:

ERROR: CMake Error at /usr/share/cmake/Modules/CMakeFindDependencyMacro.cmake:47 (find_package):
  By not providing "FindXCB.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "XCB", but
  CMake did not find one.

  Could not find a package configuration file provided by "XCB" with any of
  the following names:

    XCBConfig.cmake
    xcb-config.cmake

  Add the installation prefix of "XCB" to CMAKE_PREFIX_PATH or set "XCB_DIR"
  to a directory containing one of the above files.  If "XCB" provides a
  separate development package or SDK, be sure it has been installed.
Call Stack (most recent call first):
  /home/jpontaoski/kde/usr/lib64/cmake/KF5WindowSystem/KF5WindowSystemConfig.cmake:36 (find_dependency)
  CMakeLists.txt:11 (find_package)

This is because FindXCB is provided by ECM.

Before the named commits, projects using KWindowSystem didn't need to have the above ECM snippet.
Comment 3 Bug Janitor Service 2021-08-20 22:20:53 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kwindowsystem/-/merge_requests/31
Comment 4 Nicolas Fella 2021-08-22 11:32:11 UTC
Git commit c7c49f9c421c5473aff2131f85468bd306c38de4 by Nicolas Fella.
Committed on 20/08/2021 at 22:20.
Pushed by nicolasfella into branch 'master'.

Don't link publicly against XCB

FindXCB is from ECM, having that in the config file means that the consumer needs to include ECM, which is not nice

M  +0    -1    KF5WindowSystemConfig.cmake.in
M  +6    -1    src/CMakeLists.txt

https://invent.kde.org/frameworks/kwindowsystem/commit/c7c49f9c421c5473aff2131f85468bd306c38de4
Comment 5 Dawid Wróbel 2021-10-24 10:12:59 UTC
Git commit de4ab9b7a93bb7103f0b64a283a58d36d20936a5 by Dawid Wróbel.
Committed on 24/10/2021 at 09:58.
Pushed by wrobelda into branch 'master'.

Link privately against XCB when building statically

M  +1    -0    KF5WindowSystemConfig.cmake.in

https://invent.kde.org/frameworks/kwindowsystem/commit/de4ab9b7a93bb7103f0b64a283a58d36d20936a5