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. How to add a step of compilation of a .bat file
QtWS25 Last Chance

How to add a step of compilation of a .bat file

Scheduled Pinned Locked Moved Solved General and Desktop
compilation
6 Posts 3 Posters 2.5k 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.
  • C Offline
    C Offline
    cdcc0606
    wrote on last edited by cdcc0606
    #1

    I have my application done by qt. Now i want Qt start a .bat file each time i compile my project.
    However, i can't see my bat file is started. Can i have an option to be sure my .bat file is started each time of compilation?

    K Gojir4G 2 Replies Last reply
    0
    • C cdcc0606

      I have my application done by qt. Now i want Qt start a .bat file each time i compile my project.
      However, i can't see my bat file is started. Can i have an option to be sure my .bat file is started each time of compilation?

      K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      @cdcc0606

      How do you intend to start the .bat file?

      You need to give some details. Otherwise it is really hard to guess what are you trying to do.

      Vote the answer(s) that helped you to solve your issue(s)

      C 1 Reply Last reply
      2
      • C cdcc0606

        I have my application done by qt. Now i want Qt start a .bat file each time i compile my project.
        However, i can't see my bat file is started. Can i have an option to be sure my .bat file is started each time of compilation?

        Gojir4G Offline
        Gojir4G Offline
        Gojir4
        wrote on last edited by
        #3

        @cdcc0606 Hi,

        You can run a batch command before of after the link during compilation.
        Something like that :

        .pro file:

        QMAKE_PRE_LINK = CMD /c CALL "C:\path\to\my\batch.cmd"
        

        batch.cmd:

        ping 127.0.0.1
        

        Compilation output:

        C:\path\to\my\project\build_folder>ping 127.0.0.1 
        
        Pinging 127.0.0.1 with 32 bytes of data:
        Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
        Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
        Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
        Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
        
        Ping statistics for 127.0.0.1:
            Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
        Approximate round trip times in milli-seconds:
            Minimum = 0ms, Maximum = 0ms, Average = 0ms
        
        1 Reply Last reply
        6
        • K koahnig

          @cdcc0606

          How do you intend to start the .bat file?

          You need to give some details. Otherwise it is really hard to guess what are you trying to do.

          C Offline
          C Offline
          cdcc0606
          wrote on last edited by
          #4

          @koahnig
          I start my .bat file by add a step in compilation.
          Here is the photo how i do it
          0_1538128975718_Compilation step.png
          So to make sure my .bat file is started, i add an Pause in my .bat file. So my compilation is never end. So now i'm sure i started my .bat file. But if i delete my Pause in my .bat file. I'm not sure my .bat file is started.
          Is there an option to add to show the terminal when the .bat file is started?

          K 1 Reply Last reply
          1
          • C cdcc0606

            @koahnig
            I start my .bat file by add a step in compilation.
            Here is the photo how i do it
            0_1538128975718_Compilation step.png
            So to make sure my .bat file is started, i add an Pause in my .bat file. So my compilation is never end. So now i'm sure i started my .bat file. But if i delete my Pause in my .bat file. I'm not sure my .bat file is started.
            Is there an option to add to show the terminal when the .bat file is started?

            K Offline
            K Offline
            koahnig
            wrote on last edited by
            #5

            @cdcc0606

            Goto the buttom line of creator:
            0_1538130585447_4b2f5ba5-e874-41e4-9740-44694172e262-image.png
            Press the the upper/lower triangle button marked above and switch on number 4 (in English Compilation Output").
            This window is showing the output of your batch file. See also the post of @Gojir4 also refering to this output window.

            I have just tested and introduced a batch in same location as you have done. The output is done to the compile window. See also the options provided by @Gojir4 which performed eventually when previous commands are performed successfully.

            Vote the answer(s) that helped you to solve your issue(s)

            C 1 Reply Last reply
            4
            • K koahnig

              @cdcc0606

              Goto the buttom line of creator:
              0_1538130585447_4b2f5ba5-e874-41e4-9740-44694172e262-image.png
              Press the the upper/lower triangle button marked above and switch on number 4 (in English Compilation Output").
              This window is showing the output of your batch file. See also the post of @Gojir4 also refering to this output window.

              I have just tested and introduced a batch in same location as you have done. The output is done to the compile window. See also the options provided by @Gojir4 which performed eventually when previous commands are performed successfully.

              C Offline
              C Offline
              cdcc0606
              wrote on last edited by
              #6

              @koahnig
              Thanks so much

              1 Reply Last reply
              0

              • Login

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