Qt6 核心中的 CMake 命令

以下 CMake 命令在加载 Qt6::Core 时定义,例如用

find_package(Qt6 REQUIRED COMPONENTS Core)

另请参阅 CMake 命令参考

qt_add_android_permission

为目标可执行文件添加 Android 权限。

qt_add_big_resources

将大二进制资源编译为目标代码。

qt_add_binary_resources

从 Qt 资源文件列表创建 RCC 文件。

qt_add_executable

创建并最终确定特定平台类型的应用程序目标。

qt_add_library

创建并最终确定一个库。

qt_add_plugin

创建 Qt 插件目标。

qt_add_resources

将二进制资源编译为源代码。

qt_add_win_app_sdk

将 Windows App SDK 库添加到应用程序。

qt_allow_non_utf8_sources

防止强制将源文件视为 Windows UTF-8。

qt_android_add_apk_target

定义运行 androiddeployqt 生成 APK 的构建目标。

qt_android_apply_arch_suffix

配置目标二进制文件的名称,使其包含特定架构的后缀。

qt_android_generate_deployment_settings

生成 androiddeployqt 所需的部署设置文件。

qt_deploy_qt_conf

在部署时编写 qt.conf 文件。

qt_deploy_runtime_dependencies

部署可执行文件所需的 Qt 插件、Qt 和非 Qt 库。

qt_deploy_translations

部署可执行程序所需的 Qt 翻译。

qt_disable_unicode_defines

防止在目标机上自动设置某些与 unicode 相关的编译器定义。

qt_extract_metatypes

从 Qt 目标机中提取元类型,并生成相关的 metatypes.json 文件。

qt_finalize_project

处理与 Qt 项目相关的各种常见平台特定任务。

qt_finalize_target

处理与 Qt 目标相关的各种常见平台特定任务。

qt_generate_deploy_app_script

为应用程序生成部署脚本。

qt_generate_deploy_script

生成自定义部署脚本

qt_generate_moc

在输入文件上调用 moc

qt_import_plugins

指定要导入或排除的自定义插件集。

qt_policy

修改 Qt CMake API 的默认行为。

qt_set_finalizer_mode

自定义目标最终完成的各个方面。

qt_standard_project_setup

将整个项目的默认设置设置为标准安排。

qt_wrap_cpp

从源代码创建 .moc 文件。

© 2025 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.