Manage files in CMake projects | Qt Creator Documentation

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

How To

# 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 Create files, How To: Build with CMake, CMake, File System, and Projects.

How To