Variables

<Unknown command>contentspage{qmake Manual}{Contents} The fundamental behavior of qmake 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, a makespec may use QMAKE_LIBS to specify a list of libraries that each project needs to link against, and QMAKE_LIBS_X11 would be used to extend this list.

CONFIG

Specifies project configuration and compiler options. The values are recognized internally by qmake and have special meaning.

The following CONFIG values control compilation flags:

Option

Description

release

The project is to be built in release mode. If debug is also specified, the last one takes effect.

debug

The project is to be built in debug mode.

debug_and_release

The project is prepared to be built in both debug and release modes.

debug_and_release_target

This option is set by default. If debug_and_release is also set, the debug and release builds end up in separate debug and release directories.

build_all

If debug_and_release is specified, the project is built in both debug and release modes by default.

autogen_precompile_source

Automatically generates a .cpp file that includes the precompiled header file specified in the .pro file.

ordered

When using the subdirs template, this option specifies that the directories listed should be processed in the order in which they are given.

precompile_header

Enables support for the use of precompiled headers in projects.

precompile_header_c (MSVC only)

Enables support for the use of precompiled headers for C files.

warn_on

The compiler should output as many warnings as possible. If warn_off is also specified, the last one takes effect.

warn_off

The compiler should output as few warnings as possible.

exceptions

Exception support is enabled. Set by default.

exceptions_off

Exception support is disabled.

rtti

RTTI support is enabled. By default, the compiler default is used.

rtti_off

RTTI support is disabled. By default, the compiler default is used.

stl

STL support is enabled. By default, the compiler default is used.

stl_off

STL support is disabled. By default, the compiler default is used.

thread

Thread support is enabled. This is enabled when CONFIG includes qt, which is the default.

c99

C99 support is enabled. This option has no effect if the compiler does not support C99, or can't select the C standard. By default, the compiler default is used.

c11

C11 support is enabled. This option has no effect if the compiler does not support C11, or can't select the C standard. By default, the compiler default is used.

strict_c

Disables support for C compiler extensions. By default, they are enabled.

c++11

C++11 support is enabled. This option has no effect if the compiler does not support C++11, or can't select the C++ standard. By default, support is enabled.

c++14

C++14 support is enabled. This option has no effect if the compiler does not support C++14, or can't select the C++ standard. By default, the compiler default is used.

c++1z

C++17 support is enabled. This option has no effect if the compiler does not support C++17, or can't select the C++ standard. By default, support is disabled.

c++17

Same as c++1z.

c++2a

C++2a support is enabled. This option has no effect if the compiler does not support C++2a, or can't select the C++ standard. By default, support is disabled.

c++latest

Support for the latest C++ language standard is enabled that is supported by the compiler. By default, this option is disabled.

strict_c++

Disables support for C++ compiler extensions. By default, they are enabled.

depend_includepath

Appending the value of INCLUDEPATH to DEPENDPATH is enabled. Set by default.

lrelease

Run lrelease for all files listed in TRANSLATIONS and EXTRA_TRANSLATIONS. If embed_translations is not set, install the generated .qm files into QM_FILES_INSTALL_PATH. Use QMAKE_LRELEASE_FLAGS to add options to the lrelease call. Not set by default.

embed_translations

Embed the generated translations from lrelease in the executable, under QM_FILES_RESOURCE_PREFIX. Requires lrelease to be set, too. Not set by default.

create_libtool

Create a libtool .la file for the currently built library.

create_pc

Create a pkg-config .pc file for the currently built library.

no_batch

NMake only: Turn off generation of NMake batch rules or inference rules.

skip_target_version_ext

Suppress the automatic version number appended to the DLL file name on Windows.

suppress_vcproj_warnings

Suppress warnings of the VS project generator.

windeployqt

Automatically invoke windeployqt after linking, and add the output as deployment items.

dont_recurse

Suppress qmake recursion for the current subproject.

no_include_pwd

Do not add the current directory to INCLUDEPATHS.

When you use the debug_and_release option (which is the default under Windows), the project will be processed three times: one time to produce a "meta" Makefile, and two more times to produce a Makefile.Debug and a Makefile.Release.

