QT_TARGETS_FOLDER
Questa proprietà è stata introdotta in Qt 6.5.
Nome della CARTELLA per i target interni aggiunti dai comandi CMake di Qt.
Per impostazione predefinita, questa proprietà non è impostata.
Questa proprietà ha effetto solo se la proprietà USE_FOLDERS di CMake è impostat ON.
Nota: la proprietà QT_TARGETS_FOLDER deve essere impostata prima di chiamare qt_standard_project_setup().
Esempio
Abilitare il supporto alle cartelle con valori predefiniti
Chiamando qt_standard_project_setup() senza alcun parametro si abilita il supporto delle cartelle di CMake. I target " AUTOGEN " di CMake e i target interni di Qt vengono inseriti nella cartella QtInternalTargets.
cmake_minimum_required(VERSION 3.16...3.22)
project(MyProject)
find_package(Qt6 REQUIRED COMPONENTS Core)
qt_standard_project_setup()
qt_add_executable(MyApp main.cpp)Impostare esplicitamente i nomi delle cartelle
Questo esempio mostra come impostare i nomi delle cartelle per i target interni di Qt.
cmake_minimum_required(VERSION 3.16...3.22)
project(MyProject)
find_package(Qt6 REQUIRED COMPONENTS Core)
set_property(GLOBAL PROPERTY QT_TARGETS_FOLDER "MyQtTargets")
qt_standard_project_setup()
qt_add_executable(MyApp main.cpp)Se si desidera che i target " AUTOGEN " di CMake appaiano in una cartella separata, impostare anche ` AUTOGEN_TARGETS_FOLDER `.
cmake_minimum_required(VERSION 3.16...3.22)
project(MyProject)
find_package(Qt6 REQUIRED COMPONENTS Core)
set_property(GLOBAL PROPERTY QT_TARGETS_FOLDER "MyQtTargets")
set_property(GLOBAL PROPERTY AUTOGEN_TARGETS_FOLDER "MyAutogenTargets")
qt_standard_project_setup()
qt_add_executable(MyApp main.cpp)Vedi anche qt_standard_project_setup().
© 2026 The Qt Company Ltd. 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.