# CMake 3.20.0-rc2 is ready for testing

**URL:** https://discourse.cmake.org/t/cmake-3-20-0-rc2-is-ready-for-testing/2835
**Category:** Announcements
**Created:** [February 24, 2021, 7:12pm UTC](https://discourse.cmake.org/t/cmake-3-20-0-rc2-is-ready-for-testing/2835 "2021-02-24T19:12:46Z")
**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: [February 24, 2021, 7:12pm UTC](https://discourse.cmake.org/t/cmake-3-20-0-rc2-is-ready-for-testing/2835/1 "2021-02-24T19:12:46Z")

</div>

I am proud to announce the second CMake 3.20 release candidate.  
[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. User-facing changes include:

- 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 implementation of the “ExternalProject” module was significantly  
refactored. The patch step gained support for using the terminal  
with a new “USES\_TERMINAL\_PATCH” keyword as a by-product of that  
work.

- The “FetchContent” module no longer creates a separate sub-build to  
implement the content population. It now invokes the step scripts  
directly from within the main project’s configure stage. This  
significantly speeds up the configure phase when the required  
content is already populated and up-to-date.

- 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-rc1:

Brad King (25):

- Intel: Make explicit Fortran preprocessing under Ninja more robust
- IntelLLVM: Make explicit Fortran preprocessing under Ninja more robust
- bindexplib: remove stray debugging output when using llvm-nm
- Utilities/Sphinx: Avoid converting – to an en-dash
- Help: Mention version 2 in cmake-presets(7)
- Help: Link to tool-specific preset arguments from cmake-presets(7)
- Help: Clarify role of binaryDir inheritance in cmake-presets(7)
- Help: Fix CPACK\_DEBIAN\_PACKAGE\_SHLIBDEPS\_PRIVATE\_DIRS documentation
- cmVisualStudio10TargetGenerator: Refactor per-source PCH logic
- VS: Restore support for PCH in CXX but not C within once target
- NAG: Fix using Fortran modules from their output directory
- Tests: Clarify internal project name in RunCMake.GoogleTest cases
- Tests: Remove explicit no-signing marks from BundleTest
- Tests: Fix CTestTestCrash expected output on macOS arm64
- Tests: Suppress failures on macOS arm64 due to separate Xcode signing phase
- cmake: Document ‘–preset \<preset\>’ form of the argument
- cmake: Add support for ‘–build --prefix=\<prefix\>’ form of the argument
- ctest: Add support for ‘–prefix=\<prefix\>’ form of the argument
- ci: Use Qt macOS 10.13+ package for macOS build and test jobs
- ci: update to sccache 0.2.15 on linux builds
- Tests: Update for upstream ninja change to write status on stderr
- ci: add sccache 0.2.15 custom build for aarch64-apple-darwin
- gitlab-ci: rename macos build and test jobs to macos-x86\_64
- gitlab-ci: Add macos-arm64 jobs for Ninja and Xcode
- CMake 3.20.0-rc2

Craig Scott (5):

- FetchContent: Restore patch command support
- CPackIFWInstaller: Avoid potential null pointer dereference
- Autogen: Don’t change the order of HEADERS array in AutogenInfo.json
- ExternalProject: Fix misuse of IS\_NEWER\_THAN in timestamp checks
- FetchContent: Don’t update timestamps if files don’t change

Daan De Meyer (1):

- Tests: Fix ExternalProject CONFIGURE\_HANDLED\_BY\_BUILD on 1s filesystems

Gregor Jasny (1):

- DetermineCompiler: Fix copy-paste error in Intel Compiler detection

Kyle Edwards (7):

- cmCustomCommand: Record value of CMP0116 at time of creation
- Ninja: Use CMP0116 status recorded at time of custom command’s creation
- Tests: Test per-CC behavior of CMP0116
- Tests: Test Qt autogen target with CMP0116 set to WARN
- Help: Note that CMP0116 is recorded at the time of CC creation
- CMakePresets.json: Remove undocumented support for comments
- Tests: Remove comments from CMakePresetsTest/Good.json.in

Marc Chevrier (1):

- Genex: LINK\_LANGUAGE respects LINKER\_LANGUAGE property

Michael Hirsch (2):

- Help: Clarify preset name conflict rules in cmake-presets(7)
- Help: Add build and test preset to examples in cmake-presets(7)

Michael Hirsch, Ph.D (1):

- Help: Add internal links to if() docs

Robert Maynard (1):

- CUDA: Improve error messages when CUDA compiler detection fails

Sankhesh Jhaveri (1):

- cmake-gui: Restore search bar for cache view and environment dialog
