[Development] Proposing CMake as build tool for Qt 6

Shawn Rutledge Shawn.Rutledge at qt.io
Tue Jun 11 10:09:58 CEST 2019

> On 11 Jun 2019, at 09:12, Lars Knoll <lars.knoll at qt.io> wrote:
> That thread doesn’t explain why qtchooser isn’t a solution. It does work without problems for all my use cases, and I certainly do have quite a few Qt versions installed in parallel.
> Part of the problem simply stems from the fact that Linux distributions want to put all the binaries into /usr/bin. As long as you keep separate Qt versions in separate directories there’s no problem I know of. Giving our build tools different names depending on the version can create other problems for our users, especially those that use some hand rolled build systems (and we probably have lots of those as well).

I also use qtchooser and miss the days when Arch used to provide a package for it, and also the qtchooser config file along with Qt, so that it was easy to manage multiple Qt versions out of the box.  Switching between Qt4 and Qt5 was a breeze too.  Unfortunately they decided that it’s bad for regular users: https://bugs.archlinux.org/task/51308  I work around it by building qtchooser myself and installing to ~/bin (which I have early enough in my shell path to be able to override system binaries with a few of my own).  The same trick works on macOS too, BTW.  Brew doesn’t provide qtchooser either, you have to build it yourself.  I even use mostly the same config files on both Linux and macOS (~/.config/qtchooser/5dd.conf is always a debug build on dev branch for example, and in my shell I type “qt 5dd” to switch to that version), because ~ is the home directory even though it’s in a different place on macOS.  I have my config files in my dotfiles git repo and keep them synced between machines that way.  (You could use syncthing, also highly recommended.)

I do think qtchooser could be a generalized portable utility, not just for Qt.  But switching versions by updating symlinks (as in the /etc/alternatives system) is relatively clumsy compared to the way qtchooser lets you switch to different versions in each shell instance if you like.

More information about the Development mailing list