qmake

from Wikipedia, the free encyclopedia

qmake (a successor to tmake ) is a generator for Makefiles . It is part of Qt - library of the company Qt Development Frameworks . On the basis of a configuration description qmake creates a Makefile, with the help of which one is able to translate a collection of source texts for a program or a library. Although it was specially developed to work with Qt, it can also be used with software that is independent of Qt.

use

Since Makefiles look different depending on the compiler and platform, cross-platform development is hardly possible. This is where the qmake concept comes into play. It requires a very simply structured project file with the file extension .pro. A Makefile can now be created on all platforms supported by qmake, which can be used on the respective system, whereby it can also deal with Qt-specific extensions.

Working method

A project file for qmake initially includes a description of whether the current project is a program or a library. Different configurations can also be specified. This qmakeenables you to generate a Makefile that correctly integrates the required libraries. The programmer is also able to create debug or release versions of his program.

Finally, the programmer has to specify all source code files that belong to his program. A categorization of the files is necessary. As usual in C ++ , this is done in header and source code files. In addition, it is also possible to specify resource files that contain images, dialog definitions or other data belonging to the program. In addition to the build process, the installation can also be described in a .pro file.

As a result, after a successful qmake run, the programmer will find a Makefile with which the desired program can be generated. All dependencies are observed and further rules are defined in the Makefile with which the compiler outputs can be deleted again. The Makefile can also contain rules for installing the generated program.

It can also project files for Microsoft - IDEs create and macOS a project file for automatically Apple's IDE Xcode generated instead of makefiles.

example

 # beispiel.pro
 TEMPLATE   = app
 HEADERS   += mainwindow.h
 SOURCES   += mainwindow.cpp main.cpp
 RESOURCES += mainwindow.qrc

After executing the command qmake beispiel.prothere is now a complete but platform-specific Makefile , which can be executed with make or one of its derivatives.

See also

Web links

Individual evidence

  1. Make alternatives ( Memento of the original from May 13, 2008 in the Internet Archive ) Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice. Qmake had a predecessor, tmake, implemented in Perl @1@ 2Template: Webachiv / IABot / freshmeat.net