qmake Variable Referenceqmake's fundamental behavior is influenced by variable declarations that define the build process of each project. Some of these declare resources, such as headers and source files, that are common to each platform; others are used to customize the behavior of compilers and linkers on specific platforms. Platform-specific variables follow the naming pattern of the variables which they extend or modify, but include the name of the relevant platform in their name. For example, QMAKE_LIBS can be used to specify a list of libraries that a project needs to link against, and QMAKE_LIBS_X11 can be used to extend or override this list. BACKUP_REGISTRATION_FILE_MAEMOThis is only used on the Maemo platform. This variable is used to specify the backup registration file to use with enable_backup CONFIG value for Maemo platform. The default value is: $$_PRO_FILE_PWD_/backup_registration/maemo/$$basename(TARGET).conf. Unfortunately it is not possible to have a common registration file for Maemo like there is for Symbian, so the developer must always provide one if the platform default backup support is not sufficient. For documentation about how to create backup registration files and how the device backup works in general, see: (Using Backup Application) BACKUP_REGISTRATION_FILE_SYMBIANThis is only used on the Symbian platform. This variable is used to specify the backup registration file to use with enable_backup CONFIG value for Symbian platform. The default value is determined as follows: If a custom registration file $$_PRO_FILE_PWD_/backup_registration/symbian/backup_registration.xml exists, it is used. Otherwise, the common registration file $$[QT_INSTALL_DATA]/mkspecs/common/symbian/backup_registration.xml is used. This common registration file will define backing up of application binaries, resources, and all files under application private directory. Also note that C:/Data contents are backed up by default on Symbian devices, so no registration is needed for any files found there. For documentation about how to create backup registration files and how the device backup works in general, see: (How-To Write Backup-aware Software) BLD_INF_RULESThis is only used on the Symbian platform. Generic bld.inf file content can be specified with BLD_INF_RULES variables. The section of bld.inf file where each rule goes is appended to BLD_INF_RULES with a dot. For example: my_exports = \ "foo.h /epoc32/include/mylib/foo.h" \ "bar.h /epoc32/include/mylib/bar.h" BLD_INF_RULES.prj_exports += my_exports This will add the specified statements to the prj_exports section of the generated bld.inf file. It is also possible to add multiple rows in a single block. Each double quoted string will be placed on a new row in the generated bld.inf file. For example: myextension = \ "start extension myextension" \ "$${LITERAL_HASH}if defined(WINSCW)" \ "option MYOPTION foo" \ "$${LITERAL_HASH}endif" \ "option MYOPTION bar" \ "end" BLD_INF_RULES.prj_extensions += myextension Any rules you define will be added after automatically generated rules in each section. CONFIGThe CONFIG variable specifies project configuration and compiler options. The values will be recognized internally by qmake and have special meaning. They are as follows. These CONFIG values control compilation flags:
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:
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:
These options are used to set the compiler flags:
These options define specific features on Windows only:
See qmake Platform Notes for more information on the options for embedding manifest files. These options only have an effect on Mac OS X:
The build process for bundles is also influenced by the contents of the QMAKE_BUNDLE_DATA variable. These options only have an effect on the Symbian platform:
These options only have an effect on Symbian and Maemo platforms:
These options have an effect on Linux/Unix platforms:
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 } DEFINESqmake adds the values of this variable as compiler C preprocessor macros (-D option). For example: DEFINES += USE_MY_STUFF QT_DLL DEF_FILEThis is only used on Windows when using the app template, and on Symbian when building a shared DLL. Specifies a .def file to be included in the project. On Symbian a directory may be specified instead, in which case the real files will be located under the standard Symbian directories bwins and eabi. DEPENDPATHThis variable contains the list of all directories to look in to resolve dependencies. This will be used when crawling through included files. DEPLOYMENTThis is only used on Windows CE and the Symbian platform. 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.files = 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. For the Symbian platform, the default target is the application private directory on the drive it is installed to. 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.files = path\file1.ext1 path2\file2.ext1 path3\* myFiles.path = \some\path\on\device someother.files = C:\additional\files\* someother.path = \myFiles\path2 DEPLOYMENT += myFiles someother Note: In Windows CE all linked Qt libraries will be deployed to the path specified by myFiles.path. On Symbian platform all libraries and executables will always be deployed to the \sys\bin of the installation drive. Since the Symbian platform build system automatically moves binaries to certain directories under the epoc32 directory, custom plugins, executables or dynamically loadable libraries need special handling. When deploying extra executables or dynamically loadable libraries, the target path must specify \sys\bin. For plugins, the target path must specify the location where the plugin stub will be deployed to (see the How to Create Qt Plugins document for more information about plugins). If the binary cannot be found from the indicated source path, the directory Symbian build process moves the executables to is searched, e.g. \epoc32\release\armv5\urel. For example: customplugin.files = customimageplugin.dll customplugin.files += c:\myplugins\othercustomimageplugin.dll customplugin.path = imageformats dynamiclibrary.files = mylib.dll helper.exe dynamiclibrary.path = \sys\bin globalplugin.files = someglobalimageplugin.dll globalplugin.path = \resource\qt\plugins\imageformats DEPLOYMENT += customplugin dynamiclibrary globalplugin On the Symbian platform, generic PKG file content can also be specified with this variable. You can use either pkg_prerules or pkg_postrules to pass raw data to PKG file. The strings in pkg_prerules are added before package-body and pkg_postrules after. pkg_prerules is used for defining vendor information, dependencies, custom package headers, and the like, while pkg_postrules is used for custom file deployment and embedded sis directives. The strings defined in pkg_postrules or pkg_prerules are not parsed by qmake, so they should be in a format understood by Symbian package generation tools. Please consult the Symbian platform documentation for correct syntax. For example, to deploy DLL and add a new dependency: somelib.files = somelib.dll somelib.path = \sys\bin somelib.pkg_prerules = "(0x12345678), 2, 2, 0, {\"Some Package\"}" \ "(0x87654321), 1, *, * ~ 2, 2, 0, {\"Some Other Package\"}" justdep.pkg_prerules = "(0xAAAABBBB), 0, 2, 0, {\"My Framework\"}" DEPLOYMENT += somelib justdep Please note that pkg_prerules can also replace default statements in pkg file. If no pkg_prerules is defined, qmake makes sure that PKG file syntax is correct and it contains all mandatory statements such as:
If you decide to override any of these statements, you need to pay attention that also other statements stay valid. For example if you override languages statement, you must override also package-header statement and all other statements which are language specific. On the Symbian platform, three separate PKG files are generated:
pkg_prerules and pkg_postrules given without rules suffix will intelligently apply to each of these files, but rules can also be targeted to only one of above files by appending listed rules suffix to the variable name: my_note.pkg_postrules.installer = "\"myinstallnote.txt\" - \"\", FILETEXT, TEXTCONTINUE" DEPLOYMENT += my_note On the Symbian platform, the default_deployment item specifies default platform and package dependencies. Those dependencies can be selectively disabled if alternative dependencies need to be defined - e.g. if a specific device is required to run the application or more languages need to be supported by the package file. The supported default_deployment rules that can be disabled are:
For example: default_deployment.pkg_prerules -= pkg_platform_dependencies my_deployment.pkg_prerules = "[0x11223344],0,0,0,{\"SomeSpecificDeviceID\"}" DEPLOYMENT += my_deployment On the Symbian platform, a default deployment is generated for all application projects. You can modify the autogenerated default deployment via following DEPLOYMENT variable values:
For example: DEPLOYMENT -= default_bin_deployment default_resource_deployment default_reg_deployment This will entirely remove the default application deployment. On the Symbian platform, you can specify file specific install options with .flags modifier. Please consult the Symbian platform documentation for supported options. For example: default_bin_deployment.flags += FILERUN RUNINSTALL dep_note.files = install_note.txt dep_note.flags = FILETEXT TEXTEXIT DEPLOYMENT += dep_note This will show a message box that gives user an option to cancel the installation and then automatically runs the application after installation is complete. Note: Automatically running the applications after install may require signing the package with better than self-signed certificate, depending on the phone model. Additionally, some tools such as Runonphone may not work properly with sis packages that automatically run the application upon install. On the Symbian platform, the default package name and the default name that appears in application menu is derived from the TARGET variable. Often the default is not optimal for displaying to end user. To set a better display name for these purposes, use DEPLOYMENT.display_name variable: DEPLOYMENT.display_name = My Qt App On the Symbian platform, you can use DEPLOYMENT.installer_header variable to generate smart installer wrapper for your application. If you specify just UID of the installer package as the value, then installer package name and version will be autogenerated: DEPLOYMENT.installer_header = 0x12345678 If autogenerated values are not suitable, you can also specify the sis header yourself using this variable: DEPLOYMENT.installer_header = "$${LITERAL_HASH}{\"My Application Installer\"},(0x12345678),1,0,0" DEPLOYMENT_PLUGINThis is only used on Windows CE and the Symbian platform. 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: In Windows CE, No plugins will be deployed automatically. If the application depends on plugins, these plugins have to be specified manually. Note: On the Symbian platform, all plugins supported by this variable will be deployed by default with Qt libraries, so generally using this variable is not needed. For example: DEPLOYMENT_PLUGIN += qjpeg This will upload the jpeg imageformat plugin to the plugins directory on the Windows CE device. DESTDIRSpecifies where to put the target file. For example: DESTDIR = ../../lib DESTDIR_TARGETThis 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. DLLDESTDIRSpecifies where to copy the target dll. DISTFILESThis 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 DSP_TEMPLATEThis 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. FORMSThis 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. FORMS3This 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 GUIDSpecifies 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. HEADERSDefines 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. ICONThis variable is used only in MAC and the Symbian platform to set the application icon. Please see the application icon documentation for more information. INCLUDEPATHThis variable specifies the #include directories which should be searched when compiling the project. For example: INCLUDEPATH = c:/msdev/include d:/stl/include To specify a path containing spaces, quote the path using the technique mentioned in the qmake Project Files document. win32:INCLUDEPATH += "C:/mylibs/extra headers" unix:INCLUDEPATH += "/home/user/extra headers" INSTALLSThis 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 Note that qmake will skip files that are executable. If you need to install executable files, you can unset the files' executable flags. Note that qmake will skip files that are executable. If you need to install executable files, you can unset the files' executable flags. LEXIMPLSThis 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. LEXOBJECTSThis 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. LEXSOURCESThis 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 LIBSThis 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 and the Symbian platform (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 To specify a path containing spaces, quote the path using the technique mentioned in the qmake Project Files document. win32:LIBS += "C:/mylibs/extra libs/extra.lib" unix:LIBS += "-L/home/user/extra libs" -lextra 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. Note: On the Symbian platform, the build system makes a distinction between shared and static libraries. In most cases, qmake will figure out which library you are refering to, but in some cases you may have to specify it explicitly to get the expected behavior. This typically happens if you are building a library and using it in the same project. To specify that the library is either shared or static, add a ".dll" or ".lib" suffix, respectively, to the library name. 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 LITERAL_HASHThis 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. MAKEFILEThis 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. Note: On the Symbian platform, this variable is ignored. Note: On the Symbian platform, this variable is ignored. MAKEFILE_GENERATORThis 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. MMP_RULESThis is only used on the Symbian platform. Generic MMP file content can be specified with this variable. For example: MMP_RULES += "DEFFILE hello.def" This will add the specified statement to the end of the generated MMP file. It is also possible to add multiple rows in a single block. Each double quoted string will be placed on a new row in the generated MMP file. For example: myBlock = \ "START RESOURCE foo.rss" \ "TARGET bar" \ "TARGETPATH private\10001234" \ "HEADER" \ "LANG 01" \ "UID 0x10002345 0x10003456" \ "END" MMP_RULES += myBlock If you need to include a hash (#) character inside the MMP_RULES statement, it can be done with the variable LITERAL_HASH as follows: myIfdefBlock = \ "$${LITERAL_HASH}ifdef WINSCW" \ "DEFFILE hello_winscw.def" \ "$${LITERAL_HASH}endif" MMP_RULES += myIfdefBlock There is also a convenience function for adding conditional rules called addMMPRules. Suppose you need certain functionality to require different library depending on architecture. This can be specified with addMMPRules as follows: # Set conditional libraries LIB.MARM = "LIBRARY myarm.lib" LIB.WINSCW = "LIBRARY mywinscw.lib" LIB.default = "LIBRARY mydefault.lib" # Add the conditional MMP rules MYCONDITIONS = MARM WINSCW MYVARIABLES = LIB addMMPRules(MYCONDITIONS, MYVARIABLES) Note: You should not use this variable to add MMP statements that are explicitly supported by their own variables, such as TARGET.EPOCSTACKSIZE. Doing so could result in duplicate statements in the MMP file. MOC_DIRThis 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 OBJECTSThis 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. OBJECTS_DIRThis variable specifies the directory where all intermediate objects should be placed. For example: unix:OBJECTS_DIR = ../myproject/tmp win32:OBJECTS_DIR = c:/myproject/tmp OBJMOCThis 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. POST_TARGETDEPSAll 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. PRE_TARGETDEPSAll 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. PRECOMPILED_HEADERThis 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. PWDThe PWD variable specifies the full path leading to the directory containing the current file being parsed. This can be useful to refer to files within the source tree when writing project files to support shadow builds. See also _PRO_FILE_PWD_. Note: IN_PWD is an alias for PWD. Note: Function calls have no effect on the value of PWD. PWD will refer to the path of the calling file. OUT_PWDThis variable contains the full path leading to the directory where qmake places the generated Makefile. QMAKEThis 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. QMAKESPECThis 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. QMAKE_APP_FLAGThis 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 } QMAKE_APP_OR_DLLThis 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. QMAKE_AR_CMDThis 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. QMAKE_BUNDLE_DATAThis 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. QMAKE_BUNDLE_EXTENSIONThis 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. QMAKE_CCThis 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. QMAKE_CFLAGS_DEBUGThis 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. QMAKE_CFLAGS_MTThis 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. QMAKE_CFLAGS_MT_DBGThis 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. QMAKE_CFLAGS_MT_DLLThis 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. QMAKE_CFLAGS_MT_DLLDBGThis 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. QMAKE_CFLAGS_RELEASEThis 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. QMAKE_CFLAGS_SHLIBThis 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. QMAKE_CFLAGS_THREADThis 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. QMAKE_CFLAGS_WARN_OFFThis variable is not empty if the warn_off CONFIG option is specified. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified. QMAKE_CFLAGS_WARN_ONThis variable is not empty if the warn_on CONFIG option is specified. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified. QMAKE_CLEANThis 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". QMAKE_CXXThis 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. QMAKE_CXXFLAGSThis 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. Note: On the Symbian platform, this variable can be used to pass architecture specific options to each compiler in the Symbian build system. For example: QMAKE_CXXFLAGS.CW += -O2 QMAKE_CXXFLAGS.ARMCC += -O0 For more information, see qmake Platform Notes. QMAKE_CXXFLAGS_DEBUGThis 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. QMAKE_CXXFLAGS_MTThis 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. QMAKE_CXXFLAGS_MT_DBGThis variable contains the C++ compiler flags for creating a debuggable multi-threaded application. The value of this variable is typically handled by qmakeor qmake.conf and rarely needs to be modified. QMAKE_CXXFLAGS_MT_DLLThis 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. QMAKE_CXXFLAGS_MT_DLLDBGThis 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. QMAKE_CXXFLAGS_RELEASEThis 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. QMAKE_CXXFLAGS_SHLIBThis 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. QMAKE_CXXFLAGS_THREADThis variable contains the C++ compiler flags for creating a multi-threaded application. The value of this variable is typically handled by qmakeor qmake.conf and rarely needs to be modified. QMAKE_CXXFLAGS_WARN_OFFThis 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. QMAKE_CXXFLAGS_WARN_ONThis 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. QMAKE_DISTCLEANThis variable removes extra files upon the invocation of make distclean. QMAKE_EXTENSION_SHLIBThis 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. QMAKE_EXT_MOCThis variable changes the extention used on included moc files. See also File Extensions. QMAKE_EXT_UIThis variable changes the extention used on /e Designer UI files. See also File Extensions. QMAKE_EXT_PRLThis variable changes the extention used on created PRL files. See also File Extensions, Library Dependencies. QMAKE_EXT_LEXThis variable changes the extention used on files given to lex. See also File Extensions, LEXSOURCES. QMAKE_EXT_YACCThis variable changes the extention used on files given to yacc. See also File Extensions, YACCSOURCES. QMAKE_EXT_OBJThis variable changes the extention used on generated object files. See also File Extensions. QMAKE_EXT_CPPThis variable changes the interpretation of all suffixes in this list of values as files of type C++ source code. See also File Extensions. QMAKE_EXT_HThis variable changes the interpretation of all suffixes in this list of values as files of type C header files. See also File Extensions. QMAKE_EXTRA_COMPILERSThis variable contains the extra compilers/preprocessors that have been added See also Customizing Makefile Output QMAKE_EXTRA_TARGETSThis variable contains the extra targets that have been added See also Customizing Makefile Output QMAKE_FAILED_REQUIREMENTSThis 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. QMAKE_FILETAGSThis 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. QMAKE_FRAMEWORK_BUNDLE_NAMEIn 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. QMAKE_FRAMEWORK_VERSIONFor 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. QMAKE_INCDIRThis 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. QMAKE_INCDIR_EGLThis variable contains the location of EGL header files to be added to INCLUDEPATH when building an application with OpenGL/ES or OpenVG support. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified. QMAKE_INCDIR_OPENGLThis 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. If the OpenGL implementation uses EGL (most OpenGL/ES systems), then QMAKE_INCDIR_EGL may also need to be set. QMAKE_INCDIR_OPENGL_ES1, QMAKE_INCDIR_OPENGL_ES2These variables contain the location of OpenGL headers files to be added to INCLUDEPATH when building an application with OpenGL ES 1 or OpenGL ES 2 support respectively. The value of this variable is typically handled by l{qmake Manual#qmake}{qmake} or qmake.conf and rarely needs to be modified. If the OpenGL implementation uses EGL (most OpenGL/ES systems), then QMAKE_INCDIR_EGL may also need to be set. QMAKE_INCDIR_OPENVGThis variable contains the location of OpenVG header files to be added to INCLUDEPATH when building an application with OpenVG support. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified. If the OpenVG implementation uses EGL then QMAKE_INCDIR_EGL may also need to be set. QMAKE_INCDIR_QTThis 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. QMAKE_INCDIR_THREADThis 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. QMAKE_INCDIR_X11This 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. QMAKE_INFO_PLISTThis 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. QMAKE_LFLAGSThis 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. QMAKE_LFLAGS_CONSOLEThis 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. QMAKE_LFLAGS_CONSOLE_DLLThis 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. QMAKE_LFLAGS_DEBUGThis 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. QMAKE_LFLAGS_PLUGINThis 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. QMAKE_LFLAGS_RPATHThis is used on Unix platforms only. Library paths in this definition are added to the executable at link time so that the added paths will be preferentially searched at runtime. QMAKE_LFLAGS_QT_DLLThis 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. QMAKE_LFLAGS_RELEASEThis 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. QMAKE_LFLAGS_SHAPPThis 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. QMAKE_LFLAGS_SHLIBThis 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. QMAKE_LFLAGS_SONAMEThis 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. QMAKE_LFLAGS_THREADThis 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. QMAKE_LFLAGS_WINDOWSThis 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. QMAKE_LFLAGS_WINDOWS_DLLThis 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. QMAKE_LIBDIRThis 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. QMAKE_LIBDIR_FLAGSThis 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. QMAKE_LIBDIR_EGLThis variable contains the location of the EGL library directory, when EGL is used with OpenGL/ES or OpenVG. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified. QMAKE_LIBDIR_OPENGLThis 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. If the OpenGL implementation uses EGL (most OpenGL/ES systems), then QMAKE_LIBDIR_EGL may also need to be set. QMAKE_LIBDIR_OPENVGThis variable contains the location of the OpenVG library directory. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified. If the OpenVG implementation uses EGL, then QMAKE_LIBDIR_EGL may also need to be set. QMAKE_LIBDIR_QTThis 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. QMAKE_LIBDIR_X11This 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. QMAKE_LIBSThis variable contains all project libraries. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified. QMAKE_LIBS_CONSOLEThis 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. QMAKE_LIBS_EGLThis variable contains all EGL libraries when building Qt with OpenGL/ES or OpenVG. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified. The usual value is -lEGL. QMAKE_LIBS_OPENGLThis variable contains all OpenGL libraries. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified. If the OpenGL implementation uses EGL (most OpenGL/ES systems), then QMAKE_LIBS_EGL may also need to be set. QMAKE_LIBS_OPENGL_QTThis 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. QMAKE_LIBS_OPENGL_ES1, QMAKE_LIBS_OPENGL_ES2These variables contain all the OpenGL libraries for OpenGL ES 1 and OpenGL ES 2. The value of these variables is typically handled by qmake or qmake.conf and rarely needs to be modified. If the OpenGL implementation uses EGL (most OpenGL/ES systems), then QMAKE_LIBS_EGL may also need to be set. QMAKE_LIBS_OPENVGThis variable contains all OpenVG libraries. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified. The usual value is -lOpenVG. Some OpenVG engines are implemented on top of OpenGL. This will be detected at configure time and QMAKE_LIBS_OPENGL will be implicitly added to QMAKE_LIBS_OPENVG wherever the OpenVG libraries are linked. If the OpenVG implementation uses EGL, then QMAKE_LIBS_EGL may also need to be set. QMAKE_LIBS_QTThis variable contains all Qt libraries.The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified. QMAKE_LIBS_QT_DLLThis 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. QMAKE_LIBS_QT_OPENGLThis 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. QMAKE_LIBS_QT_THREADThis 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. QMAKE_LIBS_RTThis 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. QMAKE_LIBS_RTMTThis 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. QMAKE_LIBS_THREADThis is used on Unix and Symbian 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. QMAKE_LIBS_WINDOWSThis 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. QMAKE_LIBS_X11This 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. QMAKE_LIBS_X11SMThis 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. QMAKE_LIB_FLAGThis 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. QMAKE_LINK_SHLIB_CMDThis 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. QMAKE_LN_SHLIBThis 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. QMAKE_POST_LINKThis 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. QMAKE_PRE_LINKThis 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. QMAKE_PROJECT_NAMEThis is used for Visual Studio project files only. This variable determines the name of the project when generating project files for IDEs. The default value is the target name. The value of this variable is typically handled by qmake and rarely needs to be modified. QMAKE_MAC_SDKThis 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. QMAKE_MACOSX_DEPLOYMENT_TARGETThis 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. QMAKE_MAKEFILEThis 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. QMAKE_MOC_SRCThis 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. QMAKE_QMAKEThis 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. QMAKE_QT_DLLThis 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. QMAKE_RESOURCE_FLAGSThis 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 QMAKE_RPATHThis is used on Unix platforms only. Is equivalent to QMAKE_LFLAGS_RPATH. QMAKE_RPATHDIRThis is used on Unix platforms only. A list of library directory paths, these paths are added to the executable at link time so that the paths will be preferentially searched at runtime. QMAKE_RUN_CCThis 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. QMAKE_RUN_CC_IMPThis 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. QMAKE_RUN_CXXThis 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. QMAKE_RUN_CXX_IMPThis 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. QMAKE_TARGETThis 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. QMAKE_UICThis 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 QTThe 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:
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. QTPLUGINThis 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. QT_VERSIONThis variable contains the current version of Qt. QT_MAJOR_VERSIONThis variable contains the current major version of Qt. QT_MINOR_VERSIONThis variable contains the current minor version of Qt. QT_PATCH_VERSIONThis variable contains the current patch version of Qt. RC_FILEThis variable contains the name of the resource file for the application. The value of this variable is typically handled by |