Управление файлами в проектах CMake

Когда вы добавляете новые или существующие файлы в проект, Qt Creator автоматически добавляет их в функции ` qt_add_executable`, ` add_executable` или `qt_add_library ` в файле ` CMakeLists.txt `.

Если 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.