qmake Variable Reference |
Option | Description |
---|---|
release | The project is to be built in release mode. This is ignored if debug is also specified. |
debug | The project is to be built in debug mode. |
debug_and_release | The project is built in both debug and release modes. This can have some unexpected side effects (see below for more information). |
build_all | If debug_and_release is specified, the project is built in both debug and release modes by default. |
ordered | When using the subdirs template, this option specifies that the directories listed should be processed in the order in which they are given. |
precompile_header | Enables support for the use of precompiled headers in projects. |
warn_on | The compiler should output as many warnings as possible. This is ignored if warn_off is specified. |
warn_off | The compiler should output as few warnings as possible. |
Since the debug option overrides the release option when both are defined in the CONFIG variable, it is necessary to use the debug_and_release option if you want to allow both debug and release versions of a project to be built. In such a case, the Makefile that qmake generates includes a rule that builds both versions, and this can be invoked in the following way:
make all
When linking a library, qmake relies on the underlying platform to know what other libraries this library links against. However, if linking statically, qmake will not get this information unless we use the following CONFIG options:
Option | Description |
---|---|
create_prl | This option enables qmake to track these dependencies. When this option is enabled, qmake will create a file ending in .prl which will save meta-information about the library (see Library Dependencies for more info). |
link_prl | When this is enabled, qmake will process all libraries linked to by the application and find their meta-information (see Library Dependencies for more info). |
Please note that create_prl is required when
{building} a static library, while link_prl is required when
{using} a static library.
On Windows (or if Qt is configured with -debug_and_release, adding the build_all option to the CONFIG variable makes this rule the default when building the project, and installation targets will be created for both debug and release builds.
Additionally, adding debug_and_release to the CONFIG variable will cause both debug and release to be defined in the contents of CONFIG. When the project file is processed, the scopes that test for each value will be processed for both debug and release modes. The build_pass variable will be set for each of these mode, and you can test for this to perform build-specific tasks. For example:
build_pass:CONFIG(debug, debug|release) { unix: TARGET = $$join(TARGET,,,_debug) else: TARGET = $$join(TARGET,,,d) }
As a result, it may be useful to define mode-specific variables, such as QMAKE_LFLAGS_RELEASE, instead of general variables, such as QMAKE_LFLAGS, where possible.
The following options define the application/library type:
Option | Description |
---|---|
qt | The target is a Qt application/library and requires the Qt library and header files. The proper include and library paths for the Qt library will automatically be added to the project. This is defined by default, and can be fine-tuned with the \l{#qt}{QT} variable. |
thread | The target is a multi-threaded application or library. The proper defines and compiler flags will automatically be added to the project. |
x11 | The target is a X11 application or library. The proper include paths and libraries will automatically be added to the project. |
windows | The target is a Win32 window application (app only). The proper include paths, compiler flags and libraries will automatically be added to the project. |
console | The target is a Win32 console application (app only). The proper include paths, compiler flags and libraries will automatically be added to the project. |
shared | The target is a shared object/DLL. The proper include paths, compiler flags and libraries will automatically be added to the project. |
dll | |
dylib | |
static | The target is a static library (lib only). The proper compiler flags will automatically be added to the project. |
staticlib | |
plugin | The target is a plugin (lib only). This enables dll as well. |
designer | The target is a plugin for Qt Designer. |
uic3 | Configures qmake to run uic3 on the content of FORMS3 if defined; otherwise the contents of FORMS will be processed instead. |
no_lflags_merge | Ensures that the list of libraries stored in the LIBS variable is not reduced to a list of unique values before it is used. |
resources | Configures qmake to run rcc on the content of RESOURCES if defined. |
These options are used to set the compiler flags:
Option | Description |
---|---|
3dnow | AMD 3DNow! instruction support is enabled. |
exceptions | Exception support is enabled. |
mmx | Intel MMX instruction support is enabled. |
rtti | RTTI support is enabled. |
stl | STL support is enabled. |
sse | SSE support is enabled. |
sse2 | SSE2 support is enabled. |
These options define specific features on Windows only:
Option | Description |
---|---|
flat | When using the vcapp template this will put all the source files into the source group and the header files into the header group regardless of what directory they reside in. Turning this option off will group the files within the source/header group depending on the directory they reside. This is turned on by default. |
embed_manifest_dll | Embeds a manifest file in the DLL created as part of a library project. |
embed_manifest_exe | Embeds a manifest file in the DLL created as part of an application project. |
incremental | Used to enable or disable incremental linking in Visual C++, depending on whether this feature is enabled or disabled by default. |
See qmake Platform Notes for more information on the options for embedding manifest files.
These options only have an effect on Mac OS X:
Option | Description |
---|---|
ppc | Builds a PowerPC binary. |
x86 | Builds an i386 compatible binary. |
app_bundle | Puts the executable into a bundle (this is the default). |
lib_bundle | Puts the library into a library bundle. |
The build process for bundles is also influenced by the contents of the QMAKE_BUNDLE_DATA variable.
These options have an effect on Linux/Unix platforms:
Option | Description |
---|---|
largefile | Includes support for large files. |
separate_debug_info | Puts debugging information for libraries in separate files. |
The CONFIG variable will also be checked when resolving scopes. You may assign anything to this variable.
For example:
CONFIG += qt console newstuff ... newstuff { SOURCES += new.cpp HEADERS += new.h }
qmake adds the values of this variable as compiler C preprocessor macros (-D option).
For example:
DEFINES += USE_MY_STUFF QT_DLL
This is only used on Windows when using the app template.
Specifies a .def file to be included in the project.
This variable contains the list of all directories to look in to resolve dependencies. This will be used when crawling through included files.
This is only used on Windows CE.
Specifies which additional files will be deployed. Deployment means the transfer of files from the development system to the target device or emulator.
Files can be deployed by either creating a Visual Studio project or using the cetest executable.
For example:
myFiles.sources = path\*.png DEPLOYMENT += myFiles
This will upload all PNG images in path to the same directory your build target will be deployed to.
The default deployment target path for Windows CE is %CSIDL_PROGRAM_FILES%\target, which usually gets expanded to \Program Files\target.
It is also possible to specify multiple sources to be deployed on target paths. In addition, different variables can be used for deployment to different directories.
For example:
myFiles.sources = path\file1.ext1 path2\file2.ext1 path3\* myFiles.path = \some\path\on\device someother.sources = C:\additional\files\* someother.path = \myFiles\path2 DEPLOYMENT += myFiles someother
Note: All linked Qt libraries will be deployed to the path specified by myFiles.path.
This is only used on Windows CE.
This variable specifies the Qt plugins that will be deployed. All plugins available in Qt can be explicitly deployed to the device. See Static Plugins for a complete list.
Note: No plugins will be deployed automatically. If the application depends on plugins, these plugins have to be specified manually.
For example:
DEPLOYMENT_PLUGIN += qjpeg
This will upload the jpeg imageformat plugin to the plugins directory on the Windows CE device.
Specifies where to put the target file.
For example:
DESTDIR = ../../lib
This variable is set internally by qmake, which is basically the DESTDIR variable with the TARGET variable appened at the end. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
Specifies where to copy the target dll.
This variable contains a list of files to be included in the dist target. This feature is supported by UnixMake specs only.
For example:
DISTFILES += ../program.txt
This variable is set internally by qmake, which specifies where the dsp template file for basing generated dsp files is stored. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable specifies the .ui files (see Qt Designer) to be processed through uic before compiling. All dependencies, headers and source files required to build these .ui files will automatically be added to the project.
For example:
FORMS = mydialog.ui \ mywidget.ui \ myconfig.ui
If FORMS3 is defined in your project, then this variable must contain forms for uic, and not uic3. If CONFIG contains uic3, and FORMS3 is not defined, the this variable must contain only uic3 type forms.
This variable specifies the old style .ui files to be processed through uic3 before compiling, when CONFIG contains uic3. All dependencies, headers and source files required to build these .ui files will automatically be added to the project.
For example:
FORMS3 = my_uic3_dialog.ui \ my_uic3_widget.ui \ my_uic3_config.ui
Specifies the GUID that is set inside a .vcproj file. The GUID is usually randomly determined. However, should you require a fixed GUID, it can be set using this variable.
This variable is specific to .vcproj files only; it is ignored otherwise.
Defines the header files for the project.
qmake will generate dependency information (unless -nodepend is specified on the command line) for the specified headers. qmake will also automatically detect if moc is required by the classes in these headers, and add the appropriate dependencies and files to the project for generating and linking the moc files.
For example:
HEADERS = myclass.h \ login.h \ mainwindow.h
See also SOURCES.
This variable specifies the #include directories which should be searched when compiling the project. Use ';' or a space as the directory separator.
For example:
INCLUDEPATH = c:/msdev/include d:/stl/include
This variable contains a list of resources that will be installed when make install or a similar installation procedure is executed. Each item in the list is typically defined with attributes that provide information about where it will be installed.
For example, the following target.path definition describes where the build target will be installed, and the INSTALLS assignment adds the build target to the list of existing resources to be installed:
target.path += $$[QT_INSTALL_PLUGINS]/imageformats INSTALLS += target
This variable contains a list of lex implementation files. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains the names of intermediate lex object files.The value of this variable is typically handled by qmake and rarely needs to be modified.
This variable contains a list of lex source files. All dependencies, headers and source files will automatically be added to the project for building these lex files.
For example:
LEXSOURCES = lexer.l
This variable contains a list of libraries to be linked into the project. You can use the Unix -l (library) and -L (library path) flags and qmake will do the correct thing with these libraries on Windows (namely this means passing the full path of the library to the linker). The only limitation to this is the library must exist, for qmake to find which directory a -l lib lives in.
For example:
unix:LIBS += -L/usr/local/lib -lmath win32:LIBS += c:/mylibs/math.lib
Note: On Windows, specifying libraries with the -l option, as in the above example, will cause the library with the highest version number to be used; for example, libmath2.lib could potentially be used instead of libmathlib. To avoid this ambiguity, we recommend that you explicitly specify the library to be used by including the .lib file name suffix.
By default, the list of libraries stored in LIBS is reduced to a list of unique names before it is used. To change this behavior, add the no_lflags_merge option to the CONFIG variable:
CONFIG += no_lflags_merge
This variable is used whenever a literal hash character (#) is needed in a variable declaration, perhaps as part of a file name or in a string passed to some external application.
For example:
# To include a literal hash character, use the $$LITERAL_HASH variable: urlPieces = http://qt.nokia.com/doc/4.0/qtextdocument.html pageCount message($$join(urlPieces, $$LITERAL_HASH))
By using LITERAL_HASH in this way, the # character can be used to construct a URL for the message() function to print to the console.
This variable specifies the name of the Makefile which qmake should use when outputting the dependency information for building a project. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains the name of the Makefile generator to use when generating a Makefile. The value of this variable is typically handled internally by qmake and rarely needs to be modified.
This variable specifies the directory where all intermediate moc files should be placed.
For example:
unix:MOC_DIR = ../myproject/tmp win32:MOC_DIR = c:/myproject/tmp
This variable is generated from the SOURCES variable. The extension of each source file will have been replaced by .o (Unix) or .obj (Win32). The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable specifies the directory where all intermediate objects should be placed.
For example:
unix:OBJECTS_DIR = ../myproject/tmp win32:OBJECTS_DIR = c:/myproject/tmp
This variable is set by qmake if files can be found that contain the Q_OBJECT macro. OBJMOC contains the name of all intermediate moc object files. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
All libraries that the target depends on can be listed in this variable. Some backends do not support this, these include MSVC Dsp, and ProjectBuilder .pbproj files. Generally this is supported internally by these build tools, this is useful for explicitly listing dependant static libraries.
This list will go after all builtin (and $$PRE_TARGETDEPS) dependencies.
All libraries that the target depends on can be listed in this variable. Some backends do not support this, these include MSVC Dsp, and ProjectBuilder .pbproj files. Generally this is supported internally by these build tools, this is useful for explicitly listing dependant static libraries.
This list will go before all builtin dependencies.
This variable indicates the header file for creating a precompiled header file, to increase the compilation speed of a project. Precompiled headers are currently only supported on some platforms (Windows - all MSVC project types, Mac OS X - Xcode, Makefile, Unix - gcc 3.3 and up).
On other platforms, this variable has different meaning, as noted below.
This variable contains a list of header files that require some sort of pre-compilation step (such as with moc). The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains the full path leading to the directory where the qmake project file (project.pro) is located.
This variable contains the full path leading to the directory where qmake places the generated Makefile.
This variable contains the name of the qmake program itself and is placed in generated Makefiles. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains the name of the qmake configuration to use when generating Makefiles. The value of this variable is typically handled by qmake and rarely needs to be modified.
Use the QMAKESPEC environment variable to override the qmake configuration. Note that, due to the way qmake reads project files, setting the QMAKESPEC environment variable from within a project file will have no effect.
This variable is empty unless the app TEMPLATE is specified. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified. Use the following instead:
app { # Conditional code for 'app' template here }
This variable is empty unless the app or dll TEMPLATE is specified. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This is used on Unix platforms only.
This variable contains the command for invoking the program which creates, modifies and extracts archives. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable is used to hold the data that will be installed with a library bundle, and is often used to specify a collection of header files.
For example, the following lines add path/to/header_one.h and path/to/header_two.h to a group containing information about the headers supplied with the framework:
FRAMEWORK_HEADERS.version = Versions FRAMEWORK_HEADERS.files = path/to/header_one.h path/to/header_two.h FRAMEWORK_HEADERS.path = Headers QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS
The last line adds the information about the headers to the collection of resources that will be installed with the library bundle.
Library bundles are created when the lib_bundle option is added to the CONFIG variable.
See qmake Platform Notes for more information about creating library bundles.
This is used on Mac OS X only.
This variable defines the extension to be used for library bundles. This allows frameworks to be created with custom extensions instead of the standard .framework directory name extension.
For example, the following definition will result in a framework with the .myframework extension:
QMAKE_BUNDLE_EXTENSION = .myframework
This is used on Mac OS X only.
This variable specifies the C compiler that will be used when building projects containing C source code. Only the file name of the compiler executable needs to be specified as long as it is on a path contained in the PATH variable when the Makefile is processed.
This variable contains the flags for the C compiler in debug mode.The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains the compiler flags for creating a multi-threaded application or when the version of Qt that you link against is a multi-threaded statically linked library. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains the compiler flags for creating a debuggable multi-threaded application or when the version of Qt that you link against is a debuggable multi-threaded statically linked library. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This is used on Windows only.
This variable contains the compiler flags for creating a multi-threaded dll or when the version of Qt that you link against is a multi-threaded dll. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This is used on Windows only.
This variable contains the compiler flags for creating a debuggable multi-threaded dll or when the version of Qt that you link against is a debuggable multi-threaded statically linked library. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains the compiler flags for creating a non-debuggable application. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This is used on Unix platforms only.
This variable contains the compiler flags for creating a shared library. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains the compiler flags for creating a multi-threaded application. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable is not empty if the warn_off TEMPLATE option is specified. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable is not empty if the warn_on TEMPLATE option is specified. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains any files which are not generated files (such as moc and uic generated files) and object files that should be removed when using "make clean".
This variable specifies the C++ compiler that will be used when building projects containing C++ source code. Only the file name of the compiler executable needs to be specified as long as it is on a path contained in the PATH variable when the Makefile is processed.
This variable contains the C++ compiler flags that are used when building a project. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified. The flags specific to debug and release modes can be adjusted by modifying the QMAKE_CXXFLAGS_DEBUG and QMAKE_CXXFLAGS_RELEASE variables, respectively.
This variable contains the C++ compiler flags for creating a debuggable application. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains the C++ compiler flags for creating a multi-threaded application. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains the C++ compiler flags for creating a debuggable multi-threaded application. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This is used on Windows only.
This variable contains the C++ compiler flags for creating a multi-threaded dll. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This is used on Windows only.
This variable contains the C++ compiler flags for creating a multi-threaded debuggable dll. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains the C++ compiler flags for creating an application. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains the C++ compiler flags for creating a shared library. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains the C++ compiler flags for creating a multi-threaded application. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains the C++ compiler flags for suppressing compiler warnings. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains C++ compiler flags for generating compiler warnings. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable removes extra files upon the invocation of make distclean.
This variable contains the extention for shared libraries. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
Note that platform-specific variables that change the extension will override the contents of this variable.
This variable changes the extention used on included moc files.
See also File Extensions.
This variable changes the extention used on /e Designer UI files.
See also File Extensions.
This variable changes the extention used on created PRL files.
See also File Extensions, Library Dependencies.
This variable changes the extention used on files given to lex.
See also File Extensions, LEXSOURCES.
This variable changes the extention used on files given to yacc.
See also File Extensions, YACCSOURCES.
This variable changes the extention used on generated object files.
See also File Extensions.
This variable changes the interpretation of all suffixes in this list of values as files of type C++ source code.
See also File Extensions.
This variable changes the interpretation of all suffixes in this list of values as files of type C header files.
See also File Extensions.
This variable contains the extra compilers/preprocessors that have been added
See also Customizing Makefile Output
This variable contains the extra targets that have been added
See also Customizing Makefile Output
This variable contains the list of requirements that were failed to be met when qmake was used. For example, the sql module is needed and wasn't compiled into Qt. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains the file tags needed to be entered into the Makefile, such as SOURCES and HEADERS. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
In a framework project, this variable contains the name to be used for the framework that is built.
By default, this variable contains the same value as the TARGET variable.
See qmake Platform Notes for more information about creating frameworks and library bundles.
This is used on Mac OS X only.
For projects where the build target is a Mac OS X framework, this variable is used to specify the version number that will be applied to the framework that is built.
By default, this variable contains the same value as the VERSION variable.
See qmake Platform Notes for more information about creating frameworks.
This is used on Mac OS X only.
This variable contains the location of all known header files to be added to INCLUDEPATH when building an application. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains the location of OpenGL header files to be added to INCLUDEPATH when building an application with OpenGL support. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains the location of all known header file paths to be added to INCLUDEPATH when building a Qt application. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains the location of all known header file paths to be added to INCLUDEPATH when building a multi-threaded application. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This is used on Unix platforms only.
This variable contains the location of X11 header file paths to be added to INCLUDEPATH when building a X11 application. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This is used on Mac OS X platforms only.
This variable contains the name of the property list file, .plist, you would like to include in your Mac OS X application bundle.
In the .plist file, you can define some variables, e.g., @EXECUTABLE@, which qmake will replace with the actual executable name. Other variables include @ICON@, @TYPEINFO@, @LIBRARY@, and @SHORT_VERSION@.
Note: Most of the time, the default Info.plist is good enough.
This variable contains a general set of flags that are passed to the linker. If you need to change the flags used for a particular platform or type of project, use one of the specialized variables for that purpose instead of this variable.
This is used on Windows only.
This variable contains link flags when building console programs. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This is used on Windows only.
This variable contains link flags when building console dlls. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains link flags when building debuggable applications. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains link flags when building plugins. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains link flags when building programs that use the Qt library built as a dll. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains link flags when building applications for release. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains link flags when building applications which are using the app template. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains link flags when building shared libraries The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable specifies the link flags to set the name of shared objects, such as .so or .dll. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains link flags when building multi-threaded projects. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This is used on Windows only.
This variable contains link flags when building Windows GUI projects (i.e. non-console applications). The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This is used on Windows only.
This variable contains link flags when building Windows DLL projects. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains the location of all known library directories.The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This is used on Unix platforms only.
This variable contains the location of all library directory with -L prefixed. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains the location of the OpenGL library directory.The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains the location of the Qt library directory.The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This is used on Unix platforms only.
This variable contains the location of the X11 library directory.The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains all project libraries. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This Windows-specific variable is no longer used.
Prior to Qt 4.2, this variable was used to list the libraries that should be linked against when building a console application project on Windows. QMAKE_LIBS_WINDOW should now be used instead.
This variable contains all OpenGL libraries. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains all OpenGL Qt libraries.The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains all Qt libraries.The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This is used on Windows only.
This variable contains all Qt libraries when Qt is built as a dll. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains all the libraries needed to link against if OpenGL support is turned on. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains all the libraries needed to link against if thread support is turned on. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This is used with Borland compilers only.
This variable contains the runtime library needed to link against when building an application. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This is used with Borland compilers only.
This variable contains the runtime library needed to link against when building a multi-threaded application. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This is used on Unix platforms only.
This variable contains all libraries that need to be linked against when building a multi-threaded application. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This is used on Windows only.
This variable contains all windows libraries.The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This is used on Unix platforms only.
This variable contains all X11 libraries.The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This is used on Unix platforms only.
This variable contains all X11 session management libraries. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable is not empty if the lib template is specified. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains the command to execute when creating a shared library. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains the command to execute after linking the TARGET together. This variable is normally empty and therefore nothing is executed, additionally some backends will not support this - mostly only Makefile backends.
This variable contains the command to execute before linking the TARGET together. This variable is normally empty and therefore nothing is executed, additionally some backends will not support this - mostly only Makefile backends.
This variable contains the command to execute when creating a link to a shared library. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable is used on Mac OS X when building universal binaries. This process is described in more detail in the Deploying an Application on Mac OS X document.
This variable only has an effect when building on Mac OS X. On that platform, the variable will be forwarded to the MACOSX_DEPLOYMENT_TARGET environment variable, which is interpreted by the compiler or linker. For more information, see the Deploying an Application on Mac OS X document.
This variable contains the name of the Makefile to create. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains the names of all moc source files to generate and include in the project. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains the location of qmake if it is not in the path. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable is not empty if Qt was built as a dll. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable is used to customize the list of options passed to the Resource Compiler in each of the build rules where it is used. For example, the following line ensures that the -threshold and -compress options are used with particular values each time that rcc is invoked:
QMAKE_RESOURCE_FLAGS += -threshold 0 -compress 9
This variable specifies the individual rule needed to build an object. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable specifies the individual rule needed to build an object. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable specifies the individual rule needed to build an object. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable specifies the individual rule needed to build an object. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains the name of the project target. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains the location of uic if it is not in the path. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
It can be used to specify arguments to uic as well, such as additional plugin paths. For example:
QMAKE_UIC = uic -L /path/to/plugin
The values stored in the QT variable control which of the Qt modules are used by your project.
The table below shows the options that can be used with the QT variable and the features that are associated with each of them:
Option | Features |
---|---|
core (included by default) | QtCore module |
gui (included by default) | QtGui module |
network | QtNetwork module |
opengl | QtOpenGL module |
phonon | Phonon Multimedia Framework |
sql | QtSql module |
svg | QtSvg module |
xml | QtXml module |
webkit | WebKit integration |
qt3support | Qt3Support module |
By default, QT contains both core and gui, ensuring that standard GUI applications can be built without further configuration.
If you want to build a project without the QtGui module, you need to exclude the gui value with the "-=" operator; the following line will result in a minimal Qt project being built:
QT -= gui # Only the core module is used.
Note that adding the opengl option to the QT variable automatically causes the equivalent option to be added to the CONFIG variable. Therefore, for Qt applications, it is not necessary to add the opengl option to both CONFIG and QT.
This variable contains a list of names of static plugins that are to be compiled with an application so that they are available as built-in resources.
This variable contains the current version of Qt.
This variable contains the current major version of Qt.
This variable contains the current minor version of Qt.
This variable contains the current patch version of Qt.
This variable contains the name of the resource file for the application. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable specifies the directory where all intermediate resource files should be placed.
For example:
unix:RCC_DIR = ../myproject/resources win32:RCC_DIR = c:/myproject/resources
This is a special variable processed by qmake. If the contents of this variable do not appear in CONFIG by the time this variable is assigned, then a minimal Makefile will be generated that states what dependencies (the values assigned to REQUIRES) are missing.
This is mainly used in Qt's build system for building the examples.
This variable contains the name of the resource collection file (qrc) for the application. Further information about the resource collection file can be found at The Qt Resource System.
This variable contains the name of the resource file for the application. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This is only used on Windows CE.
Specifies which signature file should be used to sign the project target.
Note: This variable will overwrite the setting you have specified in configure, with the -signature option.
This variable contains the name of all source files in the project.
For example:
SOURCES = myclass.cpp \ login.cpp \ mainwindow.cpp
See also HEADERS
This variable is set by qmake if files can be found that contain the Q_OBJECT macro. SRCMOC contains the name of all the generated moc files. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable, when used with the subdirs template contains the names of all subdirectories that contain parts of the project that need be built. Each subdirectory must contain its own project file.
For example:
SUBDIRS = kernel \ tools
It is essential that the project file in each subdirectory has the same name as the subdirectory itself, so that qmake can find it. For example, if the subdirectory is called myapp then the project file in that directory should be called myapp.pro.
If you need to ensure that the subdirectories are built in the order in which they are specified, update the CONFIG variable to include the ordered option:
CONFIG += ordered
This specifies the name of the target file.
For example:
TEMPLATE = app TARGET = myapp SOURCES = main.cpp
The project file above would produce an executable named myapp on unix and 'myapp.exe' on windows.
This variable specifies the target's extension. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable specifies the target's extension with a major version number. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable specifies the target's extension with version number. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable contains the name of the template to use when generating the project. The allowed values are:
Option | Description |
---|---|
app | Creates a Makefile for building applications (the default). (See qmake Common Projects for more information.) |
lib | Creates a Makefile for building libraries. (See qmake Common Projects for more information.) |
subdirs | Creates a Makefile for building targets in subdirectories. The subdirectories are specified using the SUBDIRS variable. |
vcapp | Windows only Creates an application project for Visual Studio. (See qmake Platform Notes for more information.) |
vclib | Windows only Creates a library project for Visual Studio. (See qmake Platform Notes for more information.) |
For example:
TEMPLATE = lib SOURCES = main.cpp TARGET = mylib
The template can be overridden by specifying a new template type with the -t command line option. This overrides the template type after the .pro file has been processed. With .pro files that use the template type to determine how the project is built, it is necessary to declare TEMPLATE on the command line rather than use the -t option.
This variable contains a list of translation (.ts) files that contain translations of the user interface text into non-native languages.
See the Qt Linguist Manual for more information about internationalization (i18n) and localization (l10n) with Qt.
This variable contains a list of the generated implementation files by UIC. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable is generated from the UICIMPLS variable. The extension of each file will have been replaced by .o (Unix) or .obj (Win32). The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.
This variable specifies the directory where all intermediate files from uic should be placed. This variable overrides both UI_SOURCES_DIR and UI_HEADERS_DIR.
For example:
unix:UI_DIR = ../myproject/ui win32:UI_DIR = c:/myproject/ui