Qt pwd что это

Qt Documentation

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.

ANDROID_ABI

Note: This variable applies only to Android targets.

Specifies the Android target ABI. Valid values are: armeabi-v7a, arm64-v8a, x86, x86_64.

ANDROID_ABIS

Note: This variable applies only to Android targets.

Specifies a list of Android target ABIs. Valid values are: armeabi-v7a, arm64-v8a, x86, x86_64.

You can provide the ABIs as a qmake argument:

Note: It is possible to use this variable inside the *.pro file, however, it is not recommended since it will override any ABIs specified on the qmake command line.

ANDROID_API_VERSION

Note: This variable applies only to Android targets.

Specifies the Android API level number. For more information, see Android Build Numbers.

ANDROID_BUNDLED_JAR_DEPENDENCIES

Note: This variable applies only to Android modules.

ANDROID_DEPLOYMENT_DEPENDENCIES

Note: This variable applies only to Android targets.

Note: Only the Qt files specified with this variable are included. Failing to include all the correct files can result in crashes. It’s also important to make sure the files are listed in the correct loading order. This variable provides a way to override the automatic detection entirely, so if a library is listed before its dependencies, it will fail to load on some devices.

ANDROID_DEPLOYMENT_SETTINGS_FILE

Note: This variable applies only to Android targets.

ANDROID_EXTRA_LIBS

Note: This variable applies only to Android targets.

A list of external libraries that will be copied into your application’s libs folder and loaded on start-up. This can be used, for instance, to enable OpenSSL in your application. For more information, see Adding OpenSSL Support for Android.

To include external libraries for multiple ABIs, where each ABIs has its own directory, use the following:

Otherwise, if the ABI is included in the library name, use the following:

ANDROID_EXTRA_PLUGINS

Note: This variable applies only to Android targets.

Specifies a path to C++ plugins or resources that your application has to bundle but that cannot be delivered through the assets system, such as QML plugins. With this variable, androiddeployqt will make sure everything is packaged and deployed properly.

ANDROID_EXTRA_PLUGINS must point to the directory where the extra plugin(s) are built. In addition, the build directory structure must follow a naming convention similar to Qt plugins, that is, plugins/

This will ensure that the correct name mangling is applied to the plugin library (plugins/myplugin/libplugins_imageformats_myplugin_armeabi-v7a.so).

Then, assuming an extra image format plugin myplugin is built as $$DESTDIR/plugins/myplugin/, the following ensures it is packaged correctly:

ANDROID_FEATURES

Note: This variable applies only to Android modules.

Specifies a module’s features list:

For more information, see Android Docs.

ANDROID_LIB_DEPENDENCIES

Note: This variable applies only to Android modules.

This is useful when writing a Qt module. It specifies a list of pre-built dependencies used by the module, for example:

ANDROID_MIN_SDK_VERSION

Note: This variable applies only to Android targets.

Specifies the minimum Android API level for the project. By default, this variable is set to API level 21.

ANDROID_PACKAGE_SOURCE_DIR

Note: This variable applies only to Android targets.

Specifies the path for a custom Android package template. The Android package template contains:

The path specified by this variable can contain custom Java classes under src directory. By default, the androiddeployqt tool copies the application template from the Qt for Android installation path into your project’s build directory, then it copies the contents of the path specified by this variable on top of that, overwriting any existing files. For instance, you can make a custom AndroidManifest.xml for your application, then place this directly into the directory specified by this variable.

ANDROID_PERMISSIONS

Note: This variable applies only to Android modules.

Specifies a module’s permissions list:

For more information, see Android Docs.

ANDROID_TARGET_SDK_VERSION

Note: This variable applies only to Android targets.

Specifies the target Android API level for the project. By default, this variable is set to API level 30.

ANDROID_VERSION_CODE

Note: This variable applies only to Android targets.

Specifies the application’s version number. For more information, see Android App Versioning.

