qmake

Qmake ( a successor of tmake ) is a generator for makefiles. It is part of the Qt library Qt Development Frameworks of the company. qmake created starting from a configuration description Makefile, by which one is able to, a collection of source code to a program or library to translate. Although it has been developed specifically for working with Qt, a use for independent Qt software is possible.

Use

Since Makefiles depending on compiler and platform look different, a cross-platform development is hardly possible. This is where the concept of qmake. It requires a very simple construction project file that has the file extension. Pro. On all supported platforms qmake generating a Makefile is now possible, which can be used on the particular system, it can also handle Qt -specific extensions.

Operation

A project file for qmake first includes a description, whether it is a program or a library in the current project. Furthermore, different configurations can be provided. This is qmake is able to generate a Makefile, which integrates the required libraries correctly. Similarly, the programmer is able to generate or release debug versions of his program.

Finally, the programmer must still specify all source files that belong to his program. This categorization of files is necessary. This is done, as in C standard, in header and source files. In addition, the specified resource files is possible that contain images, dialog definitions or other data pertaining to the program. In addition to the build process, in a. Pro ​​file also the installation are described.

As a result, the programmer finds after a successful run of qmake before a Makefile, and the channel can be generated with the help of which. Both all dependencies are noted, as well as other rules defined in the Makefile, with which the outputs of the compiler can be deleted again. Also, the makefile rules for installing the program generated can contain.

It can also project files for Microsoft IDEs and build on MacOS X a project file for Apple's Xcode IDE instead of makefiles is generated automatically.

Example

# beispiel.pro TEMPLATE = app HEADERS = mainwindow.h SOURCES = main.cpp mainwindow.cpp RESOURCES = mainwindow.qrc After running the command qmake beispiel.pro now exists a complete but platform-specific Makefile that can be run with make or one of its derivatives.