[Development] Switch the main "Qt Build System"
Eike.Ziller at qt.io
Tue Jun 9 12:07:46 CEST 2020
> On Jun 9, 2020, at 09:59, Andy Nichols <Andy.Nichols at qt.io> wrote:
> Hi Alexandru,
> I think Brett touches on the biggest blocker for me and that is actually related to Qt Creators ability to open and use modules built using cmake. I am actually really impressed with state of the CMake support for build Qt as it is right now, and wish I could more actively use it, but unfortunately my current workflow involves using Qt Creator to develop Qt, and I have to work on modules that are not just QtBase. Despite adding my cmake based Qt Builds to Creator as kits (which seems to only be possible using qmake), it isn't possible for Creator to easily recognize that my module's are built with that kit when loading them. I hear rumors that it is possible, but most of the guys who say that are only working on qtbase anyway.
> I think that before we kill the qmake based build of Qt, that our own IDE should support developing Qt itself. And I would be happy with some "sketchy config" that works with a released version of Qt Creator for now, but this shouldn't be good enough to justify killing qmake before a real solution is in place.
Hi, I just tried opening qtdeclarative in Qt Creator 4.12.2 (on macOS).
1) build (and install) qtbase with cmake on command line
2) build (and install) qtdeclarative with cmake on command line (with qt-cmake <src> && cmake —build .)
3) register the Qt version in Qt Creator (Pointing it to the qmake that was built in (1)), press Apply
4) create a kit with that Qt version in Qt Creator
5) make sure compiler is set sensibly
6) remove everything from the “CMake Configuration” from the kit
7) open the qtdeclarative/CMakeLists.txt in Qt Creator, check the kit that you created and change the build directory to qtdeclarative’s build directory
On a short glance that seemed to work. No code model warnings, triggering a build triggers a build.
Step 6 is to try to minimize the fiddling that Qt Creator does with the build directory.
Whenever Qt Creator says that the “Qt Creator project” and the “cmake build directory” disagree, choose to “Adapt Qt Creator Project” to the cmake build directory.
This will hopefully work better in Qt Creator 4.13 where we make Qt Creator to accept an existing CMake build directory as “the one truth to rule it all”.
“Importing" the qt/module build into Qt Creator, i.e. automatically creating a kit from the build indeed doesn’t seem to work. The compiler is empty in the generated Kit for me, and Qt Creator 4.12 then explicitly passes CMAKE_CXX_COMPILER=“”. Even though the original CMakeCache.txt contains the correct entry, and that compiler is actually already registered in Qt Creator.
The Qt version in the kit is empty too. Detecting that seems to be a bit more difficult, but since CMake gives us the relevant include paths anyhow that might not be such an issue.
Principal Software Engineer
The Qt Company GmbH
eike.ziller at qt.io
Geschäftsführer: Mika Pälsi,
Juha Varelius, Mika Harjuaho
Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B
More information about the Development