ANDROID_VERSION_NAME

Note: This variable applies only to Android targets.

Specifies the application’s version in as a human readable string. For more information, see Android App Versioning.

CONFIG

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

Note: The values are case-sensitive.

The following CONFIG values control compiler and linker flags:

Note: The use of this option is discouraged. Specify dependencies as described in the SUBDIRS variable documentation.

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.

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.

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

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

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.

DEFINES

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

DEFINES_DEBUG

Specifies preprocessor defines for the debug configuration. The values of this variable get added to DEFINES after 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 after the project is loaded. This variable is typically set in qmake.conf and rarely needs to be modified.

Note: For MSVC mkspecs, this variable contains the value NDEBUG by default.

This variable was introduced in Qt 5.13.2.

DEF_FILE

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

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.

DISTFILES

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

DLLDESTDIR

Note: 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.

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.

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.

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

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:

For more information, see Installing Files.

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

JAVA_HOME

Note: This variable is useful only to Android targets.

Specifies the JDK/OpenJDK installation path used for building the project.

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.

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

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:

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.

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.

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.

OBJECTIVE_SOURCES

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

OBJECTS

OBJECTS_DIR

Specifies the directory where all intermediate objects should be placed.

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.

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

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.

Note: 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.

Note: Do not attempt to overwrite the value of this variable.

QM_FILES_RESOURCE_PREFIX

QM_FILES_INSTALL_PATH

QML_IMPORT_PATH

This variable is only used by Qt Creator. See Qt Creator: Using QML Modules with Plugins for details.

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.

Note: Do not attempt to overwrite the value of this variable.

QMAKE_AR_CMD

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

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

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

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

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

QMAKE_CFLAGS_SHLIB

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

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

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

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

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.

Note: 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.

QMAKE_EXT_UI

Contains the extension used on Qt Designer UI files.

QMAKE_EXT_PRL

Contains the extension used on created PRL files.

QMAKE_EXT_LEX

Contains the extension used on files given to Lex.

QMAKE_EXT_YACC

Contains the extension used on files given to Yacc.

QMAKE_EXT_OBJ

Contains the extension used on generated object files.

QMAKE_EXT_CPP

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

QMAKE_EXT_H

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

QMAKE_EXTRA_COMPILERS

Specifies a list of additional compilers or preprocessors.

QMAKE_EXTRA_TARGETS

Specifies a list of additional qmake targets.

QMAKE_FAILED_REQUIREMENTS

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

QMAKE_FRAMEWORK_BUNDLE_NAME

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

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

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

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 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_OPENVG

Specifies the location of OpenVG header files to be added to INCLUDEPATH when building a target with OpenVG support. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

If the OpenVG implementation uses EGL then QMAKE_INCDIR_EGL may also need to be set.

QMAKE_INCDIR_X11

Note: This variable is used on Unix platforms only.

Specifies the location of X11 header file paths to be added to INCLUDEPATH when building an X11 target. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

QMAKE_INFO_PLIST

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

Note: Most of the time, the default Info.plist is good enough.

QMAKE_IOS_DEPLOYMENT_TARGET

Note: This variable is used on the iOS platform only.

Specifies the hard minimum version of iOS that the application supports.

QMAKE_LFLAGS

Specifies a general set of flags that are passed to the linker. If you need to change the flags used for a particular platform or type of project, use one of the specialized variables for that purpose instead of this variable.

QMAKE_LFLAGS_CONSOLE

Note: This variable is used on Windows only.

Specifies the linker flags for building console programs. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

QMAKE_LFLAGS_DEBUG

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

QMAKE_LFLAGS_PLUGIN

Specifies the linker flags for building plugins. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

QMAKE_LFLAGS_RPATH

Note: This variable is used on Unix platforms only.

Specifies the linker flags needed to use the values from QMAKE_RPATHDIR.

The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

QMAKE_LFLAGS_REL_RPATH

