\ingroupcreator-how-to-build-with-cmake

\titleManage files in CMake projects

When you use project wizard templates to add files to a project, Qt Creator automatically adds them to the qt_add_executable, add_executable, or qt_add_library function in the CMakeLists.txt file.

If you use custom API, Qt Creator uses the target_sources function to add the files.

For Qt Quick projects, the files are added to the qt_add_qml_module function, prefixed with the QML_FILES, SOURCES, or RESOURCES function argument.

When you rename or remove files in the Projects or File System view, Qt Creator renames them in the CMakeLists.txt file or removes them from it.

See also CMake, Add libraries to CMake projects, Create files, Edit CMake configuration files, View CMake project contents, File System, and Projects.