Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt-Creator: output messages on a per-file-compile basis?
Forum Updated to NodeBB v4.3 + New Features

Qt-Creator: output messages on a per-file-compile basis?

Scheduled Pinned Locked Moved Unsolved General and Desktop
qt creator 4.2qt 5.8osx 10.12.6
5 Posts 2 Posters 1.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    fyngyrz
    wrote on last edited by fyngyrz
    #1

    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 Output pane. 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.

    There's a 6 General Messages pane that receives messages as set up in the project's project.pro file. For instance, putting the following command at the end of the .pro file results in an immediate dump to the 6 General Messages pane as soon as the .pro file 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 Messages window as each individual file is compiled. I imagine it might go something like this...

    CC += message($$FILENAME)

    ... where FILENAME is 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 Output pane 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.

    aha_1980A 1 Reply Last reply
    0
    • F 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 Output pane. 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.

      There's a 6 General Messages pane that receives messages as set up in the project's project.pro file. For instance, putting the following command at the end of the .pro file results in an immediate dump to the 6 General Messages pane as soon as the .pro file 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 Messages window as each individual file is compiled. I imagine it might go something like this...

      CC += message($$FILENAME)

      ... where FILENAME is 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 Output pane 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.

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi @fyngyrz,

      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.

      Regards

      Qt has to stay free or it will die.

      F 1 Reply Last reply
      1
      • aha_1980A aha_1980

        Hi @fyngyrz,

        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.

        Regards

        F Offline
        F Offline
        fyngyrz
        wrote on last edited by
        #3

        @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. :)

        aha_1980A 1 Reply Last reply
        0
        • F fyngyrz

          @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. :)

          aha_1980A Offline
          aha_1980A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi @fyngyrz,

          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.

          Regards

          Qt has to stay free or it will die.

          F 1 Reply Last reply
          1
          • aha_1980A aha_1980

            Hi @fyngyrz,

            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.

            Regards

            F Offline
            F Offline
            fyngyrz
            wrote on last edited by
            #5

            @aha_1980 said in Qt-Creator: output messages on a per-file-compile basis?:

            that this will break error parsing

            Errors??? I don't make errors!

            lol

            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!

            1 Reply Last reply
            1

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved