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

Lincoln Ramsay lincoln.ramsay at nokia.com
Wed Jul 11 03:44:22 CEST 2012


On 07/10/2012 06:31 PM, ext Oswald Buddenhagen wrote:
> you take creator master from today and compile it yourself ...

Creator generates a Core.json file but it puts this into $$OUT_PWD. moc 
does not look for .json files in $$OUT_PWD, only $$PWD so this breaks 
the build.

Should moc look for .json files in $$OUT_PWD or should creator force the 
.json files to be created in the correct directory.

My quick fix is this:
--- a/src/qtcreatorplugin.pri
+++ b/src/qtcreatorplugin.pri
@@ -66,7 +66,7 @@ greaterThan(QT_MAJOR_VERSION, 4) {
      pluginspec2json.name = Create Qt 5 plugin json file
      pluginspec2json.input = PLUGINSPEC
      pluginspec2json.variable_out = GENERATED_FILES
-    pluginspec2json.output = $${TARGET}.json
+    pluginspec2json.output = $$_PRO_FILE_PWD_/$${TARGET}.json
      pluginspec2json.commands = $$XMLPATTERNS -no-format -output 
$$pluginspec2json.output $$PWD/pluginjsonmetadata.xsl $$PLUGINSPEC
      pluginspec2json.CONFIG += no_link
      moc_header.depends += $$pluginspec2json.output


However, both the original code and this code are still wrong because a 
source file may not be located in the same directory as the .pro file. 
The output for the .json should be related to the directory of the input 
file in some way.


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





More information about the Qt-creator mailing list