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-releasefile.
- The - string(TIMESTAMP)command now supports the- %Vspecifier for ISO 8601 week numbers.
Variables¶
- The - CMAKE_BUILD_TYPEenvironment variable was added to provide a default value for the- CMAKE_BUILD_TYPEvariable.
- The - CMAKE_CONFIGURATION_TYPESenvironment variable was added to provide a default value for the- CMAKE_CONFIGURATION_TYPESvariable.
- The - CMAKE_INSTALL_MODEenvironment 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_FLAGand- CMAKE_LINK_WHAT_YOU_USE_CHECKvariables were added to control the linker flag and check used by the- LINK_WHAT_YOU_USEtarget 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>_EXTENSIONStarget property is now initialized to- CMAKE_<LANG>_EXTENSIONS_DEFAULT, detected from the compiler. See- CMP0128.
- The - VS_SETTINGSsource file property is now supported for all source file types. Previously it worked only for non-built sources.
Modules¶
- The - CMakeDependentOptionmodule- cmake_dependent_option()macro now supports full Condition Syntax. See policy- CMP0127.
- The - FetchContentmodule now passes through the- CMAKE_TLS_VERIFY,- CMAKE_TLS_CAINFO,- CMAKE_NETRCand- CMAKE_NETRC_FILEvariables (when defined) to the underlying- ExternalProjectsub-build. Previously, those variables were silently ignored by- FetchContent.
- The - FindBLASand- FindLAPACKmodules gained a- BLA_SIZEOF_INTEGERoption to find a BLAS/LAPACK whose ABI uses a specific integer size.
- The - FindJaspermodule now provides an imported target.
- The - FindMatlabmodule now provides imported targets.
- The - FindPkgConfigmodule gained a- PKG_CONFIG_ARGNvariable to specify arguments to- pkg-configcalls.
- The - GoogleTestmodule- gtest_discover_tests()function gained a- TEST_FILTERoption to filter tests using- --gtest_filterduring test discovery.
- The - UseSWIGmodule, for Visual Studio Generators, can now use the- swigtool 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- LABELStest property. See Additional Test Measurements for more information.
- ctest(1)learned to be able to modify the environment for a test through the- ENVIRONMENT_MODIFICATIONproperty. 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.xmlfile which may be used to submit test results to CDash.
CPack¶
- The - CPack DEB Generatorgained the option to set- CPACK_DEBIAN_COMPRESSION_TYPEto- zstd, which enables Zstandard compression for deb packages.
- The - CPack NSIS Generatorgained a new- CPACK_NSIS_IGNORE_LICENSE_PAGEvariable to suppress the license page in the installer.
- The - CPack RPM Generatorgained the- CPACK_RPM_REQUIRES_EXCLUDE_FROMoption to avoid scanning specific paths for dependencies.
Deprecated and Removed Features¶
- The - Visual Studio 10 2010generator is now deprecated and will be removed in a future version of CMake.
Other Changes¶
- The - Compile Featuresfunctionality 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 Featuresfunctionality now ignores features for languages that are not enabled.
- The Ninja Generators now implement the - edit_cachetarget using- ccmake(1)if available.
- The - Ninjaand- NMake Makefilesgenerators now use the MSVC- -external:Iflag for system includes. This became available as of VS 16.10 (toolchain version 14.29.30037).
- The - CPack NSIS Generatornow requires NSIS 3.03 or later.
Updates¶
Changes made since CMake 3.22.0 include the following.
3.22.1¶
- This version made no changes to documented features or interfaces. Some implementation updates were made to support ecosystem changes and/or fix regressions. 
3.22.2¶
- The - OLDbehavior of- CMP0128was fixed to add flags even when the specified standard matches the compiler default.
3.22.3¶
- The - while()command again ignores errors in condition evaluation as CMake 3.21 and below did. This bug was fixed in 3.22.0, but exposed errors in existing projects. The fix has been reverted to restore compatibility. The fix may be restored in a future version of CMake via a policy.
3.22.4, 3.22.5, 3.22.6¶
- These versions made no changes to documented features or interfaces. Some implementation updates were made to support ecosystem changes and/or fix regressions. 
