I have an Ubuntu build machine.
I wish to cross compile for Windows using MinGW which I have installed.
I am compiling QT apps (QT5 as it happens).
I am using CMake.
Native builds work fine out of the box, but cross compiling fails horribly because CMake cannot find the files used by FindPackage. To solve this I copied all the QT library files, header files, cmake files, and files under shared/qt5 from an MSYS2 MinGW/QT5 install (which works beautifully) into the relevant MinGW folder on my Ubuntu build machine. I also symbolically linked the native binaries for "qmake", "rcc", "moc", and "uic" into the correct location as the QT5 cmake files seemed to be looking for them. I suppose I should have edited the cmake files to look for the binaries with the target system prefix, and renamed the symlinks, but I was lazy.
CMake now succeeds, but when I then try to "make" my program I get the following error from "moc":
moc: could not find a Qt installation of ''
I guess that I am missing an environment variable or two.
Ideally I would like a solution which specifies some prebuilt Ubuntu packages that I can install to compile QT applications for Windows on Linux using MinGW, but frankly anything that works would be great.