4.3.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. CMake 4.3 Release Notes
  2. ***********************
  3. .. only:: html
  4. .. contents::
  5. Changes made since CMake 4.2 include the following.
  6. New Features
  7. ============
  8. Common Package Specification
  9. ----------------------------
  10. * Support for importing and exporting packages described using the |CPS|_
  11. (CPS) was added. This improves build system interoperability by allowing
  12. expressive, feature-rich package descriptions to be exchanged in a format
  13. other than CMake Language.
  14. * The :command:`find_package` now searches for and can import CPS packages.
  15. * The :command:`install` and :command:`export` commands gained a new
  16. ``PACKAGE_INFO`` sub-command to generate CPS package descriptions.
  17. * The :command:`project` command gained new ``COMPAT_VERSION`` and
  18. ``SPDX_LICENSE`` options. These values may be inherited when creating a
  19. CPS package description. See the :command:`install(PACKAGE_INFO)`
  20. documentation for details.
  21. .. _CPS: https://cps-org.github.io/cps/
  22. .. |CPS| replace:: Common Package Specification
  23. Instrumentation
  24. ---------------
  25. * :manual:`cmake-instrumentation(7)` was added to enable collection of
  26. timing data, target information, and system diagnostic information during
  27. the configure, generate, build, test, and install steps of a CMake project:
  28. * Instrumentation data are :ref:`indexed <cmake-instrumentation Indexing>`
  29. and provided to :ref:`callbacks <cmake-instrumentation Callbacks>` for
  30. custom processing.
  31. * Instrumentation data are included in submissions to CDash.
  32. * Optionally,
  33. :ref:`Google Trace Event Format <cmake-instrumentation Google Trace File>`
  34. files may be generated to visualize instrumentation data.
  35. Presets
  36. -------
  37. * :manual:`cmake-presets(7)` files now support schema version ``11``.
  38. The ``jobs`` field under test presets now supports an empty string, to
  39. match the behavior of :option:`ctest --parallel` with the value omitted.
  40. * The ``jobs`` field under both build and test presets no longer accept
  41. negative integer values, regardless of the schema version.
  42. File-Based API
  43. --------------
  44. * The :manual:`cmake-file-api(7)` "codemodel" version 2 version field
  45. has been updated to 2.10.
  46. * The :manual:`cmake-file-api(7)` "codemodel" version 2 "target" object
  47. gained a new ``interfaceSources`` array field, and the ``sourceGroups``
  48. array items gained a new ``interfaceSourceIndexes`` array field.
  49. Platforms
  50. ---------
  51. * ``HIP`` language code may now be compiled for SPIR-V targets,
  52. e.g., via chipStar. See the :variable:`CMAKE_HIP_PLATFORM` variable.
  53. Command-Line
  54. ------------
  55. * :option:`cmake --version` now supports a ``=json-v1`` value to print
  56. detailed version information in a JSON format.
  57. * :option:`cmake --build` now supports specifying a build directory and
  58. preset together. The build preset will be used with the explicit
  59. build directory substituted.
  60. * The :option:`cmake -E` commands
  61. :option:`md5sum <cmake-E md5sum>`,
  62. :option:`sha1sum <cmake-E sha1sum>`,
  63. :option:`sha224sum <cmake-E sha224sum>`,
  64. :option:`sha256sum <cmake-E sha256sum>`,
  65. :option:`sha384sum <cmake-E sha384sum>`, and
  66. :option:`sha512sum <cmake-E sha512sum>`
  67. now support reading from standard input by passing ``-``.
  68. * The :option:`cmake -E bin2c <cmake-E bin2c>` command-line tool was added.
  69. * The :option:`cmake -E tar <cmake-E tar>` command-line tool:
  70. * Gained a ``--cmake-tar-compression-level`` flag to specify the
  71. compression level.
  72. * Gained a ``--cmake-tar-compression-method`` flag to specify the
  73. compression method.
  74. * Gained a ``--cmake-tar-threads`` flag to enable multithreaded operations.
  75. * Now supports specifying compression method and level for ``7zip`` and
  76. ``zip`` formats.
  77. * Gained a ``--format=raw`` flag to disable compression.
  78. * Gained a ``--lzma`` flag to specify ``LZMA`` compression.
  79. Commands
  80. --------
  81. * The :command:`cmake_instrumentation` command was added to make
  82. project-level instrumentation queries.
  83. * The :command:`file(ARCHIVE_CREATE)` command:
  84. * Gained a ``THREADS`` option to enable multithreaded operations.
  85. * Now supports ``COMPRESSION`` method ``Deflate`` as an alias for ``GZip``.
  86. * Now supports ``COMPRESSION`` method ``LZMA``.
  87. * Now supports ``COMPRESSION`` method ``LZMA2`` as an alias for ``XZ``.
  88. * Now supports ``COMPRESSION`` method ``PPMd`` for format ``7zip``.
  89. * Now supports ``COMPRESSION`` and ``COMPRESSION_LEVEL`` options
  90. for formats ``7zip`` and ``zip``.
  91. * The :command:`get_property` and :command:`set_property` commands
  92. now support a ``FILE_SET`` scope for file set properties of a target.
  93. * The :command:`string(JSON)` command gained new ``GET_RAW`` and
  94. ``STRING_ENCODE`` modes.
  95. * The :command:`source_group` command now supports
  96. :manual:`generator expressions <cmake-generator-expressions(7)>`.
  97. * The :command:`cmake_host_system_information` command gained a
  98. ``LOCALE_CHARSET`` query for the expected :manual:`cmake-language(7)`
  99. script encoding.
  100. Variables
  101. ---------
  102. * The :variable:`CMAKE_<LANG>_LINK_FLAGS` and
  103. :variable:`CMAKE_<LANG>_LINK_FLAGS_<CONFIG>` variables were added
  104. to support per-language link flags for all target types.
  105. See policy :policy:`CMP0210`.
  106. * The :variable:`CMAKE_VERIFY_PRIVATE_HEADER_SETS` variable and corresponding
  107. :prop_tgt:`VERIFY_PRIVATE_HEADER_SETS` target property were added to
  108. enable build rules that verify all headers in private file sets can be used
  109. on their own.
  110. Properties
  111. ----------
  112. * A :prop_tgt:`<LANG>_PVS_STUDIO` target property and supporting
  113. :variable:`CMAKE_<LANG>_PVS_STUDIO` variable were introduced to tell
  114. :ref:`Makefile Generators` and :ref:`Ninja Generators` to run
  115. ``pvs-studio-analyzer`` with the compiler for ``C`` and ``CXX`` languages.
  116. * When :prop_tgt:`VERIFY_INTERFACE_HEADER_SETS` is set to true on an executable
  117. target, that target's interface file sets are verified regardless of its
  118. :prop_tgt:`ENABLE_EXPORTS` property. See policy :policy:`CMP0209`.
  119. * The :prop_tgt:`PRIVATE_HEADER_SETS_TO_VERIFY` target property was added to
  120. customize which private file sets to verify when the target's
  121. :prop_tgt:`VERIFY_PRIVATE_HEADER_SETS` property is true.
  122. Modules
  123. -------
  124. * The :module:`FindCUDAToolkit` module now creates a ``CUDA::bin2c``
  125. imported target for the :ref:`bin2c <FindCUDAToolkit_bin2c>` utility.
  126. * The :module:`FindLibXml2` module gained a ``LibXml2_USE_STATIC_LIBS`` hint
  127. to select static libraries.
  128. * The :module:`FindRuby` module now provides imported targets.
  129. * The :module:`FindSQLite3` module now provides imported
  130. targets with the ``SQLite3::`` prefix.
  131. * The :module:`UseJava` module's :command:`add_jar` command now accepts a new
  132. ``INCLUDE_MODULES`` option that adds its arguments to the ``--module-path``
  133. argument to the Java compiler. This allows building JAR files that use JPMS
  134. modules in their build.
  135. Generator Expressions
  136. ---------------------
  137. * :ref:`String Comparison <String Comparisons Generator Expressions>`
  138. generator expressions were added.
  139. * :genex:`$<STRING:...>` generator expressions were added for
  140. :ref:`query <String Queries Generator Expressions>`,
  141. :ref:`generation <String Generating Generator Expressions>`, and
  142. :ref:`transformation <String Transforming Generator Expressions>`
  143. operations on strings.
  144. * The :genex:`$<FILE_SET_EXISTS>` and :genex:`$<FILE_SET_PROPERTY>` generator
  145. expressions were added to query file set existence and properties.
  146. * The :genex:`$<SOURCE_EXISTS>` and :genex:`$<SOURCE_PROPERTY>` generator
  147. expressions were added to query source file existence and properties.
  148. CTest
  149. -----
  150. * The :module:`CTestCoverageCollectGCOV` module:
  151. * Now supports ``TARBALL_COMPRESSION`` method ``LZMA``.
  152. * Now supports ``TARBALL_COMPRESSION`` method ``LZMA2``
  153. as an alias for ``XZ``.
  154. * Now supports ``FROM_EXT`` with file extensions corresponding to
  155. ``LZMA`` and ``ZSTD`` compression.
  156. CPack
  157. -----
  158. * :module:`CPack` gained the :variable:`CPACK_COMPRESSION_LEVEL`
  159. variable to control the compression level used when creating
  160. packages.
  161. * The :cpack_gen:`CPack Archive Generator`:
  162. * Now supports compression method specification for formats
  163. ``7zip`` and ``zip``.
  164. * Gained a :variable:`CPACK_ARCHIVE_COMPRESSION_LEVEL` option to
  165. control the compression level used when creating archive packages.
  166. * Gained :variable:`CPACK_ARCHIVE_UID` and :variable:`CPACK_ARCHIVE_GID`
  167. options to specify the UID and GID of archive entries, respectively.
  168. The defaults are UID ``0`` and GID ``0``. See policy :policy:`CMP0206`.
  169. * The :cpack_gen:`CPack DEB Generator` gained a new
  170. :variable:`CPACK_DEBIAN_COMPRESSION_LEVEL` variable to control the
  171. compression level used when creating Debian packages.
  172. * The :cpack_gen:`CPack WIX Generator` now supports per-user installers
  173. by setting :variable:`CPACK_WIX_INSTALL_SCOPE` to ``perUser``.
  174. Deprecated and Removed Features
  175. ===============================
  176. * The :variable:`CMAKE_ENABLE_EXPORTS` variable is deprecated in favor of
  177. the :variable:`CMAKE_EXECUTABLE_ENABLE_EXPORTS` and
  178. :variable:`CMAKE_SHARED_LIBRARY_ENABLE_EXPORTS` variables.
  179. * The :command:`export(EXPORT)` command no longer allows certain
  180. arguments to be missing or empty. See policy :policy:`CMP0208`.
  181. Other Changes
  182. =============
  183. * The :option:`cmake -E tar <cmake-E tar>` command-line tool
  184. and the :command:`file(ARCHIVE_EXTRACT)` command now reject archive
  185. entries whose paths are absolute or contain ``..`` path traversal
  186. components.
  187. * The family of :option:`cmake --trace` and related commands now print "end"
  188. commands for control structures: :command:`endblock`, :command:`endforeach`,
  189. :command:`endfunction`, :command:`endif`, :command:`endmacro`, and
  190. :command:`endwhile`.
  191. * The :command:`file(CREATE_LINK)` command's ``COPY_ON_ERROR`` option,
  192. when used with a directory, now copies directory content.
  193. See policy :policy:`CMP0205`.
  194. * The :command:`file(GET_RUNTIME_DEPENDENCIES)`
  195. and :command:`install(RUNTIME_DEPENDENCY_SET)` commands now normalize
  196. paths before matching filters. See policy :policy:`CMP0207`.
  197. * The precompiled Linux ``aarch64`` binaries provided on
  198. `cmake.org <https://cmake.org/download/>`_ now require GLIBC 2.28 or higher.
  199. * The precompiled macOS binary provided on ``cmake.org`` for macOS 10.13+
  200. now requires macOS 12 or newer for the :manual:`cmake-gui(1)` application.
  201. The command-line tools still run on macOS 10.13.
  202. * The precompiled Windows binaries provided on
  203. `cmake.org <https://cmake.org/download/>`_ now require Windows 10 or higher.
  204. Updates
  205. =======
  206. Changes made since CMake 4.3.0 include the following.
  207. 4.3.1
  208. -----
  209. * This version made no changes to documented features or interfaces.
  210. Some implementation updates were made to support ecosystem changes
  211. and/or fix regressions.