CMake 3.21 Release Notes¶
Changes made since CMake 3.20 include the following.
New Features¶
Presets¶
cmake-presets(7)gained support for specifying the install prefix in a configure preset.cmake-presets(7)gained support for conditional enabling of presets.cmake-presets(7)gained support for a${hostSystemName}macro.cmake-presets(7)gained support for omitting thegeneratorandbinaryDirfields.
Generators¶
The
Visual Studio 17 2022generator was added.The Makefile Generators and the
Ninjagenerator learned to add linker launcher tools along with the linker forC,CXX,OBJC, andOBJCXXlanguages. See theCMAKE_<LANG>_LINKER_LAUNCHERvariable and<LANG>_LINKER_LAUNCHERtarget property for details.
Languages¶
CMake learned to support
HIPas a first-class language that can be enabled via theproject()andenable_language()commands.C_STANDARD,OBJC_STANDARD, and theCompile Featuresfunctionality gained support for C17 and C23.Source file extensions
.ixxand.cppmare now treated as C++.
Command-Line¶
cmake(1)gained the--install-prefixcommand-line option to specify the location of the install prefix.cmake(1)gained the--toolchaincommand-line option to specify a toolchain file.cmake(1)-E capabilitiesoutput, for some generators, may now contain asupportedPlatformsfield listing platforms known to be supported inCMAKE_GENERATOR_PLATFORM.Messages printed to a terminal now may be colored by message type.
Compilers¶
The Fujitsu compiler is now supported using compiler id
Fujitsuin traditional (Trad) mode, and compiler idFujitsuClanginClangmode.
Platforms¶
CMake now supports the MSYS runtime environment, much like CYGWIN.
File-Based API¶
The
cmake-file-api(7)"codemodel" version 2versionfield has been updated to 2.3.The
cmake-file-api(7)"codemodel" version 2 gained a new "directory" object containing directory-level information. This includes a list of installers generated by theinstall()command.
Commands¶
The
add_custom_command()commandDEPFILEoption:may now use
generator expressions,is now supported by Visual Studio Generators for VS 2012 and above, and
is now supported by the
Xcodegenerator.
The
add_custom_command(TARGET)command (for Build Events) gained support for resolving target-dependent generator expressions.The