Here are the new CMake features and fixes in Qt Creator 15:
More feature parity with QMake projects
Qt Creator 15 allows adding subprojects for CMake projects. This can be done via right-click context menu on the project and selecting New Subproject …

This newly added subproject can be independently built / clean / rebuild. Either from the right-click context menu, or from the top-level Build menu.

Notice that the Forms directory has the pencil icon in the same way as a QMake project!
This is available for the projects that have the Package manager auto-setup enabled, since currently it’s the only way for Qt Creator to integrate the following piece of CMake code:
option(QT_CREATOR_SOURCE_GROUPS "Qt Creator source groups extensions" ON)
if (QT_CREATOR_SOURCE_GROUPS)
source_group("Resources" REGULAR_EXPRESSION "\\.(pdf|plist|png|jpeg|jpg|storyboard|xcassets|qrc|svg|gif|ico|webp)$")
source_group("Forms" REGULAR_EXPRESSION "\\.(ui)$")
source_group("State charts" REGULAR_EXPRESSION "\\.(scxml)$")
endif()
CMake targets have the associated CMakeLists.txt file node
Below you can see that every subproject, which is marked as a folder with the CMake logo icon, now includes an Open … entry in its context menu. This action allows access to the corresponding CMakeLists.txt
file.
Notably, each CMake target has a file node with its defining CMakeLists.txt
file in the Projects view.
This change also renders the Simplify Tree view less cluttered with CMakeLists.txt
entries.

FOLDER property support
When using the FOLDER property in CMake projects for organising their structures, Qt Creator will now reflect and display these folder hierarchies.

Loading of a project via CMakeCache.txt
Qt Creator 15 can load a CMake project via the <build-dir>/CMakeCache.txt
file. This is equivalent to opening the CMakeLists.txt
project and then importing the <build-dir>
configuration.

Package manager auto-setup: Windows UTF-8 challenge
The objective here is to display the text Holiday Greetings 🌲✨ ! in the console output. Furthermore, the project has to reside within a folder named HolidayGreetings🌲✨.
The Windows configuration is a standard English (United States) language setting, as seen below:

To fulfill the need to output UTF-8 Unicode text within an English locale environment, we will use the {fmt} library, which will be supplied by Conan. The source code for CMakeLists.txt
, main.cpp
and conanfile.txt
is below:
cmake_minimum_required(VERSION 3.16)
project(HolidayGreetings🌲✨)
set(CMAKE_CXX_STANDARD 17)
find_package(fmt CONFIG REQUIRED)
add_executable(HolidayGreetings main.cpp)
target_link_libraries(HolidayGreetings PRIVATE fmt::fmt)
#include <fmt/printf.h>
int main()
{
fmt::print("Holiday Greetings 🌲✨ !\n");
return 0;
}
[requires]
fmt/11.0.0
