PDA

View Full Version : Running QT from the command line - qmake to run



Swankee
27th May 2010, 18:09
I'm putting together an install manual for our teams project. While it's not a big deal for us to open QT, run qmake and build the project we're trying to automate that for the end user.

One of the steps is just that; to build a project in QT and retreive the .dll that is generated and deposit into our main projects lib folder.

My intent would be to automate the entire process of opening QT, running qmake and building (I'm curious to do RUN too).

Right now I have a bat file that runs qmake command line and then launches QT. Can I 'remote control drive' QT still from the command line completely. Best would be to build the project through these steps without ever opening the environment. Is that possible?

To finish my bat file would end by copying that generated file and moving it into my main projects lib file. Hands off for the user from start to finish. thanks!

tbscope
27th May 2010, 18:45
You're using a computer, so any automation goes, it only depends how.

To be more specific, what do you want to control?
You can add a lot of system checks in your .pro files.

ChrisW67
28th May 2010, 09:16
By "launches QT" are we to assume that you mean "launch Qt Creator"? In that case, why do you need to involve Qt Creator at all? Simple Windows command file:


@echo OFF
CALL C:\Qt\2010.02.1\bin\qtenv.bat
CD /D D:\path\to\MyProject\
qmake
mingw32-make
COPY MyProject.DLL Q:\path\to\deployed\location\

REM commands to execute the deployed application or unit tests

Path adjustments, error trapping etc. are left as an exercise.