June 18, 2025 by Cristian Adam | Comments
Here are the new CMake changes in Qt Creator 17:
Qt Creator implements a find_package() dependecy provider as part of the package manager auto-setup feature.
This dependency provider checks every find_package()
CMake call for required Qt components. If a Qt component is not installed, Qt Maintenance Tool will be started to install the required component.
See below the setup of the Dice example when configured on a system that lacks Qt Multimedia.
By default Qt Maintenance Tool will be started in GUI mode. By setting QT_CREATOR_MAINTENANCE_TOOL_PROVIDER_USE_CLI
to ON
then the CLI mode from Qt Maintenance Tool will be used. This mode will install components without asking the user.
When using a C++ header from an installed Qt compoment, but which is not available due to the lack of build system setup, Qt Creator will issue a fix-it that would add the in the build system the required configuration.
In case for Qt Multimedia and CMake this is the equivalent:
find_package(Qt6 REQUIRED COMPONENTS Multimedia) target_link_libraries(WidgetsDemo PRIVATE Qt6::Multimedia)
Given the Android CMake preset below:
{ "version": 4, "cmakeMinimumRequired": { "major": 3, "minor": 23, "patch": 0 }, "configurePresets": [ { "name": "android-clang-arm64", "displayName": "Android Clang Arm64", "binaryDir": "${sourceDir}/build-${presetName}", "generator" : "Ninja", "cacheVariables": { "QT_HOST_PATH" : "C:/QtArm64/6.8.3/msvc2022_arm64", "CMAKE_PREFIX_PATH" : "C:/QtArm64/6.8.3/android_arm64_v8a", "CMAKE_FIND_ROOT_PATH" : "C:/QtArm64/6.8.3/android_arm64_v8a", "ANDROID_PLATFORM" : "android-31", "ANDROID_STL": "c++_shared", "ANDROID_ABI" : "arm64-v8a", "ANDROID_SDK_ROOT": "C:/Tools/Android/Sdk", "ANDROID_NDK" : "C:/Tools/Android/Sdk/ndk/26.1.10909125", "CMAKE_TOOLCHAIN_FILE": "C:/Tools/Android/Sdk/ndk/26.1.10909125/build/cmake/android.toolchain.cmake" } } ] }
... after configuring the project, the resulting Kit will have an Android device selected for 'Run Device'.
This time is about the %{Project:Name}
Qt Creator macro. Previous Qt Creator versions would set the parent project directory as the %{Project:Name}
since the project name is not part of the project file name. All project files are named CMakeLists.txt
, unlike project.pro
for qmake.
Qt Creator 17 will parse the CMakeLists.txt
after the project()
CMake function call and use that for %{ProjectName}
.
Download the latest release here: www.qt.io/download.
Qt 6.9 is now available, with new features and improvements for application developers and device creators.
Check out all our open positions here and follow us on Instagram to see what it's like to be #QtPeople.
Jun 25, 2025
We are excited to announce the launch of a new Qt Training page, which..
Jun 24, 2025
At Qt, we often say it's not just about building software—it's about..
Jun 24, 2025
The latest updates to qmlformat, Qt's own tool for formatting of QML..