File: 4.3.rst

package info (click to toggle)
cmake 4.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 158,704 kB
  • sloc: ansic: 406,077; cpp: 309,512; sh: 4,233; python: 3,696; yacc: 3,109; lex: 1,279; f90: 538; asm: 471; lisp: 375; java: 310; cs: 270; fortran: 239; objc: 215; perl: 213; xml: 198; makefile: 110; javascript: 83; pascal: 63; tcl: 55; php: 25; ruby: 22; sed: 2
file content (282 lines) | stat: -rw-r--r-- 10,572 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
CMake 4.3 Release Notes
***********************

.. only:: html

  .. contents::

Changes made since CMake 4.2 include the following.

New Features
============

Common Package Specification
----------------------------

* Support for importing and exporting packages described using the |CPS|_
  (CPS) was added.  This improves build system interoperability by allowing
  expressive, feature-rich package descriptions to be exchanged in a format
  other than CMake Language.

  * The :command:`find_package` now searches for and can import CPS packages.

  * The :command:`install` and :command:`export` commands gained a new
    ``PACKAGE_INFO`` sub-command to generate CPS package descriptions.

  * The :command:`project` command gained new ``COMPAT_VERSION`` and
    ``SPDX_LICENSE`` options.  These values may be inherited when creating a
    CPS package description.  See the :command:`install(PACKAGE_INFO)`
    documentation for details.

.. _CPS: https://cps-org.github.io/cps/
.. |CPS| replace:: Common Package Specification

Instrumentation
---------------

* :manual:`cmake-instrumentation(7)` was added to enable collection of
  timing data, target information, and system diagnostic information during
  the configure, generate, build, test, and install steps of a CMake project:

  * Instrumentation data are :ref:`indexed <cmake-instrumentation Indexing>`
    and provided to :ref:`callbacks <cmake-instrumentation Callbacks>` for
    custom processing.

  * Instrumentation data are included in submissions to CDash.

  * Optionally,
    :ref:`Google Trace Event Format <cmake-instrumentation Google Trace File>`
    files may be generated to visualize instrumentation data.

Presets
-------

* :manual:`cmake-presets(7)` files now support schema version ``11``.
  The ``jobs`` field under test presets now supports an empty string, to
  match the behavior of :option:`ctest --parallel` with the value omitted.
* The ``jobs`` field under both build and test presets no longer accept
  negative integer values, regardless of the schema version.

File-Based API
--------------

* The :manual:`cmake-file-api(7)` "codemodel" version 2 version field
  has been updated to 2.10.

* The :manual:`cmake-file-api(7)` "codemodel" version 2 "target" object
  gained a new ``interfaceSources`` array field, and the ``sourceGroups``
  array items gained a new ``interfaceSourceIndexes`` array field.

Platforms
---------

* ``HIP`` language code may now be compiled for SPIR-V targets,
  e.g., via chipStar.  See the :variable:`CMAKE_HIP_PLATFORM` variable.

Command-Line
------------

* :option:`cmake --version` now supports a ``=json-v1`` value to print
  detailed version information in a JSON format.

* :option:`cmake --build` now supports specifying a build directory and
  preset together.  The build preset will be used with the explicit
  build directory substituted.

* The :option:`cmake -E` commands
  :option:`md5sum <cmake-E md5sum>`,
  :option:`sha1sum <cmake-E sha1sum>`,
  :option:`sha224sum <cmake-E sha224sum>`,
  :option:`sha256sum <cmake-E sha256sum>`,
  :option:`sha384sum <cmake-E sha384sum>`, and
  :option:`sha512sum <cmake-E sha512sum>`
  now support reading from standard input by passing ``-``.

* The :option:`cmake -E bin2c <cmake-E bin2c>` command-line tool was added.

