CMake 3.22.0-rc3 is ready for testing

November 12, 2021

I am proud to announce the third CMake 3.22 release candidate.
https://cmake.org/download/

Documentation is available at:
https://cmake.org/cmake/help/v3.22

Release notes appear below and are also published at
https://cmake.org/cmake/help/v3.22/release/3.22.html

Some of the more significant changes in CMake 3.22 are:

  • The “Compile Features” functionality now correctly disables or
    enables compiler extensions when no standard level is specified and
    avoids unnecessarily adding language standard flags if the requested
    settings match the compiler’s defaults. See “CMP0128”.
  • The “cmake_host_system_information()” command can now query OS
    identification variables from the “/etc/os-release” file.
  • The “CMAKE_BUILD_TYPE” environment variable was added to provide a
    default value for the “CMAKE_BUILD_TYPE” variable.
  • The “CMAKE_REQUIRE_FIND_PACKAGE_<PackageName>” variable was added to
    turn a non-REQUIRED “find_package()” call into a REQUIRED one.
  • The “FetchContent” module now passes through the “CMAKE_TLS_VERIFY”,
    “CMAKE_TLS_CAINFO”, “CMAKE_NETRC” and “CMAKE_NETRC_FILE” variables
    (when defined) to the underlying “ExternalProject” sub-build.
    Previously, those variables were silently ignored by “FetchContent”.
  • The “Visual Studio 10 2010” generator is now deprecated and will be
    removed in a future version of CMake.
CMake 3.22 Release Notes
************************

Changes made since CMake 3.21 include the following.

New Features
============

Commands
--------

* The "cmake_host_system_information()" command can now query OS
  identification variables from the "/etc/os-release" file.

* The "string(TIMESTAMP)" command now supports the "%V" specifier for
  ISO 8601 week numbers.

Variables
---------

* The "CMAKE_BUILD_TYPE" environment variable was added to provide a
  default value for the "CMAKE_BUILD_TYPE" variable.

* The "CMAKE_CONFIGURATION_TYPES" environment variable was added to
  provide a default value for the "CMAKE_CONFIGURATION_TYPES"
  variable.

* The "CMAKE_INSTALL_MODE" environment variable was added to tell
  "install()" rules (implemented by "file(INSTALL)") to install
  symbolic links instead of copying of files.

* The "CMAKE_<LANG>_LINK_WHAT_YOU_USE_FLAG" and
  "CMAKE_LINK_WHAT_YOU_USE_CHECK" variables were added to control the
  linker flag and check used by the "LINK_WHAT_YOU_USE" target
  property.

* The "CMAKE_REQUIRE_FIND_PACKAGE_<PackageName>" variable was added to
  turn a non-REQUIRED "find_package()" call into a REQUIRED one.

Properties
----------

* The "<LANG>_EXTENSIONS" target property is now initialized to
  "CMAKE_<LANG>_EXTENSIONS_DEFAULT", detected from the compiler. See
  "CMP0128".

* The "VS_SETTINGS" source file property is now supported for all
  source file types.  Previously it worked only for non-built sources.

Modules
-------

* The "CMakeDependentOption" module "cmake_dependent_option()" macro
  now supports full Condition Syntax. See policy "CMP0127".

* The "FetchContent" module now passes through the "CMAKE_TLS_VERIFY",
  "CMAKE_TLS_CAINFO", "CMAKE_NETRC" and "CMAKE_NETRC_FILE" variables
  (when defined) to the underlying "ExternalProject" sub-build.
  Previously, those variables were silently ignored by "FetchContent".

* The "FindBLAS" and "FindLAPACK" modules gained a
  "BLA_SIZEOF_INTEGER" option to find a BLAS/LAPACK whose ABI uses a
  specific integer size.

* The "FindJasper" module now provides an imported target.

* The "FindMatlab" module now provides imported targets.

* The "FindPkgConfig" module gained a "PKG_CONFIG_ARGN" variable to
  specify arguments to "pkg-config" calls.

* The "GoogleTest" module "gtest_discover_tests()" function gained a
  "TEST_FILTER" option to filter tests using "--gtest_filter" during
  test discovery.

* The "UseSWIG" module, for Visual Studio Generators, can now use the
  "swig" tool to generate implicit dependencies.

CTest
-----

* "ctest(1)" learned to recognize labels attached to a test at run
  time. Previously it was only possible to attach labels to tests at
  configure time by using the "LABELS" test property. See Additional
  Test Measurements for more information.

* "ctest(1)" learned to be able to modify the environment for a test
  through the "ENVIRONMENT_MODIFICATION" property. This is allows for
  updates to environment variables based on the environment present at
  test time.

