Re: [Development] Importing a module build in creator

2022-02-07 Thread Konstantin Shegunov
This thread has been utterly useful, and thanks all for the input. May I
suggest, however, these tips get documented somehow (e.g. in the wiki)?
As it happens, what Eddy and Thiago wrote was truly a life saver for my
current poking into qtbase. Rebuilding the bootstrap lib invalidates
basically everything and it takes forever to build for no useful reason (in
my case), so it'd be really nice to have had this documented to begin with,
even if it is a 'workaround' of sorts.

Kind regards,
Konstantin.
___
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development


Re: [Development] Importing a module build in creator

2022-02-04 Thread Eike Ziller


> On 14 Jan 2022, at 11:44, Mitch Curtis  wrote:
> 
> This is the same situation I’m in. Would be nice if they were built when you 
> hit run, but as a workaround I use Alt+B, Alt+R (from memory… I think that’s 
> right):
> 
> https://codereview.qt-project.org/c/qt-creator/qt-creator/+/330075

As a side note, you can also assign a “regular” shortcut to that via Options > 
Environment > Keyboard.

Br, Eike

> 
> That way you can do that key combination and then Ctrl+R to run the test.
> 
> On 11/1/2022, 13:25, "Development"  wrote:
> 
> Am 11.01.2022 um 12:39 schrieb Edward Welbourne:
> > Arno Rehn (9 January 2022 15:59) wrote:
> >> I'm skipping building the tests by default and would like
> >> to build only a subset (the ones of the module I'm working on).
> >> QtCreator doesn't seem to support EXCLUDE_FROM_ALL tests at all, so I
> >> usually have to resort to the command line for that.
> > 
> > I suspect combining
> > 
> >-DQT_BUILD_TESTS=ON
> >-DQT_BUILD_TESTS_BY_DEFAULT=OFF
> > 
> > would help here.  CMake would know how to build the tests, but would
> > only do so on request, so you could tell ninja to build $submodule/test
> > (or indeed $subdirectory/test; see ninja -t targets for a full list) so
> > as to only build the tests you care about, or build tst_component_check
> > to (build and) run a specific test.
>  
> That's what I'm doing, actually. Works fine on he command line, like you
> said.
> But QtCreator does not know how to handle this case. You see all test
> targets in QtCreator's list, but running them does not build them first.
> So either you'll get a "file not found" error or maybe an outdated
> executable.
> You can only build them with a manual call to ninja.
>  
> Regards,
> Arno
>  
> -- 
> Arno Rehn
> Tel +49 89 189 166 0
> Fax +49 89 189 166 111
> a.r...@menlosystems.com
> www.menlosystems.com 
>  
> Menlo Systems GmbH
> Bunsenstrasse 5, D-82152 Martinsried, Germany
> Amtsgericht München HRB 138145
> Geschäftsführung: Dr. Michael Mei, Dr. Ronald Holzwarth
> USt.-IdNr. DE217772017, St.-Nr. 14316170324
> ___
> Development mailing list
> Development@qt-project.org
> https://lists.qt-project.org/listinfo/development
>  
>  
> ___
> Development mailing list
> Development@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.zil...@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


___
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development


Re: [Development] Importing a module build in creator

2022-01-14 Thread Mitch Curtis
This is the same situation I’m in. Would be nice if they were built when you 
hit run, but as a workaround I use Alt+B, Alt+R (from memory… I think that’s 
right):
https://codereview.qt-project.org/c/qt-creator/qt-creator/+/330075
That way you can do that key combination and then Ctrl+R to run the test.
On 11/1/2022, 13:25, "Development"  wrote:
Am 11.01.2022 um 12:39 schrieb Edward Welbourne:
> Arno Rehn (9 January 2022 15:59) wrote:
>> I'm skipping building the tests by default and would like
>> to build only a subset (the ones of the module I'm working on).
>> QtCreator doesn't seem to support EXCLUDE_FROM_ALL tests at all, so I
>> usually have to resort to the command line for that.
>
> I suspect combining
>
>-DQT_BUILD_TESTS=ON
>-DQT_BUILD_TESTS_BY_DEFAULT=OFF
>
> would help here.  CMake would know how to build the tests, but would
> only do so on request, so you could tell ninja to build $submodule/test
> (or indeed $subdirectory/test; see ninja -t targets for a full list) so
> as to only build the tests you care about, or build tst_component_check
> to (build and) run a specific test.

That's what I'm doing, actually. Works fine on he command line, like you
said.
But QtCreator does not know how to handle this case. You see all test
targets in QtCreator's list, but running them does not build them first.
So either you'll get a "file not found" error or maybe an outdated
executable.
You can only build them with a manual call to ninja.

Regards,
Arno

--
Arno Rehn
Tel +49 89 189 166 0
Fax +49 89 189 166 111
a.r...@menlosystems.com
www.menlosystems.com 

Menlo Systems GmbH
Bunsenstrasse 5, D-82152 Martinsried, Germany
Amtsgericht München HRB 138145
Geschäftsführung: Dr. Michael Mei, Dr. Ronald Holzwarth
USt.-IdNr. DE217772017, St.-Nr. 14316170324
___
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development


___
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development


Re: [Development] Importing a module build in creator

2022-01-13 Thread Jörg Bornemann

On 1/13/22 08:24, Eike Ziller wrote:


I.e. better use qt-configure-module to configure modules. That probably gets 
some edge cases right, that aren’t covered by just qt-cmake-private.


The main reason for its existence are configure features.
For example:

$ ../qtbase/bin/qt-configure-module ~/dev/qt/dev/qtdeclarative 
-list-features
qml-animation  QML: Provides support for animations and 
timers in QML.
qml-debug  QML: Provides infrastructure and plugins for 
debugging and profiling.

qml-delegate-model ... QML: Provides the DelegateModel QML type.
qml-devtools . QML: Provides the QmlDevtools library and 
various utilities.

...

$ ../qtbase/bin/qt-configure-module ~/dev/qt/dev/qtdeclarative 
-no-feature-quick-designer



--
Jörg Bornemann | The Qt Company
___
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development


Re: [Development] Importing a module build in creator

2022-01-12 Thread Eike Ziller
> 
> With the provision that I haven't looked inside qt-cmake-private what would 
> be the difference from the qt-configure-module, which Arno suggested?

I didn’t realize qt-configure-module existed. Looks like that passes on some 
configure options from the original / allows to pass configure options for the 
module. (In the end it calls qt-cmake-private with a few more CMake variables.)

I.e. better use qt-configure-module to configure modules. That probably gets 
some edge cases right, that aren’t covered by just qt-cmake-private.

-- 
Eike Ziller
Principal Software Engineer

The Qt Company GmbH
Erich-Thilo-Straße 10
D-12489 Berlin
eike.zil...@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


___
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development


Re: [Development] Importing a module build in creator

2022-01-12 Thread Konstantin Shegunov
Thank you all for the insights!

On Sun, Jan 9, 2022 at 5:02 PM Arno Rehn  wrote:

> I don't think that this is possible with CMake.
>
> I've been working around that by (re-)building only the module I'm
> working on with qtbase/bin/qt-configure-module in a seperate directory.
> That single-module build can then be imported just fine.
>

Thanks for that tip, I will try that out.

I've found that importing the full Qt6 build tree isn't so bad, either.
> Incremental builds with ninja are very fast.
>

Yeah, insofar as you don't touch the cmake files.

On Mon, Jan 10, 2022 at 10:10 AM Eike Ziller  wrote:

> 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 "/qtbase/bin/qt-cmake-private -S  -B
> ” 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.
>

With the provision that I haven't looked inside qt-cmake-private what would
be the difference from the qt-configure-module, which Arno suggested?

Kind regards,
Konstantin.
___
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development


Re: [Development] Importing a module build in creator

2022-01-11 Thread Arno Rehn

Am 11.01.2022 um 12:39 schrieb Edward Welbourne:

Arno Rehn (9 January 2022 15:59) wrote:

I'm skipping building the tests by default and would like
to build only a subset (the ones of the module I'm working on).
QtCreator doesn't seem to support EXCLUDE_FROM_ALL tests at all, so I
usually have to resort to the command line for that.


I suspect combining

   -DQT_BUILD_TESTS=ON
   -DQT_BUILD_TESTS_BY_DEFAULT=OFF

would help here.  CMake would know how to build the tests, but would
only do so on request, so you could tell ninja to build $submodule/test
(or indeed $subdirectory/test; see ninja -t targets for a full list) so
as to only build the tests you care about, or build tst_component_check
to (build and) run a specific test.


That's what I'm doing, actually. Works fine on he command line, like you 
said.
But QtCreator does not know how to handle this case. You see all test 
targets in QtCreator's list, but running them does not build them first. 
So either you'll get a "file not found" error or maybe an outdated 
executable.

You can only build them with a manual call to ninja.

Regards,
Arno

--
Arno Rehn
Tel +49 89 189 166 0
Fax +49 89 189 166 111
a.r...@menlosystems.com
www.menlosystems.com

Menlo Systems GmbH
Bunsenstrasse 5, D-82152 Martinsried, Germany
Amtsgericht München HRB 138145
Geschäftsführung: Dr. Michael Mei, Dr. Ronald Holzwarth
USt.-IdNr. DE217772017, St.-Nr. 14316170324
___
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development


Re: [Development] Importing a module build in creator

2022-01-11 Thread Edward Welbourne
Arno Rehn (9 January 2022 15:59) wrote:
> I'm skipping building the tests by default and would like
> to build only a subset (the ones of the module I'm working on).
> QtCreator doesn't seem to support EXCLUDE_FROM_ALL tests at all, so I
> usually have to resort to the command line for that.

I suspect combining

  -DQT_BUILD_TESTS=ON
  -DQT_BUILD_TESTS_BY_DEFAULT=OFF

would help here.  CMake would know how to build the tests, but would
only do so on request, so you could tell ninja to build $submodule/test
(or indeed $subdirectory/test; see ninja -t targets for a full list) so
as to only build the tests you care about, or build tst_component_check
to (build and) run a specific test.

Eddy.
___
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development


Re: [Development] Importing a module build in creator

2022-01-10 Thread Thiago Macieira
On Monday, 10 January 2022 06:02:43 PST Thiago Macieira wrote:
> The only problem is if you do the above, then you don't have qmake and you
> can't build qmake-based projects against your Qt build. You can get away
> with using the other build's qmake and then changing LD_LIBRARY_PATH to
> point to your Qt.

https://bugreports.qt.io/browse/QTBUG-99683

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel DPG Cloud Engineering



___
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development


Re: [Development] Importing a module build in creator

2022-01-10 Thread Thiago Macieira
On Monday, 10 January 2022 00:10:54 PST Eike Ziller wrote:
> 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.

Unless you're developing QtCore, in which case changing QtCore sources often 
involve rebuilding the bootstrap lib, the tools, and everything that those 
tools generate. For those working on QtCore, I recommend:

  -DQT_FORCE_FIND_TOOLS=ON
  -DQT_HOST_PATH=$HOME/path/to/another/qt/build

This saved me a lot of trouble during the vacations, as it is far easier to 
debug QString issues with its unit test than figuring out how moc broke.

The only problem is if you do the above, then you don't have qmake and you 
can't build qmake-based projects against your Qt build. You can get away with 
using the other build's qmake and then changing LD_LIBRARY_PATH to point to 
your Qt.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel DPG Cloud Engineering



___
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development


Re: [Development] Importing a module build in creator

2022-01-10 Thread Eike Ziller
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 
"/qtbase/bin/qt-cmake-private -S  -B 
” 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  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@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.zil...@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


___
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development


Re: [Development] Importing a module build in creator

2022-01-09 Thread Arno Rehn

On 09.01.22 12:47, Konstantin Shegunov wrote:
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)?


I don't think that this is possible with CMake.

I've been working around that by (re-)building only the module I'm 
working on with qtbase/bin/qt-configure-module in a seperate directory. 
That single-module build can then be imported just fine.


I've found that importing the full Qt6 build tree isn't so bad, either. 
Incremental builds with ninja are very fast.
Downsides are that initially, parsing all of the source files can take a 
while. Also, I'm skipping building the tests by default and would like 
to build only a subset (the ones of the module I'm working on). 
QtCreator doesn't seem to support EXCLUDE_FROM_ALL tests at all, so I 
usually have to resort to the command line for that.


Regards,
Arno

--
Arno Rehn
Tel +49 89 189 166 0
Fax +49 89 189 166 111
a.r...@menlosystems.com
www.menlosystems.com

Menlo Systems GmbH
Bunsenstrasse 5, D-82152 Martinsried, Germany
Amtsgericht München HRB 138145
Geschäftsführung: Dr. Michael Mei, Dr. Ronald Holzwarth
USt.-IdNr. DE217772017, St.-Nr. 14316170324
___
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development


[Development] Importing a module build in creator

2022-01-09 Thread Konstantin Shegunov
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@qt-project.org
https://lists.qt-project.org/listinfo/development