Qt app build from cmd-line as a .bat file
-
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.
So when I run this in cmd, it's as below stops after qtenv2.bat
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.
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.
-
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 throughcall
command:call vcvars64.bat
Perhaps the same applies to
qtenv2.bat
, if you really want to use it.