During the latter passes, build_pass and the respective debug or release option is appended to CONFIG. This makes it possible to perform build-specific tasks. For example:

 
Sélectionnez
build_pass:CONFIG(debug, debug|release) {
    unix: TARGET = $$join(TARGET,,,_debug)
    else: TARGET = $$join(TARGET,,,d)
}

As an alternative to manually writing build type conditionals, some variables offer build-specific variants, for example QMAKE_LFLAGS_RELEASE in addition to the general QMAKE_LFLAGS. These should be used when available.

The meta Makefile makes the sub-builds invokable via the debug and release targets, and a combined build via the all target. When the build_all CONFIG option is used, the combined build is the default. Otherwise, the last specified CONFIG option from the set (debug, release) determines the default. In this case, you can explicitly invoke the all target to build both configurations at once:

 
Sélectionnez
make all

The details are slightly different when producing Visual Studio and Xcode projects.

When linking a library, qmake relies on the underlying platform to know what other libraries this library links against. However, if linking statically, qmake will not get this information unless we use the following CONFIG options:

Option

Description

create_prl

This option enables qmake to track these dependencies. When this option is enabled, qmake will create a file with the extension .prl which will save meta-information about the library (see Library Dependencies for more info).

link_prl

When this option is enabled, qmake will process all libraries linked to by the application and find their meta-information (see Library Dependencies for more info).

no_install_prl

This option disables the generation of installation rules for generated .prl files.

The create_prl option is required when building a static library, while link_prl is required when using a static library.

The following options define the application or library type:

Option

Description

qt

The target is a Qt application or 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.

x11

The target is an X11 application or library. The proper include paths and libraries will automatically be added to the project.

testcase

The target is an automated test. A check target will be added to the generated Makefile to run the test. Only relevant when generating Makefiles.

insignificant_test

The exit code of the automated test will be ignored. Only relevant if testcase is also set.

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. Consider using the option cmdline for cross-platform applications.

cmdline

The target is a cross-platform command line application. On Windows, this implies CONFIG += console. On macOS, this implies CONFIG -= app_bundle.

shared

The target is a shared object/DLL. The proper include paths, compiler flags and libraries will automatically be added to the project. Note that dll can also be used on all platforms; a shared library file with the appropriate suffix for the target platform (.dll or .so) will be created.

dll

static

The target is a static library (lib only). The proper compiler flags will automatically be added to the project.

staticlib

plugin

The target is a plugin (lib only). This enables dll as well.

designer

The target is a plugin for Qt Designer.

no_lflags_merge

Ensures that the list of libraries stored in the LIBS variable is not reduced to a list of unique values before it is used.

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 EXE created as part of an application project.

See Platform Notes for more information about the options for embedding manifest files.

The following options take an effect only on macOS:

Option

Description

app_bundle

Puts the executable into a bundle (this is the default).

lib_bundle

Puts the library into a library bundle.

plugin_bundle

Puts the plugin into a plugin bundle. This value is not supported by the Xcode project generator.

The build process for bundles is also influenced by the contents of the QMAKE_BUNDLE_DATA variable.

The following options take an effect only on Linux/Unix platforms:

Option

Description

largefile

Includes support for large files.

separate_debug_info

Puts debugging information for libraries in separate files.

The CONFIG variable will also be checked when resolving scopes. You may assign anything to this variable.

For example:

 
Sélectionnez
CONFIG += console newstuff
...
newstuff {
    SOURCES += new.cpp
    HEADERS += new.h
}

DEFINES

qmake adds the values of this variable as compiler C preprocessor macros (-D option).

For example:

 
Sélectionnez
DEFINES += USE_MY_STUFF

DEFINES_DEBUG

Specifies preprocessor defines for the debug configuration. The values of this variable get added to DEFINES before the project is loaded. This variable is typically set in qmake.conf and rarely needs to be modified.

This variable was introduced in Qt 5.13.2.

DEFINES_RELEASE

Specifies preprocessor defines for the release configuration. The values of this variable get added to DEFINES before the project is loaded. This variable is typically set in qmake.conf and rarely needs to be modified.

This variable was introduced in Qt 5.13.2.

DEF_FILE

This variable is used only on Windows when using the app template.

Specifies a .def file to be included in the project.

DEPENDPATH

Specifies a list of directories for qmake to scan, to resolve dependencies. This variable is used when qmake crawls through the header files that you #include in your source code.

