File: 4.1.rst

package info (click to toggle)
cmake 4.2.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 152,336 kB
  • sloc: ansic: 403,896; cpp: 303,920; sh: 4,105; python: 3,583; yacc: 3,106; lex: 1,279; f90: 538; asm: 471; lisp: 375; cs: 270; java: 266; fortran: 239; objc: 215; perl: 213; xml: 198; makefile: 111; javascript: 83; pascal: 63; tcl: 55; php: 25; ruby: 22
file content (271 lines) | stat: -rw-r--r-- 10,025 bytes parent folder | download | duplicates (2)
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
CMake 4.1 Release Notes
***********************

.. only:: html

  .. contents::

Changes made since CMake 4.0 include the following.

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

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

* The :manual:`cmake-file-api(7)` :ref:`v1 <file-api v1>` now writes
  partial replies when buildsystem generation fails with an error.
  See the :ref:`v1 Reply Error Index <file-api reply error index>`.

Generators
----------

* :ref:`Makefile Generators` and :ref:`Ninja Generators` gained support
  for adding a linker launcher with ``Fortran``, ``CUDA``, and ``HIP``.
  See the :variable:`CMAKE_<LANG>_LINKER_LAUNCHER` variable
  and :prop_tgt:`<LANG>_LINKER_LAUNCHER` target property for details.

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

* The :ref:`cmake --build <Build Tool Mode>` command-line tool, when used
  with the :generator:`Xcode` generator, now detects when a third-party
  tool has wrapped the generated ``.xcodeproj`` in a ``.xcworkspace``,
  and drives the build through the workspace instead.

Configure Log
-------------

* The :manual:`cmake-configure-log(7)` now reports events from
  :command:`find_package` (in ``CONFIG`` mode), :command:`find_path`,
  :command:`find_file`, :command:`find_library`, and :command:`find_program`
  commands when first invoked, when their results transition between
  "not found" and "found", or when enabled explicitly by the
  :option:`--debug-find <cmake --debug-find>` command-line option.
  See :ref:`find configure-log event` and
  :ref:`find_package configure-log event`.  Logging may also be controlled
  by the :variable:`CMAKE_FIND_DEBUG_MODE` and
  :variable:`CMAKE_FIND_DEBUG_MODE_NO_IMPLICIT_CONFIGURE_LOG` variables.

Compilers
---------

* `Diab compilers from Wind River Systems`_, versions 5.9.x+, are now
  supported with :variable:`compiler id <CMAKE_<LANG>_COMPILER_ID>` ``Diab``
  for languages ``ASM``, ``C``, and ``CXX``.

.. _`Diab compilers from Wind River Systems`: https://www.windriver.com/resource/wind-river-diab-compiler-product-overview

* `Renesas Compilers`_ are now supported with
  :variable:`compiler id <CMAKE_<LANG>_COMPILER_ID>` ``Renesas`` for
  languages ``ASM`` and ``C``.

.. _Renesas Compilers: https://www.renesas.com

Commands
--------

* The :command:`add_dependencies` command may be called with no dependencies.

* The :command:`cmake_pkg_config` command now supports the ``IMPORT`` and
  ``POPULATE`` subcommands for interfacing CMake targets with pkg-config based
  dependencies.

* The :command:`project` command now has experimental support for the
  ``COMPAT_VERSION`` keyword, gated by
  ``CMAKE_EXPERIMENTAL_EXPORT_PACKAGE_INFO``.

Variables
---------

* The :variable:`CMAKE_FIND_REQUIRED` variable was added to tell
  :command:`find_package`, :command:`find_path`, :command:`find_file`,
  :command:`find_library`, and :command:`find_program` to be ``REQUIRED``
  by default.  The commands also gained an ``OPTIONAL`` keyword to ignore
  the variable for a specific call.

* The :variable:`CMAKE_<LANG>_COMPILER_ARCHITECTURE_ID` variable is now
  populated for most compilers, and documented for public use.

* The :variable:`CMAKE_<LANG>_ICSTAT` variable and corresponding
  :prop_tgt:`<LANG>_ICSTAT` target property were added to tell
  the :ref:`Makefile Generators` and the :ref:`Ninja Generators`
  to run the IAR ``icstat`` tool along with the compiler for
  ``C`` and ``CXX`` languages.

Environment Variables
---------------------

* The :envvar:`CMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES_EXCLUDE` environment
  variable was added to optionally exclude specific libraries from the
  detected set of :variable:`CMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES`.

Properties
----------

* The :prop_tgt:`AUTOMOC_INCLUDE_DIRECTORIES` target property and associated
  :variable:`CMAKE_AUTOMOC_INCLUDE_DIRECTORIES` variable were added to
  override the automatic discovery of moc includes from a target's transitive
  include directories.

* The :prop_sf:`MACOSX_PACKAGE_LOCATION` source file property now
  works when set on a source directory, and copies its entire tree
  into the bundle.

* The :prop_tgt:`PDB_NAME` and :prop_tgt:`COMPILE_PDB_NAME` target properties
  now support :manual:`generator expressions <cmake-generator-expressions(7)>`.

Modules
-------

* The :module:`FindASPELL` module now provides a version variable, imported
  targets, and components to optionally select the Aspell library and
  executable separately.

* The :module:`FindBLAS` and :module:`FindLAPACK` modules now support the
  NVIDIA Performance Libraries (NVPL).

* The :module:`FindProtobuf` module's :command:`protobuf_generate(DEPENDENCIES)`
  command argument now accepts multiple values.

