Gestire i file nei progetti CMake

Quando si aggiungono file nuovi o esistenti a un progetto, Qt Creator li aggiunge automaticamente alle funzioni qt_add_executable, add_executable o qt_add_library nel file CMakeLists.txt.

Se Qt Creator non è in grado di riconoscere dove viene creato il target, utilizzerà la funzione target_sources per aggiungere i file.

Per i progetti Qt Quick, i file vengono aggiunti alla funzione qt_add_qml_module, preceduti dall’argomento della funzione QML_FILES, SOURCES o RESOURCES.

Quando si rinominano o si rimuovono file nella vista Progetti o File system, Qt Creator li rinomina nel file CMakeLists.txt oppure li rimuove da esso.

Vedi anche Aggiunta di file, Procedura: Compilazione con CMake, CMake, File System e Progetti.

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.