It doesn't build because there's no QX11Extras lib in Qt 6 so Qt5X11Extras_FOUND always evaluates to false.