
We bake cookies in your browser for a better experience. Using this site means that you consent.Read More
qmake Referenceqmake Function Reference
qmake'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, andQMAKE_LIBS_X11 can be used to extend or override this list.
This is only used on the Maemo platform.
This variable is used to specify the backup registration file to use withenable_backupCONFIG 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)
This is only used on the Symbian platform.
This variable is used to specify the backup registration file to use withenable_backupCONFIG 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 thatC:/Data contents are backed up by default on Symbian devices, so no registration is needed for any files found there.
This is only used on the Symbian platform.
Genericbld.inf file content can be specified withBLD_INF_RULES variables. The section ofbld.inf file where each rule goes is appended toBLD_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 theprj_exports section of the generatedbld.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 generatedbld.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 += myextensionAny rules you define will be added after automatically generated rules in each section.
Note:Content specified usingBLD_INF_RULES is inserted as-is into thebld.inf file, so any rules that specify host side paths may not work correctly when doing a shadow build.
TheCONFIG variable specifies project configuration and compiler options. The values will be recognized internally byqmake and have special meaning. They are as follows.
TheseCONFIG values control compilation flags:
| Option | Description |
|---|---|
| release | The project is to be built in release mode. This is ignored ifdebug is also specified. |
| debug | The project is to be built in debug mode. |
| debug_and_release | The project is built inboth debug and release modes. This can have some unexpected side effects (see below for more information). |
| build_all | Ifdebug_and_release is specified, the project is built in both debug and release modes by default. |
| ordered | When using thesubdirs 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 ofprecompiled headers in projects. |
| warn_on | The compiler should output as many warnings as possible. This is ignored ifwarn_off is specified. |
| warn_off | The compiler should output as few warnings as possible. |
Since thedebug option overrides therelease option when both are defined in theCONFIG variable, it is necessary to use thedebug_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 thatqmake 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 followingCONFIG options:
| Option | Description |
|---|---|
| create_prl | This option enablesqmake 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 (seeLibrary 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(seeLibrary Dependencies for more info). |
Please note thatcreate_prl is required whenbuilding a static library, whilelink_prl is required whenusing a static library.
On Windows (or if Qt is configured with-debug_and_release, adding thebuild_all option to theCONFIG variable makes this rule the default when building the project, and installation targets will be created for both debug and release builds.
Additionally, addingdebug_and_release to theCONFIG variable will cause bothdebug andrelease to be defined in the contents ofCONFIG. When the project file is processed, thescopes that test for each value will be processed forboth debug and release modes. Thebuild_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 asQMAKE_LFLAGS_RELEASE, instead of general variables, such asQMAKE_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. Note thatdll can also be used on all platforms; a shared library file with the appropriate suffix for the target platform (dll, so, dylib) will be created. |
| 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 forQt Designer. |
| uic3 | Configures qmake to run uic3 on the content ofFORMS3 if defined; otherwise the contents ofFORMS will be processed instead. |
| no_lflags_merge | Ensures that the list of libraries stored in theLIBS variable is not reduced to a list of unique values before it is used. |
| resources | Configures qmake to run rcc on the content ofRESOURCES 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. |
Seeqmake 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 theQMAKE_BUNDLE_DATA variable.
These options only have an effect on the Symbian platform:
| Option | Description |
|---|---|
| stdbinary | Builds an Open C binary (i.e. STDDLL, STDEXE, or STDLIB, depending on the target binary type.) |
| no_icon | Doesn't generate resources needed for displaying an icon for executable in application menu (app only). |
| symbian_test | Places mmp files and extension makefiles under test sections in generated bld.inf instead of their regular sections. Note that this only affects automatically generated bld.inf content; the content added viaBLD_INF_RULES variable is not affected. |
| localize_deployment | Makeslupdate tool add fields for application captions and package file names into generated.ts files. Qmake generates properly localized.loc and.pkg files based on available translations. Translation file name bodies must end with underscore and the language code for deployment localization to work. E.g.myapp_en.ts.Note: All languages supported by Qt are not supported by Symbian, so some.ts files may be ignored by qmake. |
These options only have an effect on Symbian and Maemo platforms:
| Option | Description |
|---|---|
| enable_backup | Generates deployment for backup registration file to enable backing up the application during device backup. SeeBACKUP_REGISTRATION_FILE_MAEMO andBACKUP_REGISTRATION_FILE_SYMBIAN for more information about backup. |
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. |
TheCONFIG 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 theapp 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 directoriesbwins andeabi.
This variable contains the list of all directories to look in to resolve dependencies. This will be used when crawling throughincluded files.
This 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 thecetest executable.
For example:
myFiles.files = path\*.pngDEPLOYMENT += myFiles
This will upload all PNG images inpath 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 multiplesources to be deployed on targetpaths. 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\devicesomeother.files = C:\additional\files\*someother.path = \myFiles\path2DEPLOYMENT += myFiles someother
Note:In Windows CE all linked Qt libraries will be deployed to the path specified bymyFiles.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 theHow 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.dllcustomplugin.files += c:\myplugins\othercustomimageplugin.dllcustomplugin.path = imageformatsdynamiclibrary.files = mylib.dll helper.exedynamiclibrary.path = \sys\binglobalplugin.files = someglobalimageplugin.dllglobalplugin.path = \resource\qt\plugins\imageformatsDEPLOYMENT += customplugin dynamiclibrary globalplugin
On the Symbian platform, generic PKG file content can also be specified with this variable. You can use eitherpkg_prerules orpkg_postrules to pass raw data to PKG file. The strings inpkg_prerules are added before package-body andpkg_postrules after.pkg_prerules is used for defining vendor information, dependencies, custom package headers, and the like, whilepkg_postrules is used for custom file deployment and embedded sis directives. The strings defined inpkg_postrules orpkg_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.dllsomelib.path = \sys\binsomelib.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 justdepPlease note thatpkg_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.
Note:Custom deployments specified usingpkg_postrules are inserted as-is into thePKG file, so any rules that specify host side paths may not work correctly when doing a shadow build.
On the Symbian platform, three separate PKG files are generated:
.main.installer.stubpkg_prerules andpkg_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, thedefault_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 supporteddefault_deployment rules that can be disabled are:
For example:
default_deployment.pkg_prerules -= pkg_platform_dependenciesmy_deployment.pkg_prerules = "[0x11223344],0,0,0,{\"SomeSpecificDeviceID\"}"DEPLOYMENT += my_deploymentOn the Symbian platform, a default deployment is generated for all application projects. You can modify the autogenerated default deployment via followingDEPLOYMENT 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 RUNINSTALLdep_note.files = install_note.txtdep_note.flags = FILETEXT TEXTEXITDEPLOYMENT += 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 theTARGET variable. Often the default is not optimal for displaying to end user. To set a better display name for these purposes, useDEPLOYMENT.display_name variable:
DEPLOYMENT.display_name = My Qt App
On the Symbian platform, you can useDEPLOYMENT.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"This 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. SeeStatic 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.
Specifies where to put thetarget file.
For example:
DESTDIR = ../../lib
This variable is set internally byqmake, which is basically theDESTDIR variable with theTARGET variable appened at the end. The value of this variable is typically handled byqmake orqmake.conf and rarely needs to be modified.
Specifies where to copy thetarget 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 byqmake, which specifies where the dsp template file for basing generated dsp files is stored. The value of this variable is typically handled byqmake orqmake.conf and rarely needs to be modified.
This variable specifies the UI files (seeQt Designer) to be processed throughuic 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 throughuic3 before compiling, whenCONFIG 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 thecommand line) for the specified headers.qmake will also automatically detect ifmoc 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 alsoSOURCES.
This variable is used only in MAC and the Symbian platform to set the application icon. Please seethe application icon documentation for more information.
This 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 theqmake Project Files document.
win32:INCLUDEPATH += "C:/mylibs/extra headers"unix:INCLUDEPATH += "/home/user/extra headers"
This variable contains a list of resources that will be installed whenmake 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 followingtarget.path definition describes where the build target will be installed, and theINSTALLS assignment adds the build target to the list of existing resources to be installed:
target.path += $$[QT_INSTALL_PLUGINS]/imageformatsINSTALLS += target
Note thatqmake will skip files that are executable. If you need to install executable files, you can unset the files' executable flags.
Note thatqmake will skip files that are executable. If you need to install executable files, you can unset the files' executable flags.
This variable contains a list of lex implementation files. The value of this variable is typically handled byqmake orqmake.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 byqmake 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 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 -lmathwin32:LIBS += c:/mylibs/math.lib
Note: On Windows, specifying libraries with the-l option will cause the library with the highest version number to be used. For example,math2.lib could potentially be used instead ofmath.lib. To avoid this ambiguity, we recommend that you explicitly specify the library to be used by including the.lib file name suffix, as in the example above.
To specify a path containing spaces, quote the path using the technique mentioned in theqmake Project Files document.
win32:LIBS += "C:/mylibs/extra libs/extra.lib"unix:LIBS += "-L/home/user/extra libs" -lextra
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 inLIBS is reduced to a list of unique names before it is used. To change this behavior, add theno_lflags_merge option to theCONFIG 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 pageCountmessage($$join(urlPieces, $$LITERAL_HASH))
By usingLITERAL_HASH in this way, the# character can be used to construct a URL for themessage() function to print to the console.
This variable specifies the name of the Makefile whichqmake should use when outputting the dependency information for building a project. The value of this variable is typically handled byqmake orqmake.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.
This variable contains the name of the Makefile generator to use when generating a Makefile. The value of this variable is typically handled internally byqmake and rarely needs to be modified.
This 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 theMMP_RULES statement, it can be done with the variableLITERAL_HASH as follows:
myIfdefBlock = \"$${LITERAL_HASH}ifdef WINSCW" \"DEFFILE hello_winscw.def" \"$${LITERAL_HASH}endif"MMP_RULES += myIfdefBlockThere is also a convenience function for adding conditional rules calledaddMMPRules. Suppose you need certain functionality to require different library depending on architecture. This can be specified withaddMMPRules as follows:
# Set conditional librariesLIB.MARM = "LIBRARY myarm.lib"LIB.WINSCW = "LIBRARY mywinscw.lib"LIB.default = "LIBRARY mydefault.lib"# Add the conditional MMP rulesMYCONDITIONS = MARM WINSCWMYVARIABLES = LIBaddMMPRules(MYCONDITIONS, MYVARIABLES)
Note:You should not use this variable to add MMP statements that are explicitly supported by their own variables, such asTARGET.EPOCSTACKSIZE. Doing so could result in duplicate statements in the MMP file.
Note:Content specified usingMMP_RULES is inserted as-is into theMMP file, so any rules that specify host side paths may not work correctly when doing a shadow build.
This variable specifies the directory where all intermediate moc files should be placed.
For example:
unix:MOC_DIR = ../myproject/tmpwin32:MOC_DIR = c:/myproject/tmp
This variable is generated from theSOURCES 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 byqmake orqmake.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/tmpwin32:OBJECTS_DIR = c:/myproject/tmp
This variable is set byqmake if files can be found that contain theQ_OBJECT macro.OBJMOC contains the name of all intermediate moc object files. The value of this variable is typically handled byqmake orqmake.conf and rarely needs to be modified.
All libraries that thetarget 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 thetarget 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 byqmake orqmake.conf and rarely needs to be modified.
ThePWD 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.
This variable contains the full path leading to the directory whereqmake places the generated Makefile.
This variable contains the name of theqmake program itself and is placed in generated Makefiles. The value of this variable is typically handled byqmake orqmake.conf and rarely needs to be modified.
This variable contains the name of theqmake configuration to use when generating Makefiles. The value of this variable is typically handled byqmake and rarely needs to be modified.
Use theQMAKESPEC environment variable to override theqmake configuration. Note that, due to the wayqmake reads project files, setting theQMAKESPEC environment variable from within a project file will have no effect.
This variable is empty unless theappTEMPLATE is specified. The value of this variable is typically handled byqmake orqmake.conf and rarely needs to be modified. Use the following instead:
app { # Conditional code for 'app' template here}This variable is empty unless theapp ordllTEMPLATE is specified. The value of this variable is typically handled byqmake orqmake.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 byqmake orqmake.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 addpath/to/header_one.h andpath/to/header_two.h to a group containing information about the headers supplied with the framework:
FRAMEWORK_HEADERS.version = VersionsFRAMEWORK_HEADERS.files = path/to/header_one.h path/to/header_two.hFRAMEWORK_HEADERS.path = HeadersQMAKE_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 thelib_bundle option is added to theCONFIG variable.
Seeqmake 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 thePATH 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 byqmake orqmake.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 byqmake orqmake.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 byqmake orqmake.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 byqmake orqmake.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 byqmake orqmake.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 byqmake orqmake.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 byqmake orqmake.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 byqmake orqmake.conf and rarely needs to be modified.
This variable is not empty if the warn_offCONFIG option is specified. The value of this variable is typically handled byqmake orqmake.conf and rarely needs to be modified.
This variable is not empty if the warn_onCONFIG option is specified. The value of this variable is typically handled byqmake orqmake.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 thePATH 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 byqmake orqmake.conf and rarely needs to be modified. The flags specific to debug and release modes can be adjusted by modifying theQMAKE_CXXFLAGS_DEBUG andQMAKE_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 += -O2QMAKE_CXXFLAGS.ARMCC += -O0
For more information, seeqmake Platform Notes.
This variable contains the C++ compiler flags for creating a debuggable application. The value of this variable is typically handled byqmake orqmake.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 byqmake orqmake.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 byqmakeorqmake.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 byqmake orqmake.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 byqmake orqmake.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 byqmake orqmake.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 byqmake orqmake.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 byqmakeorqmake.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 byqmake orqmake.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 byqmake orqmake.conf and rarely needs to be modified.
This variable removes extra files upon the invocation ofmake distclean.
This variable contains the extention for shared libraries. The value of this variable is typically handled byqmake orqmake.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 alsoFile Extensions.
This variable changes the extention used on /e Designer UI files.
See alsoFile Extensions.
This variable changes the extention used on created PRL files.
See alsoFile Extensions,Library Dependencies.
This variable changes the extention used on files given to lex.
See alsoFile Extensions,LEXSOURCES.
This variable changes the extention used on files given to yacc.
See alsoFile Extensions,YACCSOURCES.
This variable changes the extention used on generated object files.
See alsoFile Extensions.
This variable changes the interpretation of all suffixes in this list of values as files of type C++ source code.
See alsoFile Extensions.
This variable changes the interpretation of all suffixes in this list of values as files of type C header files.
See alsoFile Extensions.
This variable contains the extra compilers/preprocessors that have been added
See alsoCustomizing Makefile Output
This variable contains the extra targets that have been added
See alsoCustomizing Makefile Output
This variable contains the list of requirements that were failed to be met whenqmake was used. For example, the sql module is needed and wasn't compiled into Qt. The value of this variable is typically handled byqmake orqmake.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 byqmake orqmake.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 theTARGET variable.
Seeqmake 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 theVERSION variable.
Seeqmake 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 byqmake orqmake.conf and rarely needs to be modified.
This variable contains the location of EGL header files to be added to INCLUDEPATH when building an application withOpenGL/ES or OpenVG support. The value of this variable is typically handled byqmake orqmake.conf and rarely needs to be modified.
This variable contains the location ofOpenGL header files to be added to INCLUDEPATH when building an application withOpenGL support. The value of this variable is typically handled byqmake orqmake.conf and rarely needs to be modified.
If theOpenGL implementation uses EGL (mostOpenGL/ES systems), thenQMAKE_INCDIR_EGL may also need to be set.
These variables contain the location ofOpenGL headers files to be added to INCLUDEPATH when building an application withOpenGL ES 1 orOpenGL ES 2 support respectively.
The value of this variable is typically handled by l{qmake Manual#qmake}{qmake} orqmake.conf and rarely needs to be modified.
If theOpenGL implementation uses EGL (mostOpenGL/ES systems), thenQMAKE_INCDIR_EGL may also need to be set.
This 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 byqmake orqmake.conf and rarely needs to be modified.
If the OpenVG implementation uses EGL thenQMAKE_INCDIR_EGL may also need to be set.
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 byqmake orqmake.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 byqmake orqmake.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 byqmake orqmake.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 defaultInfo.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 byqmake orqmake.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 byqmake orqmake.conf and rarely needs to be modified.
This variable contains link flags when building debuggable applications. The value of this variable is typically handled byqmake orqmake.conf and rarely needs to be modified.
This variable contains link flags when building plugins. The value of this variable is typically handled byqmake orqmake.conf and rarely needs to be modified.
This 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.
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 byqmake orqmake.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 byqmake orqmake.conf and rarely needs to be modified.
This variable contains link flags when building applications which are using theapp template. The value of this variable is typically handled byqmake orqmake.conf and rarely needs to be modified.
This variable contains link flags when building shared libraries The value of this variable is typically handled byqmake orqmake.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 byqmake orqmake.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 byqmake orqmake.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 byqmake orqmake.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 byqmake orqmake.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 byqmake orqmake.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 byqmake orqmake.conf and rarely needs to be modified.
This variable contains the location of the EGL library directory, when EGL is used withOpenGL/ES or OpenVG. The value of this variable is typically handled byqmake orqmake.conf and rarely needs to be modified.
This variable contains the location of theOpenGL library directory. The value of this variable is typically handled byqmake orqmake.conf and rarely needs to be modified.
If theOpenGL implementation uses EGL (mostOpenGL/ES systems), thenQMAKE_LIBDIR_EGL may also need to be set.
This variable contains the location of the OpenVG library directory. The value of this variable is typically handled byqmake orqmake.conf and rarely needs to be modified.
If the OpenVG implementation uses EGL, thenQMAKE_LIBDIR_EGL may also need to be set.
This variable contains the location of the Qt library directory. The value of this variable is typically handled byqmake orqmake.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 byqmake orqmake.conf and rarely needs to be modified.
This variable contains all project libraries. The value of this variable is typically handled byqmake orqmake.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 EGL libraries when building Qt withOpenGL/ES or OpenVG. The value of this variable is typically handled byqmake orqmake.conf and rarely needs to be modified. The usual value is-lEGL.
This variable contains allOpenGL libraries. The value of this variable is typically handled byqmake orqmake.conf and rarely needs to be modified.
If theOpenGL implementation uses EGL (mostOpenGL/ES systems), thenQMAKE_LIBS_EGL may also need to be set.
This variable contains allOpenGL Qt libraries.The value of this variable is typically handled byqmake orqmake.conf and rarely needs to be modified.
These variables contain all theOpenGL libraries forOpenGL ES 1 andOpenGL ES 2.
The value of these variables is typically handled byqmake orqmake.conf and rarely needs to be modified.
If theOpenGL implementation uses EGL (mostOpenGL/ES systems), thenQMAKE_LIBS_EGL may also need to be set.
This variable contains all OpenVG libraries. The value of this variable is typically handled byqmake orqmake.conf and rarely needs to be modified. The usual value is-lOpenVG.
Some OpenVG engines are implemented on top ofOpenGL. This will be detected at configure time andQMAKE_LIBS_OPENGL will be implicitly added toQMAKE_LIBS_OPENVG wherever the OpenVG libraries are linked.
If the OpenVG implementation uses EGL, thenQMAKE_LIBS_EGL may also need to be set.
This variable contains all Qt libraries.The value of this variable is typically handled byqmake orqmake.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 byqmake orqmake.conf and rarely needs to be modified.
This variable contains all the libraries needed to link against ifOpenGL support is turned on. The value of this variable is typically handled byqmake orqmake.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 byqmake orqmake.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 byqmake orqmake.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 byqmake orqmake.conf and rarely needs to be modified.
This 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 byqmake orqmake.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 byqmake orqmake.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 byqmake orqmake.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 byqmake orqmake.conf and rarely needs to be modified.
This variable is not empty if thelib template is specified. The value of this variable is typically handled byqmake orqmake.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 byqmake orqmake.conf and rarely needs to be modified.
This variable contains the command to execute when creating a link to a shared library. The value of this variable is typically handled byqmake orqmake.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 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 byqmake 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 theDeploying 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 theDeploying 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 byqmake orqmake.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 byqmake orqmake.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 byqmake orqmake.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 byqmake orqmake.conf and rarely needs to be modified.
This variable is used to customize the list of options passed to theResource 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 thatrcc is invoked:
QMAKE_RESOURCE_FLAGS += -threshold 0 -compress 9
This is used on Unix platforms only.
Is equivalent toQMAKE_LFLAGS_RPATH.
This 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.
This variable specifies the individual rule needed to build an object. The value of this variable is typically handled byqmake orqmake.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 byqmake orqmake.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 byqmake orqmake.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 byqmake orqmake.conf and rarely needs to be modified.
This variable contains the name of the project target. The value of this variable is typically handled byqmake orqmake.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 byqmake orqmake.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 theQT variable control which of the Qt modules are used by your project.
The table below shows the options that can be used with theQT 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 bothcore andgui, ensuring that standard GUI applications can be built without further configuration.
If you want to build a projectwithout theQtGui module, you need to exclude thegui 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 theopengl option to theQT variable automatically causes the equivalent option to be added to theCONFIG variable. Therefore, for Qt applications, it is not necessary to add theopengl option to bothCONFIG andQT.
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 byqmake orqmake.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/resourceswin32:RCC_DIR = c:/myproject/resources
This is a special variable processed byqmake. 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 atThe Qt Resource System.
This variable contains the name of the resource file for the application. The value of this variable is typically handled byqmake orqmake.conf and rarely needs to be modified.
This is only used on the Symbian platform.
Generic RSS file content can be specified with this variable. The syntax is similar toMMP_RULES andBLD_INF_RULES.
For example:
RSS_RULES += "hidden = KAppIsHidden;"
This will add the specified statement to the end of theAPP_REGISTRATION_INFO resource struct in the generated registration resource file. As an impact of this statement, the application will not be visible in application shell.
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 registration resource file.
For example:
myrssrules = \ "hidden = KAppIsHidden;" \ "launch = KAppLaunchInBackground;" \RSS_RULES += myrssrules
This example will install the application to MyFolder in the Symbian platform application shell. In addition it will make the application to be launched in background.
From S60 version 5.4 onwards, you can specifygraphics_memory value usingRSS_RULES to specify the graphics memory quota for the application. The value is in kilobytes and defaults to 24576 (i.e. 24MB) for applications that link againstQtGui. The default for all other applications is zero.
The graphics memory quota tells the operating system how much graphics memory the application is likely to need so that it can free up enough graphics memory prior to application launch. If the value is too small, it can cause random slowdowns later when the memory is freed on on-demand basis. On the other hand, too large values can delay the application launch unnecessarily.
For example:
RSS_RULES += "graphics_memory=12288;"
This example sets the graphics memory quota to 12MB.
For detailed list of possibleAPP_REGISTRATION_INFO statements, please refer to the Symbian platform help.
Note:You should not useRSS_RULES variable to set the following RSS statements:app_file,localisable_resource_file, andlocalisable_resource_id.
These statements are internally handled by qmake.
There is a number of special modifiers you can attach toRSS_RULES to specify where in the application registration file the rule will be written:
| Modifier | Location of the rule |
|---|---|
| <no modifier> | InsideAPP_REGISTRATION_INFO resource struct. |
| .header | BeforeAPP_REGISTRATION_INFO resource struct. |
| .footer | AfterAPP_REGISTRATION_INFO resource struct. |
| .service_list | Inside aSERVICE_INFO item in theservice_list ofAPP_REGISTRATION_INFO |
| .file_ownership_list | Inside aFILE_OWNERSHIP_INFO item in thefile_ownership_list ofAPP_REGISTRATION_INFO |
| .datatype_list | Inside aDATATYPE item in thedatatype_list ofAPP_REGISTRATION_INFO |
For example:
RSS_RULES.service_list += "uid = 0x12345678; datatype_list = \{\}; opaque_data = r_my_icon;"RSS_RULES.footer +="RESOURCE CAPTION_AND_ICON_INFO r_my_icon \{ icon_file =\"$$PWD/my_icon.svg\"; \}"This example will define service information for a fictional service that requires an icon to be supplied via theopaque_data of the service information.
This is only used on the Symbian platform.
Contains the version number of the underlying S60 SDK; e.g. "5.0".
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 alsoHEADERS
This variable is set byqmake if files can be found that contain theQ_OBJECT macro.SRCMOC contains the name of all the generated moc files. The value of this variable is typically handled byqmake orqmake.conf and rarely needs to be modified.
This variable, when used with thesubdirstemplate specifies the names of all subdirectories or project files that contain parts of the project that need to be built. Each subdirectory specified using this variable must contain its own project file.
It is recommended that the project file in each subdirectory has the same base name as the subdirectory itself, because that makes it possible to omit the file name. For example, if the subdirectory is calledmyapp, the project file in that directory should be calledmyapp.pro.
Alternatively, you can specify a relative path to a .pro file in any directory. It is strongly recommended that you specify only paths in the current project's parent directory or its subdirectories.
For example:
SUBDIRS = kernel \ tools \ myapp
If you need to ensure that the subdirectories are built in the order in which they are specified, update theCONFIG variable to include theordered option:
CONFIG += ordered
It is possible to modify this default behavior ofSUBDIRS by giving additional modifiers toSUBDIRS elements. Supported modifiers are:
| Modifier | Effect |
|---|---|
| .subdir | Use the specified subdirectory instead ofSUBDIRS value. |
| .file | Specify the subprojectpro file explicitly. Cannot be used in conjunction with.subdir modifier. |
| .condition | Specifies abld.inf define that must be true for subproject to be built. Available only on Symbian platform. |
| .depends | This subproject depends on specified subproject. Available only on platforms that use makefiles. |
| .makefile | The makefile of subproject. Available only on platforms that use makefiles. |
| .target | Base string used for makefile targets related to this subproject. Available only on platforms that use makefiles. |
For example, define two subdirectories, both of which reside in a different directory than theSUBDIRS value, and one of the subdirectories must be built before the other:
SUBDIRS += my_executable my_librarymy_executable.subdir = appmy_executable.depends = my_librarymy_library.subdir = lib
For example, define a subdirectory that is only build for emulator builds in Qt for Symbian:
symbian { SUBDIRS += emulator_dll emulator_dll.condition = WINSCW}Theordered option is not supported for Visual Studio. The following list describes how you can get around without it--dependencies are generated automatically if:
This is only used on the Symbian platform.
Contains the version number of the underlying Symbian SDK; e.g. "9.2" or "Symbian3".
This specifies the name of the target file.
For example:
TEMPLATE = appTARGET = myappSOURCES = main.cpp
The project file above would produce an executable namedmyapp on unix and 'myapp.exe' on windows.
This is only used on the Symbian platform.
Specifies which platform capabilities the application should have. These include the following basic capabilities, but others are also available for signed applications.
| Capability | Description |
|---|---|
| LocalServices | The ability to use local services running on the phone or device, including those which provide local connectivity to other devices. |
| Location | Access to the service that provides information about the user's location, from GPS, phone network, or other sources. |
| NetworkServices | Use of services that access the phone network, such as dialling a phone number, sending an SMS, or other operations that result in network traffic. |
| ReadUserData | Access to the user's private data, such as contact information. |
| UserEnvironment | The ability to use services that provide from the user's physical environment, such as the camera or microphone. |
| WriteUserData | The ability to write or modify the user's private data. |
For more information, and a comprehensive list of capabilities, please refer to the Symbian SDK documentation or theSymbian Capabilities page of theForum Nokia Wiki.
This is only used on the Symbian platform.
Specifies whether static data should be allowed in the application. Symbian disallows this by default in order to save memory. To use it, set this to 1.
This is only used on the Symbian platform.
Specifies the minimum and maximum heap size of the application. The program will refuse to run if the minimum size is not available when it starts. For example:
TARGET.EPOCHEAPSIZE = 10000 10000000
This is only used on the Symbian platform.
Specifies the maximum stack size of the application. For example:
TARGET.EPOCSTACKSIZE = 0x8000
This is only used on the Symbian platform.
Specifies which secure identifier to use for the target application or library. For more information, see the Symbian SDK documentation.
This is only used on the Symbian platform.
Specifies which unique identifier 2 to use for the target application or library. If this variable is not specified, it defaults to the same value as TARGET.UID3. For more information, see the Symbian SDK documentation.
This is only used on the Symbian platform.
Specifies which unique identifier 3 to use for the target application or library. If this variable is not specified, a UID3 suitable for development and debugging will be generated automatically. However, applications being released should always define this variable. For more information, see the Symbian SDK documentation.
This is only used on the Symbian platform.
Specifies which vendor identifier to use for the target application or library. For more information, see the Symbian SDK documentation.
This variable specifies the target's extension. The value of this variable is typically handled byqmake orqmake.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 byqmake orqmake.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 byqmake orqmake.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). (Seeqmake Common Projects for more information.) |
| lib | Creates a Makefile for building libraries. (Seeqmake Common Projects for more information.) |
| subdirs | Creates a Makefile for building targets in subdirectories. The subdirectories are specified using theSUBDIRS variable. |
| vcapp | Windows only Creates an application project for Visual Studio. (Seeqmake Platform Notes for more information.) |
| vclib | Windows only Creates a library project for Visual Studio. (Seeqmake Platform Notes for more information.) |
For example:
TEMPLATE = libSOURCES = main.cppTARGET = mylib
The template can be overridden by specifying a new template type with the-t command line option. This overrides the template typeafter 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 theQt 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 byqmake orqmake.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 byqmake orqmake.conf and rarely needs to be modified.
This variable specifies the directory where all intermediate files from uic should be placed. This variable overrides bothUI_SOURCES_DIR andUI_HEADERS_DIR.
For example:
unix:UI_DIR = ../myproject/uiwin32:UI_DIR = c:/myproject/ui
This variable specifies the directory where all declaration files (as generated by uic) should be placed.
For example:
unix:UI_HEADERS_DIR = ../myproject/ui/includewin32:UI_HEADERS_DIR = c:/myproject/ui/include
This variable specifies the directory where all implementation files (as generated by uic) should be placed.
For example:
unix:UI_SOURCES_DIR = ../myproject/ui/srcwin32:UI_SOURCES_DIR = c:/myproject/ui/src
This variable contains the version number of the application or library if either theappTEMPLATE or thelibTEMPLATE is specified.
For example:
VERSION = 1.2.3
This variable contains the major version number of the library, if thelibtemplate is specified.
This variable contains the minor version number of the library, if thelibtemplate is specified.
This variable contains the patch version number of the library, if thelibtemplate is specified.
This variable tellsqmake where to search for files it cannot open. With this you may tellqmake where it may look for things like SOURCES, and if it finds an entry in SOURCES that cannot be opened it will look through the entire VPATH list to see if it can find the file on its own.
See alsoDEPENDPATH.
This variable contains a list of yacc source files. The value of this variable is typically handled byqmake orqmake.conf and rarely needs to be modified.
This variable contains a list of yacc object files. The value of this variable is typically handled byqmake orqmake.conf and rarely needs to be modified.
This variable contains a list of yacc source files to be included in the project. All dependencies, headers and source files will automatically be included in the project.
For example:
YACCSOURCES = moc.y
This variable contains the path to the project file in use.
For example, the following line causes the location of the project file to be written to the console:
message($$_PRO_FILE_)
This variable contains the path to the directory containing the project file in use.
For example, the following line causes the location of the directory containing the project file to be written to the console:
message($$_PRO_FILE_PWD_)
© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.