* The :option:`cmake -E tar <cmake-E tar>` command-line tool:

  * Gained a ``--cmake-tar-compression-level`` flag to specify the
    compression level.
  * Gained a ``--cmake-tar-compression-method`` flag to specify the
    compression method.
  * Gained a ``--cmake-tar-threads`` flag to enable multithreaded operations.
  * Now supports specifying compression method and level for ``7zip`` and
    ``zip`` formats.
  * Gained a ``--format=raw`` flag to disable compression.
  * Gained a ``--lzma`` flag to specify ``LZMA`` compression.

Commands
--------

* The :command:`cmake_instrumentation` command was added to make
  project-level instrumentation queries.

* The :command:`file(ARCHIVE_CREATE)` command:

  * Gained a ``THREADS`` option to enable multithreaded operations.
  * Now supports ``COMPRESSION`` method ``Deflate`` as an alias for ``GZip``.
  * Now supports ``COMPRESSION`` method ``LZMA``.
  * Now supports ``COMPRESSION`` method ``LZMA2`` as an alias for ``XZ``.
  * Now supports ``COMPRESSION`` method ``PPMd`` for format ``7zip``.
  * Now supports ``COMPRESSION`` and ``COMPRESSION_LEVEL`` options
    for formats ``7zip`` and ``zip``.

* The :command:`get_property` and :command:`set_property` commands
  now support a ``FILE_SET`` scope for file set properties of a target.

* The :command:`string(JSON)` command gained new ``GET_RAW`` and
  ``STRING_ENCODE`` modes.

* The :command:`source_group` command now supports
  :manual:`generator expressions <cmake-generator-expressions(7)>`.

* The :command:`cmake_host_system_information` command gained a
  ``LOCALE_CHARSET`` query for the expected :manual:`cmake-language(7)`
  script encoding.

Variables
---------

* The :variable:`CMAKE_<LANG>_LINK_FLAGS` and
  :variable:`CMAKE_<LANG>_LINK_FLAGS_<CONFIG>` variables were added
  to support per-language link flags for all target types.
  See policy :policy:`CMP0210`.

* The :variable:`CMAKE_VERIFY_PRIVATE_HEADER_SETS` variable and corresponding
  :prop_tgt:`VERIFY_PRIVATE_HEADER_SETS` target property were added to
  enable build rules that verify all headers in private file sets can be used
  on their own.

Properties
----------

* A :prop_tgt:`<LANG>_PVS_STUDIO` target property and supporting
  :variable:`CMAKE_<LANG>_PVS_STUDIO` variable were introduced to tell
  :ref:`Makefile Generators` and :ref:`Ninja Generators` to run
  ``pvs-studio-analyzer`` with the compiler for ``C`` and ``CXX`` languages.

* When :prop_tgt:`VERIFY_INTERFACE_HEADER_SETS` is set to true on an executable
  target, that target's interface file sets are verified regardless of its
  :prop_tgt:`ENABLE_EXPORTS` property. See policy :policy:`CMP0209`.

* The :prop_tgt:`PRIVATE_HEADER_SETS_TO_VERIFY` target property was added to
  customize which private file sets to verify when the target's
  :prop_tgt:`VERIFY_PRIVATE_HEADER_SETS` property is true.

Modules
-------

* The :module:`FindCUDAToolkit` module now creates a ``CUDA::bin2c``
  imported target for the :ref:`bin2c <FindCUDAToolkit_bin2c>` utility.

* The :module:`FindLibXml2` module gained a ``LibXml2_USE_STATIC_LIBS`` hint
  to select static libraries.

* The :module:`FindRuby` module now provides imported targets.

* The :module:`FindSQLite3` module now provides imported
  targets with the ``SQLite3::`` prefix.

* The :module:`UseJava` module's :command:`add_jar` command now accepts a new
  ``INCLUDE_MODULES`` option that adds its arguments to the ``--module-path``
  argument to the Java compiler. This allows building JAR files that use JPMS
  modules in their build.

Generator Expressions
---------------------

* :ref:`String Comparison <String Comparisons Generator Expressions>`
  generator expressions were added.

