[Qt-creator] Creator doesn't shadow build (Core.json vs moc)

Lincoln Ramsay lincoln.ramsay at nokia.com
Fri Jul 13 03:51:52 CEST 2012

On 07/12/2012 11:28 PM, ext Oswald Buddenhagen wrote:
> On Thu, Jul 12, 2012 at 02:36:54PM +0200, ext Daniel Teske wrote:
>> On Wednesday 11 Jul 2012 03:44:22 ext Lincoln Ramsay wrote:
>>> Should moc look for .json files in $$OUT_PWD or should creator force the
>>> .json files to be created in the correct directory.
>> Good question. From a Creator standpoint, geenrating anything in the source
>> directory for a shadow build is not ideal, but if moc expects it there, then
>> so be it for now.
> it's not not ideal, but a total no-go. apart from theoretical exercises
> like a shared read-only source tree, there are also cases like multiple
> shadow builds of one source tree.

Ok. To be honest, I don't understand why Creator is generating these 
.json files at all. I'm guessing the contents are effectively static.

> moc needs an option to add a search path for these files. in fact, maybe
> just the include path could be used. isn't this the case already?

I guess if moc did look at INCLUDEPATH it wouldn't have failed to build. 
I tried explicitly doing INCLUDEPATH += $$OUT_PWD but even then, moc 
failed to find the .json file so I guess it only looks relative to the 
file with Q_PLUGIN_INFO.

Here's what I did to get it building (creating files in the source 
tree). Feel free to kill it in preference to a a better way (even if 
that's just checking all the .json files into the repo).


Lincoln Ramsay - Senior Software Engineer
Qt Development Frameworks, Nokia - http://qt.nokia.com/

More information about the Qt-creator mailing list