DESTDIR

Specifies where to put the target file.

For example:

 
Sélectionnez
DESTDIR = ../../lib

The list of supported characters can depend on the used build tool. In particular, parentheses do not work with make.

DISTFILES

Specifies a list of files to be included in the dist target. This feature is supported by UnixMake specs only.

For example:

 
Sélectionnez
DISTFILES += ../program.txt

DLLDESTDIR

This variable applies only to Windows targets.

Specifies where to copy the target dll.

EXTRA_TRANSLATIONS

Specifies a list of translation (.ts) files that contain translations of the user interface text into non-native languages.

In contrast to TRANSLATIONS, translation files in EXTRA_TRANSLATIONS will be processed only by lrelease, not lupdate.

You can use CONFIG += lrelease to automatically compile the files during the build, and CONFIG += lrelease embed_translations to make them available in The Qt Resource System.

See the Qt Linguist Manual for more information about internationalization (i18n) and localization (l10n) with Qt.

FORMS

Specifies the UI files (see Qt Designer Manual) to be processed by uic before compiling. All dependencies, headers and source files required to build these UI files will automatically be added to the project.

For example:

 
Sélectionnez
FORMS = mydialog.ui \
    mywidget.ui \
        myconfig.ui

GUID

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.

HEADERS

Defines the header files for the project.

qmake automatically detects whether moc is required by the classes in the headers, and adds the appropriate dependencies and files to the project for generating and linking the moc files.

For example:

 
Sélectionnez
HEADERS = myclass.h \
          login.h \
          mainwindow.h

See also SOURCES.

ICON

This variable is used only on Mac OS to set the application icon. Please see the application icon documentation for more information.

IDLSOURCES

This variable is used only on Windows for the Visual Studio project generation to put the specified files in the Generated Files folder.

INCLUDEPATH

Specifies the #include directories which should be searched when compiling the project.

For example:

 
Sélectionnez
INCLUDEPATH = c:/msdev/include d:/stl/include

To specify a path containing spaces, quote the path using the technique described in Whitespace.

 
Sélectionnez
win32:INCLUDEPATH += "C:/mylibs/extra headers"
unix:INCLUDEPATH += "/home/user/extra headers"

INSTALLS

Specifies 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:

 
Sélectionnez
target.path += $$[QT_INSTALL_PLUGINS]/imageformats
INSTALLS += target

INSTALLS has a .CONFIG member that can take several values:

Value

Description

no_check_exists

If not set, qmake looks to see if the files to install actually exist. If these files don't exist, qmake doesn’t create the install rule. Use this config value if you need to install files that are generated as part of your build process, like HTML files created by qdoc.

nostrip

If set, the typical Unix strip functionality is turned off and the debug information will remain in the binary.

executable

On Unix, this sets the executable flag.

no_build

When you do a make install, and you don't have a build of the project yet, the project is first built, and then installed. If you don't want this behavior, set this config value to ensure that the build target is not added as a dependency to the install target.

no_default_install

A project has a top-level project target where, when you do a make install, everything is installed. But, if you have an install target with this config value set, it's not installed by default. You then have to explicitly say make install_<file>.

For more information, see Installing Files.

This variable is also used to specify which additional files will be deployed to embedded devices.

LEXIMPLS

Specifies 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.

LEXOBJECTS

Specifies the names of intermediate Lex object files. The value of this variable is typically handled by qmake and rarely needs to be modified.

LEXSOURCES

Specifies 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:

 
Sélectionnez
LEXSOURCES = lexer.l

LIBS

Specifies a list of libraries to be linked into the project. If you use the Unix -l (library) and -L (library path) flags, qmake handles the libraries correctly on Windows (that is, passes the full path of the library to the linker). The library must exist for qmake to find the directory where a -l lib is located.

For example:

 
Sélectionnez
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 described in Whitespace.

 
Sélectionnez
win32:LIBS += "C:/mylibs/extra libs/extra.lib"
unix:LIBS += "-L/home/user/extra libs" -lextra

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:

 
Sélectionnez
CONFIG += no_lflags_merge

LIBS_PRIVATE

Specifies a list of libraries to be linked privately into the project. The behavior of this variable is identical to LIBS, except that shared library projects built for Unix do not expose these dependencies in their link interface.

