3.22.rst 6.1 KB

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