This is an alternative to #18042:
When cross compiling for macOS with depends, we do not compile with dbus. … This fixes the error by always avoiding DBUS notification on macOS.
Another (eventually better) way to fix this would be to avoid detection of host qt pkg-config packages when cross compiling.