CMake 3.21 Release Notes

Changes made since CMake 3.20 include the following.

New Features

Presets

Generators

Languages

Command-Line

  • cmake(1) gained the --install-prefix <dir> command-line option to specify the location of the install prefix.

  • cmake(1) gained the --toolchain <path/to/file> command-line option to specify a toolchain file.

  • cmake(1) -E capabilities output, for some generators, may now contain a supportedPlatforms field listing platforms known to be supported in CMAKE_GENERATOR_PLATFORM.

  • Messages printed to a terminal now may be colored by message type.

Compilers

  • The Fujitsu compiler is now supported using compiler id Fujitsu in traditional (Trad) mode, and compiler id FujitsuClang in Clang mode.

Platforms

  • CMake now supports the MSYS runtime environment, much like CYGWIN.

File-Based API

  • The cmake-file-api(7) "codemodel" version 2 version field 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 the install() command.

Commands

Variables

Properties

Modules

  • The FindBLAS and FindLAPACK modules learned to support the serial Fujitsu_SSL2 and parallel Fujitsu_SSL2BLAMP libraries.

  • The FindDevIL module now provides imported targets.

  • The FindIconv module now has version support.

  • The FindIntl module now has version support.

  • The FindMPI module learned to support Fujitsu and FujitsuClang in both host and cross compiling modes.

  • The FindMsys module was added to find MSYS installations. Like FindCygwin, it is used automatically by some other find modules to locate UNIX-style tools on Windows.

  • The FindOpenMP module learned to support Fujitsu and FujitsuClang.

  • The FindVulkan module gained imported targets Vulkan::Headers and Vulkan::glslangValidator.

  • The UseJava module command add_jar gained a RESOURCES option to allow explicit naming of resources with non-optional namespace.

  • The UseSWIG module use now standard library naming conventions for the CSharp language. See policy CMP0122.

  • The UseSWIG module now supports using the swig tool to generate implicit dependencies with the Xcode generator.

Generator Expressions

CTest

CPack

Deprecated and Removed Features

  • Undocumented CMAKE_SYSTEM_NAME version-stripping behavior has been removed entirely. If it is set by a -D flag or by a toolchain file, it is left unaltered, even if it still contains a version number. Similar CMAKE_HOST_SYSTEM_NAME version-stripping behavior, also undocumented, has been moved earlier, before project() or enable_language() is called.

  • ARMClang cpu/arch compile and link flags are no longer added automatically based on the CMAKE_SYSTEM_PROCESSOR variable or the undocumented CMAKE_SYSTEM_ARCH variable. They must be specified explicitly. See policy CMP0123.

Other Changes

Updates

Changes made since CMake 3.21.0 include the following.

3.21.1

  • The Visual Studio 17 2022 generator is now based on "Visual Studio 2022 Preview 2". Previously it was based on "Preview 1.1".