# CMake 3.20.0 available for download

**URL:** https://discourse.cmake.org/t/cmake-3-20-0-available-for-download/2999
**Category:** Announcements
**Created:** [March 23, 2021, 5:36pm UTC](https://discourse.cmake.org/t/cmake-3-20-0-available-for-download/2999 "2021-03-23T17:36:29Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Tom\_Osika](https://discourse.cmake.org/user_avatar/discourse.cmake.org/tom_osika/32/1101_2.png) [@Tom\_Osika](https://discourse.cmake.org/u/Tom_Osika)
#### Post date: [March 23, 2021, 5:36pm UTC](https://discourse.cmake.org/t/cmake-3-20-0-available-for-download/2999/1 "2021-03-23T17:36:29Z")

</div>

I am happy to announce that CMake 3.20.0 is now available for download at:  
[https://cmake.org/download/](https://cmake.org/download/)

Documentation is available at:  
[https://cmake.org/cmake/help/v3.20](https://cmake.org/cmake/help/v3.20)

Release notes appear below and are also published at  
[https://cmake.org/cmake/help/v3.20/release/3.20.html](https://cmake.org/cmake/help/v3.20/release/3.20.html)

Some of the more significant changes in CMake 3.20 are:

- “cmake-presets(7)” gained support for build and test presets.

- C++23 compiler modes may now be specified via the “CXX\_STANDARD”,  
“CUDA\_STANDARD”, or “OBJCXX\_STANDARD” target properties, or via the  
“Compile Features” functionality’s “cxx\_std\_23” meta-feature.

- The NVIDIA HPC SDK compilers are now supported with compiler id  
“NVHPC”.

- CMake’s support for Cross Compiling for Android is now merged with  
the Android NDK’s toolchain file. They now have similar behavior,  
though some variable names differ.

- The “cmake-file-api(7)” gained a new “toolchains” object kind that  
describes the compiler used for each enabled language.

- “add\_custom\_command()” and “add\_custom\_target()” now support  
“generator expressions” in their “OUTPUT” and “BYPRODUCTS” options.

- The “cmake\_path()” command was added for operations on filesystem  
paths.

- The “target\_sources()” command now supports targets created by the  
“add\_custom\_target()” command.

- The “ExternalProject” module “ExternalProject\_Add()” function gained  
a “CONFIGURE\_HANDLED\_BY\_BUILD” option. This can be used to make  
subsequent runs of the configure step be triggered by the build step  
when an external project dependency rebuilds instead of always re-  
running the configure step in such cases.

- “ctest(1)” gained a “–test-dir” option to specify the directory in  
which to look for tests.

- The “cmake-server(7)” mode has been removed. Clients should use the  
“cmake-file-api(7)” instead.

- The “WriteCompilerDetectionHeader” module has been deprecated via  
policy “CMP0120”. Projects should be ported away from it.

- The “AddFileDependencies” module is deprecated. Port projects to use  
“set\_property()” directly.

# CMake 3.20 Release Notes

#### Changes made since CMake 3.19 include the following.

## New Features

### Presets

- “cmake-presets(7)” gained support for build and test presets.

### Generators

- Makefile Generators, for some toolchains, now use the compiler to  
extract implicit dependencies while compiling source files.

### Languages

- C++23 compiler modes may now be specified via the “CXX\_STANDARD”,  
“CUDA\_STANDARD”, or “OBJCXX\_STANDARD” target properties, or via the  
“Compile Features” functionality’s “cxx\_std\_23” meta-feature.

- “CUDA” language support now works when “nvcc” is a symbolic link,  
for example due to a “ccache” or “colornvcc” wrapper script.

- The “CUDAARCHS” environment variable was added for initializing  
“CMAKE\_CUDA\_ARCHITECTURES”. Useful in cases where the compiler  
default is unsuitable for the machine’s GPU.

### Compilers

- The NVIDIA HPC SDK compilers are now supported with compiler id  
“NVHPC”.

- The Intel oneAPI NextGen LLVM compilers are now supported with  
compiler id “IntelLLVM”:

- Support was added for the IAR STM8 compiler.

### Platforms

- CMake’s support for Cross Compiling for Android is now merged with  
the Android NDK’s toolchain file. They now have similar behavior,  
though some variable names differ. User-facing changes include:

### File-Based API

- The “cmake-file-api(7)” gained a new “toolchains” object kind that  
describes the compiler used for each enabled language.

### Commands

- “add\_custom\_command()” and “add\_custom\_target()” now support  
“generator expressions” in their “OUTPUT” and “BYPRODUCTS” options.

- The “add\_custom\_command()” command gained “DEPFILE” support on  
Makefile Generators.

- The “add\_library()” command previously prohibited imported object  
libraries when using potentially multi-architecture configurations.  
This mostly affected the “Xcode” generator, e.g. when targeting iOS  
or one of the other device platforms. This restriction has now been  
removed.

- The “cmake\_path()” command was added for operations on filesystem  
paths.

- The “configure\_file()” command gained “USE\_SOURCE\_PERMISSIONS” and  
“FILE\_PERMISSIONS” options to support copying of permissions of the  
source file and using specified permissions respectively.

- The “file(GENERATE)” command gained a “NEWLINE\_STYLE” option to  
specify how newlines are handled for the generated file.

- The “file(GENERATE)” command gained “NO\_SOURCE\_PERMISSIONS”,  
“USE\_SOURCE\_PERMISSIONS”, and “FILE\_PERMISSIONS” options for  
controlling the permissions of the generated file.

- The “install(FILES)” command “RENAME” option learned to support  
“generator expressions”.

- The “target\_include\_directories()” command gained a new option  
“AFTER”.

- The “target\_sources()” command now supports targets created by the  
“add\_custom\_target()” command.

- The “try\_run()” command gained a “WORKING\_DIRECTORY” option to set  
the working directory in which to run the compiled check executable.

### Variables

- The “CMAKE\_\<LANG\>\_BYTE\_ORDER” variable was added to provide the  
target architecture byte order detected from the toolchain.

- The “CMAKE\_RUNTIME\_OUTPUT\_DIRECTORY”,  
“CMAKE\_LIBRARY\_OUTPUT\_DIRECTORY”, and  
“CMAKE\_ARCHIVE\_OUTPUT\_DIRECTORY” variables now support target-  
dependent generator expressions.

### Properties

- The “\<LANG\>\_CLANG\_TIDY” target property and the associated  
“CMAKE\_\<LANG\>\_CLANG\_TIDY” variable learned to support the “OBJC” and  
“OBJCXX” languages.

- The “EXPORT\_COMPILE\_COMMANDS” target property was added for the  
associated “CMAKE\_EXPORT\_COMPILE\_COMMANDS” variable to allow for  
configuration of exporting compile commands per target.

- The “GENERATED” source-file property is now visible from any  
directory scope, regardless of the scope in which it is set. See  
policy “CMP0118”.

- The “UNITY\_BUILD\_UNIQUE\_ID” target property was added to support  
generation of an identifier that is unique per source file in unity  
builds. It can help to resolve duplicate symbol problems with  
anonymous namespaces.

- The “WIN32\_EXECUTABLE” target property now works with Clang on  
Windows.

- The “XCODE\_EMBED\_FRAMEWORKS” target property was added to tell the  
“Xcode” generator to embed frameworks. Aspects of the embedding can  
be customized with the “XCODE\_EMBED\_FRAMEWORKS\_PATH”,  
“XCODE\_EMBED\_FRAMEWORKS\_CODE\_SIGN\_ON\_COPY”, and  
“XCODE\_EMBED\_FRAMEWORKS\_REMOVE\_HEADERS\_ON\_COPY” target properties.

### Modules

- The “ExternalData” module “ExternalData\_Add\_Target()” function  
gained a “SHOW\_PROGRESS \<bool\>” option for controlling whether or  
not to show progress output during the build.

- The “ExternalProject” module “ExternalProject\_Add()” function gained  
a “CONFIGURE\_HANDLED\_BY\_BUILD” option. This can be used to make  
subsequent runs of the configure step be triggered by the build step  
when an external project dependency rebuilds instead of always re-  
running the configure step in such cases.

- The “FindBoost” module gained a “Boost\_NO\_WARN\_NEW\_VERSIONS” option  
to silence the warning about unknown dependencies for new Boost  
versions.

- The “FindCUDAToolkit” module gained support for finding CUDA  
toolkits when “nvcc” is a symbolic link, for example due to a  
“ccache” or “colornvcc” wrapper script.

- The “FindGDAL” module has been improved to document and mark as  
advanced its cache variables. There is a new  
“FindGDAL\_SKIP\_GDAL\_CONFIG” variable which may be used to skip over  
the “gdal-config”-based search. Users may also set  
“GDAL\_ADDITIONAL\_LIBRARY\_VERSIONS” to add additional versions to the  
library name search strategy.

- The “FindIntl” module now provides an imported target.

- The “FindOpenSSL” module learned to support a version range.

- The “FindPython3”, “FindPython2” and “FindPython” modules gained  
options controlling how unversioned interpreter names are searched.

- The “UseJava” module “add\_jar()” command’s “GENERATE\_NATIVE\_HEADERS”  
feature gained options to export the generated target.

- The “UseSWIG” module gained the capability, for Makefile and Ninja  
generators, to use the “swig” tool to generate implicit  
dependencies.

### Autogen

- The AUTOMOC feature now works with per-config sources.

### CTest

- “ctest(1)” gained a “–test-dir” option to specify the directory in  
which to look for tests.

### CPack

- “CPack” gained the “CPACK\_THREADS” variable to control the number of  
threads used for parallelized operations, such as compressing the  
installer package.

- The “CPack DEB Generator” learned a new  
“CPACK\_DEBIAN\_PACKAGE\_SHLIBDEPS\_PRIVATE\_DIRS” variable to specify  
additional search directories for resolving private library  
dependencies when using “dpkg-shlibdeps”.

- The “CPack IFW Generator” gained a new  
“CPACK\_IFW\_PACKAGE\_WIZARD\_SHOW\_PAGE\_LIST” variable to control  
visibility of the widget listing installer pages on the left side of  
the wizard. This feature available only since QtIFW 4.0.

- The “CPack NSIS Generator” gained new “CPACK\_NSIS\_BRANDING\_TEXT” and  
“CPACK\_NSIS\_BRANDING\_TEXT\_TRIM\_POSITION” variables to change the  
text at the bottom of the install window and change its trim  
position

- The “CPack NSIS Generator” now correctly handles Unicode characters.  
If you want to have a “CPACK\_RESOURCE\_FILE\_LICENSE” with UTF-8  
characters, it needs to be encoded in UTF-8 BOM.

- The “CPack NuGet Generator” gained options:

## Deprecated and Removed Features

- The “cmake-server(7)” mode has been removed. Clients should use the  
“cmake-file-api(7)” instead.

- The “WriteCompilerDetectionHeader” module has been deprecated via  
policy “CMP0120”. Projects should be ported away from it.

- The “TestBigEndian” module has been deprecated in favor of the  
“CMAKE\_\<LANG\>\_BYTE\_ORDER” variable.

- The “AddFileDependencies” module is deprecated. Port projects to use  
“set\_property()” directly.

- The “CPack NuGet Generator” deprecated some variables to reflect  
changes in the NuGet specification:

## Other Changes

- Source file extensions must now be explicit. See policy “CMP0115”  
for details.

- The “LANGUAGE” source file property now forces compilation as the  
specified language. See policy “CMP0119”.

- On AIX, installation of XCOFF executables and shared libraries no  
longer requires relinking to change the runtime search path from the  
build-tree RPATH to the install-tree RPATH. CMake now edits the  
XCOFF binaries directly during installation, as has long been done  
on ELF platforms.

- With MSVC-like compilers the value of “CMAKE\_CXX\_FLAGS” no longer  
contains the “/GR” flag for runtime type information by default. See  
policy “CMP0117”.

- Ninja generators now transform the “DEPFILE” generated by an  
“add\_custom\_command()”. See policy “CMP0116” for details.

- The precompiled Linux binaries provided on [cmake.org](https://cmake.org/download/) have changed  
their naming pattern to “cmake-$ver-linux-$arch”, where “$arch” is  
either “x86\_64” or “aarch64”.

- The precompiled Windows binaries provided on [cmake.org](https://cmake.org/download/) have changed  
their naming pattern to “cmake-$ver-windows-$arch”, where “$arch” is  
either “x86\_64” or “i386”.

* * *

Changes made since CMake 3.20.0-rc5:

Adriaan de Groot (1):

- Help: Fix typos in presets schema field descriptions

Brad King (3):

- CMP0118: Fix NEW behavior when looking up target sources
- Help: Document CMP0118 requirement for boolean values
- CMake 3.20.0

Craig Scott (1):

- Help: CMAKE\_NO\_BUILTIN\_CHRPATH applies to XCOFF too
