1CMake 3.22 Release Notes 2************************ 3 4.. only:: html 5 6 .. contents:: 7 8Changes made since CMake 3.21 include the following. 9 10New Features 11============ 12 13Commands 14-------- 15 16* The :command:`cmake_host_system_information` command can now query 17 `OS identification variables`_ from the :file:`/etc/os-release` file. 18 19* The :command:`string(TIMESTAMP)` command now supports the ``%V`` 20 specifier for ISO 8601 week numbers. 21 22.. _`OS identification variables`: https://www.freedesktop.org/software/systemd/man/os-release.html 23 24Variables 25--------- 26 27* The :envvar:`CMAKE_BUILD_TYPE` environment variable was added to 28 provide a default value for the :variable:`CMAKE_BUILD_TYPE` variable. 29 30* The :envvar:`CMAKE_CONFIGURATION_TYPES` environment variable was added to 31 provide a default value for the :variable:`CMAKE_CONFIGURATION_TYPES` 32 variable. 33 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. 37 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. 42 43* The :variable:`CMAKE_REQUIRE_FIND_PACKAGE_<PackageName>` variable 44 was added to turn a non-REQUIRED :command:`find_package` call into 45 a REQUIRED one. 46 47Properties 48---------- 49 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`. 53 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. 56 57Modules 58------- 59 60* The :module:`CMakeDependentOption` module :command:`cmake_dependent_option` 61 macro now supports full :ref:`Condition Syntax`. 62 See policy :policy:`CMP0127`. 63 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`. 69 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. 73 74* The :module:`FindJasper` module now provides an imported target. 75 76* The :module:`FindMatlab` module now provides imported targets. 77 78* The :module:`FindPkgConfig` module gained a :variable:`PKG_CONFIG_ARGN` 79 variable to specify arguments to ``pkg-config`` calls. 80 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. 84 85* The :module:`UseSWIG` module, for :ref:`Visual Studio Generators`, 86 can now use the ``swig`` tool to generate implicit dependencies. 87 88CTest 89----- 90 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. 95 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 99 test time. 100 101* The :command:`ctest_memcheck` command now also generates a 102 :file:`DynamicAnalysis-Test.xml` file which may be used to submit test 103 results to CDash. 104 105CPack 106----- 107 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. 111 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. 115 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. 119 120Deprecated and Removed Features 121=============================== 122 123* The :generator:`Visual Studio 10 2010` generator is now deprecated 124 and will be removed in a future version of CMake. 125 126Other Changes 127============= 128 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`. 133 134* The :manual:`Compile Features <cmake-compile-features(7)>` functionality 135 now ignores features for languages that are not enabled. 136 137* The :ref:`Ninja Generators` now implement the ``edit_cache`` target 138 using :manual:`ccmake(1)` if available. 139 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). 143 144* The :cpack_gen:`CPack NSIS Generator` now requires NSIS 3.03 or later. 145