I’m trying to do this:
- Cross compile a Qt application: building on Linux and target Windows using MinGW
- I have a cross compiled Qt already
- Use Qt Linguists tools from the host using find_package(Qt5LinguistTools) to build translations files
- I’m using Ubuntu 20.04
The issue is that find_package won’t find the host’s Qt5LinguistTools because Qt5LinguistTools is in this directory:
And when cross compiling, cmake won’t look in this directory with find_package as CMAKE_LIB_ARCHITECTURE is empty.
I can workaround that issue by using
-DCMAKE_PREFIX_PATH=/usr/lib/x86_64-linux-gnu/cmake, but that will work only for Debian derivatives on x86_64 cpu.
Is there a way to cleanly handle this case ?
I think about several solutions:
- There is an option or something in CMake that can make this work more easily
- Qt tools should not be in a arch-dependent directory to be usable when cross-compiling
- Something else I don’t know yet
Note: the exact context is building QJackCtl for Windows from a Ubuntu 20.04 system using github actions and a cross compiled Qt: