When cross compiling on x86 for arm/aarch64 I use qemu/binfmt to run whatever arm binaries are needed during the build.
However, tqmoc produces arch independent output and so the x86 binary can be used, avoiding the overhead that qemu produces.
It’s convenient to place the x86 binaries outside the TDE tree and be able to define where tqmoc can be found, so I use this patch in FindTQt.cmake:
--- cmake/modules/FindTQt.cmake +++ cmake/modules/FindTQt.cmake @@ -34,0 +35 @@ +if( NOT DEFINED MOC_EXECUTABLE ) @@ -38 +39 @@ - +endif( NOT DEFINED MOC_EXECUTABLE )
and can then use with cmake, for example: