qmake
Generate build files for Qt projects
TLDR
Generate Makefile from .pro file
SYNOPSIS
qmake [-o makefile] [-spec spec] [CONFIG+=options] [options] [project.pro]
DESCRIPTION
qmake generates build system files for Qt projects. It reads .pro project files and produces Makefiles or IDE project files.
Project files (.pro) declare sources, headers, libraries, and build options. The qmake syntax is declarative, simpler than hand-written Makefiles.
Configuration options control build type, features, and platform specifics. Debug and release builds use different compiler flags.
Platform specifications target different build systems. Each platform has makespec files defining compiler, linker, and platform settings.
IDE integration generates native project files. Xcode projects on macOS, Visual Studio solutions on Windows.
Qt modules are linked using QT variable. Network, SQL, widgets, and other modules are added as needed.
PARAMETERS
-o FILE
Output file name.-spec SPEC
Platform specification.-makefile
Generate Makefile (default).-project
Generate .pro file.-tp TYPE
Target project type.-query [VAR]
Query Qt configuration.CONFIG+=VALUE
Add configuration option.-r, --recursive
Process subdirectories.-d
Debug mode.-v
Version information.
CAVEATS
Being replaced by CMake for new Qt6 projects. Shadow builds recommended for clean source trees. Some features are platform-specific.
HISTORY
qmake has been Qt's build system since the early 1990s, developed by Trolltech (now The Qt Company). While CMake became the primary build system for Qt 6, qmake remains supported and widely used.
