CMake 3.21.0-rc2 is ready for testing

I am proud to announce the second CMake 3.21 release candidate.

Documentation is available at:

Release notes appear below and are also published at

Some of the more significant changes in CMake 3.21 are:

  • CMake learned to support “HIP” as a first-class language that can be
    enabled via the “project()” and “enable_language()” commands.
  • The “Visual Studio 17 2022” generator was added. This is
    experimental and based on “Visual Studio 2022 Preview 1.1” because
    this version of VS has not been released.
  • The Makefile Generators and the “Ninja” generator learned to add
    linker launcher tools along with the linker for “C”, “CXX”, “OBJC”,
    and “OBJCXX” languages. See the “CMAKE_<LANG>_LINKER_LAUNCHER”
    variable and “<LANG>_LINKER_LAUNCHER” target property for details.
  • “C_STANDARD”, “OBJC_STANDARD”, and the “Compile Features”
    functionality gained support for C17 and C23.
  • “cmake(1)” gained the “–toolchain <path/to/file>” command-line
    option to specify a toolchain file.
  • Messages printed to a terminal now may be colored by message type.
  • The Fujitsu compiler is now supported using compiler id “Fujitsu” in
    traditional (“Trad”) mode, and compiler id “FujitsuClang” in “Clang”
  • The “add_custom_command()” command “DEPFILE” option:
    • may now use “generator expressions”,
    • is now supported by Visual Studio Generators for VS 2012 and
      above, and
    • is now supported by the “Xcode” generator.
  • The “add_custom_command(TARGET)” command (for Build Events) gained
    support for resolving target-dependent generator expressions.
  • The “install(TARGETS)” command gained new “RUNTIME_DEPENDENCIES” and
    “RUNTIME_DEPENDENCY_SET” arguments, which can be used to install
    runtime dependencies using “file(GET_RUNTIME_DEPENDENCIES)”.
  • A new “TARGET_RUNTIME_DLLS” generator expression was added.
  • “ctest(1)” gained a “–output-junit” option to write test results to
    a JUnit XML file.
  • The “ctest_build()” command gained a “PARALLEL_LEVEL” option.
  • “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”.
  • The “foreach()” command now isolates loop variables in the loop
    scope. See policy “CMP0124” for details.

Questions or comments are always welcome!