1 CMake 3.22 Release Notes
2 ************************
8 Changes made since CMake 3.21 include the following.
16 * The :command:`cmake_host_system_information` command can now query
17 `OS identification variables`_ from the :file:`/etc/os-release` file.
19 * The :command:`string(TIMESTAMP)` command now supports the ``%V``
20 specifier for ISO 8601 week numbers.
22 .. _`OS identification variables`: https://www.freedesktop.org/software/systemd/man/os-release.html
27 * The :envvar:`CMAKE_BUILD_TYPE` environment variable was added to
28 provide a default value for the :variable:`CMAKE_BUILD_TYPE` variable.
30 * The :envvar:`CMAKE_CONFIGURATION_TYPES` environment variable was added to
31 provide a default value for the :variable:`CMAKE_CONFIGURATION_TYPES`
34 * The :envvar:`CMAKE_INSTALL_MODE` environment variable was added to
35 tell :command:`install` rules (implemented by :command:`file(INSTALL)`)
36 to install symbolic links instead of copying of files.
38 * The :variable:`CMAKE_<LANG>_LINK_WHAT_YOU_USE_FLAG` and
39 :variable:`CMAKE_LINK_WHAT_YOU_USE_CHECK` variables were added to
40 control the linker flag and check used by the
41 :prop_tgt:`LINK_WHAT_YOU_USE` target property.
43 * The :variable:`CMAKE_REQUIRE_FIND_PACKAGE_<PackageName>` variable
44 was added to turn a non-REQUIRED :command:`find_package` call into
50 * The :prop_tgt:`<LANG>_EXTENSIONS` target property is now initialized to
51 :variable:`CMAKE_<LANG>_EXTENSIONS_DEFAULT`, detected from the compiler.
52 See :policy:`CMP0128`.
54 * The :prop_sf:`VS_SETTINGS` source file property is now supported for
55 all source file types. Previously it worked only for non-built sources.
60 * The :module:`CMakeDependentOption` module :command:`cmake_dependent_option`
61 macro now supports full :ref:`Condition Syntax`.
62 See policy :policy:`CMP0127`.
64 * The :module:`FetchContent` module now passes through the
65 :variable:`CMAKE_TLS_VERIFY`, :variable:`CMAKE_TLS_CAINFO`,
66 :variable:`CMAKE_NETRC` and :variable:`CMAKE_NETRC_FILE` variables (when
67 defined) to the underlying :module:`ExternalProject` sub-build.
68 Previously, those variables were silently ignored by :module:`FetchContent`.
70 * The :module:`FindBLAS` and :module:`FindLAPACK` modules gained
71 a ``BLA_SIZEOF_INTEGER`` option to find a BLAS/LAPACK whose ABI
72 uses a specific integer size.
74 * The :module:`FindJasper` module now provides an imported target.
76 * The :module:`FindMatlab` module now provides imported targets.
78 * The :module:`FindPkgConfig` module gained a :variable:`PKG_CONFIG_ARGN`
79 variable to specify arguments to ``pkg-config`` calls.
81 * The :module:`GoogleTest` module :command:`gtest_discover_tests`
82 function gained a ``TEST_FILTER`` option to filter tests using
83 ``--gtest_filter`` during test discovery.
85 * The :module:`UseSWIG` module, for :ref:`Visual Studio Generators`,
86 can now use the ``swig`` tool to generate implicit dependencies.
91 * :manual:`ctest(1)` learned to recognize labels attached to a test at run time.
92 Previously it was only possible to attach labels to tests at configure time
93 by using the :prop_test:`LABELS` test property.
94 See :ref:`Additional Test Measurements` for more information.
96 * :manual:`ctest(1)` learned to be able to modify the environment for a test
97 through the :prop_test:`ENVIRONMENT_MODIFICATION` property. This is allows
98 for updates to environment variables based on the environment present at
101 * The :command:`ctest_memcheck` command now also generates a
102 :file:`DynamicAnalysis-Test.xml` file which may be used to submit test
108 * The :cpack_gen:`CPack DEB Generator` gained the
109 option to set :variable:`CPACK_DEBIAN_COMPRESSION_TYPE` to ``zstd``,
110 which enables Zstandard compression for deb packages.
112 * The :cpack_gen:`CPack NSIS Generator` gained a new
113 :variable:`CPACK_NSIS_IGNORE_LICENSE_PAGE` variable to suppress
114 the license page in the installer.
116 * The :cpack_gen:`CPack RPM Generator` gained the
117 :variable:`CPACK_RPM_REQUIRES_EXCLUDE_FROM` option to avoid scanning
118 specific paths for dependencies.
120 Deprecated and Removed Features
121 ===============================
123 * The :generator:`Visual Studio 10 2010` generator is now deprecated
124 and will be removed in a future version of CMake.
129 * The :manual:`Compile Features <cmake-compile-features(7)>` functionality now
130 correctly disables or enables compiler extensions when no standard level is
131 specified and avoids unnecessarily adding language standard flags if the
132 requested settings match the compiler's defaults. See :policy:`CMP0128`.
134 * The :manual:`Compile Features <cmake-compile-features(7)>` functionality
135 now ignores features for languages that are not enabled.
137 * The :ref:`Ninja Generators` now implement the ``edit_cache`` target
138 using :manual:`ccmake(1)` if available.
140 * The :generator:`Ninja` and :generator:`NMake Makefiles` generators
141 now use the MSVC ``-external:I`` flag for system includes.
142 This became available as of VS 16.10 (toolchain version 14.29.30037).
144 * The :cpack_gen:`CPack NSIS Generator` now requires NSIS 3.03 or later.
149 Changes made since CMake 3.22.0 include the following.
154 * This version made no changes to documented features or interfaces.
155 Some implementation updates were made to support ecosystem changes
156 and/or fix regressions.
161 * The ``OLD`` behavior of :policy:`CMP0128` was fixed to add flags even when
162 the specified standard matches the compiler default.
167 * The :command:`while` command again ignores errors in condition evaluation
168 as CMake 3.21 and below did. This bug was fixed in 3.22.0, but exposed
169 errors in existing projects. The fix has been reverted to restore
170 compatibility. The fix may be restored in a future version of CMake
176 * These versions made no changes to documented features or interfaces.
177 Some implementation updates were made to support ecosystem changes
178 and/or fix regressions.