管理 CMake 项目中的文件
当您将新文件或现有文件添加到项目中时,Qt Creator 会自动将它们添加到CMakeLists.txt 文件中的qt_add_executable、add_executable 或qt_add_library函数中。
如果Qt Creator 无法识别目标的创建位置,它将使用target_sources函数来添加这些文件。
对于Qt Quick 项目,这些文件将被添加到qt_add_qml_module函数中,并以QML_FILES 、SOURCES 或RESOURCES 函数参数作为前缀。
当您在“项目”或“文件系统”视图中重命名或删除文件时,Qt Creator 会相应地在CMakeLists.txt 文件中重命名或删除这些文件。
另请参阅 “添加文件”、“操作指南:使用 CMake 构建”、“CMake”、“文件系统”和“项目”。
Copyright © The Qt Company Ltd. and other contributors. 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.