Re: [Interest] Three-file modules vs. moc

2020-09-02 Thread Bernhard Lindner
> If you turn automoc on, it tries to guess which moc files need to be > generated > and which ones are #included by way of regular expressions too. If you don't > like that, don't use automoc. Ok, I see, thanks. If cmake/automoc uses the same basic search and if there is no interest/plans in

Re: [Interest] Three-file modules vs. moc

2020-09-01 Thread Thiago Macieira
On Tuesday, 1 September 2020 14:17:50 PDT Bernhard Lindner wrote: > Anyway, how does cmake behave regarding the described moc target detection > problem? Does it work smarter than qmake? If you turn automoc on, it tries to guess which moc files need to be generated and which ones are #included by

Re: [Interest] Three-file modules vs. moc

2020-09-01 Thread Bernhard Lindner
Hi Thiago! > > Well, what about coming cmake in Qt6? I assume Qt Creator will support cmake > > based projects for application developers. Do you see a chance to fix the > > problem using the new tool set? > > Qt Creator has supported CMake for 10 years or more. Building Qt applications > with C

Re: [Interest] Three-file modules vs. moc

2020-09-01 Thread Thiago Macieira
On Tuesday, 1 September 2020 12:29:29 PDT Bernhard Lindner wrote: > Well, what about coming cmake in Qt6? I assume Qt Creator will support cmake > based projects for application developers. Do you see a chance to fix the > problem using the new tool set? Qt Creator has supported CMake for 10 years

Re: [Interest] Three-file modules vs. moc

2020-09-01 Thread Bernhard Lindner
Hi Thiago! > Correct, qmake does not preprocess, but it does try to guess what your > dependencies are. This is not restricted to moc outputs: any #include found > that match a source file is automatically removed from the list of targets to > build too. Oh my! :-( > A more correct way to do

Re: [Interest] Three-file modules vs. moc

2020-09-01 Thread Thiago Macieira
On Monday, 31 August 2020 09:31:17 PDT Bernhard Lindner wrote: > It appears to me that qmake is looking for "#include "moc_module.cpp"" using > some simple regular expression which does not take any conditional > compilation into account. Is this correct? Correct, qmake does not preprocess, but it

Re: [Interest] Three-file modules vs. moc

2020-09-01 Thread Bernhard Lindner
Hi! > Add to your module.cpp: > > #include "moc_module.cpp" > > This is recommended anyway, regardless of your problem. Always #include the > module output for your headers in your corresponding .cpp files. I tried a variant of the above using C++17 __has_include: #if __has_include("moc_mo

Re: [Interest] Three-file modules vs. moc

2020-08-27 Thread Giuseppe D'Angelo via Interest
Il 27/08/20 20:46, Bernhard Lindner ha scritto: This is recommended anyway, regardless of your problem. Always #include the module output for your headers in your corresponding .cpp files. Can you explain that general recommendation? It seems to me that such includes are only useful in special

Re: [Interest] Three-file modules vs. moc

2020-08-27 Thread Bernhard Lindner
Hi Thiago! > Add to your module.cpp: > > #include "moc_module.cpp" Works well, thank you! > This is recommended anyway, regardless of your problem. Always #include the > module output for your headers in your corresponding .cpp files. Can you explain that general recommendation? It seems to m

Re: [Interest] Three-file modules vs. moc

2020-08-27 Thread Thiago Macieira
On Wednesday, 26 August 2020 12:40:31 PDT Bernhard Lindner wrote: > Hi! > > Currently I am facing a problem with a Qt Creator managed Qt 5 project. > > The projects consists of a lot of modules and implements a special but > useful file concept. Each module has 3 files: >module.hpp - Public t

Re: [Interest] Three-file modules vs. moc

2020-08-27 Thread Bernhard Lindner
Hi! > I wonder how clients of the class declared in the .hpp file can use that > class at all. > Unless I am missing something, they won’t be able to (at least not in the > general case) > unless they also include the .inl file. Depends from what part of the module API you want to use. E.g. if

Re: [Interest] Three-file modules vs. moc

2020-08-27 Thread Adam Light
On Thu, Aug 27, 2020 at 5:43 AM Bernhard Lindner < priv...@bernhard-lindner.de> wrote: > > You might also use a custom extra compiler -- that still invokes moc, > > but for each foo.h also tells moc to include foo.inl, bar.h -> bar.inl, > > and so on... > > Hm, I see. Has something like that been

Re: [Interest] Three-file modules vs. moc

2020-08-27 Thread Tony Rietwyk
Hi Bernhard, I use plain .pro and .pri files with qmake to Visual Studio projects.  Moc has a feature that prevents the output files being treated as separate compiles - if it finds the include in the relevant module .cpp.  It works really well for us with thousands of modules.  I not sure ho

Re: [Interest] Three-file modules vs. moc

2020-08-27 Thread Volker Hilsheimer
> On 27 Aug 2020, at 14:42, Bernhard Lindner > wrote: > > Hi! > >> Can you make an example of your structure (what's exactly in each of the >> three files)? It's not entirely clear. > > Ok, I attached an example of a module containing some pseudo code. Please > tell me if you > need more inf

Re: [Interest] Three-file modules vs. moc

2020-08-27 Thread Bernhard Lindner
Hi! > Can you make an example of your structure (what's exactly in each of the > three files)? It's not entirely clear. Ok, I attached an example of a module containing some pseudo code. Please tell me if you need more information. > You might also use a custom extra compiler -- that still inv

Re: [Interest] Three-file modules vs. moc

2020-08-27 Thread Giuseppe D'Angelo via Interest
Hi, Can you make an example of your structure (what's exactly in each of the three files)? It's not entirely clear. Il 27/08/20 13:26, Bernhard Lindner ha scritto: Hm. I am not sure I get it. That is a global option, right? I have a LOT of modules, each with a different name. When adding an

Re: [Interest] Three-file modules vs. moc

2020-08-27 Thread Bernhard Lindner
Hi! > > I added all .hpp file names to the .pro file using Qt Creator. All moc > > relevant > > .hpp files are parsed fine by moc and a moc_module.cpp file is generated for > > each module as usual. > > Have you tried adding the .inl files to HEADERS instead? Yes. But it didn't work. Even more

Re: [Interest] Three-file modules vs. moc

2020-08-26 Thread Kai Köhne
> -Ursprüngliche Nachricht- > Von: Interest Im Auftrag von Bernhard > Lindner > Gesendet: Mittwoch, 26. August 2020 21:41 > An: interest@qt-project.org > Betreff: [Interest] Three-file modules vs. moc > > Hi! > > Currently I am facing a problem with a Qt Creator managed Qt 5 project. >