# CMake 3.31.0 available for download

**URL:** https://discourse.cmake.org/t/cmake-3-31-0-available-for-download/12914
**Category:** Announcements
**Created:** [November 7, 2024, 5:11pm UTC](https://discourse.cmake.org/t/cmake-3-31-0-available-for-download/12914 "2024-11-07T17:11:31Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![johnwparent](https://discourse.cmake.org/user_avatar/discourse.cmake.org/johnwparent/32/2179_2.png) [@johnwparent](https://discourse.cmake.org/u/johnwparent)
#### Post date: [November 7, 2024, 5:11pm UTC](https://discourse.cmake.org/t/cmake-3-31-0-available-for-download/12914/1 "2024-11-07T17:11:31Z")

</div>

We are pleased to announce that CMake 3.31 is now available for download.  
[https://cmake.org/download/](https://cmake.org/download/)

Documentation is available at:  
[https://cmake.org/cmake/help/v3.31](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](https://cmake.org/cmake/help/v3.31/release/3.31.html)

Release milestone is available at:  
[release milestone](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\_\<LANG\>_HOST\_COMPILER\_ID" and  
"CMAKE_\<LANG\>_HOST\_COMPILER\_VERSION" variables were added, where  
“\<LANG\>” is either “CUDA” or “HIP”. They are populated when  
"CMAKE_\<LANG\>\_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  
\<preset\>”.

- 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” variable was added to provide the  
suffix for executable names on the host platform.

- The “CMAKE\_\<LANG\>_HOST\_COMPILER\_ID" and  
"CMAKE_\<LANG\>_HOST\_COMPILER\_VERSION" variables were added, where  
“\<LANG\>” is either “CUDA” or “HIP”. They are populated when  
"CMAKE_\<LANG\>\_COMPILER\_ID” is “NVIDIA” to identify NVCC’s host  
compiler.

- The “CMAKE\_\<LANG\>\_STANDARD\_LINK\_DIRECTORIES” variable was added.  
Toolchain files can set this variable to control which link library  
directory paths are always passed to the compiler for the specified  
language.

- 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.

## Properties

- The “MACOSX\_FRAMEWORK\_BUNDLE\_NAME” target property was added to set  
the “CFBundleName” key in an Apple “FRAMEWORK”'s “Info.plist” file.

- The “UNITY\_BUILD” target property now supports the “CUDA” language.

- The “VS\_FRAMEWORK\_REFERENCES” target property was added to tell  
Visual Studio Generators to add framework references.

## Modules

- Check modules now support a “CMAKE\_REQUIRED\_LINK\_DIRECTORIES”  
variable. The following modules gained this support:

- The “CMakePackageConfigHelpers” module’s  
“generate\_apple\_platform\_selection\_file()” function gained support  
for iOS Mac Catalyst.

- The “GoogleTest” module “gtest\_discover\_tests()” command gained a  
new “DISCOVERY\_EXTRA\_ARGS” keyword. It allows extra arguments to be  
appended to the command line when querying for the list of tests.

- The “FindCUDAToolkit” module now provides a “CUDA::nvml\_static”  
target.

- The “FindOpenMP” module gained support for the “CUDA” language.

## CTest

- The “ctest\_submit()” command and “ctest -T Submit” step now verify  
TLS server certificates for connections to “https://” URLs by  
default. See the “CTEST\_TLS\_VERIFY” variable for details.

- The “ctest\_submit()” command and “ctest -T Submit” step now require  
TLS 1.2 or higher for connections to “https://” URLs by default.  
See the “CTEST\_TLS\_VERSION” variable for details.

## CPack

- The “CPack DEB Generator” gained a “CPACK\_DEBIAN\_PACKAGE\_MULTIARCH”  
option to support multi-arch packages.

- The “CPack IFW Generator” gained the new  
“CPACK\_IFW\_PACKAGE\_PRODUCT\_IMAGE\_URLS” variable to specify images  
associated with entries of “CPACK\_IFW\_PACKAGE\_PRODUCT\_IMAGES”. This  
feature is available for QtIFW 4.0 and newer.

- The “CPack RPM Generator” gained support for “zstd” as a  
“CPACK\_RPM\_COMPRESSION\_TYPE” value.

- The “CPack” module enables per-machine installation by default in  
the “CPack WIX Generator”. See policy “CMP0172” and the  
“CPACK\_WIX\_INSTALL\_SCOPE” variable.

# Deprecated and Removed Features

- 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.

- The “CMakeFindFrameworks” module has been deprecated via “CMP0173”.  
Projects should use “find\_library()” instead.

- The “Visual Studio 12 2013” generator has been removed.

# Other Changes

- When static libraries on link lines are de-duplicated (by policy  
“CMP0156”), the first occurrence is now kept on all platforms. See  
policy “CMP0179”.

- Empty list elements in the “TEST\_LAUNCHER” and  
“CROSSCOMPILING\_EMULATOR” target properties are now preserved by:

- The “execute\_process()” command’s “ENCODING” option, meaningful on  
Windows, now defaults to “UTF-8”. See policy “CMP0176”.

- 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.

- The “file(DOWNLOAD)” and “file(UPLOAD)” commands now require TLS 1.2  
or higher for connections to “https://” URLs by default. See the  
“CMAKE\_TLS\_VERSION” variable for details.

- The “file(GET\_RUNTIME\_DEPENDENCIES)” command was updated to more  
closely match the dynamic loader’s behavior on Linux.

- The “install()” command’s “DESTINATION” arguments are now  
normalized, with the exception of “INCLUDES DESTINATION” arguments  
in “install(TARGETS)”. See policy “CMP0177”.

- The “project()” command now always sets “\<PROJECT-NAME\>\_SOURCE\_DIR”,  
“\<PROJECT-NAME\>\_BINARY\_DIR”, and “\<PROJECT-NAME\>\_IS\_TOP\_LEVEL” as  
both normal variables and cache entries. See policy “CMP0180”.

- The “cmake\_parse\_arguments(PARSE\_ARGV)” command now defines a  
variable for an empty string after a single-value keyword. See  
policy “CMP0174”.

* * *

Changes made since CMake 3.31.0-rc3:

Ben Boeckel (2):

- ci: use JSON to transfer environment variables
- gitlab-ci: remove `dependencies` from jobs

Brad King (1):

- CMake 3.31.0

---

<div class="post-metadata">

### Author: ![toge](https://discourse.cmake.org/user_avatar/discourse.cmake.org/toge/32/5106_2.png) [@toge](https://discourse.cmake.org/u/toge)
#### Post date: [November 9, 2024, 9:34am UTC](https://discourse.cmake.org/t/cmake-3-31-0-available-for-download/12914/2 "2024-11-09T09:34:55Z")

</div>

Isn’t 3.31.0 is the latest public release?  
In Github repository, 3.30.5 is still the latest release.

 ![image](https://discourse.cmake.org/uploads/default/original/2X/1/1064fadaa400415780dea826ce61c130e0a27def.png)

If 3.31.0 is the latest, could you update it?

---

<div class="post-metadata">

### Author: ![Kelarov](https://discourse.cmake.org/user_avatar/discourse.cmake.org/kelarov/32/4927_2.png) [@Kelarov](https://discourse.cmake.org/u/Kelarov)
#### Post date: [November 9, 2024, 11:37am UTC](https://discourse.cmake.org/t/cmake-3-31-0-available-for-download/12914/3 "2024-11-09T11:37:15Z")

</div>

Funny.  
I didn’t even know CMake was on Github🤔.  
I just knew about its [GitLab Repo](https://gitlab.kitware.com/cmake/cmake/-/tree/v3.31.0?ref_type=tags), though I always download it from cmake.org/download 😅.

---

<div class="post-metadata">

### Author: ![fenrir](https://discourse.cmake.org/user_avatar/discourse.cmake.org/fenrir/32/734_2.png) [@fenrir](https://discourse.cmake.org/u/fenrir)
#### Post date: [November 11, 2024, 10:18am UTC](https://discourse.cmake.org/t/cmake-3-31-0-available-for-download/12914/4 "2024-11-11T10:18:02Z")

</div>

There seem to be an official mirror: [GitHub - Kitware/CMake: Mirror of CMake upstream repository](https://github.com/Kitware/CMake).

The code itself is up-to-date, but the releases are not.

---

<div class="post-metadata">

### Author: ![Kelarov](https://discourse.cmake.org/user_avatar/discourse.cmake.org/kelarov/32/4927_2.png) [@Kelarov](https://discourse.cmake.org/u/Kelarov)
#### Post date: [November 11, 2024, 11:41am UTC](https://discourse.cmake.org/t/cmake-3-31-0-available-for-download/12914/5 "2024-11-11T11:41:47Z")

</div>

Oh, I see. There’s the 3.31.0 [release tag](https://github.com/Kitware/CMake/releases/tag/v3.31.0), but GH still shows 3.30.5 as being the latest release.

It could be a GitHub issue, maybe

---

<div class="post-metadata">

### Author: ![fenrir](https://discourse.cmake.org/user_avatar/discourse.cmake.org/fenrir/32/734_2.png) [@fenrir](https://discourse.cmake.org/u/fenrir)
#### Post date: [November 11, 2024, 12:01pm UTC](https://discourse.cmake.org/t/cmake-3-31-0-available-for-download/12914/6 "2024-11-11T12:01:53Z")

</div>

I don’t think it’s a GitHub issue. One has to create a release from a tag explicitly. Just tagging a commit does not create a release.

---

<div class="post-metadata">

### Author: ![johnwparent](https://discourse.cmake.org/user_avatar/discourse.cmake.org/johnwparent/32/2179_2.png) [@johnwparent](https://discourse.cmake.org/u/johnwparent)
#### Post date: [November 11, 2024, 4:19pm UTC](https://discourse.cmake.org/t/cmake-3-31-0-available-for-download/12914/7 "2024-11-11T16:19:19Z")

</div>

Thank you all for informing us of this oversight, it has since been addressed, the 3.31 release is now designated “latest” on Github.

> I didn’t even know CMake was on Github🤔.

As @fenrir kindly pointed out, this is our downstream mirror! We provide this as an additional endpoint to acquire CMake and check out the source.

> One has to create a release from a tag explicitly. Just tagging a commit does not create a release.

This is correct as well, our release process has been updated to ensure oversights like this are avoided in the future, thanks to all again for bringing this to our attention!
