CMake 3.31 Release Notes

Changes made since CMake 3.30 include the following.

New Features

Presets

  • cmake-presets(7) files may now include comments using the key $comment at any level within the JSON object to provide documentation.

  • cmake-presets(7) files may now request graphviz output using the graphviz key in a configure preset.

Generators

Command-Line

Compilers

  • The LFortran compiler is now supported with compiler id LFortran.

Commands

  • The add_custom_command() command gained a CODEGEN option to mark a custom command's outputs as dependencies of a codegen target. See policy CMP0171.

  • The cmake_pkg_config() command was added as an endpoint for using CMake's native pkg-config format parser. The only supported option in this release is EXTRACT, which provides low-level access to the values produced by parsing a pkg-config file. For most users, this is not yet a suitable replacement for the FindPkgConfig module.

  • The file(ARCHIVE_CREATE) command gained a WORKING_DIRECTORY option to specify a working directory for the archiving process.

  • The install(FILES) and install(DIRECTORY) commands' TYPE argument gained support for a LIBEXEC type.

Variables

Properties

Modules

CTest

CPack

Deprecated and Removed Features

Other Changes