管理 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.