Specifies the linker flags needed to enable relative paths in QMAKE_RPATHDIR.

The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

QMAKE_REL_RPATH_BASE

Specifies the string the dynamic linker understands to be the location of the referring executable or library.

The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

QMAKE_LFLAGS_RPATHLINK

Specifies the linker flags needed to use the values from QMAKE_RPATHLINKDIR.

The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

QMAKE_LFLAGS_RELEASE

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

QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO

QMAKE_LFLAGS_APP

Specifies the linker flags for building applications. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

QMAKE_LFLAGS_SHLIB

Specifies the linker flags used for building shared libraries. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

QMAKE_LFLAGS_SONAME

QMAKE_LFLAGS_THREAD

Specifies the linker flags for building multi-threaded projects. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

QMAKE_LFLAGS_WINDOWS

Note: This variable is used on Windows only.

Specifies the linker flags for building Windows GUI projects (that is, non-console applications). The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

QMAKE_LIBDIR

Specifies a list of library search paths for all projects. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

To specify additional search paths in project files, use LIBS like that, instead:

QMAKE_LIBDIR_POST

Specifies a list of system library search paths for all projects. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

QMAKE_LIBDIR_FLAGS

Note: This variable is used on Unix platforms only.

QMAKE_LIBDIR_EGL

Specifies the location of the EGL library directory, when EGL is used with OpenGL/ES or OpenVG. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

QMAKE_LIBDIR_OPENGL

Specifies the location of the OpenGL library directory. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

If the OpenGL implementation uses EGL (most OpenGL/ES systems), then QMAKE_LIBDIR_EGL may also need to be set.

QMAKE_LIBDIR_OPENVG

Specifies the location of the OpenVG library directory. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

If the OpenVG implementation uses EGL, then QMAKE_LIBDIR_EGL may also need to be set.

QMAKE_LIBDIR_X11

Note: This variable is used on Unix platforms only.

Specifies the location of the X11 library directory. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

QMAKE_LIBS

Specifies additional libraries each project needs to link against. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

To specify libraries in a project file, use LIBS instead.

QMAKE_LIBS_PRIVATE

Specifies additional private libraries each project needs to link against. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

To specify private libraries in a library project file, use LIBS_PRIVATE instead.

QMAKE_LIBS_EGL

QMAKE_LIBS_OPENGL

Specifies all OpenGL libraries. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

If the OpenGL implementation uses EGL (most OpenGL/ES systems), then QMAKE_LIBS_EGL may also need to be set.

QMAKE_LIBS_OPENGL_ES1, QMAKE_LIBS_OPENGL_ES2

These variables specify all the OpenGL libraries for OpenGL ES 1 and OpenGL ES 2.

The value of these variables is typically handled by qmake or qmake.conf and rarely needs to be modified.

If the OpenGL implementation uses EGL (most OpenGL/ES systems), then QMAKE_LIBS_EGL may also need to be set.

QMAKE_LIBS_OPENVG

Some OpenVG engines are implemented on top of OpenGL. This will be detected at configure time and QMAKE_LIBS_OPENGL will be implicitly added to QMAKE_LIBS_OPENVG wherever the OpenVG libraries are linked.

If the OpenVG implementation uses EGL, then QMAKE_LIBS_EGL may also need to be set.

QMAKE_LIBS_THREAD

Note: This variable is used on Unix platforms only.

Specifies all libraries that need to be linked against when building a multi-threaded target. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

QMAKE_LIBS_X11

Note: This variable is used on Unix platforms only.

Specifies all X11 libraries. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

QMAKE_LIB_FLAG

This variable is not empty if the lib template is specified. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

QMAKE_LINK

Specifies the linker that will be used when building application based projects. Only the file name of the linker executable needs to be specified as long as it is on a path contained in the PATH variable when the Makefile is processed. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

QMAKE_LINK_SHLIB_CMD

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_LN_SHLIB

