How to build a qt project from command line?

Viewed 3877

I've seen similar questions, but they all address slightly different situations than my own.

I have the source code for a qt project on a github repo, including the .pro file. Basically, I want to know if it's possible for someone on a Windows machine to clone the repo and build the executable from the source code without downloading and configuring Qt Creator. If it is possible, what prerequisites need to be met, and what steps need to be taken in order to build the project? The project uses qmake and not cmake, which probably affects the answer.

1 Answers

Install Qt. Download and install Git for Windows. In Git Bash, go to a folder you want to use for a project. Execute the command git clone. Run Start -> Qt<version> -> Qt Command Prompt. CD to this directory and execute:

qmake <your_project.pro>
mingw32-make

or if you are using MSVC, commands should be

"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
qmake <your_project.pro>
nmake
Related