[Development] Switch the main "Qt Build System"

Alexandru Croitor alexandru.croitor at qt.io
Tue Jun 9 14:52:30 CEST 2020

> On 9. Jun 2020, at 12:07, Bogdan Vatra <bogdan.vatra at kdab.com> wrote:
> Hi,
> În ziua de marți, 9 iunie 2020, la 11:13:21 EEST, Alexandru Croitor a scris:
>>> On 9. Jun 2020, at 07:22, Bogdan Vatra <bogdan.vatra at kdab.com> wrote:
>>> - is it possible to cross compile Qt in one go (just like we do with
>>> qmake)?
>> Could you clarify what you mean by "in one go"?
>> If it's about building host tools as part of the cross-compilation, then no.
>> You first have to build a desktop Qt, and re-use that host Qt installation
>> for its tools, to cross-compile to another target.
>> That's been one of the goals for Qt 6 regardless of build system, and has
>> been communicated a while ago.
> When I'm cross-compiling Qt for a Linux device, Android, ios, etc., qmake it's 
> smart enough to build everything for me: host tools and the libs for that 
> target in one go i.e. I type ./configure .. && make and it does all the magic 
> for me.
> How qt modules that have host & target libs will be built with cmake?

Like I mentioned in my previous reply, you will have to call configure && make twice, once for the host build and once for target build.
And I will reiterate, this has nothing to do with CMake. 
A decision was made to decouple host builds from target builds, regardless of the build tool used.

That magic that you rely on works in 90% cases, and breaks in weird ways for other users, as well as creating a maintenance burden for package maintainers (linux distros, Qt itself, vcpkg, conan, etc)

> I'm using qmake for Qt6 when I'm doing Android work, also for this reason.
> I don't want to build Qt twice just to use a "cool and superior" build system.

Unfortunately that workflow will not work anymore.
> Just out of curiosity, can some pretty please remind me what are the 
> advantages of using cmake to build Qt over qmake?
> I'm not talking about Qt users, for them we should support all (major) build 
> systems: qmake, cmake, meson, etc.

I think those were pointed out and discussed in previous mailing list discussions.

Personally i don't want to spend time to try convincing anyone in either direction.

There are advantages and disadvantages, as to any solution.

More information about the Development mailing list