[Development] Importing a module build in creator

Eike Ziller Eike.Ziller at qt.io
Mon Jan 10 09:10:54 CET 2022


Hi!

qmake actually creates a “subproject” per sub-.pro file, and these “subproject” can be opened, built, run separately.

CMake works different, a build only consists of a single “project”, so it is not possible to open “subprojects”.

The options, as I see them:

Accept that, and open the toplevel Qt project. Should work fine, and _because_ CMake does not recursively create subprojects, the incremental build with Ninja is very fast on the whole project. No recursive make involved.

Build your module separately from the rest of Qt, and open that in Qt Creator. Building a module separate from qtbase is actually pretty easy with CMake. Build qtbase and other modules that you depend on via qt5, and then just run "<qt>/qtbase/bin/qt-cmake-private -S <path_to_module_src> -B <path_to_module_build>” and build. Since you ran CMake separately from Qt on your module, you’ll have a separate project that you can open in Qt Creator.

Br, Eike

> On 9 Jan 2022, at 12:47, Konstantin Shegunov <kshegunov at gmail.com> wrote:
> 
> Hello,
> In the Qt5 times with qmake I was able to run the makefile generator on the top of the Qt tree and then import build in Creator for some specific module I'd wanted to work on. Is something like this still possible for Qt6 and cmake (I'm currently using the default ninja generator)?
> 
> The whole idea of this approach is that once I build the whole of Qt I wouldn't change/rebuild or even check unrelated modules, but simply focus on what I'm hacking at. I saw that currently I can import the (cmake) configuration from the toplevel project, and that works fine, but I haven't figured out if and how to do it for a subtree/module, or if it is possible at all.
> 
> Thanks,
> Konstantin.
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> https://lists.qt-project.org/listinfo/development

-- 
Eike Ziller
Principal Software Engineer

The Qt Company GmbH
Erich-Thilo-Straße 10
D-12489 Berlin
eike.ziller at qt.io
http://qt.io
Geschäftsführer: Mika Pälsi,
Juha Varelius, Jouni Lintunen
Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B




More information about the Development mailing list