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
Forum Updated to NodeBB v4.3 + New Features

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 1 Watching
  • 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 27 Sept 2018, 13:06 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 G 2 Replies Last reply 27 Sept 2018, 13:45
    0
    • C cdcc0606
      27 Sept 2018, 13:06

      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 27 Sept 2018, 13:45 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 28 Sept 2018, 10:05
      2
      • C cdcc0606
        27 Sept 2018, 13:06

        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?

        G Offline
        G Offline
        Gojir4
        wrote on 27 Sept 2018, 14:10 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
          27 Sept 2018, 13:45

          @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 28 Sept 2018, 10:05 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 28 Sept 2018, 10:35
          1
          • C cdcc0606
            28 Sept 2018, 10:05

            @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 28 Sept 2018, 10:35 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 28 Sept 2018, 11:42
            4
            • K koahnig
              28 Sept 2018, 10:35

              @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 28 Sept 2018, 11:42 last edited by
              #6

              @koahnig
              Thanks so much

              1 Reply Last reply
              0

              6/6

              28 Sept 2018, 11:42

              • Login

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