Manage files in CMake projects | Qt Creator Documentation

- Qt Creator Documentation
- Manage files in CMake projects
- Qt Creator 19.0.1

Format CMake files ◦ Override CMake settings for a project

# Manage files in CMake projects

When you add new or existing 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 Qt Creator cannot recognize where the target is created, it will use 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 Adding files, How to: Build with CMake, CMake, File System, and Projects.

Format CMake files ◦ Override CMake settings for a project