I am proud to announce the second CMake 3.31 release candidate.
https://cmake.org/download/
Documentation is available at:
https://cmake.org/cmake/help/v3.31
Release notes appear below and are also published at
https://cmake.org/cmake/help/v3.31/release/3.31.html
Release milestone is available at:
https://gitlab.kitware.com/cmake/cmake/-/milestones/150
Some of the most significant changes in CMake 3.31 are:
* "cmake-presets(7)" files may now include comments using the key
"$comment" at any level within the JSON object to provide
documentation.
* The Ninja Generators and Makefile Generators now produce a "codegen"
build target. See policy "CMP0171". It drives a subset of the
build graph sufficient to run custom commands created with
"add_custom_command()"'s new "CODEGEN" option.
* The "CMAKE_LINK_LIBRARIES_STRATEGY" variable and corresponding
"LINK_LIBRARIES_STRATEGY" target property were added to optionally
specify the strategy CMake uses to generate link lines.
* The "CMAKE_AIX_SHARED_LIBRARY_ARCHIVE" variable and corresponding
"AIX_SHARED_LIBRARY_ARCHIVE" target property were added to create
shared libraries on AIX as shared library archives.
* The "CMAKE_EXPORT_BUILD_DATABASE" variable, a corresponding
"CMAKE_EXPORT_BUILD_DATABASE" environment variable, and an
"EXPORT_BUILD_DATABASE" target property, were added to enable
exporting C++ module compile commands. This is only supported with
Ninja Generators.
* The "CMAKE__HOST_COMPILER_ID" and
"CMAKE__HOST_COMPILER_VERSION" variables were added, where
"" is either "CUDA" or "HIP". They are populated when
"CMAKE__COMPILER_ID" is "NVIDIA" to identify NVCC's host
compiler.
* Compatibility with versions of CMake older than 3.10 is now
deprecated and will be removed from a future version. Calls to
"cmake_minimum_required()" or "cmake_policy()" that set the policy
version to an older value now issue a deprecation diagnostic.
* When static libraries on link lines are de-duplicated (by policy
"CMP0156"), the first occurrence is now kept on all platforms. See
policy "CMP0179".
* The "file(DOWNLOAD)" and "file(UPLOAD)" commands now verify TLS
server certificates for connections to "https://"; URLs by default.
See the "CMAKE_TLS_VERIFY" variable for details. This change was
made without a policy so that users are protected even when building
projects that have not been updated. Users may set the
"CMAKE_TLS_VERIFY" environment variable to "0" to restore the old
default.
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
--
* The Ninja Generators and Makefile Generators now produce a "codegen"
build target. See policy "CMP0171". It drives a subset of the
build graph sufficient to run custom commands created with
"add_custom_command()"'s new "CODEGEN" option.
Command-Line
* The "cmake --workflow" mode now accepts a preset name as the first
argument, allowing the simpler command line "cmake --workflow
".
* The "cmake -LR[A][H]" option was added to list cache entries whose
names match a regular expression.
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 "file(MAKE_DIRECTORY)" command gained a "RESULT" option to
capture failure in a result variable.
* The "install(FILES)" and "install(DIRECTORY)" commands' "TYPE"
argument gained support for a "LIBEXEC" type.
Variables
-
* The "CMAKE_AIX_SHARED_LIBRARY_ARCHIVE" variable and corresponding
"AIX_SHARED_LIBRARY_ARCHIVE" target property were added to create
shared libraries on AIX as shared library archives.
* The "CMAKE_EXPORT_BUILD_DATABASE" variable, a corresponding
"CMAKE_EXPORT_BUILD_DATABASE" environment variable, and an
"EXPORT_BUILD_DATABASE" target property, were added to enable
exporting C++ module compile commands. This is only supported with
Ninja Generators.
* The "CMAKE_HOST_EXECUTABLE_SUFFIX" vari