The effect of this is that if project C depends on library B which depends on library A privately, but C also wants to use symbols from A directly, it needs to link to A explicitly. Put differently, libraries linked privately are not exposed transitively at build time.

LITERAL_HASH

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:

 
Sélectionnez
# To include a literal hash character, use the $$LITERAL_HASH variable:
urlPieces = http://doc.qt.io/qt-5/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.

MAKEFILE

Specifies the name of the generated Makefile. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

MAKEFILE_GENERATOR

Specifies 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.

MSVCPROJ_*

These variables are handled internally by qmake and should not be modified or utilized.

MOC_DIR

Specifies the directory where all intermediate moc files should be placed.

For example:

 
Sélectionnez
unix:MOC_DIR = ../myproject/tmp
win32:MOC_DIR = c:/myproject/tmp

OBJECTIVE_HEADERS

Defines the Objective-C++ header files for the project.

qmake automatically detects whether moc is required by the classes in the headers, and adds the appropriate dependencies and files to the project for generating and linking the moc files.

This is similar to the HEADERS variable, but will let the generated moc files be compiled with the Objective-C++ compiler.

See also OBJECTIVE_SOURCES.

OBJECTIVE_SOURCES

Specifies the names of all Objective-C/C++ source files in the project.

This variable is now obsolete, Objective-C/C++ files (.m and .mm) can be added to the SOURCES variable.

See also OBJECTIVE_HEADERS.

OBJECTS

This variable is automatically populated from the SOURCES variable. The extension of each source file is replaced by .o (Unix) or .obj (Win32). You can add objects to the list.

OBJECTS_DIR

Specifies the directory where all intermediate objects should be placed.

For example:

 
Sélectionnez
unix:OBJECTS_DIR = ../myproject/tmp
win32:OBJECTS_DIR = c:/myproject/tmp

POST_TARGETDEPS

Lists the libraries that the target depends on. Some backends, such as the generators for Visual Studio and Xcode project files, do not support this variable. Generally, this variable is supported internally by these build tools, and it is useful for explicitly listing dependent static libraries.

This list is placed after all builtin (and $$PRE_TARGETDEPS) dependencies.

PRE_TARGETDEPS

Lists libraries that the target depends on. Some backends, such as the generators for Visual Studio and Xcode project files, do not support this variable. Generally, this variable is supported internally by these build tools, and it is useful for explicitly listing dependent static libraries.

This list is placed before all builtin dependencies.

PRECOMPILED_HEADER

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, Apple - Xcode, Makefile, Unix - gcc 3.3 and up).

PWD

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_.

Do not attempt to overwrite the value of this variable.

OUT_PWD

Specifies the full path leading to the directory where qmake places the generated Makefile.

Do not attempt to overwrite the value of this variable.

QM_FILES_RESOURCE_PREFIX

Specifies the directory in the resource system where .qm files will be made available by CONFIG += embed_translations.

The default is :/i18n/.

QM_FILES_INSTALL_PATH

Specifies the target directory .qm files generated by CONFIG += lrelease will be installed to. Does not have any effect if CONFIG += embed_translations is set.

 

QMAKE

Specifies 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.

 

QMAKESPEC

A system variable that contains the full path of the qmake configuration that is used when generating Makefiles. The value of this variable is automatically computed.

Do not attempt to overwrite the value of this variable.

QMAKE_AR_CMD

This variable is used on Unix platforms only.

Specifies 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_BUNDLE_DATA

This variable is used on macOS, iOS, tvOS, and watchOS only.

Specifies 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:

 
Sélectionnez
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 Platform Notes for more information about creating library bundles.

QMAKE_BUNDLE_EXTENSION

This variable is used on macOS, iOS, tvOS, and watchOS only.

Specifies 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:

 
Sélectionnez
QMAKE_BUNDLE_EXTENSION = .myframework

QMAKE_CC

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

Specifies the C compiler flags for 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_CFLAGS_DEBUG and QMAKE_CFLAGS_RELEASE variables, respectively.

QMAKE_CFLAGS_DEBUG

Specifies the C compiler flags for debug builds. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

QMAKE_CFLAGS_RELEASE

Specifies the C compiler flags for release builds. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO

Specifies the C compiler flags for release builds where force_debug_info is set in CONFIG. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

