C++ GUI Programming with Qt4: Building Qt Applications
- Building Qt Applications
- Using qmake
- Using Third-Party Build Tools
B. Building Qt Applications
- Using qmake
- Using Third-Party Build Tools
Building Qt applications is greatly simplified by the use of a build tool. Three options are open to us: We can use the qmake tool supplied with Qt, we can use a third-party build tool, or we can use an integrated development environment (IDE).
The qmake tool generates a platform-specific makefile from a platform-neutral .pro file. The tool has the necessary logic to invoke Qt's code-generating tools (moc, uic, and rcc) built-in. We have used qmake for all the examples in the book, in most cases using relatively simple .pro files. In fact, qmake provides a rich range of features including the ability to create makefiles that recursively invoke other makefiles and to switch certain features on or off depending on the target platform. In the first section of this appendix, we will review qmake and introduce some of its more advanced features.
In theory, any third-party build tool can be used for Qt development, but it is much easier to use one that is already Qt-aware. We will look at some of the Qt-aware build tools in the second section.
Some developers would rather use an IDE to build their applications. Trolltech provides software to integrate with Visual Studio and Eclipse (shown in Figure B.1), and the open source IDEs KDevelop and QDevelop—both written using Qt—provide excellent support for Qt development.
Figure B.1 The Qt Visual Studio and Eclipse integrations in action