* The :module:`FindProtobuf` module's :command:`protobuf_generate_cpp` and
  :command:`protobuf_generate_python` commands, together with their
  ``Protobuf_IMPORT_DIRS`` and ``PROTOBUF_GENERATE_CPP_APPEND_PATH`` hint
  variables, are now deprecated in favor of the :command:`protobuf_generate`
  command.

Regular Expressions
-------------------

* The :command:`string(REGEX MATCHALL)`, :command:`string(REGEX REPLACE)`, and
  :command:`list(TRANSFORM REPLACE)` commands now match the regular expression
  ``^`` anchor at most once in repeated searches, at the start of the input.
  See policy :policy:`CMP0186`.

* The :command:`string(REGEX REPLACE)` command now allows references to
  unmatched groups.  They are replaced with empty strings.

* The :command:`string(REGEX MATCH)`, :command:`string(REGEX MATCHALL)`, and
  :command:`string(REGEX REPLACE)` commands now allow zero-length matches.

CTest
-----

* :manual:`ctest(1)` gained a
  :option:`--schedule-random-seed <ctest --schedule-random-seed>`
  option to specify a numeric random seed to make
  :option:`ctest --schedule-random` deterministic for reproduction.

CPack
-----

* The :cpack_gen:`CPack NuGet Generator` gained option
  :variable:`CPACK_NUGET_SYMBOL_PACKAGE` to generate NuGet
  symbol packages containing PDB files.

* The :cpack_gen:`CPack RPM Generator` gained
  :variable:`CPACK_RPM_PACKAGE_ENHANCES`,
  :variable:`CPACK_RPM_PACKAGE_RECOMMENDS`, and
  :variable:`CPACK_RPM_PACKAGE_SUPPLEMENTS`
  variables to specify the corresponding RPM spec fields.

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

* The :module:`FindGTest` module's result variables ``GTEST_INCLUDE_DIRS``,
  ``GTEST_LIBRARIES``, ``GTEST_MAIN_LIBRARIES``, and ``GTEST_BOTH_LIBRARIES``
  are now deprecated in favor of using ``GTest::gtest`` and
  ``GTest::gtest_main`` imported targets.

* The :module:`FindGCCXML` module has been deprecated via policy
  :policy:`CMP0188`.  Port projects to CastXML instead.

* The :module:`FindCABLE` module has been deprecated via policy
  :policy:`CMP0191`.

* The :module:`CMakeDetermineVSServicePack` module has been deprecated
  via policy :policy:`CMP0196`.  Port projects to the
  :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable instead.

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

* The :module:`ExternalProject` module no longer checks the ``URL`` archive
  file extension.  Any archive type that :option:`cmake -E tar <cmake-E tar>`
  can extract is now allowed.

* Modules :module:`FindPython3`, :module:`FindPython2` and
  :module:`FindPython` now enforce consistency of artifacts in
  cross-compiling mode.  This prevents mixing host and target artifacts.
  See policy :policy:`CMP0190`.

* The :module:`GNUInstallDirs` module now prefers to default
  ``SYSCONFDIR``, ``LOCALSTATEDIR``, and ``RUNSTATEDIR`` to
  absolute paths when installing to special prefixes.
  See policy :policy:`CMP0192`.

* The :module:`GNUInstallDirs` module now caches ``CMAKE_INSTALL_*``
  variables with their leading ``usr/`` for install prefix ``/``.
  See policy :policy:`CMP0193`.

* The :command:`install(TARGETS)` command no longer ignores file sets which
  haven't been defined at the point it is called. The ordering of
  :command:`target_sources(FILE_SET)` and ``install(TARGETS)`` is no longer
  semantically relevant.

* Enabling ``ASM`` no longer accidentally succeeds using ``MSVC``'s ``cl``
  C compiler as an assembler.  See policy :policy:`CMP0194`.

* The MSVC link ``-machine:`` flag is no longer added to the
  ``CMAKE_*_LINKER_FLAGS`` variables.  See policy :policy:`CMP0197`.

* The :ref:`Visual Studio Generators` now suppress Visual Studio's default
  ``-Zc:forScope``, ``-Zc:inline``, and ``-Zc:wchar_t`` compiler flags,
  and ``-dynamicbase``, ``-errorreport``, ``-nxcompat``, and ``-safeseh``
  link flags, if they are not specified by the project or user.  This makes
  builds more consistent with other generators, and with what projects and
  users actually specify.

* The :genex:`TARGET_PROPERTY` generator expression now evaluates the
  :prop_tgt:`LINK_LIBRARIES` and :prop_tgt:`INTERFACE_LINK_LIBRARIES`
  target properties transitively.  See policy :policy:`CMP0189`.

Updates
=======

Changes made since CMake 4.1.0 include the following.

4.1.1
-----

* This version made no changes to documented features or interfaces.
  Some implementation updates were made to support ecosystem changes
  and/or fix regressions.

4.1.2
-----

* The :command:`file(GENERATE)` command, when evaluating generator
  expressions, now uses the value of policy :policy:`CMP0189` as of
  each call site.  Previously, it used the value as of the end of the
  directory's ``CMakeLists.txt``, as all other generator expression
  evaluations do.

4.1.3
-----

* When building for macOS with the :generator:`Xcode` generator,
  :variable:`CMAKE_OSX_DEPLOYMENT_TARGET` once again defaults to the
  host's macOS version if it is older than the macOS SDK version,
  as it did in CMake versions prior to 4.0.

* The :command:`execute_process` command once again terminates child
  processes when its ``TIMEOUT`` is reached.  This was accidentally
  regressed by CMake 3.29.

4.1.4, 4.1.5
------------

* These versions made no changes to documented features or interfaces.
  Some implementation updates were made to support ecosystem changes
  and/or fix regressions.