When building Qt you can use CMake variables to control the build result.
| 变量 | 描述 | 
|---|---|
| QT_HOST_PATH | Location of the host Qt installation from which host tools may be used during another Qt build, either a regular one or a cross-compiling one. | 
| 
QT_FORCE_BUILD_TOOLS
								 | Forces building tools even if host tools have already been found. Useful when cross-compiling Qt to ensure the SDK has cross-built tools. | 
| 
QT_FORCE_FIND_TOOLS
								 | Uses Qt tools from the pre-built Qt in 
QT_HOST_PATH
								when you do not cross-compile. The variable only takes effect if
QT_FORCE_BUILD_TOOLS
								被设为
ON
								. Otherwise
QT_FORCE_FIND_TOOLS
								does not affect the default behavior. | 
						Qt 模块的加载采用
						
find_package
						
						设置各种变量。
					
注意: 您很少需要直接访问这些变量。像链接到模块的常见任务,应透过每个模块定义的库目标来完成。
						例如,
						
find_package(Qt6 COMPONENTS Widgets)
						
						,当成功时,使以下变量变得可用:
					
| 变量 | 描述 | 
|---|---|
| 
Qt6Widgets_COMPILE_DEFINITIONS
								 | 要使用的编译定义列表,当针对库构建时。 | 
| 
Qt6Widgets_DEFINITIONS
								 | 要使用的定义列表,当针对库构建时。 | 
| 
Qt6Widgets_EXECUTABLE_COMPILE_FLAGS
								 | 要使用的标志字符串,当针对库构建可执行文件时。 | 
| 
Qt6Widgets_FOUND
								 | 描述是否成功找到模块的布尔。 | 
| 
Qt6Widgets_INCLUDE_DIRS
								 | 要使用的 include (包括) 目录列表,当针对库构建时。 | 
| 
Qt6Widgets_LIBRARIES
								 | 模块导入目标的名称: 
Qt6::Widgets
								 | 
| 
Qt6Widgets_PRIVATE_INCLUDE_DIRS
								 | 要使用的私有 include (包括) 目录列表,当针对库构建并使用私有 Qt API 时。 | 
| 
Qt6Widgets_VERSION
								 | 包含模块版本的字符串。 | 
						对于找到的所有包采用
						
find_package
						
						,这些变量的等价物是可用的;它们区分大小写。
					
此外,还有一些变量与特定包无关,但与 Qt 安装本身相关。
| 变量 | 描述 | 
|---|---|
| 
									 | 控制 Qt 版本的整数, 
qt_
								命令被转发给 Qt 5 和 Qt 6 混合工程。需要将其设为
5
								or
6
								先前分别
find_package()
								调用。
								若设为
								 
								若未设置,首
								 | 
| 
QT_LIBINFIX
							 | 保持库名称所用中缀的字符串,当有配置 Qt 采用 
-libinfix
							. | 
| 
								 | 隐藏命令开头采用 
qt_
							,只剩余版本号开头采用
qt6_
							. | 
| 
								 | 隐藏导入目标开头采用 
Qt::
							。相反,需要使用的目标开头采用
Qt6::
							. | 
| 
QT_VISIBILITY_AVAILABLE
							 | 在 Unix,布尔描述 Qt 库和插件是否被编译采用 
-fvisibility=hidden
							。这意味着仅选中符号被导出。 | 
这些变量能影响由 QT 提供的 CMake 命令。它们可以由工程、工具链文件或其它第 3 方包设置。
| 主机系统的特定 Android 体系结构 | |
| Android SDK 的位置 | |
| List of ABIs that the project packages are built for | |
| 传递给 Android 应用程序的自变量列表 | |
| Enables building multi-ABI packages using the autodetected Qt for Android SDK list | |
| Forces or disables release package signing regardless of the build type | |
| Allows to share CMake variables in multi-ABI builds | |
| Signs the .aab package with the specified keystore, alias, and store password | |
| Signs the package with the specified keystore, alias, and store password | |
| Prefix-relative subdirectory for deploying runtime binaries on some target platforms | |
| Directories that are excluded from runtime dependencies search | |
| Prefix-relative subdirectory for deploying program executables on some target platforms | |
| Prefix-relative subdirectory for deploying libraries on some target platforms | |
| Prefix-relative subdirectory for deploying Qt plugins on some target platforms | |
| 用于部署的基位置 | |
| 用于在某些目标平台部署 QML 插件的前缀相对子目录 | |
| 用于设置部署支持的文件名称 | |
| Prefix-relative subdirectory for deploying Qt translations on some target platforms | |
| 启用部署工具的冗余模式 | |
| 主机 Qt 安装的位置,当交叉编译时 | |
| Specifies the language of translatable strings | |
| List of languages to be used for project internationalization | |
| Path to iOS launch screen storyboard used by all targets | |
| Prevents collecting of project-built shared library targets during Android deployment | |
| Prevents collecting of imported targets during Android deployment | |
| 在 iOS 目标完成期间禁用提供后备 APP 捆绑 ID | |
| 在 iOS 目标完成期间禁用提供后备团队 ID | |
| 防止后续调用 qt_standard_project_setup() 做出任何改变 | |
| Set of variables to specify the path to Qt for Android for the corresponding ABI | 
| Enables autogeneration of .qmlls.ini files for QML Language Server | |
| 默认情况下将在其下创建 QML 模块的基输出目录 | 
| Enable verbose logging for all ifcodegen functions | |
| Search path for ifcodegen templates |