SUMMARY On platform without X11, find_package(EGL) fails as it tries to compile code without EGL_NO_X11 define. This was encountered on SailfishOS where we have the following pkg-config EGL file: ``` [root@fdebf063bc5a builder]# cat /usr/lib/pkgconfig/egl.pc prefix=/usr libdir=${prefix}/lib includedir=${prefix}/include Name: egl Description: Mesa EGL Library Version: 21.1.6 Requires.private: libdrm >= 2.4.75 Libs: -L${libdir} -lEGL Libs.private: -lpthread -pthread -lm -ldl Cflags: -I${includedir} -DEGL_NO_X11 ``` As -DEGL_NO_X11 was not used while checking for code compilation, HAVE_EGL was set to false. I am not an expert in CMake, but it looks like that define option should be somewhere here: https://invent.kde.org/frameworks/extra-cmake-modules/-/blob/master/find-modules/FindEGL.cmake#L100 SOFTWARE/OS VERSIONS Linux/KDE Plasma: SailfishOS 4.5 (available in About System) KDE Plasma Version: - KDE Frameworks Version: 5.105.0 Qt Version: 5.15.8
Adding the x11-only keyword