* :genex:`$<STRING:...>` generator expressions were added for
  :ref:`query <String Queries Generator Expressions>`,
  :ref:`generation <String Generating Generator Expressions>`, and
  :ref:`transformation <String Transforming Generator Expressions>`
  operations on strings.

* The :genex:`$<FILE_SET_EXISTS>` and :genex:`$<FILE_SET_PROPERTY>` generator
  expressions were added to query file set existence and properties.

* The :genex:`$<SOURCE_EXISTS>` and :genex:`$<SOURCE_PROPERTY>` generator
  expressions were added to query source file existence and properties.

CTest
-----

* The :module:`CTestCoverageCollectGCOV` module:

  * Now supports ``TARBALL_COMPRESSION`` method ``LZMA``.

  * Now supports ``TARBALL_COMPRESSION`` method ``LZMA2``
    as an alias for ``XZ``.

  * Now supports ``FROM_EXT`` with file extensions corresponding to
    ``LZMA`` and ``ZSTD`` compression.

CPack
-----

* :module:`CPack` gained the :variable:`CPACK_COMPRESSION_LEVEL`
  variable to control the compression level used when creating
  packages.

* The :cpack_gen:`CPack Archive Generator`:

  * Now supports compression method specification for formats
    ``7zip`` and ``zip``.

  * Gained a :variable:`CPACK_ARCHIVE_COMPRESSION_LEVEL` option to
    control the compression level used when creating archive packages.

  * Gained :variable:`CPACK_ARCHIVE_UID` and :variable:`CPACK_ARCHIVE_GID`
    options to specify the UID and GID of archive entries, respectively.
    The defaults are UID ``0`` and GID ``0``.  See policy :policy:`CMP0206`.

* The :cpack_gen:`CPack DEB Generator` gained a new
  :variable:`CPACK_DEBIAN_COMPRESSION_LEVEL` variable to control the
  compression level used when creating Debian packages.

* The :cpack_gen:`CPack WIX Generator` now supports per-user installers
  by setting :variable:`CPACK_WIX_INSTALL_SCOPE` to ``perUser``.

Deprecated and Removed Features
===============================

* The :variable:`CMAKE_ENABLE_EXPORTS` variable is deprecated in favor of
  the :variable:`CMAKE_EXECUTABLE_ENABLE_EXPORTS` and
  :variable:`CMAKE_SHARED_LIBRARY_ENABLE_EXPORTS` variables.

* The :command:`export(EXPORT)` command no longer allows certain
  arguments to be missing or empty.  See policy :policy:`CMP0208`.

Other Changes
=============

* The :option:`cmake -E tar <cmake-E tar>` command-line tool
  and the :command:`file(ARCHIVE_EXTRACT)` command now reject archive
  entries whose paths are absolute or contain ``..`` path traversal
  components.

* The family of :option:`cmake --trace` and related commands now print "end"
  commands for control structures: :command:`endblock`, :command:`endforeach`,
  :command:`endfunction`, :command:`endif`, :command:`endmacro`, and
  :command:`endwhile`.

* The :command:`file(CREATE_LINK)` command's ``COPY_ON_ERROR`` option,
  when used with a directory, now copies directory content.
  See policy :policy:`CMP0205`.

* The :command:`file(GET_RUNTIME_DEPENDENCIES)`
  and :command:`install(RUNTIME_DEPENDENCY_SET)` commands now normalize
  paths before matching filters.  See policy :policy:`CMP0207`.

* The precompiled Linux ``aarch64`` binaries provided on
  `cmake.org <https://cmake.org/download/>`_ now require GLIBC 2.28 or higher.

* The precompiled macOS binary provided on ``cmake.org`` for macOS 10.13+
  now requires macOS 12 or newer for the :manual:`cmake-gui(1)` application.
  The command-line tools still run on macOS 10.13.

* The precompiled Windows binaries provided on
  `cmake.org <https://cmake.org/download/>`_ now require Windows 10 or higher.