Qt-Creator: output messages on a per-file-compile basis?
fyngyrz last edited by fyngyrz
Qt 5.8.0, Qt Creator 4.2.2, OSX 10.12.6, CLang
When Qt builds my project, it dutifully dumps all the compile invocation information to the
4 Compile Outputpane. This is a lot of text, and it scrolls by pretty fast, sometimes so fast I can't keep track of which file it is building, or has built, particularly in larger project builds.
6 General Messagespane that receives messages as set up in the project's
project.profile. For instance, putting the following command at the end of the
.profile results in an immediate dump to the
6 General Messagespane as soon as the
.profile is processed...
message(This is a test)
...so what I'd like to do, if possible, is modify the built in compiler variable to output a message to the
6 General Messageswindow as each individual file is compiled. I imagine it might go something like this...
CC += message($$FILENAME)
FILENAMEis a placeholder for the actual variable name for the file being passed to the compiler to build. I have no idea exactly what the syntax or variable names might actually be, presuming this is possible at all.
If I could get this going, I'd like to number the compiled filename lines as they come out, so that (for instance) if I have 100 files in a project, I can get some idea of how long I have yet to wait. So, for instance, I can go feed my coffee Jones... or not. :)
Another possibility would be some means to get the
4 Compile Outputpane to be considerably less verbose — just outputting the compiled filenames as it goes. However, inasmuch as I might want all that information too (rare, but it happens), this is a less desirable method.
Any insight regarding this objective is most welcome.
I think the easiest way to achive this would be switching to CMake build system. It outputs a % during compile, IIRC.
Every compile output goes to pane 4. What you see in pane 6 is the debug output when Creator parses the pro file, not during compile.
Creator 4.10 introduced some filtering for the panes, but I'm not sure that will help you.
fyngyrz last edited by
@aha_1980 Thanks for the information on
Creator 4.10; but you're right, that doesn't apply here.
switching to CMake
I'm extremely leery of changing the actual components in the build chain; these are very large builds and my experience with compatibility when changing actual Qt build components has been poor — to understate the case.
Perhaps I could change the existing compiler variable to call something else, which would in turn message Creator via its STDOUT channel (I presume that's how Qt Creator is catching the output from the compiler), then call the compiler with its parameters? That would only work if Creator is doing more than just echoing the compiler's output to the pane, though. Seems like it might be, as it does syntax color errors at least and dump them into the compile and build panes.
It just seems... unlikely... that there's no way at all to accomplish this. But perhaps I over-estimate this version of Creator because of how well it does everything else. :)
Perhaps I could change the existing compiler variable to call something else, which would in turn message Creator via its STDOUT channel (I presume that's how Qt Creator is catching the output from the compiler), then call the compiler with its parameters?
I thought about that too, and it could work out, however, most of the output you see is the commandline that calls the compiler, so I'm not sure if that helps.
A quick search gave me https://stackoverflow.com/questions/1491671/how-to-format-change-qmake-build-output which mentions the Qmake directive
CONFIG += silent, which indeed removes most of the compile output.
Just be warned that this will break error parsing, as the output does not conform to Creators expectation. And still you don't get a percentage output (which is QTBUG-70131 btw.) but I have little hope for change here, as Qt itself is moving to CMake.
fyngyrz last edited by
that this will break error parsing
Errors??? I don't make errors!
Yeah, that'd be a real problem. Hm. Well, perhaps it's just impractical on every level with the versions I am using.
I really appreciate your taking the time to respond. Cheers!