Specifies the command to execute when creating a link to a shared library. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

QMAKE_LRELEASE_FLAGS

List of additional options passed to lrelease when enabled through CONFIG += lrelease.

QMAKE_OBJECTIVE_CFLAGS

Specifies the Objective C/C++ compiler flags for building a project. These flags are used in addition to QMAKE_CFLAGS and QMAKE_CXXFLAGS.

QMAKE_POST_LINK

Specifies the command to execute after linking the TARGET together. This variable is normally empty and therefore nothing is executed.

Note: This variable takes no effect on Xcode projects.

QMAKE_PRE_LINK

Specifies the command to execute before linking the TARGET together. This variable is normally empty and therefore nothing is executed.

Note: This variable takes no effect on Xcode projects.

QMAKE_PROJECT_NAME

Note: This variable is used for Visual Studio project files only.

Determines the name of the project when generating project files for IDEs. The default value is the target name. The value of this variable is typically handled by qmake and rarely needs to be modified.

QMAKE_PROVISIONING_PROFILE

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

The UUID of a valid provisioning profile. Use in conjunction with QMAKE_DEVELOPMENT_TEAM to specify the provisioning profile.

Note: Specifying the provisioning profile disables the automatically managed signing.

QMAKE_MAC_SDK

This variable is used on macOS when building universal binaries.

QMAKE_MACOSX_DEPLOYMENT_TARGET

Note: This variable is used on the macOS platform only.

Specifies the hard minimum version of macOS that the application supports.

QMAKE_MAKEFILE

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

QMAKE_QMAKE

Contains the absolute path of the qmake executable.

Note: Do not attempt to overwrite the value of this variable.

QMAKE_RESOURCE_FLAGS

QMAKE_RPATHDIR

Note: This variable is used on Unix platforms only.

Specifies a list of library paths that are added to the executable at link time so that the paths will be preferentially searched at runtime.

When relative paths are specified, qmake will mangle them into a form understood by the dynamic linker to be relative to the location of the referring executable or library. This is supported only by some platforms (currently Linux and Darwin-based ones) and is detectable by checking whether QMAKE_REL_RPATH_BASE is set.

QMAKE_RPATHLINKDIR

QMAKE_RUN_CC

Specifies the individual rule needed to build an object. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

QMAKE_RUN_CC_IMP

Specifies the individual rule needed to build an object. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

QMAKE_RUN_CXX

Specifies the individual rule needed to build an object. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

QMAKE_RUN_CXX_IMP

Specifies the individual rule needed to build an object. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

QMAKE_SONAME_PREFIX

If defined, the value of this variable is used as a path to be prepended to the built shared library’s SONAME identifier. The SONAME is the identifier that the dynamic linker will later use to reference the library. In general, this reference may be a library name or full library path. On macOS, iOS, tvOS, and watchOS, the path may be specified relatively using the following placeholders:

Placeholder Effect
@rpath Expands to paths defined by LC_RPATH mach-o commands in the current process executable or the referring libraries.
@executable_path Expands to the current process executable location.
@loader_path Expands to the referring executable or library location.

In most cases, using @rpath is sufficient and recommended:

However, the prefix may be also specified using different placeholders, or an absolute path, such as one of the following:

For more information, see dyld documentation on dynamic library install names.

QMAKE_TARGET

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

QMAKE_TARGET_COMPANY

Windows only. Specifies the company for the project target; this is used where applicable for putting the company name in the application’s properties. This is only utilized if the VERSION or RC_ICONS variable is set and the RC_FILE and RES_FILE variables are not set.

QMAKE_TARGET_DESCRIPTION

Windows only. Specifies the description for the project target; this is used where applicable for putting the description in the application’s properties. This is only utilized if the VERSION or RC_ICONS variable is set and the RC_FILE and RES_FILE variables are not set.

QMAKE_TARGET_COPYRIGHT

