[Development] Build system for Qt 6

Christian Ehrlicher Ch.Ehrlicher at gmx.de
Fri Dec 7 22:39:57 CET 2018


Am 07.12.2018 um 22:30 schrieb Kyle Edwards:
> On Fri, 2018-12-07 at 21:48 +0100, Christian Ehrlicher wrote:
>> One really nice feature what I miss in cmake is the '-project'
>> option
>> from qmake. Basically it scans the current directory, adds all
>> sources,
>> headers and ui-files and creates a small .pro file out of it. It's a
>> very convenient feature when you just want to compile a small test
>> project. Creating an initial CMakeLists.txt from scratch takes much
>> longer and therefore this is the only place where I use qmake
>> (outside
>> the qt sources)
>> Maybe this can be added - simply read the current directory and pass
>> the
>> files found to a template CMakeLists.txt to create the project type
>> you
>> want - I assume not all ant to get a Qt project when such a feature
>> would be added to cmake... :)
> Sounds like a nice idea! Would certainly help beginners get up and
> running quickly.
>
> Does qmake figure out which libraries you're using, etc. or does it
> just generate a barebones file that you have to fix up yourself if you
> want to add external dependencies?
It's using QtCore and QtGui by default, the rest must be specified on 
the command line: qmake -project QT += "widgets network"
will add the line 'QT += widgets network' to the pro file (*)
Therefore my idea with the template
cmake -project qt -modules widgets, network -->  simple CMakeLists.txt 
with Qt components core, gui, widgets, network
cmake -project c++ --> simple CMakeLists.txt without any Qt dependency
Or a simple helper script which creates the project file.

Thx,
Christian

* See also http://doc.qt.io/qt-5/qmake-variable-reference.html#qt



More information about the Development mailing list