Qt Creator 11 - CMake update

Below, you have two new CMake features in Qt Creator 11:

Project file management

With Qt Creator 11, it is possible to add new / existing files to a CMake target. Renaming and deleting of source files via the project tree is also supported.

Qt Creator will look after the add_executable, add_library, qt_add_executable, qt_add_library function calls and add the source / resource files at the end.

If a custom CMake API is being used, a target_sources function call will be used instead.

Widgets Example

qtcreator11-widgetsapp

Qt Quick Example

For Qt Quick projects the qt_add_qml_module function is located. The added files will be prefixed with QML_FILES, SOURCES or RESOURCES function arguments.

qtcreator11-quickapp

CMakePresets reloading

Qt Creator 11 will display a CMake Presets project tree item for quicker CMake Presets access.

In the Build menu, there is a Reload CMake Presets entry which will re-create the Kits from the CMakePresets json files.

qtcreator11-reload-presets

 


Blog Topics:

Comments

wu dongliang
1 point
22 months ago

[]~( ̄▽ ̄)~* cheers!exciting features

A
Aleksei
0 points
22 months ago

Is it possible to disable adding new file to a CMake target?

Also I have tried QtCreator 11 and noticed that it doesn't respect CMAKEINSTALLPREFIX variable anymore. On Win QtCreator uses: "C:\tmp\Qt-Creator-staging-6a40d27bf2a7205f\". How this can be disabled?

C
Cristian Adam
0 points
21 months ago

Disabling file adding is not supported. Regarding the second issue I have https://bugreports.qt.io/browse/QTCREATORBUG-29223 which might be related.

E
Eike Ziller
0 points
21 months ago

The only way to avoid adding a file, is to choose "None" for the "Add to project:" combo box on the last wizard page. (That can also be used to use a more sensible target than the auto-chosen one.)