Windows only. Specifies the copyright information for the project target; this is used where applicable for putting the copyright information in the application’s properties. This is only utilized if the VERSION or RC_ICONS variable is set and the RC_FILE and RES_FILE variables are not set.

QMAKE_TARGET_PRODUCT

Windows only. Specifies the product for the project target; this is used where applicable for putting the product in the application’s properties. This is only utilized if the VERSION or RC_ICONS variable is set and the RC_FILE and RES_FILE variables are not set.

QMAKE_MANIFEST

Windows only. Specifies the manifest file for the project target. This is only utilized if the RC_FILE and RES_FILE variables are not set. Don’t forget to remove embed_manifest_exe and embed_manifest_dll from the CONFIG variable, otherwise it will conflict with the compiler generated one.

QMAKE_TVOS_DEPLOYMENT_TARGET

Note: This variable is used on the tvOS platform only.

Specifies the hard minimum version of tvOS that the application supports.

QMAKE_UIC_FLAGS

This variable is used to customize the list of options passed to the User Interface Compiler in each of the build rules where it is used.

QMAKE_WATCHOS_DEPLOYMENT_TARGET

Note: This variable is used on the watchOS platform only.

Specifies the hard minimum version of watchOS that the application supports.

QML_IMPORT_MAJOR_VERSION

Specifies the major version to be used for automatically generated QML type registrations. For more information, see Defining QML Types from C++.

QML_IMPORT_MINOR_VERSION

When automatically registering QML types defined in C++, register an additional version of the module using this minor version. Generally, minor versions to be registered are inferred from the meta objects.

QML_IMPORT_VERSION

QML_IMPORT_NAME

Specifies the module name to be used for automatically generated QML type registrations. For more information, see Defining QML Types from C++.

QML_FOREIGN_METATYPES

Specifies further JSON files with metatypes to be considered when generating qmltypes files. Use this when external libraries provide types that are exposed to QML, either directly or as base types or properties of other types. Qt types will automatically be considered and don’t have to be added here.

Specifies the Qt modules that are used by your project. For the value to add for each module, see the module documentation.

At the C++ implementation level, using a Qt module makes its headers available for inclusion and causes it to be linked to the binary.

If you want to build a project without the Qt GUI module, you need to exclude the gui value with the «-=» operator. The following line will result in a minimal Qt project being built:

If your project is a Qt Designer plugin, use the value uiplugin to specify that the project is to be built as a library, but with specific plugin support for Qt Designer. For more information, see Building and Installing the Plugin.

QTPLUGIN

Specifies a list of names of static Qt plugins that are to be linked with an application so that they are available as built-in resources.

qmake automatically adds the plugins that are typically needed by the used Qt modules (see QT ). The defaults are tuned towards an optimal out-of-the-box experience. See Static Plugins for a list of available plugins, and ways to override the automatic linking.

This variable currently has no effect when linking against a shared/dynamic build of Qt, or when linking libraries. It may be used for deployment of dynamic plugins at a later time.

QT_VERSION

Contains the current version of Qt.

QT_MAJOR_VERSION

Contains the current major version of Qt.

QT_MINOR_VERSION

Contains the current minor version of Qt.

QT_PATCH_VERSION

Contains the current patch version of Qt.

RC_FILE

Windows only. Specifies the name of the Windows resource file (.rc) for the target. See Adding Windows Resource Files.

RC_CODEPAGE

RC_DEFINES

Windows only. qmake adds the values of this variable as RC preprocessor macros (/d option). If this variable is not set, the DEFINES variable is used instead.

RC_ICONS

RC_LANG

RC_INCLUDEPATH

Specifies include paths that are passed to the Windows Resource Compiler.

RCC_DIR

Specifies the directory for Qt Resource Compiler output files.

REQUIRES

Specifies a list of values that are evaluated as conditions. If any of the conditions is false, qmake skips this project (and its SUBDIRS) when building.