QMAKE_CFLAGS_SHLIB

This variable is used on Unix platforms only.

Specifies 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_THREAD

Specifies 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_OFF

This variable is used only when the warn_off CONFIG option is set. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

QMAKE_CFLAGS_WARN_ON

This variable is used only when the warn_on CONFIG option is set. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

QMAKE_CLEAN

Specifies a list of generated files (by moc and uic, for example) and object files to be removed by make clean.

QMAKE_CXX

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_CXXFLAGS

Specifies the C++ compiler flags for 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.

QMAKE_CXXFLAGS_DEBUG

Specifies the C++ compiler flags for debug builds. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

QMAKE_CXXFLAGS_RELEASE

Specifies the C++ compiler flags for release builds. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO

Specifies the C++ compiler flags for release builds where force_debug_info is set in CONFIG. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

QMAKE_CXXFLAGS_SHLIB

Specifies 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_THREAD

Specifies 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_WARN_OFF

Specifies 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_ON

Specifies 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_DEVELOPMENT_TEAM

This variable is used on macOS, iOS, tvOS, and watchOS only.

The identifier of a development team to use for signing certificates and provisioning profiles.

QMAKE_DISTCLEAN

Specifies a list of files to be removed by make distclean.

QMAKE_EXTENSION_SHLIB

Contains the extension for shared libraries. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

Platform-specific variables that change the extension override the contents of this variable.

QMAKE_EXTENSION_STATICLIB

Contains the extension for shared static libraries. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

QMAKE_EXT_MOC

Contains the extension used on included moc files.

See also File Extensions.

QMAKE_EXT_UI

Contains the extension used on Qt Designer UI files.

See also File Extensions.

QMAKE_EXT_PRL

Contains the extension used on created PRL files.

See also File Extensions, Library Dependencies.

QMAKE_EXT_LEX

Contains the extension used on files given to Lex.

See also File Extensions, LEXSOURCES.

QMAKE_EXT_YACC

Contains the extension used on files given to Yacc.

See also File Extensions, YACCSOURCES.

QMAKE_EXT_OBJ

Contains the extension used on generated object files.

See also File Extensions.

QMAKE_EXT_CPP

Contains suffixes for files that should be interpreted as C++ source code.

See also File Extensions.

QMAKE_EXT_H

Contains suffixes for files which should be interpreted as C header files.

See also File Extensions.

QMAKE_EXTRA_COMPILERS

Specifies a list of additional compilers or preprocessors.

See also Adding Compilers.

QMAKE_EXTRA_TARGETS

Specifies a list of additional qmake targets.

See also Adding Custom Targets.

QMAKE_FAILED_REQUIREMENTS

Contains the list of failed requirements. The value of this variable is set by qmake and cannot be modified.

See also requires() and REQUIRES.

QMAKE_FRAMEWORK_BUNDLE_NAME

This variable is used on macOS, iOS, tvOS, and watchOS only.

In a framework project, this variable contains the name to be used for the framework that is built.

By default, this variable contains the same value as the TARGET variable.

See Creating Frameworks for more information about creating frameworks and library bundles.

QMAKE_FRAMEWORK_VERSION

This variable is used on macOS, iOS, tvOS, and watchOS only.

For projects where the build target is a macOS, iOS, tvOS, or watchOS 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 Creating Frameworks for more information about creating frameworks.

QMAKE_HOST

Provides information about the host machine running qmake. For example, you can retrieve the host machine architecture from QMAKE_HOST.arch.

Keys

Values

.arch

Host architecture

.os

Host OS

.cpu_count

Number of available cpus

.name

Host computer name

.version

Host OS version number

.version_string

Host OS version string

 
Sélectionnez
win32-g++:contains(QMAKE_HOST.arch, x86_64):{
    message("Host is 64bit")
    ...
}

QMAKE_INCDIR

Specifies the list of system header paths that are appended to INCLUDEPATH. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

QMAKE_INCDIR_EGL

Specifies the location of EGL header files to be added to INCLUDEPATH when building a target 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_OPENGL

Specifies the location of OpenGL header files to be added to INCLUDEPATH when building a target 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_ES2

This variable specifies the location of OpenGL header files to be added to INCLUDEPATH when building a target with OpenGL ES 2 support.

The value of this variable is typically handled by qmake or