Adapt build system to also support Qt 6
This is complicated by the Qt 5.6 requirement of SailfishOS, hopefully that didn't get broken by this.
This is enough to get cmake to pass, but there's likely some linker and install issues left in there that aren't visible yet.