* The "ctest_memcheck()" command now also generates a
  "DynamicAnalysis-Test.xml" file which may be used to submit test
  results to CDash.

CPack
-----

* The "CPack DEB Generator" gained the option to set
  "CPACK_DEBIAN_COMPRESSION_TYPE" to "zstd", which enables Zstandard
  compression for deb packages.

* The "CPack NSIS Generator" gained a new
  "CPACK_NSIS_IGNORE_LICENSE_PAGE" variable to suppress the license
  page in the installer.

* The "CPack RPM Generator" gained the
  "CPACK_RPM_REQUIRES_EXCLUDE_FROM" option to avoid scanning specific
  paths for dependencies.

Deprecated and Removed Features
===============================

* The "Visual Studio 10 2010" generator is now deprecated and will be
  removed in a future version of CMake.

Other Changes
=============

* The "Compile Features" functionality now correctly disables or
  enables compiler extensions when no standard level is specified and
  avoids unnecessarily adding language standard flags if the requested
  settings match the compiler's defaults. See "CMP0128".

* The "Compile Features" functionality now ignores features for
  languages that are not enabled.

* The Ninja Generators now implement the "edit_cache" target using
  "ccmake(1)" if available.

* The "Ninja" and "NMake Makefiles" generators now use the MSVC
  "-external:I" flag for system includes. This became available as of
  VS 16.10 (toolchain version 14.29.30037).

* The "CPack NSIS Generator" now requires NSIS 3.03 or later.

----------------------------------------------------------------------------
Changes made since CMake 3.22.0-rc2:

Alex Turbov (1):
  Help: Add `versionadded` for `CPACK_RPM_REQUIRES_EXCLUDE_FROM` variable

Ben Boeckel (5):
  cmCTestRunTest: get the default value from the environment
  Tests/Environment: also test modifying ambient values
  FindHDF5: fix variable name when querying `hdf5_hl`'s implib
  FindHDF5: clear library output variables at the top of the module
  FindHDF5: clear language-specific libraries list before discovery

Brad King (21):
  MSVC: Refactor C compile features table for C90, C99, and C11
  MSVC: Tolerate c_std_17 and c_std_23 features on older compiler versions
  MSVC: Add support for C17
  Help: Fix versionadded for VS 15 2017 instance selection
  FindMPI: Fix finding PkgConfg for fallback
  Help: Use lower-case names of sphinx directives
  cmNinjaTargetGenerator: Replace "their" with "there" in comment
  Ninja: Fix creation of Windows import library directory
  GNUtoMS: Add search path for VS 2022 environment scripts
  cmScanDepFormat: Accept P1689r4 files with version 1
  cmGlobalVisualStudio8Generator: Refactor SetGeneratorPlatform
  Help: Clarify TARGET_RUNTIME_DLLS behavior on imported targets
  Ninja Multi-Config: Fix cross-config custom command dependency tracing
  Ninja Multi-Config: Fix internal cross-config target dependency ordering
  Ninja Multi-Config: Fix custom command target dependencies in cross-configs
  cmVisualStudio10TargetGenerator: Refactor target framework selection
  VS: Model a default target framework
  VS: Default TargetFrameworkVersion to v4.7.2 for VS 2022
  gitlab-ci: Re-organize Windows job tags
  gitlab-ci: Update Windows jobs to VS 2022
  CMake 3.22.0-rc3

Craig Scott (4):
  Help: Clarify how PKG_CONFIG env var initializes cache vars
  Help: Clarify valid versus supported values for CUDA_STANDARD
  Help: Correct inaccuracies in wording for CMP0128
  TI: Recognize invalid compiler option warning during try_compile()

Cristian Adam (2):
  PCH: Fix REUSE_FROM when Debug and RelWithDebInfo configs differ
  PCH: Fixed Ninja Multi-Config and REUSE_FROM for MSVC

Marc Aldorasi (1):
  Help: Document that configure_file can create directories

Raul Tambre (2):
  Help: Better explain CMAKE_<LANG>_EXTENSIONS_DEFAULT
  CMP0128: Enable/disable extensions if standard same as default

Robert Maynard (1):
  NVHPC: Support SYSTEM include directories

Thomas Dickerson (1):
  CheckLinkerFlag: Set policies needed by the implementation

William R. Dieter (2):
  IntelLLVM: Use MSVC linker with MSVC frontend variant
  Fortran: Save frontend variant persistently for IntelLLVM

Yonggang Luo (1):
  Help: Use stronger wording in rule about preset inheritance

Leave a Reply