- Qt 6.11
- Qt Core
- CMake Global Properties in Qt6 Core
- QT_TARGETS_FOLDER
- Qt 6.11.2 Reference Documentation

# QT_TARGETS_FOLDER

This property was introduced in Qt 6.5.

Note: This property is in technology preview and may change in future releases.

Name of the FOLDER for internal targets that are added by Qt's CMake commands.

By default, this property is not set.

This property only has an effect if CMake's USE_FOLDERS property is `ON`.

Note: The property `QT_TARGETS_FOLDER` must be set before calling qt_standard_project_setup.

## Example

### Enable folder support with default values

Calling qt_standard_project_setup without any parameters enables CMake's folder support. CMake's `AUTOGEN` targets and Qt's internal targets are placed into the folder `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)

### Explicitly set folder names

This example shows how to set the folder names for internal Qt targets.

     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)

If you want CMake's `AUTOGEN` targets to appear in a separate folder, set `AUTOGEN_TARGETS_FOLDER` too.

     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)

See also qt_standard_project_setup.