CMake: Explicitly check for required X11 libraries

CMake's FindX11 package reports that X11 was found even if not all libraries
are present. It also doesn't support proper components. This causes issues on
distros that split X11 headers into a myriad of small packages, for instance
Debian: some, but not all, components might be found.

Explicitly check that every X11 component used by Plasma was found by FindX11.
wilder-5.26
Louis Moureaux 4 years ago committed by Nate Graham
parent eb594ea713
commit 47cff0c9fc
  1. 14
      CMakeLists.txt

@ -121,6 +121,20 @@ set_package_properties(X11 PROPERTIES DESCRIPTION "X11 libraries"
URL "https://www.x.org"
TYPE OPTIONAL
PURPOSE "Required for building the X11 based workspace")
macro(check_X11_lib)
if (NOT TARGET X11::${ARGV0})
message(SEND_ERROR "Required component ${ARGV0} of X11 was not found")
endif()
endmacro()
check_X11_lib(ICE)
check_X11_lib(SM)
check_X11_lib(X11)
check_X11_lib(Xau)
check_X11_lib(Xcursor)
check_X11_lib(Xfixes)
check_X11_lib(Xft)
check_X11_lib(Xrender)
check_X11_lib(Xtst)
find_package(PkgConfig REQUIRED)
pkg_check_modules(PipeWire IMPORTED_TARGET libpipewire-0.3)

Loading…
Cancel
Save