Note: We recommend using the requires() function instead if you want to skip projects or subprojects when building.

RESOURCES

Specifies the name of the resource collection files (qrc) for the target. For more information about the resource collection file, see The Qt Resource System.

RES_FILE

Windows only. Specifies the name of the Windows resource compiler’s output file for this target. See RC_FILE and Adding Windows Resource Files.

The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

SOURCES

Specifies the names of all source files in the project.

SUBDIRS

This variable, when used with the subdirs template 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.

Note: Multiple dependencies can be listed and they will all be built before the target that depends on them.

Note: Using CONFIG += ordered is discouraged as it can slow down multi-core builds. Unlike the example shown above, all builds will happen sequentially even if they don’t have dependencies.

Beside defining the build order, it is possible to modify the default behavior of SUBDIRS by giving additional modifiers to SUBDIRS elements. Supported modifiers are:

For example, define two subdirectories, both of which reside in a different directory than the SUBDIRS value, and one of the subdirectories must be built before the other:

TARGET

Specifies the name of the target file. Contains the base name of the project file by default.

The project file above would produce an executable named myapp on unix and myapp.exe on Windows.

TARGET_EXT

TARGET_x

Specifies the extension of TARGET with a major version number. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

TARGET_x.y.z

Specifies the extension of TARGET with a version number. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

TEMPLATE

Specifies the name of the template to use when generating the project. The allowed values are:

Option Description
app Creates a Makefile for building applications (the default). See Building an Application for more information.
lib Creates a Makefile for building libraries. See Building a Library for more information.
subdirs Creates a Makefile for building targets in subdirectories. The subdirectories are specified using the SUBDIRS variable.
aux Creates a Makefile for not building anything. Use this if no compiler needs to be invoked to create the target; for instance, because your project is written in an interpreted language.

Note: This template type is only available for Makefile-based generators. In particular, it will not work with the vcxproj and Xcode generators.

vcapp Windows only. Creates an application project for Visual Studio. See Creating Visual Studio Project Files for more information. vclib Windows only. Creates a library project for Visual Studio.

TRANSLATIONS

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

Translation files in TRANSLATIONS will be processed by both lrelease and Using lupdate tools. Use EXTRA_TRANSLATIONS if you want only lrelease to process a file.

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.

UI_DIR

Specifies the directory where all intermediate files from uic should be placed.

VERSION

Specifies the version number of the application if the app template is specified or the version number of the library if the lib template is specified.

VERSION_PE_HEADER

VER_MAJ

Specifies the major version number of the library if the lib template is specified.

VER_MIN

Specifies the minor version number of the library if the lib template is specified.

VER_PAT

Specifies the patch version number of the library if the lib template is specified.

VPATH

Tells qmake where to search for files it cannot open. For example, if qmake looks for SOURCES and finds an entry that it cannot open, it looks through the entire VPATH list to see if it can find the file on its own.

WINDOWS_TARGET_PLATFORM_VERSION

Specifies the targeted Windows version; this corresponds to the tag WindowsTargetPlatformVersion in vcxproj files.

WINDOWS_TARGET_PLATFORM_MIN_VERSION

Specifies the minimum version of the Windows target platform; this corresponds to the tag WindowsTargetPlatformMinVersion in vcxproj files.

WINRT_MANIFEST

Specifies parameters to be passed to the application manifest on UWP. The allowed values are:

You can use any combination of those values.

Additionally, an input manifest file can be specified by using WINRT_MANIFEST.

In case the input manifest file should not be processed and only copied to the target directory, the verbatim configuration needs to be set.

YACCSOURCES

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

_PRO_FILE_

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:

Note: Do not attempt to overwrite the value of this variable.

_PRO_FILE_PWD_

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:

Note: Do not attempt to overwrite the value of this variable.

В© 2021 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 the GNU 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.

Источник

Читайте также:  звукоизоляция канализационного стояка в квартире своими руками
Развивающий портал