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 app build from cmd-line as a .bat file
Forum Updated to NodeBB v4.3 + New Features

Qt app build from cmd-line as a .bat file

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 624 Views 2 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.
  • S Offline
    S Offline
    sayan275
    wrote on 16 Sept 2021, 03:14 last edited by
    #1

    Hello,

    Am trying to automate a build process of an Qt app from a .bat file.

    Am able to build a Qt app from cmd-line by entering each cmd one-by-one. Like qtenv2.bat, then vcvars64.bat, and then qmake. [https://forum.qt.io/topic/129987/qt-app-build-from-command-line].
    But when I put those cmd in a .bat file and try to execute the bat in cmd, strange is happening, ie, after qtenv2.bat runs, it doesn't proceed to the next cmd for vcvar64.bat, it quits the execution. The autoBuild.bat file is as below.

    3c6baff5-724a-4ce3-81b2-2dd9bbd90a26-image.png
    So when I run this in cmd, it's as below stops after qtenv2.bat

    ad930776-f807-4358-9983-9b3774024ba5-image.png
    I want it to continue with the next cmds in the same console(it's a necessity for the build process) as below, where I run each cmds step-by-step. And the same is required from the .bat file.

    20cc73e0-24f7-4e02-8936-6c4628b62355-image.png
    I tried the following .... start "qtenv2" /min cmd /k call qtenv2.bat......but it started the process in a separate console, which I don't want.

    Any suggestion, how to write the .bat file, so that qtenv2.bat runs and then vcvars.bat also runs in the same console with stopping the execution.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 16 Sept 2021, 04:39 last edited by
      #2

      You don't need qtenv2.bat at all, just add Qt to $PATH, that's enough:

      set PATH=%QT_PATH%\bin;%PATH%
      

      Then proceed with vcvars64.bat - but you should call it through call command:

      call vcvars64.bat
      

      Perhaps the same applies to qtenv2.bat, if you really want to use it.

      (Z(:^

      S 1 Reply Last reply 16 Sept 2021, 05:11
      3
      • S sierdzio
        16 Sept 2021, 04:39

        You don't need qtenv2.bat at all, just add Qt to $PATH, that's enough:

        set PATH=%QT_PATH%\bin;%PATH%
        

        Then proceed with vcvars64.bat - but you should call it through call command:

        call vcvars64.bat
        

        Perhaps the same applies to qtenv2.bat, if you really want to use it.

        S Offline
        S Offline
        sayan275
        wrote on 16 Sept 2021, 05:11 last edited by
        #3

        @sierdzio Thanks for the quick answer!!!

        1 Reply Last reply
        0

        1/3

        16 Sept 2021, 03:14

        • Login

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