paredeyes commited on
Commit
5deaa18
·
verified ·
1 Parent(s): c901971

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. cmake/man/man1/ccmake.1 +476 -0
  2. cmake/man/man1/cmake-gui.1 +296 -0
  3. cmake/man/man1/cpack.1 +380 -0
  4. cmake/man/man1/ctest.1 +2609 -0
  5. cmake/man/man7/cmake-buildsystem.7 +1640 -0
  6. cmake/man/man7/cmake-commands.7 +0 -0
  7. cmake/man/man7/cmake-compile-features.7 +395 -0
  8. cmake/man/man7/cmake-configure-log.7 +386 -0
  9. cmake/man/man7/cmake-cxxmodules.7 +194 -0
  10. cmake/man/man7/cmake-developer.7 +676 -0
  11. cmake/man/man7/cmake-env-variables.7 +1443 -0
  12. cmake/man/man7/cmake-file-api.7 +1984 -0
  13. cmake/man/man7/cmake-generator-expressions.7 +0 -0
  14. cmake/man/man7/cmake-generators.7 +1188 -0
  15. cmake/man/man7/cmake-language.7 +684 -0
  16. cmake/man/man7/cmake-modules.7 +0 -0
  17. cmake/man/man7/cmake-packages.7 +899 -0
  18. cmake/man/man7/cmake-policies.7 +0 -0
  19. cmake/man/man7/cmake-presets.7 +1550 -0
  20. cmake/man/man7/cmake-properties.7 +0 -0
  21. cmake/man/man7/cmake-qt.7 +333 -0
  22. cmake/man/man7/cmake-server.7 +39 -0
  23. cmake/man/man7/cmake-toolchains.7 +906 -0
  24. cmake/man/man7/cmake-variables.7 +0 -0
  25. cmake/man/man7/cpack-generators.7 +0 -0
  26. cmake/share/aclocal/cmake.m4 +44 -0
  27. cmake/share/bash-completion/completions/cmake +242 -0
  28. cmake/share/bash-completion/completions/cpack +90 -0
  29. cmake/share/bash-completion/completions/ctest +131 -0
  30. cmake/share/cmake-3.31/Help/index.rst +109 -0
  31. cmake/share/cmake-3.31/Licenses/LGPLv3.txt +165 -0
  32. cmake/share/cmake-3.31/Modules/AddFileDependencies.cmake +33 -0
  33. cmake/share/cmake-3.31/Modules/AndroidTestUtilities.cmake +165 -0
  34. cmake/share/cmake-3.31/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in +32 -0
  35. cmake/share/cmake-3.31/Modules/BasicConfigVersion-ExactVersion.cmake.in +72 -0
  36. cmake/share/cmake-3.31/Modules/BasicConfigVersion-SameMajorVersion.cmake.in +54 -0
  37. cmake/share/cmake-3.31/Modules/BasicConfigVersion-SameMinorVersion.cmake.in +74 -0
  38. cmake/share/cmake-3.31/Modules/BundleUtilities.cmake +1131 -0
  39. cmake/share/cmake-3.31/Modules/CMakeCSharpCompiler.cmake.in +10 -0
  40. cmake/share/cmake-3.31/Modules/CMakeCSharpCompilerId.cs.in +71 -0
  41. cmake/share/cmake-3.31/Modules/CMakeCSharpInformation.cmake +70 -0
  42. cmake/share/cmake-3.31/Modules/CMakeCUDACompiler.cmake.in +87 -0
  43. cmake/share/cmake-3.31/Modules/CMakeCUDACompilerABI.cu +26 -0
  44. cmake/share/cmake-3.31/Modules/CMakeCUDACompilerId.cu.in +110 -0
  45. cmake/share/cmake-3.31/Modules/CMakeCUDAInformation.cmake +155 -0
  46. cmake/share/cmake-3.31/Modules/CMakeCXXCompilerABI.cpp +18 -0
  47. cmake/share/cmake-3.31/Modules/CMakeCompilerIdDetection.cmake +162 -0
  48. cmake/share/cmake-3.31/Modules/CMakeConfigurableFile.in +1 -0
  49. cmake/share/cmake-3.31/Modules/CheckCCompilerFlag.cmake +61 -0
  50. cmake/share/cmake-3.31/Modules/CheckCSourceCompiles.cmake +59 -0
cmake/man/man1/ccmake.1 ADDED
@@ -0,0 +1,476 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .\" Man page generated from reStructuredText.
2
+ .
3
+ .
4
+ .nr rst2man-indent-level 0
5
+ .
6
+ .de1 rstReportMargin
7
+ \\$1 \\n[an-margin]
8
+ level \\n[rst2man-indent-level]
9
+ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
10
+ -
11
+ \\n[rst2man-indent0]
12
+ \\n[rst2man-indent1]
13
+ \\n[rst2man-indent2]
14
+ ..
15
+ .de1 INDENT
16
+ .\" .rstReportMargin pre:
17
+ . RS \\$1
18
+ . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
19
+ . nr rst2man-indent-level +1
20
+ .\" .rstReportMargin post:
21
+ ..
22
+ .de UNINDENT
23
+ . RE
24
+ .\" indent \\n[an-margin]
25
+ .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
26
+ .nr rst2man-indent-level -1
27
+ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
28
+ .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
29
+ ..
30
+ .TH "CCMAKE" "1" "Jan 10, 2025" "3.31.4" "CMake"
31
+ .SH NAME
32
+ ccmake \- CMake Curses Dialog Command-Line Reference
33
+ .SH SYNOPSIS
34
+ .INDENT 0.0
35
+ .INDENT 3.5
36
+ .sp
37
+ .nf
38
+ .ft C
39
+ ccmake [<options>] \-B <path\-to\-build> [\-S <path\-to\-source>]
40
+ ccmake [<options>] <path\-to\-source | path\-to\-existing\-build>
41
+ .ft P
42
+ .fi
43
+ .UNINDENT
44
+ .UNINDENT
45
+ .SH DESCRIPTION
46
+ .sp
47
+ The \fBccmake\fP executable is the CMake curses interface. Project
48
+ configuration settings may be specified interactively through this
49
+ GUI. Brief instructions are provided at the bottom of the terminal
50
+ when the program is running.
51
+ .sp
52
+ CMake is a cross\-platform build system generator. Projects specify
53
+ their build process with platform\-independent CMake listfiles included
54
+ in each directory of a source tree with the name \fBCMakeLists.txt\fP\&.
55
+ Users build a project by using CMake to generate a build system for a
56
+ native tool on their platform.
57
+ .SH OPTIONS
58
+ .INDENT 0.0
59
+ .TP
60
+ .B \-S <path\-to\-source>
61
+ Path to root directory of the CMake project to build.
62
+ .UNINDENT
63
+ .INDENT 0.0
64
+ .TP
65
+ .B \-B <path\-to\-build>
66
+ Path to directory which CMake will use as the root of build directory.
67
+ .sp
68
+ If the directory doesn\(aqt already exist CMake will make it.
69
+ .UNINDENT
70
+ .INDENT 0.0
71
+ .TP
72
+ .B \-C <initial\-cache>
73
+ Pre\-load a script to populate the cache.
74
+ .sp
75
+ When CMake is first run in an empty build tree, it creates a
76
+ \fBCMakeCache.txt\fP file and populates it with customizable settings for
77
+ the project. This option may be used to specify a file from which
78
+ to load cache entries before the first pass through the project\(aqs
79
+ CMake listfiles. The loaded entries take priority over the
80
+ project\(aqs default values. The given file should be a CMake script
81
+ containing \X'tty: link #command:set'\fI\%set()\fP\X'tty: link' commands that use the \fBCACHE\fP option, not a
82
+ cache\-format file.
83
+ .sp
84
+ References to \X'tty: link #variable:CMAKE_SOURCE_DIR'\fI\%CMAKE_SOURCE_DIR\fP\X'tty: link' and \X'tty: link #variable:CMAKE_BINARY_DIR'\fI\%CMAKE_BINARY_DIR\fP\X'tty: link'
85
+ within the script evaluate to the top\-level source and build tree.
86
+ .UNINDENT
87
+ .INDENT 0.0
88
+ .TP
89
+ .B \-D <var>:<type>=<value>, \-D <var>=<value>
90
+ Create or update a CMake \fBCACHE\fP entry.
91
+ .sp
92
+ When CMake is first run in an empty build tree, it creates a
93
+ \fBCMakeCache.txt\fP file and populates it with customizable settings for
94
+ the project. This option may be used to specify a setting that
95
+ takes priority over the project\(aqs default value. The option may be
96
+ repeated for as many \fBCACHE\fP entries as desired.
97
+ .sp
98
+ If the \fB:<type>\fP portion is given it must be one of the types
99
+ specified by the \X'tty: link #command:set'\fI\%set()\fP\X'tty: link' command documentation for its
100
+ \fBCACHE\fP signature.
101
+ If the \fB:<type>\fP portion is omitted the entry will be created
102
+ with no type if it does not exist with a type already. If a
103
+ command in the project sets the type to \fBPATH\fP or \fBFILEPATH\fP
104
+ then the \fB<value>\fP will be converted to an absolute path.
105
+ .sp
106
+ This option may also be given as a single argument:
107
+ \fB\-D<var>:<type>=<value>\fP or \fB\-D<var>=<value>\fP\&.
108
+ .sp
109
+ It\(aqs important to note that the order of \fB\-C\fP and \fB\-D\fP arguments is
110
+ significant. They will be carried out in the order they are listed, with the
111
+ last argument taking precedence over the previous ones. For example, if you
112
+ specify \fB\-DCMAKE_BUILD_TYPE=Debug\fP, followed by a \fB\-C\fP argument with a
113
+ file that calls:
114
+ .INDENT 7.0
115
+ .INDENT 3.5
116
+ .sp
117
+ .nf
118
+ .ft C
119
+ set(CMAKE_BUILD_TYPE \(dqRelease\(dq CACHE STRING \(dq\(dq FORCE)
120
+ .ft P
121
+ .fi
122
+ .UNINDENT
123
+ .UNINDENT
124
+ .sp
125
+ then the \fB\-C\fP argument will take precedence, and \fBCMAKE_BUILD_TYPE\fP will
126
+ be set to \fBRelease\fP\&. However, if the \fB\-D\fP argument comes after the \fB\-C\fP
127
+ argument, it will be set to \fBDebug\fP\&.
128
+ .sp
129
+ If a \fBset(... CACHE ...)\fP call in the \fB\-C\fP file does not use \fBFORCE\fP,
130
+ and a \fB\-D\fP argument sets the same variable, the \fB\-D\fP argument will take
131
+ precedence regardless of order because of the nature of non\-\fBFORCE\fP
132
+ \fBset(... CACHE ...)\fP calls.
133
+ .UNINDENT
134
+ .INDENT 0.0
135
+ .TP
136
+ .B \-U <globbing_expr>
137
+ Remove matching entries from CMake \fBCACHE\fP\&.
138
+ .sp
139
+ This option may be used to remove one or more variables from the
140
+ \fBCMakeCache.txt\fP file, globbing expressions using \fB*\fP and \fB?\fP are
141
+ supported. The option may be repeated for as many \fBCACHE\fP entries as
142
+ desired.
143
+ .sp
144
+ Use with care, you can make your \fBCMakeCache.txt\fP non\-working.
145
+ .UNINDENT
146
+ .INDENT 0.0
147
+ .TP
148
+ .B \-G <generator\-name>
149
+ Specify a build system generator.
150
+ .sp
151
+ CMake may support multiple native build systems on certain
152
+ platforms. A generator is responsible for generating a particular
153
+ build system. Possible generator names are specified in the
154
+ \X'tty: link #manual:cmake-generators(7)'\fI\%cmake\-generators(7)\fP\X'tty: link' manual.
155
+ .sp
156
+ If not specified, CMake checks the \X'tty: link #envvar:CMAKE_GENERATOR'\fI\%CMAKE_GENERATOR\fP\X'tty: link' environment
157
+ variable and otherwise falls back to a builtin default selection.
158
+ .UNINDENT
159
+ .INDENT 0.0
160
+ .TP
161
+ .B \-T <toolset\-spec>
162
+ Toolset specification for the generator, if supported.
163
+ .sp
164
+ Some CMake generators support a toolset specification to tell
165
+ the native build system how to choose a compiler. See the
166
+ \X'tty: link #variable:CMAKE_GENERATOR_TOOLSET'\fI\%CMAKE_GENERATOR_TOOLSET\fP\X'tty: link' variable for details.
167
+ .UNINDENT
168
+ .INDENT 0.0
169
+ .TP
170
+ .B \-A <platform\-name>
171
+ Specify platform name if supported by generator.
172
+ .sp
173
+ Some CMake generators support a platform name to be given to the
174
+ native build system to choose a compiler or SDK. See the
175
+ \X'tty: link #variable:CMAKE_GENERATOR_PLATFORM'\fI\%CMAKE_GENERATOR_PLATFORM\fP\X'tty: link' variable for details.
176
+ .UNINDENT
177
+ .INDENT 0.0
178
+ .TP
179
+ .B \-\-toolchain <path\-to\-file>
180
+ Added in version 3.21.
181
+
182
+ .sp
183
+ Specify the cross compiling toolchain file, equivalent to setting
184
+ \X'tty: link #variable:CMAKE_TOOLCHAIN_FILE'\fI\%CMAKE_TOOLCHAIN_FILE\fP\X'tty: link' variable. Relative paths are interpreted as
185
+ relative to the build directory, and if not found, relative to the source
186
+ directory.
187
+ .UNINDENT
188
+ .INDENT 0.0
189
+ .TP
190
+ .B \-\-install\-prefix <directory>
191
+ Added in version 3.21.
192
+
193
+ .sp
194
+ Specify the installation directory, used by the
195
+ \X'tty: link #variable:CMAKE_INSTALL_PREFIX'\fI\%CMAKE_INSTALL_PREFIX\fP\X'tty: link' variable. Must be an absolute path.
196
+ .UNINDENT
197
+ .INDENT 0.0
198
+ .TP
199
+ .B \-Wno\-dev
200
+ Suppress developer warnings.
201
+ .sp
202
+ Suppress warnings that are meant for the author of the
203
+ \fBCMakeLists.txt\fP files. By default this will also turn off
204
+ deprecation warnings.
205
+ .UNINDENT
206
+ .INDENT 0.0
207
+ .TP
208
+ .B \-Wdev
209
+ Enable developer warnings.
210
+ .sp
211
+ Enable warnings that are meant for the author of the \fBCMakeLists.txt\fP
212
+ files. By default this will also turn on deprecation warnings.
213
+ .UNINDENT
214
+ .INDENT 0.0
215
+ .TP
216
+ .B \-Wdeprecated
217
+ Enable deprecated functionality warnings.
218
+ .sp
219
+ Enable warnings for usage of deprecated functionality, that are meant
220
+ for the author of the \fBCMakeLists.txt\fP files.
221
+ .UNINDENT
222
+ .INDENT 0.0
223
+ .TP
224
+ .B \-Wno\-deprecated
225
+ Suppress deprecated functionality warnings.
226
+ .sp
227
+ Suppress warnings for usage of deprecated functionality, that are meant
228
+ for the author of the \fBCMakeLists.txt\fP files.
229
+ .UNINDENT
230
+ .INDENT 0.0
231
+ .TP
232
+ .B \-Werror=<what>
233
+ Treat CMake warnings as errors. \fB<what>\fP must be one of the following:
234
+ .INDENT 7.0
235
+ .TP
236
+ .B \fBdev\fP
237
+ Make developer warnings errors.
238
+ .sp
239
+ Make warnings that are meant for the author of the \fBCMakeLists.txt\fP files
240
+ errors. By default this will also turn on deprecated warnings as errors.
241
+ .TP
242
+ .B \fBdeprecated\fP
243
+ Make deprecated macro and function warnings errors.
244
+ .sp
245
+ Make warnings for usage of deprecated macros and functions, that are meant
246
+ for the author of the \fBCMakeLists.txt\fP files, errors.
247
+ .UNINDENT
248
+ .UNINDENT
249
+ .INDENT 0.0
250
+ .TP
251
+ .B \-Wno\-error=<what>
252
+ Do not treat CMake warnings as errors. \fB<what>\fP must be one of the following:
253
+ .INDENT 7.0
254
+ .TP
255
+ .B \fBdev\fP
256
+ Make warnings that are meant for the author of the \fBCMakeLists.txt\fP files not
257
+ errors. By default this will also turn off deprecated warnings as errors.
258
+ .TP
259
+ .B \fBdeprecated\fP
260
+ Make warnings for usage of deprecated macros and functions, that are meant
261
+ for the author of the \fBCMakeLists.txt\fP files, not errors.
262
+ .UNINDENT
263
+ .UNINDENT
264
+ .INDENT 0.0
265
+ .TP
266
+ .B \-version [<file>], \-\-version [<file>], /V [<file>]
267
+ Show program name/version banner and exit.
268
+ The output is printed to a named \fB<file>\fP if given.
269
+ .UNINDENT
270
+ .INDENT 0.0
271
+ .TP
272
+ .B \-h, \-H, \-\-help, \-help, \-usage, /?
273
+ Print usage information and exit.
274
+ .sp
275
+ Usage describes the basic command line interface and its options.
276
+ .UNINDENT
277
+ .INDENT 0.0
278
+ .TP
279
+ .B \-\-help <keyword> [<file>]
280
+ Print help for one CMake keyword.
281
+ .sp
282
+ \fB<keyword>\fP can be a property, variable, command, policy, generator
283
+ or module.
284
+ .sp
285
+ The relevant manual entry for \fB<keyword>\fP is
286
+ printed in a human\-readable text format.
287
+ The output is printed to a named \fB<file>\fP if given.
288
+ .sp
289
+ Changed in version 3.28: Prior to CMake 3.28, this option supported command names only.
290
+
291
+ .UNINDENT
292
+ .INDENT 0.0
293
+ .TP
294
+ .B \-\-help\-full [<file>]
295
+ Print all help manuals and exit.
296
+ .sp
297
+ All manuals are printed in a human\-readable text format.
298
+ The output is printed to a named \fB<file>\fP if given.
299
+ .UNINDENT
300
+ .INDENT 0.0
301
+ .TP
302
+ .B \-\-help\-manual <man> [<file>]
303
+ Print one help manual and exit.
304
+ .sp
305
+ The specified manual is printed in a human\-readable text format.
306
+ The output is printed to a named \fB<file>\fP if given.
307
+ .UNINDENT
308
+ .INDENT 0.0
309
+ .TP
310
+ .B \-\-help\-manual\-list [<file>]
311
+ List help manuals available and exit.
312
+ .sp
313
+ The list contains all manuals for which help may be obtained by
314
+ using the \fB\-\-help\-manual\fP option followed by a manual name.
315
+ The output is printed to a named \fB<file>\fP if given.
316
+ .UNINDENT
317
+ .INDENT 0.0
318
+ .TP
319
+ .B \-\-help\-command <cmd> [<file>]
320
+ Print help for one command and exit.
321
+ .sp
322
+ The \X'tty: link #manual:cmake-commands(7)'\fI\%cmake\-commands(7)\fP\X'tty: link' manual entry for \fB<cmd>\fP is
323
+ printed in a human\-readable text format.
324
+ The output is printed to a named \fB<file>\fP if given.
325
+ .UNINDENT
326
+ .INDENT 0.0
327
+ .TP
328
+ .B \-\-help\-command\-list [<file>]
329
+ List commands with help available and exit.
330
+ .sp
331
+ The list contains all commands for which help may be obtained by
332
+ using the \fB\-\-help\-command\fP option followed by a command name.
333
+ The output is printed to a named \fB<file>\fP if given.
334
+ .UNINDENT
335
+ .INDENT 0.0
336
+ .TP
337
+ .B \-\-help\-commands [<file>]
338
+ Print cmake\-commands manual and exit.
339
+ .sp
340
+ The \X'tty: link #manual:cmake-commands(7)'\fI\%cmake\-commands(7)\fP\X'tty: link' manual is printed in a
341
+ human\-readable text format.
342
+ The output is printed to a named \fB<file>\fP if given.
343
+ .UNINDENT
344
+ .INDENT 0.0
345
+ .TP
346
+ .B \-\-help\-module <mod> [<file>]
347
+ Print help for one module and exit.
348
+ .sp
349
+ The \X'tty: link #manual:cmake-modules(7)'\fI\%cmake\-modules(7)\fP\X'tty: link' manual entry for \fB<mod>\fP is printed
350
+ in a human\-readable text format.
351
+ The output is printed to a named \fB<file>\fP if given.
352
+ .UNINDENT
353
+ .INDENT 0.0
354
+ .TP
355
+ .B \-\-help\-module\-list [<file>]
356
+ List modules with help available and exit.
357
+ .sp
358
+ The list contains all modules for which help may be obtained by
359
+ using the \fB\-\-help\-module\fP option followed by a module name.
360
+ The output is printed to a named \fB<file>\fP if given.
361
+ .UNINDENT
362
+ .INDENT 0.0
363
+ .TP
364
+ .B \-\-help\-modules [<file>]
365
+ Print cmake\-modules manual and exit.
366
+ .sp
367
+ The \X'tty: link #manual:cmake-modules(7)'\fI\%cmake\-modules(7)\fP\X'tty: link' manual is printed in a human\-readable
368
+ text format.
369
+ The output is printed to a named \fB<file>\fP if given.
370
+ .UNINDENT
371
+ .INDENT 0.0
372
+ .TP
373
+ .B \-\-help\-policy <cmp> [<file>]
374
+ Print help for one policy and exit.
375
+ .sp
376
+ The \X'tty: link #manual:cmake-policies(7)'\fI\%cmake\-policies(7)\fP\X'tty: link' manual entry for \fB<cmp>\fP is
377
+ printed in a human\-readable text format.
378
+ The output is printed to a named \fB<file>\fP if given.
379
+ .UNINDENT
380
+ .INDENT 0.0
381
+ .TP
382
+ .B \-\-help\-policy\-list [<file>]
383
+ List policies with help available and exit.
384
+ .sp
385
+ The list contains all policies for which help may be obtained by
386
+ using the \fB\-\-help\-policy\fP option followed by a policy name.
387
+ The output is printed to a named \fB<file>\fP if given.
388
+ .UNINDENT
389
+ .INDENT 0.0
390
+ .TP
391
+ .B \-\-help\-policies [<file>]
392
+ Print cmake\-policies manual and exit.
393
+ .sp
394
+ The \X'tty: link #manual:cmake-policies(7)'\fI\%cmake\-policies(7)\fP\X'tty: link' manual is printed in a
395
+ human\-readable text format.
396
+ The output is printed to a named \fB<file>\fP if given.
397
+ .UNINDENT
398
+ .INDENT 0.0
399
+ .TP
400
+ .B \-\-help\-property <prop> [<file>]
401
+ Print help for one property and exit.
402
+ .sp
403
+ The \X'tty: link #manual:cmake-properties(7)'\fI\%cmake\-properties(7)\fP\X'tty: link' manual entries for \fB<prop>\fP are
404
+ printed in a human\-readable text format.
405
+ The output is printed to a named \fB<file>\fP if given.
406
+ .UNINDENT
407
+ .INDENT 0.0
408
+ .TP
409
+ .B \-\-help\-property\-list [<file>]
410
+ List properties with help available and exit.
411
+ .sp
412
+ The list contains all properties for which help may be obtained by
413
+ using the \fB\-\-help\-property\fP option followed by a property name.
414
+ The output is printed to a named \fB<file>\fP if given.
415
+ .UNINDENT
416
+ .INDENT 0.0
417
+ .TP
418
+ .B \-\-help\-properties [<file>]
419
+ Print cmake\-properties manual and exit.
420
+ .sp
421
+ The \X'tty: link #manual:cmake-properties(7)'\fI\%cmake\-properties(7)\fP\X'tty: link' manual is printed in a
422
+ human\-readable text format.
423
+ The output is printed to a named \fB<file>\fP if given.
424
+ .UNINDENT
425
+ .INDENT 0.0
426
+ .TP
427
+ .B \-\-help\-variable <var> [<file>]
428
+ Print help for one variable and exit.
429
+ .sp
430
+ The \X'tty: link #manual:cmake-variables(7)'\fI\%cmake\-variables(7)\fP\X'tty: link' manual entry for \fB<var>\fP is
431
+ printed in a human\-readable text format.
432
+ The output is printed to a named \fB<file>\fP if given.
433
+ .UNINDENT
434
+ .INDENT 0.0
435
+ .TP
436
+ .B \-\-help\-variable\-list [<file>]
437
+ List variables with help available and exit.
438
+ .sp
439
+ The list contains all variables for which help may be obtained by
440
+ using the \fB\-\-help\-variable\fP option followed by a variable name.
441
+ The output is printed to a named \fB<file>\fP if given.
442
+ .UNINDENT
443
+ .INDENT 0.0
444
+ .TP
445
+ .B \-\-help\-variables [<file>]
446
+ Print cmake\-variables manual and exit.
447
+ .sp
448
+ The \X'tty: link #manual:cmake-variables(7)'\fI\%cmake\-variables(7)\fP\X'tty: link' manual is printed in a
449
+ human\-readable text format.
450
+ The output is printed to a named \fB<file>\fP if given.
451
+ .UNINDENT
452
+ .SH SEE ALSO
453
+ .sp
454
+ The following resources are available to get help using CMake:
455
+ .INDENT 0.0
456
+ .TP
457
+ .B Home Page
458
+ \X'tty: link https://cmake.org'\fI\%https://cmake.org\fP\X'tty: link'
459
+ .sp
460
+ The primary starting point for learning about CMake.
461
+ .TP
462
+ .B Online Documentation and Community Resources
463
+ \X'tty: link https://cmake.org/documentation'\fI\%https://cmake.org/documentation\fP\X'tty: link'
464
+ .sp
465
+ Links to available documentation and community resources may be
466
+ found on this web page.
467
+ .TP
468
+ .B Discourse Forum
469
+ \X'tty: link https://discourse.cmake.org'\fI\%https://discourse.cmake.org\fP\X'tty: link'
470
+ .sp
471
+ The Discourse Forum hosts discussion and questions about CMake.
472
+ .UNINDENT
473
+ .SH COPYRIGHT
474
+ 2000-2024 Kitware, Inc. and Contributors
475
+ .\" Generated by docutils manpage writer.
476
+ .
cmake/man/man1/cmake-gui.1 ADDED
@@ -0,0 +1,296 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .\" Man page generated from reStructuredText.
2
+ .
3
+ .
4
+ .nr rst2man-indent-level 0
5
+ .
6
+ .de1 rstReportMargin
7
+ \\$1 \\n[an-margin]
8
+ level \\n[rst2man-indent-level]
9
+ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
10
+ -
11
+ \\n[rst2man-indent0]
12
+ \\n[rst2man-indent1]
13
+ \\n[rst2man-indent2]
14
+ ..
15
+ .de1 INDENT
16
+ .\" .rstReportMargin pre:
17
+ . RS \\$1
18
+ . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
19
+ . nr rst2man-indent-level +1
20
+ .\" .rstReportMargin post:
21
+ ..
22
+ .de UNINDENT
23
+ . RE
24
+ .\" indent \\n[an-margin]
25
+ .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
26
+ .nr rst2man-indent-level -1
27
+ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
28
+ .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
29
+ ..
30
+ .TH "CMAKE-GUI" "1" "Jan 10, 2025" "3.31.4" "CMake"
31
+ .SH NAME
32
+ cmake-gui \- CMake GUI Command-Line Reference
33
+ .SH SYNOPSIS
34
+ .INDENT 0.0
35
+ .INDENT 3.5
36
+ .sp
37
+ .nf
38
+ .ft C
39
+ cmake\-gui [<options>]
40
+ cmake\-gui [<options>] \-B <path\-to\-build> [\-S <path\-to\-source>]
41
+ cmake\-gui [<options>] <path\-to\-source | path\-to\-existing\-build>
42
+ cmake\-gui [<options>] \-\-browse\-manual [<filename>]
43
+ .ft P
44
+ .fi
45
+ .UNINDENT
46
+ .UNINDENT
47
+ .SH DESCRIPTION
48
+ .sp
49
+ The \fBcmake\-gui\fP executable is the CMake GUI. Project configuration
50
+ settings may be specified interactively. Brief instructions are
51
+ provided at the bottom of the window when the program is running.
52
+ .sp
53
+ CMake is a cross\-platform build system generator. Projects specify
54
+ their build process with platform\-independent CMake listfiles included
55
+ in each directory of a source tree with the name \fBCMakeLists.txt\fP\&.
56
+ Users build a project by using CMake to generate a build system for a
57
+ native tool on their platform.
58
+ .SH OPTIONS
59
+ .INDENT 0.0
60
+ .TP
61
+ .B \-S <path\-to\-source>
62
+ Path to root directory of the CMake project to build.
63
+ .UNINDENT
64
+ .INDENT 0.0
65
+ .TP
66
+ .B \-B <path\-to\-build>
67
+ Path to directory which CMake will use as the root of build directory.
68
+ .sp
69
+ If the directory doesn\(aqt already exist CMake will make it.
70
+ .UNINDENT
71
+ .INDENT 0.0
72
+ .TP
73
+ .B \-\-preset=<preset\-name>
74
+ Name of the preset to use from the project\(aqs
75
+ \X'tty: link #manual:cmake-presets(7)'\fI\%presets\fP\X'tty: link' files, if it has them.
76
+ .UNINDENT
77
+ .INDENT 0.0
78
+ .TP
79
+ .B \-\-browse\-manual [<filename>]
80
+ Open the CMake reference manual in a browser and immediately exit. If
81
+ \fB<filename>\fP is specified, open that file within the reference manual
82
+ instead of \fBindex.html\fP\&.
83
+ .UNINDENT
84
+ .INDENT 0.0
85
+ .TP
86
+ .B \-version [<file>], \-\-version [<file>], /V [<file>]
87
+ Show program name/version banner and exit.
88
+ The output is printed to a named \fB<file>\fP if given.
89
+ .UNINDENT
90
+ .INDENT 0.0
91
+ .TP
92
+ .B \-h, \-H, \-\-help, \-help, \-usage, /?
93
+ Print usage information and exit.
94
+ .sp
95
+ Usage describes the basic command line interface and its options.
96
+ .UNINDENT
97
+ .INDENT 0.0
98
+ .TP
99
+ .B \-\-help <keyword> [<file>]
100
+ Print help for one CMake keyword.
101
+ .sp
102
+ \fB<keyword>\fP can be a property, variable, command, policy, generator
103
+ or module.
104
+ .sp
105
+ The relevant manual entry for \fB<keyword>\fP is
106
+ printed in a human\-readable text format.
107
+ The output is printed to a named \fB<file>\fP if given.
108
+ .sp
109
+ Changed in version 3.28: Prior to CMake 3.28, this option supported command names only.
110
+
111
+ .UNINDENT
112
+ .INDENT 0.0
113
+ .TP
114
+ .B \-\-help\-full [<file>]
115
+ Print all help manuals and exit.
116
+ .sp
117
+ All manuals are printed in a human\-readable text format.
118
+ The output is printed to a named \fB<file>\fP if given.
119
+ .UNINDENT
120
+ .INDENT 0.0
121
+ .TP
122
+ .B \-\-help\-manual <man> [<file>]
123
+ Print one help manual and exit.
124
+ .sp
125
+ The specified manual is printed in a human\-readable text format.
126
+ The output is printed to a named \fB<file>\fP if given.
127
+ .UNINDENT
128
+ .INDENT 0.0
129
+ .TP
130
+ .B \-\-help\-manual\-list [<file>]
131
+ List help manuals available and exit.
132
+ .sp
133
+ The list contains all manuals for which help may be obtained by
134
+ using the \fB\-\-help\-manual\fP option followed by a manual name.
135
+ The output is printed to a named \fB<file>\fP if given.
136
+ .UNINDENT
137
+ .INDENT 0.0
138
+ .TP
139
+ .B \-\-help\-command <cmd> [<file>]
140
+ Print help for one command and exit.
141
+ .sp
142
+ The \X'tty: link #manual:cmake-commands(7)'\fI\%cmake\-commands(7)\fP\X'tty: link' manual entry for \fB<cmd>\fP is
143
+ printed in a human\-readable text format.
144
+ The output is printed to a named \fB<file>\fP if given.
145
+ .UNINDENT
146
+ .INDENT 0.0
147
+ .TP
148
+ .B \-\-help\-command\-list [<file>]
149
+ List commands with help available and exit.
150
+ .sp
151
+ The list contains all commands for which help may be obtained by
152
+ using the \fB\-\-help\-command\fP option followed by a command name.
153
+ The output is printed to a named \fB<file>\fP if given.
154
+ .UNINDENT
155
+ .INDENT 0.0
156
+ .TP
157
+ .B \-\-help\-commands [<file>]
158
+ Print cmake\-commands manual and exit.
159
+ .sp
160
+ The \X'tty: link #manual:cmake-commands(7)'\fI\%cmake\-commands(7)\fP\X'tty: link' manual is printed in a
161
+ human\-readable text format.
162
+ The output is printed to a named \fB<file>\fP if given.
163
+ .UNINDENT
164
+ .INDENT 0.0
165
+ .TP
166
+ .B \-\-help\-module <mod> [<file>]
167
+ Print help for one module and exit.
168
+ .sp
169
+ The \X'tty: link #manual:cmake-modules(7)'\fI\%cmake\-modules(7)\fP\X'tty: link' manual entry for \fB<mod>\fP is printed
170
+ in a human\-readable text format.
171
+ The output is printed to a named \fB<file>\fP if given.
172
+ .UNINDENT
173
+ .INDENT 0.0
174
+ .TP
175
+ .B \-\-help\-module\-list [<file>]
176
+ List modules with help available and exit.
177
+ .sp
178
+ The list contains all modules for which help may be obtained by
179
+ using the \fB\-\-help\-module\fP option followed by a module name.
180
+ The output is printed to a named \fB<file>\fP if given.
181
+ .UNINDENT
182
+ .INDENT 0.0
183
+ .TP
184
+ .B \-\-help\-modules [<file>]
185
+ Print cmake\-modules manual and exit.
186
+ .sp
187
+ The \X'tty: link #manual:cmake-modules(7)'\fI\%cmake\-modules(7)\fP\X'tty: link' manual is printed in a human\-readable
188
+ text format.
189
+ The output is printed to a named \fB<file>\fP if given.
190
+ .UNINDENT
191
+ .INDENT 0.0
192
+ .TP
193
+ .B \-\-help\-policy <cmp> [<file>]
194
+ Print help for one policy and exit.
195
+ .sp
196
+ The \X'tty: link #manual:cmake-policies(7)'\fI\%cmake\-policies(7)\fP\X'tty: link' manual entry for \fB<cmp>\fP is
197
+ printed in a human\-readable text format.
198
+ The output is printed to a named \fB<file>\fP if given.
199
+ .UNINDENT
200
+ .INDENT 0.0
201
+ .TP
202
+ .B \-\-help\-policy\-list [<file>]
203
+ List policies with help available and exit.
204
+ .sp
205
+ The list contains all policies for which help may be obtained by
206
+ using the \fB\-\-help\-policy\fP option followed by a policy name.
207
+ The output is printed to a named \fB<file>\fP if given.
208
+ .UNINDENT
209
+ .INDENT 0.0
210
+ .TP
211
+ .B \-\-help\-policies [<file>]
212
+ Print cmake\-policies manual and exit.
213
+ .sp
214
+ The \X'tty: link #manual:cmake-policies(7)'\fI\%cmake\-policies(7)\fP\X'tty: link' manual is printed in a
215
+ human\-readable text format.
216
+ The output is printed to a named \fB<file>\fP if given.
217
+ .UNINDENT
218
+ .INDENT 0.0
219
+ .TP
220
+ .B \-\-help\-property <prop> [<file>]
221
+ Print help for one property and exit.
222
+ .sp
223
+ The \X'tty: link #manual:cmake-properties(7)'\fI\%cmake\-properties(7)\fP\X'tty: link' manual entries for \fB<prop>\fP are
224
+ printed in a human\-readable text format.
225
+ The output is printed to a named \fB<file>\fP if given.
226
+ .UNINDENT
227
+ .INDENT 0.0
228
+ .TP
229
+ .B \-\-help\-property\-list [<file>]
230
+ List properties with help available and exit.
231
+ .sp
232
+ The list contains all properties for which help may be obtained by
233
+ using the \fB\-\-help\-property\fP option followed by a property name.
234
+ The output is printed to a named \fB<file>\fP if given.
235
+ .UNINDENT
236
+ .INDENT 0.0
237
+ .TP
238
+ .B \-\-help\-properties [<file>]
239
+ Print cmake\-properties manual and exit.
240
+ .sp
241
+ The \X'tty: link #manual:cmake-properties(7)'\fI\%cmake\-properties(7)\fP\X'tty: link' manual is printed in a
242
+ human\-readable text format.
243
+ The output is printed to a named \fB<file>\fP if given.
244
+ .UNINDENT
245
+ .INDENT 0.0
246
+ .TP
247
+ .B \-\-help\-variable <var> [<file>]
248
+ Print help for one variable and exit.
249
+ .sp
250
+ The \X'tty: link #manual:cmake-variables(7)'\fI\%cmake\-variables(7)\fP\X'tty: link' manual entry for \fB<var>\fP is
251
+ printed in a human\-readable text format.
252
+ The output is printed to a named \fB<file>\fP if given.
253
+ .UNINDENT
254
+ .INDENT 0.0
255
+ .TP
256
+ .B \-\-help\-variable\-list [<file>]
257
+ List variables with help available and exit.
258
+ .sp
259
+ The list contains all variables for which help may be obtained by
260
+ using the \fB\-\-help\-variable\fP option followed by a variable name.
261
+ The output is printed to a named \fB<file>\fP if given.
262
+ .UNINDENT
263
+ .INDENT 0.0
264
+ .TP
265
+ .B \-\-help\-variables [<file>]
266
+ Print cmake\-variables manual and exit.
267
+ .sp
268
+ The \X'tty: link #manual:cmake-variables(7)'\fI\%cmake\-variables(7)\fP\X'tty: link' manual is printed in a
269
+ human\-readable text format.
270
+ The output is printed to a named \fB<file>\fP if given.
271
+ .UNINDENT
272
+ .SH SEE ALSO
273
+ .sp
274
+ The following resources are available to get help using CMake:
275
+ .INDENT 0.0
276
+ .TP
277
+ .B Home Page
278
+ \X'tty: link https://cmake.org'\fI\%https://cmake.org\fP\X'tty: link'
279
+ .sp
280
+ The primary starting point for learning about CMake.
281
+ .TP
282
+ .B Online Documentation and Community Resources
283
+ \X'tty: link https://cmake.org/documentation'\fI\%https://cmake.org/documentation\fP\X'tty: link'
284
+ .sp
285
+ Links to available documentation and community resources may be
286
+ found on this web page.
287
+ .TP
288
+ .B Discourse Forum
289
+ \X'tty: link https://discourse.cmake.org'\fI\%https://discourse.cmake.org\fP\X'tty: link'
290
+ .sp
291
+ The Discourse Forum hosts discussion and questions about CMake.
292
+ .UNINDENT
293
+ .SH COPYRIGHT
294
+ 2000-2024 Kitware, Inc. and Contributors
295
+ .\" Generated by docutils manpage writer.
296
+ .
cmake/man/man1/cpack.1 ADDED
@@ -0,0 +1,380 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .\" Man page generated from reStructuredText.
2
+ .
3
+ .
4
+ .nr rst2man-indent-level 0
5
+ .
6
+ .de1 rstReportMargin
7
+ \\$1 \\n[an-margin]
8
+ level \\n[rst2man-indent-level]
9
+ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
10
+ -
11
+ \\n[rst2man-indent0]
12
+ \\n[rst2man-indent1]
13
+ \\n[rst2man-indent2]
14
+ ..
15
+ .de1 INDENT
16
+ .\" .rstReportMargin pre:
17
+ . RS \\$1
18
+ . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
19
+ . nr rst2man-indent-level +1
20
+ .\" .rstReportMargin post:
21
+ ..
22
+ .de UNINDENT
23
+ . RE
24
+ .\" indent \\n[an-margin]
25
+ .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
26
+ .nr rst2man-indent-level -1
27
+ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
28
+ .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
29
+ ..
30
+ .TH "CPACK" "1" "Jan 10, 2025" "3.31.4" "CMake"
31
+ .SH NAME
32
+ cpack \- CPack Command-Line Reference
33
+ .SH SYNOPSIS
34
+ .INDENT 0.0
35
+ .INDENT 3.5
36
+ .sp
37
+ .nf
38
+ .ft C
39
+ cpack [<options>]
40
+ .ft P
41
+ .fi
42
+ .UNINDENT
43
+ .UNINDENT
44
+ .SH DESCRIPTION
45
+ .sp
46
+ The \fBcpack\fP executable is the CMake packaging program. It generates
47
+ installers and source packages in a variety of formats.
48
+ .sp
49
+ For each installer or package format, \fBcpack\fP has a specific backend,
50
+ called \(dqgenerator\(dq. A generator is responsible for generating the required
51
+ inputs and invoking the specific package creation tools. These installer
52
+ or package generators are not to be confused with the makefile generators
53
+ of the \X'tty: link #manual:cmake(1)'\fI\%cmake\fP\X'tty: link' command.
54
+ .sp
55
+ All supported generators are specified in the \X'tty: link #manual:cpack-generators(7)'\fI\%cpack\-generators\fP\X'tty: link' manual. The command \fBcpack \-\-help\fP prints a
56
+ list of generators supported for the target platform. Which of them are
57
+ to be used can be selected through the \X'tty: link #variable:CPACK_GENERATOR'\fI\%CPACK_GENERATOR\fP\X'tty: link' variable
58
+ or through the command\-line option \fI\%\-G\fP\&.
59
+ .sp
60
+ The \fBcpack\fP program is steered by a configuration file written in the
61
+ \X'tty: link #manual:cmake-language(7)'\fI\%CMake language\fP\X'tty: link'\&. Unless chosen differently
62
+ through the command\-line option \fI\%\-\-config\fP, the
63
+ file \fBCPackConfig.cmake\fP in the current directory is used.
64
+ .sp
65
+ In the standard CMake workflow, the file \fBCPackConfig.cmake\fP is generated
66
+ by the \X'tty: link #manual:cmake(1)'\fI\%cmake\fP\X'tty: link' executable, provided the \X'tty: link #module:CPack'\fI\%CPack\fP\X'tty: link'
67
+ module is included by the project\(aqs \fBCMakeLists.txt\fP file.
68
+ .SH OPTIONS
69
+ .INDENT 0.0
70
+ .TP
71
+ .B \-G <generators>
72
+ \fB<generators>\fP is a \X'tty: link #cmake-language-lists'\fI\%semicolon\-separated list\fP\X'tty: link'
73
+ of generator names. \fBcpack\fP will iterate through this list and produce
74
+ package(s) in that generator\(aqs format according to the details provided in
75
+ the \fBCPackConfig.cmake\fP configuration file. If this option is not given,
76
+ the \X'tty: link #variable:CPACK_GENERATOR'\fI\%CPACK_GENERATOR\fP\X'tty: link' variable determines the default set of
77
+ generators that will be used.
78
+ .UNINDENT
79
+ .INDENT 0.0
80
+ .TP
81
+ .B \-C <configs>
82
+ Specify the project configuration(s) to be packaged (e.g. \fBDebug\fP,
83
+ \fBRelease\fP, etc.), where \fB<configs>\fP is a
84
+ \X'tty: link #cmake-language-lists'\fI\%semicolon\-separated list\fP\X'tty: link'\&.
85
+ When the CMake project uses a multi\-configuration
86
+ generator such as Xcode or Visual Studio, this option is needed to tell
87
+ \fBcpack\fP which built executables to include in the package.
88
+ The user is responsible for ensuring that the configuration(s) listed
89
+ have already been built before invoking \fBcpack\fP\&.
90
+ .UNINDENT
91
+ .INDENT 0.0
92
+ .TP
93
+ .B \-D <var>=<value>
94
+ Set a CPack variable. This will override any value set for \fB<var>\fP in the
95
+ input file read by \fBcpack\fP\&.
96
+ .UNINDENT
97
+ .INDENT 0.0
98
+ .TP
99
+ .B \-\-config <configFile>
100
+ Specify the configuration file read by \fBcpack\fP to provide the packaging
101
+ details. By default, \fBCPackConfig.cmake\fP in the current directory will
102
+ be used.
103
+ .UNINDENT
104
+ .INDENT 0.0
105
+ .TP
106
+ .B \-V, \-\-verbose
107
+ Run \fBcpack\fP with verbose output. This can be used to show more details
108
+ from the package generation tools and is suitable for project developers.
109
+ .UNINDENT
110
+ .INDENT 0.0
111
+ .TP
112
+ .B \-\-debug
113
+ Run \fBcpack\fP with debug output. This option is intended mainly for the
114
+ developers of \fBcpack\fP itself and is not normally needed by project
115
+ developers.
116
+ .UNINDENT
117
+ .INDENT 0.0
118
+ .TP
119
+ .B \-\-trace
120
+ Put the underlying cmake scripts in trace mode.
121
+ .UNINDENT
122
+ .INDENT 0.0
123
+ .TP
124
+ .B \-\-trace\-expand
125
+ Put the underlying cmake scripts in expanded trace mode.
126
+ .UNINDENT
127
+ .INDENT 0.0
128
+ .TP
129
+ .B \-P <packageName>
130
+ Override/define the value of the \X'tty: link #variable:CPACK_PACKAGE_NAME'\fI\%CPACK_PACKAGE_NAME\fP\X'tty: link' variable used
131
+ for packaging. Any value set for this variable in the \fBCPackConfig.cmake\fP
132
+ file will then be ignored.
133
+ .UNINDENT
134
+ .INDENT 0.0
135
+ .TP
136
+ .B \-R <packageVersion>
137
+ Override/define the value of the \X'tty: link #variable:CPACK_PACKAGE_VERSION'\fI\%CPACK_PACKAGE_VERSION\fP\X'tty: link'
138
+ variable used for packaging. It will override a value set in the
139
+ \fBCPackConfig.cmake\fP file or one automatically computed from
140
+ \X'tty: link #variable:CPACK_PACKAGE_VERSION_MAJOR'\fI\%CPACK_PACKAGE_VERSION_MAJOR\fP\X'tty: link',
141
+ \X'tty: link #variable:CPACK_PACKAGE_VERSION_MINOR'\fI\%CPACK_PACKAGE_VERSION_MINOR\fP\X'tty: link' and
142
+ \X'tty: link #variable:CPACK_PACKAGE_VERSION_PATCH'\fI\%CPACK_PACKAGE_VERSION_PATCH\fP\X'tty: link'\&.
143
+ .UNINDENT
144
+ .INDENT 0.0
145
+ .TP
146
+ .B \-B <packageDirectory>
147
+ Override/define \X'tty: link #variable:CPACK_PACKAGE_DIRECTORY'\fI\%CPACK_PACKAGE_DIRECTORY\fP\X'tty: link', which controls the
148
+ directory where CPack will perform its packaging work. The resultant
149
+ package(s) will be created at this location by default and a
150
+ \fB_CPack_Packages\fP subdirectory will also be created below this directory to
151
+ use as a working area during package creation.
152
+ .UNINDENT
153
+ .INDENT 0.0
154
+ .TP
155
+ .B \-\-vendor <vendorName>
156
+ Override/define \X'tty: link #variable:CPACK_PACKAGE_VENDOR'\fI\%CPACK_PACKAGE_VENDOR\fP\X'tty: link'\&.
157
+ .UNINDENT
158
+ .INDENT 0.0
159
+ .TP
160
+ .B \-\-preset <presetName>
161
+ Use a preset from \X'tty: link #manual:cmake-presets(7)'\fI\%cmake\-presets(7)\fP\X'tty: link'\&.
162
+ .UNINDENT
163
+ .INDENT 0.0
164
+ .TP
165
+ .B \-\-list\-presets
166
+ List presets from \X'tty: link #manual:cmake-presets(7)'\fI\%cmake\-presets(7)\fP\X'tty: link'\&.
167
+ .UNINDENT
168
+ .INDENT 0.0
169
+ .TP
170
+ .B \-version [<file>], \-\-version [<file>], /V [<file>]
171
+ Show program name/version banner and exit.
172
+ The output is printed to a named \fB<file>\fP if given.
173
+ .UNINDENT
174
+ .INDENT 0.0
175
+ .TP
176
+ .B \-h, \-H, \-\-help, \-help, \-usage, /?
177
+ Print usage information and exit.
178
+ .sp
179
+ Usage describes the basic command line interface and its options.
180
+ .UNINDENT
181
+ .INDENT 0.0
182
+ .TP
183
+ .B \-\-help <keyword> [<file>]
184
+ Print help for one CMake keyword.
185
+ .sp
186
+ \fB<keyword>\fP can be a property, variable, command, policy, generator
187
+ or module.
188
+ .sp
189
+ The relevant manual entry for \fB<keyword>\fP is
190
+ printed in a human\-readable text format.
191
+ The output is printed to a named \fB<file>\fP if given.
192
+ .sp
193
+ Changed in version 3.28: Prior to CMake 3.28, this option supported command names only.
194
+
195
+ .UNINDENT
196
+ .INDENT 0.0
197
+ .TP
198
+ .B \-\-help\-full [<file>]
199
+ Print all help manuals and exit.
200
+ .sp
201
+ All manuals are printed in a human\-readable text format.
202
+ The output is printed to a named \fB<file>\fP if given.
203
+ .UNINDENT
204
+ .INDENT 0.0
205
+ .TP
206
+ .B \-\-help\-manual <man> [<file>]
207
+ Print one help manual and exit.
208
+ .sp
209
+ The specified manual is printed in a human\-readable text format.
210
+ The output is printed to a named \fB<file>\fP if given.
211
+ .UNINDENT
212
+ .INDENT 0.0
213
+ .TP
214
+ .B \-\-help\-manual\-list [<file>]
215
+ List help manuals available and exit.
216
+ .sp
217
+ The list contains all manuals for which help may be obtained by
218
+ using the \fB\-\-help\-manual\fP option followed by a manual name.
219
+ The output is printed to a named \fB<file>\fP if given.
220
+ .UNINDENT
221
+ .INDENT 0.0
222
+ .TP
223
+ .B \-\-help\-command <cmd> [<file>]
224
+ Print help for one command and exit.
225
+ .sp
226
+ The \X'tty: link #manual:cmake-commands(7)'\fI\%cmake\-commands(7)\fP\X'tty: link' manual entry for \fB<cmd>\fP is
227
+ printed in a human\-readable text format.
228
+ The output is printed to a named \fB<file>\fP if given.
229
+ .UNINDENT
230
+ .INDENT 0.0
231
+ .TP
232
+ .B \-\-help\-command\-list [<file>]
233
+ List commands with help available and exit.
234
+ .sp
235
+ The list contains all commands for which help may be obtained by
236
+ using the \fB\-\-help\-command\fP option followed by a command name.
237
+ The output is printed to a named \fB<file>\fP if given.
238
+ .UNINDENT
239
+ .INDENT 0.0
240
+ .TP
241
+ .B \-\-help\-commands [<file>]
242
+ Print cmake\-commands manual and exit.
243
+ .sp
244
+ The \X'tty: link #manual:cmake-commands(7)'\fI\%cmake\-commands(7)\fP\X'tty: link' manual is printed in a
245
+ human\-readable text format.
246
+ The output is printed to a named \fB<file>\fP if given.
247
+ .UNINDENT
248
+ .INDENT 0.0
249
+ .TP
250
+ .B \-\-help\-module <mod> [<file>]
251
+ Print help for one module and exit.
252
+ .sp
253
+ The \X'tty: link #manual:cmake-modules(7)'\fI\%cmake\-modules(7)\fP\X'tty: link' manual entry for \fB<mod>\fP is printed
254
+ in a human\-readable text format.
255
+ The output is printed to a named \fB<file>\fP if given.
256
+ .UNINDENT
257
+ .INDENT 0.0
258
+ .TP
259
+ .B \-\-help\-module\-list [<file>]
260
+ List modules with help available and exit.
261
+ .sp
262
+ The list contains all modules for which help may be obtained by
263
+ using the \fB\-\-help\-module\fP option followed by a module name.
264
+ The output is printed to a named \fB<file>\fP if given.
265
+ .UNINDENT
266
+ .INDENT 0.0
267
+ .TP
268
+ .B \-\-help\-modules [<file>]
269
+ Print cmake\-modules manual and exit.
270
+ .sp
271
+ The \X'tty: link #manual:cmake-modules(7)'\fI\%cmake\-modules(7)\fP\X'tty: link' manual is printed in a human\-readable
272
+ text format.
273
+ The output is printed to a named \fB<file>\fP if given.
274
+ .UNINDENT
275
+ .INDENT 0.0
276
+ .TP
277
+ .B \-\-help\-policy <cmp> [<file>]
278
+ Print help for one policy and exit.
279
+ .sp
280
+ The \X'tty: link #manual:cmake-policies(7)'\fI\%cmake\-policies(7)\fP\X'tty: link' manual entry for \fB<cmp>\fP is
281
+ printed in a human\-readable text format.
282
+ The output is printed to a named \fB<file>\fP if given.
283
+ .UNINDENT
284
+ .INDENT 0.0
285
+ .TP
286
+ .B \-\-help\-policy\-list [<file>]
287
+ List policies with help available and exit.
288
+ .sp
289
+ The list contains all policies for which help may be obtained by
290
+ using the \fB\-\-help\-policy\fP option followed by a policy name.
291
+ The output is printed to a named \fB<file>\fP if given.
292
+ .UNINDENT
293
+ .INDENT 0.0
294
+ .TP
295
+ .B \-\-help\-policies [<file>]
296
+ Print cmake\-policies manual and exit.
297
+ .sp
298
+ The \X'tty: link #manual:cmake-policies(7)'\fI\%cmake\-policies(7)\fP\X'tty: link' manual is printed in a
299
+ human\-readable text format.
300
+ The output is printed to a named \fB<file>\fP if given.
301
+ .UNINDENT
302
+ .INDENT 0.0
303
+ .TP
304
+ .B \-\-help\-property <prop> [<file>]
305
+ Print help for one property and exit.
306
+ .sp
307
+ The \X'tty: link #manual:cmake-properties(7)'\fI\%cmake\-properties(7)\fP\X'tty: link' manual entries for \fB<prop>\fP are
308
+ printed in a human\-readable text format.
309
+ The output is printed to a named \fB<file>\fP if given.
310
+ .UNINDENT
311
+ .INDENT 0.0
312
+ .TP
313
+ .B \-\-help\-property\-list [<file>]
314
+ List properties with help available and exit.
315
+ .sp
316
+ The list contains all properties for which help may be obtained by
317
+ using the \fB\-\-help\-property\fP option followed by a property name.
318
+ The output is printed to a named \fB<file>\fP if given.
319
+ .UNINDENT
320
+ .INDENT 0.0
321
+ .TP
322
+ .B \-\-help\-properties [<file>]
323
+ Print cmake\-properties manual and exit.
324
+ .sp
325
+ The \X'tty: link #manual:cmake-properties(7)'\fI\%cmake\-properties(7)\fP\X'tty: link' manual is printed in a
326
+ human\-readable text format.
327
+ The output is printed to a named \fB<file>\fP if given.
328
+ .UNINDENT
329
+ .INDENT 0.0
330
+ .TP
331
+ .B \-\-help\-variable <var> [<file>]
332
+ Print help for one variable and exit.
333
+ .sp
334
+ The \X'tty: link #manual:cmake-variables(7)'\fI\%cmake\-variables(7)\fP\X'tty: link' manual entry for \fB<var>\fP is
335
+ printed in a human\-readable text format.
336
+ The output is printed to a named \fB<file>\fP if given.
337
+ .UNINDENT
338
+ .INDENT 0.0
339
+ .TP
340
+ .B \-\-help\-variable\-list [<file>]
341
+ List variables with help available and exit.
342
+ .sp
343
+ The list contains all variables for which help may be obtained by
344
+ using the \fB\-\-help\-variable\fP option followed by a variable name.
345
+ The output is printed to a named \fB<file>\fP if given.
346
+ .UNINDENT
347
+ .INDENT 0.0
348
+ .TP
349
+ .B \-\-help\-variables [<file>]
350
+ Print cmake\-variables manual and exit.
351
+ .sp
352
+ The \X'tty: link #manual:cmake-variables(7)'\fI\%cmake\-variables(7)\fP\X'tty: link' manual is printed in a
353
+ human\-readable text format.
354
+ The output is printed to a named \fB<file>\fP if given.
355
+ .UNINDENT
356
+ .SH SEE ALSO
357
+ .sp
358
+ The following resources are available to get help using CMake:
359
+ .INDENT 0.0
360
+ .TP
361
+ .B Home Page
362
+ \X'tty: link https://cmake.org'\fI\%https://cmake.org\fP\X'tty: link'
363
+ .sp
364
+ The primary starting point for learning about CMake.
365
+ .TP
366
+ .B Online Documentation and Community Resources
367
+ \X'tty: link https://cmake.org/documentation'\fI\%https://cmake.org/documentation\fP\X'tty: link'
368
+ .sp
369
+ Links to available documentation and community resources may be
370
+ found on this web page.
371
+ .TP
372
+ .B Discourse Forum
373
+ \X'tty: link https://discourse.cmake.org'\fI\%https://discourse.cmake.org\fP\X'tty: link'
374
+ .sp
375
+ The Discourse Forum hosts discussion and questions about CMake.
376
+ .UNINDENT
377
+ .SH COPYRIGHT
378
+ 2000-2024 Kitware, Inc. and Contributors
379
+ .\" Generated by docutils manpage writer.
380
+ .
cmake/man/man1/ctest.1 ADDED
@@ -0,0 +1,2609 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .\" Man page generated from reStructuredText.
2
+ .
3
+ .
4
+ .nr rst2man-indent-level 0
5
+ .
6
+ .de1 rstReportMargin
7
+ \\$1 \\n[an-margin]
8
+ level \\n[rst2man-indent-level]
9
+ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
10
+ -
11
+ \\n[rst2man-indent0]
12
+ \\n[rst2man-indent1]
13
+ \\n[rst2man-indent2]
14
+ ..
15
+ .de1 INDENT
16
+ .\" .rstReportMargin pre:
17
+ . RS \\$1
18
+ . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
19
+ . nr rst2man-indent-level +1
20
+ .\" .rstReportMargin post:
21
+ ..
22
+ .de UNINDENT
23
+ . RE
24
+ .\" indent \\n[an-margin]
25
+ .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
26
+ .nr rst2man-indent-level -1
27
+ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
28
+ .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
29
+ ..
30
+ .TH "CTEST" "1" "Jan 10, 2025" "3.31.4" "CMake"
31
+ .SH NAME
32
+ ctest \- CTest Command-Line Reference
33
+ .SS Contents
34
+ .INDENT 0.0
35
+ .IP \(bu 2
36
+ \fI\%ctest(1)\fP
37
+ .INDENT 2.0
38
+ .IP \(bu 2
39
+ \fI\%Synopsis\fP
40
+ .IP \(bu 2
41
+ \fI\%Description\fP
42
+ .IP \(bu 2
43
+ \fI\%Run Tests\fP
44
+ .IP \(bu 2
45
+ \fI\%View Help\fP
46
+ .IP \(bu 2
47
+ \fI\%Label Matching\fP
48
+ .IP \(bu 2
49
+ \fI\%Label and Subproject Summary\fP
50
+ .IP \(bu 2
51
+ \fI\%Build and Test Mode\fP
52
+ .IP \(bu 2
53
+ \fI\%Dashboard Client\fP
54
+ .INDENT 2.0
55
+ .IP \(bu 2
56
+ \fI\%Dashboard Client Steps\fP
57
+ .IP \(bu 2
58
+ \fI\%Dashboard Client Modes\fP
59
+ .IP \(bu 2
60
+ \fI\%Dashboard Client via CTest Command\-Line\fP
61
+ .IP \(bu 2
62
+ \fI\%Dashboard Client via CTest Script\fP
63
+ .UNINDENT
64
+ .IP \(bu 2
65
+ \fI\%Dashboard Client Configuration\fP
66
+ .INDENT 2.0
67
+ .IP \(bu 2
68
+ \fI\%CTest Start Step\fP
69
+ .IP \(bu 2
70
+ \fI\%CTest Update Step\fP
71
+ .IP \(bu 2
72
+ \fI\%CTest Configure Step\fP
73
+ .IP \(bu 2
74
+ \fI\%CTest Build Step\fP
75
+ .IP \(bu 2
76
+ \fI\%CTest Test Step\fP
77
+ .IP \(bu 2
78
+ \fI\%CTest Coverage Step\fP
79
+ .IP \(bu 2
80
+ \fI\%CTest MemCheck Step\fP
81
+ .IP \(bu 2
82
+ \fI\%CTest Submit Step\fP
83
+ .UNINDENT
84
+ .IP \(bu 2
85
+ \fI\%Show as JSON Object Model\fP
86
+ .IP \(bu 2
87
+ \fI\%Resource Allocation\fP
88
+ .INDENT 2.0
89
+ .IP \(bu 2
90
+ \fI\%Resource Specification File\fP
91
+ .IP \(bu 2
92
+ \fI\%RESOURCE_GROUPS Property\fP
93
+ .IP \(bu 2
94
+ \fI\%Environment Variables\fP
95
+ .IP \(bu 2
96
+ \fI\%Dynamically\-Generated Resource Specification File\fP
97
+ .UNINDENT
98
+ .IP \(bu 2
99
+ \fI\%Job Server Integration\fP
100
+ .IP \(bu 2
101
+ \fI\%See Also\fP
102
+ .UNINDENT
103
+ .UNINDENT
104
+ .SH SYNOPSIS
105
+ .INDENT 0.0
106
+ .INDENT 3.5
107
+ .sp
108
+ .nf
109
+ .ft C
110
+ \fI\%Run Tests\fP
111
+ ctest [<options>] [\-\-test\-dir <path\-to\-build>]
112
+
113
+ \fI\%Build and Test Mode\fP
114
+ ctest \-\-build\-and\-test <path\-to\-source> <path\-to\-build>
115
+ \-\-build\-generator <generator> [<options>...]
116
+ [\-\-build\-options <opts>...]
117
+ [\-\-test\-command <command> [<args>...]]
118
+
119
+ \fI\%Dashboard Client\fP
120
+ ctest \-D <dashboard> [\-\- <dashboard\-options>...]
121
+ ctest \-M <model> \-T <action> [\-\- <dashboard\-options>...]
122
+ ctest \-S <script> [\-\- <dashboard\-options>...]
123
+ ctest \-SP <script> [\-\- <dashboard\-options>...]
124
+
125
+ \fI\%View Help\fP
126
+ ctest \-\-help[\-<topic>]
127
+ .ft P
128
+ .fi
129
+ .UNINDENT
130
+ .UNINDENT
131
+ .SH DESCRIPTION
132
+ .sp
133
+ The \fBctest\fP executable is the CMake test driver program.
134
+ CMake\-generated build trees created for projects that use the
135
+ \X'tty: link #command:enable_testing'\fI\%enable_testing()\fP\X'tty: link' and \X'tty: link #command:add_test'\fI\%add_test()\fP\X'tty: link' commands have testing support.
136
+ This program will run the tests and report results.
137
+ .SH RUN TESTS
138
+ .INDENT 0.0
139
+ .TP
140
+ .B \-\-preset <preset>, \-\-preset=<preset>
141
+ Use a test preset to specify test options. The project binary directory
142
+ is inferred from the \fBconfigurePreset\fP key. The current working directory
143
+ must contain CMake preset files.
144
+ See \X'tty: link #manual:cmake-presets(7)'\fI\%preset\fP\X'tty: link' for more details.
145
+ .UNINDENT
146
+ .INDENT 0.0
147
+ .TP
148
+ .B \-\-list\-presets
149
+ Lists the available test presets. The current working directory must contain
150
+ CMake preset files.
151
+ .UNINDENT
152
+ .INDENT 0.0
153
+ .TP
154
+ .B \-C <cfg>, \-\-build\-config <cfg>
155
+ Choose configuration to test.
156
+ .sp
157
+ Some CMake\-generated build trees can have multiple build
158
+ configurations in the same tree. This option can be used to specify
159
+ which one should be tested. Example configurations are \fBDebug\fP and
160
+ \fBRelease\fP\&.
161
+ .UNINDENT
162
+ .INDENT 0.0
163
+ .TP
164
+ .B \-\-progress
165
+ Enable short progress output from tests.
166
+ .sp
167
+ When the output of \fBctest\fP is being sent directly to a terminal, the
168
+ progress through the set of tests is reported by updating the same line
169
+ rather than printing start and end messages for each test on new lines.
170
+ This can significantly reduce the verbosity of the test output.
171
+ Test completion messages are still output on their own line for failed
172
+ tests and the final test summary will also still be logged.
173
+ .sp
174
+ This option can also be enabled by setting the environment variable
175
+ \X'tty: link #envvar:CTEST_PROGRESS_OUTPUT'\fI\%CTEST_PROGRESS_OUTPUT\fP\X'tty: link'\&.
176
+ .UNINDENT
177
+ .INDENT 0.0
178
+ .TP
179
+ .B \-V, \-\-verbose
180
+ Enable verbose output from tests.
181
+ .sp
182
+ Test output is normally suppressed and only summary information is
183
+ displayed. This option will show all test output.
184
+ .UNINDENT
185
+ .INDENT 0.0
186
+ .TP
187
+ .B \-VV, \-\-extra\-verbose
188
+ Enable more verbose output from tests.
189
+ .sp
190
+ Test output is normally suppressed and only summary information is
191
+ displayed. This option will show even more test output.
192
+ .UNINDENT
193
+ .INDENT 0.0
194
+ .TP
195
+ .B \-\-debug
196
+ Displaying more verbose internals of CTest.
197
+ .sp
198
+ This feature will result in a large number of output that is mostly
199
+ useful for debugging dashboard problems.
200
+ .UNINDENT
201
+ .INDENT 0.0
202
+ .TP
203
+ .B \-\-output\-on\-failure
204
+ Output anything outputted by the test program if the test should fail.
205
+ This option can also be enabled by setting the
206
+ \X'tty: link #envvar:CTEST_OUTPUT_ON_FAILURE'\fI\%CTEST_OUTPUT_ON_FAILURE\fP\X'tty: link' environment variable
207
+ .UNINDENT
208
+ .INDENT 0.0
209
+ .TP
210
+ .B \-\-stop\-on\-failure
211
+ Stop running the tests when the first failure happens.
212
+ .UNINDENT
213
+ .INDENT 0.0
214
+ .TP
215
+ .B \-F
216
+ Enable failover.
217
+ .sp
218
+ This option allows CTest to resume a test set execution that was
219
+ previously interrupted. If no interruption occurred, the \fB\-F\fP option
220
+ will have no effect.
221
+ .UNINDENT
222
+ .INDENT 0.0
223
+ .TP
224
+ .B \-j [<level>], \-\-parallel [<level>]
225
+ Run tests in parallel, optionally limited to a given level of parallelism.
226
+ .sp
227
+ Added in version 3.29: The \fB<level>\fP may be omitted, or \fB0\fP, in which case:
228
+ .INDENT 7.0
229
+ .IP \(bu 2
230
+ Under \fI\%Job Server Integration\fP, parallelism is limited by
231
+ available job tokens.
232
+ .IP \(bu 2
233
+ Otherwise, if the value is omitted, parallelism is limited
234
+ by the number of processors, or 2, whichever is larger.
235
+ .IP \(bu 2
236
+ Otherwise, if the value is \fB0\fP, parallelism is unbounded.
237
+ .UNINDENT
238
+
239
+ .sp
240
+ This option may instead be specified by the \X'tty: link #envvar:CTEST_PARALLEL_LEVEL'\fI\%CTEST_PARALLEL_LEVEL\fP\X'tty: link'
241
+ environment variable.
242
+ .sp
243
+ This option can be used with the \X'tty: link #prop_test:PROCESSORS'\fI\%PROCESSORS\fP\X'tty: link' test property.
244
+ See the \fI\%Label and Subproject Summary\fP\&.
245
+ .UNINDENT
246
+ .INDENT 0.0
247
+ .TP
248
+ .B \-\-resource\-spec\-file <file>
249
+ Run CTest with \fI\%resource allocation\fP enabled,
250
+ using the
251
+ \fI\%resource specification file\fP
252
+ specified in \fB<file>\fP\&.
253
+ .sp
254
+ When \fBctest\fP is run as a \fI\%Dashboard Client\fP this sets the
255
+ \fBResourceSpecFile\fP option of the \fI\%CTest Test Step\fP\&.
256
+ .UNINDENT
257
+ .INDENT 0.0
258
+ .TP
259
+ .B \-\-test\-load <level>
260
+ While running tests in parallel (e.g. with \fI\%\-j\fP), try
261
+ not to start tests when they may cause the CPU load to pass above a given
262
+ threshold.
263
+ .sp
264
+ When \fBctest\fP is run as a \fI\%Dashboard Client\fP this sets the
265
+ \fBTestLoad\fP option of the \fI\%CTest Test Step\fP\&.
266
+ .UNINDENT
267
+ .INDENT 0.0
268
+ .TP
269
+ .B \-Q, \-\-quiet
270
+ Make CTest quiet.
271
+ .sp
272
+ This option will suppress all the output. The output log file will
273
+ still be generated if the \fI\%\-\-output\-log\fP is
274
+ specified. Options such as \fI\%\-\-verbose\fP,
275
+ \fI\%\-\-extra\-verbose\fP, and
276
+ \fI\%\-\-debug\fP are ignored
277
+ if \fB\-\-quiet\fP is specified.
278
+ .UNINDENT
279
+ .INDENT 0.0
280
+ .TP
281
+ .B \-O <file>, \-\-output\-log <file>
282
+ Output to log file.
283
+ .sp
284
+ This option tells CTest to write all its output to a \fB<file>\fP log file.
285
+ .UNINDENT
286
+ .INDENT 0.0
287
+ .TP
288
+ .B \-\-output\-junit <file>
289
+ Added in version 3.21.
290
+
291
+ .sp
292
+ Write test results in JUnit format.
293
+ .sp
294
+ This option tells CTest to write test results to \fB<file>\fP in JUnit XML
295
+ format. If \fB<file>\fP already exists, it will be overwritten. If using the
296
+ \fI\%\-S\fP option to run a dashboard script, use the
297
+ \fBOUTPUT_JUNIT\fP keyword with the \X'tty: link #command:ctest_test'\fI\%ctest_test()\fP\X'tty: link' command instead.
298
+ .UNINDENT
299
+ .INDENT 0.0
300
+ .TP
301
+ .B \-N, \-\-show\-only[=<format>]
302
+ Disable actual execution of tests.
303
+ .sp
304
+ This option tells CTest to list the tests that would be run but not
305
+ actually run them. Useful in conjunction with the \fI\%\-R\fP
306
+ and \fI\%\-E\fP options.
307
+ .sp
308
+ Added in version 3.14: The \fB\-\-show\-only\fP option accepts a \fB<format>\fP value.
309
+
310
+ .sp
311
+ \fB<format>\fP can be one of the following values.
312
+ .INDENT 7.0
313
+ .INDENT 3.5
314
+ .INDENT 0.0
315
+ .TP
316
+ .B \fBhuman\fP
317
+ Human\-friendly output. This is not guaranteed to be stable.
318
+ This is the default.
319
+ .TP
320
+ .B \fBjson\-v1\fP
321
+ Dump the test information in JSON format.
322
+ See \fI\%Show as JSON Object Model\fP\&.
323
+ .UNINDENT
324
+ .UNINDENT
325
+ .UNINDENT
326
+ .UNINDENT
327
+ .INDENT 0.0
328
+ .TP
329
+ .B \-L <regex>, \-\-label\-regex <regex>
330
+ Run tests with labels matching regular expression as described under
331
+ \X'tty: link #regex-specification'\fI\%string(REGEX)\fP\X'tty: link'\&.
332
+ .sp
333
+ This option tells CTest to run only the tests whose labels match the
334
+ given regular expression. When more than one \fB\-L\fP option is given,
335
+ a test will only be run if each regular expression matches at least one
336
+ of the test\(aqs labels (i.e. the multiple \fB\-L\fP labels form an \fBAND\fP
337
+ relationship). See \fI\%Label Matching\fP\&.
338
+ .UNINDENT
339
+ .INDENT 0.0
340
+ .TP
341
+ .B \-R <regex>, \-\-tests\-regex <regex>
342
+ Run tests matching regular expression.
343
+ .sp
344
+ This option tells CTest to run only the tests whose names match the
345
+ given regular expression.
346
+ .UNINDENT
347
+ .INDENT 0.0
348
+ .TP
349
+ .B \-E <regex>, \-\-exclude\-regex <regex>
350
+ Exclude tests matching regular expression.
351
+ .sp
352
+ This option tells CTest to NOT run the tests whose names match the
353
+ given regular expression.
354
+ .UNINDENT
355
+ .INDENT 0.0
356
+ .TP
357
+ .B \-LE <regex>, \-\-label\-exclude <regex>
358
+ Exclude tests with labels matching regular expression.
359
+ .sp
360
+ This option tells CTest to NOT run the tests whose labels match the
361
+ given regular expression. When more than one \fB\-LE\fP option is given,
362
+ a test will only be excluded if each regular expression matches at least one
363
+ of the test\(aqs labels (i.e. the multiple \fB\-LE\fP labels form an \fBAND\fP
364
+ relationship). See \fI\%Label Matching\fP\&.
365
+ .UNINDENT
366
+ .INDENT 0.0
367
+ .TP
368
+ .B \-\-tests\-from\-file <filename>
369
+ Added in version 3.29.
370
+
371
+ .sp
372
+ Run tests listed in the given file.
373
+ .sp
374
+ This option tells CTest to run tests that are listed in the given file.
375
+ The file must contain one exact test name per line.
376
+ Lines that do not exactly match any test names are ignored.
377
+ This option can be combined with the other options like
378
+ \fB\-R\fP, \fB\-E\fP, \fB\-L\fP or \fB\-LE\fP\&.
379
+ .UNINDENT
380
+ .INDENT 0.0
381
+ .TP
382
+ .B \-\-exclude\-from\-file <filename>
383
+ Added in version 3.29.
384
+
385
+ .sp
386
+ Exclude tests listed in the given file.
387
+ .sp
388
+ This option tells CTest to NOT run tests that are listed in the given file.
389
+ The file must contain one exact test name per line.
390
+ Lines that do not exactly match any test names are ignored.
391
+ This option can be combined with the other options like
392
+ \fB\-R\fP, \fB\-E\fP, \fB\-L\fP or \fB\-LE\fP\&.
393
+ .UNINDENT
394
+ .INDENT 0.0
395
+ .TP
396
+ .B \-FA <regex>, \-\-fixture\-exclude\-any <regex>
397
+ Exclude fixtures matching \fB<regex>\fP from automatically adding any tests to
398
+ the test set.
399
+ .sp
400
+ If a test in the set of tests to be executed requires a particular fixture,
401
+ that fixture\(aqs setup and cleanup tests would normally be added to the test set
402
+ automatically. This option prevents adding setup or cleanup tests for fixtures
403
+ matching the \fB<regex>\fP\&. Note that all other fixture behavior is retained,
404
+ including test dependencies and skipping tests that have fixture setup tests
405
+ that fail.
406
+ .UNINDENT
407
+ .INDENT 0.0
408
+ .TP
409
+ .B \-FS <regex>, \-\-fixture\-exclude\-setup <regex>
410
+ Same as \fI\%\-FA\fP except only matching setup tests are
411
+ excluded.
412
+ .UNINDENT
413
+ .INDENT 0.0
414
+ .TP
415
+ .B \-FC <regex>, \-\-fixture\-exclude\-cleanup <regex>
416
+ Same as \fI\%\-FA\fP except only matching cleanup tests are
417
+ excluded.
418
+ .UNINDENT
419
+ .INDENT 0.0
420
+ .TP
421
+ .B \-I [Start,End,Stride,test#,test#|Test file], \-\-tests\-information
422
+ Run a specific number of tests by number.
423
+ .sp
424
+ This option causes CTest to run tests starting at number \fBStart\fP,
425
+ ending at number \fBEnd\fP, and incrementing by \fBStride\fP\&. Any additional
426
+ numbers after \fBStride\fP are considered individual test numbers. \fBStart\fP,
427
+ \fBEnd\fP, or \fBStride\fP can be empty. Optionally a file can be given that
428
+ contains the same syntax as the command line.
429
+ .UNINDENT
430
+ .INDENT 0.0
431
+ .TP
432
+ .B \-U, \-\-union
433
+ Take the Union of \fI\%\-I\fP and \fI\%\-R\fP\&.
434
+ .sp
435
+ When both \fI\%\-R\fP and \fI\%\-I\fP are specified
436
+ by default the intersection of tests are run. By specifying \fB\-U\fP the union
437
+ of tests is run instead.
438
+ .UNINDENT
439
+ .INDENT 0.0
440
+ .TP
441
+ .B \-\-rerun\-failed
442
+ Run only the tests that failed previously.
443
+ .sp
444
+ This option tells CTest to perform only the tests that failed during
445
+ its previous run. When this option is specified, CTest ignores all
446
+ other options intended to modify the list of tests to run (
447
+ \fI\%\-L\fP, \fI\%\-R\fP, \fI\%\-E\fP,
448
+ \fI\%\-LE\fP, \fI\%\-I\fP, etc). In the event that
449
+ CTest runs and no tests fail, subsequent calls to CTest with the
450
+ \fB\-\-rerun\-failed\fP option will run the set of tests that most recently
451
+ failed (if any).
452
+ .UNINDENT
453
+ .INDENT 0.0
454
+ .TP
455
+ .B \-\-repeat <mode>:<n>
456
+ Run tests repeatedly based on the given \fB<mode>\fP up to \fB<n>\fP times.
457
+ The modes are:
458
+ .INDENT 7.0
459
+ .TP
460
+ .B \fBuntil\-fail\fP
461
+ Require each test to run \fB<n>\fP times without failing in order to pass.
462
+ This is useful in finding sporadic failures in test cases.
463
+ .TP
464
+ .B \fBuntil\-pass\fP
465
+ Allow each test to run up to \fB<n>\fP times in order to pass.
466
+ Repeats tests if they fail for any reason.
467
+ This is useful in tolerating sporadic failures in test cases.
468
+ .TP
469
+ .B \fBafter\-timeout\fP
470
+ Allow each test to run up to \fB<n>\fP times in order to pass.
471
+ Repeats tests only if they timeout.
472
+ This is useful in tolerating sporadic timeouts in test cases
473
+ on busy machines.
474
+ .UNINDENT
475
+ .UNINDENT
476
+ .INDENT 0.0
477
+ .TP
478
+ .B \-\-repeat\-until\-fail <n>
479
+ Equivalent to \fI\%\-\-repeat until\-fail:<n>\fP\&.
480
+ .UNINDENT
481
+ .INDENT 0.0
482
+ .TP
483
+ .B \-\-max\-width <width>
484
+ Set the max width for a test name to output.
485
+ .sp
486
+ Set the maximum width for each test name to show in the output.
487
+ This allows the user to widen the output to avoid clipping the test
488
+ name which can be very annoying.
489
+ .UNINDENT
490
+ .INDENT 0.0
491
+ .TP
492
+ .B \-\-interactive\-debug\-mode [0|1]
493
+ Set the interactive mode to \fB0\fP or \fB1\fP\&.
494
+ .sp
495
+ This option causes CTest to run tests in either an interactive mode
496
+ or a non\-interactive mode. In dashboard mode (\fBExperimental\fP, \fBNightly\fP,
497
+ \fBContinuous\fP), the default is non\-interactive. In non\-interactive mode,
498
+ the environment variable \X'tty: link #envvar:DASHBOARD_TEST_FROM_CTEST'\fI\%DASHBOARD_TEST_FROM_CTEST\fP\X'tty: link' is set.
499
+ .sp
500
+ Prior to CMake 3.11, interactive mode on Windows allowed system debug
501
+ popup windows to appear. Now, due to CTest\(aqs use of \fBlibuv\fP to launch
502
+ test processes, all system debug popup windows are always blocked.
503
+ .UNINDENT
504
+ .INDENT 0.0
505
+ .TP
506
+ .B \-\-no\-label\-summary
507
+ Disable timing summary information for labels.
508
+ .sp
509
+ This option tells CTest not to print summary information for each
510
+ label associated with the tests run. If there are no labels on the
511
+ tests, nothing extra is printed.
512
+ .sp
513
+ See \fI\%Label and Subproject Summary\fP\&.
514
+ .UNINDENT
515
+ .INDENT 0.0
516
+ .TP
517
+ .B \-\-no\-subproject\-summary
518
+ Disable timing summary information for subprojects.
519
+ .sp
520
+ This option tells CTest not to print summary information for each
521
+ subproject associated with the tests run. If there are no subprojects on the
522
+ tests, nothing extra is printed.
523
+ .sp
524
+ See \fI\%Label and Subproject Summary\fP\&.
525
+ .UNINDENT
526
+ .INDENT 0.0
527
+ .TP
528
+ .B \-\-test\-dir <dir>
529
+ Added in version 3.20.
530
+
531
+ .sp
532
+ Specify the directory in which to look for tests, typically a CMake project
533
+ build directory. If not specified, the current directory is used.
534
+ .UNINDENT
535
+ .INDENT 0.0
536
+ .TP
537
+ .B \-\-test\-output\-size\-passed <size>
538
+ Added in version 3.4.
539
+
540
+ .sp
541
+ Limit the output for passed tests to \fB<size>\fP bytes.
542
+ .UNINDENT
543
+ .INDENT 0.0
544
+ .TP
545
+ .B \-\-test\-output\-size\-failed <size>
546
+ Added in version 3.4.
547
+
548
+ .sp
549
+ Limit the output for failed tests to \fB<size>\fP bytes.
550
+ .UNINDENT
551
+ .INDENT 0.0
552
+ .TP
553
+ .B \-\-test\-output\-truncation <mode>
554
+ Added in version 3.24.
555
+
556
+ .sp
557
+ Truncate \fBtail\fP (default), \fBmiddle\fP or \fBhead\fP of test output once
558
+ maximum output size is reached.
559
+ .UNINDENT
560
+ .INDENT 0.0
561
+ .TP
562
+ .B \-\-overwrite
563
+ Overwrite CTest configuration option.
564
+ .sp
565
+ By default CTest uses configuration options from configuration file.
566
+ This option will overwrite the configuration option.
567
+ .UNINDENT
568
+ .INDENT 0.0
569
+ .TP
570
+ .B \-\-force\-new\-ctest\-process
571
+ Run child CTest instances as new processes.
572
+ .sp
573
+ By default CTest will run child CTest instances within the same
574
+ process. If this behavior is not desired, this argument will
575
+ enforce new processes for child CTest processes.
576
+ .UNINDENT
577
+ .INDENT 0.0
578
+ .TP
579
+ .B \-\-schedule\-random
580
+ Use a random order for scheduling tests.
581
+ .sp
582
+ This option will run the tests in a random order. It is commonly
583
+ used to detect implicit dependencies in a test suite.
584
+ .UNINDENT
585
+ .INDENT 0.0
586
+ .TP
587
+ .B \-\-submit\-index
588
+ Legacy option for old Dart2 dashboard server feature.
589
+ Do not use.
590
+ .UNINDENT
591
+ .INDENT 0.0
592
+ .TP
593
+ .B \-\-timeout <seconds>
594
+ Set the default test timeout.
595
+ .sp
596
+ This option effectively sets a timeout on all tests that do not
597
+ already have a timeout set on them via the \X'tty: link #prop_test:TIMEOUT'\fI\%TIMEOUT\fP\X'tty: link'
598
+ property.
599
+ .UNINDENT
600
+ .INDENT 0.0
601
+ .TP
602
+ .B \-\-stop\-time <time>
603
+ Set a time at which all tests should stop running.
604
+ .sp
605
+ Set a real time of day at which all tests should timeout. Example:
606
+ \fB7:00:00 \-0400\fP\&. Any time format understood by the curl date parser
607
+ is accepted. Local time is assumed if no timezone is specified.
608
+ .UNINDENT
609
+ .INDENT 0.0
610
+ .TP
611
+ .B \-\-print\-labels
612
+ Print all available test labels.
613
+ .sp
614
+ This option will not run any tests, it will simply print the list of
615
+ all labels associated with the test set.
616
+ .UNINDENT
617
+ .INDENT 0.0
618
+ .TP
619
+ .B \-\-no\-tests=<action>
620
+ Regard no tests found either as error (when \fB<action>\fP is set to
621
+ \fBerror\fP) or ignore it (when \fB<action>\fP is set to \fBignore\fP).
622
+ .sp
623
+ If no tests were found, the default behavior of CTest is to always log an
624
+ error message but to return an error code in script mode only. This option
625
+ unifies the behavior of CTest by either returning an error code if no tests
626
+ were found or by ignoring it.
627
+ .sp
628
+ Added in version 3.26.
629
+
630
+ .sp
631
+ This option can also be set by setting the \X'tty: link #envvar:CTEST_NO_TESTS_ACTION'\fI\%CTEST_NO_TESTS_ACTION\fP\X'tty: link'
632
+ environment variable.
633
+ .UNINDENT
634
+ .SH VIEW HELP
635
+ .sp
636
+ To print version details or selected pages from the CMake documentation,
637
+ use one of the following options:
638
+ .INDENT 0.0
639
+ .TP
640
+ .B \-version [<file>], \-\-version [<file>], /V [<file>]
641
+ Show program name/version banner and exit.
642
+ The output is printed to a named \fB<file>\fP if given.
643
+ .UNINDENT
644
+ .INDENT 0.0
645
+ .TP
646
+ .B \-h, \-H, \-\-help, \-help, \-usage, /?
647
+ Print usage information and exit.
648
+ .sp
649
+ Usage describes the basic command line interface and its options.
650
+ .UNINDENT
651
+ .INDENT 0.0
652
+ .TP
653
+ .B \-\-help <keyword> [<file>]
654
+ Print help for one CMake keyword.
655
+ .sp
656
+ \fB<keyword>\fP can be a property, variable, command, policy, generator
657
+ or module.
658
+ .sp
659
+ The relevant manual entry for \fB<keyword>\fP is
660
+ printed in a human\-readable text format.
661
+ The output is printed to a named \fB<file>\fP if given.
662
+ .sp
663
+ Changed in version 3.28: Prior to CMake 3.28, this option supported command names only.
664
+
665
+ .UNINDENT
666
+ .INDENT 0.0
667
+ .TP
668
+ .B \-\-help\-full [<file>]
669
+ Print all help manuals and exit.
670
+ .sp
671
+ All manuals are printed in a human\-readable text format.
672
+ The output is printed to a named \fB<file>\fP if given.
673
+ .UNINDENT
674
+ .INDENT 0.0
675
+ .TP
676
+ .B \-\-help\-manual <man> [<file>]
677
+ Print one help manual and exit.
678
+ .sp
679
+ The specified manual is printed in a human\-readable text format.
680
+ The output is printed to a named \fB<file>\fP if given.
681
+ .UNINDENT
682
+ .INDENT 0.0
683
+ .TP
684
+ .B \-\-help\-manual\-list [<file>]
685
+ List help manuals available and exit.
686
+ .sp
687
+ The list contains all manuals for which help may be obtained by
688
+ using the \fB\-\-help\-manual\fP option followed by a manual name.
689
+ The output is printed to a named \fB<file>\fP if given.
690
+ .UNINDENT
691
+ .INDENT 0.0
692
+ .TP
693
+ .B \-\-help\-command <cmd> [<file>]
694
+ Print help for one command and exit.
695
+ .sp
696
+ The \X'tty: link #manual:cmake-commands(7)'\fI\%cmake\-commands(7)\fP\X'tty: link' manual entry for \fB<cmd>\fP is
697
+ printed in a human\-readable text format.
698
+ The output is printed to a named \fB<file>\fP if given.
699
+ .UNINDENT
700
+ .INDENT 0.0
701
+ .TP
702
+ .B \-\-help\-command\-list [<file>]
703
+ List commands with help available and exit.
704
+ .sp
705
+ The list contains all commands for which help may be obtained by
706
+ using the \fB\-\-help\-command\fP option followed by a command name.
707
+ The output is printed to a named \fB<file>\fP if given.
708
+ .UNINDENT
709
+ .INDENT 0.0
710
+ .TP
711
+ .B \-\-help\-commands [<file>]
712
+ Print cmake\-commands manual and exit.
713
+ .sp
714
+ The \X'tty: link #manual:cmake-commands(7)'\fI\%cmake\-commands(7)\fP\X'tty: link' manual is printed in a
715
+ human\-readable text format.
716
+ The output is printed to a named \fB<file>\fP if given.
717
+ .UNINDENT
718
+ .INDENT 0.0
719
+ .TP
720
+ .B \-\-help\-module <mod> [<file>]
721
+ Print help for one module and exit.
722
+ .sp
723
+ The \X'tty: link #manual:cmake-modules(7)'\fI\%cmake\-modules(7)\fP\X'tty: link' manual entry for \fB<mod>\fP is printed
724
+ in a human\-readable text format.
725
+ The output is printed to a named \fB<file>\fP if given.
726
+ .UNINDENT
727
+ .INDENT 0.0
728
+ .TP
729
+ .B \-\-help\-module\-list [<file>]
730
+ List modules with help available and exit.
731
+ .sp
732
+ The list contains all modules for which help may be obtained by
733
+ using the \fB\-\-help\-module\fP option followed by a module name.
734
+ The output is printed to a named \fB<file>\fP if given.
735
+ .UNINDENT
736
+ .INDENT 0.0
737
+ .TP
738
+ .B \-\-help\-modules [<file>]
739
+ Print cmake\-modules manual and exit.
740
+ .sp
741
+ The \X'tty: link #manual:cmake-modules(7)'\fI\%cmake\-modules(7)\fP\X'tty: link' manual is printed in a human\-readable
742
+ text format.
743
+ The output is printed to a named \fB<file>\fP if given.
744
+ .UNINDENT
745
+ .INDENT 0.0
746
+ .TP
747
+ .B \-\-help\-policy <cmp> [<file>]
748
+ Print help for one policy and exit.
749
+ .sp
750
+ The \X'tty: link #manual:cmake-policies(7)'\fI\%cmake\-policies(7)\fP\X'tty: link' manual entry for \fB<cmp>\fP is
751
+ printed in a human\-readable text format.
752
+ The output is printed to a named \fB<file>\fP if given.
753
+ .UNINDENT
754
+ .INDENT 0.0
755
+ .TP
756
+ .B \-\-help\-policy\-list [<file>]
757
+ List policies with help available and exit.
758
+ .sp
759
+ The list contains all policies for which help may be obtained by
760
+ using the \fB\-\-help\-policy\fP option followed by a policy name.
761
+ The output is printed to a named \fB<file>\fP if given.
762
+ .UNINDENT
763
+ .INDENT 0.0
764
+ .TP
765
+ .B \-\-help\-policies [<file>]
766
+ Print cmake\-policies manual and exit.
767
+ .sp
768
+ The \X'tty: link #manual:cmake-policies(7)'\fI\%cmake\-policies(7)\fP\X'tty: link' manual is printed in a
769
+ human\-readable text format.
770
+ The output is printed to a named \fB<file>\fP if given.
771
+ .UNINDENT
772
+ .INDENT 0.0
773
+ .TP
774
+ .B \-\-help\-property <prop> [<file>]
775
+ Print help for one property and exit.
776
+ .sp
777
+ The \X'tty: link #manual:cmake-properties(7)'\fI\%cmake\-properties(7)\fP\X'tty: link' manual entries for \fB<prop>\fP are
778
+ printed in a human\-readable text format.
779
+ The output is printed to a named \fB<file>\fP if given.
780
+ .UNINDENT
781
+ .INDENT 0.0
782
+ .TP
783
+ .B \-\-help\-property\-list [<file>]
784
+ List properties with help available and exit.
785
+ .sp
786
+ The list contains all properties for which help may be obtained by
787
+ using the \fB\-\-help\-property\fP option followed by a property name.
788
+ The output is printed to a named \fB<file>\fP if given.
789
+ .UNINDENT
790
+ .INDENT 0.0
791
+ .TP
792
+ .B \-\-help\-properties [<file>]
793
+ Print cmake\-properties manual and exit.
794
+ .sp
795
+ The \X'tty: link #manual:cmake-properties(7)'\fI\%cmake\-properties(7)\fP\X'tty: link' manual is printed in a
796
+ human\-readable text format.
797
+ The output is printed to a named \fB<file>\fP if given.
798
+ .UNINDENT
799
+ .INDENT 0.0
800
+ .TP
801
+ .B \-\-help\-variable <var> [<file>]
802
+ Print help for one variable and exit.
803
+ .sp
804
+ The \X'tty: link #manual:cmake-variables(7)'\fI\%cmake\-variables(7)\fP\X'tty: link' manual entry for \fB<var>\fP is
805
+ printed in a human\-readable text format.
806
+ The output is printed to a named \fB<file>\fP if given.
807
+ .UNINDENT
808
+ .INDENT 0.0
809
+ .TP
810
+ .B \-\-help\-variable\-list [<file>]
811
+ List variables with help available and exit.
812
+ .sp
813
+ The list contains all variables for which help may be obtained by
814
+ using the \fB\-\-help\-variable\fP option followed by a variable name.
815
+ The output is printed to a named \fB<file>\fP if given.
816
+ .UNINDENT
817
+ .INDENT 0.0
818
+ .TP
819
+ .B \-\-help\-variables [<file>]
820
+ Print cmake\-variables manual and exit.
821
+ .sp
822
+ The \X'tty: link #manual:cmake-variables(7)'\fI\%cmake\-variables(7)\fP\X'tty: link' manual is printed in a
823
+ human\-readable text format.
824
+ The output is printed to a named \fB<file>\fP if given.
825
+ .UNINDENT
826
+ .SH LABEL MATCHING
827
+ .sp
828
+ Tests may have labels attached to them. Tests may be included
829
+ or excluded from a test run by filtering on the labels.
830
+ Each individual filter is a regular expression applied to
831
+ the labels attached to a test.
832
+ .sp
833
+ When \fI\%\-L\fP is used, in order for a test to be included in a
834
+ test run, each regular expression must match at least one
835
+ label. Using more than one \fI\%\-L\fP option means \(dqmatch \fBall\fP
836
+ of these\(dq.
837
+ .sp
838
+ The \fI\%\-LE\fP option works just like \fI\%\-L\fP,
839
+ but excludes tests rather than including them. A test is excluded if each
840
+ regular expression matches at least one label.
841
+ .sp
842
+ If a test has no labels attached to it, then \fI\%\-L\fP will never
843
+ include that test, and \fI\%\-LE\fP will never exclude that test.
844
+ As an example of tests with labels, consider five tests,
845
+ with the following labels:
846
+ .INDENT 0.0
847
+ .IP \(bu 2
848
+ \fItest1\fP has labels \fItuesday\fP and \fIproduction\fP
849
+ .IP \(bu 2
850
+ \fItest2\fP has labels \fItuesday\fP and \fItest\fP
851
+ .IP \(bu 2
852
+ \fItest3\fP has labels \fIwednesday\fP and \fIproduction\fP
853
+ .IP \(bu 2
854
+ \fItest4\fP has label \fIwednesday\fP
855
+ .IP \(bu 2
856
+ \fItest5\fP has labels \fIfriday\fP and \fItest\fP
857
+ .UNINDENT
858
+ .sp
859
+ Running \fBctest\fP with \fB\-L tuesday \-L test\fP will select \fItest2\fP, which has
860
+ both labels. Running CTest with \fB\-L test\fP will select \fItest2\fP and
861
+ \fItest5\fP, because both of them have a label that matches that regular
862
+ expression.
863
+ .sp
864
+ Because the matching works with regular expressions, take note that
865
+ running CTest with \fB\-L es\fP will match all five tests.
866
+ To select the \fItuesday\fP and \fIwednesday\fP tests together, use a single
867
+ regular expression that matches either of them, like \fB\-L \(dqtue|wed\(dq\fP\&.
868
+ .SH LABEL AND SUBPROJECT SUMMARY
869
+ .sp
870
+ CTest prints timing summary information for each \fBLABEL\fP and subproject
871
+ associated with the tests run. The label time summary will not include labels
872
+ that are mapped to subprojects.
873
+ .sp
874
+ Added in version 3.22: Labels added dynamically during test execution are also reported in the
875
+ timing summary. See \X'tty: link #additional-labels'\fI\%Additional Labels\fP\X'tty: link'\&.
876
+
877
+ .sp
878
+ When the \X'tty: link #prop_test:PROCESSORS'\fI\%PROCESSORS\fP\X'tty: link' test property is set, CTest will display a
879
+ weighted test timing result in label and subproject summaries. The time is
880
+ reported with \fIsec*proc\fP instead of just \fIsec\fP\&.
881
+ .sp
882
+ The weighted time summary reported for each label or subproject \fBj\fP
883
+ is computed as:
884
+ .INDENT 0.0
885
+ .INDENT 3.5
886
+ .sp
887
+ .nf
888
+ .ft C
889
+ Weighted Time Summary for Label/Subproject j =
890
+ sum(raw_test_time[j,i] * num_processors[j,i], i=1...num_tests[j])
891
+
892
+ for labels/subprojects j=1...total
893
+ .ft P
894
+ .fi
895
+ .UNINDENT
896
+ .UNINDENT
897
+ .sp
898
+ where:
899
+ .INDENT 0.0
900
+ .IP \(bu 2
901
+ \fBraw_test_time[j,i]\fP: Wall\-clock time for the \fBi\fP test
902
+ for the \fBj\fP label or subproject
903
+ .IP \(bu 2
904
+ \fBnum_processors[j,i]\fP: Value of the CTest \X'tty: link #prop_test:PROCESSORS'\fI\%PROCESSORS\fP\X'tty: link' property
905
+ for the \fBi\fP test for the \fBj\fP label or subproject
906
+ .IP \(bu 2
907
+ \fBnum_tests[j]\fP: Number of tests associated with the \fBj\fP label or subproject
908
+ .IP \(bu 2
909
+ \fBtotal\fP: Total number of labels or subprojects that have at least one test run
910
+ .UNINDENT
911
+ .sp
912
+ Therefore, the weighted time summary for each label or subproject represents
913
+ the amount of time that CTest gave to run the tests for each label or
914
+ subproject and gives a good representation of the total expense of the tests
915
+ for each label or subproject when compared to other labels or subprojects.
916
+ .sp
917
+ For example, if \fBSubprojectA\fP showed \fB100 sec*proc\fP and \fBSubprojectB\fP showed
918
+ \fB10 sec*proc\fP, then CTest allocated approximately 10 times the CPU/core time
919
+ to run the tests for \fBSubprojectA\fP than for \fBSubprojectB\fP (e.g. so if effort
920
+ is going to be expended to reduce the cost of the test suite for the whole
921
+ project, then reducing the cost of the test suite for \fBSubprojectA\fP would
922
+ likely have a larger impact than effort to reduce the cost of the test suite
923
+ for \fBSubprojectB\fP).
924
+ .SH BUILD AND TEST MODE
925
+ .sp
926
+ CTest provides a command\-line signature to configure (i.e. run cmake on),
927
+ build, and/or execute a test:
928
+ .INDENT 0.0
929
+ .INDENT 3.5
930
+ .sp
931
+ .nf
932
+ .ft C
933
+ ctest \-\-build\-and\-test <path\-to\-source> <path\-to\-build>
934
+ \-\-build\-generator <generator>
935
+ [<options>...]
936
+ [\-\-build\-options <opts>...]
937
+ [\-\-test\-command <command> [<args>...]]
938
+ .ft P
939
+ .fi
940
+ .UNINDENT
941
+ .UNINDENT
942
+ .sp
943
+ The configure and test steps are optional. The arguments to this command line
944
+ are the source and binary directories. The \fB\-\-build\-generator\fP option \fImust\fP
945
+ be provided to use \fB\-\-build\-and\-test\fP\&. If \fB\-\-test\-command\fP is specified
946
+ then that will be run after the build is complete. Other options that affect
947
+ this mode include:
948
+ .INDENT 0.0
949
+ .TP
950
+ .B \-\-build\-and\-test
951
+ Switch into the build and test mode.
952
+ .UNINDENT
953
+ .INDENT 0.0
954
+ .TP
955
+ .B \-\-build\-target
956
+ Specify a specific target to build. The option can be given multiple times
957
+ with different targets, in which case each target is built in turn.
958
+ A clean will be done before building each target unless the
959
+ \fI\%\-\-build\-noclean\fP option is given.
960
+ .sp
961
+ If no \fB\-\-build\-target\fP is specified, the \fBall\fP target is built.
962
+ .UNINDENT
963
+ .INDENT 0.0
964
+ .TP
965
+ .B \-\-build\-nocmake
966
+ Run the build without running cmake first.
967
+ .sp
968
+ Skip the cmake step.
969
+ .UNINDENT
970
+ .INDENT 0.0
971
+ .TP
972
+ .B \-\-build\-run\-dir
973
+ Specify directory to run programs from.
974
+ .sp
975
+ Directory where programs will be after it has been compiled.
976
+ .UNINDENT
977
+ .INDENT 0.0
978
+ .TP
979
+ .B \-\-build\-two\-config
980
+ Run CMake twice.
981
+ .UNINDENT
982
+ .INDENT 0.0
983
+ .TP
984
+ .B \-\-build\-exe\-dir
985
+ Specify the directory for the executable.
986
+ .UNINDENT
987
+ .INDENT 0.0
988
+ .TP
989
+ .B \-\-build\-generator
990
+ Specify the generator to use. See the \X'tty: link #manual:cmake-generators(7)'\fI\%cmake\-generators(7)\fP\X'tty: link' manual.
991
+ .UNINDENT
992
+ .INDENT 0.0
993
+ .TP
994
+ .B \-\-build\-generator\-platform
995
+ Specify the generator\-specific platform.
996
+ .UNINDENT
997
+ .INDENT 0.0
998
+ .TP
999
+ .B \-\-build\-generator\-toolset
1000
+ Specify the generator\-specific toolset.
1001
+ .UNINDENT
1002
+ .INDENT 0.0
1003
+ .TP
1004
+ .B \-\-build\-project
1005
+ Specify the name of the project to build.
1006
+ .UNINDENT
1007
+ .INDENT 0.0
1008
+ .TP
1009
+ .B \-\-build\-makeprogram
1010
+ Specify the explicit make program to be used by CMake when configuring and
1011
+ building the project. Only applicable for Make and Ninja based generators.
1012
+ .UNINDENT
1013
+ .INDENT 0.0
1014
+ .TP
1015
+ .B \-\-build\-noclean
1016
+ Skip the make clean step.
1017
+ .UNINDENT
1018
+ .INDENT 0.0
1019
+ .TP
1020
+ .B \-\-build\-config\-sample
1021
+ A sample executable to use to determine the configuration that
1022
+ should be used. e.g. \fBDebug\fP, \fBRelease\fP etc.
1023
+ .UNINDENT
1024
+ .INDENT 0.0
1025
+ .TP
1026
+ .B \-\-build\-options
1027
+ Additional options for configuring the build (i.e. for CMake, not for
1028
+ the build tool). Note that if this is specified, the \fB\-\-build\-options\fP
1029
+ keyword and its arguments must be the last option given on the command
1030
+ line, with the possible exception of \fB\-\-test\-command\fP\&.
1031
+ .UNINDENT
1032
+ .INDENT 0.0
1033
+ .TP
1034
+ .B \-\-test\-command
1035
+ The command to run as the test step with the
1036
+ \fI\%\-\-build\-and\-test\fP option.
1037
+ All arguments following this keyword will be assumed to be part of the
1038
+ test command line, so it must be the last option given.
1039
+ .UNINDENT
1040
+ .INDENT 0.0
1041
+ .TP
1042
+ .B \-\-test\-timeout
1043
+ The time limit in seconds
1044
+ .UNINDENT
1045
+ .SH DASHBOARD CLIENT
1046
+ .sp
1047
+ CTest can operate as a client for the \X'tty: link https://www.cdash.org'\fI\%CDash\fP\X'tty: link' software quality dashboard
1048
+ application. As a dashboard client, CTest performs a sequence of steps
1049
+ to configure, build, and test software, and then submits the results to
1050
+ a \X'tty: link https://www.cdash.org'\fI\%CDash\fP\X'tty: link' server. The command\-line signature used to submit to \X'tty: link https://www.cdash.org'\fI\%CDash\fP\X'tty: link' is:
1051
+ .INDENT 0.0
1052
+ .INDENT 3.5
1053
+ .sp
1054
+ .nf
1055
+ .ft C
1056
+ ctest \-D <dashboard> [\-\- <dashboard\-options>...]
1057
+ ctest \-M <model> \-T <action> [\-\- <dashboard\-options>...]
1058
+ ctest \-S <script> [\-\- <dashboard\-options>...]
1059
+ ctest \-SP <script> [\-\- <dashboard\-options>...]
1060
+ .ft P
1061
+ .fi
1062
+ .UNINDENT
1063
+ .UNINDENT
1064
+ .sp
1065
+ Options for Dashboard Client include:
1066
+ .INDENT 0.0
1067
+ .TP
1068
+ .B \-D <dashboard>, \-\-dashboard <dashboard>
1069
+ Execute dashboard test.
1070
+ .sp
1071
+ This option tells CTest to act as a CDash client and perform a
1072
+ dashboard test. All tests are \fB<Mode><Test>\fP, where \fB<Mode>\fP can be
1073
+ \fBExperimental\fP, \fBNightly\fP, and \fBContinuous\fP, and \fB<Test>\fP can be
1074
+ \fBStart\fP, \fBUpdate\fP, \fBConfigure\fP, \fBBuild\fP, \fBTest\fP,
1075
+ \fBCoverage\fP, and \fBSubmit\fP\&.
1076
+ .sp
1077
+ If \fB<dashboard>\fP is not one of the recognized \fB<Mode><Test>\fP values,
1078
+ this will be treated as a variable definition instead (see the
1079
+ \fI\%dashboard\-options\fP further below).
1080
+ .UNINDENT
1081
+ .INDENT 0.0
1082
+ .TP
1083
+ .B \-M <model>, \-\-test\-model <model>
1084
+ Sets the model for a dashboard.
1085
+ .sp
1086
+ This option tells CTest to act as a CDash client where the \fB<model>\fP
1087
+ can be \fBExperimental\fP, \fBNightly\fP, and \fBContinuous\fP\&.
1088
+ Combining \fB\-M\fP and \fI\%\-T\fP is similar to
1089
+ \fI\%\-D\fP\&.
1090
+ .UNINDENT
1091
+ .INDENT 0.0
1092
+ .TP
1093
+ .B \-T <action>, \-\-test\-action <action>
1094
+ Sets the dashboard action to perform.
1095
+ .sp
1096
+ This option tells CTest to act as a CDash client and perform some
1097
+ action such as \fBstart\fP, \fBbuild\fP, \fBtest\fP etc. See
1098
+ \fI\%Dashboard Client Steps\fP for the full list of actions.
1099
+ Combining \fI\%\-M\fP and \fB\-T\fP is similar to
1100
+ \fI\%\-D\fP\&.
1101
+ .UNINDENT
1102
+ .INDENT 0.0
1103
+ .TP
1104
+ .B \-S <script>, \-\-script <script>
1105
+ Execute a dashboard for a configuration.
1106
+ .sp
1107
+ This option tells CTest to load in a configuration script which sets
1108
+ a number of parameters such as the binary and source directories.
1109
+ Then CTest will do what is required to create and run a dashboard.
1110
+ This option basically sets up a dashboard and then runs \fI\%ctest \-D\fP
1111
+ with the appropriate options.
1112
+ .UNINDENT
1113
+ .INDENT 0.0
1114
+ .TP
1115
+ .B \-SP <script>, \-\-script\-new\-process <script>
1116
+ Execute a dashboard for a configuration.
1117
+ .sp
1118
+ This option does the same operations as \fI\%\-S\fP but it
1119
+ will do them in a separate process. This is primarily useful in cases
1120
+ where the script may modify the environment and you do not want the modified
1121
+ environment to impact other \fI\%\-S\fP scripts.
1122
+ .UNINDENT
1123
+ .sp
1124
+ The available \fB<dashboard\-options>\fP are the following:
1125
+ .INDENT 0.0
1126
+ .TP
1127
+ .B \-D <var>:<type>=<value>
1128
+ Define a variable for script mode.
1129
+ .sp
1130
+ Pass in variable values on the command line. Use in conjunction
1131
+ with \fI\%\-S\fP to pass variable values to a dashboard script.
1132
+ Parsing \fB\-D\fP arguments as variable values is only attempted if the value
1133
+ following \fB\-D\fP does not match any of the known dashboard types.
1134
+ .UNINDENT
1135
+ .INDENT 0.0
1136
+ .TP
1137
+ .B \-\-group <group>
1138
+ Specify what group you\(aqd like to submit results to
1139
+ .sp
1140
+ Submit dashboard to specified group instead of default one. By
1141
+ default, the dashboard is submitted to Nightly, Experimental, or
1142
+ Continuous group, but by specifying this option, the group can be
1143
+ arbitrary.
1144
+ .sp
1145
+ This replaces the deprecated option \fB\-\-track\fP\&.
1146
+ Despite the name change its behavior is unchanged.
1147
+ .UNINDENT
1148
+ .INDENT 0.0
1149
+ .TP
1150
+ .B \-A <file>, \-\-add\-notes <file>
1151
+ Add a notes file with submission.
1152
+ .sp
1153
+ This option tells CTest to include a notes file when submitting
1154
+ dashboard.
1155
+ .UNINDENT
1156
+ .INDENT 0.0
1157
+ .TP
1158
+ .B \-\-tomorrow\-tag
1159
+ \fBNightly\fP or \fBExperimental\fP starts with next day tag.
1160
+ .sp
1161
+ This is useful if the build will not finish in one day.
1162
+ .UNINDENT
1163
+ .INDENT 0.0
1164
+ .TP
1165
+ .B \-\-extra\-submit <file>[;<file>]
1166
+ Submit extra files to the dashboard.
1167
+ .sp
1168
+ This option will submit extra files to the dashboard.
1169
+ .UNINDENT
1170
+ .INDENT 0.0
1171
+ .TP
1172
+ .B \-\-http\-header <header>
1173
+ Added in version 3.29.
1174
+
1175
+ .sp
1176
+ Append HTTP header when submitting to the dashboard.
1177
+ .sp
1178
+ This option will cause CTest to append the specified header
1179
+ when submitting to the dashboard.
1180
+ This option may be specified more than once.
1181
+ .UNINDENT
1182
+ .INDENT 0.0
1183
+ .TP
1184
+ .B \-\-http1.0
1185
+ Submit using \fIHTTP 1.0\fP\&.
1186
+ .sp
1187
+ This option will force CTest to use \fIHTTP 1.0\fP to submit files to the
1188
+ dashboard, instead of \fIHTTP 1.1\fP\&.
1189
+ .UNINDENT
1190
+ .INDENT 0.0
1191
+ .TP
1192
+ .B \-\-no\-compress\-output
1193
+ Do not compress test output when submitting.
1194
+ .sp
1195
+ This flag will turn off automatic compression of test output. Use
1196
+ this to maintain compatibility with an older version of CDash which
1197
+ doesn\(aqt support compressed test output.
1198
+ .UNINDENT
1199
+ .SS Dashboard Client Steps
1200
+ .sp
1201
+ CTest defines an ordered list of testing steps of which some or all may
1202
+ be run as a dashboard client:
1203
+ .INDENT 0.0
1204
+ .TP
1205
+ .B \fBStart\fP
1206
+ Start a new dashboard submission to be composed of results recorded
1207
+ by the following steps.
1208
+ See the \fI\%CTest Start Step\fP section below.
1209
+ .TP
1210
+ .B \fBUpdate\fP
1211
+ Update the source tree from its version control repository.
1212
+ Record the old and new versions and the list of updated source files.
1213
+ See the \fI\%CTest Update Step\fP section below.
1214
+ .TP
1215
+ .B \fBConfigure\fP
1216
+ Configure the software by running a command in the build tree.
1217
+ Record the configuration output log.
1218
+ See the \fI\%CTest Configure Step\fP section below.
1219
+ .TP
1220
+ .B \fBBuild\fP
1221
+ Build the software by running a command in the build tree.
1222
+ Record the build output log and detect warnings and errors.
1223
+ See the \fI\%CTest Build Step\fP section below.
1224
+ .TP
1225
+ .B \fBTest\fP
1226
+ Test the software by loading a \fBCTestTestfile.cmake\fP
1227
+ from the build tree and executing the defined tests.
1228
+ Record the output and result of each test.
1229
+ See the \fI\%CTest Test Step\fP section below.
1230
+ .TP
1231
+ .B \fBCoverage\fP
1232
+ Compute coverage of the source code by running a coverage
1233
+ analysis tool and recording its output.
1234
+ See the \fI\%CTest Coverage Step\fP section below.
1235
+ .TP
1236
+ .B \fBMemCheck\fP
1237
+ Run the software test suite through a memory check tool.
1238
+ Record the test output, results, and issues reported by the tool.
1239
+ See the \fI\%CTest MemCheck Step\fP section below.
1240
+ .TP
1241
+ .B \fBSubmit\fP
1242
+ Submit results recorded from other testing steps to the
1243
+ software quality dashboard server.
1244
+ See the \fI\%CTest Submit Step\fP section below.
1245
+ .UNINDENT
1246
+ .SS Dashboard Client Modes
1247
+ .sp
1248
+ CTest defines three modes of operation as a dashboard client:
1249
+ .INDENT 0.0
1250
+ .TP
1251
+ .B \fBNightly\fP
1252
+ This mode is intended to be invoked once per day, typically at night.
1253
+ It enables the \fBStart\fP, \fBUpdate\fP, \fBConfigure\fP, \fBBuild\fP, \fBTest\fP,
1254
+ \fBCoverage\fP, and \fBSubmit\fP steps by default. Selected steps run even
1255
+ if the \fBUpdate\fP step reports no changes to the source tree.
1256
+ .TP
1257
+ .B \fBContinuous\fP
1258
+ This mode is intended to be invoked repeatedly throughout the day.
1259
+ It enables the \fBStart\fP, \fBUpdate\fP, \fBConfigure\fP, \fBBuild\fP, \fBTest\fP,
1260
+ \fBCoverage\fP, and \fBSubmit\fP steps by default, but exits after the
1261
+ \fBUpdate\fP step if it reports no changes to the source tree.
1262
+ .TP
1263
+ .B \fBExperimental\fP
1264
+ This mode is intended to be invoked by a developer to test local changes.
1265
+ It enables the \fBStart\fP, \fBConfigure\fP, \fBBuild\fP, \fBTest\fP, \fBCoverage\fP,
1266
+ and \fBSubmit\fP steps by default.
1267
+ .UNINDENT
1268
+ .SS Dashboard Client via CTest Command\-Line
1269
+ .sp
1270
+ CTest can perform testing on an already\-generated build tree.
1271
+ Run the \fBctest\fP command with the current working directory set
1272
+ to the build tree and use one of these signatures:
1273
+ .INDENT 0.0
1274
+ .INDENT 3.5
1275
+ .sp
1276
+ .nf
1277
+ .ft C
1278
+ ctest \-D <mode>[<step>]
1279
+ ctest \-M <mode> [\-T <step>]...
1280
+ .ft P
1281
+ .fi
1282
+ .UNINDENT
1283
+ .UNINDENT
1284
+ .sp
1285
+ The \fB<mode>\fP must be one of the above \fI\%Dashboard Client Modes\fP,
1286
+ and each \fB<step>\fP must be one of the above \fI\%Dashboard Client Steps\fP\&.
1287
+ .sp
1288
+ CTest reads the \fI\%Dashboard Client Configuration\fP settings from
1289
+ a file in the build tree called either \fBCTestConfiguration.ini\fP
1290
+ or \fBDartConfiguration.tcl\fP (the names are historical). The format
1291
+ of the file is:
1292
+ .INDENT 0.0
1293
+ .INDENT 3.5
1294
+ .sp
1295
+ .nf
1296
+ .ft C
1297
+ # Lines starting in \(aq#\(aq are comments.
1298
+ # Other non\-blank lines are key\-value pairs.
1299
+ <setting>: <value>
1300
+ .ft P
1301
+ .fi
1302
+ .UNINDENT
1303
+ .UNINDENT
1304
+ .sp
1305
+ where \fB<setting>\fP is the setting name and \fB<value>\fP is the
1306
+ setting value.
1307
+ .sp
1308
+ In build trees generated by CMake, this configuration file is
1309
+ generated by the \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module if included by the project.
1310
+ The module uses variables to obtain a value for each setting
1311
+ as documented with the settings below.
1312
+ .SS Dashboard Client via CTest Script
1313
+ .sp
1314
+ CTest can perform testing driven by a \X'tty: link #manual:cmake-language(7)'\fI\%cmake\-language(7)\fP\X'tty: link'
1315
+ script that creates and maintains the source and build tree as
1316
+ well as performing the testing steps. Run the \fBctest\fP command
1317
+ with the current working directory set outside of any build tree
1318
+ and use one of these signatures:
1319
+ .INDENT 0.0
1320
+ .INDENT 3.5
1321
+ .sp
1322
+ .nf
1323
+ .ft C
1324
+ ctest \-S <script>
1325
+ ctest \-SP <script>
1326
+ .ft P
1327
+ .fi
1328
+ .UNINDENT
1329
+ .UNINDENT
1330
+ .sp
1331
+ The \fB<script>\fP file must call \X'tty: link #ctest-commands'\fI\%CTest Commands\fP\X'tty: link' commands
1332
+ to run testing steps explicitly as documented below. The commands
1333
+ obtain \fI\%Dashboard Client Configuration\fP settings from their
1334
+ arguments or from variables set in the script.
1335
+ .SH DASHBOARD CLIENT CONFIGURATION
1336
+ .sp
1337
+ The \fI\%Dashboard Client Steps\fP may be configured by named
1338
+ settings as documented in the following sections.
1339
+ .SS CTest Start Step
1340
+ .sp
1341
+ Start a new dashboard submission to be composed of results recorded
1342
+ by the following steps.
1343
+ .sp
1344
+ In a \fI\%CTest Script\fP, the \X'tty: link #command:ctest_start'\fI\%ctest_start()\fP\X'tty: link' command runs this step.
1345
+ Arguments to the command may specify some of the step settings.
1346
+ The command first runs the command\-line specified by the
1347
+ \fBCTEST_CHECKOUT_COMMAND\fP variable, if set, to initialize the source
1348
+ directory.
1349
+ .sp
1350
+ Configuration settings include:
1351
+ .INDENT 0.0
1352
+ .TP
1353
+ .B \fBBuildDirectory\fP
1354
+ The full path to the project build tree.
1355
+ .INDENT 7.0
1356
+ .IP \(bu 2
1357
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_BINARY_DIRECTORY'\fI\%CTEST_BINARY_DIRECTORY\fP\X'tty: link'
1358
+ .IP \(bu 2
1359
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \X'tty: link #variable:PROJECT_BINARY_DIR'\fI\%PROJECT_BINARY_DIR\fP\X'tty: link'
1360
+ .UNINDENT
1361
+ .TP
1362
+ .B \fBSourceDirectory\fP
1363
+ The full path to the project source tree.
1364
+ .INDENT 7.0
1365
+ .IP \(bu 2
1366
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_SOURCE_DIRECTORY'\fI\%CTEST_SOURCE_DIRECTORY\fP\X'tty: link'
1367
+ .IP \(bu 2
1368
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \X'tty: link #variable:PROJECT_SOURCE_DIR'\fI\%PROJECT_SOURCE_DIR\fP\X'tty: link'
1369
+ .UNINDENT
1370
+ .UNINDENT
1371
+ .SS CTest Update Step
1372
+ .sp
1373
+ In a \fI\%CTest Script\fP, the \X'tty: link #command:ctest_update'\fI\%ctest_update()\fP\X'tty: link' command runs this step.
1374
+ Arguments to the command may specify some of the step settings.
1375
+ .sp
1376
+ Configuration settings to specify the version control tool include:
1377
+ .INDENT 0.0
1378
+ .TP
1379
+ .B \fBBZRCommand\fP
1380
+ \fBbzr\fP command\-line tool to use if source tree is managed by Bazaar.
1381
+ .INDENT 7.0
1382
+ .IP \(bu 2
1383
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_BZR_COMMAND'\fI\%CTEST_BZR_COMMAND\fP\X'tty: link'
1384
+ .IP \(bu 2
1385
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: none
1386
+ .UNINDENT
1387
+ .TP
1388
+ .B \fBBZRUpdateOptions\fP
1389
+ Command\-line options to the \fBBZRCommand\fP when updating the source.
1390
+ .INDENT 7.0
1391
+ .IP \(bu 2
1392
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_BZR_UPDATE_OPTIONS'\fI\%CTEST_BZR_UPDATE_OPTIONS\fP\X'tty: link'
1393
+ .IP \(bu 2
1394
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: none
1395
+ .UNINDENT
1396
+ .TP
1397
+ .B \fBCVSCommand\fP
1398
+ \fBcvs\fP command\-line tool to use if source tree is managed by CVS.
1399
+ .INDENT 7.0
1400
+ .IP \(bu 2
1401
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_CVS_COMMAND'\fI\%CTEST_CVS_COMMAND\fP\X'tty: link'
1402
+ .IP \(bu 2
1403
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBCVSCOMMAND\fP
1404
+ .UNINDENT
1405
+ .TP
1406
+ .B \fBCVSUpdateOptions\fP
1407
+ Command\-line options to the \fBCVSCommand\fP when updating the source.
1408
+ .INDENT 7.0
1409
+ .IP \(bu 2
1410
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_CVS_UPDATE_OPTIONS'\fI\%CTEST_CVS_UPDATE_OPTIONS\fP\X'tty: link'
1411
+ .IP \(bu 2
1412
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBCVS_UPDATE_OPTIONS\fP
1413
+ .UNINDENT
1414
+ .TP
1415
+ .B \fBGITCommand\fP
1416
+ \fBgit\fP command\-line tool to use if source tree is managed by Git.
1417
+ .INDENT 7.0
1418
+ .IP \(bu 2
1419
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_GIT_COMMAND'\fI\%CTEST_GIT_COMMAND\fP\X'tty: link'
1420
+ .IP \(bu 2
1421
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBGITCOMMAND\fP
1422
+ .UNINDENT
1423
+ .sp
1424
+ The source tree is updated by \fBgit fetch\fP followed by
1425
+ \fBgit reset \-\-hard\fP to the \fBFETCH_HEAD\fP\&. The result is the same
1426
+ as \fBgit pull\fP except that any local modifications are overwritten.
1427
+ Use \fBGITUpdateCustom\fP to specify a different approach.
1428
+ .TP
1429
+ .B \fBGITInitSubmodules\fP
1430
+ If set, CTest will update the repository\(aqs submodules before updating.
1431
+ .INDENT 7.0
1432
+ .IP \(bu 2
1433
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_GIT_INIT_SUBMODULES'\fI\%CTEST_GIT_INIT_SUBMODULES\fP\X'tty: link'
1434
+ .IP \(bu 2
1435
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBCTEST_GIT_INIT_SUBMODULES\fP
1436
+ .UNINDENT
1437
+ .TP
1438
+ .B \fBGITUpdateCustom\fP
1439
+ Specify a custom command line (as a semicolon\-separated list) to run
1440
+ in the source tree (Git work tree) to update it instead of running
1441
+ the \fBGITCommand\fP\&.
1442
+ .INDENT 7.0
1443
+ .IP \(bu 2
1444
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_GIT_UPDATE_CUSTOM'\fI\%CTEST_GIT_UPDATE_CUSTOM\fP\X'tty: link'
1445
+ .IP \(bu 2
1446
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBCTEST_GIT_UPDATE_CUSTOM\fP
1447
+ .UNINDENT
1448
+ .TP
1449
+ .B \fBGITUpdateOptions\fP
1450
+ Command\-line options to the \fBGITCommand\fP when updating the source.
1451
+ .INDENT 7.0
1452
+ .IP \(bu 2
1453
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_GIT_UPDATE_OPTIONS'\fI\%CTEST_GIT_UPDATE_OPTIONS\fP\X'tty: link'
1454
+ .IP \(bu 2
1455
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBGIT_UPDATE_OPTIONS\fP
1456
+ .UNINDENT
1457
+ .TP
1458
+ .B \fBHGCommand\fP
1459
+ \fBhg\fP command\-line tool to use if source tree is managed by Mercurial.
1460
+ .INDENT 7.0
1461
+ .IP \(bu 2
1462
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_HG_COMMAND'\fI\%CTEST_HG_COMMAND\fP\X'tty: link'
1463
+ .IP \(bu 2
1464
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: none
1465
+ .UNINDENT
1466
+ .TP
1467
+ .B \fBHGUpdateOptions\fP
1468
+ Command\-line options to the \fBHGCommand\fP when updating the source.
1469
+ .INDENT 7.0
1470
+ .IP \(bu 2
1471
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_HG_UPDATE_OPTIONS'\fI\%CTEST_HG_UPDATE_OPTIONS\fP\X'tty: link'
1472
+ .IP \(bu 2
1473
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: none
1474
+ .UNINDENT
1475
+ .TP
1476
+ .B \fBP4Client\fP
1477
+ Value of the \fB\-c\fP option to the \fBP4Command\fP\&.
1478
+ .INDENT 7.0
1479
+ .IP \(bu 2
1480
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_P4_CLIENT'\fI\%CTEST_P4_CLIENT\fP\X'tty: link'
1481
+ .IP \(bu 2
1482
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBCTEST_P4_CLIENT\fP
1483
+ .UNINDENT
1484
+ .TP
1485
+ .B \fBP4Command\fP
1486
+ \fBp4\fP command\-line tool to use if source tree is managed by Perforce.
1487
+ .INDENT 7.0
1488
+ .IP \(bu 2
1489
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_P4_COMMAND'\fI\%CTEST_P4_COMMAND\fP\X'tty: link'
1490
+ .IP \(bu 2
1491
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBP4COMMAND\fP
1492
+ .UNINDENT
1493
+ .TP
1494
+ .B \fBP4Options\fP
1495
+ Command\-line options to the \fBP4Command\fP for all invocations.
1496
+ .INDENT 7.0
1497
+ .IP \(bu 2
1498
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_P4_OPTIONS'\fI\%CTEST_P4_OPTIONS\fP\X'tty: link'
1499
+ .IP \(bu 2
1500
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBCTEST_P4_OPTIONS\fP
1501
+ .UNINDENT
1502
+ .TP
1503
+ .B \fBP4UpdateCustom\fP
1504
+ Specify a custom command line (as a semicolon\-separated list) to run
1505
+ in the source tree (Perforce tree) to update it instead of running
1506
+ the \fBP4Command\fP\&.
1507
+ .INDENT 7.0
1508
+ .IP \(bu 2
1509
+ \fI\%CTest Script\fP variable: none
1510
+ .IP \(bu 2
1511
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBCTEST_P4_UPDATE_CUSTOM\fP
1512
+ .UNINDENT
1513
+ .TP
1514
+ .B \fBP4UpdateOptions\fP
1515
+ Command\-line options to the \fBP4Command\fP when updating the source.
1516
+ .INDENT 7.0
1517
+ .IP \(bu 2
1518
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_P4_UPDATE_OPTIONS'\fI\%CTEST_P4_UPDATE_OPTIONS\fP\X'tty: link'
1519
+ .IP \(bu 2
1520
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBCTEST_P4_UPDATE_OPTIONS\fP
1521
+ .UNINDENT
1522
+ .TP
1523
+ .B \fBSVNCommand\fP
1524
+ \fBsvn\fP command\-line tool to use if source tree is managed by Subversion.
1525
+ .INDENT 7.0
1526
+ .IP \(bu 2
1527
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_SVN_COMMAND'\fI\%CTEST_SVN_COMMAND\fP\X'tty: link'
1528
+ .IP \(bu 2
1529
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBSVNCOMMAND\fP
1530
+ .UNINDENT
1531
+ .TP
1532
+ .B \fBSVNOptions\fP
1533
+ Command\-line options to the \fBSVNCommand\fP for all invocations.
1534
+ .INDENT 7.0
1535
+ .IP \(bu 2
1536
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_SVN_OPTIONS'\fI\%CTEST_SVN_OPTIONS\fP\X'tty: link'
1537
+ .IP \(bu 2
1538
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBCTEST_SVN_OPTIONS\fP
1539
+ .UNINDENT
1540
+ .TP
1541
+ .B \fBSVNUpdateOptions\fP
1542
+ Command\-line options to the \fBSVNCommand\fP when updating the source.
1543
+ .INDENT 7.0
1544
+ .IP \(bu 2
1545
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_SVN_UPDATE_OPTIONS'\fI\%CTEST_SVN_UPDATE_OPTIONS\fP\X'tty: link'
1546
+ .IP \(bu 2
1547
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBSVN_UPDATE_OPTIONS\fP
1548
+ .UNINDENT
1549
+ .TP
1550
+ .B \fBUpdateCommand\fP
1551
+ Specify the version\-control command\-line tool to use without
1552
+ detecting the VCS that manages the source tree.
1553
+ .INDENT 7.0
1554
+ .IP \(bu 2
1555
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_UPDATE_COMMAND'\fI\%CTEST_UPDATE_COMMAND\fP\X'tty: link'
1556
+ .IP \(bu 2
1557
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fB<VCS>COMMAND\fP
1558
+ when \fBUPDATE_TYPE\fP is \fB<vcs>\fP, else \fBUPDATE_COMMAND\fP
1559
+ .UNINDENT
1560
+ .TP
1561
+ .B \fBUpdateOptions\fP
1562
+ Command\-line options to the \fBUpdateCommand\fP\&.
1563
+ .INDENT 7.0
1564
+ .IP \(bu 2
1565
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_UPDATE_OPTIONS'\fI\%CTEST_UPDATE_OPTIONS\fP\X'tty: link'
1566
+ .IP \(bu 2
1567
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fB<VCS>_UPDATE_OPTIONS\fP
1568
+ when \fBUPDATE_TYPE\fP is \fB<vcs>\fP, else \fBUPDATE_OPTIONS\fP
1569
+ .UNINDENT
1570
+ .TP
1571
+ .B \fBUpdateType\fP
1572
+ Specify the version\-control system that manages the source
1573
+ tree if it cannot be detected automatically.
1574
+ The value may be \fBbzr\fP, \fBcvs\fP, \fBgit\fP, \fBhg\fP,
1575
+ \fBp4\fP, or \fBsvn\fP\&.
1576
+ .INDENT 7.0
1577
+ .IP \(bu 2
1578
+ \fI\%CTest Script\fP variable: none, detected from source tree
1579
+ .IP \(bu 2
1580
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBUPDATE_TYPE\fP if set,
1581
+ else \fBCTEST_UPDATE_TYPE\fP
1582
+ .UNINDENT
1583
+ .UNINDENT
1584
+ .INDENT 0.0
1585
+ .TP
1586
+ .B \fBUpdateVersionOnly\fP
1587
+ Specify that you want the version control update command to only
1588
+ discover the current version that is checked out, and not to update
1589
+ to a different version.
1590
+ .INDENT 7.0
1591
+ .IP \(bu 2
1592
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_UPDATE_VERSION_ONLY'\fI\%CTEST_UPDATE_VERSION_ONLY\fP\X'tty: link'
1593
+ .UNINDENT
1594
+ .UNINDENT
1595
+ .INDENT 0.0
1596
+ .TP
1597
+ .B \fBUpdateVersionOverride\fP
1598
+ Specify the current version of your source tree.
1599
+ .sp
1600
+ When this variable is set to a non\-empty string, CTest will report the value
1601
+ you specified rather than using the update command to discover the current
1602
+ version that is checked out. Use of this variable supersedes
1603
+ \fBUpdateVersionOnly\fP\&. Like \fBUpdateVersionOnly\fP, using this variable tells
1604
+ CTest not to update the source tree to a different version.
1605
+ .INDENT 7.0
1606
+ .IP \(bu 2
1607
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_UPDATE_VERSION_OVERRIDE'\fI\%CTEST_UPDATE_VERSION_OVERRIDE\fP\X'tty: link'
1608
+ .UNINDENT
1609
+ .UNINDENT
1610
+ .sp
1611
+ Additional configuration settings include:
1612
+ .INDENT 0.0
1613
+ .TP
1614
+ .B \fBNightlyStartTime\fP
1615
+ In the \fBNightly\fP dashboard mode, specify the \(dqnightly start time\(dq.
1616
+ With centralized version control systems (\fBcvs\fP and \fBsvn\fP),
1617
+ the \fBUpdate\fP step checks out the version of the software as of
1618
+ this time so that multiple clients choose a common version to test.
1619
+ This is not well\-defined in distributed version\-control systems so
1620
+ the setting is ignored.
1621
+ .INDENT 7.0
1622
+ .IP \(bu 2
1623
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_NIGHTLY_START_TIME'\fI\%CTEST_NIGHTLY_START_TIME\fP\X'tty: link'
1624
+ .IP \(bu 2
1625
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBNIGHTLY_START_TIME\fP if set,
1626
+ else \fBCTEST_NIGHTLY_START_TIME\fP
1627
+ .UNINDENT
1628
+ .UNINDENT
1629
+ .SS CTest Configure Step
1630
+ .sp
1631
+ In a \fI\%CTest Script\fP, the \X'tty: link #command:ctest_configure'\fI\%ctest_configure()\fP\X'tty: link' command runs this step.
1632
+ Arguments to the command may specify some of the step settings.
1633
+ .sp
1634
+ Configuration settings include:
1635
+ .INDENT 0.0
1636
+ .TP
1637
+ .B \fBConfigureCommand\fP
1638
+ Command\-line to launch the software configuration process.
1639
+ It will be executed in the location specified by the
1640
+ \fBBuildDirectory\fP setting.
1641
+ .INDENT 7.0
1642
+ .IP \(bu 2
1643
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_CONFIGURE_COMMAND'\fI\%CTEST_CONFIGURE_COMMAND\fP\X'tty: link'
1644
+ .IP \(bu 2
1645
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \X'tty: link #variable:CMAKE_COMMAND'\fI\%CMAKE_COMMAND\fP\X'tty: link'
1646
+ followed by \X'tty: link #variable:PROJECT_SOURCE_DIR'\fI\%PROJECT_SOURCE_DIR\fP\X'tty: link'
1647
+ .UNINDENT
1648
+ .TP
1649
+ .B \fBLabelsForSubprojects\fP
1650
+ Specify a semicolon\-separated list of labels that will be treated as
1651
+ subprojects. This mapping will be passed on to CDash when configure, test or
1652
+ build results are submitted.
1653
+ .INDENT 7.0
1654
+ .IP \(bu 2
1655
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_LABELS_FOR_SUBPROJECTS'\fI\%CTEST_LABELS_FOR_SUBPROJECTS\fP\X'tty: link'
1656
+ .IP \(bu 2
1657
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBCTEST_LABELS_FOR_SUBPROJECTS\fP
1658
+ .UNINDENT
1659
+ .sp
1660
+ See \fI\%Label and Subproject Summary\fP\&.
1661
+ .UNINDENT
1662
+ .SS CTest Build Step
1663
+ .sp
1664
+ In a \fI\%CTest Script\fP, the \X'tty: link #command:ctest_build'\fI\%ctest_build()\fP\X'tty: link' command runs this step.
1665
+ Arguments to the command may specify some of the step settings.
1666
+ .sp
1667
+ Configuration settings include:
1668
+ .INDENT 0.0
1669
+ .TP
1670
+ .B \fBDefaultCTestConfigurationType\fP
1671
+ When the build system to be launched allows build\-time selection
1672
+ of the configuration (e.g. \fBDebug\fP, \fBRelease\fP), this specifies
1673
+ the default configuration to be built when no \fI\%\-C\fP
1674
+ option is given to the \fBctest\fP command. The value will be substituted
1675
+ into the value of \fBMakeCommand\fP to replace the literal string
1676
+ \fB${CTEST_CONFIGURATION_TYPE}\fP if it appears.
1677
+ .INDENT 7.0
1678
+ .IP \(bu 2
1679
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_CONFIGURATION_TYPE'\fI\%CTEST_CONFIGURATION_TYPE\fP\X'tty: link'
1680
+ .IP \(bu 2
1681
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBDEFAULT_CTEST_CONFIGURATION_TYPE\fP,
1682
+ initialized by the \X'tty: link #envvar:CMAKE_CONFIG_TYPE'\fI\%CMAKE_CONFIG_TYPE\fP\X'tty: link' environment variable
1683
+ .UNINDENT
1684
+ .TP
1685
+ .B \fBLabelsForSubprojects\fP
1686
+ Specify a semicolon\-separated list of labels that will be treated as
1687
+ subprojects. This mapping will be passed on to CDash when configure, test or
1688
+ build results are submitted.
1689
+ .INDENT 7.0
1690
+ .IP \(bu 2
1691
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_LABELS_FOR_SUBPROJECTS'\fI\%CTEST_LABELS_FOR_SUBPROJECTS\fP\X'tty: link'
1692
+ .IP \(bu 2
1693
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBCTEST_LABELS_FOR_SUBPROJECTS\fP
1694
+ .UNINDENT
1695
+ .sp
1696
+ See \fI\%Label and Subproject Summary\fP\&.
1697
+ .TP
1698
+ .B \fBMakeCommand\fP
1699
+ Command\-line to launch the software build process.
1700
+ It will be executed in the location specified by the
1701
+ \fBBuildDirectory\fP setting.
1702
+ .INDENT 7.0
1703
+ .IP \(bu 2
1704
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_BUILD_COMMAND'\fI\%CTEST_BUILD_COMMAND\fP\X'tty: link'
1705
+ .IP \(bu 2
1706
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBMAKECOMMAND\fP,
1707
+ initialized by the \X'tty: link #command:build_command'\fI\%build_command()\fP\X'tty: link' command
1708
+ .UNINDENT
1709
+ .TP
1710
+ .B \fBUseLaunchers\fP
1711
+ For build trees generated by CMake using one of the
1712
+ \X'tty: link #makefile-generators'\fI\%Makefile Generators\fP\X'tty: link' or the \X'tty: link #generator:Ninja'\fI\%Ninja\fP\X'tty: link'
1713
+ generator, specify whether the
1714
+ \fBCTEST_USE_LAUNCHERS\fP feature is enabled by the
1715
+ \X'tty: link #module:CTestUseLaunchers'\fI\%CTestUseLaunchers\fP\X'tty: link' module (also included by the
1716
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module). When enabled, the generated build
1717
+ system wraps each invocation of the compiler, linker, or
1718
+ custom command line with a \(dqlauncher\(dq that communicates
1719
+ with CTest via environment variables and files to report
1720
+ granular build warning and error information. Otherwise,
1721
+ CTest must \(dqscrape\(dq the build output log for diagnostics.
1722
+ .INDENT 7.0
1723
+ .IP \(bu 2
1724
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_USE_LAUNCHERS'\fI\%CTEST_USE_LAUNCHERS\fP\X'tty: link'
1725
+ .IP \(bu 2
1726
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBCTEST_USE_LAUNCHERS\fP
1727
+ .UNINDENT
1728
+ .UNINDENT
1729
+ .SS CTest Test Step
1730
+ .sp
1731
+ In a \fI\%CTest Script\fP, the \X'tty: link #command:ctest_test'\fI\%ctest_test()\fP\X'tty: link' command runs this step.
1732
+ Arguments to the command may specify some of the step settings.
1733
+ .sp
1734
+ Configuration settings include:
1735
+ .INDENT 0.0
1736
+ .TP
1737
+ .B \fBResourceSpecFile\fP
1738
+ Specify a
1739
+ \fI\%resource specification file\fP\&.
1740
+ .INDENT 7.0
1741
+ .IP \(bu 2
1742
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_RESOURCE_SPEC_FILE'\fI\%CTEST_RESOURCE_SPEC_FILE\fP\X'tty: link'
1743
+ .IP \(bu 2
1744
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBCTEST_RESOURCE_SPEC_FILE\fP
1745
+ .UNINDENT
1746
+ .sp
1747
+ See \fI\%Resource Allocation\fP for more information.
1748
+ .TP
1749
+ .B \fBLabelsForSubprojects\fP
1750
+ Specify a semicolon\-separated list of labels that will be treated as
1751
+ subprojects. This mapping will be passed on to CDash when configure, test or
1752
+ build results are submitted.
1753
+ .INDENT 7.0
1754
+ .IP \(bu 2
1755
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_LABELS_FOR_SUBPROJECTS'\fI\%CTEST_LABELS_FOR_SUBPROJECTS\fP\X'tty: link'
1756
+ .IP \(bu 2
1757
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBCTEST_LABELS_FOR_SUBPROJECTS\fP
1758
+ .UNINDENT
1759
+ .sp
1760
+ See \fI\%Label and Subproject Summary\fP\&.
1761
+ .TP
1762
+ .B \fBTestLoad\fP
1763
+ While running tests in parallel (e.g. with \fI\%\-j\fP),
1764
+ try not to start tests when they may cause the CPU load to pass above
1765
+ a given threshold.
1766
+ .INDENT 7.0
1767
+ .IP \(bu 2
1768
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_TEST_LOAD'\fI\%CTEST_TEST_LOAD\fP\X'tty: link'
1769
+ .IP \(bu 2
1770
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBCTEST_TEST_LOAD\fP
1771
+ .UNINDENT
1772
+ .TP
1773
+ .B \fBTimeOut\fP
1774
+ The default timeout for each test if not specified by the
1775
+ \X'tty: link #prop_test:TIMEOUT'\fI\%TIMEOUT\fP\X'tty: link' test property or the
1776
+ \fI\%\-\-timeout\fP flag.
1777
+ .INDENT 7.0
1778
+ .IP \(bu 2
1779
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_TEST_TIMEOUT'\fI\%CTEST_TEST_TIMEOUT\fP\X'tty: link'
1780
+ .IP \(bu 2
1781
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBDART_TESTING_TIMEOUT\fP
1782
+ .UNINDENT
1783
+ .UNINDENT
1784
+ .sp
1785
+ To report extra test values to CDash, see \X'tty: link #additional-test-measurements'\fI\%Additional Test Measurements\fP\X'tty: link'\&.
1786
+ .SS CTest Coverage Step
1787
+ .sp
1788
+ In a \fI\%CTest Script\fP, the \X'tty: link #command:ctest_coverage'\fI\%ctest_coverage()\fP\X'tty: link' command runs this step.
1789
+ Arguments to the command may specify some of the step settings.
1790
+ .sp
1791
+ Configuration settings include:
1792
+ .INDENT 0.0
1793
+ .TP
1794
+ .B \fBCoverageCommand\fP
1795
+ Command\-line tool to perform software coverage analysis.
1796
+ It will be executed in the location specified by the
1797
+ \fBBuildDirectory\fP setting.
1798
+ .INDENT 7.0
1799
+ .IP \(bu 2
1800
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_COVERAGE_COMMAND'\fI\%CTEST_COVERAGE_COMMAND\fP\X'tty: link'
1801
+ .IP \(bu 2
1802
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBCOVERAGE_COMMAND\fP
1803
+ .UNINDENT
1804
+ .TP
1805
+ .B \fBCoverageExtraFlags\fP
1806
+ Specify command\-line options to the \fBCoverageCommand\fP tool.
1807
+ .INDENT 7.0
1808
+ .IP \(bu 2
1809
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_COVERAGE_EXTRA_FLAGS'\fI\%CTEST_COVERAGE_EXTRA_FLAGS\fP\X'tty: link'
1810
+ .IP \(bu 2
1811
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBCOVERAGE_EXTRA_FLAGS\fP
1812
+ .UNINDENT
1813
+ .sp
1814
+ These options are the first arguments passed to \fBCoverageCommand\fP\&.
1815
+ .UNINDENT
1816
+ .SS CTest MemCheck Step
1817
+ .sp
1818
+ In a \fI\%CTest Script\fP, the \X'tty: link #command:ctest_memcheck'\fI\%ctest_memcheck()\fP\X'tty: link' command runs this step.
1819
+ Arguments to the command may specify some of the step settings.
1820
+ .sp
1821
+ Configuration settings include:
1822
+ .INDENT 0.0
1823
+ .TP
1824
+ .B \fBMemoryCheckCommand\fP
1825
+ Command\-line tool to perform dynamic analysis. Test command lines
1826
+ will be launched through this tool.
1827
+ .INDENT 7.0
1828
+ .IP \(bu 2
1829
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_MEMORYCHECK_COMMAND'\fI\%CTEST_MEMORYCHECK_COMMAND\fP\X'tty: link'
1830
+ .IP \(bu 2
1831
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBMEMORYCHECK_COMMAND\fP
1832
+ .UNINDENT
1833
+ .TP
1834
+ .B \fBMemoryCheckCommandOptions\fP
1835
+ Specify command\-line options to the \fBMemoryCheckCommand\fP tool.
1836
+ They will be placed prior to the test command line.
1837
+ .INDENT 7.0
1838
+ .IP \(bu 2
1839
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_MEMORYCHECK_COMMAND_OPTIONS'\fI\%CTEST_MEMORYCHECK_COMMAND_OPTIONS\fP\X'tty: link'
1840
+ .IP \(bu 2
1841
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBMEMORYCHECK_COMMAND_OPTIONS\fP
1842
+ .UNINDENT
1843
+ .TP
1844
+ .B \fBMemoryCheckType\fP
1845
+ Specify the type of memory checking to perform.
1846
+ .INDENT 7.0
1847
+ .IP \(bu 2
1848
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_MEMORYCHECK_TYPE'\fI\%CTEST_MEMORYCHECK_TYPE\fP\X'tty: link'
1849
+ .IP \(bu 2
1850
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBMEMORYCHECK_TYPE\fP
1851
+ .UNINDENT
1852
+ .TP
1853
+ .B \fBMemoryCheckSanitizerOptions\fP
1854
+ Specify options to sanitizers when running with a sanitize\-enabled build.
1855
+ .INDENT 7.0
1856
+ .IP \(bu 2
1857
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_MEMORYCHECK_SANITIZER_OPTIONS'\fI\%CTEST_MEMORYCHECK_SANITIZER_OPTIONS\fP\X'tty: link'
1858
+ .IP \(bu 2
1859
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBMEMORYCHECK_SANITIZER_OPTIONS\fP
1860
+ .UNINDENT
1861
+ .TP
1862
+ .B \fBMemoryCheckSuppressionFile\fP
1863
+ Specify a file containing suppression rules for the
1864
+ \fBMemoryCheckCommand\fP tool. It will be passed with options
1865
+ appropriate to the tool.
1866
+ .INDENT 7.0
1867
+ .IP \(bu 2
1868
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_MEMORYCHECK_SUPPRESSIONS_FILE'\fI\%CTEST_MEMORYCHECK_SUPPRESSIONS_FILE\fP\X'tty: link'
1869
+ .IP \(bu 2
1870
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBMEMORYCHECK_SUPPRESSIONS_FILE\fP
1871
+ .UNINDENT
1872
+ .UNINDENT
1873
+ .sp
1874
+ Additional configuration settings include:
1875
+ .INDENT 0.0
1876
+ .TP
1877
+ .B \fBBoundsCheckerCommand\fP
1878
+ Specify a \fBMemoryCheckCommand\fP that is known to be command\-line
1879
+ compatible with Bounds Checker.
1880
+ .INDENT 7.0
1881
+ .IP \(bu 2
1882
+ \fI\%CTest Script\fP variable: none
1883
+ .IP \(bu 2
1884
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: none
1885
+ .UNINDENT
1886
+ .TP
1887
+ .B \fBPurifyCommand\fP
1888
+ Specify a \fBMemoryCheckCommand\fP that is known to be command\-line
1889
+ compatible with Purify.
1890
+ .INDENT 7.0
1891
+ .IP \(bu 2
1892
+ \fI\%CTest Script\fP variable: none
1893
+ .IP \(bu 2
1894
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBPURIFYCOMMAND\fP
1895
+ .UNINDENT
1896
+ .TP
1897
+ .B \fBValgrindCommand\fP
1898
+ Specify a \fBMemoryCheckCommand\fP that is known to be command\-line
1899
+ compatible with Valgrind.
1900
+ .INDENT 7.0
1901
+ .IP \(bu 2
1902
+ \fI\%CTest Script\fP variable: none
1903
+ .IP \(bu 2
1904
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBVALGRIND_COMMAND\fP
1905
+ .UNINDENT
1906
+ .TP
1907
+ .B \fBValgrindCommandOptions\fP
1908
+ Specify command\-line options to the \fBValgrindCommand\fP tool.
1909
+ They will be placed prior to the test command line.
1910
+ .INDENT 7.0
1911
+ .IP \(bu 2
1912
+ \fI\%CTest Script\fP variable: none
1913
+ .IP \(bu 2
1914
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBVALGRIND_COMMAND_OPTIONS\fP
1915
+ .UNINDENT
1916
+ .TP
1917
+ .B \fBDrMemoryCommand\fP
1918
+ Specify a \fBMemoryCheckCommand\fP that is known to be a command\-line
1919
+ compatible with DrMemory.
1920
+ .INDENT 7.0
1921
+ .IP \(bu 2
1922
+ \fI\%CTest Script\fP variable: none
1923
+ .IP \(bu 2
1924
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBDRMEMORY_COMMAND\fP
1925
+ .UNINDENT
1926
+ .TP
1927
+ .B \fBDrMemoryCommandOptions\fP
1928
+ Specify command\-line options to the \fBDrMemoryCommand\fP tool.
1929
+ They will be placed prior to the test command line.
1930
+ .INDENT 7.0
1931
+ .IP \(bu 2
1932
+ \fI\%CTest Script\fP variable: none
1933
+ .IP \(bu 2
1934
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBDRMEMORY_COMMAND_OPTIONS\fP
1935
+ .UNINDENT
1936
+ .TP
1937
+ .B \fBCudaSanitizerCommand\fP
1938
+ Specify a \fBMemoryCheckCommand\fP that is known to be a command\-line
1939
+ compatible with cuda\-memcheck or compute\-sanitizer.
1940
+ .INDENT 7.0
1941
+ .IP \(bu 2
1942
+ \fI\%CTest Script\fP variable: none
1943
+ .IP \(bu 2
1944
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBCUDA_SANITIZER_COMMAND\fP
1945
+ .UNINDENT
1946
+ .TP
1947
+ .B \fBCudaSanitizerCommandOptions\fP
1948
+ Specify command\-line options to the \fBCudaSanitizerCommand\fP tool.
1949
+ They will be placed prior to the test command line.
1950
+ .INDENT 7.0
1951
+ .IP \(bu 2
1952
+ \fI\%CTest Script\fP variable: none
1953
+ .IP \(bu 2
1954
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBCUDA_SANITIZER_COMMAND_OPTIONS\fP
1955
+ .UNINDENT
1956
+ .UNINDENT
1957
+ .SS CTest Submit Step
1958
+ .sp
1959
+ In a \fI\%CTest Script\fP, the \X'tty: link #command:ctest_submit'\fI\%ctest_submit()\fP\X'tty: link' command runs this step.
1960
+ Arguments to the command may specify some of the step settings.
1961
+ .sp
1962
+ Configuration settings include:
1963
+ .INDENT 0.0
1964
+ .TP
1965
+ .B \fBBuildName\fP
1966
+ Describe the dashboard client platform with a short string.
1967
+ (Operating system, compiler, etc.)
1968
+ .INDENT 7.0
1969
+ .IP \(bu 2
1970
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_BUILD_NAME'\fI\%CTEST_BUILD_NAME\fP\X'tty: link'
1971
+ .IP \(bu 2
1972
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBBUILDNAME\fP
1973
+ .UNINDENT
1974
+ .TP
1975
+ .B \fBCDashVersion\fP
1976
+ Legacy option. Not used.
1977
+ .INDENT 7.0
1978
+ .IP \(bu 2
1979
+ \fI\%CTest Script\fP variable: none, detected from server
1980
+ .IP \(bu 2
1981
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBCTEST_CDASH_VERSION\fP
1982
+ .UNINDENT
1983
+ .TP
1984
+ .B \fBCTestSubmitRetryCount\fP
1985
+ Specify a number of attempts to retry submission on network failure.
1986
+ .INDENT 7.0
1987
+ .IP \(bu 2
1988
+ \fI\%CTest Script\fP variable: none,
1989
+ use the \X'tty: link #command:ctest_submit'\fI\%ctest_submit()\fP\X'tty: link' \fBRETRY_COUNT\fP option.
1990
+ .IP \(bu 2
1991
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBCTEST_SUBMIT_RETRY_COUNT\fP
1992
+ .UNINDENT
1993
+ .TP
1994
+ .B \fBCTestSubmitRetryDelay\fP
1995
+ Specify a delay before retrying submission on network failure.
1996
+ .INDENT 7.0
1997
+ .IP \(bu 2
1998
+ \fI\%CTest Script\fP variable: none,
1999
+ use the \X'tty: link #command:ctest_submit'\fI\%ctest_submit()\fP\X'tty: link' \fBRETRY_DELAY\fP option.
2000
+ .IP \(bu 2
2001
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBCTEST_SUBMIT_RETRY_DELAY\fP
2002
+ .UNINDENT
2003
+ .TP
2004
+ .B \fBCurlOptions\fP
2005
+ Deprecated since version 3.30: Use \fBTLSVerify\fP instead.
2006
+
2007
+ .sp
2008
+ Specify a semicolon\-separated list of options to control the
2009
+ Curl library that CTest uses internally to connect to the
2010
+ server.
2011
+ .INDENT 7.0
2012
+ .IP \(bu 2
2013
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_CURL_OPTIONS'\fI\%CTEST_CURL_OPTIONS\fP\X'tty: link'
2014
+ .IP \(bu 2
2015
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBCTEST_CURL_OPTIONS\fP
2016
+ .UNINDENT
2017
+ .sp
2018
+ Possible options are:
2019
+ .INDENT 7.0
2020
+ .TP
2021
+ .B \fBCURLOPT_SSL_VERIFYPEER_OFF\fP
2022
+ Disable the \fBCURLOPT_SSL_VERIFYPEER\fP curl option.
2023
+ .TP
2024
+ .B \fBCURLOPT_SSL_VERIFYHOST_OFF\fP
2025
+ Disable the \fBCURLOPT_SSL_VERIFYHOST\fP curl option.
2026
+ .UNINDENT
2027
+ .TP
2028
+ .B \fBDropLocation\fP
2029
+ Legacy option. When \fBSubmitURL\fP is not set, it is constructed from
2030
+ \fBDropMethod\fP, \fBDropSiteUser\fP, \fBDropSitePassword\fP, \fBDropSite\fP, and
2031
+ \fBDropLocation\fP\&.
2032
+ .INDENT 7.0
2033
+ .IP \(bu 2
2034
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_DROP_LOCATION'\fI\%CTEST_DROP_LOCATION\fP\X'tty: link'
2035
+ .IP \(bu 2
2036
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBDROP_LOCATION\fP if set,
2037
+ else \fBCTEST_DROP_LOCATION\fP
2038
+ .UNINDENT
2039
+ .TP
2040
+ .B \fBDropMethod\fP
2041
+ Legacy option. When \fBSubmitURL\fP is not set, it is constructed from
2042
+ \fBDropMethod\fP, \fBDropSiteUser\fP, \fBDropSitePassword\fP, \fBDropSite\fP, and
2043
+ \fBDropLocation\fP\&.
2044
+ .INDENT 7.0
2045
+ .IP \(bu 2
2046
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_DROP_METHOD'\fI\%CTEST_DROP_METHOD\fP\X'tty: link'
2047
+ .IP \(bu 2
2048
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBDROP_METHOD\fP if set,
2049
+ else \fBCTEST_DROP_METHOD\fP
2050
+ .UNINDENT
2051
+ .TP
2052
+ .B \fBDropSite\fP
2053
+ Legacy option. When \fBSubmitURL\fP is not set, it is constructed from
2054
+ \fBDropMethod\fP, \fBDropSiteUser\fP, \fBDropSitePassword\fP, \fBDropSite\fP, and
2055
+ \fBDropLocation\fP\&.
2056
+ .INDENT 7.0
2057
+ .IP \(bu 2
2058
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_DROP_SITE'\fI\%CTEST_DROP_SITE\fP\X'tty: link'
2059
+ .IP \(bu 2
2060
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBDROP_SITE\fP if set,
2061
+ else \fBCTEST_DROP_SITE\fP
2062
+ .UNINDENT
2063
+ .TP
2064
+ .B \fBDropSitePassword\fP
2065
+ Legacy option. When \fBSubmitURL\fP is not set, it is constructed from
2066
+ \fBDropMethod\fP, \fBDropSiteUser\fP, \fBDropSitePassword\fP, \fBDropSite\fP, and
2067
+ \fBDropLocation\fP\&.
2068
+ .INDENT 7.0
2069
+ .IP \(bu 2
2070
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_DROP_SITE_PASSWORD'\fI\%CTEST_DROP_SITE_PASSWORD\fP\X'tty: link'
2071
+ .IP \(bu 2
2072
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBDROP_SITE_PASSWORD\fP if set,
2073
+ else \fBCTEST_DROP_SITE_PASWORD\fP
2074
+ .UNINDENT
2075
+ .TP
2076
+ .B \fBDropSiteUser\fP
2077
+ Legacy option. When \fBSubmitURL\fP is not set, it is constructed from
2078
+ \fBDropMethod\fP, \fBDropSiteUser\fP, \fBDropSitePassword\fP, \fBDropSite\fP, and
2079
+ \fBDropLocation\fP\&.
2080
+ .INDENT 7.0
2081
+ .IP \(bu 2
2082
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_DROP_SITE_USER'\fI\%CTEST_DROP_SITE_USER\fP\X'tty: link'
2083
+ .IP \(bu 2
2084
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBDROP_SITE_USER\fP if set,
2085
+ else \fBCTEST_DROP_SITE_USER\fP
2086
+ .UNINDENT
2087
+ .TP
2088
+ .B \fBIsCDash\fP
2089
+ Legacy option. Not used.
2090
+ .INDENT 7.0
2091
+ .IP \(bu 2
2092
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_DROP_SITE_CDASH'\fI\%CTEST_DROP_SITE_CDASH\fP\X'tty: link'
2093
+ .IP \(bu 2
2094
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBCTEST_DROP_SITE_CDASH\fP
2095
+ .UNINDENT
2096
+ .TP
2097
+ .B \fBScpCommand\fP
2098
+ Legacy option. Not used.
2099
+ .INDENT 7.0
2100
+ .IP \(bu 2
2101
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_SCP_COMMAND'\fI\%CTEST_SCP_COMMAND\fP\X'tty: link'
2102
+ .IP \(bu 2
2103
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBSCPCOMMAND\fP
2104
+ .UNINDENT
2105
+ .TP
2106
+ .B \fBSite\fP
2107
+ Describe the dashboard client host site with a short string.
2108
+ (Hostname, domain, etc.)
2109
+ .INDENT 7.0
2110
+ .IP \(bu 2
2111
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_SITE'\fI\%CTEST_SITE\fP\X'tty: link'
2112
+ .IP \(bu 2
2113
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBSITE\fP,
2114
+ initialized by the \X'tty: link #command:site_name'\fI\%site_name()\fP\X'tty: link' command
2115
+ .UNINDENT
2116
+ .TP
2117
+ .B \fBSubmitURL\fP
2118
+ The \fBhttp\fP or \fBhttps\fP URL of the dashboard server to send the submission
2119
+ to.
2120
+ .INDENT 7.0
2121
+ .IP \(bu 2
2122
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_SUBMIT_URL'\fI\%CTEST_SUBMIT_URL\fP\X'tty: link'
2123
+ .IP \(bu 2
2124
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBSUBMIT_URL\fP if set,
2125
+ else \fBCTEST_SUBMIT_URL\fP
2126
+ .UNINDENT
2127
+ .TP
2128
+ .B \fBSubmitInactivityTimeout\fP
2129
+ The time to wait for the submission after which it is canceled
2130
+ if not completed. Specify a zero value to disable timeout.
2131
+ .INDENT 7.0
2132
+ .IP \(bu 2
2133
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_SUBMIT_INACTIVITY_TIMEOUT'\fI\%CTEST_SUBMIT_INACTIVITY_TIMEOUT\fP\X'tty: link'
2134
+ .IP \(bu 2
2135
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBCTEST_SUBMIT_INACTIVITY_TIMEOUT\fP
2136
+ .UNINDENT
2137
+ .TP
2138
+ .B \fBTLSVersion\fP
2139
+ Added in version 3.30.
2140
+
2141
+ .sp
2142
+ Specify a minimum TLS version allowed when submitting to a dashboard
2143
+ via \fBhttps://\fP URLs.
2144
+ .INDENT 7.0
2145
+ .IP \(bu 2
2146
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_TLS_VERSION'\fI\%CTEST_TLS_VERSION\fP\X'tty: link'
2147
+ .IP \(bu 2
2148
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBCTEST_TLS_VERSION\fP
2149
+ .UNINDENT
2150
+ .sp
2151
+ Changed in version 3.31: The default is TLS 1.2.
2152
+ Previously, no minimum version was enforced by default.
2153
+
2154
+ .TP
2155
+ .B \fBTLSVerify\fP
2156
+ Added in version 3.30.
2157
+
2158
+ .sp
2159
+ Specify a boolean value indicating whether to verify the server
2160
+ certificate when submitting to a dashboard via \fBhttps://\fP URLs.
2161
+ .INDENT 7.0
2162
+ .IP \(bu 2
2163
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_TLS_VERIFY'\fI\%CTEST_TLS_VERIFY\fP\X'tty: link'
2164
+ .IP \(bu 2
2165
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBCTEST_TLS_VERIFY\fP
2166
+ .UNINDENT
2167
+ .sp
2168
+ Changed in version 3.31: The default is on. Previously, the default was off.
2169
+ Users may set the \X'tty: link #envvar:CMAKE_TLS_VERIFY'\fI\%CMAKE_TLS_VERIFY\fP\X'tty: link' environment
2170
+ variable to \fB0\fP to restore the old default.
2171
+
2172
+ .TP
2173
+ .B \fBTriggerSite\fP
2174
+ Legacy option. Not used.
2175
+ .INDENT 7.0
2176
+ .IP \(bu 2
2177
+ \fI\%CTest Script\fP variable: \X'tty: link #variable:CTEST_TRIGGER_SITE'\fI\%CTEST_TRIGGER_SITE\fP\X'tty: link'
2178
+ .IP \(bu 2
2179
+ \X'tty: link #module:CTest'\fI\%CTest\fP\X'tty: link' module variable: \fBTRIGGER_SITE\fP if set,
2180
+ else \fBCTEST_TRIGGER_SITE\fP
2181
+ .UNINDENT
2182
+ .UNINDENT
2183
+ .SH SHOW AS JSON OBJECT MODEL
2184
+ .sp
2185
+ Added in version 3.14.
2186
+
2187
+ .sp
2188
+ When the \fB\-\-show\-only=json\-v1\fP command line option is given, the test
2189
+ information is output in JSON format. Version 1.0 of the JSON object
2190
+ model is defined as follows:
2191
+ .INDENT 0.0
2192
+ .TP
2193
+ .B \fBkind\fP
2194
+ The string \(dqctestInfo\(dq.
2195
+ .TP
2196
+ .B \fBversion\fP
2197
+ A JSON object specifying the version components. Its members are
2198
+ .INDENT 7.0
2199
+ .TP
2200
+ .B \fBmajor\fP
2201
+ A non\-negative integer specifying the major version component.
2202
+ .TP
2203
+ .B \fBminor\fP
2204
+ A non\-negative integer specifying the minor version component.
2205
+ .UNINDENT
2206
+ .TP
2207
+ .B \fBbacktraceGraph\fP
2208
+ JSON object representing backtrace information with the
2209
+ following members:
2210
+ .INDENT 7.0
2211
+ .TP
2212
+ .B \fBcommands\fP
2213
+ List of command names.
2214
+ .TP
2215
+ .B \fBfiles\fP
2216
+ List of file names.
2217
+ .TP
2218
+ .B \fBnodes\fP
2219
+ List of node JSON objects with members:
2220
+ .INDENT 7.0
2221
+ .TP
2222
+ .B \fBcommand\fP
2223
+ Index into the \fBcommands\fP member of the \fBbacktraceGraph\fP\&.
2224
+ .TP
2225
+ .B \fBfile\fP
2226
+ Index into the \fBfiles\fP member of the \fBbacktraceGraph\fP\&.
2227
+ .TP
2228
+ .B \fBline\fP
2229
+ Line number in the file where the backtrace was added.
2230
+ .TP
2231
+ .B \fBparent\fP
2232
+ Index into the \fBnodes\fP member of the \fBbacktraceGraph\fP
2233
+ representing the parent in the graph.
2234
+ .UNINDENT
2235
+ .UNINDENT
2236
+ .TP
2237
+ .B \fBtests\fP
2238
+ A JSON array listing information about each test. Each entry
2239
+ is a JSON object with members:
2240
+ .INDENT 7.0
2241
+ .TP
2242
+ .B \fBname\fP
2243
+ Test name.
2244
+ .TP
2245
+ .B \fBconfig\fP
2246
+ Configuration that the test can run on.
2247
+ Empty string means any config.
2248
+ .TP
2249
+ .B \fBcommand\fP
2250
+ List where the first element is the test command and the
2251
+ remaining elements are the command arguments.
2252
+ .TP
2253
+ .B \fBbacktrace\fP
2254
+ Index into the \fBnodes\fP member of the \fBbacktraceGraph\fP\&.
2255
+ .TP
2256
+ .B \fBproperties\fP
2257
+ Test properties.
2258
+ Can contain keys for each of the supported test properties.
2259
+ .UNINDENT
2260
+ .UNINDENT
2261
+ .SH RESOURCE ALLOCATION
2262
+ .sp
2263
+ CTest provides a mechanism for tests to specify the resources that they need
2264
+ in a fine\-grained way, and for users to specify the resources available on
2265
+ the running machine. This allows CTest to internally keep track of which
2266
+ resources are in use and which are free, scheduling tests in a way that
2267
+ prevents them from trying to claim resources that are not available.
2268
+ .sp
2269
+ When the resource allocation feature is used, CTest will not oversubscribe
2270
+ resources. For example, if a resource has 8 slots, CTest will not run tests
2271
+ that collectively use more than 8 slots at a time. This has the effect of
2272
+ limiting how many tests can run at any given time, even if a high \fB\-j\fP
2273
+ argument is used, if those tests all use some slots from the same resource.
2274
+ In addition, it means that a single test that uses more of a resource than is
2275
+ available on a machine will not run at all (and will be reported as
2276
+ \fBNot Run\fP).
2277
+ .sp
2278
+ A common use case for this feature is for tests that require the use of a GPU.
2279
+ Multiple tests can simultaneously allocate memory from a GPU, but if too many
2280
+ tests try to do this at once, some of them will fail to allocate, resulting in
2281
+ a failed test, even though the test would have succeeded if it had the memory
2282
+ it needed. By using the resource allocation feature, each test can specify how
2283
+ much memory it requires from a GPU, allowing CTest to schedule tests in a way
2284
+ that running several of these tests at once does not exhaust the GPU\(aqs memory
2285
+ pool.
2286
+ .sp
2287
+ Please note that CTest has no concept of what a GPU is or how much memory it
2288
+ has. It does not have any way of communicating with a GPU to retrieve this
2289
+ information or perform any memory management, although the project can define
2290
+ a test that provides details about the test machine (see
2291
+ \fI\%Dynamically\-Generated Resource Specification File\fP).
2292
+ .sp
2293
+ CTest keeps track of a list of abstract resource types, each of which has a
2294
+ certain number of slots available for tests to use. Each test specifies the
2295
+ number of slots that it requires from a certain resource, and CTest then
2296
+ schedules them in a way that prevents the total number of slots in use from
2297
+ exceeding the listed capacity. When a test is executed, and slots from a
2298
+ resource are allocated to that test, tests may assume that they have exclusive
2299
+ use of those slots for the duration of the test\(aqs process.
2300
+ .sp
2301
+ The CTest resource allocation feature consists of at least two inputs:
2302
+ .INDENT 0.0
2303
+ .IP \(bu 2
2304
+ The \fI\%resource specification file\fP,
2305
+ described below, which describes the resources available on the system.
2306
+ .IP \(bu 2
2307
+ The \X'tty: link #prop_test:RESOURCE_GROUPS'\fI\%RESOURCE_GROUPS\fP\X'tty: link' property of tests, which describes the
2308
+ resources required by the test.
2309
+ .UNINDENT
2310
+ .sp
2311
+ When CTest runs a test, the resources allocated to that test are passed in the
2312
+ form of a set of
2313
+ \fI\%environment variables\fP as
2314
+ described below. Using this information to decide which resource to connect to
2315
+ is left to the test writer.
2316
+ .sp
2317
+ The \fBRESOURCE_GROUPS\fP property tells CTest what resources a test expects
2318
+ to use grouped in a way meaningful to the test. The test itself must read
2319
+ the \fI\%environment variables\fP to
2320
+ determine which resources have been allocated to each group. For example,
2321
+ each group may correspond to a process the test will spawn when executed.
2322
+ .sp
2323
+ Note that even if a test specifies a \fBRESOURCE_GROUPS\fP property, it is still
2324
+ possible for that to test to run without any resource allocation (and without
2325
+ the corresponding
2326
+ \fI\%environment variables\fP)
2327
+ if the user does not pass a resource specification file. Passing this file,
2328
+ either through the \fB\-\-resource\-spec\-file\fP command\-line argument or the
2329
+ \fBRESOURCE_SPEC_FILE\fP argument to \X'tty: link #command:ctest_test'\fI\%ctest_test()\fP\X'tty: link', is what activates the
2330
+ resource allocation feature. Tests should check the
2331
+ \fBCTEST_RESOURCE_GROUP_COUNT\fP environment variable to find out whether or not
2332
+ resource allocation is activated. This variable will always (and only) be
2333
+ defined if resource allocation is activated. If resource allocation is not
2334
+ activated, then the \fBCTEST_RESOURCE_GROUP_COUNT\fP variable will not exist,
2335
+ even if it exists for the parent \fBctest\fP process. If a test absolutely must
2336
+ have resource allocation, then it can return a failing exit code or use the
2337
+ \X'tty: link #prop_test:SKIP_RETURN_CODE'\fI\%SKIP_RETURN_CODE\fP\X'tty: link' or \X'tty: link #prop_test:SKIP_REGULAR_EXPRESSION'\fI\%SKIP_REGULAR_EXPRESSION\fP\X'tty: link'
2338
+ properties to indicate a skipped test.
2339
+ .SS Resource Specification File
2340
+ .sp
2341
+ The resource specification file is a JSON file which is passed to CTest in one
2342
+ of a number of ways. It can be specified on the command line with the
2343
+ \fI\%ctest \-\-resource\-spec\-file\fP option, it can be given using the
2344
+ \fBRESOURCE_SPEC_FILE\fP argument of \X'tty: link #command:ctest_test'\fI\%ctest_test()\fP\X'tty: link', or it can be
2345
+ generated dynamically as part of test execution (see
2346
+ \fI\%Dynamically\-Generated Resource Specification File\fP).
2347
+ .sp
2348
+ If a dashboard script is used and \fBRESOURCE_SPEC_FILE\fP is not specified, the
2349
+ value of \X'tty: link #variable:CTEST_RESOURCE_SPEC_FILE'\fI\%CTEST_RESOURCE_SPEC_FILE\fP\X'tty: link' in the dashboard script is used
2350
+ instead. If \fI\%\-\-resource\-spec\-file\fP,
2351
+ \fBRESOURCE_SPEC_FILE\fP, and \X'tty: link #variable:CTEST_RESOURCE_SPEC_FILE'\fI\%CTEST_RESOURCE_SPEC_FILE\fP\X'tty: link' in the
2352
+ dashboard script are not specified, the value of
2353
+ \X'tty: link #variable:CTEST_RESOURCE_SPEC_FILE'\fI\%CTEST_RESOURCE_SPEC_FILE\fP\X'tty: link' in the CMake build is used instead.
2354
+ If none of these are specified, no resource spec file is used.
2355
+ .sp
2356
+ The resource specification file must be a JSON object. All examples in this
2357
+ document assume the following resource specification file:
2358
+ .INDENT 0.0
2359
+ .INDENT 3.5
2360
+ .sp
2361
+ .nf
2362
+ .ft C
2363
+ {
2364
+ \(dqversion\(dq: {
2365
+ \(dqmajor\(dq: 1,
2366
+ \(dqminor\(dq: 0
2367
+ },
2368
+ \(dqlocal\(dq: [
2369
+ {
2370
+ \(dqgpus\(dq: [
2371
+ {
2372
+ \(dqid\(dq: \(dq0\(dq,
2373
+ \(dqslots\(dq: 2
2374
+ },
2375
+ {
2376
+ \(dqid\(dq: \(dq1\(dq,
2377
+ \(dqslots\(dq: 4
2378
+ },
2379
+ {
2380
+ \(dqid\(dq: \(dq2\(dq,
2381
+ \(dqslots\(dq: 2
2382
+ },
2383
+ {
2384
+ \(dqid\(dq: \(dq3\(dq
2385
+ }
2386
+ ],
2387
+ \(dqcrypto_chips\(dq: [
2388
+ {
2389
+ \(dqid\(dq: \(dqcard0\(dq,
2390
+ \(dqslots\(dq: 4
2391
+ }
2392
+ ]
2393
+ }
2394
+ ]
2395
+ }
2396
+ .ft P
2397
+ .fi
2398
+ .UNINDENT
2399
+ .UNINDENT
2400
+ .sp
2401
+ The members are:
2402
+ .INDENT 0.0
2403
+ .TP
2404
+ .B \fBversion\fP
2405
+ An object containing a \fBmajor\fP integer field and a \fBminor\fP integer field.
2406
+ Currently, the only supported version is major \fB1\fP, minor \fB0\fP\&. Any other
2407
+ value is an error.
2408
+ .TP
2409
+ .B \fBlocal\fP
2410
+ A JSON array of resource sets present on the system. Currently, this array
2411
+ is restricted to being of size 1.
2412
+ .sp
2413
+ Each array element is a JSON object with members whose names are equal to the
2414
+ desired resource types, such as \fBgpus\fP\&. These names must start with a
2415
+ lowercase letter or an underscore, and subsequent characters can be a
2416
+ lowercase letter, a digit, or an underscore. Uppercase letters are not
2417
+ allowed, because certain platforms have case\-insensitive environment
2418
+ variables. See the \fI\%Environment Variables\fP section below for
2419
+ more information. It is recommended that the resource type name be the plural
2420
+ of a noun, such as \fBgpus\fP or \fBcrypto_chips\fP (and not \fBgpu\fP or
2421
+ \fBcrypto_chip\fP\&.)
2422
+ .sp
2423
+ Please note that the names \fBgpus\fP and \fBcrypto_chips\fP are just examples,
2424
+ and CTest does not interpret them in any way. You are free to make up any
2425
+ resource type you want to meet your own requirements.
2426
+ .sp
2427
+ The value for each resource type is a JSON array consisting of JSON objects,
2428
+ each of which describe a specific instance of the specified resource. These
2429
+ objects have the following members:
2430
+ .INDENT 7.0
2431
+ .TP
2432
+ .B \fBid\fP
2433
+ A string consisting of an identifier for the resource. Each character in
2434
+ the identifier can be a lowercase letter, a digit, or an underscore.
2435
+ Uppercase letters are not allowed.
2436
+ .sp
2437
+ Identifiers must be unique within a resource type. However, they do not
2438
+ have to be unique across resource types. For example, it is valid to have a
2439
+ \fBgpus\fP resource named \fB0\fP and a \fBcrypto_chips\fP resource named \fB0\fP,
2440
+ but not two \fBgpus\fP resources both named \fB0\fP\&.
2441
+ .sp
2442
+ Please note that the IDs \fB0\fP, \fB1\fP, \fB2\fP, \fB3\fP, and \fBcard0\fP are just
2443
+ examples, and CTest does not interpret them in any way. You are free to
2444
+ make up any IDs you want to meet your own requirements.
2445
+ .TP
2446
+ .B \fBslots\fP
2447
+ An optional unsigned number specifying the number of slots available on the
2448
+ resource. For example, this could be megabytes of RAM on a GPU, or
2449
+ cryptography units available on a cryptography chip. If \fBslots\fP is not
2450
+ specified, a default value of \fB1\fP is assumed.
2451
+ .UNINDENT
2452
+ .UNINDENT
2453
+ .sp
2454
+ In the example file above, there are four GPUs with ID\(aqs 0 through 3. GPU 0 has
2455
+ 2 slots, GPU 1 has 4, GPU 2 has 2, and GPU 3 has a default of 1 slot. There is
2456
+ also one cryptography chip with 4 slots.
2457
+ .SS \fBRESOURCE_GROUPS\fP Property
2458
+ .sp
2459
+ See \X'tty: link #prop_test:RESOURCE_GROUPS'\fI\%RESOURCE_GROUPS\fP\X'tty: link' for a description of this property.
2460
+ .SS Environment Variables
2461
+ .sp
2462
+ Once CTest has decided which resources to allocate to a test, it passes this
2463
+ information to the test executable as a series of environment variables. For
2464
+ each example below, we will assume that the test in question has a
2465
+ \X'tty: link #prop_test:RESOURCE_GROUPS'\fI\%RESOURCE_GROUPS\fP\X'tty: link' property of
2466
+ \fB2,gpus:2;gpus:4,gpus:1,crypto_chips:2\fP\&.
2467
+ .sp
2468
+ The following variables are passed to the test process:
2469
+ .INDENT 0.0
2470
+ .TP
2471
+ .B CTEST_RESOURCE_GROUP_COUNT
2472
+ The total number of groups specified by the \X'tty: link #prop_test:RESOURCE_GROUPS'\fI\%RESOURCE_GROUPS\fP\X'tty: link'
2473
+ property. For example:
2474
+ .INDENT 7.0
2475
+ .IP \(bu 2
2476
+ \fBCTEST_RESOURCE_GROUP_COUNT=3\fP
2477
+ .UNINDENT
2478
+ .sp
2479
+ This variable will only be defined if \fI\%ctest(1)\fP has been given a
2480
+ \fB\-\-resource\-spec\-file\fP, or if \X'tty: link #command:ctest_test'\fI\%ctest_test()\fP\X'tty: link' has been given a
2481
+ \fBRESOURCE_SPEC_FILE\fP\&. If no resource specification file has been given,
2482
+ this variable will not be defined.
2483
+ .UNINDENT
2484
+ .INDENT 0.0
2485
+ .TP
2486
+ .B CTEST_RESOURCE_GROUP_<num>
2487
+ The list of resource types allocated to each group, with each item
2488
+ separated by a comma. \fB<num>\fP is a number from zero to
2489
+ \fBCTEST_RESOURCE_GROUP_COUNT\fP minus one. \fBCTEST_RESOURCE_GROUP_<num>\fP
2490
+ is defined for each \fB<num>\fP in this range. For example:
2491
+ .INDENT 7.0
2492
+ .IP \(bu 2
2493
+ \fBCTEST_RESOURCE_GROUP_0=gpus\fP
2494
+ .IP \(bu 2
2495
+ \fBCTEST_RESOURCE_GROUP_1=gpus\fP
2496
+ .IP \(bu 2
2497
+ \fBCTEST_RESOURCE_GROUP_2=crypto_chips,gpus\fP
2498
+ .UNINDENT
2499
+ .UNINDENT
2500
+ .INDENT 0.0
2501
+ .TP
2502
+ .B CTEST_RESOURCE_GROUP_<num>_<resource\-type>
2503
+ The list of resource IDs and number of slots from each ID allocated to each
2504
+ group for a given resource type. This variable consists of a series of
2505
+ pairs, each pair separated by a semicolon, and with the two items in the pair
2506
+ separated by a comma. The first item in each pair is \fBid:\fP followed by the
2507
+ ID of a resource of type \fB<resource\-type>\fP, and the second item is
2508
+ \fBslots:\fP followed by the number of slots from that resource allocated to
2509
+ the given group. For example:
2510
+ .INDENT 7.0
2511
+ .IP \(bu 2
2512
+ \fBCTEST_RESOURCE_GROUP_0_GPUS=id:0,slots:2\fP
2513
+ .IP \(bu 2
2514
+ \fBCTEST_RESOURCE_GROUP_1_GPUS=id:2,slots:2\fP
2515
+ .IP \(bu 2
2516
+ \fBCTEST_RESOURCE_GROUP_2_GPUS=id:1,slots:4;id:3,slots:1\fP
2517
+ .IP \(bu 2
2518
+ \fBCTEST_RESOURCE_GROUP_2_CRYPTO_CHIPS=id:card0,slots:2\fP
2519
+ .UNINDENT
2520
+ .sp
2521
+ In this example, group 0 gets 2 slots from GPU \fB0\fP, group 1 gets 2 slots
2522
+ from GPU \fB2\fP, and group 2 gets 4 slots from GPU \fB1\fP, 1 slot from GPU
2523
+ \fB3\fP, and 2 slots from cryptography chip \fBcard0\fP\&.
2524
+ .sp
2525
+ \fB<num>\fP is a number from zero to \fBCTEST_RESOURCE_GROUP_COUNT\fP minus one.
2526
+ \fB<resource\-type>\fP is the name of a resource type, converted to uppercase.
2527
+ \fBCTEST_RESOURCE_GROUP_<num>_<resource\-type>\fP is defined for the product
2528
+ of each \fB<num>\fP in the range listed above and each resource type listed in
2529
+ \fBCTEST_RESOURCE_GROUP_<num>\fP\&.
2530
+ .sp
2531
+ Because some platforms have case\-insensitive names for environment variables,
2532
+ the names of resource types may not clash in a case\-insensitive environment.
2533
+ Because of this, for the sake of simplicity, all resource types must be
2534
+ listed in all lowercase in the
2535
+ \fI\%resource specification file\fP and
2536
+ in the \X'tty: link #prop_test:RESOURCE_GROUPS'\fI\%RESOURCE_GROUPS\fP\X'tty: link' property, and they are converted to all
2537
+ uppercase in the \fBCTEST_RESOURCE_GROUP_<num>_<resource\-type>\fP environment
2538
+ variable.
2539
+ .UNINDENT
2540
+ .SS Dynamically\-Generated Resource Specification File
2541
+ .sp
2542
+ Added in version 3.28.
2543
+
2544
+ .sp
2545
+ A project may optionally specify a single test which will be used to
2546
+ dynamically generate the resource specification file that CTest will use for
2547
+ scheduling tests that use resources. The test that generates the file must
2548
+ have the \X'tty: link #prop_test:GENERATED_RESOURCE_SPEC_FILE'\fI\%GENERATED_RESOURCE_SPEC_FILE\fP\X'tty: link' property set, and must have
2549
+ exactly one fixture in its \X'tty: link #prop_test:FIXTURES_SETUP'\fI\%FIXTURES_SETUP\fP\X'tty: link' property. This fixture
2550
+ is considered by CTest to have special meaning: it\(aqs the fixture that generates
2551
+ the resource spec file. The fixture may have any name. If such a fixture
2552
+ exists, all tests that have \X'tty: link #prop_test:RESOURCE_GROUPS'\fI\%RESOURCE_GROUPS\fP\X'tty: link' set must have the
2553
+ fixture in their \X'tty: link #prop_test:FIXTURES_REQUIRED'\fI\%FIXTURES_REQUIRED\fP\X'tty: link', and a resource spec file may
2554
+ not be specified with the \fB\-\-resource\-spec\-file\fP argument or the
2555
+ \X'tty: link #variable:CTEST_RESOURCE_SPEC_FILE'\fI\%CTEST_RESOURCE_SPEC_FILE\fP\X'tty: link' variable.
2556
+ .SH JOB SERVER INTEGRATION
2557
+ .sp
2558
+ Added in version 3.29.
2559
+
2560
+ .sp
2561
+ On POSIX systems, when running under the context of a \X'tty: link https://www.gnu.org/software/make/manual/html_node/Job-Slots.html'\fI\%Job Server\fP\X'tty: link',
2562
+ CTest shares its job slots. This is independent of the \X'tty: link #prop_test:PROCESSORS'\fI\%PROCESSORS\fP\X'tty: link'
2563
+ test property, which still counts against CTest\(aqs \fI\%\-j\fP
2564
+ parallel level. CTest acquires exactly one token from the job server before
2565
+ running each test, and returns it when the test finishes.
2566
+ .sp
2567
+ For example, consider the \fBMakefile\fP:
2568
+ .INDENT 0.0
2569
+ .INDENT 3.5
2570
+ .sp
2571
+ .nf
2572
+ .ft C
2573
+ test:
2574
+ +ctest \-j 8
2575
+
2576
+ .ft P
2577
+ .fi
2578
+ .UNINDENT
2579
+ .UNINDENT
2580
+ .sp
2581
+ When invoked via \fBmake \-j 2 test\fP, \fBctest\fP connects to the job server,
2582
+ acquires a token for each test, and runs at most 2 tests concurrently.
2583
+ .sp
2584
+ On Windows systems, job server integration is not yet implemented.
2585
+ .SH SEE ALSO
2586
+ .sp
2587
+ The following resources are available to get help using CMake:
2588
+ .INDENT 0.0
2589
+ .TP
2590
+ .B Home Page
2591
+ \X'tty: link https://cmake.org'\fI\%https://cmake.org\fP\X'tty: link'
2592
+ .sp
2593
+ The primary starting point for learning about CMake.
2594
+ .TP
2595
+ .B Online Documentation and Community Resources
2596
+ \X'tty: link https://cmake.org/documentation'\fI\%https://cmake.org/documentation\fP\X'tty: link'
2597
+ .sp
2598
+ Links to available documentation and community resources may be
2599
+ found on this web page.
2600
+ .TP
2601
+ .B Discourse Forum
2602
+ \X'tty: link https://discourse.cmake.org'\fI\%https://discourse.cmake.org\fP\X'tty: link'
2603
+ .sp
2604
+ The Discourse Forum hosts discussion and questions about CMake.
2605
+ .UNINDENT
2606
+ .SH COPYRIGHT
2607
+ 2000-2024 Kitware, Inc. and Contributors
2608
+ .\" Generated by docutils manpage writer.
2609
+ .
cmake/man/man7/cmake-buildsystem.7 ADDED
@@ -0,0 +1,1640 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .\" Man page generated from reStructuredText.
2
+ .
3
+ .
4
+ .nr rst2man-indent-level 0
5
+ .
6
+ .de1 rstReportMargin
7
+ \\$1 \\n[an-margin]
8
+ level \\n[rst2man-indent-level]
9
+ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
10
+ -
11
+ \\n[rst2man-indent0]
12
+ \\n[rst2man-indent1]
13
+ \\n[rst2man-indent2]
14
+ ..
15
+ .de1 INDENT
16
+ .\" .rstReportMargin pre:
17
+ . RS \\$1
18
+ . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
19
+ . nr rst2man-indent-level +1
20
+ .\" .rstReportMargin post:
21
+ ..
22
+ .de UNINDENT
23
+ . RE
24
+ .\" indent \\n[an-margin]
25
+ .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
26
+ .nr rst2man-indent-level -1
27
+ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
28
+ .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
29
+ ..
30
+ .TH "CMAKE-BUILDSYSTEM" "7" "Jan 10, 2025" "3.31.4" "CMake"
31
+ .SH NAME
32
+ cmake-buildsystem \- CMake Buildsystem Reference
33
+ .SH INTRODUCTION
34
+ .sp
35
+ A CMake\-based buildsystem is organized as a set of high\-level logical
36
+ targets. Each target corresponds to an executable or library, or
37
+ is a custom target containing custom commands. Dependencies between the
38
+ targets are expressed in the buildsystem to determine the build order
39
+ and the rules for regeneration in response to change.
40
+ .SH BINARY TARGETS
41
+ .sp
42
+ Executables and libraries are defined using the \X'tty: link #command:add_executable'\fI\%add_executable()\fP\X'tty: link'
43
+ and \X'tty: link #command:add_library'\fI\%add_library()\fP\X'tty: link' commands. The resulting binary files have
44
+ appropriate \X'tty: link #prop_tgt:PREFIX'\fI\%PREFIX\fP\X'tty: link', \X'tty: link #prop_tgt:SUFFIX'\fI\%SUFFIX\fP\X'tty: link' and extensions for the
45
+ platform targeted. Dependencies between binary targets are expressed using
46
+ the \X'tty: link #command:target_link_libraries'\fI\%target_link_libraries()\fP\X'tty: link' command:
47
+ .INDENT 0.0
48
+ .INDENT 3.5
49
+ .sp
50
+ .nf
51
+ .ft C
52
+ add_library(archive archive.cpp zip.cpp lzma.cpp)
53
+ add_executable(zipapp zipapp.cpp)
54
+ target_link_libraries(zipapp archive)
55
+ .ft P
56
+ .fi
57
+ .UNINDENT
58
+ .UNINDENT
59
+ .sp
60
+ \fBarchive\fP is defined as a \fBSTATIC\fP library \-\- an archive containing objects
61
+ compiled from \fBarchive.cpp\fP, \fBzip.cpp\fP, and \fBlzma.cpp\fP\&. \fBzipapp\fP
62
+ is defined as an executable formed by compiling and linking \fBzipapp.cpp\fP\&.
63
+ When linking the \fBzipapp\fP executable, the \fBarchive\fP static library is
64
+ linked in.
65
+ .SS Binary Executables
66
+ .sp
67
+ The \X'tty: link #command:add_executable'\fI\%add_executable()\fP\X'tty: link' command defines an executable target:
68
+ .INDENT 0.0
69
+ .INDENT 3.5
70
+ .sp
71
+ .nf
72
+ .ft C
73
+ add_executable(mytool mytool.cpp)
74
+ .ft P
75
+ .fi
76
+ .UNINDENT
77
+ .UNINDENT
78
+ .sp
79
+ Commands such as \X'tty: link #command:add_custom_command'\fI\%add_custom_command()\fP\X'tty: link', which generates rules to be
80
+ run at build time can transparently use an \X'tty: link #prop_tgt:TYPE'\fI\%EXECUTABLE\fP\X'tty: link'
81
+ target as a \fBCOMMAND\fP executable. The buildsystem rules will ensure that
82
+ the executable is built before attempting to run the command.
83
+ .SS Binary Library Types
84
+ .SS Normal Libraries
85
+ .sp
86
+ By default, the \X'tty: link #command:add_library'\fI\%add_library()\fP\X'tty: link' command defines a \fBSTATIC\fP library,
87
+ unless a type is specified. A type may be specified when using the command:
88
+ .INDENT 0.0
89
+ .INDENT 3.5
90
+ .sp
91
+ .nf
92
+ .ft C
93
+ add_library(archive SHARED archive.cpp zip.cpp lzma.cpp)
94
+ .ft P
95
+ .fi
96
+ .UNINDENT
97
+ .UNINDENT
98
+ .INDENT 0.0
99
+ .INDENT 3.5
100
+ .sp
101
+ .nf
102
+ .ft C
103
+ add_library(archive STATIC archive.cpp zip.cpp lzma.cpp)
104
+ .ft P
105
+ .fi
106
+ .UNINDENT
107
+ .UNINDENT
108
+ .sp
109
+ The \X'tty: link #variable:BUILD_SHARED_LIBS'\fI\%BUILD_SHARED_LIBS\fP\X'tty: link' variable may be enabled to change the
110
+ behavior of \X'tty: link #command:add_library'\fI\%add_library()\fP\X'tty: link' to build shared libraries by default.
111
+ .sp
112
+ In the context of the buildsystem definition as a whole, it is largely
113
+ irrelevant whether particular libraries are \fBSHARED\fP or \fBSTATIC\fP \-\-
114
+ the commands, dependency specifications and other APIs work similarly
115
+ regardless of the library type. The \fBMODULE\fP library type is
116
+ dissimilar in that it is generally not linked to \-\- it is not used in
117
+ the right\-hand\-side of the \X'tty: link #command:target_link_libraries'\fI\%target_link_libraries()\fP\X'tty: link' command.
118
+ It is a type which is loaded as a plugin using runtime techniques.
119
+ If the library does not export any unmanaged symbols (e.g. Windows
120
+ resource DLL, C++/CLI DLL), it is required that the library not be a
121
+ \fBSHARED\fP library because CMake expects \fBSHARED\fP libraries to export
122
+ at least one symbol.
123
+ .INDENT 0.0
124
+ .INDENT 3.5
125
+ .sp
126
+ .nf
127
+ .ft C
128
+ add_library(archive MODULE 7z.cpp)
129
+ .ft P
130
+ .fi
131
+ .UNINDENT
132
+ .UNINDENT
133
+ .SS Apple Frameworks
134
+ .sp
135
+ A \fBSHARED\fP library may be marked with the \X'tty: link #prop_tgt:FRAMEWORK'\fI\%FRAMEWORK\fP\X'tty: link'
136
+ target property to create an macOS or iOS Framework Bundle.
137
+ A library with the \fBFRAMEWORK\fP target property should also set the
138
+ \X'tty: link #prop_tgt:FRAMEWORK_VERSION'\fI\%FRAMEWORK_VERSION\fP\X'tty: link' target property. This property is typically
139
+ set to the value of \(dqA\(dq by macOS conventions.
140
+ The \fBMACOSX_FRAMEWORK_IDENTIFIER\fP sets the \fBCFBundleIdentifier\fP key
141
+ and it uniquely identifies the bundle.
142
+ .INDENT 0.0
143
+ .INDENT 3.5
144
+ .sp
145
+ .nf
146
+ .ft C
147
+ add_library(MyFramework SHARED MyFramework.cpp)
148
+ set_target_properties(MyFramework PROPERTIES
149
+ FRAMEWORK TRUE
150
+ FRAMEWORK_VERSION A # Version \(dqA\(dq is macOS convention
151
+ MACOSX_FRAMEWORK_IDENTIFIER org.cmake.MyFramework
152
+ )
153
+ .ft P
154
+ .fi
155
+ .UNINDENT
156
+ .UNINDENT
157
+ .SS Object Libraries
158
+ .sp
159
+ The \fBOBJECT\fP library type defines a non\-archival collection of object files
160
+ resulting from compiling the given source files. The object files collection
161
+ may be used as source inputs to other targets by using the syntax
162
+ \X'tty: link #genex:TARGET_OBJECTS'\fI\%$<TARGET_OBJECTS:name>\fP\X'tty: link'\&. This is a
163
+ \X'tty: link #manual:cmake-generator-expressions(7)'\fI\%generator expression\fP\X'tty: link' that can be
164
+ used to supply the \fBOBJECT\fP library content to other targets:
165
+ .INDENT 0.0
166
+ .INDENT 3.5
167
+ .sp
168
+ .nf
169
+ .ft C
170
+ add_library(archive OBJECT archive.cpp zip.cpp lzma.cpp)
171
+
172
+ add_library(archiveExtras STATIC $<TARGET_OBJECTS:archive> extras.cpp)
173
+
174
+ add_executable(test_exe $<TARGET_OBJECTS:archive> test.cpp)
175
+ .ft P
176
+ .fi
177
+ .UNINDENT
178
+ .UNINDENT
179
+ .sp
180
+ The link (or archiving) step of those other targets will use the object
181
+ files collection in addition to those from their own sources.
182
+ .sp
183
+ Alternatively, object libraries may be linked into other targets:
184
+ .INDENT 0.0
185
+ .INDENT 3.5
186
+ .sp
187
+ .nf
188
+ .ft C
189
+ add_library(archive OBJECT archive.cpp zip.cpp lzma.cpp)
190
+
191
+ add_library(archiveExtras STATIC extras.cpp)
192
+ target_link_libraries(archiveExtras PUBLIC archive)
193
+
194
+ add_executable(test_exe test.cpp)
195
+ target_link_libraries(test_exe archive)
196
+ .ft P
197
+ .fi
198
+ .UNINDENT
199
+ .UNINDENT
200
+ .sp
201
+ The link (or archiving) step of those other targets will use the object
202
+ files from \fBOBJECT\fP libraries that are \fIdirectly\fP linked. Additionally,
203
+ usage requirements of the \fBOBJECT\fP libraries will be honored when compiling
204
+ sources in those other targets. Furthermore, those usage requirements
205
+ will propagate transitively to dependents of those other targets.
206
+ .sp
207
+ Object libraries may not be used as the \fBTARGET\fP in a use of the
208
+ \X'tty: link #command:add_custom_command'\fI\%add_custom_command(TARGET)\fP\X'tty: link' command signature. However,
209
+ the list of objects can be used by \X'tty: link #command:add_custom_command'\fI\%add_custom_command(OUTPUT)\fP\X'tty: link'
210
+ or \X'tty: link #generate'\fI\%file(GENERATE)\fP\X'tty: link' by using \fB$<TARGET_OBJECTS:objlib>\fP\&.
211
+ .SH BUILD SPECIFICATION AND USAGE REQUIREMENTS
212
+ .sp
213
+ Targets build according to their own
214
+ \fI\%build specification\fP in combination with
215
+ \fI\%usage requirements\fP propagated from their
216
+ link dependencies. Both may be specified using target\-specific
217
+ \fI\%commands\fP\&.
218
+ .sp
219
+ For example:
220
+ .INDENT 0.0
221
+ .INDENT 3.5
222
+ .sp
223
+ .nf
224
+ .ft C
225
+ add_library(archive SHARED archive.cpp zip.cpp)
226
+
227
+ if (LZMA_FOUND)
228
+ # Add a source implementing support for lzma.
229
+ target_sources(archive PRIVATE lzma.cpp)
230
+
231
+ # Compile the \(aqarchive\(aq library sources with \(aq\-DBUILDING_WITH_LZMA\(aq.
232
+ target_compile_definitions(archive PRIVATE BUILDING_WITH_LZMA)
233
+ endif()
234
+
235
+ target_compile_definitions(archive INTERFACE USING_ARCHIVE_LIB)
236
+
237
+ add_executable(consumer consumer.cpp)
238
+
239
+ # Link \(aqconsumer\(aq to \(aqarchive\(aq. This also consumes its usage requirements,
240
+ # so \(aqconsumer.cpp\(aq is compiled with \(aq\-DUSING_ARCHIVE_LIB\(aq.
241
+ target_link_libraries(consumer archive)
242
+ .ft P
243
+ .fi
244
+ .UNINDENT
245
+ .UNINDENT
246
+ .SS Target Commands
247
+ .sp
248
+ Target\-specific commands populate the
249
+ \fI\%build specification\fP of \fI\%Binary Targets\fP and
250
+ \fI\%usage requirements\fP of \fI\%Binary Targets\fP,
251
+ \fI\%Interface Libraries\fP, and \fI\%Imported Targets\fP\&.
252
+ .sp
253
+ Invocations must specify scope keywords, each affecting the visibility
254
+ of arguments following it. The scopes are:
255
+ .INDENT 0.0
256
+ .TP
257
+ .B \fBPUBLIC\fP
258
+ Populates both properties for \fI\%building\fP
259
+ and properties for \fI\%using\fP a target.
260
+ .TP
261
+ .B \fBPRIVATE\fP
262
+ Populates only properties for \fI\%building\fP
263
+ a target.
264
+ .TP
265
+ .B \fBINTERFACE\fP
266
+ Populates only properties for \fI\%using\fP
267
+ a target.
268
+ .UNINDENT
269
+ .sp
270
+ The commands are:
271
+ .INDENT 0.0
272
+ .TP
273
+ .B \X'tty: link #command:target_compile_definitions'\fI\%target_compile_definitions()\fP\X'tty: link'
274
+ Populates the \X'tty: link #prop_tgt:COMPILE_DEFINITIONS'\fI\%COMPILE_DEFINITIONS\fP\X'tty: link' build specification and
275
+ \X'tty: link #prop_tgt:INTERFACE_COMPILE_DEFINITIONS'\fI\%INTERFACE_COMPILE_DEFINITIONS\fP\X'tty: link' usage requirement properties.
276
+ .sp
277
+ For example, the call
278
+ .INDENT 7.0
279
+ .INDENT 3.5
280
+ .sp
281
+ .nf
282
+ .ft C
283
+ target_compile_definitions(archive
284
+ PRIVATE BUILDING_WITH_LZMA
285
+ INTERFACE USING_ARCHIVE_LIB
286
+ )
287
+ .ft P
288
+ .fi
289
+ .UNINDENT
290
+ .UNINDENT
291
+ .sp
292
+ appends \fBBUILDING_WITH_LZMA\fP to the target\(aqs \fBCOMPILE_DEFINITIONS\fP
293
+ property and appends \fBUSING_ARCHIVE_LIB\fP to the target\(aqs
294
+ \fBINTERFACE_COMPILE_DEFINITIONS\fP property.
295
+ .TP
296
+ .B \X'tty: link #command:target_compile_options'\fI\%target_compile_options()\fP\X'tty: link'
297
+ Populates the \X'tty: link #prop_tgt:COMPILE_OPTIONS'\fI\%COMPILE_OPTIONS\fP\X'tty: link' build specification and
298
+ \X'tty: link #prop_tgt:INTERFACE_COMPILE_OPTIONS'\fI\%INTERFACE_COMPILE_OPTIONS\fP\X'tty: link' usage requirement properties.
299
+ .TP
300
+ .B \X'tty: link #command:target_compile_features'\fI\%target_compile_features()\fP\X'tty: link'
301
+ Added in version 3.1.
302
+
303
+ .sp
304
+ Populates the \X'tty: link #prop_tgt:COMPILE_FEATURES'\fI\%COMPILE_FEATURES\fP\X'tty: link' build specification and
305
+ \X'tty: link #prop_tgt:INTERFACE_COMPILE_FEATURES'\fI\%INTERFACE_COMPILE_FEATURES\fP\X'tty: link' usage requirement properties.
306
+ .TP
307
+ .B \X'tty: link #command:target_include_directories'\fI\%target_include_directories()\fP\X'tty: link'
308
+ Populates the \X'tty: link #prop_tgt:INCLUDE_DIRECTORIES'\fI\%INCLUDE_DIRECTORIES\fP\X'tty: link' build specification
309
+ and \X'tty: link #prop_tgt:INTERFACE_INCLUDE_DIRECTORIES'\fI\%INTERFACE_INCLUDE_DIRECTORIES\fP\X'tty: link' usage requirement
310
+ properties. With the \fBSYSTEM\fP option, it also populates the
311
+ \X'tty: link #prop_tgt:INTERFACE_SYSTEM_INCLUDE_DIRECTORIES'\fI\%INTERFACE_SYSTEM_INCLUDE_DIRECTORIES\fP\X'tty: link' usage requirement.
312
+ .sp
313
+ For convenience, the \X'tty: link #variable:CMAKE_INCLUDE_CURRENT_DIR'\fI\%CMAKE_INCLUDE_CURRENT_DIR\fP\X'tty: link' variable
314
+ may be enabled to add the source directory and corresponding build
315
+ directory as \fBINCLUDE_DIRECTORIES\fP on all targets. Similarly,
316
+ the \X'tty: link #variable:CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE'\fI\%CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE\fP\X'tty: link' variable may
317
+ be enabled to add them as \fBINTERFACE_INCLUDE_DIRECTORIES\fP on all
318
+ targets.
319
+ .TP
320
+ .B \X'tty: link #command:target_sources'\fI\%target_sources()\fP\X'tty: link'
321
+ Added in version 3.1.
322
+
323
+ .sp
324
+ Populates the \X'tty: link #prop_tgt:SOURCES'\fI\%SOURCES\fP\X'tty: link' build specification and
325
+ \X'tty: link #prop_tgt:INTERFACE_SOURCES'\fI\%INTERFACE_SOURCES\fP\X'tty: link' usage requirement properties.
326
+ .sp
327
+ It also supports specifying \X'tty: link #file-sets'\fI\%File Sets\fP\X'tty: link', which can add C++ module
328
+ sources and headers not listed in the \fBSOURCES\fP and \fBINTERFACE_SOURCES\fP
329
+ properties. File sets may also populate the \X'tty: link #prop_tgt:INCLUDE_DIRECTORIES'\fI\%INCLUDE_DIRECTORIES\fP\X'tty: link'
330
+ build specification and \X'tty: link #prop_tgt:INTERFACE_INCLUDE_DIRECTORIES'\fI\%INTERFACE_INCLUDE_DIRECTORIES\fP\X'tty: link' usage
331
+ requirement properties with the include directories containing the headers.
332
+ .TP
333
+ .B \X'tty: link #command:target_precompile_headers'\fI\%target_precompile_headers()\fP\X'tty: link'
334
+ Added in version 3.16.
335
+
336
+ .sp
337
+ Populates the \X'tty: link #prop_tgt:PRECOMPILE_HEADERS'\fI\%PRECOMPILE_HEADERS\fP\X'tty: link' build specification and
338
+ \X'tty: link #prop_tgt:INTERFACE_PRECOMPILE_HEADERS'\fI\%INTERFACE_PRECOMPILE_HEADERS\fP\X'tty: link' usage requirement properties.
339
+ .TP
340
+ .B \X'tty: link #command:target_link_libraries'\fI\%target_link_libraries()\fP\X'tty: link'
341
+ Populates the \X'tty: link #prop_tgt:LINK_LIBRARIES'\fI\%LINK_LIBRARIES\fP\X'tty: link' build specification
342
+ and \X'tty: link #prop_tgt:INTERFACE_LINK_LIBRARIES'\fI\%INTERFACE_LINK_LIBRARIES\fP\X'tty: link' usage requirement properties.
343
+ .sp
344
+ This is the primary mechanism by which link dependencies and their
345
+ \fI\%usage requirements\fP are transitively
346
+ propagated to affect compilation and linking of a target.
347
+ .TP
348
+ .B \X'tty: link #command:target_link_directories'\fI\%target_link_directories()\fP\X'tty: link'
349
+ Added in version 3.13.
350
+
351
+ .sp
352
+ Populates the \X'tty: link #prop_tgt:LINK_DIRECTORIES'\fI\%LINK_DIRECTORIES\fP\X'tty: link' build specification and
353
+ \X'tty: link #prop_tgt:INTERFACE_LINK_DIRECTORIES'\fI\%INTERFACE_LINK_DIRECTORIES\fP\X'tty: link' usage requirement properties.
354
+ .TP
355
+ .B \X'tty: link #command:target_link_options'\fI\%target_link_options()\fP\X'tty: link'
356
+ Added in version 3.13.
357
+
358
+ .sp
359
+ Populates the \X'tty: link #prop_tgt:LINK_OPTIONS'\fI\%LINK_OPTIONS\fP\X'tty: link' build specification and
360
+ \X'tty: link #prop_tgt:INTERFACE_LINK_OPTIONS'\fI\%INTERFACE_LINK_OPTIONS\fP\X'tty: link' usage requirement properties.
361
+ .UNINDENT
362
+ .SS Target Build Specification
363
+ .sp
364
+ The build specification of \fI\%Binary Targets\fP is represented by target
365
+ properties. For each of the following \fI\%compile\fP
366
+ and \fI\%link\fP properties, compilation and linking
367
+ of the target is affected both by its own value and by the corresponding
368
+ \fI\%usage requirement\fP property, named with
369
+ an \fBINTERFACE_\fP prefix, collected from the transitive closure of link
370
+ dependencies.
371
+ .SS Target Compile Properties
372
+ .sp
373
+ These represent the \fI\%build specification\fP
374
+ for compiling a target.
375
+ .INDENT 0.0
376
+ .TP
377
+ .B \X'tty: link #prop_tgt:COMPILE_DEFINITIONS'\fI\%COMPILE_DEFINITIONS\fP\X'tty: link'
378
+ List of compile definitions for compiling sources in the target.
379
+ These are passed to the compiler with \fB\-D\fP flags, or equivalent,
380
+ in an unspecified order.
381
+ .sp
382
+ The \X'tty: link #prop_tgt:DEFINE_SYMBOL'\fI\%DEFINE_SYMBOL\fP\X'tty: link' target property is also used
383
+ as a compile definition as a special convenience case for
384
+ \fBSHARED\fP and \fBMODULE\fP library targets.
385
+ .TP
386
+ .B \X'tty: link #prop_tgt:COMPILE_OPTIONS'\fI\%COMPILE_OPTIONS\fP\X'tty: link'
387
+ List of compile options for compiling sources in the target.
388
+ These are passed to the compiler as flags, in the order of appearance.
389
+ .sp
390
+ Compile options are automatically escaped for the shell.
391
+ .sp
392
+ Some compile options are best specified via dedicated settings,
393
+ such as the \X'tty: link #prop_tgt:POSITION_INDEPENDENT_CODE'\fI\%POSITION_INDEPENDENT_CODE\fP\X'tty: link' target property.
394
+ .TP
395
+ .B \X'tty: link #prop_tgt:COMPILE_FEATURES'\fI\%COMPILE_FEATURES\fP\X'tty: link'
396
+ Added in version 3.1.
397
+
398
+ .sp
399
+ List of \X'tty: link #manual:cmake-compile-features(7)'\fI\%compile features\fP\X'tty: link' needed
400
+ for compiling sources in the target. Typically these ensure the
401
+ target\(aqs sources are compiled using a sufficient language standard level.
402
+ .TP
403
+ .B \X'tty: link #prop_tgt:INCLUDE_DIRECTORIES'\fI\%INCLUDE_DIRECTORIES\fP\X'tty: link'
404
+ List of include directories for compiling sources in the target.
405
+ These are passed to the compiler with \fB\-I\fP or \fB\-isystem\fP flags,
406
+ or equivalent, in the order of appearance.
407
+ .sp
408
+ For convenience, the \X'tty: link #variable:CMAKE_INCLUDE_CURRENT_DIR'\fI\%CMAKE_INCLUDE_CURRENT_DIR\fP\X'tty: link' variable
409
+ may be enabled to add the source directory and corresponding build
410
+ directory as \fBINCLUDE_DIRECTORIES\fP on all targets.
411
+ .TP
412
+ .B \X'tty: link #prop_tgt:SOURCES'\fI\%SOURCES\fP\X'tty: link'
413
+ List of source files associated with the target. This includes sources
414
+ specified when the target was created by the \X'tty: link #command:add_executable'\fI\%add_executable()\fP\X'tty: link',
415
+ \X'tty: link #command:add_library'\fI\%add_library()\fP\X'tty: link', or \X'tty: link #command:add_custom_target'\fI\%add_custom_target()\fP\X'tty: link' command.
416
+ It also includes sources added by the \X'tty: link #command:target_sources'\fI\%target_sources()\fP\X'tty: link' command,
417
+ but does not include \X'tty: link #file-sets'\fI\%File Sets\fP\X'tty: link'\&.
418
+ .TP
419
+ .B \X'tty: link #prop_tgt:PRECOMPILE_HEADERS'\fI\%PRECOMPILE_HEADERS\fP\X'tty: link'
420
+ Added in version 3.16.
421
+
422
+ .sp
423
+ List of header files to precompile and include when compiling
424
+ sources in the target.
425
+ .TP
426
+ .B \X'tty: link #prop_tgt:AUTOMOC_MACRO_NAMES'\fI\%AUTOMOC_MACRO_NAMES\fP\X'tty: link'
427
+ Added in version 3.10.
428
+
429
+ .sp
430
+ List of macro names used by \X'tty: link #prop_tgt:AUTOMOC'\fI\%AUTOMOC\fP\X'tty: link' to determine if a
431
+ C++ source in the target needs to be processed by \fBmoc\fP\&.
432
+ .TP
433
+ .B \X'tty: link #prop_tgt:AUTOUIC_OPTIONS'\fI\%AUTOUIC_OPTIONS\fP\X'tty: link'
434
+ Added in version 3.0.
435
+
436
+ .sp
437
+ List of options used by \X'tty: link #prop_tgt:AUTOUIC'\fI\%AUTOUIC\fP\X'tty: link' when invoking \fBuic\fP
438
+ for the target.
439
+ .UNINDENT
440
+ .SS Target Link Properties
441
+ .sp
442
+ These represent the \fI\%build specification\fP
443
+ for linking a target.
444
+ .INDENT 0.0
445
+ .TP
446
+ .B \X'tty: link #prop_tgt:LINK_LIBRARIES'\fI\%LINK_LIBRARIES\fP\X'tty: link'
447
+ List of link libraries for linking the target, if it is an executable,
448
+ shared library, or module library. Entries for \fI\%Normal Libraries\fP are
449
+ passed to the linker either via paths to their link artifacts, or
450
+ with \fB\-l\fP flags or equivalent. Entries for \fI\%Object Libraries\fP are
451
+ passed to the linker via paths to their object files.
452
+ .sp
453
+ Additionally, for compiling and linking the target itself,
454
+ \fI\%usage requirements\fP are propagated from
455
+ \fBLINK_LIBRARIES\fP entries naming \fI\%Normal Libraries\fP,
456
+ \fI\%Interface Libraries\fP, \fI\%Object Libraries\fP, and \fI\%Imported Targets\fP,
457
+ collected over the transitive closure of their
458
+ \X'tty: link #prop_tgt:INTERFACE_LINK_LIBRARIES'\fI\%INTERFACE_LINK_LIBRARIES\fP\X'tty: link' properties.
459
+ .TP
460
+ .B \X'tty: link #prop_tgt:LINK_DIRECTORIES'\fI\%LINK_DIRECTORIES\fP\X'tty: link'
461
+ Added in version 3.13.
462
+
463
+ .sp
464
+ List of link directories for linking the target, if it is an executable,
465
+ shared library, or module library. The directories are passed to the
466
+ linker with \fB\-L\fP flags, or equivalent.
467
+ .TP
468
+ .B \X'tty: link #prop_tgt:LINK_OPTIONS'\fI\%LINK_OPTIONS\fP\X'tty: link'
469
+ Added in version 3.13.
470
+
471
+ .sp
472
+ List of link options for linking the target, if it is an executable,
473
+ shared library, or module library. The options are passed to the
474
+ linker as flags, in the order of appearance.
475
+ .sp
476
+ Link options are automatically escaped for the shell.
477
+ .TP
478
+ .B \X'tty: link #prop_tgt:LINK_DEPENDS'\fI\%LINK_DEPENDS\fP\X'tty: link'
479
+ List of files on which linking the target depends, if it is an executable,
480
+ shared library, or module library. For example, linker scripts specified
481
+ via \X'tty: link #prop_tgt:LINK_OPTIONS'\fI\%LINK_OPTIONS\fP\X'tty: link' may be listed here such that changing them
482
+ causes binaries to be linked again.
483
+ .UNINDENT
484
+ .SS Target Usage Requirements
485
+ .sp
486
+ The \fIusage requirements\fP of a target are settings that propagate to consumers,
487
+ which link to the target via \X'tty: link #command:target_link_libraries'\fI\%target_link_libraries()\fP\X'tty: link', in order to
488
+ correctly compile and link with it. They are represented by transitive
489
+ \fI\%compile\fP and
490
+ \fI\%link\fP properties.
491
+ .sp
492
+ Note that usage requirements are not designed as a way to make downstreams
493
+ use particular \X'tty: link #prop_tgt:COMPILE_OPTIONS'\fI\%COMPILE_OPTIONS\fP\X'tty: link', \X'tty: link #prop_tgt:COMPILE_DEFINITIONS'\fI\%COMPILE_DEFINITIONS\fP\X'tty: link',
494
+ etc. for convenience only. The contents of the properties must be
495
+ \fBrequirements\fP, not merely recommendations.
496
+ .sp
497
+ See the \X'tty: link #creating-relocatable-packages'\fI\%Creating Relocatable Packages\fP\X'tty: link' section of the
498
+ \X'tty: link #manual:cmake-packages(7)'\fI\%cmake\-packages(7)\fP\X'tty: link' manual for discussion of additional care
499
+ that must be taken when specifying usage requirements while creating
500
+ packages for redistribution.
501
+ .sp
502
+ The usage requirements of a target can transitively propagate to the dependents.
503
+ The \X'tty: link #command:target_link_libraries'\fI\%target_link_libraries()\fP\X'tty: link' command has \fBPRIVATE\fP,
504
+ \fBINTERFACE\fP and \fBPUBLIC\fP keywords to control the propagation.
505
+ .INDENT 0.0
506
+ .INDENT 3.5
507
+ .sp
508
+ .nf
509
+ .ft C
510
+ add_library(archive archive.cpp)
511
+ target_compile_definitions(archive INTERFACE USING_ARCHIVE_LIB)
512
+
513
+ add_library(serialization serialization.cpp)
514
+ target_compile_definitions(serialization INTERFACE USING_SERIALIZATION_LIB)
515
+
516
+ add_library(archiveExtras extras.cpp)
517
+ target_link_libraries(archiveExtras PUBLIC archive)
518
+ target_link_libraries(archiveExtras PRIVATE serialization)
519
+ # archiveExtras is compiled with \-DUSING_ARCHIVE_LIB
520
+ # and \-DUSING_SERIALIZATION_LIB
521
+
522
+ add_executable(consumer consumer.cpp)
523
+ # consumer is compiled with \-DUSING_ARCHIVE_LIB
524
+ target_link_libraries(consumer archiveExtras)
525
+ .ft P
526
+ .fi
527
+ .UNINDENT
528
+ .UNINDENT
529
+ .sp
530
+ Because the \fBarchive\fP is a \fBPUBLIC\fP dependency of \fBarchiveExtras\fP, the
531
+ usage requirements of it are propagated to \fBconsumer\fP too.
532
+ .sp
533
+ Because
534
+ \fBserialization\fP is a \fBPRIVATE\fP dependency of \fBarchiveExtras\fP, the usage
535
+ requirements of it are not propagated to \fBconsumer\fP\&.
536
+ .sp
537
+ Generally, a dependency should be specified in a use of
538
+ \X'tty: link #command:target_link_libraries'\fI\%target_link_libraries()\fP\X'tty: link' with the \fBPRIVATE\fP keyword if it is used by
539
+ only the implementation of a library, and not in the header files. If a
540
+ dependency is additionally used in the header files of a library (e.g. for
541
+ class inheritance), then it should be specified as a \fBPUBLIC\fP dependency.
542
+ A dependency which is not used by the implementation of a library, but only by
543
+ its headers should be specified as an \fBINTERFACE\fP dependency. The
544
+ \X'tty: link #command:target_link_libraries'\fI\%target_link_libraries()\fP\X'tty: link' command may be invoked with multiple uses of
545
+ each keyword:
546
+ .INDENT 0.0
547
+ .INDENT 3.5
548
+ .sp
549
+ .nf
550
+ .ft C
551
+ target_link_libraries(archiveExtras
552
+ PUBLIC archive
553
+ PRIVATE serialization
554
+ )
555
+ .ft P
556
+ .fi
557
+ .UNINDENT
558
+ .UNINDENT
559
+ .sp
560
+ Usage requirements are propagated by reading the \fBINTERFACE_\fP variants
561
+ of target properties from dependencies and appending the values to the
562
+ non\-\fBINTERFACE_\fP variants of the operand. For example, the
563
+ \X'tty: link #prop_tgt:INTERFACE_INCLUDE_DIRECTORIES'\fI\%INTERFACE_INCLUDE_DIRECTORIES\fP\X'tty: link' of dependencies is read and
564
+ appended to the \X'tty: link #prop_tgt:INCLUDE_DIRECTORIES'\fI\%INCLUDE_DIRECTORIES\fP\X'tty: link' of the operand. In cases
565
+ where order is relevant and maintained, and the order resulting from the
566
+ \X'tty: link #command:target_link_libraries'\fI\%target_link_libraries()\fP\X'tty: link' calls does not allow correct compilation,
567
+ use of an appropriate command to set the property directly may update the
568
+ order.
569
+ .sp
570
+ For example, if the linked libraries for a target must be specified
571
+ in the order \fBlib1\fP \fBlib2\fP \fBlib3\fP , but the include directories must
572
+ be specified in the order \fBlib3\fP \fBlib1\fP \fBlib2\fP:
573
+ .INDENT 0.0
574
+ .INDENT 3.5
575
+ .sp
576
+ .nf
577
+ .ft C
578
+ target_link_libraries(myExe lib1 lib2 lib3)
579
+ target_include_directories(myExe
580
+ PRIVATE $<TARGET_PROPERTY:lib3,INTERFACE_INCLUDE_DIRECTORIES>)
581
+ .ft P
582
+ .fi
583
+ .UNINDENT
584
+ .UNINDENT
585
+ .sp
586
+ Note that care must be taken when specifying usage requirements for targets
587
+ which will be exported for installation using the \X'tty: link #export'\fI\%install(EXPORT)\fP\X'tty: link'
588
+ command. See \X'tty: link #creating-packages'\fI\%Creating Packages\fP\X'tty: link' for more.
589
+ .SS Transitive Compile Properties
590
+ .sp
591
+ These represent \fI\%usage requirements\fP for
592
+ compiling consumers.
593
+ .INDENT 0.0
594
+ .TP
595
+ .B \X'tty: link #prop_tgt:INTERFACE_COMPILE_DEFINITIONS'\fI\%INTERFACE_COMPILE_DEFINITIONS\fP\X'tty: link'
596
+ List of compile definitions for compiling sources in the target\(aqs consumers.
597
+ Typically these are used by the target\(aqs header files.
598
+ .TP
599
+ .B \X'tty: link #prop_tgt:INTERFACE_COMPILE_OPTIONS'\fI\%INTERFACE_COMPILE_OPTIONS\fP\X'tty: link'
600
+ List of compile options for compiling sources in the target\(aqs consumers.
601
+ .TP
602
+ .B \X'tty: link #prop_tgt:INTERFACE_COMPILE_FEATURES'\fI\%INTERFACE_COMPILE_FEATURES\fP\X'tty: link'
603
+ Added in version 3.1.
604
+
605
+ .sp
606
+ List of \X'tty: link #manual:cmake-compile-features(7)'\fI\%compile features\fP\X'tty: link' needed
607
+ for compiling sources in the target\(aqs consumers. Typically these
608
+ ensure the target\(aqs header files are processed when compiling consumers
609
+ using a sufficient language standard level.
610
+ .TP
611
+ .B \X'tty: link #prop_tgt:INTERFACE_INCLUDE_DIRECTORIES'\fI\%INTERFACE_INCLUDE_DIRECTORIES\fP\X'tty: link'
612
+ List of include directories for compiling sources in the target\(aqs consumers.
613
+ Typically these are the locations of the target\(aqs header files.
614
+ .TP
615
+ .B \X'tty: link #prop_tgt:INTERFACE_SYSTEM_INCLUDE_DIRECTORIES'\fI\%INTERFACE_SYSTEM_INCLUDE_DIRECTORIES\fP\X'tty: link'
616
+ List of directories that, when specified as include directories, e.g., by
617
+ \X'tty: link #prop_tgt:INCLUDE_DIRECTORIES'\fI\%INCLUDE_DIRECTORIES\fP\X'tty: link' or \X'tty: link #prop_tgt:INTERFACE_INCLUDE_DIRECTORIES'\fI\%INTERFACE_INCLUDE_DIRECTORIES\fP\X'tty: link',
618
+ should be treated as \(dqsystem\(dq include directories when compiling sources
619
+ in the target\(aqs consumers.
620
+ .TP
621
+ .B \X'tty: link #prop_tgt:INTERFACE_SOURCES'\fI\%INTERFACE_SOURCES\fP\X'tty: link'
622
+ List of source files to associate with the target\(aqs consumers.
623
+ .TP
624
+ .B \X'tty: link #prop_tgt:INTERFACE_PRECOMPILE_HEADERS'\fI\%INTERFACE_PRECOMPILE_HEADERS\fP\X'tty: link'
625
+ Added in version 3.16.
626
+
627
+ .sp
628
+ List of header files to precompile and include when compiling
629
+ sources in the target\(aqs consumers.
630
+ .TP
631
+ .B \X'tty: link #prop_tgt:INTERFACE_AUTOMOC_MACRO_NAMES'\fI\%INTERFACE_AUTOMOC_MACRO_NAMES\fP\X'tty: link'
632
+ Added in version 3.27.
633
+
634
+ .sp
635
+ List of macro names used by \X'tty: link #prop_tgt:AUTOMOC'\fI\%AUTOMOC\fP\X'tty: link' to determine if a
636
+ C++ source in the target\(aqs consumers needs to be processed by \fBmoc\fP\&.
637
+ .TP
638
+ .B \X'tty: link #prop_tgt:INTERFACE_AUTOUIC_OPTIONS'\fI\%INTERFACE_AUTOUIC_OPTIONS\fP\X'tty: link'
639
+ Added in version 3.0.
640
+
641
+ .sp
642
+ List of options used by \X'tty: link #prop_tgt:AUTOUIC'\fI\%AUTOUIC\fP\X'tty: link' when invoking \fBuic\fP
643
+ for the target\(aqs consumers.
644
+ .UNINDENT
645
+ .SS Transitive Link Properties
646
+ .sp
647
+ These represent \fI\%usage requirements\fP for
648
+ linking consumers.
649
+ .INDENT 0.0
650
+ .TP
651
+ .B \X'tty: link #prop_tgt:INTERFACE_LINK_LIBRARIES'\fI\%INTERFACE_LINK_LIBRARIES\fP\X'tty: link'
652
+ List of link libraries for linking the target\(aqs consumers, for
653
+ those that are executables, shared libraries, or module libraries.
654
+ These are the transitive dependencies of the target.
655
+ .sp
656
+ Additionally, for compiling and linking the target\(aqs consumers,
657
+ \fI\%usage requirements\fP are collected from
658
+ the transitive closure of \fBINTERFACE_LINK_LIBRARIES\fP entries naming
659
+ \fI\%Normal Libraries\fP, \fI\%Interface Libraries\fP, \fI\%Object Libraries\fP,
660
+ and \fI\%Imported Targets\fP,
661
+ .TP
662
+ .B \X'tty: link #prop_tgt:INTERFACE_LINK_DIRECTORIES'\fI\%INTERFACE_LINK_DIRECTORIES\fP\X'tty: link'
663
+ Added in version 3.13.
664
+
665
+ .sp
666
+ List of link directories for linking the target\(aqs consumers, for
667
+ those that are executables, shared libraries, or module libraries.
668
+ .TP
669
+ .B \X'tty: link #prop_tgt:INTERFACE_LINK_OPTIONS'\fI\%INTERFACE_LINK_OPTIONS\fP\X'tty: link'
670
+ Added in version 3.13.
671
+
672
+ .sp
673
+ List of link options for linking the target\(aqs consumers, for
674
+ those that are executables, shared libraries, or module libraries.
675
+ .TP
676
+ .B \X'tty: link #prop_tgt:INTERFACE_LINK_DEPENDS'\fI\%INTERFACE_LINK_DEPENDS\fP\X'tty: link'
677
+ Added in version 3.13.
678
+
679
+ .sp
680
+ List of files on which linking the target\(aqs consumers depends, for
681
+ those that are executables, shared libraries, or module libraries.
682
+ .UNINDENT
683
+ .SS Custom Transitive Properties
684
+ .sp
685
+ Added in version 3.30.
686
+
687
+ .sp
688
+ The \X'tty: link #genex:TARGET_PROPERTY'\fI\%TARGET_PROPERTY\fP\X'tty: link' generator expression evaluates the above
689
+ \fI\%build specification\fP and
690
+ \fI\%usage requirement\fP properties
691
+ as builtin transitive properties. It also supports custom transitive
692
+ properties defined by the \X'tty: link #prop_tgt:TRANSITIVE_COMPILE_PROPERTIES'\fI\%TRANSITIVE_COMPILE_PROPERTIES\fP\X'tty: link'
693
+ and \X'tty: link #prop_tgt:TRANSITIVE_LINK_PROPERTIES'\fI\%TRANSITIVE_LINK_PROPERTIES\fP\X'tty: link' properties on the target
694
+ and its link dependencies.
695
+ .sp
696
+ For example:
697
+ .INDENT 0.0
698
+ .INDENT 3.5
699
+ .sp
700
+ .nf
701
+ .ft C
702
+ add_library(example INTERFACE)
703
+ set_target_properties(example PROPERTIES
704
+ TRANSITIVE_COMPILE_PROPERTIES \(dqCUSTOM_C\(dq
705
+ TRANSITIVE_LINK_PROPERTIES \(dqCUSTOM_L\(dq
706
+
707
+ INTERFACE_CUSTOM_C \(dqEXAMPLE_CUSTOM_C\(dq
708
+ INTERFACE_CUSTOM_L \(dqEXAMPLE_CUSTOM_L\(dq
709
+ )
710
+
711
+ add_library(mylib STATIC mylib.c)
712
+ target_link_libraries(mylib PRIVATE example)
713
+ set_target_properties(mylib PROPERTIES
714
+ CUSTOM_C \(dqMYLIB_PRIVATE_CUSTOM_C\(dq
715
+ CUSTOM_L \(dqMYLIB_PRIVATE_CUSTOM_L\(dq
716
+ INTERFACE_CUSTOM_C \(dqMYLIB_IFACE_CUSTOM_C\(dq
717
+ INTERFACE_CUSTOM_L \(dqMYLIB_IFACE_CUSTOM_L\(dq
718
+ )
719
+
720
+ add_executable(myexe myexe.c)
721
+ target_link_libraries(myexe PRIVATE mylib)
722
+ set_target_properties(myexe PROPERTIES
723
+ CUSTOM_C \(dqMYEXE_CUSTOM_C\(dq
724
+ CUSTOM_L \(dqMYEXE_CUSTOM_L\(dq
725
+ )
726
+
727
+ add_custom_target(print ALL VERBATIM
728
+ COMMAND ${CMAKE_COMMAND} \-E echo
729
+ # Prints \(dqMYLIB_PRIVATE_CUSTOM_C;EXAMPLE_CUSTOM_C\(dq
730
+ \(dq$<TARGET_PROPERTY:mylib,CUSTOM_C>\(dq
731
+
732
+ # Prints \(dqMYLIB_PRIVATE_CUSTOM_L;EXAMPLE_CUSTOM_L\(dq
733
+ \(dq$<TARGET_PROPERTY:mylib,CUSTOM_L>\(dq
734
+
735
+ # Prints \(dqMYEXE_CUSTOM_C\(dq
736
+ \(dq$<TARGET_PROPERTY:myexe,CUSTOM_C>\(dq
737
+
738
+ # Prints \(dqMYEXE_CUSTOM_L;MYLIB_IFACE_CUSTOM_L;EXAMPLE_CUSTOM_L\(dq
739
+ \(dq$<TARGET_PROPERTY:myexe,CUSTOM_L>\(dq
740
+ )
741
+ .ft P
742
+ .fi
743
+ .UNINDENT
744
+ .UNINDENT
745
+ .SS Compatible Interface Properties
746
+ .sp
747
+ Some target properties are required to be compatible between a target and
748
+ the interface of each dependency. For example, the
749
+ \X'tty: link #prop_tgt:POSITION_INDEPENDENT_CODE'\fI\%POSITION_INDEPENDENT_CODE\fP\X'tty: link' target property may specify a
750
+ boolean value of whether a target should be compiled as
751
+ position\-independent\-code, which has platform\-specific consequences.
752
+ A target may also specify the usage requirement
753
+ \X'tty: link #prop_tgt:INTERFACE_POSITION_INDEPENDENT_CODE'\fI\%INTERFACE_POSITION_INDEPENDENT_CODE\fP\X'tty: link' to communicate that
754
+ consumers must be compiled as position\-independent\-code.
755
+ .INDENT 0.0
756
+ .INDENT 3.5
757
+ .sp
758
+ .nf
759
+ .ft C
760
+ add_executable(exe1 exe1.cpp)
761
+ set_property(TARGET exe1 PROPERTY POSITION_INDEPENDENT_CODE ON)
762
+
763
+ add_library(lib1 SHARED lib1.cpp)
764
+ set_property(TARGET lib1 PROPERTY INTERFACE_POSITION_INDEPENDENT_CODE ON)
765
+
766
+ add_executable(exe2 exe2.cpp)
767
+ target_link_libraries(exe2 lib1)
768
+ .ft P
769
+ .fi
770
+ .UNINDENT
771
+ .UNINDENT
772
+ .sp
773
+ Here, both \fBexe1\fP and \fBexe2\fP will be compiled as position\-independent\-code.
774
+ \fBlib1\fP will also be compiled as position\-independent\-code because that is the
775
+ default setting for \fBSHARED\fP libraries. If dependencies have conflicting,
776
+ non\-compatible requirements \X'tty: link #manual:cmake(1)'\fI\%cmake(1)\fP\X'tty: link' issues a diagnostic:
777
+ .INDENT 0.0
778
+ .INDENT 3.5
779
+ .sp
780
+ .nf
781
+ .ft C
782
+ add_library(lib1 SHARED lib1.cpp)
783
+ set_property(TARGET lib1 PROPERTY INTERFACE_POSITION_INDEPENDENT_CODE ON)
784
+
785
+ add_library(lib2 SHARED lib2.cpp)
786
+ set_property(TARGET lib2 PROPERTY INTERFACE_POSITION_INDEPENDENT_CODE OFF)
787
+
788
+ add_executable(exe1 exe1.cpp)
789
+ target_link_libraries(exe1 lib1)
790
+ set_property(TARGET exe1 PROPERTY POSITION_INDEPENDENT_CODE OFF)
791
+
792
+ add_executable(exe2 exe2.cpp)
793
+ target_link_libraries(exe2 lib1 lib2)
794
+ .ft P
795
+ .fi
796
+ .UNINDENT
797
+ .UNINDENT
798
+ .sp
799
+ The \fBlib1\fP requirement \fBINTERFACE_POSITION_INDEPENDENT_CODE\fP is not
800
+ \(dqcompatible\(dq with the \X'tty: link #prop_tgt:POSITION_INDEPENDENT_CODE'\fI\%POSITION_INDEPENDENT_CODE\fP\X'tty: link' property of
801
+ the \fBexe1\fP target. The library requires that consumers are built as
802
+ position\-independent\-code, while the executable specifies to not built as
803
+ position\-independent\-code, so a diagnostic is issued.
804
+ .sp
805
+ The \fBlib1\fP and \fBlib2\fP requirements are not \(dqcompatible\(dq. One of them
806
+ requires that consumers are built as position\-independent\-code, while
807
+ the other requires that consumers are not built as position\-independent\-code.
808
+ Because \fBexe2\fP links to both and they are in conflict, a CMake error message
809
+ is issued:
810
+ .INDENT 0.0
811
+ .INDENT 3.5
812
+ .sp
813
+ .nf
814
+ .ft C
815
+ CMake Error: The INTERFACE_POSITION_INDEPENDENT_CODE property of \(dqlib2\(dq does
816
+ not agree with the value of POSITION_INDEPENDENT_CODE already determined
817
+ for \(dqexe2\(dq.
818
+ .ft P
819
+ .fi
820
+ .UNINDENT
821
+ .UNINDENT
822
+ .sp
823
+ To be \(dqcompatible\(dq, the \X'tty: link #prop_tgt:POSITION_INDEPENDENT_CODE'\fI\%POSITION_INDEPENDENT_CODE\fP\X'tty: link' property,
824
+ if set must be either the same, in a boolean sense, as the
825
+ \X'tty: link #prop_tgt:INTERFACE_POSITION_INDEPENDENT_CODE'\fI\%INTERFACE_POSITION_INDEPENDENT_CODE\fP\X'tty: link' property of all transitively
826
+ specified dependencies on which that property is set.
827
+ .sp
828
+ This property of \(dqcompatible interface requirement\(dq may be extended to other
829
+ properties by specifying the property in the content of the
830
+ \X'tty: link #prop_tgt:COMPATIBLE_INTERFACE_BOOL'\fI\%COMPATIBLE_INTERFACE_BOOL\fP\X'tty: link' target property. Each specified property
831
+ must be compatible between the consuming target and the corresponding property
832
+ with an \fBINTERFACE_\fP prefix from each dependency:
833
+ .INDENT 0.0
834
+ .INDENT 3.5
835
+ .sp
836
+ .nf
837
+ .ft C
838
+ add_library(lib1Version2 SHARED lib1_v2.cpp)
839
+ set_property(TARGET lib1Version2 PROPERTY INTERFACE_CUSTOM_PROP ON)
840
+ set_property(TARGET lib1Version2 APPEND PROPERTY
841
+ COMPATIBLE_INTERFACE_BOOL CUSTOM_PROP
842
+ )
843
+
844
+ add_library(lib1Version3 SHARED lib1_v3.cpp)
845
+ set_property(TARGET lib1Version3 PROPERTY INTERFACE_CUSTOM_PROP OFF)
846
+
847
+ add_executable(exe1 exe1.cpp)
848
+ target_link_libraries(exe1 lib1Version2) # CUSTOM_PROP will be ON
849
+
850
+ add_executable(exe2 exe2.cpp)
851
+ target_link_libraries(exe2 lib1Version2 lib1Version3) # Diagnostic
852
+ .ft P
853
+ .fi
854
+ .UNINDENT
855
+ .UNINDENT
856
+ .sp
857
+ Non\-boolean properties may also participate in \(dqcompatible interface\(dq
858
+ computations. Properties specified in the
859
+ \X'tty: link #prop_tgt:COMPATIBLE_INTERFACE_STRING'\fI\%COMPATIBLE_INTERFACE_STRING\fP\X'tty: link'
860
+ property must be either unspecified or compare to the same string among
861
+ all transitively specified dependencies. This can be useful to ensure
862
+ that multiple incompatible versions of a library are not linked together
863
+ through transitive requirements of a target:
864
+ .INDENT 0.0
865
+ .INDENT 3.5
866
+ .sp
867
+ .nf
868
+ .ft C
869
+ add_library(lib1Version2 SHARED lib1_v2.cpp)
870
+ set_property(TARGET lib1Version2 PROPERTY INTERFACE_LIB_VERSION 2)
871
+ set_property(TARGET lib1Version2 APPEND PROPERTY
872
+ COMPATIBLE_INTERFACE_STRING LIB_VERSION
873
+ )
874
+
875
+ add_library(lib1Version3 SHARED lib1_v3.cpp)
876
+ set_property(TARGET lib1Version3 PROPERTY INTERFACE_LIB_VERSION 3)
877
+
878
+ add_executable(exe1 exe1.cpp)
879
+ target_link_libraries(exe1 lib1Version2) # LIB_VERSION will be \(dq2\(dq
880
+
881
+ add_executable(exe2 exe2.cpp)
882
+ target_link_libraries(exe2 lib1Version2 lib1Version3) # Diagnostic
883
+ .ft P
884
+ .fi
885
+ .UNINDENT
886
+ .UNINDENT
887
+ .sp
888
+ The \X'tty: link #prop_tgt:COMPATIBLE_INTERFACE_NUMBER_MAX'\fI\%COMPATIBLE_INTERFACE_NUMBER_MAX\fP\X'tty: link' target property specifies
889
+ that content will be evaluated numerically and the maximum number among all
890
+ specified will be calculated:
891
+ .INDENT 0.0
892
+ .INDENT 3.5
893
+ .sp
894
+ .nf
895
+ .ft C
896
+ add_library(lib1Version2 SHARED lib1_v2.cpp)
897
+ set_property(TARGET lib1Version2 PROPERTY INTERFACE_CONTAINER_SIZE_REQUIRED 200)
898
+ set_property(TARGET lib1Version2 APPEND PROPERTY
899
+ COMPATIBLE_INTERFACE_NUMBER_MAX CONTAINER_SIZE_REQUIRED
900
+ )
901
+
902
+ add_library(lib1Version3 SHARED lib1_v3.cpp)
903
+ set_property(TARGET lib1Version3 PROPERTY INTERFACE_CONTAINER_SIZE_REQUIRED 1000)
904
+
905
+ add_executable(exe1 exe1.cpp)
906
+ # CONTAINER_SIZE_REQUIRED will be \(dq200\(dq
907
+ target_link_libraries(exe1 lib1Version2)
908
+
909
+ add_executable(exe2 exe2.cpp)
910
+ # CONTAINER_SIZE_REQUIRED will be \(dq1000\(dq
911
+ target_link_libraries(exe2 lib1Version2 lib1Version3)
912
+ .ft P
913
+ .fi
914
+ .UNINDENT
915
+ .UNINDENT
916
+ .sp
917
+ Similarly, the \X'tty: link #prop_tgt:COMPATIBLE_INTERFACE_NUMBER_MIN'\fI\%COMPATIBLE_INTERFACE_NUMBER_MIN\fP\X'tty: link' may be used to
918
+ calculate the numeric minimum value for a property from dependencies.
919
+ .sp
920
+ Each calculated \(dqcompatible\(dq property value may be read in the consumer at
921
+ generate\-time using generator expressions.
922
+ .sp
923
+ Note that for each dependee, the set of properties specified in each
924
+ compatible interface property must not intersect with the set specified in
925
+ any of the other properties.
926
+ .SS Property Origin Debugging
927
+ .sp
928
+ Because build specifications can be determined by dependencies, the lack of
929
+ locality of code which creates a target and code which is responsible for
930
+ setting build specifications may make the code more difficult to reason about.
931
+ \X'tty: link #manual:cmake(1)'\fI\%cmake(1)\fP\X'tty: link' provides a debugging facility to print the origin of the
932
+ contents of properties which may be determined by dependencies. The properties
933
+ which can be debugged are listed in the
934
+ \X'tty: link #variable:CMAKE_DEBUG_TARGET_PROPERTIES'\fI\%CMAKE_DEBUG_TARGET_PROPERTIES\fP\X'tty: link' variable documentation:
935
+ .INDENT 0.0
936
+ .INDENT 3.5
937
+ .sp
938
+ .nf
939
+ .ft C
940
+ set(CMAKE_DEBUG_TARGET_PROPERTIES
941
+ INCLUDE_DIRECTORIES
942
+ COMPILE_DEFINITIONS
943
+ POSITION_INDEPENDENT_CODE
944
+ CONTAINER_SIZE_REQUIRED
945
+ LIB_VERSION
946
+ )
947
+ add_executable(exe1 exe1.cpp)
948
+ .ft P
949
+ .fi
950
+ .UNINDENT
951
+ .UNINDENT
952
+ .sp
953
+ In the case of properties listed in \X'tty: link #prop_tgt:COMPATIBLE_INTERFACE_BOOL'\fI\%COMPATIBLE_INTERFACE_BOOL\fP\X'tty: link' or
954
+ \X'tty: link #prop_tgt:COMPATIBLE_INTERFACE_STRING'\fI\%COMPATIBLE_INTERFACE_STRING\fP\X'tty: link', the debug output shows which target
955
+ was responsible for setting the property, and which other dependencies also
956
+ defined the property. In the case of
957
+ \X'tty: link #prop_tgt:COMPATIBLE_INTERFACE_NUMBER_MAX'\fI\%COMPATIBLE_INTERFACE_NUMBER_MAX\fP\X'tty: link' and
958
+ \X'tty: link #prop_tgt:COMPATIBLE_INTERFACE_NUMBER_MIN'\fI\%COMPATIBLE_INTERFACE_NUMBER_MIN\fP\X'tty: link', the debug output shows the
959
+ value of the property from each dependency, and whether the value determines
960
+ the new extreme.
961
+ .SS Build Specification with Generator Expressions
962
+ .sp
963
+ Build specifications may use
964
+ \X'tty: link #manual:cmake-generator-expressions(7)'\fI\%generator expressions\fP\X'tty: link' containing
965
+ content which may be conditional or known only at generate\-time. For example,
966
+ the calculated \(dqcompatible\(dq value of a property may be read with the
967
+ \fBTARGET_PROPERTY\fP expression:
968
+ .INDENT 0.0
969
+ .INDENT 3.5
970
+ .sp
971
+ .nf
972
+ .ft C
973
+ add_library(lib1Version2 SHARED lib1_v2.cpp)
974
+ set_property(TARGET lib1Version2 PROPERTY
975
+ INTERFACE_CONTAINER_SIZE_REQUIRED 200)
976
+ set_property(TARGET lib1Version2 APPEND PROPERTY
977
+ COMPATIBLE_INTERFACE_NUMBER_MAX CONTAINER_SIZE_REQUIRED
978
+ )
979
+
980
+ add_executable(exe1 exe1.cpp)
981
+ target_link_libraries(exe1 lib1Version2)
982
+ target_compile_definitions(exe1 PRIVATE
983
+ CONTAINER_SIZE=$<TARGET_PROPERTY:CONTAINER_SIZE_REQUIRED>
984
+ )
985
+ .ft P
986
+ .fi
987
+ .UNINDENT
988
+ .UNINDENT
989
+ .sp
990
+ In this case, the \fBexe1\fP source files will be compiled with
991
+ \fB\-DCONTAINER_SIZE=200\fP\&.
992
+ .sp
993
+ The unary \fBTARGET_PROPERTY\fP generator expression and the \fBTARGET_POLICY\fP
994
+ generator expression are evaluated with the consuming target context. This
995
+ means that a usage requirement specification may be evaluated differently based
996
+ on the consumer:
997
+ .INDENT 0.0
998
+ .INDENT 3.5
999
+ .sp
1000
+ .nf
1001
+ .ft C
1002
+ add_library(lib1 lib1.cpp)
1003
+ target_compile_definitions(lib1 INTERFACE
1004
+ $<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:LIB1_WITH_EXE>
1005
+ $<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:LIB1_WITH_SHARED_LIB>
1006
+ $<$<TARGET_POLICY:CMP0041>:CONSUMER_CMP0041_NEW>
1007
+ )
1008
+
1009
+ add_executable(exe1 exe1.cpp)
1010
+ target_link_libraries(exe1 lib1)
1011
+
1012
+ cmake_policy(SET CMP0041 NEW)
1013
+
1014
+ add_library(shared_lib shared_lib.cpp)
1015
+ target_link_libraries(shared_lib lib1)
1016
+ .ft P
1017
+ .fi
1018
+ .UNINDENT
1019
+ .UNINDENT
1020
+ .sp
1021
+ The \fBexe1\fP executable will be compiled with \fB\-DLIB1_WITH_EXE\fP, while the
1022
+ \fBshared_lib\fP shared library will be compiled with \fB\-DLIB1_WITH_SHARED_LIB\fP
1023
+ and \fB\-DCONSUMER_CMP0041_NEW\fP, because policy \X'tty: link #policy:CMP0041'\fI\%CMP0041\fP\X'tty: link' is
1024
+ \fBNEW\fP at the point where the \fBshared_lib\fP target is created.
1025
+ .sp
1026
+ The \fBBUILD_INTERFACE\fP expression wraps requirements which are only used when
1027
+ consumed from a target in the same buildsystem, or when consumed from a target
1028
+ exported to the build directory using the \X'tty: link #command:export'\fI\%export()\fP\X'tty: link' command. The
1029
+ \fBINSTALL_INTERFACE\fP expression wraps requirements which are only used when
1030
+ consumed from a target which has been installed and exported with the
1031
+ \X'tty: link #export'\fI\%install(EXPORT)\fP\X'tty: link' command:
1032
+ .INDENT 0.0
1033
+ .INDENT 3.5
1034
+ .sp
1035
+ .nf
1036
+ .ft C
1037
+ add_library(ClimbingStats climbingstats.cpp)
1038
+ target_compile_definitions(ClimbingStats INTERFACE
1039
+ $<BUILD_INTERFACE:ClimbingStats_FROM_BUILD_LOCATION>
1040
+ $<INSTALL_INTERFACE:ClimbingStats_FROM_INSTALLED_LOCATION>
1041
+ )
1042
+ install(TARGETS ClimbingStats EXPORT libExport ${InstallArgs})
1043
+ install(EXPORT libExport NAMESPACE Upstream::
1044
+ DESTINATION lib/cmake/ClimbingStats)
1045
+ export(EXPORT libExport NAMESPACE Upstream::)
1046
+
1047
+ add_executable(exe1 exe1.cpp)
1048
+ target_link_libraries(exe1 ClimbingStats)
1049
+ .ft P
1050
+ .fi
1051
+ .UNINDENT
1052
+ .UNINDENT
1053
+ .sp
1054
+ In this case, the \fBexe1\fP executable will be compiled with
1055
+ \fB\-DClimbingStats_FROM_BUILD_LOCATION\fP\&. The exporting commands generate
1056
+ \X'tty: link #prop_tgt:IMPORTED'\fI\%IMPORTED\fP\X'tty: link' targets with either the \fBINSTALL_INTERFACE\fP or the
1057
+ \fBBUILD_INTERFACE\fP omitted, and the \fB*_INTERFACE\fP marker stripped away.
1058
+ A separate project consuming the \fBClimbingStats\fP package would contain:
1059
+ .INDENT 0.0
1060
+ .INDENT 3.5
1061
+ .sp
1062
+ .nf
1063
+ .ft C
1064
+ find_package(ClimbingStats REQUIRED)
1065
+
1066
+ add_executable(Downstream main.cpp)
1067
+ target_link_libraries(Downstream Upstream::ClimbingStats)
1068
+ .ft P
1069
+ .fi
1070
+ .UNINDENT
1071
+ .UNINDENT
1072
+ .sp
1073
+ Depending on whether the \fBClimbingStats\fP package was used from the build
1074
+ location or the install location, the \fBDownstream\fP target would be compiled
1075
+ with either \fB\-DClimbingStats_FROM_BUILD_LOCATION\fP or
1076
+ \fB\-DClimbingStats_FROM_INSTALL_LOCATION\fP\&. For more about packages and
1077
+ exporting see the \X'tty: link #manual:cmake-packages(7)'\fI\%cmake\-packages(7)\fP\X'tty: link' manual.
1078
+ .SS Include Directories and Usage Requirements
1079
+ .sp
1080
+ Include directories require some special consideration when specified as usage
1081
+ requirements and when used with generator expressions. The
1082
+ \X'tty: link #command:target_include_directories'\fI\%target_include_directories()\fP\X'tty: link' command accepts both relative and
1083
+ absolute include directories:
1084
+ .INDENT 0.0
1085
+ .INDENT 3.5
1086
+ .sp
1087
+ .nf
1088
+ .ft C
1089
+ add_library(lib1 lib1.cpp)
1090
+ target_include_directories(lib1 PRIVATE
1091
+ /absolute/path
1092
+ relative/path
1093
+ )
1094
+ .ft P
1095
+ .fi
1096
+ .UNINDENT
1097
+ .UNINDENT
1098
+ .sp
1099
+ Relative paths are interpreted relative to the source directory where the
1100
+ command appears. Relative paths are not allowed in the
1101
+ \X'tty: link #prop_tgt:INTERFACE_INCLUDE_DIRECTORIES'\fI\%INTERFACE_INCLUDE_DIRECTORIES\fP\X'tty: link' of \X'tty: link #prop_tgt:IMPORTED'\fI\%IMPORTED\fP\X'tty: link' targets.
1102
+ .sp
1103
+ In cases where a non\-trivial generator expression is used, the
1104
+ \fBINSTALL_PREFIX\fP expression may be used within the argument of an
1105
+ \fBINSTALL_INTERFACE\fP expression. It is a replacement marker which
1106
+ expands to the installation prefix when imported by a consuming project.
1107
+ .sp
1108
+ Include directories usage requirements commonly differ between the build\-tree
1109
+ and the install\-tree. The \fBBUILD_INTERFACE\fP and \fBINSTALL_INTERFACE\fP
1110
+ generator expressions can be used to describe separate usage requirements
1111
+ based on the usage location. Relative paths are allowed within the
1112
+ \fBINSTALL_INTERFACE\fP expression and are interpreted relative to the
1113
+ installation prefix. For example:
1114
+ .INDENT 0.0
1115
+ .INDENT 3.5
1116
+ .sp
1117
+ .nf
1118
+ .ft C
1119
+ add_library(ClimbingStats climbingstats.cpp)
1120
+ target_include_directories(ClimbingStats INTERFACE
1121
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/generated>
1122
+ $<INSTALL_INTERFACE:/absolute/path>
1123
+ $<INSTALL_INTERFACE:relative/path>
1124
+ $<INSTALL_INTERFACE:$<INSTALL_PREFIX>/$<CONFIG>/generated>
1125
+ )
1126
+ .ft P
1127
+ .fi
1128
+ .UNINDENT
1129
+ .UNINDENT
1130
+ .sp
1131
+ Two convenience APIs are provided relating to include directories usage
1132
+ requirements. The \X'tty: link #variable:CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE'\fI\%CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE\fP\X'tty: link' variable
1133
+ may be enabled, with an equivalent effect to:
1134
+ .INDENT 0.0
1135
+ .INDENT 3.5
1136
+ .sp
1137
+ .nf
1138
+ .ft C
1139
+ set_property(TARGET tgt APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
1140
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_CURRENT_BINARY_DIR}>
1141
+ )
1142
+ .ft P
1143
+ .fi
1144
+ .UNINDENT
1145
+ .UNINDENT
1146
+ .sp
1147
+ for each target affected. The convenience for installed targets is
1148
+ an \fBINCLUDES DESTINATION\fP component with the \X'tty: link #targets'\fI\%install(TARGETS)\fP\X'tty: link'
1149
+ command:
1150
+ .INDENT 0.0
1151
+ .INDENT 3.5
1152
+ .sp
1153
+ .nf
1154
+ .ft C
1155
+ install(TARGETS foo bar bat EXPORT tgts ${dest_args}
1156
+ INCLUDES DESTINATION include
1157
+ )
1158
+ install(EXPORT tgts ${other_args})
1159
+ install(FILES ${headers} DESTINATION include)
1160
+ .ft P
1161
+ .fi
1162
+ .UNINDENT
1163
+ .UNINDENT
1164
+ .sp
1165
+ This is equivalent to appending \fB${CMAKE_INSTALL_PREFIX}/include\fP to the
1166
+ \X'tty: link #prop_tgt:INTERFACE_INCLUDE_DIRECTORIES'\fI\%INTERFACE_INCLUDE_DIRECTORIES\fP\X'tty: link' of each of the installed
1167
+ \X'tty: link #prop_tgt:IMPORTED'\fI\%IMPORTED\fP\X'tty: link' targets when generated by \X'tty: link #export'\fI\%install(EXPORT)\fP\X'tty: link'\&.
1168
+ .sp
1169
+ When the \X'tty: link #prop_tgt:INTERFACE_INCLUDE_DIRECTORIES'\fI\%INTERFACE_INCLUDE_DIRECTORIES\fP\X'tty: link' of an
1170
+ \fI\%imported target\fP is consumed, the entries in the
1171
+ property may be treated as system include directories. The effects of that
1172
+ are toolchain\-dependent, but one common effect is to omit compiler warnings
1173
+ for headers found in those directories. The \X'tty: link #prop_tgt:SYSTEM'\fI\%SYSTEM\fP\X'tty: link' property of
1174
+ the installed target determines this behavior (see the
1175
+ \X'tty: link #prop_tgt:EXPORT_NO_SYSTEM'\fI\%EXPORT_NO_SYSTEM\fP\X'tty: link' property for how to modify the installed value
1176
+ for a target). It is also possible to change how consumers interpret the
1177
+ system behavior of consumed imported targets by setting the
1178
+ \X'tty: link #prop_tgt:NO_SYSTEM_FROM_IMPORTED'\fI\%NO_SYSTEM_FROM_IMPORTED\fP\X'tty: link' target property on the \fIconsumer\fP\&.
1179
+ .sp
1180
+ If a binary target is linked transitively to a macOS \X'tty: link #prop_tgt:FRAMEWORK'\fI\%FRAMEWORK\fP\X'tty: link', the
1181
+ \fBHeaders\fP directory of the framework is also treated as a usage requirement.
1182
+ This has the same effect as passing the framework directory as an include
1183
+ directory.
1184
+ .SS Link Libraries and Generator Expressions
1185
+ .sp
1186
+ Like build specifications, \X'tty: link #prop_tgt:LINK_LIBRARIES'\fI\%link libraries\fP\X'tty: link' may be
1187
+ specified with generator expression conditions. However, as consumption of
1188
+ usage requirements is based on collection from linked dependencies, there is
1189
+ an additional limitation that the link dependencies must form a \(dqdirected
1190
+ acyclic graph\(dq. That is, if linking to a target is dependent on the value of
1191
+ a target property, that target property may not be dependent on the linked
1192
+ dependencies:
1193
+ .INDENT 0.0
1194
+ .INDENT 3.5
1195
+ .sp
1196
+ .nf
1197
+ .ft C
1198
+ add_library(lib1 lib1.cpp)
1199
+ add_library(lib2 lib2.cpp)
1200
+ target_link_libraries(lib1 PUBLIC
1201
+ $<$<TARGET_PROPERTY:POSITION_INDEPENDENT_CODE>:lib2>
1202
+ )
1203
+ add_library(lib3 lib3.cpp)
1204
+ set_property(TARGET lib3 PROPERTY INTERFACE_POSITION_INDEPENDENT_CODE ON)
1205
+
1206
+ add_executable(exe1 exe1.cpp)
1207
+ target_link_libraries(exe1 lib1 lib3)
1208
+ .ft P
1209
+ .fi
1210
+ .UNINDENT
1211
+ .UNINDENT
1212
+ .sp
1213
+ As the value of the \X'tty: link #prop_tgt:POSITION_INDEPENDENT_CODE'\fI\%POSITION_INDEPENDENT_CODE\fP\X'tty: link' property of
1214
+ the \fBexe1\fP target is dependent on the linked libraries (\fBlib3\fP), and the
1215
+ edge of linking \fBexe1\fP is determined by the same
1216
+ \X'tty: link #prop_tgt:POSITION_INDEPENDENT_CODE'\fI\%POSITION_INDEPENDENT_CODE\fP\X'tty: link' property, the dependency graph above
1217
+ contains a cycle. \X'tty: link #manual:cmake(1)'\fI\%cmake(1)\fP\X'tty: link' issues an error message.
1218
+ .SS Output Artifacts
1219
+ .sp
1220
+ The buildsystem targets created by the \X'tty: link #command:add_library'\fI\%add_library()\fP\X'tty: link' and
1221
+ \X'tty: link #command:add_executable'\fI\%add_executable()\fP\X'tty: link' commands create rules to create binary outputs.
1222
+ The exact output location of the binaries can only be determined at
1223
+ generate\-time because it can depend on the build\-configuration and the
1224
+ link\-language of linked dependencies etc. \fBTARGET_FILE\fP,
1225
+ \fBTARGET_LINKER_FILE\fP and related expressions can be used to access the
1226
+ name and location of generated binaries. These expressions do not work
1227
+ for \fBOBJECT\fP libraries however, as there is no single file generated
1228
+ by such libraries which is relevant to the expressions.
1229
+ .sp
1230
+ There are three kinds of output artifacts that may be build by targets
1231
+ as detailed in the following sections. Their classification differs
1232
+ between DLL platforms and non\-DLL platforms. All Windows\-based
1233
+ systems including Cygwin are DLL platforms.
1234
+ .SS Runtime Output Artifacts
1235
+ .sp
1236
+ A \fIruntime\fP output artifact of a buildsystem target may be:
1237
+ .INDENT 0.0
1238
+ .IP \(bu 2
1239
+ The executable file (e.g. \fB\&.exe\fP) of an executable target
1240
+ created by the \X'tty: link #command:add_executable'\fI\%add_executable()\fP\X'tty: link' command.
1241
+ .IP \(bu 2
1242
+ On DLL platforms: the executable file (e.g. \fB\&.dll\fP) of a shared
1243
+ library target created by the \X'tty: link #command:add_library'\fI\%add_library()\fP\X'tty: link' command
1244
+ with the \fBSHARED\fP option.
1245
+ .UNINDENT
1246
+ .sp
1247
+ The \X'tty: link #prop_tgt:RUNTIME_OUTPUT_DIRECTORY'\fI\%RUNTIME_OUTPUT_DIRECTORY\fP\X'tty: link' and \X'tty: link #prop_tgt:RUNTIME_OUTPUT_NAME'\fI\%RUNTIME_OUTPUT_NAME\fP\X'tty: link'
1248
+ target properties may be used to control runtime output artifact locations
1249
+ and names in the build tree.
1250
+ .SS Library Output Artifacts
1251
+ .sp
1252
+ A \fIlibrary\fP output artifact of a buildsystem target may be:
1253
+ .INDENT 0.0
1254
+ .IP \(bu 2
1255
+ The loadable module file (e.g. \fB\&.dll\fP or \fB\&.so\fP) of a module
1256
+ library target created by the \X'tty: link #command:add_library'\fI\%add_library()\fP\X'tty: link' command
1257
+ with the \fBMODULE\fP option.
1258
+ .IP \(bu 2
1259
+ On non\-DLL platforms: the shared library file (e.g. \fB\&.so\fP or \fB\&.dylib\fP)
1260
+ of a shared library target created by the \X'tty: link #command:add_library'\fI\%add_library()\fP\X'tty: link'
1261
+ command with the \fBSHARED\fP option.
1262
+ .UNINDENT
1263
+ .sp
1264
+ The \X'tty: link #prop_tgt:LIBRARY_OUTPUT_DIRECTORY'\fI\%LIBRARY_OUTPUT_DIRECTORY\fP\X'tty: link' and \X'tty: link #prop_tgt:LIBRARY_OUTPUT_NAME'\fI\%LIBRARY_OUTPUT_NAME\fP\X'tty: link'
1265
+ target properties may be used to control library output artifact locations
1266
+ and names in the build tree.
1267
+ .SS Archive Output Artifacts
1268
+ .sp
1269
+ An \fIarchive\fP output artifact of a buildsystem target may be:
1270
+ .INDENT 0.0
1271
+ .IP \(bu 2
1272
+ The static library file (e.g. \fB\&.lib\fP or \fB\&.a\fP) of a static
1273
+ library target created by the \X'tty: link #command:add_library'\fI\%add_library()\fP\X'tty: link' command
1274
+ with the \fBSTATIC\fP option.
1275
+ .IP \(bu 2
1276
+ On DLL platforms: the import library file (e.g. \fB\&.lib\fP) of a shared
1277
+ library target created by the \X'tty: link #command:add_library'\fI\%add_library()\fP\X'tty: link' command
1278
+ with the \fBSHARED\fP option. This file is only guaranteed to exist if
1279
+ the library exports at least one unmanaged symbol.
1280
+ .IP \(bu 2
1281
+ On DLL platforms: the import library file (e.g. \fB\&.lib\fP) of an
1282
+ executable target created by the \X'tty: link #command:add_executable'\fI\%add_executable()\fP\X'tty: link' command
1283
+ when its \X'tty: link #prop_tgt:ENABLE_EXPORTS'\fI\%ENABLE_EXPORTS\fP\X'tty: link' target property is set.
1284
+ .IP \(bu 2
1285
+ On AIX: the linker import file (e.g. \fB\&.imp\fP) of an executable target
1286
+ created by the \X'tty: link #command:add_executable'\fI\%add_executable()\fP\X'tty: link' command when its
1287
+ \X'tty: link #prop_tgt:ENABLE_EXPORTS'\fI\%ENABLE_EXPORTS\fP\X'tty: link' target property is set.
1288
+ .IP \(bu 2
1289
+ On macOS: the linker import file (e.g. \fB\&.tbd\fP) of a shared library target
1290
+ created by the \X'tty: link #command:add_library'\fI\%add_library()\fP\X'tty: link' command with the \fBSHARED\fP option and
1291
+ when its \X'tty: link #prop_tgt:ENABLE_EXPORTS'\fI\%ENABLE_EXPORTS\fP\X'tty: link' target property is set.
1292
+ .UNINDENT
1293
+ .sp
1294
+ The \X'tty: link #prop_tgt:ARCHIVE_OUTPUT_DIRECTORY'\fI\%ARCHIVE_OUTPUT_DIRECTORY\fP\X'tty: link' and \X'tty: link #prop_tgt:ARCHIVE_OUTPUT_NAME'\fI\%ARCHIVE_OUTPUT_NAME\fP\X'tty: link'
1295
+ target properties may be used to control archive output artifact locations
1296
+ and names in the build tree.
1297
+ .SS Directory\-Scoped Commands
1298
+ .sp
1299
+ The \X'tty: link #command:target_include_directories'\fI\%target_include_directories()\fP\X'tty: link',
1300
+ \X'tty: link #command:target_compile_definitions'\fI\%target_compile_definitions()\fP\X'tty: link' and
1301
+ \X'tty: link #command:target_compile_options'\fI\%target_compile_options()\fP\X'tty: link' commands have an effect on only one
1302
+ target at a time. The commands \X'tty: link #command:add_compile_definitions'\fI\%add_compile_definitions()\fP\X'tty: link',
1303
+ \X'tty: link #command:add_compile_options'\fI\%add_compile_options()\fP\X'tty: link' and \X'tty: link #command:include_directories'\fI\%include_directories()\fP\X'tty: link' have
1304
+ a similar function, but operate at directory scope instead of target
1305
+ scope for convenience.
1306
+ .SH BUILD CONFIGURATIONS
1307
+ .sp
1308
+ Configurations determine specifications for a certain type of build, such
1309
+ as \fBRelease\fP or \fBDebug\fP\&. The way this is specified depends on the type
1310
+ of \X'tty: link #manual:cmake-generators(7)'\fI\%generator\fP\X'tty: link' being used. For single
1311
+ configuration generators like \X'tty: link #makefile-generators'\fI\%Makefile Generators\fP\X'tty: link' and
1312
+ \X'tty: link #generator:Ninja'\fI\%Ninja\fP\X'tty: link', the configuration is specified at configure time by the
1313
+ \X'tty: link #variable:CMAKE_BUILD_TYPE'\fI\%CMAKE_BUILD_TYPE\fP\X'tty: link' variable. For multi\-configuration generators
1314
+ like \X'tty: link #visual-studio-generators'\fI\%Visual Studio\fP\X'tty: link', \X'tty: link #generator:Xcode'\fI\%Xcode\fP\X'tty: link', and
1315
+ \X'tty: link #generator:Ninja Multi-Config'\fI\%Ninja Multi\-Config\fP\X'tty: link', the configuration is chosen by the user at
1316
+ build time and \X'tty: link #variable:CMAKE_BUILD_TYPE'\fI\%CMAKE_BUILD_TYPE\fP\X'tty: link' is ignored. In the
1317
+ multi\-configuration case, the set of \fIavailable\fP configurations is specified
1318
+ at configure time by the \X'tty: link #variable:CMAKE_CONFIGURATION_TYPES'\fI\%CMAKE_CONFIGURATION_TYPES\fP\X'tty: link' variable,
1319
+ but the actual configuration used cannot be known until the build stage.
1320
+ This difference is often misunderstood, leading to problematic code like the
1321
+ following:
1322
+ .INDENT 0.0
1323
+ .INDENT 3.5
1324
+ .sp
1325
+ .nf
1326
+ .ft C
1327
+ # WARNING: This is wrong for multi\-config generators because they don\(aqt use
1328
+ # and typically don\(aqt even set CMAKE_BUILD_TYPE
1329
+ string(TOLOWER ${CMAKE_BUILD_TYPE} build_type)
1330
+ if (build_type STREQUAL debug)
1331
+ target_compile_definitions(exe1 PRIVATE DEBUG_BUILD)
1332
+ endif()
1333
+ .ft P
1334
+ .fi
1335
+ .UNINDENT
1336
+ .UNINDENT
1337
+ .sp
1338
+ \X'tty: link #manual:cmake-generator-expressions(7)'\fI\%Generator expressions\fP\X'tty: link' should be
1339
+ used instead to handle configuration\-specific logic correctly, regardless of
1340
+ the generator used. For example:
1341
+ .INDENT 0.0
1342
+ .INDENT 3.5
1343
+ .sp
1344
+ .nf
1345
+ .ft C
1346
+ # Works correctly for both single and multi\-config generators
1347
+ target_compile_definitions(exe1 PRIVATE
1348
+ $<$<CONFIG:Debug>:DEBUG_BUILD>
1349
+ )
1350
+ .ft P
1351
+ .fi
1352
+ .UNINDENT
1353
+ .UNINDENT
1354
+ .sp
1355
+ In the presence of \X'tty: link #prop_tgt:IMPORTED'\fI\%IMPORTED\fP\X'tty: link' targets, the content of
1356
+ \X'tty: link #prop_tgt:MAP_IMPORTED_CONFIG_<CONFIG>'\fI\%MAP_IMPORTED_CONFIG_DEBUG\fP\X'tty: link' is also
1357
+ accounted for by the above \X'tty: link #genex:CONFIG'\fI\%$<CONFIG:Debug>\fP\X'tty: link' expression.
1358
+ .SS Case Sensitivity
1359
+ .sp
1360
+ \X'tty: link #variable:CMAKE_BUILD_TYPE'\fI\%CMAKE_BUILD_TYPE\fP\X'tty: link' and \X'tty: link #variable:CMAKE_CONFIGURATION_TYPES'\fI\%CMAKE_CONFIGURATION_TYPES\fP\X'tty: link' are
1361
+ just like other variables in that any string comparisons made with their
1362
+ values will be case\-sensitive. The \X'tty: link #genex:CONFIG'\fI\%$<CONFIG>\fP\X'tty: link' generator expression also
1363
+ preserves the casing of the configuration as set by the user or CMake defaults.
1364
+ For example:
1365
+ .INDENT 0.0
1366
+ .INDENT 3.5
1367
+ .sp
1368
+ .nf
1369
+ .ft C
1370
+ # NOTE: Don\(aqt use these patterns, they are for illustration purposes only.
1371
+
1372
+ set(CMAKE_BUILD_TYPE Debug)
1373
+ if(CMAKE_BUILD_TYPE STREQUAL DEBUG)
1374
+ # ... will never get here, \(dqDebug\(dq != \(dqDEBUG\(dq
1375
+ endif()
1376
+ add_custom_target(print_config ALL
1377
+ # Prints \(dqConfig is Debug\(dq in this single\-config case
1378
+ COMMAND ${CMAKE_COMMAND} \-E echo \(dqConfig is $<CONFIG>\(dq
1379
+ VERBATIM
1380
+ )
1381
+
1382
+ set(CMAKE_CONFIGURATION_TYPES Debug Release)
1383
+ if(DEBUG IN_LIST CMAKE_CONFIGURATION_TYPES)
1384
+ # ... will never get here, \(dqDebug\(dq != \(dqDEBUG\(dq
1385
+ endif()
1386
+ .ft P
1387
+ .fi
1388
+ .UNINDENT
1389
+ .UNINDENT
1390
+ .sp
1391
+ In contrast, CMake treats the configuration type case\-insensitively when
1392
+ using it internally in places that modify behavior based on the configuration.
1393
+ For example, the \X'tty: link #genex:CONFIG'\fI\%$<CONFIG:Debug>\fP\X'tty: link' generator expression will evaluate to 1
1394
+ for a configuration of not only \fBDebug\fP, but also \fBDEBUG\fP, \fBdebug\fP or
1395
+ even \fBDeBuG\fP\&. Therefore, you can specify configuration types in
1396
+ \X'tty: link #variable:CMAKE_BUILD_TYPE'\fI\%CMAKE_BUILD_TYPE\fP\X'tty: link' and \X'tty: link #variable:CMAKE_CONFIGURATION_TYPES'\fI\%CMAKE_CONFIGURATION_TYPES\fP\X'tty: link' with
1397
+ any mixture of upper and lowercase, although there are strong conventions
1398
+ (see the next section). If you must test the value in string comparisons,
1399
+ always convert the value to upper or lowercase first and adjust the test
1400
+ accordingly.
1401
+ .SS Default And Custom Configurations
1402
+ .sp
1403
+ By default, CMake defines a number of standard configurations:
1404
+ .INDENT 0.0
1405
+ .IP \(bu 2
1406
+ \fBDebug\fP
1407
+ .IP \(bu 2
1408
+ \fBRelease\fP
1409
+ .IP \(bu 2
1410
+ \fBRelWithDebInfo\fP
1411
+ .IP \(bu 2
1412
+ \fBMinSizeRel\fP
1413
+ .UNINDENT
1414
+ .sp
1415
+ In multi\-config generators, the \X'tty: link #variable:CMAKE_CONFIGURATION_TYPES'\fI\%CMAKE_CONFIGURATION_TYPES\fP\X'tty: link' variable
1416
+ will be populated with (potentially a subset of) the above list by default,
1417
+ unless overridden by the project or user. The actual configuration used is
1418
+ selected by the user at build time.
1419
+ .sp
1420
+ For single\-config generators, the configuration is specified with the
1421
+ \X'tty: link #variable:CMAKE_BUILD_TYPE'\fI\%CMAKE_BUILD_TYPE\fP\X'tty: link' variable at configure time and cannot be changed
1422
+ at build time. The default value will often be none of the above standard
1423
+ configurations and will instead be an empty string. A common misunderstanding
1424
+ is that this is the same as \fBDebug\fP, but that is not the case. Users should
1425
+ always explicitly specify the build type instead to avoid this common problem.
1426
+ .sp
1427
+ The above standard configuration types provide reasonable behavior on most
1428
+ platforms, but they can be extended to provide other types. Each configuration
1429
+ defines a set of compiler and linker flag variables for the language in use.
1430
+ These variables follow the convention \X'tty: link #variable:CMAKE_<LANG>_FLAGS_<CONFIG>'\fI\%CMAKE_<LANG>_FLAGS_<CONFIG>\fP\X'tty: link',
1431
+ where \fB<CONFIG>\fP is always the uppercase configuration name. When defining
1432
+ a custom configuration type, make sure these variables are set appropriately,
1433
+ typically as cache variables.
1434
+ .SH PSEUDO TARGETS
1435
+ .sp
1436
+ Some target types do not represent outputs of the buildsystem, but only inputs
1437
+ such as external dependencies, aliases or other non\-build artifacts. Pseudo
1438
+ targets are not represented in the generated buildsystem.
1439
+ .SS Imported Targets
1440
+ .sp
1441
+ An \X'tty: link #prop_tgt:IMPORTED'\fI\%IMPORTED\fP\X'tty: link' target represents a pre\-existing dependency. Usually
1442
+ such targets are defined by an upstream package and should be treated as
1443
+ immutable. After declaring an \X'tty: link #prop_tgt:IMPORTED'\fI\%IMPORTED\fP\X'tty: link' target one can adjust its
1444
+ target properties by using the customary commands such as
1445
+ \X'tty: link #command:target_compile_definitions'\fI\%target_compile_definitions()\fP\X'tty: link', \X'tty: link #command:target_include_directories'\fI\%target_include_directories()\fP\X'tty: link',
1446
+ \X'tty: link #command:target_compile_options'\fI\%target_compile_options()\fP\X'tty: link' or \X'tty: link #command:target_link_libraries'\fI\%target_link_libraries()\fP\X'tty: link' just like
1447
+ with any other regular target.
1448
+ .sp
1449
+ \X'tty: link #prop_tgt:IMPORTED'\fI\%IMPORTED\fP\X'tty: link' targets may have the same usage requirement properties
1450
+ populated as binary targets, such as
1451
+ \X'tty: link #prop_tgt:INTERFACE_INCLUDE_DIRECTORIES'\fI\%INTERFACE_INCLUDE_DIRECTORIES\fP\X'tty: link',
1452
+ \X'tty: link #prop_tgt:INTERFACE_COMPILE_DEFINITIONS'\fI\%INTERFACE_COMPILE_DEFINITIONS\fP\X'tty: link',
1453
+ \X'tty: link #prop_tgt:INTERFACE_COMPILE_OPTIONS'\fI\%INTERFACE_COMPILE_OPTIONS\fP\X'tty: link',
1454
+ \X'tty: link #prop_tgt:INTERFACE_LINK_LIBRARIES'\fI\%INTERFACE_LINK_LIBRARIES\fP\X'tty: link', and
1455
+ \X'tty: link #prop_tgt:INTERFACE_POSITION_INDEPENDENT_CODE'\fI\%INTERFACE_POSITION_INDEPENDENT_CODE\fP\X'tty: link'\&.
1456
+ .sp
1457
+ The \X'tty: link #prop_tgt:LOCATION'\fI\%LOCATION\fP\X'tty: link' may also be read from an IMPORTED target, though there
1458
+ is rarely reason to do so. Commands such as \X'tty: link #command:add_custom_command'\fI\%add_custom_command()\fP\X'tty: link' can
1459
+ transparently use an \X'tty: link #prop_tgt:IMPORTED'\fI\%IMPORTED\fP\X'tty: link' \X'tty: link #prop_tgt:TYPE'\fI\%EXECUTABLE\fP\X'tty: link' target
1460
+ as a \fBCOMMAND\fP executable.
1461
+ .sp
1462
+ The scope of the definition of an \X'tty: link #prop_tgt:IMPORTED'\fI\%IMPORTED\fP\X'tty: link' target is the directory
1463
+ where it was defined. It may be accessed and used from subdirectories, but
1464
+ not from parent directories or sibling directories. The scope is similar to
1465
+ the scope of a cmake variable.
1466
+ .sp
1467
+ It is also possible to define a \fBGLOBAL\fP \X'tty: link #prop_tgt:IMPORTED'\fI\%IMPORTED\fP\X'tty: link' target which is
1468
+ accessible globally in the buildsystem.
1469
+ .sp
1470
+ See the \X'tty: link #manual:cmake-packages(7)'\fI\%cmake\-packages(7)\fP\X'tty: link' manual for more on creating packages
1471
+ with \X'tty: link #prop_tgt:IMPORTED'\fI\%IMPORTED\fP\X'tty: link' targets.
1472
+ .SS Alias Targets
1473
+ .sp
1474
+ An \fBALIAS\fP target is a name which may be used interchangeably with
1475
+ a binary target name in read\-only contexts. A primary use\-case for \fBALIAS\fP
1476
+ targets is for example or unit test executables accompanying a library, which
1477
+ may be part of the same buildsystem or built separately based on user
1478
+ configuration.
1479
+ .INDENT 0.0
1480
+ .INDENT 3.5
1481
+ .sp
1482
+ .nf
1483
+ .ft C
1484
+ add_library(lib1 lib1.cpp)
1485
+ install(TARGETS lib1 EXPORT lib1Export ${dest_args})
1486
+ install(EXPORT lib1Export NAMESPACE Upstream:: ${other_args})
1487
+
1488
+ add_library(Upstream::lib1 ALIAS lib1)
1489
+ .ft P
1490
+ .fi
1491
+ .UNINDENT
1492
+ .UNINDENT
1493
+ .sp
1494
+ In another directory, we can link unconditionally to the \fBUpstream::lib1\fP
1495
+ target, which may be an \X'tty: link #prop_tgt:IMPORTED'\fI\%IMPORTED\fP\X'tty: link' target from a package, or an
1496
+ \fBALIAS\fP target if built as part of the same buildsystem.
1497
+ .INDENT 0.0
1498
+ .INDENT 3.5
1499
+ .sp
1500
+ .nf
1501
+ .ft C
1502
+ if (NOT TARGET Upstream::lib1)
1503
+ find_package(lib1 REQUIRED)
1504
+ endif()
1505
+ add_executable(exe1 exe1.cpp)
1506
+ target_link_libraries(exe1 Upstream::lib1)
1507
+ .ft P
1508
+ .fi
1509
+ .UNINDENT
1510
+ .UNINDENT
1511
+ .sp
1512
+ \fBALIAS\fP targets are not mutable, installable or exportable. They are
1513
+ entirely local to the buildsystem description. A name can be tested for
1514
+ whether it is an \fBALIAS\fP name by reading the \X'tty: link #prop_tgt:ALIASED_TARGET'\fI\%ALIASED_TARGET\fP\X'tty: link'
1515
+ property from it:
1516
+ .INDENT 0.0
1517
+ .INDENT 3.5
1518
+ .sp
1519
+ .nf
1520
+ .ft C
1521
+ get_target_property(_aliased Upstream::lib1 ALIASED_TARGET)
1522
+ if(_aliased)
1523
+ message(STATUS \(dqThe name Upstream::lib1 is an ALIAS for ${_aliased}.\(dq)
1524
+ endif()
1525
+ .ft P
1526
+ .fi
1527
+ .UNINDENT
1528
+ .UNINDENT
1529
+ .SS Interface Libraries
1530
+ .sp
1531
+ An \fBINTERFACE\fP library target does not compile sources and does not
1532
+ produce a library artifact on disk, so it has no \X'tty: link #prop_tgt:LOCATION'\fI\%LOCATION\fP\X'tty: link'\&.
1533
+ .sp
1534
+ It may specify usage requirements such as
1535
+ \X'tty: link #prop_tgt:INTERFACE_INCLUDE_DIRECTORIES'\fI\%INTERFACE_INCLUDE_DIRECTORIES\fP\X'tty: link',
1536
+ \X'tty: link #prop_tgt:INTERFACE_COMPILE_DEFINITIONS'\fI\%INTERFACE_COMPILE_DEFINITIONS\fP\X'tty: link',
1537
+ \X'tty: link #prop_tgt:INTERFACE_COMPILE_OPTIONS'\fI\%INTERFACE_COMPILE_OPTIONS\fP\X'tty: link',
1538
+ \X'tty: link #prop_tgt:INTERFACE_LINK_LIBRARIES'\fI\%INTERFACE_LINK_LIBRARIES\fP\X'tty: link',
1539
+ \X'tty: link #prop_tgt:INTERFACE_SOURCES'\fI\%INTERFACE_SOURCES\fP\X'tty: link',
1540
+ and \X'tty: link #prop_tgt:INTERFACE_POSITION_INDEPENDENT_CODE'\fI\%INTERFACE_POSITION_INDEPENDENT_CODE\fP\X'tty: link'\&.
1541
+ Only the \fBINTERFACE\fP modes of the \X'tty: link #command:target_include_directories'\fI\%target_include_directories()\fP\X'tty: link',
1542
+ \X'tty: link #command:target_compile_definitions'\fI\%target_compile_definitions()\fP\X'tty: link', \X'tty: link #command:target_compile_options'\fI\%target_compile_options()\fP\X'tty: link',
1543
+ \X'tty: link #command:target_sources'\fI\%target_sources()\fP\X'tty: link', and \X'tty: link #command:target_link_libraries'\fI\%target_link_libraries()\fP\X'tty: link' commands
1544
+ may be used with \fBINTERFACE\fP libraries.
1545
+ .sp
1546
+ Since CMake 3.19, an \fBINTERFACE\fP library target may optionally contain
1547
+ source files. An interface library that contains source files will be
1548
+ included as a build target in the generated buildsystem. It does not
1549
+ compile sources, but may contain custom commands to generate other sources.
1550
+ Additionally, IDEs will show the source files as part of the target for
1551
+ interactive reading and editing.
1552
+ .sp
1553
+ A primary use\-case for \fBINTERFACE\fP libraries is header\-only libraries.
1554
+ Since CMake 3.23, header files may be associated with a library by adding
1555
+ them to a header set using the \X'tty: link #command:target_sources'\fI\%target_sources()\fP\X'tty: link' command:
1556
+ .INDENT 0.0
1557
+ .INDENT 3.5
1558
+ .sp
1559
+ .nf
1560
+ .ft C
1561
+ add_library(Eigen INTERFACE)
1562
+
1563
+ target_sources(Eigen PUBLIC
1564
+ FILE_SET HEADERS
1565
+ BASE_DIRS src
1566
+ FILES src/eigen.h src/vector.h src/matrix.h
1567
+ )
1568
+
1569
+ add_executable(exe1 exe1.cpp)
1570
+ target_link_libraries(exe1 Eigen)
1571
+ .ft P
1572
+ .fi
1573
+ .UNINDENT
1574
+ .UNINDENT
1575
+ .sp
1576
+ When we specify the \fBFILE_SET\fP here, the \fBBASE_DIRS\fP we define automatically
1577
+ become include directories in the usage requirements for the target \fBEigen\fP\&.
1578
+ The usage requirements from the target are consumed and used when compiling, but
1579
+ have no effect on linking.
1580
+ .sp
1581
+ Another use\-case is to employ an entirely target\-focussed design for usage
1582
+ requirements:
1583
+ .INDENT 0.0
1584
+ .INDENT 3.5
1585
+ .sp
1586
+ .nf
1587
+ .ft C
1588
+ add_library(pic_on INTERFACE)
1589
+ set_property(TARGET pic_on PROPERTY INTERFACE_POSITION_INDEPENDENT_CODE ON)
1590
+ add_library(pic_off INTERFACE)
1591
+ set_property(TARGET pic_off PROPERTY INTERFACE_POSITION_INDEPENDENT_CODE OFF)
1592
+
1593
+ add_library(enable_rtti INTERFACE)
1594
+ target_compile_options(enable_rtti INTERFACE
1595
+ $<$<OR:$<COMPILER_ID:GNU>,$<COMPILER_ID:Clang>>:\-rtti>
1596
+ )
1597
+
1598
+ add_executable(exe1 exe1.cpp)
1599
+ target_link_libraries(exe1 pic_on enable_rtti)
1600
+ .ft P
1601
+ .fi
1602
+ .UNINDENT
1603
+ .UNINDENT
1604
+ .sp
1605
+ This way, the build specification of \fBexe1\fP is expressed entirely as linked
1606
+ targets, and the complexity of compiler\-specific flags is encapsulated in an
1607
+ \fBINTERFACE\fP library target.
1608
+ .sp
1609
+ \fBINTERFACE\fP libraries may be installed and exported. We can install the
1610
+ default header set along with the target:
1611
+ .INDENT 0.0
1612
+ .INDENT 3.5
1613
+ .sp
1614
+ .nf
1615
+ .ft C
1616
+ add_library(Eigen INTERFACE)
1617
+
1618
+ target_sources(Eigen INTERFACE
1619
+ FILE_SET HEADERS
1620
+ BASE_DIRS src
1621
+ FILES src/eigen.h src/vector.h src/matrix.h
1622
+ )
1623
+
1624
+ install(TARGETS Eigen EXPORT eigenExport
1625
+ FILE_SET HEADERS DESTINATION include/Eigen)
1626
+ install(EXPORT eigenExport NAMESPACE Upstream::
1627
+ DESTINATION lib/cmake/Eigen
1628
+ )
1629
+ .ft P
1630
+ .fi
1631
+ .UNINDENT
1632
+ .UNINDENT
1633
+ .sp
1634
+ Here, the headers defined in the header set are installed to \fBinclude/Eigen\fP\&.
1635
+ The install destination automatically becomes an include directory that is a
1636
+ usage requirement for consumers.
1637
+ .SH COPYRIGHT
1638
+ 2000-2024 Kitware, Inc. and Contributors
1639
+ .\" Generated by docutils manpage writer.
1640
+ .
cmake/man/man7/cmake-commands.7 ADDED
The diff for this file is too large to render. See raw diff
 
cmake/man/man7/cmake-compile-features.7 ADDED
@@ -0,0 +1,395 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .\" Man page generated from reStructuredText.
2
+ .
3
+ .
4
+ .nr rst2man-indent-level 0
5
+ .
6
+ .de1 rstReportMargin
7
+ \\$1 \\n[an-margin]
8
+ level \\n[rst2man-indent-level]
9
+ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
10
+ -
11
+ \\n[rst2man-indent0]
12
+ \\n[rst2man-indent1]
13
+ \\n[rst2man-indent2]
14
+ ..
15
+ .de1 INDENT
16
+ .\" .rstReportMargin pre:
17
+ . RS \\$1
18
+ . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
19
+ . nr rst2man-indent-level +1
20
+ .\" .rstReportMargin post:
21
+ ..
22
+ .de UNINDENT
23
+ . RE
24
+ .\" indent \\n[an-margin]
25
+ .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
26
+ .nr rst2man-indent-level -1
27
+ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
28
+ .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
29
+ ..
30
+ .TH "CMAKE-COMPILE-FEATURES" "7" "Jan 10, 2025" "3.31.4" "CMake"
31
+ .SH NAME
32
+ cmake-compile-features \- CMake Compile Features Reference
33
+ .SH INTRODUCTION
34
+ .sp
35
+ Project source code may depend on, or be conditional on, the availability
36
+ of certain features of the compiler. There are three use\-cases which arise:
37
+ \fI\%Compile Feature Requirements\fP, \fI\%Optional Compile Features\fP
38
+ and \fI\%Conditional Compilation Options\fP\&.
39
+ .sp
40
+ While features are typically specified in programming language standards,
41
+ CMake provides a primary user interface based on granular handling of
42
+ the features, not the language standard that introduced the feature.
43
+ .sp
44
+ The \X'tty: link #prop_gbl:CMAKE_C_KNOWN_FEATURES'\fI\%CMAKE_C_KNOWN_FEATURES\fP\X'tty: link', \X'tty: link #prop_gbl:CMAKE_CUDA_KNOWN_FEATURES'\fI\%CMAKE_CUDA_KNOWN_FEATURES\fP\X'tty: link',
45
+ and \X'tty: link #prop_gbl:CMAKE_CXX_KNOWN_FEATURES'\fI\%CMAKE_CXX_KNOWN_FEATURES\fP\X'tty: link' global properties contain all the
46
+ features known to CMake, regardless of compiler support for the feature.
47
+ The \X'tty: link #variable:CMAKE_C_COMPILE_FEATURES'\fI\%CMAKE_C_COMPILE_FEATURES\fP\X'tty: link', \X'tty: link #variable:CMAKE_CUDA_COMPILE_FEATURES'\fI\%CMAKE_CUDA_COMPILE_FEATURES\fP\X'tty: link'
48
+ , and \X'tty: link #variable:CMAKE_CXX_COMPILE_FEATURES'\fI\%CMAKE_CXX_COMPILE_FEATURES\fP\X'tty: link' variables contain all features
49
+ CMake knows are known to the compiler, regardless of language standard
50
+ or compile flags needed to use them.
51
+ .sp
52
+ Features known to CMake are named mostly following the same convention
53
+ as the Clang feature test macros. There are some exceptions, such as
54
+ CMake using \fBcxx_final\fP and \fBcxx_override\fP instead of the single
55
+ \fBcxx_override_control\fP used by Clang.
56
+ .sp
57
+ Note that there are no separate compile features properties or variables for
58
+ the \fBOBJC\fP or \fBOBJCXX\fP languages. These are based off \fBC\fP or \fBC++\fP
59
+ respectively, so the properties and variables for their corresponding base
60
+ language should be used instead.
61
+ .SH COMPILE FEATURE REQUIREMENTS
62
+ .sp
63
+ Compile feature requirements may be specified with the
64
+ \X'tty: link #command:target_compile_features'\fI\%target_compile_features()\fP\X'tty: link' command. For example, if a target must
65
+ be compiled with compiler support for the
66
+ \X'tty: link #prop_gbl:CMAKE_CXX_KNOWN_FEATURES'\fI\%cxx_constexpr\fP\X'tty: link' feature:
67
+ .INDENT 0.0
68
+ .INDENT 3.5
69
+ .sp
70
+ .nf
71
+ .ft C
72
+ add_library(mylib requires_constexpr.cpp)
73
+ target_compile_features(mylib PRIVATE cxx_constexpr)
74
+ .ft P
75
+ .fi
76
+ .UNINDENT
77
+ .UNINDENT
78
+ .sp
79
+ In processing the requirement for the \fBcxx_constexpr\fP feature,
80
+ \X'tty: link #manual:cmake(1)'\fI\%cmake(1)\fP\X'tty: link' will ensure that the in\-use C++ compiler is capable
81
+ of the feature, and will add any necessary flags such as \fB\-std=gnu++11\fP
82
+ to the compile lines of C++ files in the \fBmylib\fP target. A
83
+ \fBFATAL_ERROR\fP is issued if the compiler is not capable of the
84
+ feature.
85
+ .sp
86
+ The exact compile flags and language standard are deliberately not part
87
+ of the user interface for this use\-case. CMake will compute the
88
+ appropriate compile flags to use by considering the features specified
89
+ for each target.
90
+ .sp
91
+ Such compile flags are added even if the compiler supports the
92
+ particular feature without the flag. For example, the GNU compiler
93
+ supports variadic templates (with a warning) even if \fB\-std=gnu++98\fP is
94
+ used. CMake adds the \fB\-std=gnu++11\fP flag if \fBcxx_variadic_templates\fP
95
+ is specified as a requirement.
96
+ .sp
97
+ In the above example, \fBmylib\fP requires \fBcxx_constexpr\fP when it
98
+ is built itself, but consumers of \fBmylib\fP are not required to use a
99
+ compiler which supports \fBcxx_constexpr\fP\&. If the interface of
100
+ \fBmylib\fP does require the \fBcxx_constexpr\fP feature (or any other
101
+ known feature), that may be specified with the \fBPUBLIC\fP or
102
+ \fBINTERFACE\fP signatures of \X'tty: link #command:target_compile_features'\fI\%target_compile_features()\fP\X'tty: link':
103
+ .INDENT 0.0
104
+ .INDENT 3.5
105
+ .sp
106
+ .nf
107
+ .ft C
108
+ add_library(mylib requires_constexpr.cpp)
109
+ # cxx_constexpr is a usage\-requirement
110
+ target_compile_features(mylib PUBLIC cxx_constexpr)
111
+
112
+ # main.cpp will be compiled with \-std=gnu++11 on GNU for cxx_constexpr.
113
+ add_executable(myexe main.cpp)
114
+ target_link_libraries(myexe mylib)
115
+ .ft P
116
+ .fi
117
+ .UNINDENT
118
+ .UNINDENT
119
+ .sp
120
+ Feature requirements are evaluated transitively by consuming the link
121
+ implementation. See \X'tty: link #manual:cmake-buildsystem(7)'\fI\%cmake\-buildsystem(7)\fP\X'tty: link' for more on
122
+ transitive behavior of build properties and usage requirements.
123
+ .SS Requiring Language Standards
124
+ .sp
125
+ In projects that use a large number of commonly available features from
126
+ a particular language standard (e.g. C++ 11) one may specify a
127
+ meta\-feature (e.g. \fBcxx_std_11\fP) that requires use of a compiler mode
128
+ that is at minimum aware of that standard, but could be greater.
129
+ This is simpler than specifying all the features individually, but does
130
+ not guarantee the existence of any particular feature.
131
+ Diagnosis of use of unsupported features will be delayed until compile time.
132
+ .sp
133
+ For example, if C++ 11 features are used extensively in a project\(aqs
134
+ header files, then clients must use a compiler mode that is no less
135
+ than C++ 11. This can be requested with the code:
136
+ .INDENT 0.0
137
+ .INDENT 3.5
138
+ .sp
139
+ .nf
140
+ .ft C
141
+ target_compile_features(mylib PUBLIC cxx_std_11)
142
+ .ft P
143
+ .fi
144
+ .UNINDENT
145
+ .UNINDENT
146
+ .sp
147
+ In this example, CMake will ensure the compiler is invoked in a mode
148
+ of at\-least C++ 11 (or C++ 14, C++ 17, ...), adding flags such as
149
+ \fB\-std=gnu++11\fP if necessary. This applies to sources within \fBmylib\fP
150
+ as well as any dependents (that may include headers from \fBmylib\fP).
151
+ .sp
152
+ \fBNOTE:\fP
153
+ .INDENT 0.0
154
+ .INDENT 3.5
155
+ If the compiler\(aqs default standard level is at least that
156
+ of the requested feature, CMake may omit the \fB\-std=\fP flag.
157
+ The flag may still be added if the compiler\(aqs default extensions mode
158
+ does not match the \X'tty: link #prop_tgt:<LANG>_EXTENSIONS'\fI\%<LANG>_EXTENSIONS\fP\X'tty: link' target property,
159
+ or if the \X'tty: link #prop_tgt:<LANG>_STANDARD'\fI\%<LANG>_STANDARD\fP\X'tty: link' target property is set.
160
+ .UNINDENT
161
+ .UNINDENT
162
+ .SS Availability of Compiler Extensions
163
+ .sp
164
+ The \X'tty: link #prop_tgt:<LANG>_EXTENSIONS'\fI\%<LANG>_EXTENSIONS\fP\X'tty: link' target property defaults to the compiler\(aqs
165
+ default (see \X'tty: link #variable:CMAKE_<LANG>_EXTENSIONS_DEFAULT'\fI\%CMAKE_<LANG>_EXTENSIONS_DEFAULT\fP\X'tty: link'). Note that because
166
+ most compilers enable extensions by default, this may expose portability bugs
167
+ in user code or in the headers of third\-party dependencies.
168
+ .sp
169
+ \X'tty: link #prop_tgt:<LANG>_EXTENSIONS'\fI\%<LANG>_EXTENSIONS\fP\X'tty: link' used to default to \fBON\fP\&. See \X'tty: link #policy:CMP0128'\fI\%CMP0128\fP\X'tty: link'\&.
170
+ .SH OPTIONAL COMPILE FEATURES
171
+ .sp
172
+ Compile features may be preferred if available, without creating a hard
173
+ requirement. This can be achieved by \fInot\fP specifying features with
174
+ \X'tty: link #command:target_compile_features'\fI\%target_compile_features()\fP\X'tty: link' and instead checking the compiler
175
+ capabilities with preprocessor conditions in project code.
176
+ .sp
177
+ In this use\-case, the project may wish to establish a particular language
178
+ standard if available from the compiler, and use preprocessor conditions
179
+ to detect the features actually available. A language standard may be
180
+ established by \fI\%Requiring Language Standards\fP using
181
+ \X'tty: link #command:target_compile_features'\fI\%target_compile_features()\fP\X'tty: link' with meta\-features like \fBcxx_std_11\fP,
182
+ or by setting the \X'tty: link #prop_tgt:CXX_STANDARD'\fI\%CXX_STANDARD\fP\X'tty: link' target property or
183
+ \X'tty: link #variable:CMAKE_CXX_STANDARD'\fI\%CMAKE_CXX_STANDARD\fP\X'tty: link' variable.
184
+ .sp
185
+ See also policy \X'tty: link #policy:CMP0120'\fI\%CMP0120\fP\X'tty: link' and legacy documentation on
186
+ \X'tty: link #wcdh-example-usage'\fI\%Example Usage\fP\X'tty: link' of the deprecated
187
+ \X'tty: link #module:WriteCompilerDetectionHeader'\fI\%WriteCompilerDetectionHeader\fP\X'tty: link' module.
188
+ .SH CONDITIONAL COMPILATION OPTIONS
189
+ .sp
190
+ Libraries may provide entirely different header files depending on
191
+ requested compiler features.
192
+ .sp
193
+ For example, a header at \fBwith_variadics/interface.h\fP may contain:
194
+ .INDENT 0.0
195
+ .INDENT 3.5
196
+ .sp
197
+ .nf
198
+ .ft C
199
+ template<int I, int... Is>
200
+ struct Interface;
201
+
202
+ template<int I>
203
+ struct Interface<I>
204
+ {
205
+ static int accumulate()
206
+ {
207
+ return I;
208
+ }
209
+ };
210
+
211
+ template<int I, int... Is>
212
+ struct Interface
213
+ {
214
+ static int accumulate()
215
+ {
216
+ return I + Interface<Is...>::accumulate();
217
+ }
218
+ };
219
+ .ft P
220
+ .fi
221
+ .UNINDENT
222
+ .UNINDENT
223
+ .sp
224
+ while a header at \fBno_variadics/interface.h\fP may contain:
225
+ .INDENT 0.0
226
+ .INDENT 3.5
227
+ .sp
228
+ .nf
229
+ .ft C
230
+ template<int I1, int I2 = 0, int I3 = 0, int I4 = 0>
231
+ struct Interface
232
+ {
233
+ static int accumulate() { return I1 + I2 + I3 + I4; }
234
+ };
235
+ .ft P
236
+ .fi
237
+ .UNINDENT
238
+ .UNINDENT
239
+ .sp
240
+ It may be possible to write an abstraction \fBinterface.h\fP header
241
+ containing something like:
242
+ .INDENT 0.0
243
+ .INDENT 3.5
244
+ .sp
245
+ .nf
246
+ .ft C
247
+ #ifdef HAVE_CXX_VARIADIC_TEMPLATES
248
+ #include \(dqwith_variadics/interface.h\(dq
249
+ #else
250
+ #include \(dqno_variadics/interface.h\(dq
251
+ #endif
252
+ .ft P
253
+ .fi
254
+ .UNINDENT
255
+ .UNINDENT
256
+ .sp
257
+ However this could be unmaintainable if there are many files to
258
+ abstract. What is needed is to use alternative include directories
259
+ depending on the compiler capabilities.
260
+ .sp
261
+ CMake provides a \fBCOMPILE_FEATURES\fP
262
+ \X'tty: link #manual:cmake-generator-expressions(7)'\fI\%generator expression\fP\X'tty: link' to implement
263
+ such conditions. This may be used with the build\-property commands such as
264
+ \X'tty: link #command:target_include_directories'\fI\%target_include_directories()\fP\X'tty: link' and \X'tty: link #command:target_link_libraries'\fI\%target_link_libraries()\fP\X'tty: link'
265
+ to set the appropriate \X'tty: link #manual:cmake-buildsystem(7)'\fI\%buildsystem\fP\X'tty: link'
266
+ properties:
267
+ .INDENT 0.0
268
+ .INDENT 3.5
269
+ .sp
270
+ .nf
271
+ .ft C
272
+ add_library(foo INTERFACE)
273
+ set(with_variadics ${CMAKE_CURRENT_SOURCE_DIR}/with_variadics)
274
+ set(no_variadics ${CMAKE_CURRENT_SOURCE_DIR}/no_variadics)
275
+ target_include_directories(foo
276
+ INTERFACE
277
+ \(dq$<$<COMPILE_FEATURES:cxx_variadic_templates>:${with_variadics}>\(dq
278
+ \(dq$<$<NOT:$<COMPILE_FEATURES:cxx_variadic_templates>>:${no_variadics}>\(dq
279
+ )
280
+ .ft P
281
+ .fi
282
+ .UNINDENT
283
+ .UNINDENT
284
+ .sp
285
+ Consuming code then simply links to the \fBfoo\fP target as usual and uses
286
+ the feature\-appropriate include directory
287
+ .INDENT 0.0
288
+ .INDENT 3.5
289
+ .sp
290
+ .nf
291
+ .ft C
292
+ add_executable(consumer_with consumer_with.cpp)
293
+ target_link_libraries(consumer_with foo)
294
+ set_property(TARGET consumer_with CXX_STANDARD 11)
295
+
296
+ add_executable(consumer_no consumer_no.cpp)
297
+ target_link_libraries(consumer_no foo)
298
+ .ft P
299
+ .fi
300
+ .UNINDENT
301
+ .UNINDENT
302
+ .SH SUPPORTED COMPILERS
303
+ .sp
304
+ CMake is currently aware of the \X'tty: link #prop_tgt:CXX_STANDARD'\fI\%C++ standards\fP\X'tty: link'
305
+ and \X'tty: link #prop_gbl:CMAKE_CXX_KNOWN_FEATURES'\fI\%compile features\fP\X'tty: link' available from
306
+ the following \X'tty: link #variable:CMAKE_<LANG>_COMPILER_ID'\fI\%compiler ids\fP\X'tty: link' as of the
307
+ versions specified for each:
308
+ .INDENT 0.0
309
+ .IP \(bu 2
310
+ \fBAppleClang\fP: Apple Clang for Xcode versions 4.4+.
311
+ .IP \(bu 2
312
+ \fBClang\fP: Clang compiler versions 2.9+.
313
+ .IP \(bu 2
314
+ \fBGNU\fP: GNU compiler versions 4.4+.
315
+ .IP \(bu 2
316
+ \fBMSVC\fP: Microsoft Visual Studio versions 2010+.
317
+ .IP \(bu 2
318
+ \fBSunPro\fP: Oracle SolarisStudio versions 12.4+.
319
+ .IP \(bu 2
320
+ \fBIntel\fP: Intel compiler versions 12.1+.
321
+ .UNINDENT
322
+ .sp
323
+ CMake is currently aware of the \X'tty: link #prop_tgt:C_STANDARD'\fI\%C standards\fP\X'tty: link'
324
+ and \X'tty: link #prop_gbl:CMAKE_C_KNOWN_FEATURES'\fI\%compile features\fP\X'tty: link' available from
325
+ the following \X'tty: link #variable:CMAKE_<LANG>_COMPILER_ID'\fI\%compiler ids\fP\X'tty: link' as of the
326
+ versions specified for each:
327
+ .INDENT 0.0
328
+ .IP \(bu 2
329
+ all compilers and versions listed above for C++.
330
+ .IP \(bu 2
331
+ \fBGNU\fP: GNU compiler versions 3.4+
332
+ .UNINDENT
333
+ .sp
334
+ CMake is currently aware of the \X'tty: link #prop_tgt:CXX_STANDARD'\fI\%C++ standards\fP\X'tty: link' and
335
+ their associated meta\-features (e.g. \fBcxx_std_11\fP) available from the
336
+ following \X'tty: link #variable:CMAKE_<LANG>_COMPILER_ID'\fI\%compiler ids\fP\X'tty: link' as of the
337
+ versions specified for each:
338
+ .INDENT 0.0
339
+ .IP \(bu 2
340
+ \fBCray\fP: Cray Compiler Environment version 8.1+.
341
+ .IP \(bu 2
342
+ \fBFujitsu\fP: Fujitsu HPC compiler 4.0+.
343
+ .IP \(bu 2
344
+ \fBPGI\fP: PGI version 12.10+.
345
+ .IP \(bu 2
346
+ \fBNVHPC\fP: NVIDIA HPC compilers version 11.0+.
347
+ .IP \(bu 2
348
+ \fBTI\fP: Texas Instruments compiler.
349
+ .IP \(bu 2
350
+ \fBTIClang\fP: Texas Instruments Clang\-based compilers.
351
+ .IP \(bu 2
352
+ \fBXL\fP: IBM XL version 10.1+.
353
+ .UNINDENT
354
+ .sp
355
+ CMake is currently aware of the \X'tty: link #prop_tgt:C_STANDARD'\fI\%C standards\fP\X'tty: link' and
356
+ their associated meta\-features (e.g. \fBc_std_99\fP) available from the
357
+ following \X'tty: link #variable:CMAKE_<LANG>_COMPILER_ID'\fI\%compiler ids\fP\X'tty: link' as of the
358
+ versions specified for each:
359
+ .INDENT 0.0
360
+ .IP \(bu 2
361
+ all compilers and versions listed above with only meta\-features for C++.
362
+ .UNINDENT
363
+ .sp
364
+ CMake is currently aware of the \X'tty: link #prop_tgt:CUDA_STANDARD'\fI\%CUDA standards\fP\X'tty: link' and
365
+ their associated meta\-features (e.g. \fBcuda_std_11\fP) available from the
366
+ following \X'tty: link #variable:CMAKE_<LANG>_COMPILER_ID'\fI\%compiler ids\fP\X'tty: link' as of the
367
+ versions specified for each:
368
+ .INDENT 0.0
369
+ .IP \(bu 2
370
+ \fBClang\fP: Clang compiler 5.0+.
371
+ .IP \(bu 2
372
+ \fBNVIDIA\fP: NVIDIA nvcc compiler 7.5+.
373
+ .UNINDENT
374
+ .SH LANGUAGE STANDARD FLAGS
375
+ .sp
376
+ In order to satisfy requirements specified by the
377
+ \X'tty: link #command:target_compile_features'\fI\%target_compile_features()\fP\X'tty: link' command or the
378
+ \X'tty: link #variable:CMAKE_<LANG>_STANDARD'\fI\%CMAKE_<LANG>_STANDARD\fP\X'tty: link' variable, CMake may pass a
379
+ language standard flag to the compiler, such as \fB\-std=c++11\fP\&.
380
+ .sp
381
+ For \X'tty: link #visual-studio-generators'\fI\%Visual Studio Generators\fP\X'tty: link', CMake cannot precisely control
382
+ the placement of the language standard flag on the compiler command line.
383
+ For \X'tty: link #ninja-generators'\fI\%Ninja Generators\fP\X'tty: link', \X'tty: link #makefile-generators'\fI\%Makefile Generators\fP\X'tty: link', and
384
+ \X'tty: link #generator:Xcode'\fI\%Xcode\fP\X'tty: link', CMake places the language standard flag just after
385
+ the language\-wide flags from \X'tty: link #variable:CMAKE_<LANG>_FLAGS'\fI\%CMAKE_<LANG>_FLAGS\fP\X'tty: link'
386
+ and \X'tty: link #variable:CMAKE_<LANG>_FLAGS_<CONFIG>'\fI\%CMAKE_<LANG>_FLAGS_<CONFIG>\fP\X'tty: link'\&.
387
+ .sp
388
+ Changed in version 3.26: The language standard flag is placed before flags specified by other
389
+ abstractions such as the \X'tty: link #command:target_compile_options'\fI\%target_compile_options()\fP\X'tty: link' command.
390
+ Prior to CMake 3.26, the language standard flag was placed after them.
391
+
392
+ .SH COPYRIGHT
393
+ 2000-2024 Kitware, Inc. and Contributors
394
+ .\" Generated by docutils manpage writer.
395
+ .
cmake/man/man7/cmake-configure-log.7 ADDED
@@ -0,0 +1,386 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .\" Man page generated from reStructuredText.
2
+ .
3
+ .
4
+ .nr rst2man-indent-level 0
5
+ .
6
+ .de1 rstReportMargin
7
+ \\$1 \\n[an-margin]
8
+ level \\n[rst2man-indent-level]
9
+ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
10
+ -
11
+ \\n[rst2man-indent0]
12
+ \\n[rst2man-indent1]
13
+ \\n[rst2man-indent2]
14
+ ..
15
+ .de1 INDENT
16
+ .\" .rstReportMargin pre:
17
+ . RS \\$1
18
+ . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
19
+ . nr rst2man-indent-level +1
20
+ .\" .rstReportMargin post:
21
+ ..
22
+ .de UNINDENT
23
+ . RE
24
+ .\" indent \\n[an-margin]
25
+ .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
26
+ .nr rst2man-indent-level -1
27
+ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
28
+ .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
29
+ ..
30
+ .TH "CMAKE-CONFIGURE-LOG" "7" "Jan 10, 2025" "3.31.4" "CMake"
31
+ .SH NAME
32
+ cmake-configure-log \- CMake Configure Log
33
+ .sp
34
+ Added in version 3.26.
35
+
36
+ .SH INTRODUCTION
37
+ .sp
38
+ CMake writes a running log, known as the \fIconfigure log\fP,
39
+ of certain events that occur during the Configure step.
40
+ The configure log does \fInot\fP contain a log of all output, errors,
41
+ or messages printed while configuring a project. It is a log of
42
+ detailed information about specific events, such as toolchain inspection
43
+ by \X'tty: link #command:try_compile'\fI\%try_compile()\fP\X'tty: link', meant for use in debugging the configuration
44
+ of a build tree.
45
+ .sp
46
+ For human use, this version of CMake writes the configure log to the file:
47
+ .INDENT 0.0
48
+ .INDENT 3.5
49
+ .sp
50
+ .nf
51
+ .ft C
52
+ ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeConfigureLog.yaml
53
+ .ft P
54
+ .fi
55
+ .UNINDENT
56
+ .UNINDENT
57
+ .sp
58
+ However, the \fIlocation and name of the log file may change\fP in future
59
+ versions of CMake. Tools that read the configure log should get its
60
+ location using a \X'tty: link #file-api-configurelog'\fI\%configureLog\fP\X'tty: link' query to
61
+ the \X'tty: link #manual:cmake-file-api(7)'\fI\%cmake\-file\-api(7)\fP\X'tty: link'\&.
62
+ See the \fI\%Log Versioning\fP section below for details.
63
+ .SH LOG STRUCTURE
64
+ .sp
65
+ The configure log is designed to be both machine\- and human\-readable.
66
+ .sp
67
+ The log file is a YAML document stream containing zero or more YAML
68
+ documents separated by document markers. Each document begins
69
+ with a \fB\-\-\-\fP document marker line, contains a single YAML mapping
70
+ that logs events from one CMake \(dqconfigure\(dq step, and, if the configure
71
+ step finished normally, ends with a \fB\&...\fP document marker line:
72
+ .INDENT 0.0
73
+ .INDENT 3.5
74
+ .sp
75
+ .nf
76
+ .ft C
77
+ \-\-\-
78
+ events:
79
+ \-
80
+ kind: \(dqtry_compile\-v1\(dq
81
+ # (other fields omitted)
82
+ \-
83
+ kind: \(dqtry_compile\-v1\(dq
84
+ # (other fields omitted)
85
+ \&...
86
+ .ft P
87
+ .fi
88
+ .UNINDENT
89
+ .UNINDENT
90
+ .sp
91
+ A new document is appended to the log every time CMake configures
92
+ the build tree and logs new events.
93
+ .sp
94
+ The keys of each document root mapping are:
95
+ .INDENT 0.0
96
+ .TP
97
+ .B \fBevents\fP
98
+ A YAML block sequence of nodes corresponding to events logged during
99
+ one CMake \(dqconfigure\(dq step. Each event is a YAML node containing one
100
+ of the \fI\%Event Kinds\fP documented below.
101
+ .UNINDENT
102
+ .SS Log Versioning
103
+ .sp
104
+ Each of the \fI\%Event Kinds\fP is versioned independently. The set of
105
+ keys an event\(aqs log entry provides is specific to its major version.
106
+ When an event is logged, the latest version of its event kind that is
107
+ known to the running version of CMake is always written to the log.
108
+ .sp
109
+ Tools reading the configure log must ignore event kinds and versions
110
+ they do not understand:
111
+ .INDENT 0.0
112
+ .IP \(bu 2
113
+ A future version of CMake may introduce a new event kind or version.
114
+ .IP \(bu 2
115
+ If an existing build tree is re\-configured with a different version of
116
+ CMake, the log may contain different versions of the same event kind.
117
+ .IP \(bu 2
118
+ If \X'tty: link #manual:cmake-file-api(7)'\fI\%cmake\-file\-api(7)\fP\X'tty: link' queries request one or more
119
+ \X'tty: link #file-api-configurelog'\fI\%configureLog\fP\X'tty: link' object versions,
120
+ the log may contain multiple entries for the same event, each
121
+ with a different version of its event kind.
122
+ .UNINDENT
123
+ .sp
124
+ IDEs should write a \X'tty: link #manual:cmake-file-api(7)'\fI\%cmake\-file\-api(7)\fP\X'tty: link' query requesting a
125
+ specific \X'tty: link #file-api-configurelog'\fI\%configureLog\fP\X'tty: link' object version,
126
+ before running CMake, and then read the configure log only as described
127
+ by the file\-api reply.
128
+ .SS Text Block Encoding
129
+ .sp
130
+ In order to make the log human\-readable, text blocks are always
131
+ represented using YAML literal block scalars (\fB|\fP).
132
+ Since literal block scalars do not support escaping, backslashes
133
+ and non\-printable characters are encoded at the application layer:
134
+ .INDENT 0.0
135
+ .IP \(bu 2
136
+ \fB\e\e\fP encodes a backslash.
137
+ .IP \(bu 2
138
+ \fB\exXX\fP encodes a byte using two hexadecimal digits, \fBXX\fP\&.
139
+ .UNINDENT
140
+ .SH EVENT KINDS
141
+ .sp
142
+ Every event kind is represented by a YAML mapping of the form:
143
+ .INDENT 0.0
144
+ .INDENT 3.5
145
+ .sp
146
+ .nf
147
+ .ft C
148
+ kind: \(dq<kind>\-v<major>\(dq
149
+ backtrace:
150
+ \- \(dq<file>:<line> (<function>)\(dq
151
+ checks:
152
+ \- \(dqChecking for something\(dq
153
+ #...event\-specific keys...
154
+ .ft P
155
+ .fi
156
+ .UNINDENT
157
+ .UNINDENT
158
+ .sp
159
+ The keys common to all events are:
160
+ .INDENT 0.0
161
+ .TP
162
+ .B \fBkind\fP
163
+ A string identifying the event kind and major version.
164
+ .TP
165
+ .B \fBbacktrace\fP
166
+ A YAML block sequence reporting the call stack of CMake source
167
+ locations at which the event occurred, from most\-recent to
168
+ least\-recent. Each node is a string specifying one location
169
+ formatted as \fB<file>:<line> (<function>)\fP\&.
170
+ .TP
171
+ .B \fBchecks\fP
172
+ An optional key that is present when the event occurred with
173
+ at least one pending \X'tty: link #command:message'\fI\%message(CHECK_START)\fP\X'tty: link'\&. Its value
174
+ is a YAML block sequence reporting the stack of pending checks,
175
+ from most\-recent to least\-recent. Each node is a string containing
176
+ a pending check message.
177
+ .UNINDENT
178
+ .sp
179
+ Additional mapping keys are specific to each (versioned) event kind,
180
+ described below.
181
+ .SS Event Kind \fBmessage\fP
182
+ .sp
183
+ The \X'tty: link #command:message'\fI\%message(CONFIGURE_LOG)\fP\X'tty: link' command logs \fBmessage\fP events.
184
+ .sp
185
+ There is only one \fBmessage\fP event major version, version 1.
186
+ .SS \fBmessage\-v1\fP Event
187
+ .sp
188
+ A \fBmessage\-v1\fP event is a YAML mapping:
189
+ .INDENT 0.0
190
+ .INDENT 3.5
191
+ .sp
192
+ .nf
193
+ .ft C
194
+ kind: \(dqmessage\-v1\(dq
195
+ backtrace:
196
+ \- \(dqCMakeLists.txt:123 (message)\(dq
197
+ checks:
198
+ \- \(dqChecking for something\(dq
199
+ message: |
200
+ # ...
201
+ .ft P
202
+ .fi
203
+ .UNINDENT
204
+ .UNINDENT
205
+ .sp
206
+ The keys specific to \fBmessage\-v1\fP mappings are:
207
+ .INDENT 0.0
208
+ .TP
209
+ .B \fBmessage\fP
210
+ A YAML literal block scalar containing the message text,
211
+ represented using our \fI\%Text Block Encoding\fP\&.
212
+ .UNINDENT
213
+ .SS Event Kind \fBtry_compile\fP
214
+ .sp
215
+ The \X'tty: link #command:try_compile'\fI\%try_compile()\fP\X'tty: link' command logs \fBtry_compile\fP events.
216
+ .sp
217
+ There is only one \fBtry_compile\fP event major version, version 1.
218
+ .SS \fBtry_compile\-v1\fP Event
219
+ .sp
220
+ A \fBtry_compile\-v1\fP event is a YAML mapping:
221
+ .INDENT 0.0
222
+ .INDENT 3.5
223
+ .sp
224
+ .nf
225
+ .ft C
226
+ kind: \(dqtry_compile\-v1\(dq
227
+ backtrace:
228
+ \- \(dqCMakeLists.txt:123 (try_compile)\(dq
229
+ checks:
230
+ \- \(dqChecking for something\(dq
231
+ description: \(dqExplicit LOG_DESCRIPTION\(dq
232
+ directories:
233
+ source: \(dq/path/to/.../TryCompile\-01234\(dq
234
+ binary: \(dq/path/to/.../TryCompile\-01234\(dq
235
+ cmakeVariables:
236
+ SOME_VARIABLE: \(dqSome Value\(dq
237
+ buildResult:
238
+ variable: \(dqCOMPILE_RESULT\(dq
239
+ cached: true
240
+ stdout: |
241
+ # ...
242
+ exitCode: 0
243
+ .ft P
244
+ .fi
245
+ .UNINDENT
246
+ .UNINDENT
247
+ .sp
248
+ The keys specific to \fBtry_compile\-v1\fP mappings are:
249
+ .INDENT 0.0
250
+ .TP
251
+ .B \fBdescription\fP
252
+ An optional key that is present when the \fBLOG_DESCRIPTION <text>\fP option
253
+ was used. Its value is a string containing the description \fB<text>\fP\&.
254
+ .TP
255
+ .B \fBdirectories\fP
256
+ A mapping describing the directories associated with the
257
+ compilation attempt. It has the following keys:
258
+ .INDENT 7.0
259
+ .TP
260
+ .B \fBsource\fP
261
+ String specifying the source directory of the
262
+ \X'tty: link #command:try_compile'\fI\%try_compile()\fP\X'tty: link' project.
263
+ .TP
264
+ .B \fBbinary\fP
265
+ String specifying the binary directory of the
266
+ \X'tty: link #command:try_compile'\fI\%try_compile()\fP\X'tty: link' project.
267
+ For non\-project invocations, this is often the same as
268
+ the source directory.
269
+ .UNINDENT
270
+ .TP
271
+ .B \fBcmakeVariables\fP
272
+ An optional key that is present when CMake propagates variables
273
+ into the test project, either automatically or due to the
274
+ \X'tty: link #variable:CMAKE_TRY_COMPILE_PLATFORM_VARIABLES'\fI\%CMAKE_TRY_COMPILE_PLATFORM_VARIABLES\fP\X'tty: link' variable.
275
+ Its value is a mapping from variable names to their values.
276
+ .TP
277
+ .B \fBbuildResult\fP
278
+ A mapping describing the result of compiling the test code.
279
+ It has the following keys:
280
+ .INDENT 7.0
281
+ .TP
282
+ .B \fBvariable\fP
283
+ A string specifying the name of the CMake variable
284
+ storing the result of trying to build the test project.
285
+ .TP
286
+ .B \fBcached\fP
287
+ A boolean indicating whether the above result \fBvariable\fP
288
+ is stored in the CMake cache.
289
+ .TP
290
+ .B \fBstdout\fP
291
+ A YAML literal block scalar containing the output from building
292
+ the test project, represented using our \fI\%Text Block Encoding\fP\&.
293
+ This contains build output from both stdout and stderr.
294
+ .TP
295
+ .B \fBexitCode\fP
296
+ An integer specifying the build tool exit code from trying
297
+ to build the test project.
298
+ .UNINDENT
299
+ .UNINDENT
300
+ .SS Event Kind \fBtry_run\fP
301
+ .sp
302
+ The \X'tty: link #command:try_run'\fI\%try_run()\fP\X'tty: link' command logs \fBtry_run\fP events.
303
+ .sp
304
+ There is only one \fBtry_run\fP event major version, version 1.
305
+ .SS \fBtry_run\-v1\fP Event
306
+ .sp
307
+ A \fBtry_run\-v1\fP event is a YAML mapping:
308
+ .INDENT 0.0
309
+ .INDENT 3.5
310
+ .sp
311
+ .nf
312
+ .ft C
313
+ kind: \(dqtry_run\-v1\(dq
314
+ backtrace:
315
+ \- \(dqCMakeLists.txt:456 (try_run)\(dq
316
+ checks:
317
+ \- \(dqChecking for something\(dq
318
+ description: \(dqExplicit LOG_DESCRIPTION\(dq
319
+ directories:
320
+ source: \(dq/path/to/.../TryCompile\-56789\(dq
321
+ binary: \(dq/path/to/.../TryCompile\-56789\(dq
322
+ buildResult:
323
+ variable: \(dqCOMPILE_RESULT\(dq
324
+ cached: true
325
+ stdout: |
326
+ # ...
327
+ exitCode: 0
328
+ runResult:
329
+ variable: \(dqRUN_RESULT\(dq
330
+ cached: true
331
+ stdout: |
332
+ # ...
333
+ stderr: |
334
+ # ...
335
+ exitCode: 0
336
+ .ft P
337
+ .fi
338
+ .UNINDENT
339
+ .UNINDENT
340
+ .sp
341
+ The keys specific to \fBtry_run\-v1\fP mappings include those
342
+ documented by the \fI\%try_compile\-v1 event\fP, plus:
343
+ .INDENT 0.0
344
+ .TP
345
+ .B \fBrunResult\fP
346
+ A mapping describing the result of running the test code.
347
+ It has the following keys:
348
+ .INDENT 7.0
349
+ .TP
350
+ .B \fBvariable\fP
351
+ A string specifying the name of the CMake variable
352
+ storing the result of trying to run the test executable.
353
+ .TP
354
+ .B \fBcached\fP
355
+ A boolean indicating whether the above result \fBvariable\fP
356
+ is stored in the CMake cache.
357
+ .TP
358
+ .B \fBstdout\fP
359
+ An optional key that is present when the test project built successfully.
360
+ Its value is a YAML literal block scalar containing output from running
361
+ the test executable, represented using our \fI\%Text Block Encoding\fP\&.
362
+ .sp
363
+ If \fBRUN_OUTPUT_VARIABLE\fP was used, stdout and stderr are captured
364
+ together, so this will contain both. Otherwise, this will contain
365
+ only the stdout output.
366
+ .TP
367
+ .B \fBstderr\fP
368
+ An optional key that is present when the test project built successfully
369
+ and the \fBRUN_OUTPUT_VARIABLE\fP option was not used.
370
+ Its value is a YAML literal block scalar containing output from running
371
+ the test executable, represented using our \fI\%Text Block Encoding\fP\&.
372
+ .sp
373
+ If \fBRUN_OUTPUT_VARIABLE\fP was used, stdout and stderr are captured
374
+ together in the \fBstdout\fP key, and this key will not be present.
375
+ Otherwise, this will contain the stderr output.
376
+ .TP
377
+ .B \fBexitCode\fP
378
+ An optional key that is present when the test project built successfully.
379
+ Its value is an integer specifying the exit code, or a string containing
380
+ an error message, from trying to run the test executable.
381
+ .UNINDENT
382
+ .UNINDENT
383
+ .SH COPYRIGHT
384
+ 2000-2024 Kitware, Inc. and Contributors
385
+ .\" Generated by docutils manpage writer.
386
+ .
cmake/man/man7/cmake-cxxmodules.7 ADDED
@@ -0,0 +1,194 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .\" Man page generated from reStructuredText.
2
+ .
3
+ .
4
+ .nr rst2man-indent-level 0
5
+ .
6
+ .de1 rstReportMargin
7
+ \\$1 \\n[an-margin]
8
+ level \\n[rst2man-indent-level]
9
+ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
10
+ -
11
+ \\n[rst2man-indent0]
12
+ \\n[rst2man-indent1]
13
+ \\n[rst2man-indent2]
14
+ ..
15
+ .de1 INDENT
16
+ .\" .rstReportMargin pre:
17
+ . RS \\$1
18
+ . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
19
+ . nr rst2man-indent-level +1
20
+ .\" .rstReportMargin post:
21
+ ..
22
+ .de UNINDENT
23
+ . RE
24
+ .\" indent \\n[an-margin]
25
+ .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
26
+ .nr rst2man-indent-level -1
27
+ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
28
+ .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
29
+ ..
30
+ .TH "CMAKE-CXXMODULES" "7" "Jan 10, 2025" "3.31.4" "CMake"
31
+ .SH NAME
32
+ cmake-cxxmodules \- CMake C++ Modules Support Reference
33
+ .sp
34
+ Added in version 3.28.
35
+
36
+ .sp
37
+ C++ 20 introduced the concept of \(dqmodules\(dq to the language. The design
38
+ requires build systems to order compilations among each other to satisfy
39
+ \fBimport\fP statements reliably. CMake\(aqs implementation asks the compiler
40
+ to scan source files for module dependencies during the build, collates
41
+ scanning results to infer ordering constraints, and tells the build tool
42
+ how to dynamically update the build graph.
43
+ .SH COMPILATION STRATEGY
44
+ .sp
45
+ With C++ modules, compiling a set of C++ sources is no longer embarrassingly
46
+ parallel. That is, any given source may first require the compilation of
47
+ another source file first in order to provide a \(dqCMI\(dq (compiled module
48
+ interface) or \(dqBMI\(dq (binary module interface) that C++ compilers use to
49
+ satisfy \fBimport\fP statements in other sources. With headers, sources could
50
+ share their declarations so that any consumers could compile independently.
51
+ With modules, declarations are now generated into these BMI files by the
52
+ compiler during compilation based on the contents of the source file and its
53
+ \fBexport\fP statements.
54
+ .sp
55
+ The order necessary for compilation requires build\-time resolution of the
56
+ ordering because the order is controlled by the contents of the sources. This
57
+ means that the ordering needs extracted from the source during the build to
58
+ avoid regenerating the build graph via a configure and generate phase for
59
+ every source change to get a correct build.
60
+ .sp
61
+ The general strategy is to use a \(dqscanner\(dq to extract the ordering dependency
62
+ information and update the build graph with new edges between existing edges
63
+ by taking the per\-source scan results (represented by \X'tty: link https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1689r5.html'\fI\%P1689R5\fP\X'tty: link' files) and
64
+ \(dqcollating\(dq the dependencies within a target and to modules produced by
65
+ targets visible to the target. The primary task is to generate \(dqmodule map\(dq
66
+ files to pass to each compile rule with the paths to the BMIs needed to
67
+ satisfy \fBimport\fP statements. The collator also has tasks to use the
68
+ build\-time information to fill out information including \fBinstall\fP rules for
69
+ the module interface units, their BMIs, and properties for any exported
70
+ targets with C++ modules.
71
+ .sp
72
+ \fBNOTE:\fP
73
+ .INDENT 0.0
74
+ .INDENT 3.5
75
+ CMake is focusing on correct builds before looking at performance
76
+ improvements. There are known tactics within the chosen strategy which may
77
+ offer build performance improvements. However, they are being deferred
78
+ until we have a working model against which to compare them. It is also
79
+ important to note that a tactic useful in one situation (e.g., clean
80
+ builds) may not be performant in a different situation (e.g., incremental
81
+ builds). Finding a balance and offering controls to select the tactics is
82
+ future work.
83
+ .UNINDENT
84
+ .UNINDENT
85
+ .SH SCANNING CONTROL
86
+ .sp
87
+ Whether or not sources get scanned for C++ module usage is dependent on the
88
+ following queries. The first query that provides a yes/no answer is used.
89
+ .INDENT 0.0
90
+ .IP \(bu 2
91
+ If the source file belongs to a file set of type \fBCXX_MODULES\fP, it will
92
+ be scanned.
93
+ .IP \(bu 2
94
+ If the target does not use at least C++ 20, it will not be scanned.
95
+ .IP \(bu 2
96
+ If the source file is not the language \fBCXX\fP, it will not be scanned.
97
+ .IP \(bu 2
98
+ If the \X'tty: link #prop_sf:CXX_SCAN_FOR_MODULES'\fI\%CXX_SCAN_FOR_MODULES\fP\X'tty: link' source file property is set, its
99
+ value will be used.
100
+ .IP \(bu 2
101
+ If the \X'tty: link #prop_tgt:CXX_SCAN_FOR_MODULES'\fI\%CXX_SCAN_FOR_MODULES\fP\X'tty: link' target property is set, its value
102
+ will be used. Set the \X'tty: link #variable:CMAKE_CXX_SCAN_FOR_MODULES'\fI\%CMAKE_CXX_SCAN_FOR_MODULES\fP\X'tty: link' variable
103
+ to initialize this property on all targets as they are created.
104
+ .IP \(bu 2
105
+ Otherwise, the source file will be scanned if the compiler and generator
106
+ support scanning. See policy \X'tty: link #policy:CMP0155'\fI\%CMP0155\fP\X'tty: link'\&.
107
+ .UNINDENT
108
+ .sp
109
+ Note that any scanned source will be excluded from any unity build (see
110
+ \X'tty: link #prop_tgt:UNITY_BUILD'\fI\%UNITY_BUILD\fP\X'tty: link') because module\-related statements can only happen at
111
+ one place within a C++ translation unit.
112
+ .SH COMPILER SUPPORT
113
+ .sp
114
+ Compilers which CMake natively supports module dependency scanning include:
115
+ .INDENT 0.0
116
+ .IP \(bu 2
117
+ MSVC toolset 14.34 and newer (provided with Visual Studio 17.4 and newer)
118
+ .IP \(bu 2
119
+ LLVM/Clang 16.0 and newer
120
+ .IP \(bu 2
121
+ GCC 14 (for the in\-development branch, after 2023\-09\-20) and newer
122
+ .UNINDENT
123
+ .SH IMPORT STD SUPPORT
124
+ .sp
125
+ Support for \fBimport std\fP is limited to the following toolchain and standard
126
+ library combinations:
127
+ .INDENT 0.0
128
+ .IP \(bu 2
129
+ Clang 18.1.2 and newer with \fB\-stdlib=libc++\fP
130
+ .IP \(bu 2
131
+ MSVC toolset 14.36 and newer (provided with Visual Studio 17.6 Preview 2 and
132
+ newer)
133
+ .UNINDENT
134
+ .sp
135
+ The \X'tty: link #variable:CMAKE_CXX_COMPILER_IMPORT_STD'\fI\%CMAKE_CXX_COMPILER_IMPORT_STD\fP\X'tty: link' variable may be used to detect
136
+ support for a standard level with the active C++ toolchain.
137
+ .sp
138
+ \fBNOTE:\fP
139
+ .INDENT 0.0
140
+ .INDENT 3.5
141
+ This support is provided only when experimental support for
142
+ \fBimport std;\fP has been enabled by the
143
+ \fBCMAKE_EXPERIMENTAL_CXX_IMPORT_STD\fP gate.
144
+ .UNINDENT
145
+ .UNINDENT
146
+ .SH GENERATOR SUPPORT
147
+ .sp
148
+ The list of generators which support scanning sources for C++ modules include:
149
+ .INDENT 0.0
150
+ .IP \(bu 2
151
+ \X'tty: link #generator:Ninja'\fI\%Ninja\fP\X'tty: link'
152
+ .IP \(bu 2
153
+ \X'tty: link #generator:Ninja Multi-Config'\fI\%Ninja Multi\-Config\fP\X'tty: link'
154
+ .IP \(bu 2
155
+ \X'tty: link #generator:Visual Studio 17 2022'\fI\%Visual Studio 17 2022\fP\X'tty: link'
156
+ .UNINDENT
157
+ .SS Limitations
158
+ .sp
159
+ There are a number of known limitations of the current C++ module support in
160
+ CMake. This does not document known limitations or bugs in compilers as these
161
+ can change over time.
162
+ .sp
163
+ For all generators:
164
+ .INDENT 0.0
165
+ .IP \(bu 2
166
+ Header units are not supported.
167
+ .IP \(bu 2
168
+ No builtin support for \fBimport std;\fP or other compiler\-provided modules.
169
+ .UNINDENT
170
+ .sp
171
+ For the Ninja Generators:
172
+ .INDENT 0.0
173
+ .IP \(bu 2
174
+ \fBninja\fP 1.11 or newer is required.
175
+ .UNINDENT
176
+ .sp
177
+ For the \X'tty: link #visual-studio-generators'\fI\%Visual Studio Generators\fP\X'tty: link':
178
+ .INDENT 0.0
179
+ .IP \(bu 2
180
+ Only Visual Studio 2022 and MSVC toolsets 14.34 (Visual Studio
181
+ 17.4) and newer.
182
+ .IP \(bu 2
183
+ No support for exporting or installing BMI or module information.
184
+ .IP \(bu 2
185
+ No support for compiling BMIs from \fBIMPORTED\fP targets with C++ modules
186
+ (including \fBimport std\fP).
187
+ .IP \(bu 2
188
+ No diagnosis of using modules provided by \fBPRIVATE\fP sources from
189
+ \fBPUBLIC\fP module sources.
190
+ .UNINDENT
191
+ .SH COPYRIGHT
192
+ 2000-2024 Kitware, Inc. and Contributors
193
+ .\" Generated by docutils manpage writer.
194
+ .
cmake/man/man7/cmake-developer.7 ADDED
@@ -0,0 +1,676 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .\" Man page generated from reStructuredText.
2
+ .
3
+ .
4
+ .nr rst2man-indent-level 0
5
+ .
6
+ .de1 rstReportMargin
7
+ \\$1 \\n[an-margin]
8
+ level \\n[rst2man-indent-level]
9
+ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
10
+ -
11
+ \\n[rst2man-indent0]
12
+ \\n[rst2man-indent1]
13
+ \\n[rst2man-indent2]
14
+ ..
15
+ .de1 INDENT
16
+ .\" .rstReportMargin pre:
17
+ . RS \\$1
18
+ . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
19
+ . nr rst2man-indent-level +1
20
+ .\" .rstReportMargin post:
21
+ ..
22
+ .de UNINDENT
23
+ . RE
24
+ .\" indent \\n[an-margin]
25
+ .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
26
+ .nr rst2man-indent-level -1
27
+ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
28
+ .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
29
+ ..
30
+ .TH "CMAKE-DEVELOPER" "7" "Jan 10, 2025" "3.31.4" "CMake"
31
+ .SH NAME
32
+ cmake-developer \- CMake Developer Reference
33
+ .SH INTRODUCTION
34
+ .sp
35
+ This manual is intended for reference by developers working with
36
+ \X'tty: link #manual:cmake-language(7)'\fI\%cmake\-language(7)\fP\X'tty: link' code, whether writing their own modules,
37
+ authoring their own build systems, or working on CMake itself.
38
+ .sp
39
+ See \X'tty: link https://cmake.org/get-involved/'\fI\%https://cmake.org/get\-involved/\fP\X'tty: link' to get involved in development of
40
+ CMake upstream. It includes links to contribution instructions, which
41
+ in turn link to developer guides for CMake itself.
42
+ .SH ACCESSING WINDOWS REGISTRY
43
+ .sp
44
+ CMake offers some facilities to access the registry on \fBWindows\fP platforms.
45
+ .SS Query Windows Registry
46
+ .sp
47
+ Added in version 3.24.
48
+
49
+ .sp
50
+ The \X'tty: link #command:cmake_host_system_information'\fI\%cmake_host_system_information()\fP\X'tty: link' command offers the possibility to
51
+ query the registry on the local computer. See
52
+ \X'tty: link #query-windows-registry'\fI\%cmake_host_system(QUERY_WINDOWS_REGISTRY)\fP\X'tty: link' for
53
+ more information.
54
+ .SS Find Using Windows Registry
55
+ .sp
56
+ Changed in version 3.24.
57
+
58
+ .sp
59
+ Options \fBHINTS\fP and \fBPATHS\fP of \X'tty: link #command:find_file'\fI\%find_file()\fP\X'tty: link',
60
+ \X'tty: link #command:find_library'\fI\%find_library()\fP\X'tty: link', \X'tty: link #command:find_path'\fI\%find_path()\fP\X'tty: link', \X'tty: link #command:find_program'\fI\%find_program()\fP\X'tty: link', and
61
+ \X'tty: link #command:find_package'\fI\%find_package()\fP\X'tty: link' commands offer the possibility, on \fBWindows\fP
62
+ platform, to query the registry.
63
+ .sp
64
+ The formal syntax, as specified using
65
+ \X'tty: link https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form'\fI\%BNF\fP\X'tty: link' notation with
66
+ the regular extensions, for registry query is the following:
67
+ .sp
68
+ .nf
69
+ \fBregistry_query \fP ::= \(aq[\(aq \fI\%sep_definition\fP? \fI\%root_key\fP
70
+ ((\fI\%key_separator\fP \fI\%sub_key\fP)? (\fI\%value_separator\fP \fI\%value_name\fP_)?)? \(aq]\(aq
71
+ \fBsep_definition \fP ::= \(aq{\(aq \fI\%value_separator\fP \(aq}\(aq
72
+ \fBroot_key \fP ::= \(aqHKLM\(aq | \(aqHKEY_LOCAL_MACHINE\(aq | \(aqHKCU\(aq | \(aqHKEY_CURRENT_USER\(aq |
73
+ \(aqHKCR\(aq | \(aqHKEY_CLASSES_ROOT\(aq | \(aqHKCC\(aq | \(aqHKEY_CURRENT_CONFIG\(aq |
74
+ \(aqHKU\(aq | \(aqHKEY_USERS\(aq
75
+ \fBsub_key \fP ::= \fI\%element\fP (\fI\%key_separator\fP \fI\%element\fP)*
76
+ \fBkey_separator \fP ::= \(aq/\(aq | \(aq\e\e\(aq
77
+ \fBvalue_separator\fP ::= \fI\%element\fP | \(aq;\(aq
78
+ \fBvalue_name \fP ::= \fI\%element\fP | \(aq(default)\(aq
79
+ \fBelement \fP ::= \fI\%character\fP\e+
80
+ \fBcharacter \fP ::= <any character except \fI\%key_separator\fP and \fI\%value_separator\fP>
81
+
82
+ .fi
83
+ .sp
84
+ The \fI\%sep_definition\fP optional item offers the possibility to specify
85
+ the string used to separate the \fI\%sub_key\fP from the \fI\%value_name\fP
86
+ item. If not specified, the character \fB;\fP is used. Multiple
87
+ \fI\%registry_query\fP items can be specified as part of a path.
88
+ .INDENT 0.0
89
+ .INDENT 3.5
90
+ .sp
91
+ .nf
92
+ .ft C
93
+ # example using default separator
94
+ find_file(... PATHS \(dq/root/[HKLM/Stuff;InstallDir]/lib[HKLM\e\e\e\eStuff;Architecture]\(dq)
95
+
96
+ # example using different specified separators
97
+ find_library(... HINTS \(dq/root/[{|}HKCU/Stuff|InstallDir]/lib[{@@}HKCU\e\e\e\eStuff@@Architecture]\(dq)
98
+ .ft P
99
+ .fi
100
+ .UNINDENT
101
+ .UNINDENT
102
+ .sp
103
+ If the \fI\%value_name\fP item is not specified or has the special name
104
+ \fB(default)\fP, the content of the default value, if any, will be returned. The
105
+ supported types for the \fI\%value_name\fP are:
106
+ .INDENT 0.0
107
+ .IP \(bu 2
108
+ \fBREG_SZ\fP\&.
109
+ .IP \(bu 2
110
+ \fBREG_EXPAND_SZ\fP\&. The returned data is expanded.
111
+ .IP \(bu 2
112
+ \fBREG_DWORD\fP\&.
113
+ .IP \(bu 2
114
+ \fBREG_QWORD\fP\&.
115
+ .UNINDENT
116
+ .sp
117
+ When the registry query failed, typically because the key does not exist or
118
+ the data type is not supported, the string \fB/REGISTRY\-NOTFOUND\fP is substituted
119
+ to the \fB[]\fP query expression.
120
+ .SH FIND MODULES
121
+ .sp
122
+ A \(dqfind module\(dq is a \fBFind<PackageName>.cmake\fP file to be loaded by the
123
+ \X'tty: link #command:find_package'\fI\%find_package()\fP\X'tty: link' command when invoked for \fB<PackageName>\fP\&.
124
+ .sp
125
+ The primary task of a find module is to determine whether a package is
126
+ available, set the \fB<PackageName>_FOUND\fP variable to reflect this and
127
+ provide any variables, macros and imported targets required to use the
128
+ package. A find module is useful in cases where an upstream library does
129
+ not provide a \X'tty: link #config-file-packages'\fI\%config file package\fP\X'tty: link'\&.
130
+ .sp
131
+ The traditional approach is to use variables for everything, including
132
+ libraries and executables: see the \fI\%Standard Variable Names\fP section
133
+ below. This is what most of the existing find modules provided by CMake
134
+ do.
135
+ .sp
136
+ The more modern approach is to behave as much like
137
+ \X'tty: link #config-file-packages'\fI\%config file packages\fP\X'tty: link' files as possible, by
138
+ providing \X'tty: link #imported-targets'\fI\%imported target\fP\X'tty: link'\&. This has the advantage
139
+ of propagating \X'tty: link #target-usage-requirements'\fI\%usage requirements\fP\X'tty: link'
140
+ to consumers.
141
+ .sp
142
+ In either case (or even when providing both variables and imported
143
+ targets), find modules should provide backwards compatibility with old
144
+ versions that had the same name.
145
+ .sp
146
+ A FindFoo.cmake module will typically be loaded by the command:
147
+ .INDENT 0.0
148
+ .INDENT 3.5
149
+ .sp
150
+ .nf
151
+ .ft C
152
+ find_package(Foo [major[.minor[.patch[.tweak]]]]
153
+ [EXACT] [QUIET] [REQUIRED]
154
+ [[COMPONENTS] [components...]]
155
+ [OPTIONAL_COMPONENTS components...]
156
+ [NO_POLICY_SCOPE])
157
+ .ft P
158
+ .fi
159
+ .UNINDENT
160
+ .UNINDENT
161
+ .sp
162
+ See the \X'tty: link #command:find_package'\fI\%find_package()\fP\X'tty: link' documentation for details on what
163
+ variables are set for the find module. Most of these are dealt with by
164
+ using \X'tty: link #module:FindPackageHandleStandardArgs'\fI\%FindPackageHandleStandardArgs\fP\X'tty: link'\&.
165
+ .sp
166
+ Briefly, the module should only locate versions of the package
167
+ compatible with the requested version, as described by the
168
+ \fBFoo_FIND_VERSION\fP family of variables. If \fBFoo_FIND_QUIETLY\fP is
169
+ set to true, it should avoid printing messages, including anything
170
+ complaining about the package not being found. If \fBFoo_FIND_REQUIRED\fP
171
+ is set to true, the module should issue a \fBFATAL_ERROR\fP if the package
172
+ cannot be found. If neither are set to true, it should print a
173
+ non\-fatal message if it cannot find the package.
174
+ .sp
175
+ Packages that find multiple semi\-independent parts (like bundles of
176
+ libraries) should search for the components listed in
177
+ \fBFoo_FIND_COMPONENTS\fP if it is set , and only set \fBFoo_FOUND\fP to
178
+ true if for each searched\-for component \fB<c>\fP that was not found,
179
+ \fBFoo_FIND_REQUIRED_<c>\fP is not set to true. The \fBHANDLE_COMPONENTS\fP
180
+ argument of \fBfind_package_handle_standard_args()\fP can be used to
181
+ implement this.
182
+ .sp
183
+ If \fBFoo_FIND_COMPONENTS\fP is not set, which modules are searched for
184
+ and required is up to the find module, but should be documented.
185
+ .sp
186
+ For internal implementation, it is a generally accepted convention that
187
+ variables starting with underscore are for temporary use only.
188
+ .SS Standard Variable Names
189
+ .sp
190
+ For a \fBFindXxx.cmake\fP module that takes the approach of setting
191
+ variables (either instead of or in addition to creating imported
192
+ targets), the following variable names should be used to keep things
193
+ consistent between Find modules. Note that all variables start with
194
+ \fBXxx_\fP, which (unless otherwise noted) must match exactly the name
195
+ of the \fBFindXxx.cmake\fP file, including upper/lowercase.
196
+ This prefix on the variable names ensures that they do not conflict with
197
+ variables of other Find modules. The same pattern should also be followed
198
+ for any macros, functions and imported targets defined by the Find module.
199
+ .INDENT 0.0
200
+ .TP
201
+ .B \fBXxx_INCLUDE_DIRS\fP
202
+ The final set of include directories listed in one variable for use by
203
+ client code. This should not be a cache entry (note that this also means
204
+ this variable should not be used as the result variable of a
205
+ \X'tty: link #command:find_path'\fI\%find_path()\fP\X'tty: link' command \- see \fBXxx_INCLUDE_DIR\fP below for that).
206
+ .TP
207
+ .B \fBXxx_LIBRARIES\fP
208
+ The libraries to use with the module. These may be CMake targets, full
209
+ absolute paths to a library binary or the name of a library that the
210
+ linker must find in its search path. This should not be a cache entry
211
+ (note that this also means this variable should not be used as the
212
+ result variable of a \X'tty: link #command:find_library'\fI\%find_library()\fP\X'tty: link' command \- see
213
+ \fBXxx_LIBRARY\fP below for that).
214
+ .TP
215
+ .B \fBXxx_DEFINITIONS\fP
216
+ The compile definitions to use when compiling code that uses the module.
217
+ This really shouldn\(aqt include options such as \fB\-DHAS_JPEG\fP that a client
218
+ source\-code file uses to decide whether to \fB#include <jpeg.h>\fP
219
+ .TP
220
+ .B \fBXxx_EXECUTABLE\fP
221
+ The full absolute path to an executable. In this case, \fBXxx\fP might not
222
+ be the name of the module, it might be the name of the tool (usually
223
+ converted to all uppercase), assuming that tool has such a well\-known name
224
+ that it is unlikely that another tool with the same name exists. It would
225
+ be appropriate to use this as the result variable of a
226
+ \X'tty: link #command:find_program'\fI\%find_program()\fP\X'tty: link' command.
227
+ .TP
228
+ .B \fBXxx_YYY_EXECUTABLE\fP
229
+ Similar to \fBXxx_EXECUTABLE\fP except here the \fBXxx\fP is always the module
230
+ name and \fBYYY\fP is the tool name (again, usually fully uppercase).
231
+ Prefer this form if the tool name is not very widely known or has the
232
+ potential to clash with another tool. For greater consistency, also
233
+ prefer this form if the module provides more than one executable.
234
+ .TP
235
+ .B \fBXxx_LIBRARY_DIRS\fP
236
+ Optionally, the final set of library directories listed in one
237
+ variable for use by client code. This should not be a cache entry.
238
+ .TP
239
+ .B \fBXxx_ROOT_DIR\fP
240
+ Where to find the base directory of the module.
241
+ .TP
242
+ .B \fBXxx_VERSION_VV\fP
243
+ Variables of this form specify whether the \fBXxx\fP module being provided
244
+ is version \fBVV\fP of the module. There should not be more than one
245
+ variable of this form set to true for a given module. For example, a
246
+ module \fBBarry\fP might have evolved over many years and gone through a
247
+ number of different major versions. Version 3 of the \fBBarry\fP module
248
+ might set the variable \fBBarry_VERSION_3\fP to true, whereas an older
249
+ version of the module might set \fBBarry_VERSION_2\fP to true instead.
250
+ It would be an error for both \fBBarry_VERSION_3\fP and \fBBarry_VERSION_2\fP
251
+ to both be set to true.
252
+ .TP
253
+ .B \fBXxx_WRAP_YY\fP
254
+ When a variable of this form is set to false, it indicates that the
255
+ relevant wrapping command should not be used. The wrapping command
256
+ depends on the module, it may be implied by the module name or it might
257
+ be specified by the \fBYY\fP part of the variable.
258
+ .TP
259
+ .B \fBXxx_Yy_FOUND\fP
260
+ For variables of this form, \fBYy\fP is the name of a component for the
261
+ module. It should match exactly one of the valid component names that
262
+ may be passed to the \X'tty: link #command:find_package'\fI\%find_package()\fP\X'tty: link' command for the module.
263
+ If a variable of this form is set to false, it means that the \fBYy\fP
264
+ component of module \fBXxx\fP was not found or is not available.
265
+ Variables of this form would typically be used for optional components
266
+ so that the caller can check whether an optional component is available.
267
+ .TP
268
+ .B \fBXxx_FOUND\fP
269
+ When the \X'tty: link #command:find_package'\fI\%find_package()\fP\X'tty: link' command returns to the caller, this
270
+ variable will be set to true if the module was deemed to have been found
271
+ successfully.
272
+ .TP
273
+ .B \fBXxx_NOT_FOUND_MESSAGE\fP
274
+ Should be set by config\-files in the case that it has set
275
+ \fBXxx_FOUND\fP to FALSE. The contained message will be printed by the
276
+ \X'tty: link #command:find_package'\fI\%find_package()\fP\X'tty: link' command and by
277
+ \X'tty: link #command:find_package_handle_standard_args'\fI\%find_package_handle_standard_args()\fP\X'tty: link' to inform the user about the
278
+ problem. Use this instead of calling \X'tty: link #command:message'\fI\%message()\fP\X'tty: link' directly to
279
+ report a reason for failing to find the module or package.
280
+ .TP
281
+ .B \fBXxx_RUNTIME_LIBRARY_DIRS\fP
282
+ Optionally, the runtime library search path for use when running an
283
+ executable linked to shared libraries. The list should be used by
284
+ user code to create the \fBPATH\fP on windows or \fBLD_LIBRARY_PATH\fP on
285
+ UNIX. This should not be a cache entry.
286
+ .TP
287
+ .B \fBXxx_VERSION\fP
288
+ The full version string of the package found, if any. Note that many
289
+ existing modules provide \fBXxx_VERSION_STRING\fP instead.
290
+ .TP
291
+ .B \fBXxx_VERSION_MAJOR\fP
292
+ The major version of the package found, if any.
293
+ .TP
294
+ .B \fBXxx_VERSION_MINOR\fP
295
+ The minor version of the package found, if any.
296
+ .TP
297
+ .B \fBXxx_VERSION_PATCH\fP
298
+ The patch version of the package found, if any.
299
+ .UNINDENT
300
+ .sp
301
+ The following names should not usually be used in \fBCMakeLists.txt\fP files.
302
+ They are intended for use by Find modules to specify and cache the locations
303
+ of specific files or directories. Users are typically able to set and edit
304
+ these variables to control the behavior of Find modules (like entering the
305
+ path to a library manually):
306
+ .INDENT 0.0
307
+ .TP
308
+ .B \fBXxx_LIBRARY\fP
309
+ The path of the library. Use this form only when the module provides a
310
+ single library. It is appropriate to use this as the result variable
311
+ in a \X'tty: link #command:find_library'\fI\%find_library()\fP\X'tty: link' command.
312
+ .TP
313
+ .B \fBXxx_Yy_LIBRARY\fP
314
+ The path of library \fBYy\fP provided by the module \fBXxx\fP\&. Use this form
315
+ when the module provides more than one library or where other modules may
316
+ also provide a library of the same name. It is also appropriate to use
317
+ this form as the result variable in a \X'tty: link #command:find_library'\fI\%find_library()\fP\X'tty: link' command.
318
+ .TP
319
+ .B \fBXxx_INCLUDE_DIR\fP
320
+ When the module provides only a single library, this variable can be used
321
+ to specify where to find headers for using the library (or more accurately,
322
+ the path that consumers of the library should add to their header search
323
+ path). It would be appropriate to use this as the result variable in a
324
+ \X'tty: link #command:find_path'\fI\%find_path()\fP\X'tty: link' command.
325
+ .TP
326
+ .B \fBXxx_Yy_INCLUDE_DIR\fP
327
+ If the module provides more than one library or where other modules may
328
+ also provide a library of the same name, this form is recommended for
329
+ specifying where to find headers for using library \fBYy\fP provided by
330
+ the module. Again, it would be appropriate to use this as the result
331
+ variable in a \X'tty: link #command:find_path'\fI\%find_path()\fP\X'tty: link' command.
332
+ .UNINDENT
333
+ .sp
334
+ To prevent users being overwhelmed with settings to configure, try to
335
+ keep as many options as possible out of the cache, leaving at least one
336
+ option which can be used to disable use of the module, or locate a
337
+ not\-found library (e.g. \fBXxx_ROOT_DIR\fP). For the same reason, mark
338
+ most cache options as advanced. For packages which provide both debug
339
+ and release binaries, it is common to create cache variables with a
340
+ \fB_LIBRARY_<CONFIG>\fP suffix, such as \fBFoo_LIBRARY_RELEASE\fP and
341
+ \fBFoo_LIBRARY_DEBUG\fP\&. The \X'tty: link #module:SelectLibraryConfigurations'\fI\%SelectLibraryConfigurations\fP\X'tty: link' module
342
+ can be helpful for such cases.
343
+ .sp
344
+ While these are the standard variable names, you should provide
345
+ backwards compatibility for any old names that were actually in use.
346
+ Make sure you comment them as deprecated, so that no\-one starts using
347
+ them.
348
+ .SS A Sample Find Module
349
+ .sp
350
+ We will describe how to create a simple find module for a library \fBFoo\fP\&.
351
+ .sp
352
+ The top of the module should begin with a license notice, followed by
353
+ a blank line, and then followed by a \X'tty: link #bracket-comment'\fI\%Bracket Comment\fP\X'tty: link'\&. The comment
354
+ should begin with \fB\&.rst:\fP to indicate that the rest of its content is
355
+ reStructuredText\-format documentation. For example:
356
+ .INDENT 0.0
357
+ .INDENT 3.5
358
+ .sp
359
+ .nf
360
+ .ft C
361
+ # Distributed under the OSI\-approved BSD 3\-Clause License. See accompanying
362
+ # file Copyright.txt or https://cmake.org/licensing for details.
363
+
364
+ #[=======================================================================[.rst:
365
+ FindFoo
366
+ \-\-\-\-\-\-\-
367
+
368
+ Finds the Foo library.
369
+
370
+ Imported Targets
371
+ ^^^^^^^^^^^^^^^^
372
+
373
+ This module provides the following imported targets, if found:
374
+
375
+ \(ga\(gaFoo::Foo\(ga\(ga
376
+ The Foo library
377
+
378
+ Result Variables
379
+ ^^^^^^^^^^^^^^^^
380
+
381
+ This will define the following variables:
382
+
383
+ \(ga\(gaFoo_FOUND\(ga\(ga
384
+ True if the system has the Foo library.
385
+ \(ga\(gaFoo_VERSION\(ga\(ga
386
+ The version of the Foo library which was found.
387
+ \(ga\(gaFoo_INCLUDE_DIRS\(ga\(ga
388
+ Include directories needed to use Foo.
389
+ \(ga\(gaFoo_LIBRARIES\(ga\(ga
390
+ Libraries needed to link to Foo.
391
+
392
+ Cache Variables
393
+ ^^^^^^^^^^^^^^^
394
+
395
+ The following cache variables may also be set:
396
+
397
+ \(ga\(gaFoo_INCLUDE_DIR\(ga\(ga
398
+ The directory containing \(ga\(gafoo.h\(ga\(ga.
399
+ \(ga\(gaFoo_LIBRARY\(ga\(ga
400
+ The path to the Foo library.
401
+
402
+ #]=======================================================================]
403
+ .ft P
404
+ .fi
405
+ .UNINDENT
406
+ .UNINDENT
407
+ .sp
408
+ The module documentation consists of:
409
+ .INDENT 0.0
410
+ .IP \(bu 2
411
+ An underlined heading specifying the module name.
412
+ .IP \(bu 2
413
+ A simple description of what the module finds.
414
+ More description may be required for some packages. If there are
415
+ caveats or other details users of the module should be aware of,
416
+ specify them here.
417
+ .IP \(bu 2
418
+ A section listing imported targets provided by the module, if any.
419
+ .IP \(bu 2
420
+ A section listing result variables provided by the module.
421
+ .IP \(bu 2
422
+ Optionally a section listing cache variables used by the module, if any.
423
+ .UNINDENT
424
+ .sp
425
+ If the package provides any macros or functions, they should be listed in
426
+ an additional section, but can be documented by additional \fB\&.rst:\fP
427
+ comment blocks immediately above where those macros or functions are defined.
428
+ .sp
429
+ The find module implementation may begin below the documentation block.
430
+ Now the actual libraries and so on have to be found. The code here will
431
+ obviously vary from module to module (dealing with that, after all, is the
432
+ point of find modules), but there tends to be a common pattern for libraries.
433
+ .sp
434
+ First, we try to use \fBpkg\-config\fP to find the library. Note that we
435
+ cannot rely on this, as it may not be available, but it provides a good
436
+ starting point.
437
+ .INDENT 0.0
438
+ .INDENT 3.5
439
+ .sp
440
+ .nf
441
+ .ft C
442
+ find_package(PkgConfig)
443
+ if(PKG_CONFIG_FOUND)
444
+ pkg_check_modules(PC_Foo QUIET Foo)
445
+ endif()
446
+ .ft P
447
+ .fi
448
+ .UNINDENT
449
+ .UNINDENT
450
+ .sp
451
+ This should define some variables starting \fBPC_Foo_\fP that contain the
452
+ information from the \fBFoo.pc\fP file.
453
+ .sp
454
+ Now we need to find the libraries and include files; we use the
455
+ information from \fBpkg\-config\fP to provide hints to CMake about where to
456
+ look.
457
+ .INDENT 0.0
458
+ .INDENT 3.5
459
+ .sp
460
+ .nf
461
+ .ft C
462
+ find_path(Foo_INCLUDE_DIR
463
+ NAMES foo.h
464
+ PATHS ${PC_Foo_INCLUDE_DIRS}
465
+ PATH_SUFFIXES Foo
466
+ )
467
+ find_library(Foo_LIBRARY
468
+ NAMES foo
469
+ PATHS ${PC_Foo_LIBRARY_DIRS}
470
+ )
471
+ .ft P
472
+ .fi
473
+ .UNINDENT
474
+ .UNINDENT
475
+ .sp
476
+ Alternatively, if the library is available with multiple configurations, you can
477
+ use \X'tty: link #module:SelectLibraryConfigurations'\fI\%SelectLibraryConfigurations\fP\X'tty: link' to automatically set the
478
+ \fBFoo_LIBRARY\fP variable instead:
479
+ .INDENT 0.0
480
+ .INDENT 3.5
481
+ .sp
482
+ .nf
483
+ .ft C
484
+ find_library(Foo_LIBRARY_RELEASE
485
+ NAMES foo
486
+ PATHS ${PC_Foo_LIBRARY_DIRS}/Release
487
+ )
488
+ find_library(Foo_LIBRARY_DEBUG
489
+ NAMES foo
490
+ PATHS ${PC_Foo_LIBRARY_DIRS}/Debug
491
+ )
492
+
493
+ include(SelectLibraryConfigurations)
494
+ select_library_configurations(Foo)
495
+ .ft P
496
+ .fi
497
+ .UNINDENT
498
+ .UNINDENT
499
+ .sp
500
+ If you have a good way of getting the version (from a header file, for
501
+ example), you can use that information to set \fBFoo_VERSION\fP (although
502
+ note that find modules have traditionally used \fBFoo_VERSION_STRING\fP,
503
+ so you may want to set both). Otherwise, attempt to use the information
504
+ from \fBpkg\-config\fP
505
+ .INDENT 0.0
506
+ .INDENT 3.5
507
+ .sp
508
+ .nf
509
+ .ft C
510
+ set(Foo_VERSION ${PC_Foo_VERSION})
511
+ .ft P
512
+ .fi
513
+ .UNINDENT
514
+ .UNINDENT
515
+ .sp
516
+ Now we can use \X'tty: link #module:FindPackageHandleStandardArgs'\fI\%FindPackageHandleStandardArgs\fP\X'tty: link' to do most of the
517
+ rest of the work for us
518
+ .INDENT 0.0
519
+ .INDENT 3.5
520
+ .sp
521
+ .nf
522
+ .ft C
523
+ include(FindPackageHandleStandardArgs)
524
+ find_package_handle_standard_args(Foo
525
+ FOUND_VAR Foo_FOUND
526
+ REQUIRED_VARS
527
+ Foo_LIBRARY
528
+ Foo_INCLUDE_DIR
529
+ VERSION_VAR Foo_VERSION
530
+ )
531
+ .ft P
532
+ .fi
533
+ .UNINDENT
534
+ .UNINDENT
535
+ .sp
536
+ This will check that the \fBREQUIRED_VARS\fP contain values (that do not
537
+ end in \fB\-NOTFOUND\fP) and set \fBFoo_FOUND\fP appropriately. It will also
538
+ cache those values. If \fBFoo_VERSION\fP is set, and a required version
539
+ was passed to \X'tty: link #command:find_package'\fI\%find_package()\fP\X'tty: link', it will check the requested version
540
+ against the one in \fBFoo_VERSION\fP\&. It will also print messages as
541
+ appropriate; note that if the package was found, it will print the
542
+ contents of the first required variable to indicate where it was found.
543
+ .sp
544
+ At this point, we have to provide a way for users of the find module to
545
+ link to the library or libraries that were found. There are two
546
+ approaches, as discussed in the \fI\%Find Modules\fP section above. The
547
+ traditional variable approach looks like
548
+ .INDENT 0.0
549
+ .INDENT 3.5
550
+ .sp
551
+ .nf
552
+ .ft C
553
+ if(Foo_FOUND)
554
+ set(Foo_LIBRARIES ${Foo_LIBRARY})
555
+ set(Foo_INCLUDE_DIRS ${Foo_INCLUDE_DIR})
556
+ set(Foo_DEFINITIONS ${PC_Foo_CFLAGS_OTHER})
557
+ endif()
558
+ .ft P
559
+ .fi
560
+ .UNINDENT
561
+ .UNINDENT
562
+ .sp
563
+ If more than one library was found, all of them should be included in
564
+ these variables (see the \fI\%Standard Variable Names\fP section for more
565
+ information).
566
+ .sp
567
+ When providing imported targets, these should be namespaced (hence the
568
+ \fBFoo::\fP prefix); CMake will recognize that values passed to
569
+ \X'tty: link #command:target_link_libraries'\fI\%target_link_libraries()\fP\X'tty: link' that contain \fB::\fP in their name are
570
+ supposed to be imported targets (rather than just library names), and
571
+ will produce appropriate diagnostic messages if that target does not
572
+ exist (see policy \X'tty: link #policy:CMP0028'\fI\%CMP0028\fP\X'tty: link').
573
+ .INDENT 0.0
574
+ .INDENT 3.5
575
+ .sp
576
+ .nf
577
+ .ft C
578
+ if(Foo_FOUND AND NOT TARGET Foo::Foo)
579
+ add_library(Foo::Foo UNKNOWN IMPORTED)
580
+ set_target_properties(Foo::Foo PROPERTIES
581
+ IMPORTED_LOCATION \(dq${Foo_LIBRARY}\(dq
582
+ INTERFACE_COMPILE_OPTIONS \(dq${PC_Foo_CFLAGS_OTHER}\(dq
583
+ INTERFACE_INCLUDE_DIRECTORIES \(dq${Foo_INCLUDE_DIR}\(dq
584
+ )
585
+ endif()
586
+ .ft P
587
+ .fi
588
+ .UNINDENT
589
+ .UNINDENT
590
+ .sp
591
+ One thing to note about this is that the \fBINTERFACE_INCLUDE_DIRECTORIES\fP and
592
+ similar properties should only contain information about the target itself, and
593
+ not any of its dependencies. Instead, those dependencies should also be
594
+ targets, and CMake should be told that they are dependencies of this target.
595
+ CMake will then combine all the necessary information automatically.
596
+ .sp
597
+ The type of the \X'tty: link #prop_tgt:IMPORTED'\fI\%IMPORTED\fP\X'tty: link' target created in the
598
+ \X'tty: link #command:add_library'\fI\%add_library()\fP\X'tty: link' command can always be specified as \fBUNKNOWN\fP
599
+ type. This simplifies the code in cases where static or shared variants may
600
+ be found, and CMake will determine the type by inspecting the files.
601
+ .sp
602
+ If the library is available with multiple configurations, the
603
+ \X'tty: link #prop_tgt:IMPORTED_CONFIGURATIONS'\fI\%IMPORTED_CONFIGURATIONS\fP\X'tty: link' target property should also be
604
+ populated:
605
+ .INDENT 0.0
606
+ .INDENT 3.5
607
+ .sp
608
+ .nf
609
+ .ft C
610
+ if(Foo_FOUND)
611
+ if (NOT TARGET Foo::Foo)
612
+ add_library(Foo::Foo UNKNOWN IMPORTED)
613
+ endif()
614
+ if (Foo_LIBRARY_RELEASE)
615
+ set_property(TARGET Foo::Foo APPEND PROPERTY
616
+ IMPORTED_CONFIGURATIONS RELEASE
617
+ )
618
+ set_target_properties(Foo::Foo PROPERTIES
619
+ IMPORTED_LOCATION_RELEASE \(dq${Foo_LIBRARY_RELEASE}\(dq
620
+ )
621
+ endif()
622
+ if (Foo_LIBRARY_DEBUG)
623
+ set_property(TARGET Foo::Foo APPEND PROPERTY
624
+ IMPORTED_CONFIGURATIONS DEBUG
625
+ )
626
+ set_target_properties(Foo::Foo PROPERTIES
627
+ IMPORTED_LOCATION_DEBUG \(dq${Foo_LIBRARY_DEBUG}\(dq
628
+ )
629
+ endif()
630
+ set_target_properties(Foo::Foo PROPERTIES
631
+ INTERFACE_COMPILE_OPTIONS \(dq${PC_Foo_CFLAGS_OTHER}\(dq
632
+ INTERFACE_INCLUDE_DIRECTORIES \(dq${Foo_INCLUDE_DIR}\(dq
633
+ )
634
+ endif()
635
+ .ft P
636
+ .fi
637
+ .UNINDENT
638
+ .UNINDENT
639
+ .sp
640
+ The \fBRELEASE\fP variant should be listed first in the property
641
+ so that the variant is chosen if the user uses a configuration which is
642
+ not an exact match for any listed \fBIMPORTED_CONFIGURATIONS\fP\&.
643
+ .sp
644
+ Most of the cache variables should be hidden in the \fBccmake\fP interface unless
645
+ the user explicitly asks to edit them.
646
+ .INDENT 0.0
647
+ .INDENT 3.5
648
+ .sp
649
+ .nf
650
+ .ft C
651
+ mark_as_advanced(
652
+ Foo_INCLUDE_DIR
653
+ Foo_LIBRARY
654
+ )
655
+ .ft P
656
+ .fi
657
+ .UNINDENT
658
+ .UNINDENT
659
+ .sp
660
+ If this module replaces an older version, you should set compatibility variables
661
+ to cause the least disruption possible.
662
+ .INDENT 0.0
663
+ .INDENT 3.5
664
+ .sp
665
+ .nf
666
+ .ft C
667
+ # compatibility variables
668
+ set(Foo_VERSION_STRING ${Foo_VERSION})
669
+ .ft P
670
+ .fi
671
+ .UNINDENT
672
+ .UNINDENT
673
+ .SH COPYRIGHT
674
+ 2000-2024 Kitware, Inc. and Contributors
675
+ .\" Generated by docutils manpage writer.
676
+ .
cmake/man/man7/cmake-env-variables.7 ADDED
@@ -0,0 +1,1443 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .\" Man page generated from reStructuredText.
2
+ .
3
+ .
4
+ .nr rst2man-indent-level 0
5
+ .
6
+ .de1 rstReportMargin
7
+ \\$1 \\n[an-margin]
8
+ level \\n[rst2man-indent-level]
9
+ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
10
+ -
11
+ \\n[rst2man-indent0]
12
+ \\n[rst2man-indent1]
13
+ \\n[rst2man-indent2]
14
+ ..
15
+ .de1 INDENT
16
+ .\" .rstReportMargin pre:
17
+ . RS \\$1
18
+ . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
19
+ . nr rst2man-indent-level +1
20
+ .\" .rstReportMargin post:
21
+ ..
22
+ .de UNINDENT
23
+ . RE
24
+ .\" indent \\n[an-margin]
25
+ .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
26
+ .nr rst2man-indent-level -1
27
+ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
28
+ .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
29
+ ..
30
+ .TH "CMAKE-ENV-VARIABLES" "7" "Jan 10, 2025" "3.31.4" "CMake"
31
+ .SH NAME
32
+ cmake-env-variables \- CMake Environment Variables Reference
33
+ .sp
34
+ This page lists environment variables that have special
35
+ meaning to CMake.
36
+ .sp
37
+ For general information on environment variables, see the
38
+ \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variables\fP\X'tty: link'
39
+ section in the cmake\-language manual.
40
+ .SH ENVIRONMENT VARIABLES THAT CHANGE BEHAVIOR
41
+ .SS CMAKE_APPBUNDLE_PATH
42
+ .sp
43
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
44
+ the calling process environment.
45
+ .sp
46
+ The \fBCMAKE_APPBUNDLE_PATH\fP environment variable may be set to a list of
47
+ directories to be searched for macOS application bundles
48
+ by the \X'tty: link #command:find_program'\fI\%find_program()\fP\X'tty: link' and \X'tty: link #command:find_package'\fI\%find_package()\fP\X'tty: link' commands.
49
+ .sp
50
+ This variable may hold a single directory or a list of directories separated
51
+ by \fB:\fP on UNIX or \fB;\fP on Windows (the same as the \fBPATH\fP environment
52
+ variable convention on those platforms).
53
+ .sp
54
+ See also the \X'tty: link #variable:CMAKE_APPBUNDLE_PATH'\fI\%CMAKE_APPBUNDLE_PATH\fP\X'tty: link' CMake variable.
55
+ .SS CMAKE_FRAMEWORK_PATH
56
+ .sp
57
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
58
+ the calling process environment.
59
+ .sp
60
+ The \fBCMAKE_FRAMEWORK_PATH\fP environment variable may be set to a list of
61
+ directories to be searched for macOS frameworks by the \X'tty: link #command:find_library'\fI\%find_library()\fP\X'tty: link',
62
+ \X'tty: link #command:find_package'\fI\%find_package()\fP\X'tty: link', \X'tty: link #command:find_path'\fI\%find_path()\fP\X'tty: link' and \X'tty: link #command:find_file'\fI\%find_file()\fP\X'tty: link' commands.
63
+ .sp
64
+ This variable may hold a single directory or a list of directories separated
65
+ by \fB:\fP on UNIX or \fB;\fP on Windows (the same as the \fBPATH\fP environment
66
+ variable convention on those platforms).
67
+ .sp
68
+ See also the \X'tty: link #variable:CMAKE_FRAMEWORK_PATH'\fI\%CMAKE_FRAMEWORK_PATH\fP\X'tty: link' CMake variable.
69
+ .SS CMAKE_INCLUDE_PATH
70
+ .sp
71
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
72
+ the calling process environment.
73
+ .sp
74
+ The \fBCMAKE_INCLUDE_PATH\fP environment variable may be set to a list of
75
+ directories to be searched by the \X'tty: link #command:find_file'\fI\%find_file()\fP\X'tty: link' and \X'tty: link #command:find_path'\fI\%find_path()\fP\X'tty: link' commands.
76
+ .sp
77
+ This variable may hold a single directory or a list of directories separated
78
+ by \fB:\fP on UNIX or \fB;\fP on Windows (the same as the \fBPATH\fP environment
79
+ variable convention on those platforms).
80
+ .sp
81
+ See also the \X'tty: link #variable:CMAKE_INCLUDE_PATH'\fI\%CMAKE_INCLUDE_PATH\fP\X'tty: link' CMake variable.
82
+ .SS CMAKE_LIBRARY_PATH
83
+ .sp
84
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
85
+ the calling process environment.
86
+ .sp
87
+ The \fBCMAKE_LIBRARY_PATH\fP environment variable may be set to a list of
88
+ directories to be searched by the \X'tty: link #command:find_library'\fI\%find_library()\fP\X'tty: link' command.
89
+ .sp
90
+ This variable may hold a single directory or a list of directories separated
91
+ by \fB:\fP on UNIX or \fB;\fP on Windows (the same as the \fBPATH\fP environment
92
+ variable convention on those platforms).
93
+ .sp
94
+ See also the \X'tty: link #variable:CMAKE_LIBRARY_PATH'\fI\%CMAKE_LIBRARY_PATH\fP\X'tty: link' CMake variable.
95
+ .SS CMAKE_MAXIMUM_RECURSION_DEPTH
96
+ .sp
97
+ Added in version 3.27.
98
+
99
+ .sp
100
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
101
+ the calling process environment.
102
+ .sp
103
+ Maximum recursion depth for CMake scripts. This environment variable is
104
+ used if the \X'tty: link #variable:CMAKE_MAXIMUM_RECURSION_DEPTH'\fI\%CMAKE_MAXIMUM_RECURSION_DEPTH\fP\X'tty: link' variable is not set.
105
+ See that variable\(aqs documentation for details.
106
+ .SS CMAKE_PREFIX_PATH
107
+ .sp
108
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
109
+ the calling process environment.
110
+ .sp
111
+ The \fBCMAKE_PREFIX_PATH\fP environment variable may be set to a list of
112
+ directories specifying installation \fIprefixes\fP to be searched by the
113
+ \X'tty: link #command:find_package'\fI\%find_package()\fP\X'tty: link', \X'tty: link #command:find_program'\fI\%find_program()\fP\X'tty: link', \X'tty: link #command:find_library'\fI\%find_library()\fP\X'tty: link',
114
+ \X'tty: link #command:find_file'\fI\%find_file()\fP\X'tty: link', and \X'tty: link #command:find_path'\fI\%find_path()\fP\X'tty: link' commands. Each command will
115
+ add appropriate subdirectories (like \fBbin\fP, \fBlib\fP, or \fBinclude\fP)
116
+ as specified in its own documentation.
117
+ .sp
118
+ This variable may hold a single prefix or a list of prefixes separated
119
+ by \fB:\fP on UNIX or \fB;\fP on Windows (the same as the \fBPATH\fP environment
120
+ variable convention on those platforms).
121
+ .sp
122
+ See also the \X'tty: link #variable:CMAKE_PREFIX_PATH'\fI\%CMAKE_PREFIX_PATH\fP\X'tty: link' CMake variable.
123
+ .SS CMAKE_PROGRAM_PATH
124
+ .sp
125
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
126
+ the calling process environment.
127
+ .sp
128
+ The \fBCMAKE_PROGRAM_PATH\fP environment variable may be set to a list of
129
+ directories to be searched by the \X'tty: link #command:find_program'\fI\%find_program()\fP\X'tty: link' command.
130
+ .sp
131
+ This variable may hold a single directory or a list of directories separated
132
+ by \fB:\fP on UNIX or \fB;\fP on Windows (the same as the \fBPATH\fP environment
133
+ variable convention on those platforms).
134
+ .sp
135
+ See also the \X'tty: link #variable:CMAKE_PROGRAM_PATH'\fI\%CMAKE_PROGRAM_PATH\fP\X'tty: link' CMake variable.
136
+ .SS CMAKE_TLS_VERIFY
137
+ .sp
138
+ Added in version 3.30.
139
+
140
+ .sp
141
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
142
+ the calling process environment.
143
+ .sp
144
+ Specify the default value for the \X'tty: link #download'\fI\%file(DOWNLOAD)\fP\X'tty: link' and
145
+ \X'tty: link #upload'\fI\%file(UPLOAD)\fP\X'tty: link' commands\(aq \fBTLS_VERIFY\fP option.
146
+ This environment variable is used if the option is not given
147
+ and the \X'tty: link #variable:CMAKE_TLS_VERIFY'\fI\%CMAKE_TLS_VERIFY\fP\X'tty: link' cmake variable is not set.
148
+ .sp
149
+ This variable is also used by the \X'tty: link #module:ExternalProject'\fI\%ExternalProject\fP\X'tty: link' and
150
+ \X'tty: link #module:FetchContent'\fI\%FetchContent\fP\X'tty: link' modules for internal calls to
151
+ \X'tty: link #download'\fI\%file(DOWNLOAD)\fP\X'tty: link' and \fBgit clone\fP\&.
152
+ .SS CMAKE_TLS_VERSION
153
+ .sp
154
+ Added in version 3.30.
155
+
156
+ .sp
157
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
158
+ the calling process environment.
159
+ .sp
160
+ Specify the default value for the \X'tty: link #download'\fI\%file(DOWNLOAD)\fP\X'tty: link' and
161
+ \X'tty: link #upload'\fI\%file(UPLOAD)\fP\X'tty: link' commands\(aq \fBTLS_VERSION\fP option.
162
+ This environment variable is used if the option is not given
163
+ and the \X'tty: link #variable:CMAKE_TLS_VERSION'\fI\%CMAKE_TLS_VERSION\fP\X'tty: link' cmake variable is not set.
164
+ See that variable for allowed values.
165
+ .sp
166
+ This variable is also used by the \X'tty: link #module:ExternalProject'\fI\%ExternalProject\fP\X'tty: link' and
167
+ \X'tty: link #module:FetchContent'\fI\%FetchContent\fP\X'tty: link' modules for internal calls to
168
+ \X'tty: link #download'\fI\%file(DOWNLOAD)\fP\X'tty: link' and \fBgit clone\fP\&.
169
+ .SS SSL_CERT_DIR
170
+ .sp
171
+ Added in version 3.25.
172
+
173
+ .sp
174
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
175
+ the calling process environment.
176
+ .sp
177
+ Specify default directory containing CA certificates. It overrides
178
+ the default CA directory used.
179
+ .SS SSL_CERT_FILE
180
+ .sp
181
+ Added in version 3.25.
182
+
183
+ .sp
184
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
185
+ the calling process environment.
186
+ .sp
187
+ Specify the file name containing CA certificates. It overrides the
188
+ default, os\-specific CA file used.
189
+ .SH ENVIRONMENT VARIABLES THAT CONTROL THE BUILD
190
+ .SS ADSP_ROOT
191
+ .sp
192
+ Added in version 3.24.
193
+
194
+ .sp
195
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
196
+ the calling process environment.
197
+ .sp
198
+ The \fBADSP_ROOT\fP environment variable specifies a default value
199
+ for the \X'tty: link #variable:CMAKE_ADSP_ROOT'\fI\%CMAKE_ADSP_ROOT\fP\X'tty: link' variable when there is no explicit
200
+ configuration given on the first run while creating a new build tree.
201
+ .SS CMAKE_APPLE_SILICON_PROCESSOR
202
+ .sp
203
+ Added in version 3.19.2.
204
+
205
+ .sp
206
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
207
+ the calling process environment.
208
+ .sp
209
+ On Apple Silicon hosts running macOS, set this environment variable to tell
210
+ CMake what architecture to use for \X'tty: link #variable:CMAKE_HOST_SYSTEM_PROCESSOR'\fI\%CMAKE_HOST_SYSTEM_PROCESSOR\fP\X'tty: link'\&.
211
+ The value must be either \fBarm64\fP or \fBx86_64\fP\&.
212
+ .sp
213
+ The \X'tty: link #variable:CMAKE_APPLE_SILICON_PROCESSOR'\fI\%CMAKE_APPLE_SILICON_PROCESSOR\fP\X'tty: link' normal variable, if set,
214
+ overrides this environment variable.
215
+ .SS CMAKE_BUILD_PARALLEL_LEVEL
216
+ .sp
217
+ Added in version 3.12.
218
+
219
+ .sp
220
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
221
+ the calling process environment.
222
+ .sp
223
+ Specifies the maximum number of concurrent processes to use when building
224
+ using the \fBcmake \-\-build\fP command line
225
+ \X'tty: link #build-tool-mode'\fI\%Build Tool Mode\fP\X'tty: link'\&.
226
+ For example, if \fBCMAKE_BUILD_PARALLEL_LEVEL\fP is set to 8, the
227
+ underlying build tool will execute up to 8 jobs concurrently as if
228
+ \fBcmake \-\-build\fP were invoked with the
229
+ \X'tty: link #cmdoption-cmake-build-j'\fI\%\-\-parallel 8\fP\X'tty: link' option.
230
+ .sp
231
+ If this variable is defined empty the native build tool\(aqs default number is
232
+ used.
233
+ .SS CMAKE_BUILD_TYPE
234
+ .sp
235
+ Added in version 3.22.
236
+
237
+ .sp
238
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
239
+ the calling process environment.
240
+ .sp
241
+ The \fBCMAKE_BUILD_TYPE\fP environment variable specifies a default value
242
+ for the \X'tty: link #variable:CMAKE_BUILD_TYPE'\fI\%CMAKE_BUILD_TYPE\fP\X'tty: link' variable when there is no explicit
243
+ configuration given on the first run while creating a new build tree.
244
+ .SS CMAKE_COLOR_DIAGNOSTICS
245
+ .sp
246
+ Added in version 3.24.
247
+
248
+ .sp
249
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
250
+ the calling process environment.
251
+ .sp
252
+ Specifies a default value for the \X'tty: link #variable:CMAKE_COLOR_DIAGNOSTICS'\fI\%CMAKE_COLOR_DIAGNOSTICS\fP\X'tty: link' variable
253
+ when there is no explicit value given on the first run.
254
+ .SS CMAKE_CONFIG_DIR
255
+ .sp
256
+ Added in version 3.31.
257
+
258
+ .sp
259
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
260
+ the calling process environment.
261
+ .sp
262
+ Specify a CMake user\-wide configuration directory for
263
+ \X'tty: link #manual:cmake-file-api(7)'\fI\%cmake\-file\-api(7)\fP\X'tty: link' queries.
264
+ .sp
265
+ If this environment variable is not set, the default user\-wide
266
+ configuration directory is platform\-specific:
267
+ .INDENT 0.0
268
+ .IP \(bu 2
269
+ Windows: \fB%LOCALAPPDATA%\eCMake\fP
270
+ .IP \(bu 2
271
+ macOS: \fB$XDG_CONFIG_HOME/CMake\fP if set, otherwise
272
+ \fB$HOME/Library/Application Support/CMake\fP
273
+ .IP \(bu 2
274
+ Linux/Other: \fB$XDG_CONFIG_HOME/cmake\fP if set, otherwise
275
+ \fB$HOME/.config/cmake\fP
276
+ .UNINDENT
277
+ .SS CMAKE_CONFIG_TYPE
278
+ .sp
279
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
280
+ the calling process environment.
281
+ .sp
282
+ The default build configuration for \X'tty: link #build-tool-mode'\fI\%Build a Project\fP\X'tty: link' and
283
+ \fBctest\fP build handler when there is no explicit configuration given.
284
+ .SS CMAKE_CONFIGURATION_TYPES
285
+ .sp
286
+ Added in version 3.22.
287
+
288
+ .sp
289
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
290
+ the calling process environment.
291
+ .sp
292
+ The \fBCMAKE_CONFIGURATION_TYPES\fP environment variable specifies a
293
+ default value for the \X'tty: link #variable:CMAKE_CONFIGURATION_TYPES'\fI\%CMAKE_CONFIGURATION_TYPES\fP\X'tty: link' variable
294
+ when there is no explicit configuration given on the first run while
295
+ creating a new build tree.
296
+ .SS CMAKE_CROSSCOMPILING_EMULATOR
297
+ .sp
298
+ Added in version 3.28.
299
+
300
+ .sp
301
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
302
+ the calling process environment.
303
+ .sp
304
+ The default value for \X'tty: link #variable:CMAKE_CROSSCOMPILING_EMULATOR'\fI\%CMAKE_CROSSCOMPILING_EMULATOR\fP\X'tty: link' when there
305
+ is no explicit configuration given on the first run while creating a new
306
+ build tree. On later runs in an existing build tree the value persists in
307
+ the cache as \X'tty: link #variable:CMAKE_CROSSCOMPILING_EMULATOR'\fI\%CMAKE_CROSSCOMPILING_EMULATOR\fP\X'tty: link'\&.
308
+ .SS CMAKE_EXPORT_BUILD_DATABASE
309
+ .sp
310
+ Added in version 3.31.
311
+
312
+ .sp
313
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
314
+ the calling process environment.
315
+ .sp
316
+ The default value for \X'tty: link #variable:CMAKE_EXPORT_BUILD_DATABASE'\fI\%CMAKE_EXPORT_BUILD_DATABASE\fP\X'tty: link' when there is no
317
+ explicit configuration given on the first run while creating a new build tree.
318
+ On later runs in an existing build tree the value persists in the cache as
319
+ \X'tty: link #variable:CMAKE_EXPORT_BUILD_DATABASE'\fI\%CMAKE_EXPORT_BUILD_DATABASE\fP\X'tty: link'\&.
320
+ .sp
321
+ \fBNOTE:\fP
322
+ .INDENT 0.0
323
+ .INDENT 3.5
324
+ This variable is meaningful only when experimental support for build
325
+ databases has been enabled by the
326
+ \fBCMAKE_EXPERIMENTAL_EXPORT_BUILD_DATABASE\fP gate.
327
+ .UNINDENT
328
+ .UNINDENT
329
+ .SS CMAKE_EXPORT_COMPILE_COMMANDS
330
+ .sp
331
+ Added in version 3.17.
332
+
333
+ .sp
334
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
335
+ the calling process environment.
336
+ .sp
337
+ The default value for \X'tty: link #variable:CMAKE_EXPORT_COMPILE_COMMANDS'\fI\%CMAKE_EXPORT_COMPILE_COMMANDS\fP\X'tty: link' when there
338
+ is no explicit configuration given on the first run while creating a new
339
+ build tree. On later runs in an existing build tree the value persists in
340
+ the cache as \X'tty: link #variable:CMAKE_EXPORT_COMPILE_COMMANDS'\fI\%CMAKE_EXPORT_COMPILE_COMMANDS\fP\X'tty: link'\&.
341
+ .SS CMAKE_GENERATOR
342
+ .sp
343
+ Added in version 3.15.
344
+
345
+ .sp
346
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
347
+ the calling process environment.
348
+ .sp
349
+ Specifies the CMake default generator to use when no generator is supplied
350
+ with \X'tty: link #cmdoption-cmake-G'\fI\%\-G\fP\X'tty: link'\&. If the provided value doesn\(aqt name a generator
351
+ known by CMake, the internal default is used. Either way the resulting
352
+ generator selection is stored in the \X'tty: link #variable:CMAKE_GENERATOR'\fI\%CMAKE_GENERATOR\fP\X'tty: link' variable.
353
+ .sp
354
+ Some generators may be additionally configured using the environment
355
+ variables:
356
+ .INDENT 0.0
357
+ .IP \(bu 2
358
+ \X'tty: link #envvar:CMAKE_GENERATOR_PLATFORM'\fI\%CMAKE_GENERATOR_PLATFORM\fP\X'tty: link'
359
+ .IP \(bu 2
360
+ \X'tty: link #envvar:CMAKE_GENERATOR_TOOLSET'\fI\%CMAKE_GENERATOR_TOOLSET\fP\X'tty: link'
361
+ .IP \(bu 2
362
+ \X'tty: link #envvar:CMAKE_GENERATOR_INSTANCE'\fI\%CMAKE_GENERATOR_INSTANCE\fP\X'tty: link'
363
+ .UNINDENT
364
+ .SS CMAKE_GENERATOR_INSTANCE
365
+ .sp
366
+ Added in version 3.15.
367
+
368
+ .sp
369
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
370
+ the calling process environment.
371
+ .sp
372
+ Default value for \X'tty: link #variable:CMAKE_GENERATOR_INSTANCE'\fI\%CMAKE_GENERATOR_INSTANCE\fP\X'tty: link' if no Cache entry is
373
+ present. This value is only applied if \X'tty: link #envvar:CMAKE_GENERATOR'\fI\%CMAKE_GENERATOR\fP\X'tty: link' is set.
374
+ .SS CMAKE_GENERATOR_PLATFORM
375
+ .sp
376
+ Added in version 3.15.
377
+
378
+ .sp
379
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
380
+ the calling process environment.
381
+ .sp
382
+ Default value for \X'tty: link #variable:CMAKE_GENERATOR_PLATFORM'\fI\%CMAKE_GENERATOR_PLATFORM\fP\X'tty: link' if no Cache entry
383
+ is present and no value is specified by \X'tty: link #cmdoption-cmake-A'\fI\%cmake \-A\fP\X'tty: link' option.
384
+ This value is only applied if \X'tty: link #envvar:CMAKE_GENERATOR'\fI\%CMAKE_GENERATOR\fP\X'tty: link' is set.
385
+ .SS CMAKE_GENERATOR_TOOLSET
386
+ .sp
387
+ Added in version 3.15.
388
+
389
+ .sp
390
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
391
+ the calling process environment.
392
+ .sp
393
+ Default value for \X'tty: link #variable:CMAKE_GENERATOR_TOOLSET'\fI\%CMAKE_GENERATOR_TOOLSET\fP\X'tty: link' if no Cache entry
394
+ is present and no value is specified by \X'tty: link #cmdoption-cmake-T'\fI\%cmake \-T\fP\X'tty: link' option.
395
+ This value is only applied if \X'tty: link #envvar:CMAKE_GENERATOR'\fI\%CMAKE_GENERATOR\fP\X'tty: link' is set.
396
+ .SS CMAKE_INSTALL_MODE
397
+ .sp
398
+ Added in version 3.22.
399
+
400
+ .sp
401
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
402
+ the calling process environment.
403
+ .sp
404
+ The \fBCMAKE_INSTALL_MODE\fP environment variable allows users to operate
405
+ CMake in an alternate mode of \X'tty: link #install'\fI\%file(INSTALL)\fP\X'tty: link' and \X'tty: link #command:install'\fI\%install()\fP\X'tty: link'\&.
406
+ .sp
407
+ The default behavior for an installation is to copy a source file from a
408
+ source directory into a destination directory. This environment variable
409
+ however allows the user to override this behavior, causing CMake to create
410
+ symbolic links instead.
411
+ .SS Usage Scenarios
412
+ .sp
413
+ Installing symbolic links rather than copying files can help in the following
414
+ ways:
415
+ .INDENT 0.0
416
+ .IP \(bu 2
417
+ Conserving storage space because files do not have to be duplicated on disk.
418
+ .IP \(bu 2
419
+ Changes to the source of the symbolic link are seen at the install
420
+ destination without having to re\-run the install step.
421
+ .IP \(bu 2
422
+ Editing through the link at the install destination will modify the source
423
+ of the link. This may be useful when dealing with CMake project hierarchies,
424
+ i.e. using \X'tty: link #module:ExternalProject'\fI\%ExternalProject\fP\X'tty: link' and consistent source navigation and
425
+ refactoring is desired across projects.
426
+ .UNINDENT
427
+ .SS Allowed Values
428
+ .sp
429
+ The following values are allowed for \fBCMAKE_INSTALL_MODE\fP:
430
+ .INDENT 0.0
431
+ .TP
432
+ .B \fBCOPY\fP, empty or unset
433
+ Duplicate the file at its destination. This is the default behavior.
434
+ .TP
435
+ .B \fBABS_SYMLINK\fP
436
+ Create an \fIabsolute\fP symbolic link to the source file at the destination.
437
+ Halt with an error if the link cannot be created.
438
+ .TP
439
+ .B \fBABS_SYMLINK_OR_COPY\fP
440
+ Like \fBABS_SYMLINK\fP but fall back to silently copying if the symlink
441
+ couldn\(aqt be created.
442
+ .TP
443
+ .B \fBREL_SYMLINK\fP
444
+ Create a \fIrelative\fP symbolic link to the source file at the destination.
445
+ Halt with an error if the link cannot be created.
446
+ .TP
447
+ .B \fBREL_SYMLINK_OR_COPY\fP
448
+ Like \fBREL_SYMLINK\fP but fall back to silently copying if the symlink
449
+ couldn\(aqt be created.
450
+ .TP
451
+ .B \fBSYMLINK\fP
452
+ Try as if through \fBREL_SYMLINK\fP and fall back to \fBABS_SYMLINK\fP if the
453
+ referenced file cannot be expressed using a relative path.
454
+ Halt with an error if the link cannot be created.
455
+ .TP
456
+ .B \fBSYMLINK_OR_COPY\fP
457
+ Like \fBSYMLINK\fP but fall back to silently copying if the symlink couldn\(aqt
458
+ be created.
459
+ .UNINDENT
460
+ .sp
461
+ \fBNOTE:\fP
462
+ .INDENT 0.0
463
+ .INDENT 3.5
464
+ A symbolic link consists of a reference file path rather than contents of its
465
+ own, hence there are two ways to express the relation, either by a \fIrelative\fP
466
+ or an \fIabsolute\fP path.
467
+ .UNINDENT
468
+ .UNINDENT
469
+ .SS When To Set The Environment Variable
470
+ .sp
471
+ For the environment variable to take effect, it must be set during the correct
472
+ build phase(s).
473
+ .INDENT 0.0
474
+ .IP \(bu 2
475
+ If the project calls \X'tty: link #install'\fI\%file(INSTALL)\fP\X'tty: link' directly, the environment
476
+ variable must be set during the configuration phase.
477
+ .IP \(bu 2
478
+ In order to apply to \X'tty: link #command:install'\fI\%install()\fP\X'tty: link', the environment variable must be
479
+ set during installation. This could be during a build if using the
480
+ \fBinstall\fP or \fBpackage\fP build targets, or separate from the build when
481
+ invoking an install or running \X'tty: link #manual:cpack(1)'\fI\%cpack\fP\X'tty: link' from the command
482
+ line.
483
+ .IP \(bu 2
484
+ When using \X'tty: link #module:ExternalProject'\fI\%ExternalProject\fP\X'tty: link', it might be required during the build
485
+ phase, since the external project\(aqs own configure, build and install steps
486
+ will execute during the main project\(aqs build phase.
487
+ .UNINDENT
488
+ .sp
489
+ Given the above, it is recommended to set the environment variable consistently
490
+ across all phases (configure, build and install).
491
+ .SS Caveats
492
+ .sp
493
+ Use this environment variable with caution. The following highlights some
494
+ points to be considered:
495
+ .INDENT 0.0
496
+ .IP \(bu 2
497
+ \fBCMAKE_INSTALL_MODE\fP only affects files, not directories.
498
+ .IP \(bu 2
499
+ Symbolic links are not available on all platforms.
500
+ .IP \(bu 2
501
+ The way this environment variable interacts with the install step of
502
+ \X'tty: link #module:ExternalProject'\fI\%ExternalProject\fP\X'tty: link' is more complex. For further details, see that
503
+ module\(aqs documentation.
504
+ .IP \(bu 2
505
+ A symbolic link ties the destination to the source in a persistent way.
506
+ Writing to either of the two affects both file system objects.
507
+ This is in contrast to normal install behavior which only copies files as
508
+ they were at the time the install was performed, with no enduring
509
+ relationship between the source and destination of the install.
510
+ .IP \(bu 2
511
+ Combining \fBCMAKE_INSTALL_MODE\fP with \X'tty: link #prop_tgt:IOS_INSTALL_COMBINED'\fI\%IOS_INSTALL_COMBINED\fP\X'tty: link' is
512
+ not supported.
513
+ .IP \(bu 2
514
+ Changing \fBCMAKE_INSTALL_MODE\fP from what it was on a previous run can lead
515
+ to unexpected results. Moving from a non\-symlinking mode to a symlinking
516
+ mode will discard any previous file at the destination, but the reverse is
517
+ not true. Once a symlink exists at the destination, even if you switch to a
518
+ non\-symlink mode, the symlink will continue to exist at the destination and
519
+ will not be replaced by an actual file.
520
+ .UNINDENT
521
+ .SS CMAKE_INSTALL_PARALLEL_LEVEL
522
+ .sp
523
+ Added in version 3.31.
524
+
525
+ .sp
526
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
527
+ the calling process environment.
528
+ .sp
529
+ Specifies the default maximum number of concurrent processes to use when
530
+ installing using \fBcmake \-\-install\fP\&.
531
+ .sp
532
+ This has no impact unless \X'tty: link #prop_gbl:INSTALL_PARALLEL'\fI\%INSTALL_PARALLEL\fP\X'tty: link' is enabled.
533
+ .SS CMAKE_INSTALL_PREFIX
534
+ .sp
535
+ Added in version 3.29.
536
+
537
+ .sp
538
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
539
+ the calling process environment.
540
+ .sp
541
+ The \fBCMAKE_INSTALL_PREFIX\fP environment variable specifies a custom default
542
+ value for the \X'tty: link #variable:CMAKE_INSTALL_PREFIX'\fI\%CMAKE_INSTALL_PREFIX\fP\X'tty: link' variable in place of the
543
+ default values specified by CMake itself. The value specified must be an
544
+ absolute path to a directory.
545
+ .SS CMAKE_<LANG>_COMPILER_LAUNCHER
546
+ .sp
547
+ Added in version 3.17.
548
+
549
+ .sp
550
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
551
+ the calling process environment.
552
+ .sp
553
+ Default compiler launcher to use for the specified language. Will only be used
554
+ by CMake to initialize the variable on the first configuration. Afterwards, it
555
+ is available through the cache setting of the variable of the same name. For
556
+ any configuration run (including the first), the environment variable will be
557
+ ignored if the \X'tty: link #variable:CMAKE_<LANG>_COMPILER_LAUNCHER'\fI\%CMAKE_<LANG>_COMPILER_LAUNCHER\fP\X'tty: link' variable is defined.
558
+ .SS CMAKE_<LANG>_IMPLICIT_LINK_DIRECTORIES_EXCLUDE
559
+ .sp
560
+ Added in version 3.27.
561
+
562
+ .sp
563
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
564
+ the calling process environment.
565
+ .sp
566
+ A \X'tty: link #cmake-language-lists'\fI\%semicolon\-separated list\fP\X'tty: link' of directories
567
+ to exclude from the \X'tty: link #variable:CMAKE_<LANG>_IMPLICIT_LINK_DIRECTORIES'\fI\%CMAKE_<LANG>_IMPLICIT_LINK_DIRECTORIES\fP\X'tty: link'
568
+ variable when it is automatically detected from the \fB<LANG>\fP compiler.
569
+ .sp
570
+ This may be used to work around misconfigured compiler drivers that pass
571
+ extraneous implicit link directories to their linker.
572
+ .SS CMAKE_<LANG>_LINKER_LAUNCHER
573
+ .sp
574
+ Added in version 3.21.
575
+
576
+ .sp
577
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
578
+ the calling process environment.
579
+ .sp
580
+ Default launcher to use when linking a target of the specified language. Will
581
+ only be used by CMake to initialize the variable on the first configuration.
582
+ Afterwards, it is available through the cache setting of the variable of the
583
+ same name. For any configuration run (including the first), the environment
584
+ variable will be ignored if the \X'tty: link #variable:CMAKE_<LANG>_LINKER_LAUNCHER'\fI\%CMAKE_<LANG>_LINKER_LAUNCHER\fP\X'tty: link'
585
+ variable is defined.
586
+ .SS CMAKE_MSVCIDE_RUN_PATH
587
+ .sp
588
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
589
+ the calling process environment.
590
+ .sp
591
+ Extra PATH locations for custom commands when using
592
+ \X'tty: link #visual-studio-generators'\fI\%Visual Studio Generators\fP\X'tty: link'\&.
593
+ .sp
594
+ The \fBCMAKE_MSVCIDE_RUN_PATH\fP environment variable sets the default value for
595
+ the \X'tty: link #variable:CMAKE_MSVCIDE_RUN_PATH'\fI\%CMAKE_MSVCIDE_RUN_PATH\fP\X'tty: link' variable if not already explicitly set.
596
+ .SS CMAKE_NO_VERBOSE
597
+ .sp
598
+ Added in version 3.14.
599
+
600
+ .sp
601
+ Disables verbose output from CMake when \X'tty: link #envvar:VERBOSE'\fI\%VERBOSE\fP\X'tty: link' environment variable
602
+ is set.
603
+ .sp
604
+ Only your build tool of choice will still print verbose output when you start
605
+ to actually build your project.
606
+ .SS CMAKE_OSX_ARCHITECTURES
607
+ .sp
608
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
609
+ the calling process environment.
610
+ .sp
611
+ Target specific architectures for macOS.
612
+ .sp
613
+ The \fBCMAKE_OSX_ARCHITECTURES\fP environment variable sets the default value for
614
+ the \X'tty: link #variable:CMAKE_OSX_ARCHITECTURES'\fI\%CMAKE_OSX_ARCHITECTURES\fP\X'tty: link' variable. See
615
+ \X'tty: link #prop_tgt:OSX_ARCHITECTURES'\fI\%OSX_ARCHITECTURES\fP\X'tty: link' for more information.
616
+ .SS CMAKE_TEST_LAUNCHER
617
+ .sp
618
+ Added in version 3.29.
619
+
620
+ .sp
621
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
622
+ the calling process environment.
623
+ .sp
624
+ The default value for the \X'tty: link #variable:CMAKE_TEST_LAUNCHER'\fI\%CMAKE_TEST_LAUNCHER\fP\X'tty: link' variable when there
625
+ is no explicit configuration given on the first run while creating a new
626
+ build tree. On later runs in an existing build tree the value persists in
627
+ the cache as \X'tty: link #variable:CMAKE_TEST_LAUNCHER'\fI\%CMAKE_TEST_LAUNCHER\fP\X'tty: link'\&.
628
+ .SS CMAKE_TOOLCHAIN_FILE
629
+ .sp
630
+ Added in version 3.21.
631
+
632
+ .sp
633
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
634
+ the calling process environment.
635
+ .sp
636
+ The \fBCMAKE_TOOLCHAIN_FILE\fP environment variable specifies a default value
637
+ for the \X'tty: link #variable:CMAKE_TOOLCHAIN_FILE'\fI\%CMAKE_TOOLCHAIN_FILE\fP\X'tty: link' variable when there is no explicit
638
+ configuration given on the first run while creating a new build tree.
639
+ On later runs in an existing build tree the value persists in the cache
640
+ as \X'tty: link #variable:CMAKE_TOOLCHAIN_FILE'\fI\%CMAKE_TOOLCHAIN_FILE\fP\X'tty: link'\&.
641
+ .SS DESTDIR
642
+ .sp
643
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
644
+ the calling process environment.
645
+ .sp
646
+ On UNIX one can use the \fBDESTDIR\fP mechanism in order to relocate the
647
+ whole installation. \fBDESTDIR\fP means DESTination DIRectory. It is
648
+ commonly used by packagers to install software in a staging directory.
649
+ .sp
650
+ For example, running
651
+ .INDENT 0.0
652
+ .INDENT 3.5
653
+ .sp
654
+ .nf
655
+ .ft C
656
+ make DESTDIR=/package/stage install
657
+ .ft P
658
+ .fi
659
+ .UNINDENT
660
+ .UNINDENT
661
+ .sp
662
+ will install the software using the installation prefix, e.g. \fB/usr/local\fP,
663
+ prepended with the \fBDESTDIR\fP value which gives \fB/package/stage/usr/local\fP\&.
664
+ The packaging tool may then construct the package from the content of the
665
+ \fB/package/stage\fP directory.
666
+ .sp
667
+ See the \X'tty: link #variable:CMAKE_INSTALL_PREFIX'\fI\%CMAKE_INSTALL_PREFIX\fP\X'tty: link' variable to control the
668
+ installation prefix when configuring a build tree. Or, when using
669
+ the \X'tty: link #manual:cmake(1)'\fI\%cmake(1)\fP\X'tty: link' command\-line tool\(aqs \X'tty: link #cmdoption-cmake-install'\fI\%\-\-install\fP\X'tty: link'
670
+ mode, one may specify a different prefix using the
671
+ \X'tty: link #cmdoption-cmake--install-0'\fI\%\-\-prefix\fP\X'tty: link' option.
672
+ .sp
673
+ \fBNOTE:\fP
674
+ .INDENT 0.0
675
+ .INDENT 3.5
676
+ \fBDESTDIR\fP may not be used on Windows because installation
677
+ prefix usually contains a drive letter like in \fBC:/Program Files\fP
678
+ which cannot be prepended with some other prefix.
679
+ .UNINDENT
680
+ .UNINDENT
681
+ .SS LDFLAGS
682
+ .sp
683
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
684
+ the calling process environment.
685
+ .sp
686
+ Will only be used by CMake on the first configuration to determine the default
687
+ linker flags, after which the value for \fBLDFLAGS\fP is stored in the cache
688
+ as \X'tty: link #variable:CMAKE_EXE_LINKER_FLAGS_INIT'\fI\%CMAKE_EXE_LINKER_FLAGS_INIT\fP\X'tty: link',
689
+ \X'tty: link #variable:CMAKE_SHARED_LINKER_FLAGS_INIT'\fI\%CMAKE_SHARED_LINKER_FLAGS_INIT\fP\X'tty: link', and
690
+ \X'tty: link #variable:CMAKE_MODULE_LINKER_FLAGS_INIT'\fI\%CMAKE_MODULE_LINKER_FLAGS_INIT\fP\X'tty: link'\&. For any configuration run
691
+ (including the first), the environment variable will be ignored if the
692
+ equivalent \fBCMAKE_<TYPE>_LINKER_FLAGS_INIT\fP variable is defined.
693
+ .SS MACOSX_DEPLOYMENT_TARGET
694
+ .sp
695
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
696
+ the calling process environment.
697
+ .sp
698
+ Specify the minimum version of macOS on which the target binaries are
699
+ to be deployed.
700
+ .sp
701
+ The \fBMACOSX_DEPLOYMENT_TARGET\fP environment variable sets the default value for
702
+ the \X'tty: link #variable:CMAKE_OSX_DEPLOYMENT_TARGET'\fI\%CMAKE_OSX_DEPLOYMENT_TARGET\fP\X'tty: link' variable.
703
+ .SS <PackageName>_ROOT
704
+ .sp
705
+ Added in version 3.12.
706
+
707
+ .sp
708
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
709
+ the calling process environment.
710
+ .sp
711
+ Calls to \X'tty: link #command:find_package'\fI\%find_package(<PackageName>)\fP\X'tty: link' will search in prefixes
712
+ specified by the \fB<PackageName>_ROOT\fP environment variable, where
713
+ \fB<PackageName>\fP is the (case\-preserved) name given to the
714
+ \X'tty: link #command:find_package'\fI\%find_package()\fP\X'tty: link' call and \fB_ROOT\fP is literal.
715
+ For example, \fBfind_package(Foo)\fP will search prefixes specified in the
716
+ \fBFoo_ROOT\fP environment variable (if set). See policy \X'tty: link #policy:CMP0074'\fI\%CMP0074\fP\X'tty: link'\&.
717
+ .sp
718
+ This variable may hold a single prefix or a list of prefixes separated
719
+ by \fB:\fP on UNIX or \fB;\fP on Windows (the same as the \fBPATH\fP environment
720
+ variable convention on those platforms).
721
+ .sp
722
+ See also the \X'tty: link #variable:<PackageName>_ROOT'\fI\%<PackageName>_ROOT\fP\X'tty: link' CMake variable.
723
+ .INDENT 0.0
724
+ .TP
725
+ .B <PACKAGENAME>_ROOT
726
+ Added in version 3.27.
727
+
728
+ .sp
729
+ Calls to \X'tty: link #command:find_package'\fI\%find_package(<PackageName>)\fP\X'tty: link' will also search in
730
+ prefixes specified by the upper\-case \fB<PACKAGENAME>_ROOT\fP environment
731
+ variable. See policy \X'tty: link #policy:CMP0144'\fI\%CMP0144\fP\X'tty: link'\&.
732
+ .UNINDENT
733
+ .sp
734
+ \fBNOTE:\fP
735
+ .INDENT 0.0
736
+ .INDENT 3.5
737
+ Note that the \fB<PackageName>_ROOT\fP and \fB<PACKAGENAME>_ROOT\fP
738
+ environment variables are distinct only on platforms that have
739
+ case\-sensitive environments.
740
+ .UNINDENT
741
+ .UNINDENT
742
+ .SS VERBOSE
743
+ .sp
744
+ Added in version 3.14.
745
+
746
+ .sp
747
+ Activates verbose output from CMake and your build tools of choice when
748
+ you start to actually build your project.
749
+ .sp
750
+ Note that any given value is ignored. It\(aqs just checked for existence.
751
+ .sp
752
+ See also \X'tty: link #build-tool-mode'\fI\%Build Tool Mode\fP\X'tty: link' and
753
+ \X'tty: link #envvar:CMAKE_NO_VERBOSE'\fI\%CMAKE_NO_VERBOSE\fP\X'tty: link' environment variable
754
+ .SH ENVIRONMENT VARIABLES FOR LANGUAGES
755
+ .SS ASM<DIALECT>
756
+ .sp
757
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
758
+ the calling process environment.
759
+ .sp
760
+ Preferred executable for compiling a specific dialect of assembly language
761
+ files. \fBASM<DIALECT>\fP can be one of:
762
+ .INDENT 0.0
763
+ .IP \(bu 2
764
+ \fBASM\fP
765
+ .IP \(bu 2
766
+ \fBASM_NASM\fP (Netwide Assembler)
767
+ .IP \(bu 2
768
+ \fBASM_MASM\fP (Microsoft Assembler)
769
+ .IP \(bu 2
770
+ \fBASM_MARMASM\fP (Microsoft ARM Assembler)
771
+ .IP \(bu 2
772
+ \fBASM\-ATT\fP (Assembler AT&T)
773
+ .UNINDENT
774
+ .sp
775
+ Will only be used by CMake on the first configuration to determine
776
+ \fBASM<DIALECT>\fP compiler, after which the value for \fBASM<DIALECT>\fP is stored
777
+ in the cache as
778
+ \X'tty: link #variable:CMAKE_<LANG>_COMPILER'\fI\%CMAKE_ASM<DIALECT>_COMPILER\fP\X'tty: link'\&. For subsequent
779
+ configuration runs, the environment variable will be ignored in favor of
780
+ \X'tty: link #variable:CMAKE_<LANG>_COMPILER'\fI\%CMAKE_ASM<DIALECT>_COMPILER\fP\X'tty: link'\&.
781
+ .sp
782
+ \fBNOTE:\fP
783
+ .INDENT 0.0
784
+ .INDENT 3.5
785
+ Options that are required to make the compiler work correctly can be included;
786
+ they can not be changed.
787
+ .UNINDENT
788
+ .UNINDENT
789
+ .INDENT 0.0
790
+ .INDENT 3.5
791
+ .sp
792
+ .nf
793
+ .ft C
794
+ $ export ASM=\(dqcustom\-compiler \-\-arg1 \-\-arg2\(dq
795
+ .ft P
796
+ .fi
797
+ .UNINDENT
798
+ .UNINDENT
799
+ .SS ASM<DIALECT>FLAGS
800
+ .sp
801
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
802
+ the calling process environment.
803
+ .sp
804
+ Add default compilation flags to be used when compiling a specific dialect
805
+ of an assembly language. \fBASM<DIALECT>FLAGS\fP can be one of:
806
+ .INDENT 0.0
807
+ .IP \(bu 2
808
+ \fBASMFLAGS\fP
809
+ .IP \(bu 2
810
+ \fBASM_NASMFLAGS\fP
811
+ .IP \(bu 2
812
+ \fBASM_MASMFLAGS\fP
813
+ .IP \(bu 2
814
+ \fBASM_MARMASMFLAGS\fP
815
+ .IP \(bu 2
816
+ \fBASM\-ATTFLAGS\fP
817
+ .UNINDENT
818
+ .sp
819
+ CMake uses this environment variable value, in combination with its own
820
+ builtin default flags for the toolchain, to initialize and store the
821
+ \X'tty: link #variable:CMAKE_<LANG>_FLAGS'\fI\%CMAKE_ASM<DIALECT>_FLAGS\fP\X'tty: link' cache entry.
822
+ This occurs the first time a build tree is configured for language \fBASM<DIALECT>\fP\&.
823
+ For any configuration run (including the first), the environment variable
824
+ will be ignored if the \X'tty: link #variable:CMAKE_<LANG>_FLAGS'\fI\%CMAKE_ASM<DIALECT>_FLAGS\fP\X'tty: link' variable is already defined.
825
+ .sp
826
+ See also \X'tty: link #variable:CMAKE_<LANG>_FLAGS_INIT'\fI\%CMAKE_ASM<DIALECT>_FLAGS_INIT\fP\X'tty: link'\&.
827
+ .SS CC
828
+ .sp
829
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
830
+ the calling process environment.
831
+ .sp
832
+ Preferred executable for compiling \fBC\fP language files. Will only be used by
833
+ CMake on the first configuration to determine \fBC\fP compiler, after which the
834
+ value for \fBCC\fP is stored in the cache as
835
+ \X'tty: link #variable:CMAKE_<LANG>_COMPILER'\fI\%CMAKE_C_COMPILER\fP\X'tty: link'\&. For any configuration run
836
+ (including the first), the environment variable will be ignored if the
837
+ \X'tty: link #variable:CMAKE_<LANG>_COMPILER'\fI\%CMAKE_C_COMPILER\fP\X'tty: link' variable is defined.
838
+ .sp
839
+ \fBNOTE:\fP
840
+ .INDENT 0.0
841
+ .INDENT 3.5
842
+ Options that are required to make the compiler work correctly can be included;
843
+ they can not be changed.
844
+ .UNINDENT
845
+ .UNINDENT
846
+ .INDENT 0.0
847
+ .INDENT 3.5
848
+ .sp
849
+ .nf
850
+ .ft C
851
+ $ export CC=\(dqcustom\-compiler \-\-arg1 \-\-arg2\(dq
852
+ .ft P
853
+ .fi
854
+ .UNINDENT
855
+ .UNINDENT
856
+ .SS CFLAGS
857
+ .sp
858
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
859
+ the calling process environment.
860
+ .sp
861
+ Add default compilation flags to be used when compiling \fBC\fP files.
862
+ .sp
863
+ CMake uses this environment variable value, in combination with its own
864
+ builtin default flags for the toolchain, to initialize and store the
865
+ \X'tty: link #variable:CMAKE_<LANG>_FLAGS'\fI\%CMAKE_C_FLAGS\fP\X'tty: link' cache entry.
866
+ This occurs the first time a build tree is configured for language \fBC\fP\&.
867
+ For any configuration run (including the first), the environment variable
868
+ will be ignored if the \X'tty: link #variable:CMAKE_<LANG>_FLAGS'\fI\%CMAKE_C_FLAGS\fP\X'tty: link' variable is already defined.
869
+ .sp
870
+ See also \X'tty: link #variable:CMAKE_<LANG>_FLAGS_INIT'\fI\%CMAKE_C_FLAGS_INIT\fP\X'tty: link'\&.
871
+ .SS CSFLAGS
872
+ .sp
873
+ Added in version 3.9.2.
874
+
875
+ .sp
876
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
877
+ the calling process environment.
878
+ .sp
879
+ Add default compilation flags to be used when compiling \fBCSharp\fP files.
880
+ .sp
881
+ CMake uses this environment variable value, in combination with its own
882
+ builtin default flags for the toolchain, to initialize and store the
883
+ \X'tty: link #variable:CMAKE_<LANG>_FLAGS'\fI\%CMAKE_CSharp_FLAGS\fP\X'tty: link' cache entry.
884
+ This occurs the first time a build tree is configured for language \fBCSharp\fP\&.
885
+ For any configuration run (including the first), the environment variable
886
+ will be ignored if the \X'tty: link #variable:CMAKE_<LANG>_FLAGS'\fI\%CMAKE_CSharp_FLAGS\fP\X'tty: link' variable is already defined.
887
+ .sp
888
+ See also \X'tty: link #variable:CMAKE_<LANG>_FLAGS_INIT'\fI\%CMAKE_CSharp_FLAGS_INIT\fP\X'tty: link'\&.
889
+ .SS CUDAARCHS
890
+ .sp
891
+ Added in version 3.20.
892
+
893
+ .sp
894
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
895
+ the calling process environment.
896
+ .sp
897
+ Value used to initialize \X'tty: link #variable:CMAKE_CUDA_ARCHITECTURES'\fI\%CMAKE_CUDA_ARCHITECTURES\fP\X'tty: link' on the first
898
+ configuration. Subsequent runs will use the value stored in the cache.
899
+ .sp
900
+ This is a semicolon\-separated list of architectures as described in
901
+ \X'tty: link #prop_tgt:CUDA_ARCHITECTURES'\fI\%CUDA_ARCHITECTURES\fP\X'tty: link'\&.
902
+ .SS CUDACXX
903
+ .sp
904
+ Added in version 3.8.
905
+
906
+ .sp
907
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
908
+ the calling process environment.
909
+ .sp
910
+ Preferred executable for compiling \fBCUDA\fP language files. Will only be used by
911
+ CMake on the first configuration to determine \fBCUDA\fP compiler, after which the
912
+ value for \fBCUDA\fP is stored in the cache as
913
+ \X'tty: link #variable:CMAKE_<LANG>_COMPILER'\fI\%CMAKE_CUDA_COMPILER\fP\X'tty: link'\&. For any configuration
914
+ run (including the first), the environment variable will be ignored if the
915
+ \X'tty: link #variable:CMAKE_<LANG>_COMPILER'\fI\%CMAKE_CUDA_COMPILER\fP\X'tty: link' variable is defined.
916
+ .sp
917
+ \fBNOTE:\fP
918
+ .INDENT 0.0
919
+ .INDENT 3.5
920
+ Options that are required to make the compiler work correctly can be included;
921
+ they can not be changed.
922
+ .UNINDENT
923
+ .UNINDENT
924
+ .INDENT 0.0
925
+ .INDENT 3.5
926
+ .sp
927
+ .nf
928
+ .ft C
929
+ $ export CUDACXX=\(dqcustom\-compiler \-\-arg1 \-\-arg2\(dq
930
+ .ft P
931
+ .fi
932
+ .UNINDENT
933
+ .UNINDENT
934
+ .SS CUDAFLAGS
935
+ .sp
936
+ Added in version 3.8.
937
+
938
+ .sp
939
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
940
+ the calling process environment.
941
+ .sp
942
+ Add default compilation flags to be used when compiling \fBCUDA\fP files.
943
+ .sp
944
+ CMake uses this environment variable value, in combination with its own
945
+ builtin default flags for the toolchain, to initialize and store the
946
+ \X'tty: link #variable:CMAKE_<LANG>_FLAGS'\fI\%CMAKE_CUDA_FLAGS\fP\X'tty: link' cache entry.
947
+ This occurs the first time a build tree is configured for language \fBCUDA\fP\&.
948
+ For any configuration run (including the first), the environment variable
949
+ will be ignored if the \X'tty: link #variable:CMAKE_<LANG>_FLAGS'\fI\%CMAKE_CUDA_FLAGS\fP\X'tty: link' variable is already defined.
950
+ .sp
951
+ See also \X'tty: link #variable:CMAKE_<LANG>_FLAGS_INIT'\fI\%CMAKE_CUDA_FLAGS_INIT\fP\X'tty: link'\&.
952
+ .SS CUDAHOSTCXX
953
+ .sp
954
+ Added in version 3.8.
955
+
956
+ .sp
957
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
958
+ the calling process environment.
959
+ .sp
960
+ Preferred executable for compiling host code when compiling \fBCUDA\fP
961
+ language files. Will only be used by CMake on the first configuration to
962
+ determine \fBCUDA\fP host compiler, after which the value for \fBCUDAHOSTCXX\fP is
963
+ stored in the cache as
964
+ \X'tty: link #variable:CMAKE_<LANG>_HOST_COMPILER'\fI\%CMAKE_CUDA_HOST_COMPILER\fP\X'tty: link'\&.
965
+ This environment variable is preferred over
966
+ \X'tty: link #variable:CMAKE_<LANG>_HOST_COMPILER'\fI\%CMAKE_CUDA_HOST_COMPILER\fP\X'tty: link'\&.
967
+ .sp
968
+ This environment variable is primarily meant for use with projects that
969
+ enable \fBCUDA\fP as a first\-class language.
970
+ .sp
971
+ \fBNOTE:\fP
972
+ .INDENT 0.0
973
+ .INDENT 3.5
974
+ Ignored when using \X'tty: link #visual-studio-generators'\fI\%Visual Studio Generators\fP\X'tty: link'\&.
975
+ .UNINDENT
976
+ .UNINDENT
977
+ .sp
978
+ Added in version 3.13: The \X'tty: link #module:FindCUDA'\fI\%FindCUDA\fP\X'tty: link'
979
+ module will use this variable to initialize its \fBCUDA_HOST_COMPILER\fP setting.
980
+
981
+ .SS CXX
982
+ .sp
983
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
984
+ the calling process environment.
985
+ .sp
986
+ Preferred executable for compiling \fBCXX\fP language files. Will only be used by
987
+ CMake on the first configuration to determine \fBCXX\fP compiler, after which the
988
+ value for \fBCXX\fP is stored in the cache as
989
+ \X'tty: link #variable:CMAKE_<LANG>_COMPILER'\fI\%CMAKE_CXX_COMPILER\fP\X'tty: link'\&. For any configuration
990
+ run (including the first), the environment variable will be ignored if the
991
+ \X'tty: link #variable:CMAKE_<LANG>_COMPILER'\fI\%CMAKE_CXX_COMPILER\fP\X'tty: link' variable is defined.
992
+ .sp
993
+ \fBNOTE:\fP
994
+ .INDENT 0.0
995
+ .INDENT 3.5
996
+ Options that are required to make the compiler work correctly can be included;
997
+ they can not be changed.
998
+ .UNINDENT
999
+ .UNINDENT
1000
+ .INDENT 0.0
1001
+ .INDENT 3.5
1002
+ .sp
1003
+ .nf
1004
+ .ft C
1005
+ $ export CXX=\(dqcustom\-compiler \-\-arg1 \-\-arg2\(dq
1006
+ .ft P
1007
+ .fi
1008
+ .UNINDENT
1009
+ .UNINDENT
1010
+ .SS CXXFLAGS
1011
+ .sp
1012
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
1013
+ the calling process environment.
1014
+ .sp
1015
+ Add default compilation flags to be used when compiling \fBCXX\fP (C++) files.
1016
+ .sp
1017
+ CMake uses this environment variable value, in combination with its own
1018
+ builtin default flags for the toolchain, to initialize and store the
1019
+ \X'tty: link #variable:CMAKE_<LANG>_FLAGS'\fI\%CMAKE_CXX_FLAGS\fP\X'tty: link' cache entry.
1020
+ This occurs the first time a build tree is configured for language \fBCXX\fP\&.
1021
+ For any configuration run (including the first), the environment variable
1022
+ will be ignored if the \X'tty: link #variable:CMAKE_<LANG>_FLAGS'\fI\%CMAKE_CXX_FLAGS\fP\X'tty: link' variable is already defined.
1023
+ .sp
1024
+ See also \X'tty: link #variable:CMAKE_<LANG>_FLAGS_INIT'\fI\%CMAKE_CXX_FLAGS_INIT\fP\X'tty: link'\&.
1025
+ .SS FC
1026
+ .sp
1027
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
1028
+ the calling process environment.
1029
+ .sp
1030
+ Preferred executable for compiling \fBFortran\fP language files. Will only be used
1031
+ by CMake on the first configuration to determine \fBFortran\fP compiler, after
1032
+ which the value for \fBFortran\fP is stored in the cache as
1033
+ \X'tty: link #variable:CMAKE_<LANG>_COMPILER'\fI\%CMAKE_Fortran_COMPILER\fP\X'tty: link'\&. For any
1034
+ configuration run (including the first), the environment variable will be
1035
+ ignored if the \X'tty: link #variable:CMAKE_<LANG>_COMPILER'\fI\%CMAKE_Fortran_COMPILER\fP\X'tty: link'
1036
+ variable is defined.
1037
+ .sp
1038
+ \fBNOTE:\fP
1039
+ .INDENT 0.0
1040
+ .INDENT 3.5
1041
+ Options that are required to make the compiler work correctly can be included;
1042
+ they can not be changed.
1043
+ .UNINDENT
1044
+ .UNINDENT
1045
+ .INDENT 0.0
1046
+ .INDENT 3.5
1047
+ .sp
1048
+ .nf
1049
+ .ft C
1050
+ $ export FC=\(dqcustom\-compiler \-\-arg1 \-\-arg2\(dq
1051
+ .ft P
1052
+ .fi
1053
+ .UNINDENT
1054
+ .UNINDENT
1055
+ .SS FFLAGS
1056
+ .sp
1057
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
1058
+ the calling process environment.
1059
+ .sp
1060
+ Add default compilation flags to be used when compiling \fBFortran\fP files.
1061
+ .sp
1062
+ CMake uses this environment variable value, in combination with its own
1063
+ builtin default flags for the toolchain, to initialize and store the
1064
+ \X'tty: link #variable:CMAKE_<LANG>_FLAGS'\fI\%CMAKE_Fortran_FLAGS\fP\X'tty: link' cache entry.
1065
+ This occurs the first time a build tree is configured for language \fBFortran\fP\&.
1066
+ For any configuration run (including the first), the environment variable
1067
+ will be ignored if the \X'tty: link #variable:CMAKE_<LANG>_FLAGS'\fI\%CMAKE_Fortran_FLAGS\fP\X'tty: link' variable is already defined.
1068
+ .sp
1069
+ See also \X'tty: link #variable:CMAKE_<LANG>_FLAGS_INIT'\fI\%CMAKE_Fortran_FLAGS_INIT\fP\X'tty: link'\&.
1070
+ .SS HIPCXX
1071
+ .sp
1072
+ Added in version 3.21.
1073
+
1074
+ .sp
1075
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
1076
+ the calling process environment.
1077
+ .sp
1078
+ Preferred executable for compiling \fBHIP\fP language files. Will only be used by
1079
+ CMake on the first configuration to determine \fBHIP\fP compiler, after which the
1080
+ value for \fBHIP\fP is stored in the cache as
1081
+ \X'tty: link #variable:CMAKE_<LANG>_COMPILER'\fI\%CMAKE_HIP_COMPILER\fP\X'tty: link'\&. For any configuration
1082
+ run (including the first), the environment variable will be ignored if the
1083
+ \X'tty: link #variable:CMAKE_<LANG>_COMPILER'\fI\%CMAKE_HIP_COMPILER\fP\X'tty: link' variable is defined.
1084
+ .SS HIPFLAGS
1085
+ .sp
1086
+ Added in version 3.21.
1087
+
1088
+ .sp
1089
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
1090
+ the calling process environment.
1091
+ .sp
1092
+ Add default compilation flags to be used when compiling \fBHIP\fP files.
1093
+ .sp
1094
+ CMake uses this environment variable value, in combination with its own
1095
+ builtin default flags for the toolchain, to initialize and store the
1096
+ \X'tty: link #variable:CMAKE_<LANG>_FLAGS'\fI\%CMAKE_HIP_FLAGS\fP\X'tty: link' cache entry.
1097
+ This occurs the first time a build tree is configured for language \fBHIP\fP\&.
1098
+ For any configuration run (including the first), the environment variable
1099
+ will be ignored if the \X'tty: link #variable:CMAKE_<LANG>_FLAGS'\fI\%CMAKE_HIP_FLAGS\fP\X'tty: link' variable is already defined.
1100
+ .sp
1101
+ See also \X'tty: link #variable:CMAKE_<LANG>_FLAGS_INIT'\fI\%CMAKE_HIP_FLAGS_INIT\fP\X'tty: link'\&.
1102
+ .SS HIPHOSTCXX
1103
+ .sp
1104
+ Added in version 3.28.
1105
+
1106
+ .sp
1107
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
1108
+ the calling process environment.
1109
+ .sp
1110
+ Preferred executable for compiling host code when compiling \fBHIP\fP
1111
+ language files with the NVIDIA CUDA Compiler. Will only be used by CMake
1112
+ on the first configuration to determine \fBHIP\fP host compiler, after which
1113
+ the value for \fBHIPHOSTCXX\fP is stored in the cache as
1114
+ \X'tty: link #variable:CMAKE_<LANG>_HOST_COMPILER'\fI\%CMAKE_HIP_HOST_COMPILER\fP\X'tty: link'\&.
1115
+ .sp
1116
+ This environment variable is primarily meant for use with projects that
1117
+ enable \fBHIP\fP as a first\-class language.
1118
+ .sp
1119
+ \fBNOTE:\fP
1120
+ .INDENT 0.0
1121
+ .INDENT 3.5
1122
+ Ignored when using \X'tty: link #visual-studio-generators'\fI\%Visual Studio Generators\fP\X'tty: link'\&.
1123
+ .UNINDENT
1124
+ .UNINDENT
1125
+ .SS ISPC
1126
+ .sp
1127
+ Added in version 3.19.
1128
+
1129
+ .sp
1130
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
1131
+ the calling process environment.
1132
+ .sp
1133
+ Preferred executable for compiling \fBISPC\fP language files. Will only be used by
1134
+ CMake on the first configuration to determine \fBISPC\fP compiler, after which the
1135
+ value for \fBISPC\fP is stored in the cache as
1136
+ \X'tty: link #variable:CMAKE_<LANG>_COMPILER'\fI\%CMAKE_ISPC_COMPILER\fP\X'tty: link'\&. For any configuration
1137
+ run (including the first), the environment variable will be ignored if the
1138
+ \X'tty: link #variable:CMAKE_<LANG>_COMPILER'\fI\%CMAKE_ISPC_COMPILER\fP\X'tty: link' variable is defined.
1139
+ .SS ISPCFLAGS
1140
+ .sp
1141
+ Added in version 3.19.
1142
+
1143
+ .sp
1144
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
1145
+ the calling process environment.
1146
+ .sp
1147
+ Add default compilation flags to be used when compiling \fBISPC\fP files.
1148
+ .sp
1149
+ CMake uses this environment variable value, in combination with its own
1150
+ builtin default flags for the toolchain, to initialize and store the
1151
+ \X'tty: link #variable:CMAKE_<LANG>_FLAGS'\fI\%CMAKE_ISPC_FLAGS\fP\X'tty: link' cache entry.
1152
+ This occurs the first time a build tree is configured for language \fBISPC\fP\&.
1153
+ For any configuration run (including the first), the environment variable
1154
+ will be ignored if the \X'tty: link #variable:CMAKE_<LANG>_FLAGS'\fI\%CMAKE_ISPC_FLAGS\fP\X'tty: link' variable is already defined.
1155
+ .sp
1156
+ See also \X'tty: link #variable:CMAKE_<LANG>_FLAGS_INIT'\fI\%CMAKE_ISPC_FLAGS_INIT\fP\X'tty: link'\&.
1157
+ .SS OBJC
1158
+ .sp
1159
+ Added in version 3.16.7.
1160
+
1161
+ .sp
1162
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
1163
+ the calling process environment.
1164
+ .sp
1165
+ Preferred executable for compiling \fBOBJC\fP language files. Will only be used
1166
+ by CMake on the first configuration to determine \fBOBJC\fP compiler, after
1167
+ which the value for \fBOBJC\fP is stored in the cache as
1168
+ \X'tty: link #variable:CMAKE_<LANG>_COMPILER'\fI\%CMAKE_OBJC_COMPILER\fP\X'tty: link'\&. For any configuration
1169
+ run (including the first), the environment variable will be ignored if the
1170
+ \X'tty: link #variable:CMAKE_<LANG>_COMPILER'\fI\%CMAKE_OBJC_COMPILER\fP\X'tty: link' variable is defined.
1171
+ .sp
1172
+ If \fBOBJC\fP is not defined, the \X'tty: link #envvar:CC'\fI\%CC\fP\X'tty: link' environment variable will
1173
+ be checked instead.
1174
+ .SS OBJCFLAGS
1175
+ .sp
1176
+ Added in version 3.16.
1177
+
1178
+ .sp
1179
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
1180
+ the calling process environment.
1181
+ .sp
1182
+ Add default compilation flags to be used when compiling \fBObjective C\fP files.
1183
+ .sp
1184
+ CMake uses this environment variable value, in combination with its own
1185
+ builtin default flags for the toolchain, to initialize and store the
1186
+ \X'tty: link #variable:CMAKE_<LANG>_FLAGS'\fI\%CMAKE_OBJC_FLAGS\fP\X'tty: link' cache entry.
1187
+ This occurs the first time a build tree is configured for language \fBOBJC\fP\&.
1188
+ For any configuration run (including the first), the environment variable
1189
+ will be ignored if the \X'tty: link #variable:CMAKE_<LANG>_FLAGS'\fI\%CMAKE_OBJC_FLAGS\fP\X'tty: link' variable is already defined.
1190
+ .sp
1191
+ See also \X'tty: link #variable:CMAKE_<LANG>_FLAGS_INIT'\fI\%CMAKE_OBJC_FLAGS_INIT\fP\X'tty: link'\&.
1192
+ .SS OBJCXX
1193
+ .sp
1194
+ Added in version 3.16.7.
1195
+
1196
+ .sp
1197
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
1198
+ the calling process environment.
1199
+ .sp
1200
+ Preferred executable for compiling \fBOBJCXX\fP language files. Will only be used
1201
+ by CMake on the first configuration to determine \fBOBJCXX\fP compiler, after
1202
+ which the value for \fBOBJCXX\fP is stored in the cache as
1203
+ \X'tty: link #variable:CMAKE_<LANG>_COMPILER'\fI\%CMAKE_OBJCXX_COMPILER\fP\X'tty: link'\&. For any configuration
1204
+ run (including the first), the environment variable will be ignored if the
1205
+ \X'tty: link #variable:CMAKE_<LANG>_COMPILER'\fI\%CMAKE_OBJCXX_COMPILER\fP\X'tty: link' variable is defined.
1206
+ .sp
1207
+ If \fBOBJCXX\fP is not defined, the \X'tty: link #envvar:CXX'\fI\%CXX\fP\X'tty: link' environment variable will
1208
+ be checked instead.
1209
+ .SS OBJCXXFLAGS
1210
+ .sp
1211
+ Added in version 3.16.
1212
+
1213
+ .sp
1214
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
1215
+ the calling process environment.
1216
+ .sp
1217
+ Add default compilation flags to be used when compiling \fBObjective C++\fP (.mm) files.
1218
+ .sp
1219
+ CMake uses this environment variable value, in combination with its own
1220
+ builtin default flags for the toolchain, to initialize and store the
1221
+ \X'tty: link #variable:CMAKE_<LANG>_FLAGS'\fI\%CMAKE_OBJCXX_FLAGS\fP\X'tty: link' cache entry.
1222
+ This occurs the first time a build tree is configured for language \fBOBJCXX\fP\&.
1223
+ For any configuration run (including the first), the environment variable
1224
+ will be ignored if the \X'tty: link #variable:CMAKE_<LANG>_FLAGS'\fI\%CMAKE_OBJCXX_FLAGS\fP\X'tty: link' variable is already defined.
1225
+ .sp
1226
+ See also \X'tty: link #variable:CMAKE_<LANG>_FLAGS_INIT'\fI\%CMAKE_OBJCXX_FLAGS_INIT\fP\X'tty: link'\&.
1227
+ .SS RC
1228
+ .sp
1229
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
1230
+ the calling process environment.
1231
+ .sp
1232
+ Preferred executable for compiling \fBresource\fP files. Will only be used by CMake
1233
+ on the first configuration to determine \fBresource\fP compiler, after which the
1234
+ value for \fBRC\fP is stored in the cache as
1235
+ \X'tty: link #variable:CMAKE_<LANG>_COMPILER'\fI\%CMAKE_RC_COMPILER\fP\X'tty: link'\&. For any configuration run
1236
+ (including the first), the environment variable will be ignored if the
1237
+ \X'tty: link #variable:CMAKE_<LANG>_COMPILER'\fI\%CMAKE_RC_COMPILER\fP\X'tty: link' variable is defined.
1238
+ .sp
1239
+ \fBNOTE:\fP
1240
+ .INDENT 0.0
1241
+ .INDENT 3.5
1242
+ Options that are required to make the compiler work correctly can be included;
1243
+ they can not be changed.
1244
+ .UNINDENT
1245
+ .UNINDENT
1246
+ .INDENT 0.0
1247
+ .INDENT 3.5
1248
+ .sp
1249
+ .nf
1250
+ .ft C
1251
+ $ export RC=\(dqcustom\-compiler \-\-arg1 \-\-arg2\(dq
1252
+ .ft P
1253
+ .fi
1254
+ .UNINDENT
1255
+ .UNINDENT
1256
+ .SS RCFLAGS
1257
+ .sp
1258
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
1259
+ the calling process environment.
1260
+ .sp
1261
+ Add default compilation flags to be used when compiling \fBRC\fP (resource) files.
1262
+ .sp
1263
+ CMake uses this environment variable value, in combination with its own
1264
+ builtin default flags for the toolchain, to initialize and store the
1265
+ \X'tty: link #variable:CMAKE_<LANG>_FLAGS'\fI\%CMAKE_RC_FLAGS\fP\X'tty: link' cache entry.
1266
+ This occurs the first time a build tree is configured for language \fBRC\fP\&.
1267
+ For any configuration run (including the first), the environment variable
1268
+ will be ignored if the \X'tty: link #variable:CMAKE_<LANG>_FLAGS'\fI\%CMAKE_RC_FLAGS\fP\X'tty: link' variable is already defined.
1269
+ .sp
1270
+ See also \X'tty: link #variable:CMAKE_<LANG>_FLAGS_INIT'\fI\%CMAKE_RC_FLAGS_INIT\fP\X'tty: link'\&.
1271
+ .SS SWIFTC
1272
+ .sp
1273
+ Added in version 3.15.
1274
+
1275
+ .sp
1276
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
1277
+ the calling process environment.
1278
+ .sp
1279
+ Preferred executable for compiling \fBSwift\fP language files. Will only be used by
1280
+ CMake on the first configuration to determine \fBSwift\fP compiler, after which the
1281
+ value for \fBSWIFTC\fP is stored in the cache as
1282
+ \X'tty: link #variable:CMAKE_<LANG>_COMPILER'\fI\%CMAKE_Swift_COMPILER\fP\X'tty: link'\&. For any configuration run
1283
+ (including the first), the environment variable will be ignored if the
1284
+ \X'tty: link #variable:CMAKE_<LANG>_COMPILER'\fI\%CMAKE_Swift_COMPILER\fP\X'tty: link' variable is defined.
1285
+ .sp
1286
+ \fBNOTE:\fP
1287
+ .INDENT 0.0
1288
+ .INDENT 3.5
1289
+ Options that are required to make the compiler work correctly can be included;
1290
+ they can not be changed.
1291
+ .UNINDENT
1292
+ .UNINDENT
1293
+ .INDENT 0.0
1294
+ .INDENT 3.5
1295
+ .sp
1296
+ .nf
1297
+ .ft C
1298
+ $ export SWIFTC=\(dqcustom\-compiler \-\-arg1 \-\-arg2\(dq
1299
+ .ft P
1300
+ .fi
1301
+ .UNINDENT
1302
+ .UNINDENT
1303
+ .SH ENVIRONMENT VARIABLES FOR CTEST
1304
+ .SS CTEST_INTERACTIVE_DEBUG_MODE
1305
+ .sp
1306
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
1307
+ the calling process environment.
1308
+ .sp
1309
+ Environment variable that will exist and be set to \fB1\fP when a test executed
1310
+ by \X'tty: link #manual:ctest(1)'\fI\%ctest(1)\fP\X'tty: link' is run in interactive mode.
1311
+ .SS CTEST_NO_TESTS_ACTION
1312
+ .sp
1313
+ Added in version 3.26.
1314
+
1315
+ .sp
1316
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
1317
+ the calling process environment.
1318
+ .sp
1319
+ Environment variable that controls how \X'tty: link #manual:ctest(1)'\fI\%ctest\fP\X'tty: link' handles
1320
+ cases when there are no tests to run. Possible values are: \fBerror\fP,
1321
+ \fBignore\fP, empty or unset.
1322
+ .sp
1323
+ The \X'tty: link #cmdoption-ctest-no-tests'\fI\%\-\-no\-tests=<action>\fP\X'tty: link' option to
1324
+ \X'tty: link #manual:ctest(1)'\fI\%ctest\fP\X'tty: link' overrides this environment variable if both
1325
+ are given.
1326
+ .SS CTEST_OUTPUT_ON_FAILURE
1327
+ .sp
1328
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
1329
+ the calling process environment.
1330
+ .sp
1331
+ Boolean environment variable that controls if the output should be logged for
1332
+ failed tests. Set the value to \fB1\fP, \fBTrue\fP, or \fBON\fP to enable output on failure.
1333
+ See \X'tty: link #manual:ctest(1)'\fI\%ctest(1)\fP\X'tty: link' for more information on controlling output of failed
1334
+ tests.
1335
+ .SS CTEST_PARALLEL_LEVEL
1336
+ .sp
1337
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
1338
+ the calling process environment.
1339
+ .sp
1340
+ Specify the number of tests for CTest to run in parallel.
1341
+ For example, if \fBCTEST_PARALLEL_LEVEL\fP is set to 8, CTest will run
1342
+ up to 8 tests concurrently as if \fBctest\fP were invoked with the
1343
+ \X'tty: link #cmdoption-ctest-j'\fI\%\-\-parallel 8\fP\X'tty: link' option.
1344
+ .sp
1345
+ Changed in version 3.29: The value may be empty, or \fB0\fP, to let ctest use a default level of
1346
+ parallelism, or unbounded parallelism, respectively, as documented by
1347
+ the \X'tty: link #cmdoption-ctest-j'\fI\%ctest \-\-parallel\fP\X'tty: link' option.
1348
+ .sp
1349
+ On Windows, environment variables cannot be set to an empty string.
1350
+ CTest will interpret a whitespace\-only string as empty.
1351
+ .sp
1352
+ In CMake 3.28 and earlier, an empty or \fB0\fP value was equivalent to \fB1\fP\&.
1353
+
1354
+ .sp
1355
+ See \X'tty: link #manual:ctest(1)'\fI\%ctest(1)\fP\X'tty: link' for more information on parallel test execution.
1356
+ .SS CTEST_PROGRESS_OUTPUT
1357
+ .sp
1358
+ Added in version 3.13.
1359
+
1360
+ .sp
1361
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
1362
+ the calling process environment.
1363
+ .sp
1364
+ Boolean environment variable that affects how \X'tty: link #manual:ctest(1)'\fI\%ctest\fP\X'tty: link'
1365
+ command output reports overall progress. When set to \fB1\fP, \fBTRUE\fP, \fBON\fP or anything
1366
+ else that evaluates to boolean true, progress is reported by repeatedly
1367
+ updating the same line. This greatly reduces the overall verbosity, but is
1368
+ only supported when output is sent directly to a terminal. If the environment
1369
+ variable is not set or has a value that evaluates to false, output is reported
1370
+ normally with each test having its own start and end lines logged to the
1371
+ output.
1372
+ .sp
1373
+ The \X'tty: link #cmdoption-ctest-progress'\fI\%\-\-progress\fP\X'tty: link' option to \X'tty: link #manual:ctest(1)'\fI\%ctest\fP\X'tty: link'
1374
+ overrides this environment variable if both are given.
1375
+ .SS CTEST_USE_LAUNCHERS_DEFAULT
1376
+ .sp
1377
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
1378
+ the calling process environment.
1379
+ .sp
1380
+ Initializes the \X'tty: link #variable:CTEST_USE_LAUNCHERS'\fI\%CTEST_USE_LAUNCHERS\fP\X'tty: link' variable if not already defined.
1381
+ .SS DASHBOARD_TEST_FROM_CTEST
1382
+ .sp
1383
+ This is a CMake \X'tty: link #cmake-language-environment-variables'\fI\%Environment Variable\fP\X'tty: link'\&. Its initial value is taken from
1384
+ the calling process environment.
1385
+ .sp
1386
+ Environment variable that will exist when a test executed by \X'tty: link #manual:ctest(1)'\fI\%ctest(1)\fP\X'tty: link'
1387
+ is run in non\-interactive mode. The value will be equal to
1388
+ \X'tty: link #variable:CMAKE_VERSION'\fI\%CMAKE_VERSION\fP\X'tty: link'\&.
1389
+ .SH ENVIRONMENT VARIABLES FOR THE CMAKE CURSES INTERFACE
1390
+ .SS CCMAKE_COLORS
1391
+ .sp
1392
+ Added in version 3.18.
1393
+
1394
+ .sp
1395
+ Determines what colors are used by the CMake curses interface,
1396
+ when run on a terminal that supports colors.
1397
+ The syntax follows the same conventions as \fBLS_COLORS\fP;
1398
+ that is, a list of key/value pairs separated by \fB:\fP\&.
1399
+ .sp
1400
+ Keys are a single letter corresponding to a CMake cache variable type:
1401
+ .INDENT 0.0
1402
+ .IP \(bu 2
1403
+ \fBs\fP: A \fBSTRING\fP\&.
1404
+ .IP \(bu 2
1405
+ \fBp\fP: A \fBFILEPATH\fP\&.
1406
+ .IP \(bu 2
1407
+ \fBc\fP: A value which has an associated list of choices.
1408
+ .IP \(bu 2
1409
+ \fBy\fP: A \fBBOOL\fP which has a true\-like value (e.g. \fBON\fP, \fBYES\fP).
1410
+ .IP \(bu 2
1411
+ \fBn\fP: A \fBBOOL\fP which has a false\-like value (e.g. \fBOFF\fP, \fBNO\fP).
1412
+ .UNINDENT
1413
+ .sp
1414
+ Values are an integer number that specifies what color to use.
1415
+ \fB0\fP is black (you probably don\(aqt want to use that).
1416
+ Others are determined by your terminal\(aqs color support.
1417
+ Most (color) terminals will support at least 8 or 16 colors.
1418
+ Some will support up to 256 colors. The colors will likely match
1419
+ \X'tty: link https://upload.wikimedia.org/wikipedia/commons/1/15/Xterm_256color_chart.svg'\fI\%this chart\fP\X'tty: link',
1420
+ although the first 16 colors may match the original
1421
+ \X'tty: link https://en.wikipedia.org/wiki/Color_Graphics_Adapter#Color_palette'\fI\%CGA color palette\fP\X'tty: link'\&.
1422
+ (Many modern terminal emulators also allow their color palette,
1423
+ at least for the first 16 colors, to be configured by the user.)
1424
+ .sp
1425
+ Note that fairly minimal checking is done for bad colors
1426
+ (although a value higher than what curses believes your terminal supports
1427
+ will be silently ignored) or bad syntax.
1428
+ .sp
1429
+ For example:
1430
+ .INDENT 0.0
1431
+ .INDENT 3.5
1432
+ .sp
1433
+ .nf
1434
+ .ft C
1435
+ CCMAKE_COLORS=\(aqs=39:p=220:c=207:n=196:y=46\(aq
1436
+ .ft P
1437
+ .fi
1438
+ .UNINDENT
1439
+ .UNINDENT
1440
+ .SH COPYRIGHT
1441
+ 2000-2024 Kitware, Inc. and Contributors
1442
+ .\" Generated by docutils manpage writer.
1443
+ .
cmake/man/man7/cmake-file-api.7 ADDED
@@ -0,0 +1,1984 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .\" Man page generated from reStructuredText.
2
+ .
3
+ .
4
+ .nr rst2man-indent-level 0
5
+ .
6
+ .de1 rstReportMargin
7
+ \\$1 \\n[an-margin]
8
+ level \\n[rst2man-indent-level]
9
+ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
10
+ -
11
+ \\n[rst2man-indent0]
12
+ \\n[rst2man-indent1]
13
+ \\n[rst2man-indent2]
14
+ ..
15
+ .de1 INDENT
16
+ .\" .rstReportMargin pre:
17
+ . RS \\$1
18
+ . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
19
+ . nr rst2man-indent-level +1
20
+ .\" .rstReportMargin post:
21
+ ..
22
+ .de UNINDENT
23
+ . RE
24
+ .\" indent \\n[an-margin]
25
+ .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
26
+ .nr rst2man-indent-level -1
27
+ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
28
+ .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
29
+ ..
30
+ .TH "CMAKE-FILE-API" "7" "Jan 10, 2025" "3.31.4" "CMake"
31
+ .SH NAME
32
+ cmake-file-api \- CMake File-Based API
33
+ .SH INTRODUCTION
34
+ .sp
35
+ CMake provides a file\-based API that clients may use to get semantic
36
+ information about the buildsystems CMake generates. Clients may use
37
+ the API by writing query files to a specific location in a build tree
38
+ to request zero or more \fI\%Object Kinds\fP\&. When CMake generates the
39
+ buildsystem in that build tree it will read the query files and write
40
+ reply files for the client to read.
41
+ .sp
42
+ The file\-based API uses a \fB<build>/.cmake/api/\fP directory at the top
43
+ of a build tree. The API is versioned to support changes to the layout
44
+ of files within the API directory. API file layout versioning is
45
+ orthogonal to the versioning of \fI\%Object Kinds\fP used in replies.
46
+ This version of CMake supports only one API version, \fI\%API v1\fP\&.
47
+ .sp
48
+ Added in version 3.27: Projects may also submit queries for the current run using the
49
+ \X'tty: link #command:cmake_file_api'\fI\%cmake_file_api()\fP\X'tty: link' command.
50
+
51
+ .SH API V1
52
+ .sp
53
+ API v1 is housed in the \fB<build>/.cmake/api/v1/\fP directory.
54
+ It has the following subdirectories:
55
+ .INDENT 0.0
56
+ .TP
57
+ .B \fBquery/\fP
58
+ Holds query files written by clients.
59
+ These may be \fI\%v1 Shared Stateless Query Files\fP,
60
+ \fI\%v1 Client Stateless Query Files\fP, or \fI\%v1 Client Stateful Query Files\fP\&.
61
+ .TP
62
+ .B \fBreply/\fP
63
+ Holds reply files written by CMake whenever it runs to generate a build
64
+ system. These are indexed by a \fI\%v1 Reply Index File\fP file that may
65
+ reference additional \fI\%v1 Reply Files\fP\&. CMake owns all reply files.
66
+ Clients must never remove them.
67
+ .sp
68
+ Clients may look for and read a reply index file at any time.
69
+ Clients may optionally create the \fBreply/\fP directory at any time
70
+ and monitor it for the appearance of a new reply index file.
71
+ .UNINDENT
72
+ .sp
73
+ Added in version 3.31: Users can add query files to \fBapi/v1/query\fP inside the
74
+ \X'tty: link #envvar:CMAKE_CONFIG_DIR'\fI\%CMAKE_CONFIG_DIR\fP\X'tty: link' to create user\-wide queries for all CMake projects.
75
+
76
+ .SS v1 Shared Stateless Query Files
77
+ .sp
78
+ Shared stateless query files allow clients to share requests for
79
+ major versions of the \fI\%Object Kinds\fP and get all requested versions
80
+ recognized by the CMake that runs.
81
+ .sp
82
+ Clients may create shared requests by creating empty files in the
83
+ \fBv1/query/\fP directory. The form is:
84
+ .INDENT 0.0
85
+ .INDENT 3.5
86
+ .sp
87
+ .nf
88
+ .ft C
89
+ <build>/.cmake/api/v1/query/<kind>\-v<major>
90
+ .ft P
91
+ .fi
92
+ .UNINDENT
93
+ .UNINDENT
94
+ .sp
95
+ where \fB<kind>\fP is one of the \fI\%Object Kinds\fP, \fB\-v\fP is literal,
96
+ and \fB<major>\fP is the major version number.
97
+ .sp
98
+ Files of this form are stateless shared queries not owned by any specific
99
+ client. Once created they should not be removed without external client
100
+ coordination or human intervention.
101
+ .SS v1 Client Stateless Query Files
102
+ .sp
103
+ Client stateless query files allow clients to create owned requests for
104
+ major versions of the \fI\%Object Kinds\fP and get all requested versions
105
+ recognized by the CMake that runs.
106
+ .sp
107
+ Clients may create owned requests by creating empty files in
108
+ client\-specific query subdirectories. The form is:
109
+ .INDENT 0.0
110
+ .INDENT 3.5
111
+ .sp
112
+ .nf
113
+ .ft C
114
+ <build>/.cmake/api/v1/query/client\-<client>/<kind>\-v<major>
115
+ .ft P
116
+ .fi
117
+ .UNINDENT
118
+ .UNINDENT
119
+ .sp
120
+ where \fBclient\-\fP is literal, \fB<client>\fP is a string uniquely
121
+ identifying the client, \fB<kind>\fP is one of the \fI\%Object Kinds\fP,
122
+ \fB\-v\fP is literal, and \fB<major>\fP is the major version number.
123
+ Each client must choose a unique \fB<client>\fP identifier via its
124
+ own means.
125
+ .sp
126
+ Files of this form are stateless queries owned by the client \fB<client>\fP\&.
127
+ The owning client may remove them at any time.
128
+ .SS v1 Client Stateful Query Files
129
+ .sp
130
+ Stateful query files allow clients to request a list of versions of
131
+ each of the \fI\%Object Kinds\fP and get only the most recent version
132
+ recognized by the CMake that runs.
133
+ .sp
134
+ Clients may create owned stateful queries by creating \fBquery.json\fP
135
+ files in client\-specific query subdirectories. The form is:
136
+ .INDENT 0.0
137
+ .INDENT 3.5
138
+ .sp
139
+ .nf
140
+ .ft C
141
+ <build>/.cmake/api/v1/query/client\-<client>/query.json
142
+ .ft P
143
+ .fi
144
+ .UNINDENT
145
+ .UNINDENT
146
+ .sp
147
+ where \fBclient\-\fP is literal, \fB<client>\fP is a string uniquely
148
+ identifying the client, and \fBquery.json\fP is literal. Each client
149
+ must choose a unique \fB<client>\fP identifier via its own means.
150
+ .sp
151
+ \fBquery.json\fP files are stateful queries owned by the client \fB<client>\fP\&.
152
+ The owning client may update or remove them at any time. When a
153
+ given client installation is updated it may then update the stateful
154
+ query it writes to build trees to request newer object versions.
155
+ This can be used to avoid asking CMake to generate multiple object
156
+ versions unnecessarily.
157
+ .sp
158
+ A \fBquery.json\fP file must contain a JSON object:
159
+ .INDENT 0.0
160
+ .INDENT 3.5
161
+ .sp
162
+ .nf
163
+ .ft C
164
+ {
165
+ \(dqrequests\(dq: [
166
+ { \(dqkind\(dq: \(dq<kind>\(dq , \(dqversion\(dq: 1 },
167
+ { \(dqkind\(dq: \(dq<kind>\(dq , \(dqversion\(dq: { \(dqmajor\(dq: 1, \(dqminor\(dq: 2 } },
168
+ { \(dqkind\(dq: \(dq<kind>\(dq , \(dqversion\(dq: [2, 1] },
169
+ { \(dqkind\(dq: \(dq<kind>\(dq , \(dqversion\(dq: [2, { \(dqmajor\(dq: 1, \(dqminor\(dq: 2 }] },
170
+ { \(dqkind\(dq: \(dq<kind>\(dq , \(dqversion\(dq: 1, \(dqclient\(dq: {} },
171
+ { \(dqkind\(dq: \(dq...\(dq }
172
+ ],
173
+ \(dqclient\(dq: {}
174
+ }
175
+ .ft P
176
+ .fi
177
+ .UNINDENT
178
+ .UNINDENT
179
+ .sp
180
+ The members are:
181
+ .INDENT 0.0
182
+ .TP
183
+ .B \fBrequests\fP
184
+ A JSON array containing zero or more requests. Each request is
185
+ a JSON object with members:
186
+ .INDENT 7.0
187
+ .TP
188
+ .B \fBkind\fP
189
+ Specifies one of the \fI\%Object Kinds\fP to be included in the reply.
190
+ .TP
191
+ .B \fBversion\fP
192
+ Indicates the version(s) of the object kind that the client
193
+ understands. Versions have major and minor components following
194
+ semantic version conventions. The value must be
195
+ .INDENT 7.0
196
+ .IP \(bu 2
197
+ a JSON integer specifying a (non\-negative) major version number, or
198
+ .IP \(bu 2
199
+ a JSON object containing \fBmajor\fP and (optionally) \fBminor\fP
200
+ members specifying non\-negative integer version components, or
201
+ .IP \(bu 2
202
+ a JSON array whose elements are each one of the above.
203
+ .UNINDENT
204
+ .TP
205
+ .B \fBclient\fP
206
+ Optional member reserved for use by the client. This value is
207
+ preserved in the reply written for the client in the
208
+ \fI\%v1 Reply Index File\fP but is otherwise ignored. Clients may use
209
+ this to pass custom information with a request through to its reply.
210
+ .UNINDENT
211
+ .sp
212
+ For each requested object kind CMake will choose the \fIfirst\fP version
213
+ that it recognizes for that kind among those listed in the request.
214
+ The response will use the selected \fImajor\fP version with the highest
215
+ \fIminor\fP version known to the running CMake for that major version.
216
+ Therefore clients should list all supported major versions in
217
+ preferred order along with the minimal minor version required
218
+ for each major version.
219
+ .TP
220
+ .B \fBclient\fP
221
+ Optional member reserved for use by the client. This value is
222
+ preserved in the reply written for the client in the
223
+ \fI\%v1 Reply Index File\fP but is otherwise ignored. Clients may use
224
+ this to pass custom information with a query through to its reply.
225
+ .UNINDENT
226
+ .sp
227
+ Other \fBquery.json\fP top\-level members are reserved for future use.
228
+ If present they are ignored for forward compatibility.
229
+ .SS v1 Reply Index File
230
+ .sp
231
+ CMake writes an \fBindex\-*.json\fP file to the \fBv1/reply/\fP directory
232
+ whenever it runs to generate a build system. Clients must read the
233
+ reply index file first and may read other \fI\%v1 Reply Files\fP only by
234
+ following references. The form of the reply index file name is:
235
+ .INDENT 0.0
236
+ .INDENT 3.5
237
+ .sp
238
+ .nf
239
+ .ft C
240
+ <build>/.cmake/api/v1/reply/index\-<unspecified>.json
241
+ .ft P
242
+ .fi
243
+ .UNINDENT
244
+ .UNINDENT
245
+ .sp
246
+ where \fBindex\-\fP is literal and \fB<unspecified>\fP is an unspecified
247
+ name selected by CMake. Whenever a new index file is generated it
248
+ is given a new name and any old one is deleted. During the short
249
+ time between these steps there may be multiple index files present;
250
+ the one with the largest name in lexicographic order is the current
251
+ index file.
252
+ .sp
253
+ The reply index file contains a JSON object:
254
+ .INDENT 0.0
255
+ .INDENT 3.5
256
+ .sp
257
+ .nf
258
+ .ft C
259
+ {
260
+ \(dqcmake\(dq: {
261
+ \(dqversion\(dq: {
262
+ \(dqmajor\(dq: 3, \(dqminor\(dq: 14, \(dqpatch\(dq: 0, \(dqsuffix\(dq: \(dq\(dq,
263
+ \(dqstring\(dq: \(dq3.14.0\(dq, \(dqisDirty\(dq: false
264
+ },
265
+ \(dqpaths\(dq: {
266
+ \(dqcmake\(dq: \(dq/prefix/bin/cmake\(dq,
267
+ \(dqctest\(dq: \(dq/prefix/bin/ctest\(dq,
268
+ \(dqcpack\(dq: \(dq/prefix/bin/cpack\(dq,
269
+ \(dqroot\(dq: \(dq/prefix/share/cmake\-3.14\(dq
270
+ },
271
+ \(dqgenerator\(dq: {
272
+ \(dqmultiConfig\(dq: false,
273
+ \(dqname\(dq: \(dqUnix Makefiles\(dq
274
+ }
275
+ },
276
+ \(dqobjects\(dq: [
277
+ { \(dqkind\(dq: \(dq<kind>\(dq,
278
+ \(dqversion\(dq: { \(dqmajor\(dq: 1, \(dqminor\(dq: 0 },
279
+ \(dqjsonFile\(dq: \(dq<file>\(dq },
280
+ { \(dq...\(dq: \(dq...\(dq }
281
+ ],
282
+ \(dqreply\(dq: {
283
+ \(dq<kind>\-v<major>\(dq: { \(dqkind\(dq: \(dq<kind>\(dq,
284
+ \(dqversion\(dq: { \(dqmajor\(dq: 1, \(dqminor\(dq: 0 },
285
+ \(dqjsonFile\(dq: \(dq<file>\(dq },
286
+ \(dq<unknown>\(dq: { \(dqerror\(dq: \(dqunknown query file\(dq },
287
+ \(dq...\(dq: {},
288
+ \(dqclient\-<client>\(dq: {
289
+ \(dq<kind>\-v<major>\(dq: { \(dqkind\(dq: \(dq<kind>\(dq,
290
+ \(dqversion\(dq: { \(dqmajor\(dq: 1, \(dqminor\(dq: 0 },
291
+ \(dqjsonFile\(dq: \(dq<file>\(dq },
292
+ \(dq<unknown>\(dq: { \(dqerror\(dq: \(dqunknown query file\(dq },
293
+ \(dq...\(dq: {},
294
+ \(dqquery.json\(dq: {
295
+ \(dqrequests\(dq: [ {}, {}, {} ],
296
+ \(dqresponses\(dq: [
297
+ { \(dqkind\(dq: \(dq<kind>\(dq,
298
+ \(dqversion\(dq: { \(dqmajor\(dq: 1, \(dqminor\(dq: 0 },
299
+ \(dqjsonFile\(dq: \(dq<file>\(dq },
300
+ { \(dqerror\(dq: \(dqunknown query file\(dq },
301
+ { \(dq...\(dq: {} }
302
+ ],
303
+ \(dqclient\(dq: {}
304
+ }
305
+ }
306
+ }
307
+ }
308
+ .ft P
309
+ .fi
310
+ .UNINDENT
311
+ .UNINDENT
312
+ .sp
313
+ The members are:
314
+ .INDENT 0.0
315
+ .TP
316
+ .B \fBcmake\fP
317
+ A JSON object containing information about the instance of CMake that
318
+ generated the reply. It contains members:
319
+ .INDENT 7.0
320
+ .TP
321
+ .B \fBversion\fP
322
+ A JSON object specifying the version of CMake with members:
323
+ .INDENT 7.0
324
+ .TP
325
+ .B \fBmajor\fP, \fBminor\fP, \fBpatch\fP
326
+ Integer values specifying the major, minor, and patch version components.
327
+ .TP
328
+ .B \fBsuffix\fP
329
+ A string specifying the version suffix, if any, e.g. \fBg0abc3\fP\&.
330
+ .TP
331
+ .B \fBstring\fP
332
+ A string specifying the full version in the format
333
+ \fB<major>.<minor>.<patch>[\-<suffix>]\fP\&.
334
+ .TP
335
+ .B \fBisDirty\fP
336
+ A boolean indicating whether the version was built from a version
337
+ controlled source tree with local modifications.
338
+ .UNINDENT
339
+ .TP
340
+ .B \fBpaths\fP
341
+ A JSON object specifying paths to things that come with CMake.
342
+ It has members for \fBcmake\fP, \fBctest\fP, and \fBcpack\fP
343
+ whose values are JSON strings specifying the absolute path to each tool,
344
+ represented with forward slashes. It also has a \fBroot\fP member for
345
+ the absolute path to the directory containing CMake resources like the
346
+ \fBModules/\fP directory (see \X'tty: link #variable:CMAKE_ROOT'\fI\%CMAKE_ROOT\fP\X'tty: link').
347
+ .TP
348
+ .B \fBgenerator\fP
349
+ A JSON object describing the CMake generator used for the build.
350
+ It has members:
351
+ .INDENT 7.0
352
+ .TP
353
+ .B \fBmultiConfig\fP
354
+ A boolean specifying whether the generator supports multiple output
355
+ configurations.
356
+ .TP
357
+ .B \fBname\fP
358
+ A string specifying the name of the generator.
359
+ .TP
360
+ .B \fBplatform\fP
361
+ If the generator supports \X'tty: link #variable:CMAKE_GENERATOR_PLATFORM'\fI\%CMAKE_GENERATOR_PLATFORM\fP\X'tty: link',
362
+ this is a string specifying the generator platform name.
363
+ .UNINDENT
364
+ .UNINDENT
365
+ .TP
366
+ .B \fBobjects\fP
367
+ A JSON array listing all versions of all \fI\%Object Kinds\fP generated
368
+ as part of the reply. Each array entry is a
369
+ \fI\%v1 Reply File Reference\fP\&.
370
+ .TP
371
+ .B \fBreply\fP
372
+ A JSON object mirroring the content of the \fBquery/\fP directory
373
+ that CMake loaded to produce the reply. The members are of the form
374
+ .INDENT 7.0
375
+ .TP
376
+ .B \fB<kind>\-v<major>\fP
377
+ A member of this form appears for each of the
378
+ \fI\%v1 Shared Stateless Query Files\fP that CMake recognized as a
379
+ request for object kind \fB<kind>\fP with major version \fB<major>\fP\&.
380
+ The value is a \fI\%v1 Reply File Reference\fP to the corresponding
381
+ reply file for that object kind and version.
382
+ .TP
383
+ .B \fB<unknown>\fP
384
+ A member of this form appears for each of the
385
+ \fI\%v1 Shared Stateless Query Files\fP that CMake did not recognize.
386
+ The value is a JSON object with a single \fBerror\fP member
387
+ containing a string with an error message indicating that the
388
+ query file is unknown.
389
+ .TP
390
+ .B \fBclient\-<client>\fP
391
+ A member of this form appears for each client\-owned directory
392
+ holding \fI\%v1 Client Stateless Query Files\fP\&.
393
+ The value is a JSON object mirroring the content of the
394
+ \fBquery/client\-<client>/\fP directory. The members are of the form:
395
+ .INDENT 7.0
396
+ .TP
397
+ .B \fB<kind>\-v<major>\fP
398
+ A member of this form appears for each of the
399
+ \fI\%v1 Client Stateless Query Files\fP that CMake recognized as a
400
+ request for object kind \fB<kind>\fP with major version \fB<major>\fP\&.
401
+ The value is a \fI\%v1 Reply File Reference\fP to the corresponding
402
+ reply file for that object kind and version.
403
+ .TP
404
+ .B \fB<unknown>\fP
405
+ A member of this form appears for each of the
406
+ \fI\%v1 Client Stateless Query Files\fP that CMake did not recognize.
407
+ The value is a JSON object with a single \fBerror\fP member
408
+ containing a string with an error message indicating that the
409
+ query file is unknown.
410
+ .TP
411
+ .B \fBquery.json\fP
412
+ This member appears for clients using
413
+ \fI\%v1 Client Stateful Query Files\fP\&.
414
+ If the \fBquery.json\fP file failed to read or parse as a JSON object,
415
+ this member is a JSON object with a single \fBerror\fP member
416
+ containing a string with an error message. Otherwise, this member
417
+ is a JSON object mirroring the content of the \fBquery.json\fP file.
418
+ The members are:
419
+ .INDENT 7.0
420
+ .TP
421
+ .B \fBclient\fP
422
+ A copy of the \fBquery.json\fP file \fBclient\fP member, if it exists.
423
+ .TP
424
+ .B \fBrequests\fP
425
+ A copy of the \fBquery.json\fP file \fBrequests\fP member, if it exists.
426
+ .TP
427
+ .B \fBresponses\fP
428
+ If the \fBquery.json\fP file \fBrequests\fP member is missing or invalid,
429
+ this member is a JSON object with a single \fBerror\fP member
430
+ containing a string with an error message. Otherwise, this member
431
+ contains a JSON array with a response for each entry of the
432
+ \fBrequests\fP array, in the same order. Each response is
433
+ .INDENT 7.0
434
+ .IP \(bu 2
435
+ a JSON object with a single \fBerror\fP member containing a string
436
+ with an error message, or
437
+ .IP \(bu 2
438
+ a \fI\%v1 Reply File Reference\fP to the corresponding reply file for
439
+ the requested object kind and selected version.
440
+ .UNINDENT
441
+ .UNINDENT
442
+ .UNINDENT
443
+ .UNINDENT
444
+ .UNINDENT
445
+ .sp
446
+ After reading the reply index file, clients may read the other
447
+ \fI\%v1 Reply Files\fP it references.
448
+ .SS v1 Reply File Reference
449
+ .sp
450
+ The reply index file represents each reference to another reply file
451
+ using a JSON object with members:
452
+ .INDENT 0.0
453
+ .TP
454
+ .B \fBkind\fP
455
+ A string specifying one of the \fI\%Object Kinds\fP\&.
456
+ .TP
457
+ .B \fBversion\fP
458
+ A JSON object with members \fBmajor\fP and \fBminor\fP specifying
459
+ integer version components of the object kind.
460
+ .TP
461
+ .B \fBjsonFile\fP
462
+ A JSON string specifying a path relative to the reply index file
463
+ to another JSON file containing the object.
464
+ .UNINDENT
465
+ .SS v1 Reply Files
466
+ .sp
467
+ Reply files containing specific \fI\%Object Kinds\fP are written by CMake.
468
+ The names of these files are unspecified and must not be interpreted
469
+ by clients. Clients must first read the \fI\%v1 Reply Index File\fP and
470
+ follow references to the names of the desired response objects.
471
+ .sp
472
+ Reply files (including the index file) will never be replaced by
473
+ files of the same name but different content. This allows a client
474
+ to read the files concurrently with a running CMake that may generate
475
+ a new reply. However, after generating a new reply CMake will attempt
476
+ to remove reply files from previous runs that it did not just write.
477
+ If a client attempts to read a reply file referenced by the index but
478
+ finds the file missing, that means a concurrent CMake has generated
479
+ a new reply. The client may simply start again by reading the new
480
+ reply index file.
481
+ .SH OBJECT KINDS
482
+ .sp
483
+ The CMake file\-based API reports semantic information about the build
484
+ system using the following kinds of JSON objects. Each kind of object
485
+ is versioned independently using semantic versioning with major and
486
+ minor components. Every kind of object has the form:
487
+ .INDENT 0.0
488
+ .INDENT 3.5
489
+ .sp
490
+ .nf
491
+ .ft C
492
+ {
493
+ \(dqkind\(dq: \(dq<kind>\(dq,
494
+ \(dqversion\(dq: { \(dqmajor\(dq: 1, \(dqminor\(dq: 0 },
495
+ \(dq...\(dq: {}
496
+ }
497
+ .ft P
498
+ .fi
499
+ .UNINDENT
500
+ .UNINDENT
501
+ .sp
502
+ The \fBkind\fP member is a string specifying the object kind name.
503
+ The \fBversion\fP member is a JSON object with \fBmajor\fP and \fBminor\fP
504
+ members specifying integer components of the object kind\(aqs version.
505
+ Additional top\-level members are specific to each object kind.
506
+ .SS Object Kind \(dqcodemodel\(dq
507
+ .sp
508
+ The \fBcodemodel\fP object kind describes the build system structure as
509
+ modeled by CMake.
510
+ .sp
511
+ There is only one \fBcodemodel\fP object major version, version 2.
512
+ Version 1 does not exist to avoid confusion with that from
513
+ \X'tty: link #manual:cmake-server(7)'\fI\%cmake\-server(7)\fP\X'tty: link' mode.
514
+ .SS \(dqcodemodel\(dq version 2
515
+ .sp
516
+ \fBcodemodel\fP object version 2 is a JSON object:
517
+ .INDENT 0.0
518
+ .INDENT 3.5
519
+ .sp
520
+ .nf
521
+ .ft C
522
+ {
523
+ \(dqkind\(dq: \(dqcodemodel\(dq,
524
+ \(dqversion\(dq: { \(dqmajor\(dq: 2, \(dqminor\(dq: 7 },
525
+ \(dqpaths\(dq: {
526
+ \(dqsource\(dq: \(dq/path/to/top\-level\-source\-dir\(dq,
527
+ \(dqbuild\(dq: \(dq/path/to/top\-level\-build\-dir\(dq
528
+ },
529
+ \(dqconfigurations\(dq: [
530
+ {
531
+ \(dqname\(dq: \(dqDebug\(dq,
532
+ \(dqdirectories\(dq: [
533
+ {
534
+ \(dqsource\(dq: \(dq.\(dq,
535
+ \(dqbuild\(dq: \(dq.\(dq,
536
+ \(dqchildIndexes\(dq: [ 1 ],
537
+ \(dqprojectIndex\(dq: 0,
538
+ \(dqtargetIndexes\(dq: [ 0 ],
539
+ \(dqhasInstallRule\(dq: true,
540
+ \(dqminimumCMakeVersion\(dq: {
541
+ \(dqstring\(dq: \(dq3.14\(dq
542
+ },
543
+ \(dqjsonFile\(dq: \(dq<file>\(dq
544
+ },
545
+ {
546
+ \(dqsource\(dq: \(dqsub\(dq,
547
+ \(dqbuild\(dq: \(dqsub\(dq,
548
+ \(dqparentIndex\(dq: 0,
549
+ \(dqprojectIndex\(dq: 0,
550
+ \(dqtargetIndexes\(dq: [ 1 ],
551
+ \(dqminimumCMakeVersion\(dq: {
552
+ \(dqstring\(dq: \(dq3.14\(dq
553
+ },
554
+ \(dqjsonFile\(dq: \(dq<file>\(dq
555
+ }
556
+ ],
557
+ \(dqprojects\(dq: [
558
+ {
559
+ \(dqname\(dq: \(dqMyProject\(dq,
560
+ \(dqdirectoryIndexes\(dq: [ 0, 1 ],
561
+ \(dqtargetIndexes\(dq: [ 0, 1 ]
562
+ }
563
+ ],
564
+ \(dqtargets\(dq: [
565
+ {
566
+ \(dqname\(dq: \(dqMyExecutable\(dq,
567
+ \(dqdirectoryIndex\(dq: 0,
568
+ \(dqprojectIndex\(dq: 0,
569
+ \(dqjsonFile\(dq: \(dq<file>\(dq
570
+ },
571
+ {
572
+ \(dqname\(dq: \(dqMyLibrary\(dq,
573
+ \(dqdirectoryIndex\(dq: 1,
574
+ \(dqprojectIndex\(dq: 0,
575
+ \(dqjsonFile\(dq: \(dq<file>\(dq
576
+ }
577
+ ]
578
+ }
579
+ ]
580
+ }
581
+ .ft P
582
+ .fi
583
+ .UNINDENT
584
+ .UNINDENT
585
+ .sp
586
+ The members specific to \fBcodemodel\fP objects are:
587
+ .INDENT 0.0
588
+ .TP
589
+ .B \fBpaths\fP
590
+ A JSON object containing members:
591
+ .INDENT 7.0
592
+ .TP
593
+ .B \fBsource\fP
594
+ A string specifying the absolute path to the top\-level source directory,
595
+ represented with forward slashes.
596
+ .TP
597
+ .B \fBbuild\fP
598
+ A string specifying the absolute path to the top\-level build directory,
599
+ represented with forward slashes.
600
+ .UNINDENT
601
+ .TP
602
+ .B \fBconfigurations\fP
603
+ A JSON array of entries corresponding to available build configurations.
604
+ On single\-configuration generators there is one entry for the value
605
+ of the \X'tty: link #variable:CMAKE_BUILD_TYPE'\fI\%CMAKE_BUILD_TYPE\fP\X'tty: link' variable. For multi\-configuration
606
+ generators there is an entry for each configuration listed in the
607
+ \X'tty: link #variable:CMAKE_CONFIGURATION_TYPES'\fI\%CMAKE_CONFIGURATION_TYPES\fP\X'tty: link' variable.
608
+ Each entry is a JSON object containing members:
609
+ .INDENT 7.0
610
+ .TP
611
+ .B \fBname\fP
612
+ A string specifying the name of the configuration, e.g. \fBDebug\fP\&.
613
+ .TP
614
+ .B \fBdirectories\fP
615
+ A JSON array of entries each corresponding to a build system directory
616
+ whose source directory contains a \fBCMakeLists.txt\fP file. The first
617
+ entry corresponds to the top\-level directory. Each entry is a
618
+ JSON object containing members:
619
+ .INDENT 7.0
620
+ .TP
621
+ .B \fBsource\fP
622
+ A string specifying the path to the source directory, represented
623
+ with forward slashes. If the directory is inside the top\-level
624
+ source directory then the path is specified relative to that
625
+ directory (with \fB\&.\fP for the top\-level source directory itself).
626
+ Otherwise the path is absolute.
627
+ .TP
628
+ .B \fBbuild\fP
629
+ A string specifying the path to the build directory, represented
630
+ with forward slashes. If the directory is inside the top\-level
631
+ build directory then the path is specified relative to that
632
+ directory (with \fB\&.\fP for the top\-level build directory itself).
633
+ Otherwise the path is absolute.
634
+ .TP
635
+ .B \fBparentIndex\fP
636
+ Optional member that is present when the directory is not top\-level.
637
+ The value is an unsigned integer 0\-based index of another entry in
638
+ the main \fBdirectories\fP array that corresponds to the parent
639
+ directory that added this directory as a subdirectory.
640
+ .TP
641
+ .B \fBchildIndexes\fP
642
+ Optional member that is present when the directory has subdirectories.
643
+ The value is a JSON array of entries corresponding to child directories
644
+ created by the \X'tty: link #command:add_subdirectory'\fI\%add_subdirectory()\fP\X'tty: link' or \X'tty: link #command:subdirs'\fI\%subdirs()\fP\X'tty: link'
645
+ command. Each entry is an unsigned integer 0\-based index of another
646
+ entry in the main \fBdirectories\fP array.
647
+ .TP
648
+ .B \fBprojectIndex\fP
649
+ An unsigned integer 0\-based index into the main \fBprojects\fP array
650
+ indicating the build system project to which the this directory belongs.
651
+ .TP
652
+ .B \fBtargetIndexes\fP
653
+ Optional member that is present when the directory itself has targets,
654
+ excluding those belonging to subdirectories. The value is a JSON
655
+ array of entries corresponding to the targets. Each entry is an
656
+ unsigned integer 0\-based index into the main \fBtargets\fP array.
657
+ .TP
658
+ .B \fBminimumCMakeVersion\fP
659
+ Optional member present when a minimum required version of CMake is
660
+ known for the directory. This is the \fB<min>\fP version given to the
661
+ most local call to the \X'tty: link #command:cmake_minimum_required'\fI\%cmake_minimum_required(VERSION)\fP\X'tty: link'
662
+ command in the directory itself or one of its ancestors.
663
+ The value is a JSON object with one member:
664
+ .INDENT 7.0
665
+ .TP
666
+ .B \fBstring\fP
667
+ A string specifying the minimum required version in the format:
668
+ .INDENT 7.0
669
+ .INDENT 3.5
670
+ .sp
671
+ .nf
672
+ .ft C
673
+ <major>.<minor>[.<patch>[.<tweak>]][<suffix>]
674
+ .ft P
675
+ .fi
676
+ .UNINDENT
677
+ .UNINDENT
678
+ .sp
679
+ Each component is an unsigned integer and the suffix may be an
680
+ arbitrary string.
681
+ .UNINDENT
682
+ .TP
683
+ .B \fBhasInstallRule\fP
684
+ Optional member that is present with boolean value \fBtrue\fP when
685
+ the directory or one of its subdirectories contains any
686
+ \X'tty: link #command:install'\fI\%install()\fP\X'tty: link' rules, i.e. whether a \fBmake install\fP
687
+ or equivalent rule is available.
688
+ .TP
689
+ .B \fBjsonFile\fP
690
+ A JSON string specifying a path relative to the codemodel file
691
+ to another JSON file containing a
692
+ \fI\%\(dqcodemodel\(dq version 2 \(dqdirectory\(dq object\fP\&.
693
+ .sp
694
+ This field was added in codemodel version 2.3.
695
+ .UNINDENT
696
+ .TP
697
+ .B \fBprojects\fP
698
+ A JSON array of entries corresponding to the top\-level project
699
+ and sub\-projects defined in the build system. Each (sub\-)project
700
+ corresponds to a source directory whose \fBCMakeLists.txt\fP file
701
+ calls the \X'tty: link #command:project'\fI\%project()\fP\X'tty: link' command with a project name different
702
+ from its parent directory. The first entry corresponds to the
703
+ top\-level project.
704
+ .sp
705
+ Each entry is a JSON object containing members:
706
+ .INDENT 7.0
707
+ .TP
708
+ .B \fBname\fP
709
+ A string specifying the name given to the \X'tty: link #command:project'\fI\%project()\fP\X'tty: link' command.
710
+ .TP
711
+ .B \fBparentIndex\fP
712
+ Optional member that is present when the project is not top\-level.
713
+ The value is an unsigned integer 0\-based index of another entry in
714
+ the main \fBprojects\fP array that corresponds to the parent project
715
+ that added this project as a sub\-project.
716
+ .TP
717
+ .B \fBchildIndexes\fP
718
+ Optional member that is present when the project has sub\-projects.
719
+ The value is a JSON array of entries corresponding to the sub\-projects.
720
+ Each entry is an unsigned integer 0\-based index of another
721
+ entry in the main \fBprojects\fP array.
722
+ .TP
723
+ .B \fBdirectoryIndexes\fP
724
+ A JSON array of entries corresponding to build system directories
725
+ that are part of the project. The first entry corresponds to the
726
+ top\-level directory of the project. Each entry is an unsigned
727
+ integer 0\-based index into the main \fBdirectories\fP array.
728
+ .TP
729
+ .B \fBtargetIndexes\fP
730
+ Optional member that is present when the project itself has targets,
731
+ excluding those belonging to sub\-projects. The value is a JSON
732
+ array of entries corresponding to the targets. Each entry is an
733
+ unsigned integer 0\-based index into the main \fBtargets\fP array.
734
+ .UNINDENT
735
+ .TP
736
+ .B \fBtargets\fP
737
+ A JSON array of entries corresponding to the build system targets.
738
+ Such targets are created by calls to \X'tty: link #command:add_executable'\fI\%add_executable()\fP\X'tty: link',
739
+ \X'tty: link #command:add_library'\fI\%add_library()\fP\X'tty: link', and \X'tty: link #command:add_custom_target'\fI\%add_custom_target()\fP\X'tty: link', excluding
740
+ imported targets and interface libraries (which do not generate any
741
+ build rules). Each entry is a JSON object containing members:
742
+ .INDENT 7.0
743
+ .TP
744
+ .B \fBname\fP
745
+ A string specifying the target name.
746
+ .TP
747
+ .B \fBid\fP
748
+ A string uniquely identifying the target. This matches the \fBid\fP
749
+ field in the file referenced by \fBjsonFile\fP\&.
750
+ .TP
751
+ .B \fBdirectoryIndex\fP
752
+ An unsigned integer 0\-based index into the main \fBdirectories\fP array
753
+ indicating the build system directory in which the target is defined.
754
+ .TP
755
+ .B \fBprojectIndex\fP
756
+ An unsigned integer 0\-based index into the main \fBprojects\fP array
757
+ indicating the build system project in which the target is defined.
758
+ .TP
759
+ .B \fBjsonFile\fP
760
+ A JSON string specifying a path relative to the codemodel file
761
+ to another JSON file containing a
762
+ \fI\%\(dqcodemodel\(dq version 2 \(dqtarget\(dq object\fP\&.
763
+ .UNINDENT
764
+ .UNINDENT
765
+ .UNINDENT
766
+ .SS \(dqcodemodel\(dq version 2 \(dqdirectory\(dq object
767
+ .sp
768
+ A codemodel \(dqdirectory\(dq object is referenced by a \fI\%\(dqcodemodel\(dq version 2\fP
769
+ object\(aqs \fBdirectories\fP array. Each \(dqdirectory\(dq object is a JSON object
770
+ with members:
771
+ .INDENT 0.0
772
+ .TP
773
+ .B \fBpaths\fP
774
+ A JSON object containing members:
775
+ .INDENT 7.0
776
+ .TP
777
+ .B \fBsource\fP
778
+ A string specifying the path to the source directory, represented
779
+ with forward slashes. If the directory is inside the top\-level
780
+ source directory then the path is specified relative to that
781
+ directory (with \fB\&.\fP for the top\-level source directory itself).
782
+ Otherwise the path is absolute.
783
+ .TP
784
+ .B \fBbuild\fP
785
+ A string specifying the path to the build directory, represented
786
+ with forward slashes. If the directory is inside the top\-level
787
+ build directory then the path is specified relative to that
788
+ directory (with \fB\&.\fP for the top\-level build directory itself).
789
+ Otherwise the path is absolute.
790
+ .UNINDENT
791
+ .TP
792
+ .B \fBinstallers\fP
793
+ A JSON array of entries corresponding to \X'tty: link #command:install'\fI\%install()\fP\X'tty: link' rules.
794
+ Each entry is a JSON object containing members:
795
+ .INDENT 7.0
796
+ .TP
797
+ .B \fBcomponent\fP
798
+ A string specifying the component selected by the corresponding
799
+ \X'tty: link #command:install'\fI\%install()\fP\X'tty: link' command invocation.
800
+ .TP
801
+ .B \fBdestination\fP
802
+ Optional member that is present for specific \fBtype\fP values below.
803
+ The value is a string specifying the install destination path.
804
+ The path may be absolute or relative to the install prefix.
805
+ .TP
806
+ .B \fBpaths\fP
807
+ Optional member that is present for specific \fBtype\fP values below.
808
+ The value is a JSON array of entries corresponding to the paths
809
+ (files or directories) to be installed. Each entry is one of:
810
+ .INDENT 7.0
811
+ .IP \(bu 2
812
+ A string specifying the path from which a file or directory
813
+ is to be installed. The portion of the path not preceded by
814
+ a \fB/\fP also specifies the path (name) to which the file
815
+ or directory is to be installed under the destination.
816
+ .IP \(bu 2
817
+ A JSON object with members:
818
+ .INDENT 2.0
819
+ .TP
820
+ .B \fBfrom\fP
821
+ A string specifying the path from which a file or directory
822
+ is to be installed.
823
+ .TP
824
+ .B \fBto\fP
825
+ A string specifying the path to which the file or directory
826
+ is to be installed under the destination.
827
+ .UNINDENT
828
+ .UNINDENT
829
+ .sp
830
+ In both cases the paths are represented with forward slashes. If
831
+ the \(dqfrom\(dq path is inside the top\-level directory documented by the
832
+ corresponding \fBtype\fP value, then the path is specified relative
833
+ to that directory. Otherwise the path is absolute.
834
+ .TP
835
+ .B \fBtype\fP
836
+ A string specifying the type of installation rule. The value is one
837
+ of the following, with some variants providing additional members:
838
+ .INDENT 7.0
839
+ .TP
840
+ .B \fBfile\fP
841
+ An \X'tty: link #files'\fI\%install(FILES)\fP\X'tty: link' or \X'tty: link #programs'\fI\%install(PROGRAMS)\fP\X'tty: link' call.
842
+ The \fBdestination\fP and \fBpaths\fP members are populated, with paths
843
+ under the top\-level \fIsource\fP directory expressed relative to it.
844
+ The \fBisOptional\fP member may exist.
845
+ This type has no additional members.
846
+ .TP
847
+ .B \fBdirectory\fP
848
+ An \X'tty: link #directory'\fI\%install(DIRECTORY)\fP\X'tty: link' call.
849
+ The \fBdestination\fP and \fBpaths\fP members are populated, with paths
850
+ under the top\-level \fIsource\fP directory expressed relative to it.
851
+ The \fBisOptional\fP member may exist.
852
+ This type has no additional members.
853
+ .TP
854
+ .B \fBtarget\fP
855
+ An \X'tty: link #targets'\fI\%install(TARGETS)\fP\X'tty: link' call.
856
+ The \fBdestination\fP and \fBpaths\fP members are populated, with paths
857
+ under the top\-level \fIbuild\fP directory expressed relative to it.
858
+ The \fBisOptional\fP member may exist.
859
+ This type has additional members \fBtargetId\fP, \fBtargetIndex\fP,
860
+ \fBtargetIsImportLibrary\fP, and \fBtargetInstallNamelink\fP\&.
861
+ .TP
862
+ .B \fBexport\fP
863
+ An \X'tty: link #export'\fI\%install(EXPORT)\fP\X'tty: link' call.
864
+ The \fBdestination\fP and \fBpaths\fP members are populated, with paths
865
+ under the top\-level \fIbuild\fP directory expressed relative to it.
866
+ The \fBpaths\fP entries refer to files generated automatically by
867
+ CMake for installation, and their actual values are considered
868
+ private implementation details.
869
+ This type has additional members \fBexportName\fP and \fBexportTargets\fP\&.
870
+ .TP
871
+ .B \fBscript\fP
872
+ An \X'tty: link #script'\fI\%install(SCRIPT)\fP\X'tty: link' call.
873
+ This type has additional member \fBscriptFile\fP\&.
874
+ .TP
875
+ .B \fBcode\fP
876
+ An \X'tty: link #code'\fI\%install(CODE)\fP\X'tty: link' call.
877
+ This type has no additional members.
878
+ .TP
879
+ .B \fBimportedRuntimeArtifacts\fP
880
+ An \X'tty: link #imported-runtime-artifacts'\fI\%install(IMPORTED_RUNTIME_ARTIFACTS)\fP\X'tty: link' call.
881
+ The \fBdestination\fP member is populated. The \fBisOptional\fP member may
882
+ exist. This type has no additional members.
883
+ .TP
884
+ .B \fBruntimeDependencySet\fP
885
+ An \X'tty: link #runtime-dependency-set'\fI\%install(RUNTIME_DEPENDENCY_SET)\fP\X'tty: link' call or an
886
+ \X'tty: link #targets'\fI\%install(TARGETS)\fP\X'tty: link' call with \fBRUNTIME_DEPENDENCIES\fP\&. The
887
+ \fBdestination\fP member is populated. This type has additional members
888
+ \fBruntimeDependencySetName\fP and \fBruntimeDependencySetType\fP\&.
889
+ .TP
890
+ .B \fBfileSet\fP
891
+ An \X'tty: link #targets'\fI\%install(TARGETS)\fP\X'tty: link' call with \fBFILE_SET\fP\&.
892
+ The \fBdestination\fP and \fBpaths\fP members are populated.
893
+ The \fBisOptional\fP member may exist.
894
+ This type has additional members \fBfileSetName\fP, \fBfileSetType\fP,
895
+ \fBfileSetDirectories\fP, and \fBfileSetTarget\fP\&.
896
+ .sp
897
+ This type was added in codemodel version 2.4.
898
+ .UNINDENT
899
+ .TP
900
+ .B \fBisExcludeFromAll\fP
901
+ Optional member that is present with boolean value \fBtrue\fP when
902
+ \X'tty: link #command:install'\fI\%install()\fP\X'tty: link' is called with the \fBEXCLUDE_FROM_ALL\fP option.
903
+ .TP
904
+ .B \fBisForAllComponents\fP
905
+ Optional member that is present with boolean value \fBtrue\fP when
906
+ \X'tty: link #command:install'\fI\%install(SCRIPT|CODE)\fP\X'tty: link' is called with the
907
+ \fBALL_COMPONENTS\fP option.
908
+ .TP
909
+ .B \fBisOptional\fP
910
+ Optional member that is present with boolean value \fBtrue\fP when
911
+ \X'tty: link #command:install'\fI\%install()\fP\X'tty: link' is called with the \fBOPTIONAL\fP option.
912
+ This is allowed when \fBtype\fP is \fBfile\fP, \fBdirectory\fP, or \fBtarget\fP\&.
913
+ .TP
914
+ .B \fBtargetId\fP
915
+ Optional member that is present when \fBtype\fP is \fBtarget\fP\&.
916
+ The value is a string uniquely identifying the target to be installed.
917
+ This matches the \fBid\fP member of the target in the main
918
+ \(dqcodemodel\(dq object\(aqs \fBtargets\fP array.
919
+ .TP
920
+ .B \fBtargetIndex\fP
921
+ Optional member that is present when \fBtype\fP is \fBtarget\fP\&.
922
+ The value is an unsigned integer 0\-based index into the main \(dqcodemodel\(dq
923
+ object\(aqs \fBtargets\fP array for the target to be installed.
924
+ .TP
925
+ .B \fBtargetIsImportLibrary\fP
926
+ Optional member that is present when \fBtype\fP is \fBtarget\fP and
927
+ the installer is for a Windows DLL import library file or for an
928
+ AIX linker import file. If present, it has boolean value \fBtrue\fP\&.
929
+ .TP
930
+ .B \fBtargetInstallNamelink\fP
931
+ Optional member that is present when \fBtype\fP is \fBtarget\fP and
932
+ the installer corresponds to a target that may use symbolic links
933
+ to implement the \X'tty: link #prop_tgt:VERSION'\fI\%VERSION\fP\X'tty: link' and \X'tty: link #prop_tgt:SOVERSION'\fI\%SOVERSION\fP\X'tty: link'
934
+ target properties.
935
+ The value is a string indicating how the installer is supposed to
936
+ handle the symlinks: \fBskip\fP means the installer should skip the
937
+ symlinks and install only the real file, and \fBonly\fP means the
938
+ installer should install only the symlinks and not the real file.
939
+ In all cases the \fBpaths\fP member lists what it actually installs.
940
+ .TP
941
+ .B \fBexportName\fP
942
+ Optional member that is present when \fBtype\fP is \fBexport\fP\&.
943
+ The value is a string specifying the name of the export.
944
+ .TP
945
+ .B \fBexportTargets\fP
946
+ Optional member that is present when \fBtype\fP is \fBexport\fP\&.
947
+ The value is a JSON array of entries corresponding to the targets
948
+ included in the export. Each entry is a JSON object with members:
949
+ .INDENT 7.0
950
+ .TP
951
+ .B \fBid\fP
952
+ A string uniquely identifying the target. This matches
953
+ the \fBid\fP member of the target in the main \(dqcodemodel\(dq
954
+ object\(aqs \fBtargets\fP array.
955
+ .TP
956
+ .B \fBindex\fP
957
+ An unsigned integer 0\-based index into the main \(dqcodemodel\(dq
958
+ object\(aqs \fBtargets\fP array for the target.
959
+ .UNINDENT
960
+ .TP
961
+ .B \fBruntimeDependencySetName\fP
962
+ Optional member that is present when \fBtype\fP is \fBruntimeDependencySet\fP
963
+ and the installer was created by an
964
+ \X'tty: link #runtime-dependency-set'\fI\%install(RUNTIME_DEPENDENCY_SET)\fP\X'tty: link' call. The value is a string
965
+ specifying the name of the runtime dependency set that was installed.
966
+ .TP
967
+ .B \fBruntimeDependencySetType\fP
968
+ Optional member that is present when \fBtype\fP is \fBruntimeDependencySet\fP\&.
969
+ The value is a string with one of the following values:
970
+ .INDENT 7.0
971
+ .TP
972
+ .B \fBlibrary\fP
973
+ Indicates that this installer installs dependencies that are not macOS
974
+ frameworks.
975
+ .TP
976
+ .B \fBframework\fP
977
+ Indicates that this installer installs dependencies that are macOS
978
+ frameworks.
979
+ .UNINDENT
980
+ .TP
981
+ .B \fBfileSetName\fP
982
+ Optional member that is present when \fBtype\fP is \fBfileSet\fP\&. The value is
983
+ a string with the name of the file set.
984
+ .sp
985
+ This field was added in codemodel version 2.4.
986
+ .TP
987
+ .B \fBfileSetType\fP
988
+ Optional member that is present when \fBtype\fP is \fBfileSet\fP\&. The value is
989
+ a string with the type of the file set.
990
+ .sp
991
+ This field was added in codemodel version 2.4.
992
+ .TP
993
+ .B \fBfileSetDirectories\fP
994
+ Optional member that is present when \fBtype\fP is \fBfileSet\fP\&. The value
995
+ is a list of strings with the file set\(aqs base directories (determined by
996
+ genex\-evaluation of \X'tty: link #prop_tgt:HEADER_DIRS'\fI\%HEADER_DIRS\fP\X'tty: link' or
997
+ \X'tty: link #prop_tgt:HEADER_DIRS_<NAME>'\fI\%HEADER_DIRS_<NAME>\fP\X'tty: link').
998
+ .sp
999
+ This field was added in codemodel version 2.4.
1000
+ .TP
1001
+ .B \fBfileSetTarget\fP
1002
+ Optional member that is present when \fBtype\fP is \fBfileSet\fP\&. The value
1003
+ is a JSON object with members:
1004
+ .INDENT 7.0
1005
+ .TP
1006
+ .B \fBid\fP
1007
+ A string uniquely identifying the target. This matches
1008
+ the \fBid\fP member of the target in the main \(dqcodemodel\(dq
1009
+ object\(aqs \fBtargets\fP array.
1010
+ .TP
1011
+ .B \fBindex\fP
1012
+ An unsigned integer 0\-based index into the main \(dqcodemodel\(dq
1013
+ object\(aqs \fBtargets\fP array for the target.
1014
+ .UNINDENT
1015
+ .sp
1016
+ This field was added in codemodel version 2.4.
1017
+ .TP
1018
+ .B \fBscriptFile\fP
1019
+ Optional member that is present when \fBtype\fP is \fBscript\fP\&.
1020
+ The value is a string specifying the path to the script file on disk,
1021
+ represented with forward slashes. If the file is inside the top\-level
1022
+ source directory then the path is specified relative to that directory.
1023
+ Otherwise the path is absolute.
1024
+ .TP
1025
+ .B \fBbacktrace\fP
1026
+ Optional member that is present when a CMake language backtrace to
1027
+ the \X'tty: link #command:install'\fI\%install()\fP\X'tty: link' or other command invocation that added this
1028
+ installer is available. The value is an unsigned integer 0\-based
1029
+ index into the \fBbacktraceGraph\fP member\(aqs \fBnodes\fP array.
1030
+ .UNINDENT
1031
+ .TP
1032
+ .B \fBbacktraceGraph\fP
1033
+ A \fI\%\(dqcodemodel\(dq version 2 \(dqbacktrace graph\(dq\fP whose nodes are referenced
1034
+ from \fBbacktrace\fP members elsewhere in this \(dqdirectory\(dq object.
1035
+ .UNINDENT
1036
+ .SS \(dqcodemodel\(dq version 2 \(dqtarget\(dq object
1037
+ .sp
1038
+ A codemodel \(dqtarget\(dq object is referenced by a \fI\%\(dqcodemodel\(dq version 2\fP
1039
+ object\(aqs \fBtargets\fP array. Each \(dqtarget\(dq object is a JSON object
1040
+ with members:
1041
+ .INDENT 0.0
1042
+ .TP
1043
+ .B \fBname\fP
1044
+ A string specifying the logical name of the target.
1045
+ .TP
1046
+ .B \fBid\fP
1047
+ A string uniquely identifying the target. The format is unspecified
1048
+ and should not be interpreted by clients.
1049
+ .TP
1050
+ .B \fBtype\fP
1051
+ A string specifying the type of the target. The value is one of
1052
+ \fBEXECUTABLE\fP, \fBSTATIC_LIBRARY\fP, \fBSHARED_LIBRARY\fP,
1053
+ \fBMODULE_LIBRARY\fP, \fBOBJECT_LIBRARY\fP, \fBINTERFACE_LIBRARY\fP,
1054
+ or \fBUTILITY\fP\&.
1055
+ .TP
1056
+ .B \fBbacktrace\fP
1057
+ Optional member that is present when a CMake language backtrace to
1058
+ the command in the source code that created the target is available.
1059
+ The value is an unsigned integer 0\-based index into the
1060
+ \fBbacktraceGraph\fP member\(aqs \fBnodes\fP array.
1061
+ .TP
1062
+ .B \fBfolder\fP
1063
+ Optional member that is present when the \X'tty: link #prop_tgt:FOLDER'\fI\%FOLDER\fP\X'tty: link' target
1064
+ property is set. The value is a JSON object with one member:
1065
+ .INDENT 7.0
1066
+ .TP
1067
+ .B \fBname\fP
1068
+ A string specifying the name of the target folder.
1069
+ .UNINDENT
1070
+ .TP
1071
+ .B \fBpaths\fP
1072
+ A JSON object containing members:
1073
+ .INDENT 7.0
1074
+ .TP
1075
+ .B \fBsource\fP
1076
+ A string specifying the path to the target\(aqs source directory,
1077
+ represented with forward slashes. If the directory is inside the
1078
+ top\-level source directory then the path is specified relative to
1079
+ that directory (with \fB\&.\fP for the top\-level source directory itself).
1080
+ Otherwise the path is absolute.
1081
+ .TP
1082
+ .B \fBbuild\fP
1083
+ A string specifying the path to the target\(aqs build directory,
1084
+ represented with forward slashes. If the directory is inside the
1085
+ top\-level build directory then the path is specified relative to
1086
+ that directory (with \fB\&.\fP for the top\-level build directory itself).
1087
+ Otherwise the path is absolute.
1088
+ .UNINDENT
1089
+ .TP
1090
+ .B \fBnameOnDisk\fP
1091
+ Optional member that is present for executable and library targets
1092
+ that are linked or archived into a single primary artifact.
1093
+ The value is a string specifying the file name of that artifact on disk.
1094
+ .TP
1095
+ .B \fBartifacts\fP
1096
+ Optional member that is present for executable and library targets
1097
+ that produce artifacts on disk meant for consumption by dependents.
1098
+ The value is a JSON array of entries corresponding to the artifacts.
1099
+ Each entry is a JSON object containing one member:
1100
+ .INDENT 7.0
1101
+ .TP
1102
+ .B \fBpath\fP
1103
+ A string specifying the path to the file on disk, represented with
1104
+ forward slashes. If the file is inside the top\-level build directory
1105
+ then the path is specified relative to that directory.
1106
+ Otherwise the path is absolute.
1107
+ .UNINDENT
1108
+ .TP
1109
+ .B \fBisGeneratorProvided\fP
1110
+ Optional member that is present with boolean value \fBtrue\fP if the
1111
+ target is provided by CMake\(aqs build system generator rather than by
1112
+ a command in the source code.
1113
+ .TP
1114
+ .B \fBinstall\fP
1115
+ Optional member that is present when the target has an \X'tty: link #command:install'\fI\%install()\fP\X'tty: link'
1116
+ rule. The value is a JSON object with members:
1117
+ .INDENT 7.0
1118
+ .TP
1119
+ .B \fBprefix\fP
1120
+ A JSON object specifying the installation prefix. It has one member:
1121
+ .INDENT 7.0
1122
+ .TP
1123
+ .B \fBpath\fP
1124
+ A string specifying the value of \X'tty: link #variable:CMAKE_INSTALL_PREFIX'\fI\%CMAKE_INSTALL_PREFIX\fP\X'tty: link'\&.
1125
+ .UNINDENT
1126
+ .TP
1127
+ .B \fBdestinations\fP
1128
+ A JSON array of entries specifying an install destination path.
1129
+ Each entry is a JSON object with members:
1130
+ .INDENT 7.0
1131
+ .TP
1132
+ .B \fBpath\fP
1133
+ A string specifying the install destination path. The path may
1134
+ be absolute or relative to the install prefix.
1135
+ .TP
1136
+ .B \fBbacktrace\fP
1137
+ Optional member that is present when a CMake language backtrace to
1138
+ the \X'tty: link #command:install'\fI\%install()\fP\X'tty: link' command invocation that specified this
1139
+ destination is available. The value is an unsigned integer 0\-based
1140
+ index into the \fBbacktraceGraph\fP member\(aqs \fBnodes\fP array.
1141
+ .UNINDENT
1142
+ .UNINDENT
1143
+ .TP
1144
+ .B \fBlaunchers\fP
1145
+ Optional member that is present on executable targets that have
1146
+ at least one launcher specified by the project. The value is a
1147
+ JSON array of entries corresponding to the specified launchers.
1148
+ Each entry is a JSON object with members:
1149
+ .INDENT 7.0
1150
+ .TP
1151
+ .B \fBcommand\fP
1152
+ A string specifying the path to the launcher on disk, represented
1153
+ with forward slashes. If the file is inside the top\-level source
1154
+ directory then the path is specified relative to that directory.
1155
+ .TP
1156
+ .B \fBarguments\fP
1157
+ Optional member that is present when the launcher command has
1158
+ arguments preceding the executable to be launched. The value
1159
+ is a JSON array of strings representing the arguments.
1160
+ .TP
1161
+ .B \fBtype\fP
1162
+ A string specifying the type of launcher. The value is one of
1163
+ the following:
1164
+ .INDENT 7.0
1165
+ .TP
1166
+ .B \fBemulator\fP
1167
+ An emulator for the target platform when cross\-compiling.
1168
+ See the \X'tty: link #prop_tgt:CROSSCOMPILING_EMULATOR'\fI\%CROSSCOMPILING_EMULATOR\fP\X'tty: link' target property.
1169
+ .TP
1170
+ .B \fBtest\fP
1171
+ A start program for the execution of tests.
1172
+ See the \X'tty: link #prop_tgt:TEST_LAUNCHER'\fI\%TEST_LAUNCHER\fP\X'tty: link' target property.
1173
+ .UNINDENT
1174
+ .UNINDENT
1175
+ .sp
1176
+ This field was added in codemodel version 2.7.
1177
+ .TP
1178
+ .B \fBlink\fP
1179
+ Optional member that is present for executables and shared library
1180
+ targets that link into a runtime binary. The value is a JSON object
1181
+ with members describing the link step:
1182
+ .INDENT 7.0
1183
+ .TP
1184
+ .B \fBlanguage\fP
1185
+ A string specifying the language (e.g. \fBC\fP, \fBCXX\fP, \fBFortran\fP)
1186
+ of the toolchain is used to invoke the linker.
1187
+ .TP
1188
+ .B \fBcommandFragments\fP
1189
+ Optional member that is present when fragments of the link command
1190
+ line invocation are available. The value is a JSON array of entries
1191
+ specifying ordered fragments. Each entry is a JSON object with members:
1192
+ .INDENT 7.0
1193
+ .TP
1194
+ .B \fBfragment\fP
1195
+ A string specifying a fragment of the link command line invocation.
1196
+ The value is encoded in the build system\(aqs native shell format.
1197
+ .TP
1198
+ .B \fBrole\fP
1199
+ A string specifying the role of the fragment\(aqs content:
1200
+ .INDENT 7.0
1201
+ .IP \(bu 2
1202
+ \fBflags\fP: link flags.
1203
+ .IP \(bu 2
1204
+ \fBlibraries\fP: link library file paths or flags.
1205
+ .IP \(bu 2
1206
+ \fBlibraryPath\fP: library search path flags.
1207
+ .IP \(bu 2
1208
+ \fBframeworkPath\fP: macOS framework search path flags.
1209
+ .UNINDENT
1210
+ .UNINDENT
1211
+ .TP
1212
+ .B \fBlto\fP
1213
+ Optional member that is present with boolean value \fBtrue\fP
1214
+ when link\-time optimization (a.k.a. interprocedural optimization
1215
+ or link\-time code generation) is enabled.
1216
+ .TP
1217
+ .B \fBsysroot\fP
1218
+ Optional member that is present when the \X'tty: link #variable:CMAKE_SYSROOT_LINK'\fI\%CMAKE_SYSROOT_LINK\fP\X'tty: link'
1219
+ or \X'tty: link #variable:CMAKE_SYSROOT'\fI\%CMAKE_SYSROOT\fP\X'tty: link' variable is defined. The value is a
1220
+ JSON object with one member:
1221
+ .INDENT 7.0
1222
+ .TP
1223
+ .B \fBpath\fP
1224
+ A string specifying the absolute path to the sysroot, represented
1225
+ with forward slashes.
1226
+ .UNINDENT
1227
+ .UNINDENT
1228
+ .TP
1229
+ .B \fBarchive\fP
1230
+ Optional member that is present for static library targets. The value
1231
+ is a JSON object with members describing the archive step:
1232
+ .INDENT 7.0
1233
+ .TP
1234
+ .B \fBcommandFragments\fP
1235
+ Optional member that is present when fragments of the archiver command
1236
+ line invocation are available. The value is a JSON array of entries
1237
+ specifying the fragments. Each entry is a JSON object with members:
1238
+ .INDENT 7.0
1239
+ .TP
1240
+ .B \fBfragment\fP
1241
+ A string specifying a fragment of the archiver command line invocation.
1242
+ The value is encoded in the build system\(aqs native shell format.
1243
+ .TP
1244
+ .B \fBrole\fP
1245
+ A string specifying the role of the fragment\(aqs content:
1246
+ .INDENT 7.0
1247
+ .IP \(bu 2
1248
+ \fBflags\fP: archiver flags.
1249
+ .UNINDENT
1250
+ .UNINDENT
1251
+ .TP
1252
+ .B \fBlto\fP
1253
+ Optional member that is present with boolean value \fBtrue\fP
1254
+ when link\-time optimization (a.k.a. interprocedural optimization
1255
+ or link\-time code generation) is enabled.
1256
+ .UNINDENT
1257
+ .TP
1258
+ .B \fBdependencies\fP
1259
+ Optional member that is present when the target depends on other targets.
1260
+ The value is a JSON array of entries corresponding to the dependencies.
1261
+ Each entry is a JSON object with members:
1262
+ .INDENT 7.0
1263
+ .TP
1264
+ .B \fBid\fP
1265
+ A string uniquely identifying the target on which this target depends.
1266
+ This matches the main \fBid\fP member of the other target.
1267
+ .TP
1268
+ .B \fBbacktrace\fP
1269
+ Optional member that is present when a CMake language backtrace to
1270
+ the \X'tty: link #command:add_dependencies'\fI\%add_dependencies()\fP\X'tty: link', \X'tty: link #command:target_link_libraries'\fI\%target_link_libraries()\fP\X'tty: link',
1271
+ or other command invocation that created this dependency is
1272
+ available. The value is an unsigned integer 0\-based index into
1273
+ the \fBbacktraceGraph\fP member\(aqs \fBnodes\fP array.
1274
+ .UNINDENT
1275
+ .TP
1276
+ .B \fBfileSets\fP
1277
+ A JSON array of entries corresponding to the target\(aqs file sets. Each entry
1278
+ is a JSON object with members:
1279
+ .INDENT 7.0
1280
+ .TP
1281
+ .B \fBname\fP
1282
+ A string specifying the name of the file set.
1283
+ .TP
1284
+ .B \fBtype\fP
1285
+ A string specifying the type of the file set. See
1286
+ \X'tty: link #command:target_sources'\fI\%target_sources()\fP\X'tty: link' supported file set types.
1287
+ .TP
1288
+ .B \fBvisibility\fP
1289
+ A string specifying the visibility of the file set; one of \fBPUBLIC\fP,
1290
+ \fBPRIVATE\fP, or \fBINTERFACE\fP\&.
1291
+ .TP
1292
+ .B \fBbaseDirectories\fP
1293
+ A JSON array of strings, each specifying a base directory containing
1294
+ sources in the file set. If the directory is inside the top\-level source
1295
+ directory then the path is specified relative to that directory.
1296
+ Otherwise the path is absolute.
1297
+ .UNINDENT
1298
+ .sp
1299
+ This field was added in codemodel version 2.5.
1300
+ .TP
1301
+ .B \fBsources\fP
1302
+ A JSON array of entries corresponding to the target\(aqs source files.
1303
+ Each entry is a JSON object with members:
1304
+ .INDENT 7.0
1305
+ .TP
1306
+ .B \fBpath\fP
1307
+ A string specifying the path to the source file on disk, represented
1308
+ with forward slashes. If the file is inside the top\-level source
1309
+ directory then the path is specified relative to that directory.
1310
+ Otherwise the path is absolute.
1311
+ .TP
1312
+ .B \fBcompileGroupIndex\fP
1313
+ Optional member that is present when the source is compiled.
1314
+ The value is an unsigned integer 0\-based index into the
1315
+ \fBcompileGroups\fP array.
1316
+ .TP
1317
+ .B \fBsourceGroupIndex\fP
1318
+ Optional member that is present when the source is part of a source
1319
+ group either via the \X'tty: link #command:source_group'\fI\%source_group()\fP\X'tty: link' command or by default.
1320
+ The value is an unsigned integer 0\-based index into the
1321
+ \fBsourceGroups\fP array.
1322
+ .TP
1323
+ .B \fBisGenerated\fP
1324
+ Optional member that is present with boolean value \fBtrue\fP if
1325
+ the source is \X'tty: link #prop_sf:GENERATED'\fI\%GENERATED\fP\X'tty: link'\&.
1326
+ .TP
1327
+ .B \fBfileSetIndex\fP
1328
+ Optional member that is present when the source is part of a file set.
1329
+ The value is an unsigned integer 0\-based index into the \fBfileSets\fP
1330
+ array.
1331
+ .sp
1332
+ This field was added in codemodel version 2.5.
1333
+ .TP
1334
+ .B \fBbacktrace\fP
1335
+ Optional member that is present when a CMake language backtrace to
1336
+ the \X'tty: link #command:target_sources'\fI\%target_sources()\fP\X'tty: link', \X'tty: link #command:add_executable'\fI\%add_executable()\fP\X'tty: link',
1337
+ \X'tty: link #command:add_library'\fI\%add_library()\fP\X'tty: link', \X'tty: link #command:add_custom_target'\fI\%add_custom_target()\fP\X'tty: link', or other
1338
+ command invocation that added this source to the target is
1339
+ available. The value is an unsigned integer 0\-based index into
1340
+ the \fBbacktraceGraph\fP member\(aqs \fBnodes\fP array.
1341
+ .UNINDENT
1342
+ .TP
1343
+ .B \fBsourceGroups\fP
1344
+ Optional member that is present when sources are grouped together by
1345
+ the \X'tty: link #command:source_group'\fI\%source_group()\fP\X'tty: link' command or by default. The value is a
1346
+ JSON array of entries corresponding to the groups. Each entry is
1347
+ a JSON object with members:
1348
+ .INDENT 7.0
1349
+ .TP
1350
+ .B \fBname\fP
1351
+ A string specifying the name of the source group.
1352
+ .TP
1353
+ .B \fBsourceIndexes\fP
1354
+ A JSON array listing the sources belonging to the group.
1355
+ Each entry is an unsigned integer 0\-based index into the
1356
+ main \fBsources\fP array for the target.
1357
+ .UNINDENT
1358
+ .TP
1359
+ .B \fBcompileGroups\fP
1360
+ Optional member that is present when the target has sources that compile.
1361
+ The value is a JSON array of entries corresponding to groups of sources
1362
+ that all compile with the same settings. Each entry is a JSON object
1363
+ with members:
1364
+ .INDENT 7.0
1365
+ .TP
1366
+ .B \fBsourceIndexes\fP
1367
+ A JSON array listing the sources belonging to the group.
1368
+ Each entry is an unsigned integer 0\-based index into the
1369
+ main \fBsources\fP array for the target.
1370
+ .TP
1371
+ .B \fBlanguage\fP
1372
+ A string specifying the language (e.g. \fBC\fP, \fBCXX\fP, \fBFortran\fP)
1373
+ of the toolchain is used to compile the source file.
1374
+ .TP
1375
+ .B \fBlanguageStandard\fP
1376
+ Optional member that is present when the language standard is set
1377
+ explicitly (e.g. via \X'tty: link #prop_tgt:CXX_STANDARD'\fI\%CXX_STANDARD\fP\X'tty: link') or implicitly by
1378
+ compile features. Each entry is a JSON object with two members:
1379
+ .INDENT 7.0
1380
+ .TP
1381
+ .B \fBbacktraces\fP
1382
+ Optional member that is present when a CMake language backtrace to
1383
+ the \fB<LANG>_STANDARD\fP setting is available. If the language
1384
+ standard was set implicitly by compile features those are used as
1385
+ the backtrace(s). It\(aqs possible for multiple compile features to
1386
+ require the same language standard so there could be multiple
1387
+ backtraces. The value is a JSON array with each entry being an
1388
+ unsigned integer 0\-based index into the \fBbacktraceGraph\fP
1389
+ member\(aqs \fBnodes\fP array.
1390
+ .TP
1391
+ .B \fBstandard\fP
1392
+ String representing the language standard.
1393
+ .UNINDENT
1394
+ .sp
1395
+ This field was added in codemodel version 2.2.
1396
+ .TP
1397
+ .B \fBcompileCommandFragments\fP
1398
+ Optional member that is present when fragments of the compiler command
1399
+ line invocation are available. The value is a JSON array of entries
1400
+ specifying ordered fragments. Each entry is a JSON object with
1401
+ one member:
1402
+ .INDENT 7.0
1403
+ .TP
1404
+ .B \fBfragment\fP
1405
+ A string specifying a fragment of the compile command line invocation.
1406
+ The value is encoded in the build system\(aqs native shell format.
1407
+ .UNINDENT
1408
+ .TP
1409
+ .B \fBincludes\fP
1410
+ Optional member that is present when there are include directories.
1411
+ The value is a JSON array with an entry for each directory. Each
1412
+ entry is a JSON object with members:
1413
+ .INDENT 7.0
1414
+ .TP
1415
+ .B \fBpath\fP
1416
+ A string specifying the path to the include directory,
1417
+ represented with forward slashes.
1418
+ .TP
1419
+ .B \fBisSystem\fP
1420
+ Optional member that is present with boolean value \fBtrue\fP if
1421
+ the include directory is marked as a system include directory.
1422
+ .TP
1423
+ .B \fBbacktrace\fP
1424
+ Optional member that is present when a CMake language backtrace to
1425
+ the \X'tty: link #command:target_include_directories'\fI\%target_include_directories()\fP\X'tty: link' or other command invocation
1426
+ that added this include directory is available. The value is
1427
+ an unsigned integer 0\-based index into the \fBbacktraceGraph\fP
1428
+ member\(aqs \fBnodes\fP array.
1429
+ .UNINDENT
1430
+ .TP
1431
+ .B \fBframeworks\fP
1432
+ Optional member that is present when, on Apple platforms, there are
1433
+ frameworks. The value is a JSON array with an entry for each directory.
1434
+ Each entry is a JSON object with members:
1435
+ .INDENT 7.0
1436
+ .TP
1437
+ .B \fBpath\fP
1438
+ A string specifying the path to the framework directory,
1439
+ represented with forward slashes.
1440
+ .TP
1441
+ .B \fBisSystem\fP
1442
+ Optional member that is present with boolean value \fBtrue\fP if
1443
+ the framework is marked as a system one.
1444
+ .TP
1445
+ .B \fBbacktrace\fP
1446
+ Optional member that is present when a CMake language backtrace to
1447
+ the \X'tty: link #command:target_link_libraries'\fI\%target_link_libraries()\fP\X'tty: link' or other command invocation
1448
+ that added this framework is available. The value is
1449
+ an unsigned integer 0\-based index into the \fBbacktraceGraph\fP
1450
+ member\(aqs \fBnodes\fP array.
1451
+ .UNINDENT
1452
+ .sp
1453
+ This field was added in codemodel version 2.6.
1454
+ .TP
1455
+ .B \fBprecompileHeaders\fP
1456
+ Optional member that is present when \X'tty: link #command:target_precompile_headers'\fI\%target_precompile_headers()\fP\X'tty: link'
1457
+ or other command invocations set \X'tty: link #prop_tgt:PRECOMPILE_HEADERS'\fI\%PRECOMPILE_HEADERS\fP\X'tty: link' on the
1458
+ target. The value is a JSON array with an entry for each header. Each
1459
+ entry is a JSON object with members:
1460
+ .INDENT 7.0
1461
+ .TP
1462
+ .B \fBheader\fP
1463
+ Full path to the precompile header file.
1464
+ .TP
1465
+ .B \fBbacktrace\fP
1466
+ Optional member that is present when a CMake language backtrace to
1467
+ the \X'tty: link #command:target_precompile_headers'\fI\%target_precompile_headers()\fP\X'tty: link' or other command invocation
1468
+ that added this precompiled header is available. The value is an
1469
+ unsigned integer 0\-based index into the \fBbacktraceGraph\fP member\(aqs
1470
+ \fBnodes\fP array.
1471
+ .UNINDENT
1472
+ .sp
1473
+ This field was added in codemodel version 2.1.
1474
+ .TP
1475
+ .B \fBdefines\fP
1476
+ Optional member that is present when there are preprocessor definitions.
1477
+ The value is a JSON array with an entry for each definition. Each
1478
+ entry is a JSON object with members:
1479
+ .INDENT 7.0
1480
+ .TP
1481
+ .B \fBdefine\fP
1482
+ A string specifying the preprocessor definition in the format
1483
+ \fB<name>[=<value>]\fP, e.g. \fBDEF\fP or \fBDEF=1\fP\&.
1484
+ .TP
1485
+ .B \fBbacktrace\fP
1486
+ Optional member that is present when a CMake language backtrace to
1487
+ the \X'tty: link #command:target_compile_definitions'\fI\%target_compile_definitions()\fP\X'tty: link' or other command invocation
1488
+ that added this preprocessor definition is available. The value is
1489
+ an unsigned integer 0\-based index into the \fBbacktraceGraph\fP
1490
+ member\(aqs \fBnodes\fP array.
1491
+ .UNINDENT
1492
+ .TP
1493
+ .B \fBsysroot\fP
1494
+ Optional member that is present when the
1495
+ \X'tty: link #variable:CMAKE_SYSROOT_COMPILE'\fI\%CMAKE_SYSROOT_COMPILE\fP\X'tty: link' or \X'tty: link #variable:CMAKE_SYSROOT'\fI\%CMAKE_SYSROOT\fP\X'tty: link'
1496
+ variable is defined. The value is a JSON object with one member:
1497
+ .INDENT 7.0
1498
+ .TP
1499
+ .B \fBpath\fP
1500
+ A string specifying the absolute path to the sysroot, represented
1501
+ with forward slashes.
1502
+ .UNINDENT
1503
+ .UNINDENT
1504
+ .TP
1505
+ .B \fBbacktraceGraph\fP
1506
+ A \fI\%\(dqcodemodel\(dq version 2 \(dqbacktrace graph\(dq\fP whose nodes are referenced
1507
+ from \fBbacktrace\fP members elsewhere in this \(dqtarget\(dq object.
1508
+ .UNINDENT
1509
+ .SS \(dqcodemodel\(dq version 2 \(dqbacktrace graph\(dq
1510
+ .sp
1511
+ The \fBbacktraceGraph\fP member of a \fI\%\(dqcodemodel\(dq version 2 \(dqdirectory\(dq object\fP,
1512
+ or \fI\%\(dqcodemodel\(dq version 2 \(dqtarget\(dq object\fP is a JSON object describing a
1513
+ graph of backtraces. Its nodes are referenced from \fBbacktrace\fP members
1514
+ elsewhere in the containing object. The backtrace graph object members are:
1515
+ .INDENT 0.0
1516
+ .TP
1517
+ .B \fBnodes\fP
1518
+ A JSON array listing nodes in the backtrace graph. Each entry
1519
+ is a JSON object with members:
1520
+ .INDENT 7.0
1521
+ .TP
1522
+ .B \fBfile\fP
1523
+ An unsigned integer 0\-based index into the backtrace \fBfiles\fP array.
1524
+ .TP
1525
+ .B \fBline\fP
1526
+ An optional member present when the node represents a line within
1527
+ the file. The value is an unsigned integer 1\-based line number.
1528
+ .TP
1529
+ .B \fBcommand\fP
1530
+ An optional member present when the node represents a command
1531
+ invocation within the file. The value is an unsigned integer
1532
+ 0\-based index into the backtrace \fBcommands\fP array.
1533
+ .TP
1534
+ .B \fBparent\fP
1535
+ An optional member present when the node is not the bottom of
1536
+ the call stack. The value is an unsigned integer 0\-based index
1537
+ of another entry in the backtrace \fBnodes\fP array.
1538
+ .UNINDENT
1539
+ .TP
1540
+ .B \fBcommands\fP
1541
+ A JSON array listing command names referenced by backtrace nodes.
1542
+ Each entry is a string specifying a command name.
1543
+ .TP
1544
+ .B \fBfiles\fP
1545
+ A JSON array listing CMake language files referenced by backtrace nodes.
1546
+ Each entry is a string specifying the path to a file, represented
1547
+ with forward slashes. If the file is inside the top\-level source
1548
+ directory then the path is specified relative to that directory.
1549
+ Otherwise the path is absolute.
1550
+ .UNINDENT
1551
+ .SS Object Kind \(dqconfigureLog\(dq
1552
+ .sp
1553
+ The \fBconfigureLog\fP object kind describes the location and contents of
1554
+ a \X'tty: link #manual:cmake-configure-log(7)'\fI\%cmake\-configure\-log(7)\fP\X'tty: link' file.
1555
+ .sp
1556
+ There is only one \fBconfigureLog\fP object major version, version 1.
1557
+ .SS \(dqconfigureLog\(dq version 1
1558
+ .sp
1559
+ \fBconfigureLog\fP object version 1 is a JSON object:
1560
+ .INDENT 0.0
1561
+ .INDENT 3.5
1562
+ .sp
1563
+ .nf
1564
+ .ft C
1565
+ {
1566
+ \(dqkind\(dq: \(dqconfigureLog\(dq,
1567
+ \(dqversion\(dq: { \(dqmajor\(dq: 1, \(dqminor\(dq: 0 },
1568
+ \(dqpath\(dq: \(dq/path/to/top\-level\-build\-dir/CMakeFiles/CMakeConfigureLog.yaml\(dq,
1569
+ \(dqeventKindNames\(dq: [ \(dqtry_compile\-v1\(dq, \(dqtry_run\-v1\(dq ]
1570
+ }
1571
+ .ft P
1572
+ .fi
1573
+ .UNINDENT
1574
+ .UNINDENT
1575
+ .sp
1576
+ The members specific to \fBconfigureLog\fP objects are:
1577
+ .INDENT 0.0
1578
+ .TP
1579
+ .B \fBpath\fP
1580
+ A string specifying the path to the configure log file.
1581
+ Clients must read the log file from this path, which may be
1582
+ different than the path documented by \X'tty: link #manual:cmake-configure-log(7)'\fI\%cmake\-configure\-log(7)\fP\X'tty: link'\&.
1583
+ The log file may not exist if no events are logged.
1584
+ .TP
1585
+ .B \fBeventKindNames\fP
1586
+ A JSON array whose entries are each a JSON string naming one
1587
+ of the \X'tty: link #manual:cmake-configure-log(7)'\fI\%cmake\-configure\-log(7)\fP\X'tty: link' versioned event kinds.
1588
+ At most one version of each configure log event kind will be listed.
1589
+ Although the configure log may contain other (versioned) event kinds,
1590
+ clients must ignore those that are not listed in this field.
1591
+ .UNINDENT
1592
+ .SS Object Kind \(dqcache\(dq
1593
+ .sp
1594
+ The \fBcache\fP object kind lists cache entries. These are the
1595
+ \X'tty: link #cmake-language-variables'\fI\%Variables\fP\X'tty: link' stored in the persistent cache
1596
+ (\fBCMakeCache.txt\fP) for the build tree.
1597
+ .sp
1598
+ There is only one \fBcache\fP object major version, version 2.
1599
+ Version 1 does not exist to avoid confusion with that from
1600
+ \X'tty: link #manual:cmake-server(7)'\fI\%cmake\-server(7)\fP\X'tty: link' mode.
1601
+ .SS \(dqcache\(dq version 2
1602
+ .sp
1603
+ \fBcache\fP object version 2 is a JSON object:
1604
+ .INDENT 0.0
1605
+ .INDENT 3.5
1606
+ .sp
1607
+ .nf
1608
+ .ft C
1609
+ {
1610
+ \(dqkind\(dq: \(dqcache\(dq,
1611
+ \(dqversion\(dq: { \(dqmajor\(dq: 2, \(dqminor\(dq: 0 },
1612
+ \(dqentries\(dq: [
1613
+ {
1614
+ \(dqname\(dq: \(dqBUILD_SHARED_LIBS\(dq,
1615
+ \(dqvalue\(dq: \(dqON\(dq,
1616
+ \(dqtype\(dq: \(dqBOOL\(dq,
1617
+ \(dqproperties\(dq: [
1618
+ {
1619
+ \(dqname\(dq: \(dqHELPSTRING\(dq,
1620
+ \(dqvalue\(dq: \(dqBuild shared libraries\(dq
1621
+ }
1622
+ ]
1623
+ },
1624
+ {
1625
+ \(dqname\(dq: \(dqCMAKE_GENERATOR\(dq,
1626
+ \(dqvalue\(dq: \(dqUnix Makefiles\(dq,
1627
+ \(dqtype\(dq: \(dqINTERNAL\(dq,
1628
+ \(dqproperties\(dq: [
1629
+ {
1630
+ \(dqname\(dq: \(dqHELPSTRING\(dq,
1631
+ \(dqvalue\(dq: \(dqName of generator.\(dq
1632
+ }
1633
+ ]
1634
+ }
1635
+ ]
1636
+ }
1637
+ .ft P
1638
+ .fi
1639
+ .UNINDENT
1640
+ .UNINDENT
1641
+ .sp
1642
+ The members specific to \fBcache\fP objects are:
1643
+ .INDENT 0.0
1644
+ .TP
1645
+ .B \fBentries\fP
1646
+ A JSON array whose entries are each a JSON object specifying a
1647
+ cache entry. The members of each entry are:
1648
+ .INDENT 7.0
1649
+ .TP
1650
+ .B \fBname\fP
1651
+ A string specifying the name of the entry.
1652
+ .TP
1653
+ .B \fBvalue\fP
1654
+ A string specifying the value of the entry.
1655
+ .TP
1656
+ .B \fBtype\fP
1657
+ A string specifying the type of the entry used by
1658
+ \X'tty: link #manual:cmake-gui(1)'\fI\%cmake\-gui(1)\fP\X'tty: link' to choose a widget for editing.
1659
+ .TP
1660
+ .B \fBproperties\fP
1661
+ A JSON array of entries specifying associated
1662
+ \X'tty: link #cache-entry-properties'\fI\%cache entry properties\fP\X'tty: link'\&.
1663
+ Each entry is a JSON object containing members:
1664
+ .INDENT 7.0
1665
+ .TP
1666
+ .B \fBname\fP
1667
+ A string specifying the name of the cache entry property.
1668
+ .TP
1669
+ .B \fBvalue\fP
1670
+ A string specifying the value of the cache entry property.
1671
+ .UNINDENT
1672
+ .UNINDENT
1673
+ .UNINDENT
1674
+ .SS Object Kind \(dqcmakeFiles\(dq
1675
+ .sp
1676
+ The \fBcmakeFiles\fP object kind lists files used by CMake while
1677
+ configuring and generating the build system. These include the
1678
+ \fBCMakeLists.txt\fP files as well as included \fB\&.cmake\fP files.
1679
+ .sp
1680
+ There is only one \fBcmakeFiles\fP object major version, version 1.
1681
+ .SS \(dqcmakeFiles\(dq version 1
1682
+ .sp
1683
+ \fBcmakeFiles\fP object version 1 is a JSON object:
1684
+ .INDENT 0.0
1685
+ .INDENT 3.5
1686
+ .sp
1687
+ .nf
1688
+ .ft C
1689
+ {
1690
+ \(dqkind\(dq: \(dqcmakeFiles\(dq,
1691
+ \(dqversion\(dq: { \(dqmajor\(dq: 1, \(dqminor\(dq: 1 },
1692
+ \(dqpaths\(dq: {
1693
+ \(dqbuild\(dq: \(dq/path/to/top\-level\-build\-dir\(dq,
1694
+ \(dqsource\(dq: \(dq/path/to/top\-level\-source\-dir\(dq
1695
+ },
1696
+ \(dqinputs\(dq: [
1697
+ {
1698
+ \(dqpath\(dq: \(dqCMakeLists.txt\(dq
1699
+ },
1700
+ {
1701
+ \(dqisGenerated\(dq: true,
1702
+ \(dqpath\(dq: \(dq/path/to/top\-level\-build\-dir/.../CMakeSystem.cmake\(dq
1703
+ },
1704
+ {
1705
+ \(dqisExternal\(dq: true,
1706
+ \(dqpath\(dq: \(dq/path/to/external/third\-party/module.cmake\(dq
1707
+ },
1708
+ {
1709
+ \(dqisCMake\(dq: true,
1710
+ \(dqisExternal\(dq: true,
1711
+ \(dqpath\(dq: \(dq/path/to/cmake/Modules/CMakeGenericSystem.cmake\(dq
1712
+ }
1713
+ ],
1714
+ \(dqglobsDependent\(dq: [
1715
+ {
1716
+ \(dqexpression\(dq: \(dqsrc/*.cxx\(dq,
1717
+ \(dqrecurse\(dq: true,
1718
+ \(dqfiles\(dq: [
1719
+ \(dqsrc/foo.cxx\(dq,
1720
+ \(dqsrc/bar.cxx\(dq
1721
+ ]
1722
+ }
1723
+ ]
1724
+ }
1725
+ .ft P
1726
+ .fi
1727
+ .UNINDENT
1728
+ .UNINDENT
1729
+ .sp
1730
+ The members specific to \fBcmakeFiles\fP objects are:
1731
+ .INDENT 0.0
1732
+ .TP
1733
+ .B \fBpaths\fP
1734
+ A JSON object containing members:
1735
+ .INDENT 7.0
1736
+ .TP
1737
+ .B \fBsource\fP
1738
+ A string specifying the absolute path to the top\-level source directory,
1739
+ represented with forward slashes.
1740
+ .TP
1741
+ .B \fBbuild\fP
1742
+ A string specifying the absolute path to the top\-level build directory,
1743
+ represented with forward slashes.
1744
+ .UNINDENT
1745
+ .TP
1746
+ .B \fBinputs\fP
1747
+ A JSON array whose entries are each a JSON object specifying an input
1748
+ file used by CMake when configuring and generating the build system.
1749
+ The members of each entry are:
1750
+ .INDENT 7.0
1751
+ .TP
1752
+ .B \fBpath\fP
1753
+ A string specifying the path to an input file to CMake, represented
1754
+ with forward slashes. If the file is inside the top\-level source
1755
+ directory then the path is specified relative to that directory.
1756
+ Otherwise the path is absolute.
1757
+ .TP
1758
+ .B \fBisGenerated\fP
1759
+ Optional member that is present with boolean value \fBtrue\fP
1760
+ if the path specifies a file that is under the top\-level
1761
+ build directory and the build is out\-of\-source.
1762
+ This member is not available on in\-source builds.
1763
+ .TP
1764
+ .B \fBisExternal\fP
1765
+ Optional member that is present with boolean value \fBtrue\fP
1766
+ if the path specifies a file that is not under the top\-level
1767
+ source or build directories.
1768
+ .TP
1769
+ .B \fBisCMake\fP
1770
+ Optional member that is present with boolean value \fBtrue\fP
1771
+ if the path specifies a file in the CMake installation.
1772
+ .UNINDENT
1773
+ .TP
1774
+ .B \fBglobsDependent\fP
1775
+ Optional member that is present when the project calls \X'tty: link #glob'\fI\%file(GLOB)\fP\X'tty: link'
1776
+ or \X'tty: link #glob-recurse'\fI\%file(GLOB_RECURSE)\fP\X'tty: link' with the \fBCONFIGURE_DEPENDS\fP option.
1777
+ The value is a JSON array of JSON objects, each specifying a globbing
1778
+ expression and the list of paths it matched. If the globbing expression
1779
+ no longer matches the same list of paths, CMake considers the build system
1780
+ to be out of date.
1781
+ .sp
1782
+ This field was added in \fBcmakeFiles\fP version 1.1.
1783
+ .sp
1784
+ The members of each entry are:
1785
+ .INDENT 7.0
1786
+ .TP
1787
+ .B \fBexpression\fP
1788
+ A string specifying the globbing expression.
1789
+ .TP
1790
+ .B \fBrecurse\fP
1791
+ Optional member that is present with boolean value \fBtrue\fP
1792
+ if the entry corresponds to a \X'tty: link #glob-recurse'\fI\%file(GLOB_RECURSE)\fP\X'tty: link' call.
1793
+ Otherwise the entry corresponds to a \X'tty: link #glob'\fI\%file(GLOB)\fP\X'tty: link' call.
1794
+ .TP
1795
+ .B \fBlistDirectories\fP
1796
+ Optional member that is present with boolean value \fBtrue\fP if
1797
+ \X'tty: link #glob'\fI\%file(GLOB)\fP\X'tty: link' was called without \fBLIST_DIRECTORIES false\fP or
1798
+ \X'tty: link #glob-recurse'\fI\%file(GLOB_RECURSE)\fP\X'tty: link' was called with \fBLIST_DIRECTORIES true\fP\&.
1799
+ .TP
1800
+ .B \fBfollowSymlinks\fP
1801
+ Optional member that is present with boolean value \fBtrue\fP if
1802
+ \X'tty: link #glob'\fI\%file(GLOB)\fP\X'tty: link' was called with the \fBFOLLOW_SYMLINKS\fP option.
1803
+ .TP
1804
+ .B \fBrelative\fP
1805
+ Optional member that is present if \X'tty: link #glob'\fI\%file(GLOB)\fP\X'tty: link' was called
1806
+ with the \fBRELATIVE <path>\fP option. The value is a string containing
1807
+ the \fB<path>\fP given.
1808
+ .TP
1809
+ .B \fBpaths\fP
1810
+ A JSON array of strings specifying the paths matched by the call
1811
+ to \X'tty: link #glob'\fI\%file(GLOB)\fP\X'tty: link' or \X'tty: link #glob-recurse'\fI\%file(GLOB_RECURSE)\fP\X'tty: link'\&.
1812
+ .UNINDENT
1813
+ .UNINDENT
1814
+ .SS Object Kind \(dqtoolchains\(dq
1815
+ .sp
1816
+ The \fBtoolchains\fP object kind lists properties of the toolchains used during
1817
+ the build. These include the language, compiler path, ID, and version.
1818
+ .sp
1819
+ There is only one \fBtoolchains\fP object major version, version 1.
1820
+ .SS \(dqtoolchains\(dq version 1
1821
+ .sp
1822
+ \fBtoolchains\fP object version 1 is a JSON object:
1823
+ .INDENT 0.0
1824
+ .INDENT 3.5
1825
+ .sp
1826
+ .nf
1827
+ .ft C
1828
+ {
1829
+ \(dqkind\(dq: \(dqtoolchains\(dq,
1830
+ \(dqversion\(dq: { \(dqmajor\(dq: 1, \(dqminor\(dq: 0 },
1831
+ \(dqtoolchains\(dq: [
1832
+ {
1833
+ \(dqlanguage\(dq: \(dqC\(dq,
1834
+ \(dqcompiler\(dq: {
1835
+ \(dqpath\(dq: \(dq/usr/bin/cc\(dq,
1836
+ \(dqid\(dq: \(dqGNU\(dq,
1837
+ \(dqversion\(dq: \(dq9.3.0\(dq,
1838
+ \(dqimplicit\(dq: {
1839
+ \(dqincludeDirectories\(dq: [
1840
+ \(dq/usr/lib/gcc/x86_64\-linux\-gnu/9/include\(dq,
1841
+ \(dq/usr/local/include\(dq,
1842
+ \(dq/usr/include/x86_64\-linux\-gnu\(dq,
1843
+ \(dq/usr/include\(dq
1844
+ ],
1845
+ \(dqlinkDirectories\(dq: [
1846
+ \(dq/usr/lib/gcc/x86_64\-linux\-gnu/9\(dq,
1847
+ \(dq/usr/lib/x86_64\-linux\-gnu\(dq,
1848
+ \(dq/usr/lib\(dq,
1849
+ \(dq/lib/x86_64\-linux\-gnu\(dq,
1850
+ \(dq/lib\(dq
1851
+ ],
1852
+ \(dqlinkFrameworkDirectories\(dq: [],
1853
+ \(dqlinkLibraries\(dq: [ \(dqgcc\(dq, \(dqgcc_s\(dq, \(dqc\(dq, \(dqgcc\(dq, \(dqgcc_s\(dq ]
1854
+ }
1855
+ },
1856
+ \(dqsourceFileExtensions\(dq: [ \(dqc\(dq, \(dqm\(dq ]
1857
+ },
1858
+ {
1859
+ \(dqlanguage\(dq: \(dqCXX\(dq,
1860
+ \(dqcompiler\(dq: {
1861
+ \(dqpath\(dq: \(dq/usr/bin/c++\(dq,
1862
+ \(dqid\(dq: \(dqGNU\(dq,
1863
+ \(dqversion\(dq: \(dq9.3.0\(dq,
1864
+ \(dqimplicit\(dq: {
1865
+ \(dqincludeDirectories\(dq: [
1866
+ \(dq/usr/include/c++/9\(dq,
1867
+ \(dq/usr/include/x86_64\-linux\-gnu/c++/9\(dq,
1868
+ \(dq/usr/include/c++/9/backward\(dq,
1869
+ \(dq/usr/lib/gcc/x86_64\-linux\-gnu/9/include\(dq,
1870
+ \(dq/usr/local/include\(dq,
1871
+ \(dq/usr/include/x86_64\-linux\-gnu\(dq,
1872
+ \(dq/usr/include\(dq
1873
+ ],
1874
+ \(dqlinkDirectories\(dq: [
1875
+ \(dq/usr/lib/gcc/x86_64\-linux\-gnu/9\(dq,
1876
+ \(dq/usr/lib/x86_64\-linux\-gnu\(dq,
1877
+ \(dq/usr/lib\(dq,
1878
+ \(dq/lib/x86_64\-linux\-gnu\(dq,
1879
+ \(dq/lib\(dq
1880
+ ],
1881
+ \(dqlinkFrameworkDirectories\(dq: [],
1882
+ \(dqlinkLibraries\(dq: [
1883
+ \(dqstdc++\(dq, \(dqm\(dq, \(dqgcc_s\(dq, \(dqgcc\(dq, \(dqc\(dq, \(dqgcc_s\(dq, \(dqgcc\(dq
1884
+ ]
1885
+ }
1886
+ },
1887
+ \(dqsourceFileExtensions\(dq: [
1888
+ \(dqC\(dq, \(dqM\(dq, \(dqc++\(dq, \(dqcc\(dq, \(dqcpp\(dq, \(dqcxx\(dq, \(dqmm\(dq, \(dqCPP\(dq
1889
+ ]
1890
+ }
1891
+ ]
1892
+ }
1893
+ .ft P
1894
+ .fi
1895
+ .UNINDENT
1896
+ .UNINDENT
1897
+ .sp
1898
+ The members specific to \fBtoolchains\fP objects are:
1899
+ .INDENT 0.0
1900
+ .TP
1901
+ .B \fBtoolchains\fP
1902
+ A JSON array whose entries are each a JSON object specifying a toolchain
1903
+ associated with a particular language. The members of each entry are:
1904
+ .INDENT 7.0
1905
+ .TP
1906
+ .B \fBlanguage\fP
1907
+ A JSON string specifying the toolchain language, like C or CXX. Language
1908
+ names are the same as language names that can be passed to the
1909
+ \X'tty: link #command:project'\fI\%project()\fP\X'tty: link' command. Because CMake only supports a single toolchain
1910
+ per language, this field can be used as a key.
1911
+ .TP
1912
+ .B \fBcompiler\fP
1913
+ A JSON object containing members:
1914
+ .INDENT 7.0
1915
+ .TP
1916
+ .B \fBpath\fP
1917
+ Optional member that is present when the
1918
+ \X'tty: link #variable:CMAKE_<LANG>_COMPILER'\fI\%CMAKE_<LANG>_COMPILER\fP\X'tty: link' variable is defined for the current
1919
+ language. Its value is a JSON string holding the path to the compiler.
1920
+ .TP
1921
+ .B \fBid\fP
1922
+ Optional member that is present when the
1923
+ \X'tty: link #variable:CMAKE_<LANG>_COMPILER_ID'\fI\%CMAKE_<LANG>_COMPILER_ID\fP\X'tty: link' variable is defined for the current
1924
+ language. Its value is a JSON string holding the ID (GNU, MSVC, etc.) of
1925
+ the compiler.
1926
+ .TP
1927
+ .B \fBversion\fP
1928
+ Optional member that is present when the
1929
+ \X'tty: link #variable:CMAKE_<LANG>_COMPILER_VERSION'\fI\%CMAKE_<LANG>_COMPILER_VERSION\fP\X'tty: link' variable is defined for the
1930
+ current language. Its value is a JSON string holding the version of the
1931
+ compiler.
1932
+ .TP
1933
+ .B \fBtarget\fP
1934
+ Optional member that is present when the
1935
+ \X'tty: link #variable:CMAKE_<LANG>_COMPILER_TARGET'\fI\%CMAKE_<LANG>_COMPILER_TARGET\fP\X'tty: link' variable is defined for the
1936
+ current language. Its value is a JSON string holding the cross\-compiling
1937
+ target of the compiler.
1938
+ .TP
1939
+ .B \fBimplicit\fP
1940
+ A JSON object containing members:
1941
+ .INDENT 7.0
1942
+ .TP
1943
+ .B \fBincludeDirectories\fP
1944
+ Optional member that is present when the
1945
+ \X'tty: link #variable:CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES'\fI\%CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES\fP\X'tty: link' variable is
1946
+ defined for the current language. Its value is a JSON array of JSON
1947
+ strings where each string holds a path to an implicit include
1948
+ directory for the compiler.
1949
+ .TP
1950
+ .B \fBlinkDirectories\fP
1951
+ Optional member that is present when the
1952
+ \X'tty: link #variable:CMAKE_<LANG>_IMPLICIT_LINK_DIRECTORIES'\fI\%CMAKE_<LANG>_IMPLICIT_LINK_DIRECTORIES\fP\X'tty: link' variable is
1953
+ defined for the current language. Its value is a JSON array of JSON
1954
+ strings where each string holds a path to an implicit link directory
1955
+ for the compiler.
1956
+ .TP
1957
+ .B \fBlinkFrameworkDirectories\fP
1958
+ Optional member that is present when the
1959
+ \X'tty: link #variable:CMAKE_<LANG>_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES'\fI\%CMAKE_<LANG>_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES\fP\X'tty: link' variable
1960
+ is defined for the current language. Its value is a JSON array of JSON
1961
+ strings where each string holds a path to an implicit link framework
1962
+ directory for the compiler.
1963
+ .TP
1964
+ .B \fBlinkLibraries\fP
1965
+ Optional member that is present when the
1966
+ \X'tty: link #variable:CMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES'\fI\%CMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES\fP\X'tty: link' variable is defined
1967
+ for the current language. Its value is a JSON array of JSON strings
1968
+ where each string holds a path to an implicit link library for the
1969
+ compiler.
1970
+ .UNINDENT
1971
+ .UNINDENT
1972
+ .TP
1973
+ .B \fBsourceFileExtensions\fP
1974
+ Optional member that is present when the
1975
+ \X'tty: link #variable:CMAKE_<LANG>_SOURCE_FILE_EXTENSIONS'\fI\%CMAKE_<LANG>_SOURCE_FILE_EXTENSIONS\fP\X'tty: link' variable is defined for
1976
+ the current language. Its value is a JSON array of JSON strings where each
1977
+ each string holds a file extension (without the leading dot) for the
1978
+ language.
1979
+ .UNINDENT
1980
+ .UNINDENT
1981
+ .SH COPYRIGHT
1982
+ 2000-2024 Kitware, Inc. and Contributors
1983
+ .\" Generated by docutils manpage writer.
1984
+ .
cmake/man/man7/cmake-generator-expressions.7 ADDED
The diff for this file is too large to render. See raw diff
 
cmake/man/man7/cmake-generators.7 ADDED
@@ -0,0 +1,1188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .\" Man page generated from reStructuredText.
2
+ .
3
+ .
4
+ .nr rst2man-indent-level 0
5
+ .
6
+ .de1 rstReportMargin
7
+ \\$1 \\n[an-margin]
8
+ level \\n[rst2man-indent-level]
9
+ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
10
+ -
11
+ \\n[rst2man-indent0]
12
+ \\n[rst2man-indent1]
13
+ \\n[rst2man-indent2]
14
+ ..
15
+ .de1 INDENT
16
+ .\" .rstReportMargin pre:
17
+ . RS \\$1
18
+ . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
19
+ . nr rst2man-indent-level +1
20
+ .\" .rstReportMargin post:
21
+ ..
22
+ .de UNINDENT
23
+ . RE
24
+ .\" indent \\n[an-margin]
25
+ .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
26
+ .nr rst2man-indent-level -1
27
+ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
28
+ .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
29
+ ..
30
+ .TH "CMAKE-GENERATORS" "7" "Jan 10, 2025" "3.31.4" "CMake"
31
+ .SH NAME
32
+ cmake-generators \- CMake Generators Reference
33
+ .SH INTRODUCTION
34
+ .sp
35
+ A \fICMake Generator\fP is responsible for writing the input files for
36
+ a native build system. Exactly one of the \fI\%CMake Generators\fP must be
37
+ selected for a build tree to determine what native build system is to
38
+ be used. Optionally one of the \fI\%Extra Generators\fP may be selected
39
+ as a variant of some of the \fI\%Command\-Line Build Tool Generators\fP to
40
+ produce project files for an auxiliary IDE.
41
+ .sp
42
+ CMake Generators are platform\-specific so each may be available only
43
+ on certain platforms. The \X'tty: link #manual:cmake(1)'\fI\%cmake(1)\fP\X'tty: link' command\-line tool
44
+ \X'tty: link #cmdoption-cmake-h'\fI\%\-\-help\fP\X'tty: link' output lists available generators on the
45
+ current platform. Use its \X'tty: link #cmdoption-cmake-G'\fI\%\-G\fP\X'tty: link' option to specify the
46
+ generator for a new build tree. The \X'tty: link #manual:cmake-gui(1)'\fI\%cmake\-gui(1)\fP\X'tty: link' offers
47
+ interactive selection of a generator when creating a new build tree.
48
+ .SH CMAKE GENERATORS
49
+ .SS Command\-Line Build Tool Generators
50
+ .sp
51
+ These generators support command\-line build tools. In order to use them,
52
+ one must launch CMake from a command\-line prompt whose environment is
53
+ already configured for the chosen compiler and build tool.
54
+ .SS Makefile Generators
55
+ .SS Borland Makefiles
56
+ .sp
57
+ Generates Borland makefiles.
58
+ .SS MSYS Makefiles
59
+ .sp
60
+ Generates makefiles for use with MSYS (Minimal SYStem)
61
+ \fBmake\fP under the MSYS shell.
62
+ .sp
63
+ Use this generator in a MSYS shell prompt and using \fBmake\fP as the build
64
+ tool. The generated makefiles use \fB/bin/sh\fP as the shell to launch build
65
+ rules. They are not compatible with a Windows command prompt.
66
+ .sp
67
+ To build under a Windows command prompt, use the
68
+ \X'tty: link #generator:MinGW Makefiles'\fI\%MinGW Makefiles\fP\X'tty: link' generator.
69
+ .SS MinGW Makefiles
70
+ .sp
71
+ Generates makefiles for use with \fBmingw32\-make\fP under a Windows command
72
+ prompt.
73
+ .sp
74
+ Use this generator under a Windows command prompt with
75
+ MinGW (Minimalist GNU for Windows) in the \fBPATH\fP
76
+ and using \fBmingw32\-make\fP as the build tool. The generated makefiles use
77
+ \fBcmd.exe\fP as the shell to launch build rules. They are not compatible with
78
+ MSYS or a unix shell.
79
+ .sp
80
+ To build under the MSYS shell, use the \X'tty: link #generator:MSYS Makefiles'\fI\%MSYS Makefiles\fP\X'tty: link' generator.
81
+ .SS NMake Makefiles
82
+ .sp
83
+ Generates NMake makefiles.
84
+ .SS NMake Makefiles JOM
85
+ .sp
86
+ Generates JOM makefiles.
87
+ .sp
88
+ Added in version 3.8: \X'tty: link #generator:CodeBlocks'\fI\%CodeBlocks\fP\X'tty: link' generator can be used as an extra generator.
89
+
90
+ .SS Unix Makefiles
91
+ .sp
92
+ Generates standard UNIX makefiles.
93
+ .sp
94
+ A hierarchy of UNIX makefiles is generated into the build tree. Use
95
+ any standard UNIX\-style make program to build the project through
96
+ the \fBall\fP target and install the project through the \fBinstall\fP
97
+ (or \fBinstall/strip\fP) target.
98
+ .sp
99
+ For each subdirectory \fBsub/dir\fP of the project a UNIX makefile will
100
+ be created, containing the following targets:
101
+ .INDENT 0.0
102
+ .TP
103
+ .B \fBall\fP
104
+ Depends on all targets required by the subdirectory.
105
+ .TP
106
+ .B \fBinstall\fP
107
+ Runs the install step in the subdirectory, if any.
108
+ .TP
109
+ .B \fBinstall/strip\fP
110
+ Runs the install step in the subdirectory followed by a \fBCMAKE_STRIP\fP command,
111
+ if any.
112
+ .sp
113
+ The \fBCMAKE_STRIP\fP variable will contain the platform\(aqs \fBstrip\fP utility, which
114
+ removes symbols information from generated binaries.
115
+ .TP
116
+ .B \fBtest\fP
117
+ Runs the test step in the subdirectory, if any.
118
+ .TP
119
+ .B \fBpackage\fP
120
+ Runs the package step in the subdirectory, if any.
121
+ .UNINDENT
122
+ .SS Watcom WMake
123
+ .sp
124
+ Generates Watcom WMake makefiles.
125
+ .SS Ninja Generators
126
+ .SS Ninja
127
+ .sp
128
+ Generates a \fBbuild.ninja\fP file into the build tree.
129
+ .SS Builtin Targets
130
+ .sp
131
+ \fBall\fP
132
+ .INDENT 0.0
133
+ .INDENT 3.5
134
+ Depends on all targets required by the project, except those with
135
+ \X'tty: link #prop_tgt:EXCLUDE_FROM_ALL'\fI\%EXCLUDE_FROM_ALL\fP\X'tty: link' set to true.
136
+ .UNINDENT
137
+ .UNINDENT
138
+ .sp
139
+ \fBinstall\fP
140
+ .INDENT 0.0
141
+ .INDENT 3.5
142
+ Runs the install step.
143
+ .UNINDENT
144
+ .UNINDENT
145
+ .sp
146
+ \fBinstall/strip\fP
147
+ .INDENT 0.0
148
+ .INDENT 3.5
149
+ Added in version 3.7: Runs the install followed by a \fBCMAKE_STRIP\fP command, if any.
150
+ .sp
151
+ The \fBCMAKE_STRIP\fP variable will contain the platform\(aqs \fBstrip\fP utility, which
152
+ removes symbols information from generated binaries.
153
+
154
+ .UNINDENT
155
+ .UNINDENT
156
+ .sp
157
+ \fBinstall/parallel\fP
158
+ .INDENT 0.0
159
+ .INDENT 3.5
160
+ Added in version 3.30: Created only if the \X'tty: link #prop_gbl:INSTALL_PARALLEL'\fI\%INSTALL_PARALLEL\fP\X'tty: link' global property is \fBON\fP\&.
161
+ Runs the install step for each subdirectory independently and in parallel.
162
+
163
+ .UNINDENT
164
+ .UNINDENT
165
+ .sp
166
+ For each subdirectory \fBsub/dir\fP of the project, additional targets
167
+ are generated:
168
+ .sp
169
+ \fBsub/dir/all\fP
170
+ .INDENT 0.0
171
+ .INDENT 3.5
172
+ Added in version 3.6: Depends on all targets required by the subdirectory.
173
+
174
+ .UNINDENT
175
+ .UNINDENT
176
+ .sp
177
+ \fBsub/dir/install\fP
178
+ .INDENT 0.0
179
+ .INDENT 3.5
180
+ Added in version 3.7: Runs the install step in the subdirectory, if any.
181
+
182
+ .UNINDENT
183
+ .UNINDENT
184
+ .sp
185
+ \fBsub/dir/install/strip\fP
186
+ .INDENT 0.0
187
+ .INDENT 3.5
188
+ Added in version 3.7: Runs the install step in the subdirectory followed by a \fBCMAKE_STRIP\fP command,
189
+ if any.
190
+
191
+ .UNINDENT
192
+ .UNINDENT
193
+ .sp
194
+ \fBsub/dir/test\fP
195
+ .INDENT 0.0
196
+ .INDENT 3.5
197
+ Added in version 3.7: Runs the test step in the subdirectory, if any.
198
+
199
+ .UNINDENT
200
+ .UNINDENT
201
+ .sp
202
+ \fBsub/dir/package\fP
203
+ .INDENT 0.0
204
+ .INDENT 3.5
205
+ Added in version 3.7: Runs the package step in the subdirectory, if any.
206
+
207
+ .UNINDENT
208
+ .UNINDENT
209
+ .SS Fortran Support
210
+ .sp
211
+ Added in version 3.7.
212
+
213
+ .sp
214
+ The \fBNinja\fP generator conditionally supports Fortran when the \fBninja\fP
215
+ tool is at least version 1.10 (which has the required features).
216
+ .SS Swift Support
217
+ .sp
218
+ Added in version 3.15.
219
+
220
+ .sp
221
+ The Swift support is experimental, not considered stable, and may change
222
+ in future releases of CMake.
223
+ .SS See Also
224
+ .sp
225
+ Added in version 3.17: The \X'tty: link #generator:Ninja Multi-Config'\fI\%Ninja Multi\-Config\fP\X'tty: link' generator is similar to the \fBNinja\fP
226
+ generator, but generates multiple configurations at once.
227
+
228
+ .SS Ninja Multi\-Config
229
+ .sp
230
+ Added in version 3.17.
231
+
232
+ .sp
233
+ Generates multiple \fBbuild\-<Config>.ninja\fP files.
234
+ .sp
235
+ This generator is very much like the \X'tty: link #generator:Ninja'\fI\%Ninja\fP\X'tty: link' generator, but with
236
+ some key differences. Only these differences will be discussed in this
237
+ document.
238
+ .sp
239
+ Unlike the \X'tty: link #generator:Ninja'\fI\%Ninja\fP\X'tty: link' generator, \fBNinja Multi\-Config\fP generates
240
+ multiple configurations at once with \X'tty: link #variable:CMAKE_CONFIGURATION_TYPES'\fI\%CMAKE_CONFIGURATION_TYPES\fP\X'tty: link'
241
+ instead of only one configuration with \X'tty: link #variable:CMAKE_BUILD_TYPE'\fI\%CMAKE_BUILD_TYPE\fP\X'tty: link'\&. One
242
+ \fBbuild\-<Config>.ninja\fP file will be generated for each of these
243
+ configurations (with \fB<Config>\fP being the configuration name.) These files
244
+ are intended to be run with \fBninja \-f build\-<Config>.ninja\fP\&. A
245
+ \fBbuild.ninja\fP file is also generated, using the configuration from either
246
+ \X'tty: link #variable:CMAKE_DEFAULT_BUILD_TYPE'\fI\%CMAKE_DEFAULT_BUILD_TYPE\fP\X'tty: link' or the first item from
247
+ \X'tty: link #variable:CMAKE_CONFIGURATION_TYPES'\fI\%CMAKE_CONFIGURATION_TYPES\fP\X'tty: link'\&.
248
+ .sp
249
+ \fBcmake \-\-build . \-\-config <Config>\fP will always use \fBbuild\-<Config>.ninja\fP
250
+ to build. If no \X'tty: link #cmdoption-cmake-build-config'\fI\%\-\-config\fP\X'tty: link' argument is
251
+ specified, \X'tty: link #cmdoption-cmake-build'\fI\%cmake \-\-build .\fP\X'tty: link' will use \fBbuild.ninja\fP\&.
252
+ .sp
253
+ Each \fBbuild\-<Config>.ninja\fP file contains \fB<target>\fP targets as well as
254
+ \fB<target>:<Config>\fP targets, where \fB<Config>\fP is the same as the
255
+ configuration specified in \fBbuild\-<Config>.ninja\fP Additionally, if
256
+ cross\-config mode is enabled, \fBbuild\-<Config>.ninja\fP may contain
257
+ \fB<target>:<OtherConfig>\fP targets, where \fB<OtherConfig>\fP is a cross\-config,
258
+ as well as \fB<target>:all\fP, which builds the target in all cross\-configs. See
259
+ below for how to enable cross\-config mode.
260
+ .sp
261
+ The \fBNinja Multi\-Config\fP generator recognizes the following variables:
262
+ .INDENT 0.0
263
+ .TP
264
+ .B \X'tty: link #variable:CMAKE_CONFIGURATION_TYPES'\fI\%CMAKE_CONFIGURATION_TYPES\fP\X'tty: link'
265
+ Specifies the total set of configurations to build. Unlike with other
266
+ multi\-config generators, this variable has a value of
267
+ \fBDebug;Release;RelWithDebInfo\fP by default.
268
+ .TP
269
+ .B \X'tty: link #variable:CMAKE_CROSS_CONFIGS'\fI\%CMAKE_CROSS_CONFIGS\fP\X'tty: link'
270
+ Specifies a \X'tty: link #cmake-language-lists'\fI\%semicolon\-separated list\fP\X'tty: link' of
271
+ configurations available from all \fBbuild\-<Config>.ninja\fP files.
272
+ .TP
273
+ .B \X'tty: link #variable:CMAKE_DEFAULT_BUILD_TYPE'\fI\%CMAKE_DEFAULT_BUILD_TYPE\fP\X'tty: link'
274
+ Specifies the configuration to use by default in a \fBbuild.ninja\fP file.
275
+ .TP
276
+ .B \X'tty: link #variable:CMAKE_DEFAULT_CONFIGS'\fI\%CMAKE_DEFAULT_CONFIGS\fP\X'tty: link'
277
+ Specifies a \X'tty: link #cmake-language-lists'\fI\%semicolon\-separated list\fP\X'tty: link' of
278
+ configurations to build for a target in \fBbuild.ninja\fP
279
+ if no \fB:<Config>\fP suffix is specified.
280
+ .UNINDENT
281
+ .sp
282
+ Consider the following example:
283
+ .INDENT 0.0
284
+ .INDENT 3.5
285
+ .sp
286
+ .nf
287
+ .ft C
288
+ cmake_minimum_required(VERSION 3.16)
289
+ project(MultiConfigNinja C)
290
+
291
+ add_executable(generator generator.c)
292
+ add_custom_command(OUTPUT generated.c COMMAND generator generated.c)
293
+ add_library(generated ${CMAKE_BINARY_DIR}/generated.c)
294
+ .ft P
295
+ .fi
296
+ .UNINDENT
297
+ .UNINDENT
298
+ .sp
299
+ Now assume you configure the project with \fBNinja Multi\-Config\fP and run one of
300
+ the following commands:
301
+ .INDENT 0.0
302
+ .INDENT 3.5
303
+ .sp
304
+ .nf
305
+ .ft C
306
+ ninja \-f build\-Debug.ninja generated
307
+ # OR
308
+ cmake \-\-build . \-\-config Debug \-\-target generated
309
+ .ft P
310
+ .fi
311
+ .UNINDENT
312
+ .UNINDENT
313
+ .sp
314
+ This would build the \fBDebug\fP configuration of \fBgenerator\fP, which would be
315
+ used to generate \fBgenerated.c\fP, which would be used to build the \fBDebug\fP
316
+ configuration of \fBgenerated\fP\&.
317
+ .sp
318
+ But if \X'tty: link #variable:CMAKE_CROSS_CONFIGS'\fI\%CMAKE_CROSS_CONFIGS\fP\X'tty: link' is set to \fBall\fP, and you run the
319
+ following instead:
320
+ .INDENT 0.0
321
+ .INDENT 3.5
322
+ .sp
323
+ .nf
324
+ .ft C
325
+ ninja \-f build\-Release.ninja generated:Debug
326
+ # OR
327
+ cmake \-\-build . \-\-config Release \-\-target generated:Debug
328
+ .ft P
329
+ .fi
330
+ .UNINDENT
331
+ .UNINDENT
332
+ .sp
333
+ This would build the \fBRelease\fP configuration of \fBgenerator\fP, which would be
334
+ used to generate \fBgenerated.c\fP, which would be used to build the \fBDebug\fP
335
+ configuration of \fBgenerated\fP\&. This is useful for running a release\-optimized
336
+ version of a generator utility while still building the debug version of the
337
+ targets built with the generated code.
338
+ .SS Custom Commands
339
+ .sp
340
+ Added in version 3.20.
341
+
342
+ .sp
343
+ The \fBNinja Multi\-Config\fP generator adds extra capabilities to
344
+ \X'tty: link #command:add_custom_command'\fI\%add_custom_command()\fP\X'tty: link' and \X'tty: link #command:add_custom_target'\fI\%add_custom_target()\fP\X'tty: link' through its
345
+ cross\-config mode. The \fBCOMMAND\fP, \fBDEPENDS\fP, and \fBWORKING_DIRECTORY\fP
346
+ arguments can be evaluated in the context of either the \(dqcommand config\(dq (the
347
+ \(dqnative\(dq configuration of the \fBbuild\-<Config>.ninja\fP file in use) or the
348
+ \(dqoutput config\(dq (the configuration used to evaluate the \fBOUTPUT\fP and
349
+ \fBBYPRODUCTS\fP).
350
+ .sp
351
+ If either \fBOUTPUT\fP or \fBBYPRODUCTS\fP names a path that is common to
352
+ more than one configuration (e.g. it does not use any generator expressions),
353
+ all arguments are evaluated in the command config by default.
354
+ If all \fBOUTPUT\fP and \fBBYPRODUCTS\fP paths are unique to each configuration
355
+ (e.g. by using the \X'tty: link #genex:CONFIG'\fI\%$<CONFIG>\fP\X'tty: link' generator expression), the first argument of
356
+ \fBCOMMAND\fP is still evaluated in the command config by default, while all
357
+ subsequent arguments, as well as the arguments to \fBDEPENDS\fP and
358
+ \fBWORKING_DIRECTORY\fP, are evaluated in the output config. These defaults can
359
+ be overridden with the \X'tty: link #genex:OUTPUT_CONFIG'\fI\%$<OUTPUT_CONFIG:...>\fP\X'tty: link' and \X'tty: link #genex:COMMAND_CONFIG'\fI\%$<COMMAND_CONFIG:...>\fP\X'tty: link'
360
+ generator\-expressions. Note that if a target is specified by its name in
361
+ \fBDEPENDS\fP, or as the first argument of \fBCOMMAND\fP, it is always evaluated
362
+ in the command config, even if it is wrapped in \X'tty: link #genex:OUTPUT_CONFIG'\fI\%$<OUTPUT_CONFIG:...>\fP\X'tty: link'
363
+ (because its plain name is not a generator expression).
364
+ .sp
365
+ As an example, consider the following:
366
+ .INDENT 0.0
367
+ .INDENT 3.5
368
+ .sp
369
+ .nf
370
+ .ft C
371
+ add_custom_command(
372
+ OUTPUT \(dq$<CONFIG>.txt\(dq
373
+ COMMAND
374
+ generator \(dq$<CONFIG>.txt\(dq
375
+ \(dq$<OUTPUT_CONFIG:$<CONFIG>>\(dq
376
+ \(dq$<COMMAND_CONFIG:$<CONFIG>>\(dq
377
+ DEPENDS
378
+ tgt1
379
+ \(dq$<TARGET_FILE:tgt2>\(dq
380
+ \(dq$<OUTPUT_CONFIG:$<TARGET_FILE:tgt3>>\(dq
381
+ \(dq$<COMMAND_CONFIG:$<TARGET_FILE:tgt4>>\(dq
382
+ )
383
+ .ft P
384
+ .fi
385
+ .UNINDENT
386
+ .UNINDENT
387
+ .sp
388
+ Assume that \fBgenerator\fP, \fBtgt1\fP, \fBtgt2\fP, \fBtgt3\fP, and \fBtgt4\fP are all
389
+ executable targets, and assume that \fB$<CONFIG>.txt\fP is built in the \fBDebug\fP
390
+ output config using the \fBRelease\fP command config. The \fBRelease\fP build of
391
+ the \fBgenerator\fP target is called with \fBDebug.txt Debug Release\fP as
392
+ arguments. The command depends on the \fBRelease\fP builds of \fBtgt1\fP and
393
+ \fBtgt4\fP, and the \fBDebug\fP builds of \fBtgt2\fP and \fBtgt3\fP\&.
394
+ .sp
395
+ \fBPRE_BUILD\fP, \fBPRE_LINK\fP, and \fBPOST_BUILD\fP custom commands for targets
396
+ only get run in their \(dqnative\(dq configuration (the \fBRelease\fP configuration in
397
+ the \fBbuild\-Release.ninja\fP file) unless they have no \fBBYPRODUCTS\fP or their
398
+ \fBBYPRODUCTS\fP are unique per config. Consider the following example:
399
+ .INDENT 0.0
400
+ .INDENT 3.5
401
+ .sp
402
+ .nf
403
+ .ft C
404
+ add_executable(exe main.c)
405
+ add_custom_command(
406
+ TARGET exe
407
+ POST_BUILD
408
+ COMMAND
409
+ ${CMAKE_COMMAND} \-E echo \(dqRunning no\-byproduct command\(dq
410
+ )
411
+ add_custom_command(
412
+ TARGET exe
413
+ POST_BUILD
414
+ COMMAND
415
+ ${CMAKE_COMMAND} \-E echo
416
+ \(dqRunning separate\-byproduct command for $<CONFIG>\(dq
417
+ BYPRODUCTS $<CONFIG>.txt
418
+ )
419
+ add_custom_command(
420
+ TARGET exe
421
+ POST_BUILD
422
+ COMMAND
423
+ ${CMAKE_COMMAND} \-E echo
424
+ \(dqRunning common\-byproduct command for $<CONFIG>\(dq
425
+ BYPRODUCTS exe.txt
426
+ )
427
+ .ft P
428
+ .fi
429
+ .UNINDENT
430
+ .UNINDENT
431
+ .sp
432
+ In this example, if you build \fBexe:Debug\fP in \fBbuild\-Release.ninja\fP, the
433
+ first and second custom commands get run, since their byproducts are unique
434
+ per\-config, but the last custom command does not. However, if you build
435
+ \fBexe:Release\fP in \fBbuild\-Release.ninja\fP, all three custom commands get run.
436
+ .SS IDE Build Tool Generators
437
+ .sp
438
+ These generators support Integrated Development Environment (IDE)
439
+ project files. Since the IDEs configure their own environment
440
+ one may launch CMake from any environment.
441
+ .SS Visual Studio Generators
442
+ .SS Visual Studio 6
443
+ .sp
444
+ Removed. This once generated Visual Studio 6 project files, but the
445
+ generator has been removed since CMake 3.6. It is still possible to
446
+ build with VS 6 tools using the \X'tty: link #generator:NMake Makefiles'\fI\%NMake Makefiles\fP\X'tty: link' generator.
447
+ .SS Visual Studio 7
448
+ .sp
449
+ Removed. This once generated Visual Studio .NET 2002 project files, but
450
+ the generator has been removed since CMake 3.6. It is still possible to
451
+ build with VS 7.0 tools using the \X'tty: link #generator:NMake Makefiles'\fI\%NMake Makefiles\fP\X'tty: link' generator.
452
+ .SS Visual Studio 7 .NET 2003
453
+ .sp
454
+ Removed. This once generated Visual Studio .NET 2003 project files, but
455
+ the generator has been removed since CMake 3.9. It is still possible to
456
+ build with VS 7.1 tools using the \X'tty: link #generator:NMake Makefiles'\fI\%NMake Makefiles\fP\X'tty: link' generator.
457
+ .SS Visual Studio 8 2005
458
+ .sp
459
+ Removed. This once generated Visual Studio 8 2005 project files, but
460
+ the generator has been removed since CMake 3.12. It is still possible to
461
+ build with VS 2005 tools using the \X'tty: link #generator:NMake Makefiles'\fI\%NMake Makefiles\fP\X'tty: link' generator.
462
+ .SS Visual Studio 9 2008
463
+ .sp
464
+ Removed. This once generated Visual Studio 9 2008 project files, but
465
+ the generator has been removed since CMake 3.30. It is still possible
466
+ to build with the VS 9 2008 toolset by also installing VS 10 2010 and
467
+ VS 2015 (or above) and using the \X'tty: link #generator:Visual Studio 14 2015'\fI\%Visual Studio 14 2015\fP\X'tty: link'
468
+ generator (or above) with \X'tty: link #variable:CMAKE_GENERATOR_TOOLSET'\fI\%CMAKE_GENERATOR_TOOLSET\fP\X'tty: link' set to \fBv90\fP,
469
+ or by using the \X'tty: link #generator:NMake Makefiles'\fI\%NMake Makefiles\fP\X'tty: link' generator.
470
+ .SS Visual Studio 10 2010
471
+ .sp
472
+ Removed. This once generated Visual Studio 10 2010 project files, but
473
+ the generator has been removed since CMake 3.25. It is still possible
474
+ to build with the VS 10 2010 toolset by also installing VS 2015 (or above)
475
+ and using the \X'tty: link #generator:Visual Studio 14 2015'\fI\%Visual Studio 14 2015\fP\X'tty: link' (or above) generator with
476
+ \X'tty: link #variable:CMAKE_GENERATOR_TOOLSET'\fI\%CMAKE_GENERATOR_TOOLSET\fP\X'tty: link' set to \fBv100\fP,
477
+ or by using the \X'tty: link #generator:NMake Makefiles'\fI\%NMake Makefiles\fP\X'tty: link' generator.
478
+ .SS Visual Studio 11 2012
479
+ .sp
480
+ Removed. This once generated Visual Studio 11 2012 project files, but
481
+ the generator has been removed since CMake 3.28. It is still possible
482
+ to build with the VS 11 2012 toolset by also installing VS 2015 (or above)
483
+ and using the \X'tty: link #generator:Visual Studio 14 2015'\fI\%Visual Studio 14 2015\fP\X'tty: link' (or above) generator with
484
+ \X'tty: link #variable:CMAKE_GENERATOR_TOOLSET'\fI\%CMAKE_GENERATOR_TOOLSET\fP\X'tty: link' set to \fBv110\fP,
485
+ or by using the \X'tty: link #generator:NMake Makefiles'\fI\%NMake Makefiles\fP\X'tty: link' generator.
486
+ .SS Visual Studio 12 2013
487
+ .sp
488
+ Removed. This once generated Visual Studio 12 2013 project files, but
489
+ the generator has been removed since CMake 3.31. It is still possible
490
+ to build with the VS 12 2013 toolset by also installing VS 2015 (or above)
491
+ and using the \X'tty: link #generator:Visual Studio 14 2015'\fI\%Visual Studio 14 2015\fP\X'tty: link' (or above) generator with
492
+ \X'tty: link #variable:CMAKE_GENERATOR_TOOLSET'\fI\%CMAKE_GENERATOR_TOOLSET\fP\X'tty: link' set to \fBv120\fP,
493
+ or by using the \X'tty: link #generator:NMake Makefiles'\fI\%NMake Makefiles\fP\X'tty: link' generator.
494
+ .SS Visual Studio 14 2015
495
+ .sp
496
+ Added in version 3.1.
497
+
498
+ .sp
499
+ Generates Visual Studio 14 (VS 2015) project files.
500
+ .SS Project Types
501
+ .sp
502
+ Only Visual C++ and C# projects may be generated (and Fortran with
503
+ Intel compiler integration). Other types of projects (JavaScript,
504
+ Powershell, Python, etc.) are not supported.
505
+ .SS Platform Selection
506
+ .sp
507
+ The default target platform name (architecture) is \fBWin32\fP\&.
508
+ .sp
509
+ The \X'tty: link #variable:CMAKE_GENERATOR_PLATFORM'\fI\%CMAKE_GENERATOR_PLATFORM\fP\X'tty: link' variable may be set, perhaps
510
+ via the \X'tty: link #cmdoption-cmake-A'\fI\%cmake \-A\fP\X'tty: link' option, to specify a target platform
511
+ name (architecture). For example:
512
+ .INDENT 0.0
513
+ .IP \(bu 2
514
+ \fBcmake \-G \(dqVisual Studio 14 2015\(dq \-A Win32\fP
515
+ .IP \(bu 2
516
+ \fBcmake \-G \(dqVisual Studio 14 2015\(dq \-A x64\fP
517
+ .IP \(bu 2
518
+ \fBcmake \-G \(dqVisual Studio 14 2015\(dq \-A ARM\fP
519
+ .UNINDENT
520
+ .sp
521
+ For compatibility with CMake versions prior to 3.1, one may specify
522
+ a target platform name optionally at the end of the generator name.
523
+ This is supported only for:
524
+ .INDENT 0.0
525
+ .TP
526
+ .B \fBVisual Studio 14 2015 Win64\fP
527
+ Specify target platform \fBx64\fP\&.
528
+ .TP
529
+ .B \fBVisual Studio 14 2015 ARM\fP
530
+ Specify target platform \fBARM\fP\&.
531
+ .UNINDENT
532
+ .SS Toolset Selection
533
+ .sp
534
+ The \fBv140\fP toolset that comes with Visual Studio 14 2015 is selected by
535
+ default. The \X'tty: link #variable:CMAKE_GENERATOR_TOOLSET'\fI\%CMAKE_GENERATOR_TOOLSET\fP\X'tty: link' option may be set, perhaps
536
+ via the \X'tty: link #cmdoption-cmake-T'\fI\%cmake \-T\fP\X'tty: link' option, to specify another toolset.
537
+ .sp
538
+ Added in version 3.8: For each toolset that comes with this version of Visual Studio, there are
539
+ variants that are themselves compiled for 32\-bit (\fBx86\fP) and
540
+ 64\-bit (\fBx64\fP) hosts (independent of the architecture they target).
541
+ By default this generator uses the 32\-bit variant even on a 64\-bit host.
542
+ One may explicitly request use of either the 32\-bit or 64\-bit host tools
543
+ by adding either \fBhost=x86\fP or \fBhost=x64\fP to the toolset specification.
544
+ See the \X'tty: link #variable:CMAKE_GENERATOR_TOOLSET'\fI\%CMAKE_GENERATOR_TOOLSET\fP\X'tty: link' variable for details.
545
+
546
+ .sp
547
+ Added in version 3.14: Added support for \fBhost=x86\fP option.
548
+
549
+ .SS Windows 10 SDK Maximum Version for VS 2015
550
+ .sp
551
+ Added in version 3.19.
552
+
553
+ .sp
554
+ Microsoft stated in a \(dqWindows 10 October 2018 Update\(dq blog post that Windows
555
+ 10 SDK versions (15063, 16299, 17134, 17763) are not supported by VS 2015 and
556
+ are only supported by VS 2017 and later. Therefore by default CMake
557
+ automatically ignores Windows 10 SDKs beyond \fB10.0.14393.0\fP\&.
558
+ .sp
559
+ However, there are other recommendations for certain driver/Win32 builds that
560
+ indicate otherwise. A user can override this behavior by either setting the
561
+ \X'tty: link #variable:CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM'\fI\%CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM\fP\X'tty: link' to a false value
562
+ or setting the \X'tty: link #variable:CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM'\fI\%CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM\fP\X'tty: link' to
563
+ the string value of the required maximum (e.g. \fB10.0.15063.0\fP).
564
+ .SS Visual Studio 15 2017
565
+ .sp
566
+ Added in version 3.7.1.
567
+
568
+ .sp
569
+ Generates Visual Studio 15 (VS 2017) project files.
570
+ .SS Project Types
571
+ .sp
572
+ Only Visual C++ and C# projects may be generated (and Fortran with
573
+ Intel compiler integration). Other types of projects (JavaScript,
574
+ Powershell, Python, etc.) are not supported.
575
+ .SS Instance Selection
576
+ .sp
577
+ Added in version 3.11.
578
+
579
+ .sp
580
+ VS 2017 supports multiple installations on the same machine. The
581
+ \X'tty: link #variable:CMAKE_GENERATOR_INSTANCE'\fI\%CMAKE_GENERATOR_INSTANCE\fP\X'tty: link' variable may be used to select one.
582
+ .SS Platform Selection
583
+ .sp
584
+ The default target platform name (architecture) is \fBWin32\fP\&.
585
+ .sp
586
+ The \X'tty: link #variable:CMAKE_GENERATOR_PLATFORM'\fI\%CMAKE_GENERATOR_PLATFORM\fP\X'tty: link' variable may be set, perhaps
587
+ via the \X'tty: link #cmdoption-cmake-A'\fI\%cmake \-A\fP\X'tty: link' option, to specify a target platform
588
+ name (architecture). For example:
589
+ .INDENT 0.0
590
+ .IP \(bu 2
591
+ \fBcmake \-G \(dqVisual Studio 15 2017\(dq \-A Win32\fP
592
+ .IP \(bu 2
593
+ \fBcmake \-G \(dqVisual Studio 15 2017\(dq \-A x64\fP
594
+ .IP \(bu 2
595
+ \fBcmake \-G \(dqVisual Studio 15 2017\(dq \-A ARM\fP
596
+ .IP \(bu 2
597
+ \fBcmake \-G \(dqVisual Studio 15 2017\(dq \-A ARM64\fP
598
+ .UNINDENT
599
+ .sp
600
+ For compatibility with CMake versions prior to 3.1, one may specify
601
+ a target platform name optionally at the end of the generator name.
602
+ This is supported only for:
603
+ .INDENT 0.0
604
+ .TP
605
+ .B \fBVisual Studio 15 2017 Win64\fP
606
+ Specify target platform \fBx64\fP\&.
607
+ .TP
608
+ .B \fBVisual Studio 15 2017 ARM\fP
609
+ Specify target platform \fBARM\fP\&.
610
+ .UNINDENT
611
+ .SS Toolset Selection
612
+ .sp
613
+ The \fBv141\fP toolset that comes with Visual Studio 15 2017 is selected by
614
+ default. The \X'tty: link #variable:CMAKE_GENERATOR_TOOLSET'\fI\%CMAKE_GENERATOR_TOOLSET\fP\X'tty: link' option may be set, perhaps
615
+ via the \X'tty: link #cmdoption-cmake-T'\fI\%cmake \-T\fP\X'tty: link' option, to specify another toolset.
616
+ .sp
617
+ Added in version 3.8: For each toolset that comes with this version of Visual Studio, there are
618
+ variants that are themselves compiled for 32\-bit (\fBx86\fP) and
619
+ 64\-bit (\fBx64\fP) hosts (independent of the architecture they target).
620
+ By default this generator uses the 32\-bit variant even on a 64\-bit host.
621
+ One may explicitly request use of either the 32\-bit or 64\-bit host tools
622
+ by adding either \fBhost=x86\fP or \fBhost=x64\fP to the toolset specification.
623
+ See the \X'tty: link #variable:CMAKE_GENERATOR_TOOLSET'\fI\%CMAKE_GENERATOR_TOOLSET\fP\X'tty: link' variable for details.
624
+
625
+ .sp
626
+ Added in version 3.14: Added support for \fBhost=x86\fP option.
627
+
628
+ .SS Visual Studio 16 2019
629
+ .sp
630
+ Added in version 3.14.
631
+
632
+ .sp
633
+ Generates Visual Studio 16 (VS 2019) project files.
634
+ .SS Project Types
635
+ .sp
636
+ Only Visual C++ and C# projects may be generated (and Fortran with
637
+ Intel compiler integration). Other types of projects (JavaScript,
638
+ Powershell, Python, etc.) are not supported.
639
+ .SS Instance Selection
640
+ .sp
641
+ VS 2019 supports multiple installations on the same machine. The
642
+ \X'tty: link #variable:CMAKE_GENERATOR_INSTANCE'\fI\%CMAKE_GENERATOR_INSTANCE\fP\X'tty: link' variable may be used to select one.
643
+ .SS Platform Selection
644
+ .sp
645
+ The default target platform name (architecture) is that of the host
646
+ and is provided in the \X'tty: link #variable:CMAKE_VS_PLATFORM_NAME_DEFAULT'\fI\%CMAKE_VS_PLATFORM_NAME_DEFAULT\fP\X'tty: link' variable.
647
+ .sp
648
+ The \X'tty: link #variable:CMAKE_GENERATOR_PLATFORM'\fI\%CMAKE_GENERATOR_PLATFORM\fP\X'tty: link' variable may be set, perhaps
649
+ via the \X'tty: link #cmdoption-cmake-A'\fI\%cmake \-A\fP\X'tty: link' option, to specify a target platform
650
+ name (architecture). For example:
651
+ .INDENT 0.0
652
+ .IP \(bu 2
653
+ \fBcmake \-G \(dqVisual Studio 16 2019\(dq \-A Win32\fP
654
+ .IP \(bu 2
655
+ \fBcmake \-G \(dqVisual Studio 16 2019\(dq \-A x64\fP
656
+ .IP \(bu 2
657
+ \fBcmake \-G \(dqVisual Studio 16 2019\(dq \-A ARM\fP
658
+ .IP \(bu 2
659
+ \fBcmake \-G \(dqVisual Studio 16 2019\(dq \-A ARM64\fP
660
+ .UNINDENT
661
+ .SS Toolset Selection
662
+ .sp
663
+ The \fBv142\fP toolset that comes with Visual Studio 16 2019 is selected by
664
+ default. The \X'tty: link #variable:CMAKE_GENERATOR_TOOLSET'\fI\%CMAKE_GENERATOR_TOOLSET\fP\X'tty: link' option may be set, perhaps
665
+ via the \X'tty: link #cmdoption-cmake-T'\fI\%cmake \-T\fP\X'tty: link' option, to specify another toolset.
666
+ .sp
667
+ For each toolset that comes with this version of Visual Studio, there are
668
+ variants that are themselves compiled for 32\-bit (\fBx86\fP) and
669
+ 64\-bit (\fBx64\fP) hosts (independent of the architecture they target).
670
+ By default this generator uses the 64\-bit variant on x64 hosts and
671
+ the 32\-bit variant otherwise.
672
+ One may explicitly request use of either the 32\-bit or 64\-bit host tools
673
+ by adding either \fBhost=x86\fP or \fBhost=x64\fP to the toolset specification.
674
+ See the \X'tty: link #variable:CMAKE_GENERATOR_TOOLSET'\fI\%CMAKE_GENERATOR_TOOLSET\fP\X'tty: link' variable for details.
675
+ .SS Visual Studio 17 2022
676
+ .sp
677
+ Added in version 3.21.
678
+
679
+ .sp
680
+ Generates Visual Studio 17 (VS 2022) project files.
681
+ .SS Project Types
682
+ .sp
683
+ Only Visual C++ and C# projects may be generated (and Fortran with
684
+ Intel compiler integration). Other types of projects (JavaScript,
685
+ Powershell, Python, etc.) are not supported.
686
+ .SS Instance Selection
687
+ .sp
688
+ VS 2022 supports multiple installations on the same machine. The
689
+ \X'tty: link #variable:CMAKE_GENERATOR_INSTANCE'\fI\%CMAKE_GENERATOR_INSTANCE\fP\X'tty: link' variable may be used to select one.
690
+ .SS Platform Selection
691
+ .sp
692
+ The default target platform name (architecture) is that of the host
693
+ and is provided in the \X'tty: link #variable:CMAKE_VS_PLATFORM_NAME_DEFAULT'\fI\%CMAKE_VS_PLATFORM_NAME_DEFAULT\fP\X'tty: link' variable.
694
+ .sp
695
+ The \X'tty: link #variable:CMAKE_GENERATOR_PLATFORM'\fI\%CMAKE_GENERATOR_PLATFORM\fP\X'tty: link' variable may be set, perhaps
696
+ via the \X'tty: link #cmdoption-cmake-A'\fI\%cmake \-A\fP\X'tty: link' option, to specify a target platform
697
+ name (architecture). For example:
698
+ .INDENT 0.0
699
+ .IP \(bu 2
700
+ \fBcmake \-G \(dqVisual Studio 17 2022\(dq \-A Win32\fP
701
+ .IP \(bu 2
702
+ \fBcmake \-G \(dqVisual Studio 17 2022\(dq \-A x64\fP
703
+ .IP \(bu 2
704
+ \fBcmake \-G \(dqVisual Studio 17 2022\(dq \-A ARM\fP
705
+ .IP \(bu 2
706
+ \fBcmake \-G \(dqVisual Studio 17 2022\(dq \-A ARM64\fP
707
+ .UNINDENT
708
+ .SS Toolset Selection
709
+ .sp
710
+ The \fBv143\fP toolset that comes with VS 17 2022 is selected by default.
711
+ The \X'tty: link #variable:CMAKE_GENERATOR_TOOLSET'\fI\%CMAKE_GENERATOR_TOOLSET\fP\X'tty: link' option may be set, perhaps
712
+ via the \X'tty: link #cmdoption-cmake-T'\fI\%cmake \-T\fP\X'tty: link' option, to specify another toolset.
713
+ .sp
714
+ For each toolset that comes with this version of Visual Studio, there are
715
+ variants that are themselves compiled for 32\-bit (\fBx86\fP) and
716
+ 64\-bit (\fBx64\fP) hosts (independent of the architecture they target).
717
+ By default this generator uses the 64\-bit variant on x64 hosts and
718
+ the 32\-bit variant otherwise.
719
+ One may explicitly request use of either the 32\-bit or 64\-bit host tools
720
+ by adding either \fBhost=x86\fP or \fBhost=x64\fP to the toolset specification.
721
+ See the \X'tty: link #variable:CMAKE_GENERATOR_TOOLSET'\fI\%CMAKE_GENERATOR_TOOLSET\fP\X'tty: link' variable for details.
722
+ .SS Other Generators
723
+ .SS Green Hills MULTI
724
+ .sp
725
+ Added in version 3.3.
726
+
727
+ .sp
728
+ Added in version 3.15: Linux support.
729
+
730
+ .sp
731
+ Generates Green Hills MULTI project files (experimental, work\-in\-progress).
732
+ .INDENT 0.0
733
+ .INDENT 3.5
734
+ The buildsystem has predetermined build\-configuration settings that can be controlled
735
+ via the \X'tty: link #variable:CMAKE_BUILD_TYPE'\fI\%CMAKE_BUILD_TYPE\fP\X'tty: link' variable.
736
+ .UNINDENT
737
+ .UNINDENT
738
+ .SS Platform Selection
739
+ .sp
740
+ Added in version 3.13.
741
+
742
+ .sp
743
+ The variable \fBGHS_PRIMARY_TARGET\fP can be used to select the target platform.
744
+ .INDENT 0.0
745
+ .INDENT 3.5
746
+ .nf
747
+ Sets \fBprimaryTarget\fP entry in project file.
748
+ .fi
749
+ .sp
750
+ .UNINDENT
751
+ .UNINDENT
752
+ .sp
753
+ For example:
754
+ .INDENT 0.0
755
+ .IP \(bu 2
756
+ \fBcmake \-G \(dqGreen Hills MULTI\(dq \-D GHS_PRIMARY_TARGET=ppc_integrity.tgt\fP
757
+ .UNINDENT
758
+ .sp
759
+ Otherwise the \fBprimaryTarget\fP will be composed from the values of \X'tty: link #variable:CMAKE_GENERATOR_PLATFORM'\fI\%CMAKE_GENERATOR_PLATFORM\fP\X'tty: link'
760
+ and \fBGHS_TARGET_PLATFORM\fP\&. Defaulting to the value of \fBarm_integrity.tgt\fP
761
+ .INDENT 0.0
762
+ .IP \(bu 2
763
+ The \X'tty: link #variable:CMAKE_GENERATOR_PLATFORM'\fI\%CMAKE_GENERATOR_PLATFORM\fP\X'tty: link' variable may be set, perhaps
764
+ via the \X'tty: link #cmdoption-cmake-A'\fI\%cmake \-A\fP\X'tty: link' option.
765
+ .nf
766
+ Typical values of \fBarm\fP, \fBppc\fP, \fB86\fP, etcetera, are used.
767
+ .fi
768
+ .sp
769
+ .IP \(bu 2
770
+ The variable \fBGHS_TARGET_PLATFORM\fP may be set, perhaps via the \X'tty: link #cmdoption-cmake-D'\fI\%cmake \-D\fP\X'tty: link'
771
+ option.
772
+ .nf
773
+ Defaults to \fBintegrity\fP\&.
774
+ Usual values are \fBintegrity\fP, \fBthreadx\fP, \fBuvelosity\fP, \fBvelosity\fP,
775
+ \fBvxworks\fP, \fBstandalone\fP\&.
776
+ .fi
777
+ .sp
778
+ .UNINDENT
779
+ .sp
780
+ For example:
781
+ .INDENT 0.0
782
+ .IP \(bu 2
783
+ \fBcmake \-G \(dqGreen Hills MULTI\(dq\fP for \fBarm_integrity.tgt\fP\&.
784
+ .IP \(bu 2
785
+ \fBcmake \-G \(dqGreen Hills MULTI\(dq \-A 86\fP for \fB86_integrity.tgt\fP\&.
786
+ .IP \(bu 2
787
+ \fBcmake \-G \(dqGreen Hills MULTI\(dq \-D GHS_TARGET_PLATFORM=standalone\fP for \fBarm_standalone.tgt\fP\&.
788
+ .IP \(bu 2
789
+ \fBcmake \-G \(dqGreen Hills MULTI\(dq \-A ppc \-D GHS_TARGET_PLATFORM=standalone\fP for \fBppc_standalone.tgt\fP\&.
790
+ .UNINDENT
791
+ .SS Toolset Selection
792
+ .sp
793
+ Added in version 3.13.
794
+
795
+ .sp
796
+ The generator searches for the latest compiler or can be given a location to use.
797
+ \fBGHS_TOOLSET_ROOT\fP is the directory that is checked for the latest compiler.
798
+ .INDENT 0.0
799
+ .IP \(bu 2
800
+ The \X'tty: link #variable:CMAKE_GENERATOR_TOOLSET'\fI\%CMAKE_GENERATOR_TOOLSET\fP\X'tty: link' option may be set, perhaps
801
+ via the \X'tty: link #cmdoption-cmake-T'\fI\%cmake \-T\fP\X'tty: link' option, to specify the location of the toolset.
802
+ Both absolute and relative paths are valid. Paths are relative to \fBGHS_TOOLSET_ROOT\fP\&.
803
+ .IP \(bu 2
804
+ The variable \fBGHS_TOOLSET_ROOT\fP may be set, perhaps via the \X'tty: link #cmdoption-cmake-D'\fI\%cmake \-D\fP\X'tty: link'
805
+ option.
806
+ .nf
807
+ Root path for toolset searches and relative paths.
808
+ Defaults to \fBC:/ghs\fP in Windows or \fB/usr/ghs\fP in Linux.
809
+ .fi
810
+ .sp
811
+ .UNINDENT
812
+ .sp
813
+ For example, setting a specific compiler:
814
+ .INDENT 0.0
815
+ .IP \(bu 2
816
+ \fBcmake \-G \(dqGreen Hills MULTI\(dq \-T comp_201754\fP for \fB/usr/ghs/comp_201754\fP\&.
817
+ .IP \(bu 2
818
+ \fBcmake \-G \(dqGreen Hills MULTI\(dq \-T comp_201754 \-D GHS_TOOLSET_ROOT=/opt/ghs\fP for \fB/opt/ghs/comp_201754\fP\&.
819
+ .IP \(bu 2
820
+ \fBcmake \-G \(dqGreen Hills MULTI\(dq \-T /usr/ghs/comp_201554\fP
821
+ .IP \(bu 2
822
+ \fBcmake \-G \(dqGreen Hills MULTI\(dq \-T C:/ghs/comp_201754\fP
823
+ .UNINDENT
824
+ .sp
825
+ For example, searching for latest compiler:
826
+ .INDENT 0.0
827
+ .IP \(bu 2
828
+ \fBcmake \-G \(dqGreen Hills MULTI\(dq\fP for searching \fB/usr/ghs\fP\&.
829
+ .IP \(bu 2
830
+ \fBcmake \-G \(dqGreen Hills MULTI \-D GHS_TOOLSET_ROOT=/opt/ghs\(dq\fP for searching \fB/opt/ghs\fP\&.
831
+ .UNINDENT
832
+ .sp
833
+ \fBNOTE:\fP
834
+ .INDENT 0.0
835
+ .INDENT 3.5
836
+ The \X'tty: link #variable:CMAKE_GENERATOR_TOOLSET'\fI\%CMAKE_GENERATOR_TOOLSET\fP\X'tty: link' should use CMake style paths.
837
+ .UNINDENT
838
+ .UNINDENT
839
+ .SS OS and BSP Selection
840
+ .sp
841
+ Added in version 3.3.
842
+
843
+ .sp
844
+ Certain target platforms, like Integrity, require an OS. The RTOS directory path
845
+ can be explicitly set using \fBGHS_OS_DIR\fP\&. Otherwise \fBGHS_OS_ROOT\fP will be
846
+ searched for the latest Integrity RTOS.
847
+ .sp
848
+ If the target platform, like Integrity, requires a BSP name then it can be set via
849
+ the \fBGHS_BSP_NAME\fP variable.
850
+ .INDENT 0.0
851
+ .IP \(bu 2
852
+ \fBGHS_OS_DIR\fP and \fBGHS_OS_DIR_OPTION\fP
853
+ .nf
854
+ Sets \fB\-os_dir\fP entry in project file.
855
+ .fi
856
+ .sp
857
+ .nf
858
+ \fBGHS_OS_DIR_OPTION\fP default value is \fB\-os_dir\fP\&.
859
+ .fi
860
+ .sp
861
+ .sp
862
+ Added in version 3.15: The \fBGHS_OS_DIR_OPTION\fP variable.
863
+
864
+ .sp
865
+ For example:
866
+ .INDENT 2.0
867
+ .IP \(bu 2
868
+ \fBcmake \-G \(dqGreen Hills MULTI\(dq \-D GHS_OS_DIR=/usr/ghs/int1144\fP
869
+ .UNINDENT
870
+ .IP \(bu 2
871
+ \fBGHS_OS_ROOT\fP
872
+ .nf
873
+ Root path for RTOS searches.
874
+ Defaults to \fBC:/ghs\fP in Windows or \fB/usr/ghs\fP in Linux.
875
+ .fi
876
+ .sp
877
+ .sp
878
+ For example:
879
+ .INDENT 2.0
880
+ .IP \(bu 2
881
+ \fBcmake \-G \(dqGreen Hills MULTI\(dq \-D GHS_OS_ROOT=/opt/ghs\fP
882
+ .UNINDENT
883
+ .IP \(bu 2
884
+ \fBGHS_BSP_NAME\fP
885
+ .nf
886
+ Sets \fB\-bsp\fP entry in project file.
887
+ Defaults to \fBsim<arch>\fP for \fBintegrity\fP platforms.
888
+ .fi
889
+ .sp
890
+ .sp
891
+ For example:
892
+ .INDENT 2.0
893
+ .IP \(bu 2
894
+ \fBcmake \-G \(dqGreen Hills MULTI\(dq\fP for \fBsimarm\fP on \fBarm_integrity.tgt\fP\&.
895
+ .IP \(bu 2
896
+ \fBcmake \-G \(dqGreen Hills MULTI\(dq \-A 86\fP for \fBsim86\fP on \fB86_integrity.tgt\fP\&.
897
+ .IP \(bu 2
898
+ \fBcmake \-G \(dqGreen Hills MULTI\(dq \-A ppc \-D GHS_BSP_NAME=sim800\fP for \fBsim800\fP
899
+ on \fBppc_integrity.tgt\fP\&.
900
+ .IP \(bu 2
901
+ \fBcmake \-G \(dqGreen Hills MULTI\(dq \-D GHS_PRIMARY_TARGET=ppc_integrity.tgt \-D GHS_BSP_NAME=fsl\-t1040\fP
902
+ for \fBfsl\-t1040\fP on \fBppc_integrity.tgt\fP\&.
903
+ .UNINDENT
904
+ .UNINDENT
905
+ .SS Target Properties
906
+ .sp
907
+ Added in version 3.14.
908
+
909
+ .sp
910
+ The following properties are available:
911
+ .INDENT 0.0
912
+ .IP \(bu 2
913
+ \X'tty: link #prop_tgt:GHS_INTEGRITY_APP'\fI\%GHS_INTEGRITY_APP\fP\X'tty: link'
914
+ .IP \(bu 2
915
+ \X'tty: link #prop_tgt:GHS_NO_SOURCE_GROUP_FILE'\fI\%GHS_NO_SOURCE_GROUP_FILE\fP\X'tty: link'
916
+ .UNINDENT
917
+ .SS MULTI Project Variables
918
+ .sp
919
+ Added in version 3.3.
920
+
921
+ .sp
922
+ Adding a Customization file and macros are available through the use of the following
923
+ variables:
924
+ .INDENT 0.0
925
+ .IP \(bu 2
926
+ \fBGHS_CUSTOMIZATION\fP \- CMake path name to Customization File.
927
+ .IP \(bu 2
928
+ \fBGHS_GPJ_MACROS\fP \- CMake list of Macros.
929
+ .UNINDENT
930
+ .sp
931
+ \fBNOTE:\fP
932
+ .INDENT 0.0
933
+ .INDENT 3.5
934
+ This generator is deemed experimental as of CMake 3.31.4
935
+ and is still a work in progress. Future versions of CMake
936
+ may make breaking changes as the generator matures.
937
+ .UNINDENT
938
+ .UNINDENT
939
+ .SS Xcode
940
+ .sp
941
+ Generate Xcode project files.
942
+ .sp
943
+ Changed in version 3.15: This generator supports Xcode 5.0 and above.
944
+
945
+ .SS Toolset and Build System Selection
946
+ .sp
947
+ By default Xcode is allowed to select its own default toolchain.
948
+ The \X'tty: link #variable:CMAKE_GENERATOR_TOOLSET'\fI\%CMAKE_GENERATOR_TOOLSET\fP\X'tty: link' option may be set, perhaps
949
+ via the \X'tty: link #cmdoption-cmake-T'\fI\%cmake \-T\fP\X'tty: link' option, to specify another toolset.
950
+ .sp
951
+ Added in version 3.19: This generator supports toolset specification using one of these forms:
952
+
953
+ .INDENT 0.0
954
+ .IP \(bu 2
955
+ \fBtoolset\fP
956
+ .IP \(bu 2
957
+ \fBtoolset[,key=value]*\fP
958
+ .IP \(bu 2
959
+ \fBkey=value[,key=value]*\fP
960
+ .UNINDENT
961
+ .sp
962
+ The \fBtoolset\fP specifies the toolset name. The selected toolset name
963
+ is provided in the \X'tty: link #variable:CMAKE_XCODE_PLATFORM_TOOLSET'\fI\%CMAKE_XCODE_PLATFORM_TOOLSET\fP\X'tty: link' variable.
964
+ .sp
965
+ The \fBkey=value\fP pairs form a comma\-separated list of options to
966
+ specify generator\-specific details of the toolset selection.
967
+ Supported pairs are:
968
+ .INDENT 0.0
969
+ .TP
970
+ .B \fBbuildsystem=<variant>\fP
971
+ Specify the buildsystem variant to use.
972
+ See the \X'tty: link #variable:CMAKE_XCODE_BUILD_SYSTEM'\fI\%CMAKE_XCODE_BUILD_SYSTEM\fP\X'tty: link' variable for allowed values.
973
+ .sp
974
+ For example, to select the original build system under Xcode 12,
975
+ run \X'tty: link #manual:cmake(1)'\fI\%cmake(1)\fP\X'tty: link' with the option \X'tty: link #cmdoption-cmake-T'\fI\%\-T buildsystem=1\fP\X'tty: link'\&.
976
+ .UNINDENT
977
+ .SS Swift Support
978
+ .sp
979
+ Added in version 3.4.
980
+
981
+ .sp
982
+ When using the \fBXcode\fP generator with Xcode 6.1 or higher,
983
+ one may enable the \fBSwift\fP language with the \X'tty: link #command:enable_language'\fI\%enable_language()\fP\X'tty: link'
984
+ command or the \X'tty: link #command:project'\fI\%project()\fP\X'tty: link'\&.
985
+ .SS Limitations
986
+ .sp
987
+ The Xcode generator does not support per\-configuration sources.
988
+ Code like the following will result in a generation error:
989
+ .INDENT 0.0
990
+ .INDENT 3.5
991
+ .sp
992
+ .nf
993
+ .ft C
994
+ add_executable(MyApp mymain\-$<CONFIG>.cpp)
995
+ .ft P
996
+ .fi
997
+ .UNINDENT
998
+ .UNINDENT
999
+ .SH EXTRA GENERATORS
1000
+ .sp
1001
+ Deprecated since version 3.27: Support for \(dqExtra Generators\(dq is deprecated and will be removed from
1002
+ a future version of CMake. IDEs may use the \X'tty: link #manual:cmake-file-api(7)'\fI\%cmake\-file\-api(7)\fP\X'tty: link'
1003
+ to view CMake\-generated project build trees.
1004
+
1005
+ .sp
1006
+ Some of the \fI\%CMake Generators\fP listed in the \X'tty: link #manual:cmake(1)'\fI\%cmake(1)\fP\X'tty: link'
1007
+ command\-line tool \X'tty: link #cmdoption-cmake-h'\fI\%\-\-help\fP\X'tty: link' output may have
1008
+ variants that specify an extra generator for an auxiliary IDE tool.
1009
+ Such generator names have the form \fB<extra\-generator> \- <main\-generator>\fP\&.
1010
+ The following extra generators are known to CMake.
1011
+ .SS CodeBlocks
1012
+ .sp
1013
+ Deprecated since version 3.27: Support for \X'tty: link #extra-generators'\fI\%Extra Generators\fP\X'tty: link' is deprecated and will be removed from
1014
+ a future version of CMake. IDEs may use the \X'tty: link #manual:cmake-file-api(7)'\fI\%cmake\-file\-api(7)\fP\X'tty: link'
1015
+ to view CMake\-generated project build trees.
1016
+
1017
+ .sp
1018
+ Generates CodeBlocks project files.
1019
+ .sp
1020
+ Project files for CodeBlocks will be created in the top directory and
1021
+ in every subdirectory which features a \fBCMakeLists.txt\fP file containing
1022
+ a \X'tty: link #command:project'\fI\%project()\fP\X'tty: link' call. Additionally a hierarchy of makefiles is generated
1023
+ into the build tree.
1024
+ The appropriate make program can build the
1025
+ project through the default \fBall\fP target. An \fBinstall\fP target is
1026
+ also provided.
1027
+ .sp
1028
+ Added in version 3.10: The \X'tty: link #variable:CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES'\fI\%CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES\fP\X'tty: link' variable may
1029
+ be set to \fBON\fP to exclude any files which are located outside of
1030
+ the project root directory.
1031
+
1032
+ .sp
1033
+ This \(dqextra\(dq generator may be specified as:
1034
+ .INDENT 0.0
1035
+ .TP
1036
+ .B \fBCodeBlocks \- MinGW Makefiles\fP
1037
+ Generate with \X'tty: link #generator:MinGW Makefiles'\fI\%MinGW Makefiles\fP\X'tty: link'\&.
1038
+ .TP
1039
+ .B \fBCodeBlocks \- NMake Makefiles\fP
1040
+ Generate with \X'tty: link #generator:NMake Makefiles'\fI\%NMake Makefiles\fP\X'tty: link'\&.
1041
+ .TP
1042
+ .B \fBCodeBlocks \- NMake Makefiles JOM\fP
1043
+ Added in version 3.8: Generate with \X'tty: link #generator:NMake Makefiles JOM'\fI\%NMake Makefiles JOM\fP\X'tty: link'\&.
1044
+
1045
+ .TP
1046
+ .B \fBCodeBlocks \- Ninja\fP
1047
+ Generate with \X'tty: link #generator:Ninja'\fI\%Ninja\fP\X'tty: link'\&.
1048
+ .TP
1049
+ .B \fBCodeBlocks \- Unix Makefiles\fP
1050
+ Generate with \X'tty: link #generator:Unix Makefiles'\fI\%Unix Makefiles\fP\X'tty: link'\&.
1051
+ .UNINDENT
1052
+ .SS CodeLite
1053
+ .sp
1054
+ Deprecated since version 3.27: Support for \X'tty: link #extra-generators'\fI\%Extra Generators\fP\X'tty: link' is deprecated and will be removed from
1055
+ a future version of CMake. IDEs may use the \X'tty: link #manual:cmake-file-api(7)'\fI\%cmake\-file\-api(7)\fP\X'tty: link'
1056
+ to view CMake\-generated project build trees.
1057
+
1058
+ .sp
1059
+ Generates CodeLite project files.
1060
+ .sp
1061
+ Project files for CodeLite will be created in the top directory and
1062
+ in every subdirectory which features a CMakeLists.txt file containing
1063
+ a \X'tty: link #command:project'\fI\%project()\fP\X'tty: link' call.
1064
+ The appropriate make program can build the
1065
+ project through the default \fBall\fP target. An \fBinstall\fP target
1066
+ is also provided.
1067
+ .sp
1068
+ Added in version 3.7: The \X'tty: link #variable:CMAKE_CODELITE_USE_TARGETS'\fI\%CMAKE_CODELITE_USE_TARGETS\fP\X'tty: link' variable may be set to \fBON\fP
1069
+ to change the default behavior from projects to targets as the basis
1070
+ for project files.
1071
+
1072
+ .sp
1073
+ This \(dqextra\(dq generator may be specified as:
1074
+ .INDENT 0.0
1075
+ .TP
1076
+ .B \fBCodeLite \- MinGW Makefiles\fP
1077
+ Generate with \X'tty: link #generator:MinGW Makefiles'\fI\%MinGW Makefiles\fP\X'tty: link'\&.
1078
+ .TP
1079
+ .B \fBCodeLite \- NMake Makefiles\fP
1080
+ Generate with \X'tty: link #generator:NMake Makefiles'\fI\%NMake Makefiles\fP\X'tty: link'\&.
1081
+ .TP
1082
+ .B \fBCodeLite \- Ninja\fP
1083
+ Generate with \X'tty: link #generator:Ninja'\fI\%Ninja\fP\X'tty: link'\&.
1084
+ .TP
1085
+ .B \fBCodeLite \- Unix Makefiles\fP
1086
+ Generate with \X'tty: link #generator:Unix Makefiles'\fI\%Unix Makefiles\fP\X'tty: link'\&.
1087
+ .UNINDENT
1088
+ .SS Eclipse CDT4
1089
+ .sp
1090
+ Deprecated since version 3.27: Support for \X'tty: link #extra-generators'\fI\%Extra Generators\fP\X'tty: link' is deprecated and will be removed from
1091
+ a future version of CMake. IDEs may use the \X'tty: link #manual:cmake-file-api(7)'\fI\%cmake\-file\-api(7)\fP\X'tty: link'
1092
+ to view CMake\-generated project build trees.
1093
+
1094
+ .sp
1095
+ Generates Eclipse CDT 4.0 project files.
1096
+ .sp
1097
+ Project files for Eclipse will be created in the top directory. In
1098
+ out of source builds, a linked resource to the top level source
1099
+ directory will be created. Additionally a hierarchy of makefiles is
1100
+ generated into the build tree. The appropriate make program can build
1101
+ the project through the default \fBall\fP target. An \fBinstall\fP target
1102
+ is also provided.
1103
+ .sp
1104
+ This \(dqextra\(dq generator may be specified as:
1105
+ .INDENT 0.0
1106
+ .TP
1107
+ .B \fBEclipse CDT4 \- MinGW Makefiles\fP
1108
+ Generate with \X'tty: link #generator:MinGW Makefiles'\fI\%MinGW Makefiles\fP\X'tty: link'\&.
1109
+ .TP
1110
+ .B \fBEclipse CDT4 \- NMake Makefiles\fP
1111
+ Generate with \X'tty: link #generator:NMake Makefiles'\fI\%NMake Makefiles\fP\X'tty: link'\&.
1112
+ .TP
1113
+ .B \fBEclipse CDT4 \- Ninja\fP
1114
+ Generate with \X'tty: link #generator:Ninja'\fI\%Ninja\fP\X'tty: link'\&.
1115
+ .TP
1116
+ .B \fBEclipse CDT4 \- Unix Makefiles\fP
1117
+ Generate with \X'tty: link #generator:Unix Makefiles'\fI\%Unix Makefiles\fP\X'tty: link'\&.
1118
+ .UNINDENT
1119
+ .SS Kate
1120
+ .sp
1121
+ Deprecated since version 3.27: Support for \X'tty: link #extra-generators'\fI\%Extra Generators\fP\X'tty: link' is deprecated and will be removed from
1122
+ a future version of CMake. IDEs may use the \X'tty: link #manual:cmake-file-api(7)'\fI\%cmake\-file\-api(7)\fP\X'tty: link'
1123
+ to view CMake\-generated project build trees.
1124
+
1125
+ .sp
1126
+ Generates Kate project files.
1127
+ .sp
1128
+ A project file for Kate will be created in the top directory in the top level
1129
+ build directory.
1130
+ To use it in Kate, the Project plugin must be enabled.
1131
+ The project file is loaded in Kate by opening the
1132
+ \fBProjectName.kateproject\fP file in the editor.
1133
+ If the Kate Build\-plugin is enabled, all targets generated by CMake are
1134
+ available for building.
1135
+ .sp
1136
+ This \(dqextra\(dq generator may be specified as:
1137
+ .INDENT 0.0
1138
+ .TP
1139
+ .B \fBKate \- MinGW Makefiles\fP
1140
+ Generate with \X'tty: link #generator:MinGW Makefiles'\fI\%MinGW Makefiles\fP\X'tty: link'\&.
1141
+ .TP
1142
+ .B \fBKate \- NMake Makefiles\fP
1143
+ Generate with \X'tty: link #generator:NMake Makefiles'\fI\%NMake Makefiles\fP\X'tty: link'\&.
1144
+ .TP
1145
+ .B \fBKate \- Ninja\fP
1146
+ Generate with \X'tty: link #generator:Ninja'\fI\%Ninja\fP\X'tty: link'\&.
1147
+ .TP
1148
+ .B \fBKate \- Ninja Multi\-Config\fP
1149
+ Generate with \X'tty: link #generator:Ninja Multi-Config'\fI\%Ninja Multi\-Config\fP\X'tty: link'\&.
1150
+ .TP
1151
+ .B \fBKate \- Unix Makefiles\fP
1152
+ Generate with \X'tty: link #generator:Unix Makefiles'\fI\%Unix Makefiles\fP\X'tty: link'\&.
1153
+ .UNINDENT
1154
+ .SS Sublime Text 2
1155
+ .sp
1156
+ Deprecated since version 3.27: Support for \X'tty: link #extra-generators'\fI\%Extra Generators\fP\X'tty: link' is deprecated and will be removed from
1157
+ a future version of CMake. IDEs may use the \X'tty: link #manual:cmake-file-api(7)'\fI\%cmake\-file\-api(7)\fP\X'tty: link'
1158
+ to view CMake\-generated project build trees.
1159
+
1160
+ .sp
1161
+ Generates Sublime Text 2 project files.
1162
+ .sp
1163
+ Project files for Sublime Text 2 will be created in the top directory
1164
+ and in every subdirectory which features a \fBCMakeLists.txt\fP file
1165
+ containing a \X'tty: link #command:project'\fI\%project()\fP\X'tty: link' call. Additionally \fBMakefiles\fP
1166
+ (or \fBbuild.ninja\fP files) are generated into the build tree.
1167
+ The appropriate make program can build the project through the default \fBall\fP
1168
+ target. An \fBinstall\fP target is also provided.
1169
+ .sp
1170
+ This \(dqextra\(dq generator may be specified as:
1171
+ .INDENT 0.0
1172
+ .TP
1173
+ .B \fBSublime Text 2 \- MinGW Makefiles\fP
1174
+ Generate with \X'tty: link #generator:MinGW Makefiles'\fI\%MinGW Makefiles\fP\X'tty: link'\&.
1175
+ .TP
1176
+ .B \fBSublime Text 2 \- NMake Makefiles\fP
1177
+ Generate with \X'tty: link #generator:NMake Makefiles'\fI\%NMake Makefiles\fP\X'tty: link'\&.
1178
+ .TP
1179
+ .B \fBSublime Text 2 \- Ninja\fP
1180
+ Generate with \X'tty: link #generator:Ninja'\fI\%Ninja\fP\X'tty: link'\&.
1181
+ .TP
1182
+ .B \fBSublime Text 2 \- Unix Makefiles\fP
1183
+ Generate with \X'tty: link #generator:Unix Makefiles'\fI\%Unix Makefiles\fP\X'tty: link'\&.
1184
+ .UNINDENT
1185
+ .SH COPYRIGHT
1186
+ 2000-2024 Kitware, Inc. and Contributors
1187
+ .\" Generated by docutils manpage writer.
1188
+ .
cmake/man/man7/cmake-language.7 ADDED
@@ -0,0 +1,684 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .\" Man page generated from reStructuredText.
2
+ .
3
+ .
4
+ .nr rst2man-indent-level 0
5
+ .
6
+ .de1 rstReportMargin
7
+ \\$1 \\n[an-margin]
8
+ level \\n[rst2man-indent-level]
9
+ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
10
+ -
11
+ \\n[rst2man-indent0]
12
+ \\n[rst2man-indent1]
13
+ \\n[rst2man-indent2]
14
+ ..
15
+ .de1 INDENT
16
+ .\" .rstReportMargin pre:
17
+ . RS \\$1
18
+ . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
19
+ . nr rst2man-indent-level +1
20
+ .\" .rstReportMargin post:
21
+ ..
22
+ .de UNINDENT
23
+ . RE
24
+ .\" indent \\n[an-margin]
25
+ .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
26
+ .nr rst2man-indent-level -1
27
+ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
28
+ .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
29
+ ..
30
+ .TH "CMAKE-LANGUAGE" "7" "Jan 10, 2025" "3.31.4" "CMake"
31
+ .SH NAME
32
+ cmake-language \- CMake Language Reference
33
+ .SH ORGANIZATION
34
+ .sp
35
+ CMake input files are written in the \(dqCMake Language\(dq in source files
36
+ named \fBCMakeLists.txt\fP or ending in a \fB\&.cmake\fP file name extension.
37
+ .sp
38
+ CMake Language source files in a project are organized into:
39
+ .INDENT 0.0
40
+ .IP \(bu 2
41
+ \fI\%Directories\fP (\fBCMakeLists.txt\fP),
42
+ .IP \(bu 2
43
+ \fI\%Scripts\fP (\fB<script>.cmake\fP), and
44
+ .IP \(bu 2
45
+ \fI\%Modules\fP (\fB<module>.cmake\fP).
46
+ .UNINDENT
47
+ .SS Directories
48
+ .sp
49
+ When CMake processes a project source tree, the entry point is
50
+ a source file called \fBCMakeLists.txt\fP in the top\-level source
51
+ directory. This file may contain the entire build specification
52
+ or use the \X'tty: link #command:add_subdirectory'\fI\%add_subdirectory()\fP\X'tty: link' command to add subdirectories
53
+ to the build. Each subdirectory added by the command must also
54
+ contain a \fBCMakeLists.txt\fP file as the entry point to that
55
+ directory. For each source directory whose \fBCMakeLists.txt\fP file
56
+ is processed CMake generates a corresponding directory in the build
57
+ tree to act as the default working and output directory.
58
+ .SS Scripts
59
+ .sp
60
+ An individual \fB<script>.cmake\fP source file may be processed
61
+ in \fIscript mode\fP by using the \X'tty: link #manual:cmake(1)'\fI\%cmake(1)\fP\X'tty: link' command\-line tool
62
+ with the \X'tty: link #cmdoption-cmake-P'\fI\%\-P\fP\X'tty: link' option. Script mode simply runs
63
+ the commands in the given CMake Language source file and does not
64
+ generate a build system. It does not allow CMake commands that
65
+ define build targets or actions.
66
+ .SS Modules
67
+ .sp
68
+ CMake Language code in either \fI\%Directories\fP or \fI\%Scripts\fP may
69
+ use the \X'tty: link #command:include'\fI\%include()\fP\X'tty: link' command to load a \fB<module>.cmake\fP
70
+ source file in the scope of the including context.
71
+ See the \X'tty: link #manual:cmake-modules(7)'\fI\%cmake\-modules(7)\fP\X'tty: link' manual page for documentation
72
+ of modules included with the CMake distribution.
73
+ Project source trees may also provide their own modules and
74
+ specify their location(s) in the \X'tty: link #variable:CMAKE_MODULE_PATH'\fI\%CMAKE_MODULE_PATH\fP\X'tty: link'
75
+ variable.
76
+ .SH SYNTAX
77
+ .SS Encoding
78
+ .sp
79
+ A CMake Language source file may be written in 7\-bit ASCII text for
80
+ maximum portability across all supported platforms. Newlines may be
81
+ encoded as either \fB\en\fP or \fB\er\en\fP but will be converted to \fB\en\fP
82
+ as input files are read.
83
+ .sp
84
+ Note that the implementation is 8\-bit clean so source files may
85
+ be encoded as UTF\-8 on platforms with system APIs supporting this
86
+ encoding. In addition, CMake 3.2 and above support source files
87
+ encoded in UTF\-8 on Windows (using UTF\-16 to call system APIs).
88
+ Furthermore, CMake 3.0 and above allow a leading UTF\-8
89
+ \X'tty: link https://en.wikipedia.org/wiki/Byte_order_mark'\fI\%Byte\-Order Mark\fP\X'tty: link' in source files.
90
+ .SS Source Files
91
+ .sp
92
+ A CMake Language source file consists of zero or more
93
+ \fI\%Command Invocations\fP separated by newlines and optionally
94
+ spaces and \fI\%Comments\fP:
95
+ .sp
96
+ .nf
97
+ \fBfile \fP ::= \fI\%file_element\fP*
98
+ \fBfile_element\fP ::= \fI\%command_invocation\fP \fI\%line_ending\fP |
99
+ (\fI\%bracket_comment\fP|\fI\%space\fP)* \fI\%line_ending\fP
100
+ \fBline_ending \fP ::= \fI\%line_comment\fP? \fI\%newline\fP
101
+ \fBspace \fP ::= <match \(aq[ \et]+\(aq>
102
+ \fBnewline \fP ::= <match \(aq\en\(aq>
103
+
104
+ .fi
105
+ .sp
106
+ Note that any source file line not inside \fI\%Command Arguments\fP or
107
+ a \fI\%Bracket Comment\fP can end in a \fI\%Line Comment\fP\&.
108
+ .SS Command Invocations
109
+ .sp
110
+ A \fIcommand invocation\fP is a name followed by paren\-enclosed arguments
111
+ separated by whitespace:
112
+ .sp
113
+ .nf
114
+ \fBcommand_invocation \fP ::= \fI\%space\fP* \fI\%identifier\fP \fI\%space\fP* \(aq(\(aq \fI\%arguments\fP \(aq)\(aq
115
+ \fBidentifier \fP ::= <match \(aq[A\-Za\-z_][A\-Za\-z0\-9_]*\(aq>
116
+ \fBarguments \fP ::= \fI\%argument\fP? \fI\%separated_arguments\fP*
117
+ \fBseparated_arguments\fP ::= \fI\%separation\fP+ \fI\%argument\fP? |
118
+ \fI\%separation\fP* \(aq(\(aq \fI\%arguments\fP \(aq)\(aq
119
+ \fBseparation \fP ::= \fI\%space\fP | \fI\%line_ending\fP
120
+
121
+ .fi
122
+ .sp
123
+ For example:
124
+ .INDENT 0.0
125
+ .INDENT 3.5
126
+ .sp
127
+ .nf
128
+ .ft C
129
+ add_executable(hello world.c)
130
+ .ft P
131
+ .fi
132
+ .UNINDENT
133
+ .UNINDENT
134
+ .sp
135
+ Command names are case\-insensitive.
136
+ Nested unquoted parentheses in the arguments must balance.
137
+ Each \fB(\fP or \fB)\fP is given to the command invocation as
138
+ a literal \fI\%Unquoted Argument\fP\&. This may be used in calls
139
+ to the \X'tty: link #command:if'\fI\%if()\fP\X'tty: link' command to enclose conditions.
140
+ For example:
141
+ .INDENT 0.0
142
+ .INDENT 3.5
143
+ .sp
144
+ .nf
145
+ .ft C
146
+ if(FALSE AND (FALSE OR TRUE)) # evaluates to FALSE
147
+ .ft P
148
+ .fi
149
+ .UNINDENT
150
+ .UNINDENT
151
+ .sp
152
+ \fBNOTE:\fP
153
+ .INDENT 0.0
154
+ .INDENT 3.5
155
+ CMake versions prior to 3.0 require command name identifiers
156
+ to be at least 2 characters.
157
+ .sp
158
+ CMake versions prior to 2.8.12 silently accept an \fI\%Unquoted Argument\fP
159
+ or a \fI\%Quoted Argument\fP immediately following a \fI\%Quoted Argument\fP and
160
+ not separated by any whitespace. For compatibility, CMake 2.8.12 and
161
+ higher accept such code but produce a warning.
162
+ .UNINDENT
163
+ .UNINDENT
164
+ .SS Command Arguments
165
+ .sp
166
+ There are three types of arguments within \fI\%Command Invocations\fP:
167
+ .sp
168
+ .nf
169
+ \fBargument\fP ::= \fI\%bracket_argument\fP | \fI\%quoted_argument\fP | \fI\%unquoted_argument\fP
170
+
171
+ .fi
172
+ .SS Bracket Argument
173
+ .sp
174
+ A \fIbracket argument\fP, inspired by \X'tty: link https://www.lua.org/'\fI\%Lua\fP\X'tty: link' long bracket syntax,
175
+ encloses content between opening and closing \(dqbrackets\(dq of the
176
+ same length:
177
+ .sp
178
+ .nf
179
+ \fBbracket_argument\fP ::= \fI\%bracket_open\fP \fI\%bracket_content\fP \fI\%bracket_close\fP
180
+ \fBbracket_open \fP ::= \(aq[\(aq \(aq=\(aq* \(aq[\(aq
181
+ \fBbracket_content \fP ::= <any text not containing a \fI\%bracket_close\fP with
182
+ the same number of \(aq=\(aq as the \fI\%bracket_open\fP>
183
+ \fBbracket_close \fP ::= \(aq]\(aq \(aq=\(aq* \(aq]\(aq
184
+
185
+ .fi
186
+ .sp
187
+ An opening bracket is written \fB[\fP followed by zero or more \fB=\fP followed
188
+ by \fB[\fP\&. The corresponding closing bracket is written \fB]\fP followed
189
+ by the same number of \fB=\fP followed by \fB]\fP\&.
190
+ Brackets do not nest. A unique length may always be chosen
191
+ for the opening and closing brackets to contain closing brackets
192
+ of other lengths.
193
+ .sp
194
+ Bracket argument content consists of all text between the opening
195
+ and closing brackets, except that one newline immediately following
196
+ the opening bracket, if any, is ignored. No evaluation of the
197
+ enclosed content, such as \fI\%Escape Sequences\fP or \fI\%Variable References\fP,
198
+ is performed. A bracket argument is always given to the command
199
+ invocation as exactly one argument.
200
+ .sp
201
+ For example:
202
+ .INDENT 0.0
203
+ .INDENT 3.5
204
+ .sp
205
+ .nf
206
+ .ft C
207
+ message([=[
208
+ This is the first line in a bracket argument with bracket length 1.
209
+ No \e\-escape sequences or ${variable} references are evaluated.
210
+ This is always one argument even though it contains a ; character.
211
+ The text does not end on a closing bracket of length 0 like ]].
212
+ It does end in a closing bracket of length 1.
213
+ ]=])
214
+ .ft P
215
+ .fi
216
+ .UNINDENT
217
+ .UNINDENT
218
+ .sp
219
+ \fBNOTE:\fP
220
+ .INDENT 0.0
221
+ .INDENT 3.5
222
+ CMake versions prior to 3.0 do not support bracket arguments.
223
+ They interpret the opening bracket as the start of an
224
+ \fI\%Unquoted Argument\fP\&.
225
+ .UNINDENT
226
+ .UNINDENT
227
+ .SS Quoted Argument
228
+ .sp
229
+ A \fIquoted argument\fP encloses content between opening and closing
230
+ double\-quote characters:
231
+ .sp
232
+ .nf
233
+ \fBquoted_argument \fP ::= \(aq\(dq\(aq \fI\%quoted_element\fP* \(aq\(dq\(aq
234
+ \fBquoted_element \fP ::= <any character except \(aq\e\(aq or \(aq\(dq\(aq> |
235
+ \fI\%escape_sequence\fP |
236
+ \fI\%quoted_continuation\fP
237
+ \fBquoted_continuation\fP ::= \(aq\e\(aq \fI\%newline\fP
238
+
239
+ .fi
240
+ .sp
241
+ Quoted argument content consists of all text between opening and
242
+ closing quotes. Both \fI\%Escape Sequences\fP and \fI\%Variable References\fP
243
+ are evaluated. A quoted argument is always given to the command
244
+ invocation as exactly one argument.
245
+ .sp
246
+ For example:
247
+ .INDENT 0.0
248
+ .INDENT 3.5
249
+ .sp
250
+ .nf
251
+ .ft C
252
+ message(\(dqThis is a quoted argument containing multiple lines.
253
+ This is always one argument even though it contains a ; character.
254
+ Both \e\e\-escape sequences and ${variable} references are evaluated.
255
+ The text does not end on an escaped double\-quote like \e\(dq.
256
+ It does end in an unescaped double quote.
257
+ \(dq)
258
+ .ft P
259
+ .fi
260
+ .UNINDENT
261
+ .UNINDENT
262
+ .sp
263
+ The final \fB\e\fP on any line ending in an odd number of backslashes
264
+ is treated as a line continuation and ignored along with the
265
+ immediately following newline character. For example:
266
+ .INDENT 0.0
267
+ .INDENT 3.5
268
+ .sp
269
+ .nf
270
+ .ft C
271
+ message(\(dq\e
272
+ This is the first line of a quoted argument. \e
273
+ In fact it is the only line but since it is long \e
274
+ the source code uses line continuation.\e
275
+ \(dq)
276
+ .ft P
277
+ .fi
278
+ .UNINDENT
279
+ .UNINDENT
280
+ .sp
281
+ \fBNOTE:\fP
282
+ .INDENT 0.0
283
+ .INDENT 3.5
284
+ CMake versions prior to 3.0 do not support continuation with \fB\e\fP\&.
285
+ They report errors in quoted arguments containing lines ending in
286
+ an odd number of \fB\e\fP characters.
287
+ .UNINDENT
288
+ .UNINDENT
289
+ .SS Unquoted Argument
290
+ .sp
291
+ An \fIunquoted argument\fP is not enclosed by any quoting syntax.
292
+ It may not contain any whitespace, \fB(\fP, \fB)\fP, \fB#\fP, \fB\(dq\fP, or \fB\e\fP
293
+ except when escaped by a backslash:
294
+ .sp
295
+ .nf
296
+ \fBunquoted_argument\fP ::= \fI\%unquoted_element\fP+ | \fI\%unquoted_legacy\fP
297
+ \fBunquoted_element \fP ::= <any character except whitespace or one of \(aq()#\(dq\e\(aq> |
298
+ \fI\%escape_sequence\fP
299
+ \fBunquoted_legacy \fP ::= <see note in text>
300
+
301
+ .fi
302
+ .sp
303
+ Unquoted argument content consists of all text in a contiguous block
304
+ of allowed or escaped characters. Both \fI\%Escape Sequences\fP and
305
+ \fI\%Variable References\fP are evaluated. The resulting value is divided
306
+ in the same way \fI\%Lists\fP divide into elements. Each non\-empty element
307
+ is given to the command invocation as an argument. Therefore an
308
+ unquoted argument may be given to a command invocation as zero or
309
+ more arguments.
310
+ .sp
311
+ For example:
312
+ .INDENT 0.0
313
+ .INDENT 3.5
314
+ .sp
315
+ .nf
316
+ .ft C
317
+ foreach(arg
318
+ NoSpace
319
+ Escaped\e Space
320
+ This;Divides;Into;Five;Arguments
321
+ Escaped\e;Semicolon
322
+ )
323
+ message(\(dq${arg}\(dq)
324
+ endforeach()
325
+ .ft P
326
+ .fi
327
+ .UNINDENT
328
+ .UNINDENT
329
+ .sp
330
+ \fBNOTE:\fP
331
+ .INDENT 0.0
332
+ .INDENT 3.5
333
+ To support legacy CMake code, unquoted arguments may also contain
334
+ double\-quoted strings (\fB\(dq...\(dq\fP, possibly enclosing horizontal
335
+ whitespace), and make\-style variable references (\fB$(MAKEVAR)\fP).
336
+ .sp
337
+ Unescaped double\-quotes must balance, may not appear at the
338
+ beginning of an unquoted argument, and are treated as part of the
339
+ content. For example, the unquoted arguments \fB\-Da=\(dqb c\(dq\fP,
340
+ \fB\-Da=$(v)\fP, and \fBa\(dq \(dqb\(dqc\(dqd\fP are each interpreted literally.
341
+ They may instead be written as quoted arguments \fB\(dq\-Da=\e\(dqb c\e\(dq\(dq\fP,
342
+ \fB\(dq\-Da=$(v)\(dq\fP, and \fB\(dqa\e\(dq \e\(dqb\e\(dqc\e\(dqd\(dq\fP, respectively.
343
+ .sp
344
+ Make\-style references are treated literally as part of the content
345
+ and do not undergo variable expansion. They are treated as part
346
+ of a single argument (rather than as separate \fB$\fP, \fB(\fP,
347
+ \fBMAKEVAR\fP, and \fB)\fP arguments).
348
+ .sp
349
+ The above \(dqunquoted_legacy\(dq production represents such arguments.
350
+ We do not recommend using legacy unquoted arguments in new code.
351
+ Instead use a \fI\%Quoted Argument\fP or a \fI\%Bracket Argument\fP to
352
+ represent the content.
353
+ .UNINDENT
354
+ .UNINDENT
355
+ .SS Escape Sequences
356
+ .sp
357
+ An \fIescape sequence\fP is a \fB\e\fP followed by one character:
358
+ .sp
359
+ .nf
360
+ \fBescape_sequence \fP ::= \fI\%escape_identity\fP | \fI\%escape_encoded\fP | \fI\%escape_semicolon\fP
361
+ \fBescape_identity \fP ::= \(aq\e\(aq <match \(aq[^A\-Za\-z0\-9;]\(aq>
362
+ \fBescape_encoded \fP ::= \(aq\et\(aq | \(aq\er\(aq | \(aq\en\(aq
363
+ \fBescape_semicolon\fP ::= \(aq\e;\(aq
364
+
365
+ .fi
366
+ .sp
367
+ A \fB\e\fP followed by a non\-alphanumeric character simply encodes the literal
368
+ character without interpreting it as syntax. A \fB\et\fP, \fB\er\fP, or \fB\en\fP
369
+ encodes a tab, carriage return, or newline character, respectively. A \fB\e;\fP
370
+ outside of any \fI\%Variable References\fP encodes itself but may be used in an
371
+ \fI\%Unquoted Argument\fP to encode the \fB;\fP without dividing the argument
372
+ value on it. A \fB\e;\fP inside \fI\%Variable References\fP encodes the literal
373
+ \fB;\fP character. (See also policy \X'tty: link #policy:CMP0053'\fI\%CMP0053\fP\X'tty: link' documentation for
374
+ historical considerations.)
375
+ .SS Variable References
376
+ .sp
377
+ A \fIvariable reference\fP has the form \fB${<variable>}\fP and is
378
+ evaluated inside a \fI\%Quoted Argument\fP or an \fI\%Unquoted Argument\fP\&.
379
+ A variable reference is replaced by the value of the specified
380
+ variable or cache entry, or if neither is set, by the empty string.
381
+ Variable references can nest and are evaluated from the
382
+ inside out, e.g. \fB${outer_${inner_variable}_variable}\fP\&.
383
+ .sp
384
+ Literal variable references may consist of alphanumeric characters,
385
+ the characters \fB/_.+\-\fP, and \fI\%Escape Sequences\fP\&. Nested references
386
+ may be used to evaluate variables of any name. See also policy
387
+ \X'tty: link #policy:CMP0053'\fI\%CMP0053\fP\X'tty: link' documentation for historical considerations and reasons why
388
+ the \fB$\fP is also technically permitted but is discouraged.
389
+ .sp
390
+ The \fI\%Variables\fP section documents the scope of variable names
391
+ and how their values are set.
392
+ .sp
393
+ An \fIenvironment variable reference\fP has the form \fB$ENV{<variable>}\fP\&.
394
+ See the \fI\%Environment Variables\fP section for more information.
395
+ .sp
396
+ A \fIcache variable reference\fP has the form \fB$CACHE{<variable>}\fP,
397
+ and is replaced by the value of the specified cache entry without
398
+ checking for a normal variable of the same name. If the cache
399
+ entry does not exist, it is replaced by the empty string.
400
+ See \X'tty: link #variable:CACHE'\fI\%CACHE\fP\X'tty: link' for more information.
401
+ .sp
402
+ The \X'tty: link #command:if'\fI\%if()\fP\X'tty: link' command has a special condition syntax that
403
+ allows for variable references in the short form \fB<variable>\fP
404
+ instead of \fB${<variable>}\fP\&. However, environment variables
405
+ always need to be referenced as \fB$ENV{<variable>}\fP\&.
406
+ .SS Comments
407
+ .sp
408
+ A comment starts with a \fB#\fP character that is not inside a
409
+ \fI\%Bracket Argument\fP, \fI\%Quoted Argument\fP, or escaped with \fB\e\fP
410
+ as part of an \fI\%Unquoted Argument\fP\&. There are two types of
411
+ comments: a \fI\%Bracket Comment\fP and a \fI\%Line Comment\fP\&.
412
+ .SS Bracket Comment
413
+ .sp
414
+ A \fB#\fP immediately followed by a \fI\%bracket_open\fP forms a
415
+ \fIbracket comment\fP consisting of the entire bracket enclosure:
416
+ .sp
417
+ .nf
418
+ \fBbracket_comment\fP ::= \(aq#\(aq \fI\%bracket_argument\fP
419
+
420
+ .fi
421
+ .sp
422
+ For example:
423
+ .INDENT 0.0
424
+ .INDENT 3.5
425
+ .sp
426
+ .nf
427
+ .ft C
428
+ #[[This is a bracket comment.
429
+ It runs until the close bracket.]]
430
+ message(\(dqFirst Argument\en\(dq #[[Bracket Comment]] \(dqSecond Argument\(dq)
431
+ .ft P
432
+ .fi
433
+ .UNINDENT
434
+ .UNINDENT
435
+ .sp
436
+ \fBNOTE:\fP
437
+ .INDENT 0.0
438
+ .INDENT 3.5
439
+ CMake versions prior to 3.0 do not support bracket comments.
440
+ They interpret the opening \fB#\fP as the start of a \fI\%Line Comment\fP\&.
441
+ .UNINDENT
442
+ .UNINDENT
443
+ .SS Line Comment
444
+ .sp
445
+ A \fB#\fP not immediately followed by a \fI\%bracket_open\fP forms a
446
+ \fIline comment\fP that runs until the end of the line:
447
+ .sp
448
+ .nf
449
+ \fBline_comment\fP ::= \(aq#\(aq <any text not starting in a \fI\%bracket_open\fP
450
+ and not containing a \fI\%newline\fP>
451
+
452
+ .fi
453
+ .sp
454
+ For example:
455
+ .INDENT 0.0
456
+ .INDENT 3.5
457
+ .sp
458
+ .nf
459
+ .ft C
460
+ # This is a line comment.
461
+ message(\(dqFirst Argument\en\(dq # This is a line comment :)
462
+ \(dqSecond Argument\(dq) # This is a line comment.
463
+ .ft P
464
+ .fi
465
+ .UNINDENT
466
+ .UNINDENT
467
+ .SH CONTROL STRUCTURES
468
+ .SS Conditional Blocks
469
+ .sp
470
+ The \X'tty: link #command:if'\fI\%if()\fP\X'tty: link'/\X'tty: link #command:elseif'\fI\%elseif()\fP\X'tty: link'/\X'tty: link #command:else'\fI\%else()\fP\X'tty: link'/\X'tty: link #command:endif'\fI\%endif()\fP\X'tty: link'
471
+ commands delimit code blocks to be executed conditionally.
472
+ .SS Loops
473
+ .sp
474
+ The \X'tty: link #command:foreach'\fI\%foreach()\fP\X'tty: link'/\X'tty: link #command:endforeach'\fI\%endforeach()\fP\X'tty: link' and
475
+ \X'tty: link #command:while'\fI\%while()\fP\X'tty: link'/\X'tty: link #command:endwhile'\fI\%endwhile()\fP\X'tty: link' commands delimit code
476
+ blocks to be executed in a loop. Inside such blocks the
477
+ \X'tty: link #command:break'\fI\%break()\fP\X'tty: link' command may be used to terminate the loop
478
+ early whereas the \X'tty: link #command:continue'\fI\%continue()\fP\X'tty: link' command may be used
479
+ to start with the next iteration immediately.
480
+ .SS Command Definitions
481
+ .sp
482
+ The \X'tty: link #command:macro'\fI\%macro()\fP\X'tty: link'/\X'tty: link #command:endmacro'\fI\%endmacro()\fP\X'tty: link', and
483
+ \X'tty: link #command:function'\fI\%function()\fP\X'tty: link'/\X'tty: link #command:endfunction'\fI\%endfunction()\fP\X'tty: link' commands delimit
484
+ code blocks to be recorded for later invocation as commands.
485
+ .SH VARIABLES
486
+ .sp
487
+ Variables are the basic unit of storage in the CMake Language.
488
+ Their values are always of string type, though some commands may
489
+ interpret the strings as values of other types.
490
+ The \X'tty: link #command:set'\fI\%set()\fP\X'tty: link' and \X'tty: link #command:unset'\fI\%unset()\fP\X'tty: link' commands explicitly
491
+ set or unset a variable, but other commands have semantics
492
+ that modify variables as well.
493
+ Variable names are case\-sensitive and may consist of almost
494
+ any text, but we recommend sticking to names consisting only
495
+ of alphanumeric characters plus \fB_\fP and \fB\-\fP\&.
496
+ .sp
497
+ Variables have dynamic scope. Each variable \(dqset\(dq or \(dqunset\(dq
498
+ creates a binding in the current scope:
499
+ .INDENT 0.0
500
+ .TP
501
+ .B Block Scope
502
+ The \X'tty: link #command:block'\fI\%block()\fP\X'tty: link' command may create a new scope for variable bindings.
503
+ .TP
504
+ .B Function Scope
505
+ \fI\%Command Definitions\fP created by the \X'tty: link #command:function'\fI\%function()\fP\X'tty: link' command
506
+ create commands that, when invoked, process the recorded commands
507
+ in a new variable binding scope. A variable \(dqset\(dq or \(dqunset\(dq
508
+ binds in this scope and is visible for the current function and
509
+ any nested calls within it, but not after the function returns.
510
+ .TP
511
+ .B Directory Scope
512
+ Each of the \fI\%Directories\fP in a source tree has its own variable
513
+ bindings. Before processing the \fBCMakeLists.txt\fP file for a
514
+ directory, CMake copies all variable bindings currently defined
515
+ in the parent directory, if any, to initialize the new directory
516
+ scope. CMake \fI\%Scripts\fP, when processed with \X'tty: link #cmdoption-cmake-P'\fI\%cmake \-P\fP\X'tty: link',
517
+ bind variables in one \(dqdirectory\(dq scope.
518
+ .sp
519
+ A variable \(dqset\(dq or \(dqunset\(dq not inside a function call binds
520
+ to the current directory scope.
521
+ .TP
522
+ .B Persistent Cache
523
+ CMake stores a separate set of \(dqcache\(dq variables, or \(dqcache entries\(dq,
524
+ whose values persist across multiple runs within a project build
525
+ tree. Cache entries have an isolated binding scope modified only
526
+ by explicit request, such as by the \fBCACHE\fP option of the
527
+ \X'tty: link #command:set'\fI\%set()\fP\X'tty: link' and \X'tty: link #command:unset'\fI\%unset()\fP\X'tty: link' commands.
528
+ .UNINDENT
529
+ .sp
530
+ When evaluating \fI\%Variable References\fP, CMake first searches the
531
+ function call stack, if any, for a binding and then falls back
532
+ to the binding in the current directory scope, if any. If a
533
+ \(dqset\(dq binding is found, its value is used. If an \(dqunset\(dq binding
534
+ is found, or no binding is found, CMake then searches for a
535
+ cache entry. If a cache entry is found, its value is used.
536
+ Otherwise, the variable reference evaluates to an empty string.
537
+ The \fB$CACHE{VAR}\fP syntax can be used to do direct cache entry
538
+ lookups.
539
+ .sp
540
+ The \X'tty: link #manual:cmake-variables(7)'\fI\%cmake\-variables(7)\fP\X'tty: link' manual documents the many variables
541
+ that are provided by CMake or have meaning to CMake when set
542
+ by project code.
543
+ .sp
544
+ \fBNOTE:\fP
545
+ .INDENT 0.0
546
+ .INDENT 3.5
547
+ CMake reserves identifiers that:
548
+ .INDENT 0.0
549
+ .IP \(bu 2
550
+ begin with \fBCMAKE_\fP (upper\-, lower\-, or mixed\-case), or
551
+ .IP \(bu 2
552
+ begin with \fB_CMAKE_\fP (upper\-, lower\-, or mixed\-case), or
553
+ .IP \(bu 2
554
+ begin with \fB_\fP followed by the name of any \X'tty: link #manual:cmake-commands(7)'\fI\%CMake Command\fP\X'tty: link'\&.
555
+ .UNINDENT
556
+ .UNINDENT
557
+ .UNINDENT
558
+ .SH ENVIRONMENT VARIABLES
559
+ .sp
560
+ Environment Variables are like ordinary \fI\%Variables\fP, with the
561
+ following differences:
562
+ .INDENT 0.0
563
+ .TP
564
+ .B Scope
565
+ Environment variables have global scope in a CMake process.
566
+ They are never cached.
567
+ .TP
568
+ .B References
569
+ \fI\%Variable References\fP have the form \fB$ENV{<variable>}\fP, using the
570
+ \X'tty: link #variable:ENV'\fI\%ENV\fP\X'tty: link' operator.
571
+ .TP
572
+ .B Initialization
573
+ Initial values of the CMake environment variables are those of
574
+ the calling process.
575
+ Values can be changed using the \X'tty: link #command:set'\fI\%set()\fP\X'tty: link' and \X'tty: link #command:unset'\fI\%unset()\fP\X'tty: link'
576
+ commands.
577
+ These commands only affect the running CMake process,
578
+ not the system environment at large.
579
+ Changed values are not written back to the calling process,
580
+ and they are not seen by subsequent build or test processes.
581
+ .sp
582
+ See the \X'tty: link #cmdoption-cmake-E-arg-env'\fI\%cmake \-E env\fP\X'tty: link' command\-line
583
+ tool to run a command in a modified environment.
584
+ .TP
585
+ .B Inspection
586
+ See the \X'tty: link #cmdoption-cmake-E-arg-environment'\fI\%cmake \-E environment\fP\X'tty: link' command\-line
587
+ tool to display all current environment variables.
588
+ .UNINDENT
589
+ .sp
590
+ The \X'tty: link #manual:cmake-env-variables(7)'\fI\%cmake\-env\-variables(7)\fP\X'tty: link' manual documents environment
591
+ variables that have special meaning to CMake.
592
+ .SH LISTS
593
+ .sp
594
+ Although all values in CMake are stored as strings, a string
595
+ may be treated as a list in certain contexts, such as during
596
+ evaluation of an \fI\%Unquoted Argument\fP\&. In such contexts, a string
597
+ is divided into list elements by splitting on \fB;\fP characters not
598
+ following an unequal number of \fB[\fP and \fB]\fP characters and not
599
+ immediately preceded by a \fB\e\fP\&. The sequence \fB\e;\fP does not
600
+ divide a value but is replaced by \fB;\fP in the resulting element.
601
+ .sp
602
+ A list of elements is represented as a string by concatenating
603
+ the elements separated by \fB;\fP\&. For example, the \X'tty: link #command:set'\fI\%set()\fP\X'tty: link'
604
+ command stores multiple values into the destination variable
605
+ as a list:
606
+ .INDENT 0.0
607
+ .INDENT 3.5
608
+ .sp
609
+ .nf
610
+ .ft C
611
+ set(srcs a.c b.c c.c) # sets \(dqsrcs\(dq to \(dqa.c;b.c;c.c\(dq
612
+ .ft P
613
+ .fi
614
+ .UNINDENT
615
+ .UNINDENT
616
+ .sp
617
+ Lists are meant for simple use cases such as a list of source
618
+ files and should not be used for complex data processing tasks.
619
+ Most commands that construct lists do not escape \fB;\fP characters
620
+ in list elements, thus flattening nested lists:
621
+ .INDENT 0.0
622
+ .INDENT 3.5
623
+ .sp
624
+ .nf
625
+ .ft C
626
+ set(x a \(dqb;c\(dq) # sets \(dqx\(dq to \(dqa;b;c\(dq, not \(dqa;b\e;c\(dq
627
+ .ft P
628
+ .fi
629
+ .UNINDENT
630
+ .UNINDENT
631
+ .sp
632
+ In general, lists do not support elements containing \fB;\fP characters.
633
+ To avoid problems, consider the following advice:
634
+ .INDENT 0.0
635
+ .IP \(bu 2
636
+ The interfaces of many CMake commands, variables, and properties accept
637
+ semicolon\-separated lists. Avoid passing lists with elements containing
638
+ semicolons to these interfaces unless they document either direct support
639
+ or some way to escape or encode semicolons.
640
+ .IP \(bu 2
641
+ When constructing a list, substitute an otherwise\-unused placeholder
642
+ for \fB;\fP in elements when. Then substitute \fB;\fP for the placeholder
643
+ when processing list elements.
644
+ For example, the following code uses \fB|\fP in place of \fB;\fP characters:
645
+ .INDENT 2.0
646
+ .INDENT 3.5
647
+ .sp
648
+ .nf
649
+ .ft C
650
+ set(mylist a \(dqb|c\(dq)
651
+ foreach(entry IN LISTS mylist)
652
+ string(REPLACE \(dq|\(dq \(dq;\(dq entry \(dq${entry}\(dq)
653
+ # use \(dq${entry}\(dq normally
654
+ endforeach()
655
+ .ft P
656
+ .fi
657
+ .UNINDENT
658
+ .UNINDENT
659
+ .sp
660
+ The \X'tty: link #module:ExternalProject'\fI\%ExternalProject\fP\X'tty: link' module\(aqs \fBLIST_SEPARATOR\fP option is an
661
+ example of an interface built using this approach.
662
+ .IP \(bu 2
663
+ In lists of \X'tty: link #manual:cmake-generator-expressions(7)'\fI\%generator expressions\fP\X'tty: link',
664
+ use the \X'tty: link #genex:SEMICOLON'\fI\%$<SEMICOLON>\fP\X'tty: link' generator expression.
665
+ .IP \(bu 2
666
+ In command calls, use \fI\%Quoted Argument\fP syntax whenever possible.
667
+ The called command will receive the content of the argument with
668
+ semicolons preserved. An \fI\%Unquoted Argument\fP will be split on
669
+ semicolons.
670
+ .IP \(bu 2
671
+ In \X'tty: link #command:function'\fI\%function()\fP\X'tty: link' implementations, avoid \fBARGV\fP and \fBARGN\fP,
672
+ which do not distinguish semicolons in values from those separating values.
673
+ Instead, prefer using named positional arguments and the \fBARGC\fP and
674
+ \fBARGV#\fP variables.
675
+ When using \X'tty: link #command:cmake_parse_arguments'\fI\%cmake_parse_arguments()\fP\X'tty: link' to parse arguments, prefer
676
+ its \fBPARSE_ARGV\fP signature, which uses the \fBARGV#\fP variables.
677
+ .sp
678
+ Note that this approach does not apply to \X'tty: link #command:macro'\fI\%macro()\fP\X'tty: link' implementations
679
+ because they reference arguments using placeholders, not real variables.
680
+ .UNINDENT
681
+ .SH COPYRIGHT
682
+ 2000-2024 Kitware, Inc. and Contributors
683
+ .\" Generated by docutils manpage writer.
684
+ .
cmake/man/man7/cmake-modules.7 ADDED
The diff for this file is too large to render. See raw diff
 
cmake/man/man7/cmake-packages.7 ADDED
@@ -0,0 +1,899 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .\" Man page generated from reStructuredText.
2
+ .
3
+ .
4
+ .nr rst2man-indent-level 0
5
+ .
6
+ .de1 rstReportMargin
7
+ \\$1 \\n[an-margin]
8
+ level \\n[rst2man-indent-level]
9
+ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
10
+ -
11
+ \\n[rst2man-indent0]
12
+ \\n[rst2man-indent1]
13
+ \\n[rst2man-indent2]
14
+ ..
15
+ .de1 INDENT
16
+ .\" .rstReportMargin pre:
17
+ . RS \\$1
18
+ . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
19
+ . nr rst2man-indent-level +1
20
+ .\" .rstReportMargin post:
21
+ ..
22
+ .de UNINDENT
23
+ . RE
24
+ .\" indent \\n[an-margin]
25
+ .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
26
+ .nr rst2man-indent-level -1
27
+ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
28
+ .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
29
+ ..
30
+ .TH "CMAKE-PACKAGES" "7" "Jan 10, 2025" "3.31.4" "CMake"
31
+ .SH NAME
32
+ cmake-packages \- CMake Packages Reference
33
+ .SH INTRODUCTION
34
+ .sp
35
+ Packages provide dependency information to CMake based buildsystems. Packages
36
+ are found with the \X'tty: link #command:find_package'\fI\%find_package()\fP\X'tty: link' command. The result of
37
+ using \X'tty: link #command:find_package'\fI\%find_package()\fP\X'tty: link' is either a set of \X'tty: link #prop_tgt:IMPORTED'\fI\%IMPORTED\fP\X'tty: link' targets, or
38
+ a set of variables corresponding to build\-relevant information.
39
+ .SH USING PACKAGES
40
+ .sp
41
+ CMake provides direct support for two forms of packages,
42
+ \fI\%Config\-file Packages\fP and \fI\%Find\-module Packages\fP\&.
43
+ Indirect support for \fBpkg\-config\fP packages is also provided via
44
+ the \X'tty: link #module:FindPkgConfig'\fI\%FindPkgConfig\fP\X'tty: link' module. In all cases, the basic form
45
+ of \X'tty: link #command:find_package'\fI\%find_package()\fP\X'tty: link' calls is the same:
46
+ .INDENT 0.0
47
+ .INDENT 3.5
48
+ .sp
49
+ .nf
50
+ .ft C
51
+ find_package(Qt4 4.7.0 REQUIRED) # CMake provides a Qt4 find\-module
52
+ find_package(Qt5Core 5.1.0 REQUIRED) # Qt provides a Qt5 package config file.
53
+ find_package(LibXml2 REQUIRED) # Use pkg\-config via the LibXml2 find\-module
54
+ .ft P
55
+ .fi
56
+ .UNINDENT
57
+ .UNINDENT
58
+ .sp
59
+ In cases where it is known that a package configuration file is provided by
60
+ upstream, and only that should be used, the \fBCONFIG\fP keyword may be passed
61
+ to \X'tty: link #command:find_package'\fI\%find_package()\fP\X'tty: link':
62
+ .INDENT 0.0
63
+ .INDENT 3.5
64
+ .sp
65
+ .nf
66
+ .ft C
67
+ find_package(Qt5Core 5.1.0 CONFIG REQUIRED)
68
+ find_package(Qt5Gui 5.1.0 CONFIG)
69
+ .ft P
70
+ .fi
71
+ .UNINDENT
72
+ .UNINDENT
73
+ .sp
74
+ Similarly, the \fBMODULE\fP keyword says to use only a find\-module:
75
+ .INDENT 0.0
76
+ .INDENT 3.5
77
+ .sp
78
+ .nf
79
+ .ft C
80
+ find_package(Qt4 4.7.0 MODULE REQUIRED)
81
+ .ft P
82
+ .fi
83
+ .UNINDENT
84
+ .UNINDENT
85
+ .sp
86
+ Specifying the type of package explicitly improves the error message shown to
87
+ the user if it is not found.
88
+ .sp
89
+ Both types of packages also support specifying components of a package,
90
+ either after the \fBREQUIRED\fP keyword:
91
+ .INDENT 0.0
92
+ .INDENT 3.5
93
+ .sp
94
+ .nf
95
+ .ft C
96
+ find_package(Qt5 5.1.0 CONFIG REQUIRED Widgets Xml Sql)
97
+ .ft P
98
+ .fi
99
+ .UNINDENT
100
+ .UNINDENT
101
+ .sp
102
+ or as a separate \fBCOMPONENTS\fP list:
103
+ .INDENT 0.0
104
+ .INDENT 3.5
105
+ .sp
106
+ .nf
107
+ .ft C
108
+ find_package(Qt5 5.1.0 COMPONENTS Widgets Xml Sql)
109
+ .ft P
110
+ .fi
111
+ .UNINDENT
112
+ .UNINDENT
113
+ .sp
114
+ or as a separate \fBOPTIONAL_COMPONENTS\fP list:
115
+ .INDENT 0.0
116
+ .INDENT 3.5
117
+ .sp
118
+ .nf
119
+ .ft C
120
+ find_package(Qt5 5.1.0 COMPONENTS Widgets
121
+ OPTIONAL_COMPONENTS Xml Sql
122
+ )
123
+ .ft P
124
+ .fi
125
+ .UNINDENT
126
+ .UNINDENT
127
+ .sp
128
+ Handling of \fBCOMPONENTS\fP and \fBOPTIONAL_COMPONENTS\fP is defined by the
129
+ package.
130
+ .sp
131
+ By setting the \X'tty: link #variable:CMAKE_DISABLE_FIND_PACKAGE_<PackageName>'\fI\%CMAKE_DISABLE_FIND_PACKAGE_<PackageName>\fP\X'tty: link' variable to
132
+ \fBTRUE\fP, the \fB<PackageName>\fP package will not be searched, and will always
133
+ be \fBNOTFOUND\fP\&. Likewise, setting the
134
+ \X'tty: link #variable:CMAKE_REQUIRE_FIND_PACKAGE_<PackageName>'\fI\%CMAKE_REQUIRE_FIND_PACKAGE_<PackageName>\fP\X'tty: link' to \fBTRUE\fP will make the
135
+ package REQUIRED.
136
+ .SS Config\-file Packages
137
+ .sp
138
+ A config\-file package is a set of files provided by upstreams for downstreams
139
+ to use. CMake searches in a number of locations for package configuration files, as
140
+ described in the \X'tty: link #command:find_package'\fI\%find_package()\fP\X'tty: link' documentation. The most simple way for
141
+ a CMake user to tell \X'tty: link #manual:cmake(1)'\fI\%cmake(1)\fP\X'tty: link' to search in a non\-standard prefix for
142
+ a package is to set the \fBCMAKE_PREFIX_PATH\fP cache variable.
143
+ .sp
144
+ Config\-file packages are provided by upstream vendors as part of development
145
+ packages, that is, they belong with the header files and any other files
146
+ provided to assist downstreams in using the package.
147
+ .sp
148
+ A set of variables which provide package status information are also set
149
+ automatically when using a config\-file package. The \fB<PackageName>_FOUND\fP
150
+ variable is set to true or false, depending on whether the package was
151
+ found. The \fB<PackageName>_DIR\fP cache variable is set to the location of the
152
+ package configuration file.
153
+ .SS Find\-module Packages
154
+ .sp
155
+ A find module is a file with a set of rules for finding the required pieces of
156
+ a dependency, primarily header files and libraries. Typically, a find module
157
+ is needed when the upstream is not built with CMake, or is not CMake\-aware
158
+ enough to otherwise provide a package configuration file. Unlike a package configuration
159
+ file, it is not shipped with upstream, but is used by downstream to find the
160
+ files by guessing locations of files with platform\-specific hints.
161
+ .sp
162
+ Unlike the case of an upstream\-provided package configuration file, no single point
163
+ of reference identifies the package as being found, so the \fB<PackageName>_FOUND\fP
164
+ variable is not automatically set by the \X'tty: link #command:find_package'\fI\%find_package()\fP\X'tty: link' command. It
165
+ can still be expected to be set by convention however and should be set by
166
+ the author of the Find\-module. Similarly there is no \fB<PackageName>_DIR\fP variable,
167
+ but each of the artifacts such as library locations and header file locations
168
+ provide a separate cache variable.
169
+ .sp
170
+ See the \X'tty: link #manual:cmake-developer(7)'\fI\%cmake\-developer(7)\fP\X'tty: link' manual for more information about creating
171
+ Find\-module files.
172
+ .SH PACKAGE LAYOUT
173
+ .sp
174
+ A config\-file package consists of a \fI\%Package Configuration File\fP and
175
+ optionally a \fI\%Package Version File\fP provided with the project distribution.
176
+ .SS Package Configuration File
177
+ .sp
178
+ Consider a project \fBFoo\fP that installs the following files:
179
+ .INDENT 0.0
180
+ .INDENT 3.5
181
+ .sp
182
+ .nf
183
+ .ft C
184
+ <prefix>/include/foo\-1.2/foo.h
185
+ <prefix>/lib/foo\-1.2/libfoo.a
186
+ .ft P
187
+ .fi
188
+ .UNINDENT
189
+ .UNINDENT
190
+ .sp
191
+ It may also provide a CMake package configuration file:
192
+ .INDENT 0.0
193
+ .INDENT 3.5
194
+ .sp
195
+ .nf
196
+ .ft C
197
+ <prefix>/lib/cmake/foo\-1.2/FooConfig.cmake
198
+ .ft P
199
+ .fi
200
+ .UNINDENT
201
+ .UNINDENT
202
+ .sp
203
+ with content defining \X'tty: link #prop_tgt:IMPORTED'\fI\%IMPORTED\fP\X'tty: link' targets, or defining variables, such
204
+ as:
205
+ .INDENT 0.0
206
+ .INDENT 3.5
207
+ .sp
208
+ .nf
209
+ .ft C
210
+ # ...
211
+ # (compute PREFIX relative to file location)
212
+ # ...
213
+ set(Foo_INCLUDE_DIRS ${PREFIX}/include/foo\-1.2)
214
+ set(Foo_LIBRARIES ${PREFIX}/lib/foo\-1.2/libfoo.a)
215
+ .ft P
216
+ .fi
217
+ .UNINDENT
218
+ .UNINDENT
219
+ .sp
220
+ If another project wishes to use \fBFoo\fP it need only to locate the \fBFooConfig.cmake\fP
221
+ file and load it to get all the information it needs about package content
222
+ locations. Since the package configuration file is provided by the package
223
+ installation it already knows all the file locations.
224
+ .sp
225
+ The \X'tty: link #command:find_package'\fI\%find_package()\fP\X'tty: link' command may be used to search for the package
226
+ configuration file. This command constructs a set of installation prefixes
227
+ and searches under each prefix in several locations. Given the name \fBFoo\fP,
228
+ it looks for a file called \fBFooConfig.cmake\fP or \fBfoo\-config.cmake\fP\&.
229
+ The full set of locations is specified in the \X'tty: link #command:find_package'\fI\%find_package()\fP\X'tty: link' command
230
+ documentation. One place it looks is:
231
+ .INDENT 0.0
232
+ .INDENT 3.5
233
+ .sp
234
+ .nf
235
+ .ft C
236
+ <prefix>/lib/cmake/Foo*/
237
+ .ft P
238
+ .fi
239
+ .UNINDENT
240
+ .UNINDENT
241
+ .sp
242
+ where \fBFoo*\fP is a case\-insensitive globbing expression. In our example the
243
+ globbing expression will match \fB<prefix>/lib/cmake/foo\-1.2\fP and the package
244
+ configuration file will be found.
245
+ .sp
246
+ Once found, a package configuration file is immediately loaded. It, together
247
+ with a package version file, contains all the information the project needs to
248
+ use the package.
249
+ .SS Package Version File
250
+ .sp
251
+ When the \X'tty: link #command:find_package'\fI\%find_package()\fP\X'tty: link' command finds a candidate package configuration
252
+ file it looks next to it for a version file. The version file is loaded to test
253
+ whether the package version is an acceptable match for the version requested.
254
+ If the version file claims compatibility the configuration file is accepted.
255
+ Otherwise it is ignored.
256
+ .sp
257
+ The name of the package version file must match that of the package configuration
258
+ file but has either \fB\-version\fP or \fBVersion\fP appended to the name before
259
+ the \fB\&.cmake\fP extension. For example, the files:
260
+ .INDENT 0.0
261
+ .INDENT 3.5
262
+ .sp
263
+ .nf
264
+ .ft C
265
+ <prefix>/lib/cmake/foo\-1.3/foo\-config.cmake
266
+ <prefix>/lib/cmake/foo\-1.3/foo\-config\-version.cmake
267
+ .ft P
268
+ .fi
269
+ .UNINDENT
270
+ .UNINDENT
271
+ .sp
272
+ and:
273
+ .INDENT 0.0
274
+ .INDENT 3.5
275
+ .sp
276
+ .nf
277
+ .ft C
278
+ <prefix>/lib/cmake/bar\-4.2/BarConfig.cmake
279
+ <prefix>/lib/cmake/bar\-4.2/BarConfigVersion.cmake
280
+ .ft P
281
+ .fi
282
+ .UNINDENT
283
+ .UNINDENT
284
+ .sp
285
+ are each pairs of package configuration files and corresponding package version
286
+ files.
287
+ .sp
288
+ When the \X'tty: link #command:find_package'\fI\%find_package()\fP\X'tty: link' command loads a version file it first sets the
289
+ following variables:
290
+ .INDENT 0.0
291
+ .TP
292
+ .B \fBPACKAGE_FIND_NAME\fP
293
+ The \fB<PackageName>\fP
294
+ .TP
295
+ .B \fBPACKAGE_FIND_VERSION\fP
296
+ Full requested version string
297
+ .TP
298
+ .B \fBPACKAGE_FIND_VERSION_MAJOR\fP
299
+ Major version if requested, else 0
300
+ .TP
301
+ .B \fBPACKAGE_FIND_VERSION_MINOR\fP
302
+ Minor version if requested, else 0
303
+ .TP
304
+ .B \fBPACKAGE_FIND_VERSION_PATCH\fP
305
+ Patch version if requested, else 0
306
+ .TP
307
+ .B \fBPACKAGE_FIND_VERSION_TWEAK\fP
308
+ Tweak version if requested, else 0
309
+ .TP
310
+ .B \fBPACKAGE_FIND_VERSION_COUNT\fP
311
+ Number of version components, 0 to 4
312
+ .UNINDENT
313
+ .sp
314
+ The version file must use these variables to check whether it is compatible or
315
+ an exact match for the requested version and set the following variables with
316
+ results:
317
+ .INDENT 0.0
318
+ .TP
319
+ .B \fBPACKAGE_VERSION\fP
320
+ Full provided version string
321
+ .TP
322
+ .B \fBPACKAGE_VERSION_EXACT\fP
323
+ True if version is exact match
324
+ .TP
325
+ .B \fBPACKAGE_VERSION_COMPATIBLE\fP
326
+ True if version is compatible
327
+ .TP
328
+ .B \fBPACKAGE_VERSION_UNSUITABLE\fP
329
+ True if unsuitable as any version
330
+ .UNINDENT
331
+ .sp
332
+ Version files are loaded in a nested scope so they are free to set any variables
333
+ they wish as part of their computation. The find_package command wipes out the
334
+ scope when the version file has completed and it has checked the output
335
+ variables. When the version file claims to be an acceptable match for the
336
+ requested version the find_package command sets the following variables for
337
+ use by the project:
338
+ .INDENT 0.0
339
+ .TP
340
+ .B \fB<PackageName>_VERSION\fP
341
+ Full provided version string
342
+ .TP
343
+ .B \fB<PackageName>_VERSION_MAJOR\fP
344
+ Major version if provided, else 0
345
+ .TP
346
+ .B \fB<PackageName>_VERSION_MINOR\fP
347
+ Minor version if provided, else 0
348
+ .TP
349
+ .B \fB<PackageName>_VERSION_PATCH\fP
350
+ Patch version if provided, else 0
351
+ .TP
352
+ .B \fB<PackageName>_VERSION_TWEAK\fP
353
+ Tweak version if provided, else 0
354
+ .TP
355
+ .B \fB<PackageName>_VERSION_COUNT\fP
356
+ Number of version components, 0 to 4
357
+ .UNINDENT
358
+ .sp
359
+ The variables report the version of the package that was actually found.
360
+ The \fB<PackageName>\fP part of their name matches the argument given to the
361
+ \X'tty: link #command:find_package'\fI\%find_package()\fP\X'tty: link' command.
362
+ .SH CREATING PACKAGES
363
+ .sp
364
+ Usually, the upstream depends on CMake itself and can use some CMake facilities
365
+ for creating the package files. Consider an upstream which provides a single
366
+ shared library:
367
+ .INDENT 0.0
368
+ .INDENT 3.5
369
+ .sp
370
+ .nf
371
+ .ft C
372
+ project(UpstreamLib)
373
+
374
+ set(CMAKE_INCLUDE_CURRENT_DIR ON)
375
+ set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)
376
+
377
+ set(Upstream_VERSION 3.4.1)
378
+
379
+ include(GenerateExportHeader)
380
+
381
+ add_library(ClimbingStats SHARED climbingstats.cpp)
382
+ generate_export_header(ClimbingStats)
383
+ set_property(TARGET ClimbingStats PROPERTY VERSION ${Upstream_VERSION})
384
+ set_property(TARGET ClimbingStats PROPERTY SOVERSION 3)
385
+ set_property(TARGET ClimbingStats PROPERTY
386
+ INTERFACE_ClimbingStats_MAJOR_VERSION 3)
387
+ set_property(TARGET ClimbingStats APPEND PROPERTY
388
+ COMPATIBLE_INTERFACE_STRING ClimbingStats_MAJOR_VERSION
389
+ )
390
+
391
+ install(TARGETS ClimbingStats EXPORT ClimbingStatsTargets
392
+ LIBRARY DESTINATION lib
393
+ ARCHIVE DESTINATION lib
394
+ RUNTIME DESTINATION bin
395
+ INCLUDES DESTINATION include
396
+ )
397
+ install(
398
+ FILES
399
+ climbingstats.h
400
+ \(dq${CMAKE_CURRENT_BINARY_DIR}/climbingstats_export.h\(dq
401
+ DESTINATION
402
+ include
403
+ COMPONENT
404
+ Devel
405
+ )
406
+
407
+ include(CMakePackageConfigHelpers)
408
+ write_basic_package_version_file(
409
+ \(dq${CMAKE_CURRENT_BINARY_DIR}/ClimbingStats/ClimbingStatsConfigVersion.cmake\(dq
410
+ VERSION ${Upstream_VERSION}
411
+ COMPATIBILITY AnyNewerVersion
412
+ )
413
+
414
+ export(EXPORT ClimbingStatsTargets
415
+ FILE \(dq${CMAKE_CURRENT_BINARY_DIR}/ClimbingStats/ClimbingStatsTargets.cmake\(dq
416
+ NAMESPACE Upstream::
417
+ )
418
+ configure_file(cmake/ClimbingStatsConfig.cmake
419
+ \(dq${CMAKE_CURRENT_BINARY_DIR}/ClimbingStats/ClimbingStatsConfig.cmake\(dq
420
+ COPYONLY
421
+ )
422
+
423
+ set(ConfigPackageLocation lib/cmake/ClimbingStats)
424
+ install(EXPORT ClimbingStatsTargets
425
+ FILE
426
+ ClimbingStatsTargets.cmake
427
+ NAMESPACE
428
+ Upstream::
429
+ DESTINATION
430
+ ${ConfigPackageLocation}
431
+ )
432
+ install(
433
+ FILES
434
+ cmake/ClimbingStatsConfig.cmake
435
+ \(dq${CMAKE_CURRENT_BINARY_DIR}/ClimbingStats/ClimbingStatsConfigVersion.cmake\(dq
436
+ DESTINATION
437
+ ${ConfigPackageLocation}
438
+ COMPONENT
439
+ Devel
440
+ )
441
+ .ft P
442
+ .fi
443
+ .UNINDENT
444
+ .UNINDENT
445
+ .sp
446
+ The \X'tty: link #module:CMakePackageConfigHelpers'\fI\%CMakePackageConfigHelpers\fP\X'tty: link' module provides a macro for creating
447
+ a simple \fBConfigVersion.cmake\fP file. This file sets the version of the
448
+ package. It is read by CMake when \X'tty: link #command:find_package'\fI\%find_package()\fP\X'tty: link' is called to
449
+ determine the compatibility with the requested version, and to set some
450
+ version\-specific variables \fB<PackageName>_VERSION\fP, \fB<PackageName>_VERSION_MAJOR\fP,
451
+ \fB<PackageName>_VERSION_MINOR\fP etc. The \X'tty: link #export'\fI\%install(EXPORT)\fP\X'tty: link' command is
452
+ used to export the targets in the \fBClimbingStatsTargets\fP export\-set, defined
453
+ previously by the \X'tty: link #targets'\fI\%install(TARGETS)\fP\X'tty: link' command. This command generates
454
+ the \fBClimbingStatsTargets.cmake\fP file to contain \X'tty: link #prop_tgt:IMPORTED'\fI\%IMPORTED\fP\X'tty: link'
455
+ targets, suitable for use by downstreams and arranges to install it to
456
+ \fBlib/cmake/ClimbingStats\fP\&. The generated \fBClimbingStatsConfigVersion.cmake\fP
457
+ and a \fBcmake/ClimbingStatsConfig.cmake\fP are installed to the same location,
458
+ completing the package.
459
+ .sp
460
+ The generated \X'tty: link #prop_tgt:IMPORTED'\fI\%IMPORTED\fP\X'tty: link' targets have appropriate properties set
461
+ to define their \X'tty: link #target-usage-requirements'\fI\%usage requirements\fP\X'tty: link', such as
462
+ \X'tty: link #prop_tgt:INTERFACE_INCLUDE_DIRECTORIES'\fI\%INTERFACE_INCLUDE_DIRECTORIES\fP\X'tty: link',
463
+ \X'tty: link #prop_tgt:INTERFACE_COMPILE_DEFINITIONS'\fI\%INTERFACE_COMPILE_DEFINITIONS\fP\X'tty: link' and other relevant built\-in
464
+ \fBINTERFACE_\fP properties. The \fBINTERFACE\fP variant of user\-defined
465
+ properties listed in \X'tty: link #prop_tgt:COMPATIBLE_INTERFACE_STRING'\fI\%COMPATIBLE_INTERFACE_STRING\fP\X'tty: link' and
466
+ other \X'tty: link #compatible-interface-properties'\fI\%Compatible Interface Properties\fP\X'tty: link' are also propagated to the
467
+ generated \X'tty: link #prop_tgt:IMPORTED'\fI\%IMPORTED\fP\X'tty: link' targets. In the above case,
468
+ \fBClimbingStats_MAJOR_VERSION\fP is defined as a string which must be
469
+ compatible among the dependencies of any depender. By setting this custom
470
+ defined user property in this version and in the next version of
471
+ \fBClimbingStats\fP, \X'tty: link #manual:cmake(1)'\fI\%cmake(1)\fP\X'tty: link' will issue a diagnostic if there is an
472
+ attempt to use version 3 together with version 4. Packages can choose to
473
+ employ such a pattern if different major versions of the package are designed
474
+ to be incompatible.
475
+ .sp
476
+ A \fBNAMESPACE\fP with double\-colons is specified when exporting the targets
477
+ for installation. This convention of double\-colons gives CMake a hint that
478
+ the name is an \X'tty: link #prop_tgt:IMPORTED'\fI\%IMPORTED\fP\X'tty: link' target when it is used by downstreams
479
+ with the \X'tty: link #command:target_link_libraries'\fI\%target_link_libraries()\fP\X'tty: link' command. This way, CMake can
480
+ issue a diagnostic if the package providing it has not yet been found.
481
+ .sp
482
+ In this case, when using \X'tty: link #targets'\fI\%install(TARGETS)\fP\X'tty: link' the \fBINCLUDES DESTINATION\fP
483
+ was specified. This causes the \fBIMPORTED\fP targets to have their
484
+ \X'tty: link #prop_tgt:INTERFACE_INCLUDE_DIRECTORIES'\fI\%INTERFACE_INCLUDE_DIRECTORIES\fP\X'tty: link' populated with the \fBinclude\fP
485
+ directory in the \X'tty: link #variable:CMAKE_INSTALL_PREFIX'\fI\%CMAKE_INSTALL_PREFIX\fP\X'tty: link'\&. When the \fBIMPORTED\fP
486
+ target is used by downstream, it automatically consumes the entries from
487
+ that property.
488
+ .SS Creating a Package Configuration File
489
+ .sp
490
+ In this case, the \fBClimbingStatsConfig.cmake\fP file could be as simple as:
491
+ .INDENT 0.0
492
+ .INDENT 3.5
493
+ .sp
494
+ .nf
495
+ .ft C
496
+ include(\(dq${CMAKE_CURRENT_LIST_DIR}/ClimbingStatsTargets.cmake\(dq)
497
+ .ft P
498
+ .fi
499
+ .UNINDENT
500
+ .UNINDENT
501
+ .sp
502
+ As this allows downstreams to use the \fBIMPORTED\fP targets. If any macros
503
+ should be provided by the \fBClimbingStats\fP package, they should
504
+ be in a separate file which is installed to the same location as the
505
+ \fBClimbingStatsConfig.cmake\fP file, and included from there.
506
+ .sp
507
+ This can also be extended to cover dependencies:
508
+ .INDENT 0.0
509
+ .INDENT 3.5
510
+ .sp
511
+ .nf
512
+ .ft C
513
+ # ...
514
+ add_library(ClimbingStats SHARED climbingstats.cpp)
515
+ generate_export_header(ClimbingStats)
516
+
517
+ find_package(Stats 2.6.4 REQUIRED)
518
+ target_link_libraries(ClimbingStats PUBLIC Stats::Types)
519
+ .ft P
520
+ .fi
521
+ .UNINDENT
522
+ .UNINDENT
523
+ .sp
524
+ As the \fBStats::Types\fP target is a \fBPUBLIC\fP dependency of \fBClimbingStats\fP,
525
+ downstreams must also find the \fBStats\fP package and link to the \fBStats::Types\fP
526
+ library. The \fBStats\fP package should be found in the \fBClimbingStatsConfig.cmake\fP
527
+ file to ensure this. The \fBfind_dependency\fP macro from the
528
+ \X'tty: link #module:CMakeFindDependencyMacro'\fI\%CMakeFindDependencyMacro\fP\X'tty: link' helps with this by propagating
529
+ whether the package is \fBREQUIRED\fP, or \fBQUIET\fP etc. All \fBREQUIRED\fP
530
+ dependencies of a package should be found in the \fBConfig.cmake\fP file:
531
+ .INDENT 0.0
532
+ .INDENT 3.5
533
+ .sp
534
+ .nf
535
+ .ft C
536
+ include(CMakeFindDependencyMacro)
537
+ find_dependency(Stats 2.6.4)
538
+
539
+ include(\(dq${CMAKE_CURRENT_LIST_DIR}/ClimbingStatsTargets.cmake\(dq)
540
+ include(\(dq${CMAKE_CURRENT_LIST_DIR}/ClimbingStatsMacros.cmake\(dq)
541
+ .ft P
542
+ .fi
543
+ .UNINDENT
544
+ .UNINDENT
545
+ .sp
546
+ The \fBfind_dependency\fP macro also sets \fBClimbingStats_FOUND\fP to \fBFalse\fP if
547
+ the dependency is not found, along with a diagnostic that the \fBClimbingStats\fP
548
+ package can not be used without the \fBStats\fP package.
549
+ .sp
550
+ If \fBCOMPONENTS\fP are specified when the downstream uses \X'tty: link #command:find_package'\fI\%find_package()\fP\X'tty: link',
551
+ they are listed in the \fB<PackageName>_FIND_COMPONENTS\fP variable. If a particular
552
+ component is non\-optional, then the \fB<PackageName>_FIND_REQUIRED_<comp>\fP will
553
+ be true. This can be tested with logic in the package configuration file:
554
+ .INDENT 0.0
555
+ .INDENT 3.5
556
+ .sp
557
+ .nf
558
+ .ft C
559
+ include(CMakeFindDependencyMacro)
560
+ find_dependency(Stats 2.6.4)
561
+
562
+ include(\(dq${CMAKE_CURRENT_LIST_DIR}/ClimbingStatsTargets.cmake\(dq)
563
+ include(\(dq${CMAKE_CURRENT_LIST_DIR}/ClimbingStatsMacros.cmake\(dq)
564
+
565
+ set(_ClimbingStats_supported_components Plot Table)
566
+
567
+ foreach(_comp ${ClimbingStats_FIND_COMPONENTS})
568
+ if (NOT \(dq;${_ClimbingStats_supported_components};\(dq MATCHES \(dq;${_comp};\(dq)
569
+ set(ClimbingStats_FOUND False)
570
+ set(ClimbingStats_NOT_FOUND_MESSAGE \(dqUnsupported component: ${_comp}\(dq)
571
+ endif()
572
+ include(\(dq${CMAKE_CURRENT_LIST_DIR}/ClimbingStats${_comp}Targets.cmake\(dq)
573
+ endforeach()
574
+ .ft P
575
+ .fi
576
+ .UNINDENT
577
+ .UNINDENT
578
+ .sp
579
+ Here, the \fBClimbingStats_NOT_FOUND_MESSAGE\fP is set to a diagnosis that the package
580
+ could not be found because an invalid component was specified. This message
581
+ variable can be set for any case where the \fB_FOUND\fP variable is set to \fBFalse\fP,
582
+ and will be displayed to the user.
583
+ .SS Creating a Package Configuration File for the Build Tree
584
+ .sp
585
+ The \X'tty: link #command:export'\fI\%export(EXPORT)\fP\X'tty: link' command creates an \X'tty: link #prop_tgt:IMPORTED'\fI\%IMPORTED\fP\X'tty: link' targets
586
+ definition file which is specific to the build\-tree, and is not relocatable.
587
+ This can similarly be used with a suitable package configuration file and
588
+ package version file to define a package for the build tree which may be used
589
+ without installation. Consumers of the build tree can simply ensure that the
590
+ \X'tty: link #variable:CMAKE_PREFIX_PATH'\fI\%CMAKE_PREFIX_PATH\fP\X'tty: link' contains the build directory, or set the
591
+ \fBClimbingStats_DIR\fP to \fB<build_dir>/ClimbingStats\fP in the cache.
592
+ .SS Creating Relocatable Packages
593
+ .sp
594
+ A relocatable package must not reference absolute paths of files on
595
+ the machine where the package is built that will not exist on the
596
+ machines where the package may be installed.
597
+ .sp
598
+ Packages created by \X'tty: link #export'\fI\%install(EXPORT)\fP\X'tty: link' are designed to be relocatable,
599
+ using paths relative to the location of the package itself. When defining
600
+ the interface of a target for \fBEXPORT\fP, keep in mind that the include
601
+ directories should be specified as relative paths which are relative to the
602
+ \X'tty: link #variable:CMAKE_INSTALL_PREFIX'\fI\%CMAKE_INSTALL_PREFIX\fP\X'tty: link':
603
+ .INDENT 0.0
604
+ .INDENT 3.5
605
+ .sp
606
+ .nf
607
+ .ft C
608
+ target_include_directories(tgt INTERFACE
609
+ # Wrong, not relocatable:
610
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include/TgtName>
611
+ )
612
+
613
+ target_include_directories(tgt INTERFACE
614
+ # Ok, relocatable:
615
+ $<INSTALL_INTERFACE:include/TgtName>
616
+ )
617
+ .ft P
618
+ .fi
619
+ .UNINDENT
620
+ .UNINDENT
621
+ .sp
622
+ The \fB$<INSTALL_PREFIX>\fP
623
+ \X'tty: link #manual:cmake-generator-expressions(7)'\fI\%generator expression\fP\X'tty: link' may be used as
624
+ a placeholder for the install prefix without resulting in a non\-relocatable
625
+ package. This is necessary if complex generator expressions are used:
626
+ .INDENT 0.0
627
+ .INDENT 3.5
628
+ .sp
629
+ .nf
630
+ .ft C
631
+ target_include_directories(tgt INTERFACE
632
+ # Ok, relocatable:
633
+ $<INSTALL_INTERFACE:$<$<CONFIG:Debug>:$<INSTALL_PREFIX>/include/TgtName>>
634
+ )
635
+ .ft P
636
+ .fi
637
+ .UNINDENT
638
+ .UNINDENT
639
+ .sp
640
+ This also applies to paths referencing external dependencies.
641
+ It is not advisable to populate any properties which may contain
642
+ paths, such as \X'tty: link #prop_tgt:INTERFACE_INCLUDE_DIRECTORIES'\fI\%INTERFACE_INCLUDE_DIRECTORIES\fP\X'tty: link' and
643
+ \X'tty: link #prop_tgt:INTERFACE_LINK_LIBRARIES'\fI\%INTERFACE_LINK_LIBRARIES\fP\X'tty: link', with paths relevant to dependencies.
644
+ For example, this code may not work well for a relocatable package:
645
+ .INDENT 0.0
646
+ .INDENT 3.5
647
+ .sp
648
+ .nf
649
+ .ft C
650
+ target_link_libraries(ClimbingStats INTERFACE
651
+ ${Foo_LIBRARIES} ${Bar_LIBRARIES}
652
+ )
653
+ target_include_directories(ClimbingStats INTERFACE
654
+ \(dq$<INSTALL_INTERFACE:${Foo_INCLUDE_DIRS};${Bar_INCLUDE_DIRS}>\(dq
655
+ )
656
+ .ft P
657
+ .fi
658
+ .UNINDENT
659
+ .UNINDENT
660
+ .sp
661
+ The referenced variables may contain the absolute paths to libraries
662
+ and include directories \fBas found on the machine the package was made on\fP\&.
663
+ This would create a package with hard\-coded paths to dependencies and not
664
+ suitable for relocation.
665
+ .sp
666
+ Ideally such dependencies should be used through their own
667
+ \X'tty: link #imported-targets'\fI\%IMPORTED targets\fP\X'tty: link' that have their own
668
+ \X'tty: link #prop_tgt:IMPORTED_LOCATION'\fI\%IMPORTED_LOCATION\fP\X'tty: link' and usage requirement properties
669
+ such as \X'tty: link #prop_tgt:INTERFACE_INCLUDE_DIRECTORIES'\fI\%INTERFACE_INCLUDE_DIRECTORIES\fP\X'tty: link' populated
670
+ appropriately. Those imported targets may then be used with
671
+ the \X'tty: link #command:target_link_libraries'\fI\%target_link_libraries()\fP\X'tty: link' command for \fBClimbingStats\fP:
672
+ .INDENT 0.0
673
+ .INDENT 3.5
674
+ .sp
675
+ .nf
676
+ .ft C
677
+ target_link_libraries(ClimbingStats INTERFACE Foo::Foo Bar::Bar)
678
+ .ft P
679
+ .fi
680
+ .UNINDENT
681
+ .UNINDENT
682
+ .sp
683
+ With this approach the package references its external dependencies
684
+ only through the names of \X'tty: link #imported-targets'\fI\%IMPORTED targets\fP\X'tty: link'\&.
685
+ When a consumer uses the installed package, the consumer will run the
686
+ appropriate \X'tty: link #command:find_package'\fI\%find_package()\fP\X'tty: link' commands (via the \fBfind_dependency\fP
687
+ macro described above) to find the dependencies and populate the
688
+ imported targets with appropriate paths on their own machine.
689
+ .sp
690
+ Unfortunately many \X'tty: link #manual:cmake-modules(7)'\fI\%modules\fP\X'tty: link' shipped with
691
+ CMake do not yet provide \X'tty: link #imported-targets'\fI\%IMPORTED targets\fP\X'tty: link'
692
+ because their development pre\-dated this approach. This may improve
693
+ incrementally over time. Workarounds to create relocatable packages
694
+ using such modules include:
695
+ .INDENT 0.0
696
+ .IP \(bu 2
697
+ When building the package, specify each \fBFoo_LIBRARY\fP cache
698
+ entry as just a library name, e.g. \fB\-DFoo_LIBRARY=foo\fP\&. This
699
+ tells the corresponding find module to populate the \fBFoo_LIBRARIES\fP
700
+ with just \fBfoo\fP to ask the linker to search for the library
701
+ instead of hard\-coding a path.
702
+ .IP \(bu 2
703
+ Or, after installing the package content but before creating the
704
+ package installation binary for redistribution, manually replace
705
+ the absolute paths with placeholders for substitution by the
706
+ installation tool when the package is installed.
707
+ .UNINDENT
708
+ .SH PACKAGE REGISTRY
709
+ .sp
710
+ CMake provides two central locations to register packages that have
711
+ been built or installed anywhere on a system:
712
+ .INDENT 0.0
713
+ .IP \(bu 2
714
+ \fI\%User Package Registry\fP
715
+ .IP \(bu 2
716
+ \fI\%System Package Registry\fP
717
+ .UNINDENT
718
+ .sp
719
+ The registries are especially useful to help projects find packages in
720
+ non\-standard install locations or directly in their own build trees.
721
+ A project may populate either the user or system registry (using its own
722
+ means, see below) to refer to its location.
723
+ In either case the package should store at the registered location a
724
+ \fI\%Package Configuration File\fP (\fB<PackageName>Config.cmake\fP) and optionally a
725
+ \fI\%Package Version File\fP (\fB<PackageName>ConfigVersion.cmake\fP).
726
+ .sp
727
+ The \X'tty: link #command:find_package'\fI\%find_package()\fP\X'tty: link' command searches the two package registries
728
+ as two of the search steps specified in its documentation. If it has
729
+ sufficient permissions it also removes stale package registry entries
730
+ that refer to directories that do not exist or do not contain a matching
731
+ package configuration file.
732
+ .SS User Package Registry
733
+ .sp
734
+ The User Package Registry is stored in a per\-user location.
735
+ The \X'tty: link #package'\fI\%export(PACKAGE)\fP\X'tty: link' command may be used to register a project
736
+ build tree in the user package registry. CMake currently provides no
737
+ interface to add install trees to the user package registry. Installers
738
+ must be manually taught to register their packages if desired.
739
+ .sp
740
+ On Windows the user package registry is stored in the Windows registry
741
+ under a key in \fBHKEY_CURRENT_USER\fP\&.
742
+ .sp
743
+ A \fB<PackageName>\fP may appear under registry key:
744
+ .INDENT 0.0
745
+ .INDENT 3.5
746
+ .sp
747
+ .nf
748
+ .ft C
749
+ HKEY_CURRENT_USER\eSoftware\eKitware\eCMake\ePackages\e<PackageName>
750
+ .ft P
751
+ .fi
752
+ .UNINDENT
753
+ .UNINDENT
754
+ .sp
755
+ as a \fBREG_SZ\fP value, with arbitrary name, that specifies the directory
756
+ containing the package configuration file.
757
+ .sp
758
+ On UNIX platforms the user package registry is stored in the user home
759
+ directory under \fB~/.cmake/packages\fP\&. A \fB<PackageName>\fP may appear under
760
+ the directory:
761
+ .INDENT 0.0
762
+ .INDENT 3.5
763
+ .sp
764
+ .nf
765
+ .ft C
766
+ ~/.cmake/packages/<PackageName>
767
+ .ft P
768
+ .fi
769
+ .UNINDENT
770
+ .UNINDENT
771
+ .sp
772
+ as a file, with arbitrary name, whose content specifies the directory
773
+ containing the package configuration file.
774
+ .SS System Package Registry
775
+ .sp
776
+ The System Package Registry is stored in a system\-wide location.
777
+ CMake currently provides no interface to add to the system package registry.
778
+ Installers must be manually taught to register their packages if desired.
779
+ .sp
780
+ On Windows the system package registry is stored in the Windows registry
781
+ under a key in \fBHKEY_LOCAL_MACHINE\fP\&. A \fB<PackageName>\fP may appear under
782
+ registry key:
783
+ .INDENT 0.0
784
+ .INDENT 3.5
785
+ .sp
786
+ .nf
787
+ .ft C
788
+ HKEY_LOCAL_MACHINE\eSoftware\eKitware\eCMake\ePackages\e<PackageName>
789
+ .ft P
790
+ .fi
791
+ .UNINDENT
792
+ .UNINDENT
793
+ .sp
794
+ as a \fBREG_SZ\fP value, with arbitrary name, that specifies the directory
795
+ containing the package configuration file.
796
+ .sp
797
+ There is no system package registry on non\-Windows platforms.
798
+ .SS Disabling the Package Registry
799
+ .sp
800
+ In some cases using the Package Registries is not desirable. CMake
801
+ allows one to disable them using the following variables:
802
+ .INDENT 0.0
803
+ .IP \(bu 2
804
+ The \X'tty: link #package'\fI\%export(PACKAGE)\fP\X'tty: link' command does not populate the user
805
+ package registry when \X'tty: link #policy:CMP0090'\fI\%CMP0090\fP\X'tty: link' is set to \fBNEW\fP unless the
806
+ \X'tty: link #variable:CMAKE_EXPORT_PACKAGE_REGISTRY'\fI\%CMAKE_EXPORT_PACKAGE_REGISTRY\fP\X'tty: link' variable explicitly enables it.
807
+ When \X'tty: link #policy:CMP0090'\fI\%CMP0090\fP\X'tty: link' is \fInot\fP set to \fBNEW\fP then
808
+ \X'tty: link #package'\fI\%export(PACKAGE)\fP\X'tty: link' populates the user package registry unless
809
+ the \X'tty: link #variable:CMAKE_EXPORT_NO_PACKAGE_REGISTRY'\fI\%CMAKE_EXPORT_NO_PACKAGE_REGISTRY\fP\X'tty: link' variable explicitly
810
+ disables it.
811
+ .IP \(bu 2
812
+ \X'tty: link #variable:CMAKE_FIND_USE_PACKAGE_REGISTRY'\fI\%CMAKE_FIND_USE_PACKAGE_REGISTRY\fP\X'tty: link' disables the
813
+ User Package Registry in all the \X'tty: link #command:find_package'\fI\%find_package()\fP\X'tty: link' calls when
814
+ set to \fBFALSE\fP\&.
815
+ .IP \(bu 2
816
+ Deprecated \X'tty: link #variable:CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY'\fI\%CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY\fP\X'tty: link' disables the
817
+ User Package Registry in all the \X'tty: link #command:find_package'\fI\%find_package()\fP\X'tty: link' calls when set
818
+ to \fBTRUE\fP\&. This variable is ignored when
819
+ \X'tty: link #variable:CMAKE_FIND_USE_PACKAGE_REGISTRY'\fI\%CMAKE_FIND_USE_PACKAGE_REGISTRY\fP\X'tty: link' has been set.
820
+ .IP \(bu 2
821
+ \X'tty: link #variable:CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY'\fI\%CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY\fP\X'tty: link' disables
822
+ the System Package Registry in all the \X'tty: link #command:find_package'\fI\%find_package()\fP\X'tty: link' calls.
823
+ .UNINDENT
824
+ .SS Package Registry Example
825
+ .sp
826
+ A simple convention for naming package registry entries is to use content
827
+ hashes. They are deterministic and unlikely to collide
828
+ (\X'tty: link #package'\fI\%export(PACKAGE)\fP\X'tty: link' uses this approach).
829
+ The name of an entry referencing a specific directory is simply the content
830
+ hash of the directory path itself.
831
+ .sp
832
+ If a project arranges for package registry entries to exist, such as:
833
+ .INDENT 0.0
834
+ .INDENT 3.5
835
+ .sp
836
+ .nf
837
+ .ft C
838
+ > reg query HKCU\eSoftware\eKitware\eCMake\ePackages\eMyPackage
839
+ HKEY_CURRENT_USER\eSoftware\eKitware\eCMake\ePackages\eMyPackage
840
+ 45e7d55f13b87179bb12f907c8de6fc4 REG_SZ c:/Users/Me/Work/lib/cmake/MyPackage
841
+ 7b4a9844f681c80ce93190d4e3185db9 REG_SZ c:/Users/Me/Work/MyPackage\-build
842
+ .ft P
843
+ .fi
844
+ .UNINDENT
845
+ .UNINDENT
846
+ .sp
847
+ or:
848
+ .INDENT 0.0
849
+ .INDENT 3.5
850
+ .sp
851
+ .nf
852
+ .ft C
853
+ $ cat ~/.cmake/packages/MyPackage/7d1fb77e07ce59a81bed093bbee945bd
854
+ /home/me/work/lib/cmake/MyPackage
855
+ $ cat ~/.cmake/packages/MyPackage/f92c1db873a1937f3100706657c63e07
856
+ /home/me/work/MyPackage\-build
857
+ .ft P
858
+ .fi
859
+ .UNINDENT
860
+ .UNINDENT
861
+ .sp
862
+ then the \fBCMakeLists.txt\fP code:
863
+ .INDENT 0.0
864
+ .INDENT 3.5
865
+ .sp
866
+ .nf
867
+ .ft C
868
+ find_package(MyPackage)
869
+ .ft P
870
+ .fi
871
+ .UNINDENT
872
+ .UNINDENT
873
+ .sp
874
+ will search the registered locations for package configuration files
875
+ (\fBMyPackageConfig.cmake\fP). The search order among package registry
876
+ entries for a single package is unspecified and the entry names
877
+ (hashes in this example) have no meaning. Registered locations may
878
+ contain package version files (\fBMyPackageConfigVersion.cmake\fP) to
879
+ tell \X'tty: link #command:find_package'\fI\%find_package()\fP\X'tty: link' whether a specific location is suitable
880
+ for the version requested.
881
+ .SS Package Registry Ownership
882
+ .sp
883
+ Package registry entries are individually owned by the project installations
884
+ that they reference. A package installer is responsible for adding its own
885
+ entry and the corresponding uninstaller is responsible for removing it.
886
+ .sp
887
+ The \X'tty: link #package'\fI\%export(PACKAGE)\fP\X'tty: link' command populates the user package registry
888
+ with the location of a project build tree. Build trees tend to be deleted by
889
+ developers and have no \(dquninstall\(dq event that could trigger removal of their
890
+ entries. In order to keep the registries clean the \X'tty: link #command:find_package'\fI\%find_package()\fP\X'tty: link'
891
+ command automatically removes stale entries it encounters if it has sufficient
892
+ permissions. CMake provides no interface to remove an entry referencing an
893
+ existing build tree once \X'tty: link #package'\fI\%export(PACKAGE)\fP\X'tty: link' has been invoked.
894
+ However, if the project removes its package configuration file from the build
895
+ tree then the entry referencing the location will be considered stale.
896
+ .SH COPYRIGHT
897
+ 2000-2024 Kitware, Inc. and Contributors
898
+ .\" Generated by docutils manpage writer.
899
+ .
cmake/man/man7/cmake-policies.7 ADDED
The diff for this file is too large to render. See raw diff
 
cmake/man/man7/cmake-presets.7 ADDED
@@ -0,0 +1,1550 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .\" Man page generated from reStructuredText.
2
+ .
3
+ .
4
+ .nr rst2man-indent-level 0
5
+ .
6
+ .de1 rstReportMargin
7
+ \\$1 \\n[an-margin]
8
+ level \\n[rst2man-indent-level]
9
+ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
10
+ -
11
+ \\n[rst2man-indent0]
12
+ \\n[rst2man-indent1]
13
+ \\n[rst2man-indent2]
14
+ ..
15
+ .de1 INDENT
16
+ .\" .rstReportMargin pre:
17
+ . RS \\$1
18
+ . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
19
+ . nr rst2man-indent-level +1
20
+ .\" .rstReportMargin post:
21
+ ..
22
+ .de UNINDENT
23
+ . RE
24
+ .\" indent \\n[an-margin]
25
+ .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
26
+ .nr rst2man-indent-level -1
27
+ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
28
+ .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
29
+ ..
30
+ .TH "CMAKE-PRESETS" "7" "Jan 10, 2025" "3.31.4" "CMake"
31
+ .SH NAME
32
+ cmake-presets \- CMakePresets.json
33
+ .SH INTRODUCTION
34
+ .sp
35
+ Added in version 3.19.
36
+
37
+ .sp
38
+ One problem that CMake users often face is sharing settings with other people
39
+ for common ways to configure a project. This may be done to support CI builds,
40
+ or for users who frequently use the same build. CMake supports two main files,
41
+ \fBCMakePresets.json\fP and \fBCMakeUserPresets.json\fP, that allow users to
42
+ specify common configure options and share them with others. CMake also
43
+ supports files included with the \fBinclude\fP field.
44
+ .sp
45
+ \fBCMakePresets.json\fP and \fBCMakeUserPresets.json\fP live in the project\(aqs root
46
+ directory. They both have exactly the same format, and both are optional
47
+ (though at least one must be present if \X'tty: link #cmdoption-cmake-preset'\fI\%\-\-preset\fP\X'tty: link'
48
+ is specified). \fBCMakePresets.json\fP is meant to specify project\-wide build
49
+ details, while \fBCMakeUserPresets.json\fP is meant for developers to specify
50
+ their own local build details.
51
+ .sp
52
+ \fBCMakePresets.json\fP may be checked into a version control system, and
53
+ \fBCMakeUserPresets.json\fP should NOT be checked in. For example, if a
54
+ project is using Git, \fBCMakePresets.json\fP may be tracked, and
55
+ \fBCMakeUserPresets.json\fP should be added to the \fB\&.gitignore\fP\&.
56
+ .SH FORMAT
57
+ .sp
58
+ The files are a JSON document with an object as the root:
59
+ .INDENT 0.0
60
+ .INDENT 3.5
61
+ .sp
62
+ .nf
63
+ .ft C
64
+ {
65
+ \(dqversion\(dq: 10,
66
+ \(dqcmakeMinimumRequired\(dq: {
67
+ \(dqmajor\(dq: 3,
68
+ \(dqminor\(dq: 23,
69
+ \(dqpatch\(dq: 0
70
+ },
71
+ \(dq$comment\(dq: \(dqAn example CMakePresets.json file\(dq,
72
+ \(dqinclude\(dq: [
73
+ \(dqotherThings.json\(dq,
74
+ \(dqmoreThings.json\(dq
75
+ ],
76
+ \(dqconfigurePresets\(dq: [
77
+ {
78
+ \(dq$comment\(dq: [
79
+ \(dqThis is a comment row.\(dq,
80
+ \(dqThis is another comment,\(dq,
81
+ \(dqjust because we can do it\(dq
82
+ ],
83
+ \(dqname\(dq: \(dqdefault\(dq,
84
+ \(dqdisplayName\(dq: \(dqDefault Config\(dq,
85
+ \(dqdescription\(dq: \(dqDefault build using Ninja generator\(dq,
86
+ \(dqgenerator\(dq: \(dqNinja\(dq,
87
+ \(dqbinaryDir\(dq: \(dq${sourceDir}/build/default\(dq,
88
+ \(dqcacheVariables\(dq: {
89
+ \(dqFIRST_CACHE_VARIABLE\(dq: {
90
+ \(dqtype\(dq: \(dqBOOL\(dq,
91
+ \(dqvalue\(dq: \(dqOFF\(dq
92
+ },
93
+ \(dqSECOND_CACHE_VARIABLE\(dq: \(dqON\(dq
94
+ },
95
+ \(dqenvironment\(dq: {
96
+ \(dqMY_ENVIRONMENT_VARIABLE\(dq: \(dqTest\(dq,
97
+ \(dqPATH\(dq: \(dq$env{HOME}/ninja/bin:$penv{PATH}\(dq
98
+ },
99
+ \(dqvendor\(dq: {
100
+ \(dqexample.com/ExampleIDE/1.0\(dq: {
101
+ \(dqautoFormat\(dq: true
102
+ }
103
+ }
104
+ },
105
+ {
106
+ \(dqname\(dq: \(dqninja\-multi\(dq,
107
+ \(dqinherits\(dq: \(dqdefault\(dq,
108
+ \(dqdisplayName\(dq: \(dqNinja Multi\-Config\(dq,
109
+ \(dqdescription\(dq: \(dqDefault build using Ninja Multi\-Config generator\(dq,
110
+ \(dqgenerator\(dq: \(dqNinja Multi\-Config\(dq
111
+ },
112
+ {
113
+ \(dqname\(dq: \(dqwindows\-only\(dq,
114
+ \(dqinherits\(dq: \(dqdefault\(dq,
115
+ \(dqdisplayName\(dq: \(dqWindows\-only configuration\(dq,
116
+ \(dqdescription\(dq: \(dqThis build is only available on Windows\(dq,
117
+ \(dqcondition\(dq: {
118
+ \(dqtype\(dq: \(dqequals\(dq,
119
+ \(dqlhs\(dq: \(dq${hostSystemName}\(dq,
120
+ \(dqrhs\(dq: \(dqWindows\(dq
121
+ }
122
+ }
123
+ ],
124
+ \(dqbuildPresets\(dq: [
125
+ {
126
+ \(dqname\(dq: \(dqdefault\(dq,
127
+ \(dqconfigurePreset\(dq: \(dqdefault\(dq
128
+ }
129
+ ],
130
+ \(dqtestPresets\(dq: [
131
+ {
132
+ \(dqname\(dq: \(dqdefault\(dq,
133
+ \(dqconfigurePreset\(dq: \(dqdefault\(dq,
134
+ \(dqoutput\(dq: {\(dqoutputOnFailure\(dq: true},
135
+ \(dqexecution\(dq: {\(dqnoTestsAction\(dq: \(dqerror\(dq, \(dqstopOnFailure\(dq: true}
136
+ }
137
+ ],
138
+ \(dqpackagePresets\(dq: [
139
+ {
140
+ \(dqname\(dq: \(dqdefault\(dq,
141
+ \(dqconfigurePreset\(dq: \(dqdefault\(dq,
142
+ \(dqgenerators\(dq: [
143
+ \(dqTGZ\(dq
144
+ ]
145
+ }
146
+ ],
147
+ \(dqworkflowPresets\(dq: [
148
+ {
149
+ \(dqname\(dq: \(dqdefault\(dq,
150
+ \(dqsteps\(dq: [
151
+ {
152
+ \(dqtype\(dq: \(dqconfigure\(dq,
153
+ \(dqname\(dq: \(dqdefault\(dq
154
+ },
155
+ {
156
+ \(dqtype\(dq: \(dqbuild\(dq,
157
+ \(dqname\(dq: \(dqdefault\(dq
158
+ },
159
+ {
160
+ \(dqtype\(dq: \(dqtest\(dq,
161
+ \(dqname\(dq: \(dqdefault\(dq
162
+ },
163
+ {
164
+ \(dqtype\(dq: \(dqpackage\(dq,
165
+ \(dqname\(dq: \(dqdefault\(dq
166
+ }
167
+ ]
168
+ }
169
+ ],
170
+ \(dqvendor\(dq: {
171
+ \(dqexample.com/ExampleIDE/1.0\(dq: {
172
+ \(dqautoFormat\(dq: false
173
+ }
174
+ }
175
+ }
176
+
177
+ .ft P
178
+ .fi
179
+ .UNINDENT
180
+ .UNINDENT
181
+ .sp
182
+ Preset files specifying version \fB10\fP or above may include comments using the
183
+ key \fB$comment\fP at any level within the JSON object to provide documentation.
184
+ .sp
185
+ The root object recognizes the following fields:
186
+ .INDENT 0.0
187
+ .TP
188
+ .B \fB$schema\fP
189
+ An optional string that provides a URI to the JSON schema that describes the
190
+ structure of this JSON document. This field is used for validation and
191
+ autocompletion in editors that support JSON schema. It doesn\(aqt affect the
192
+ behavior of the document itself. If this field is not specified, the JSON
193
+ document will still be valid, but tools that use JSON schema for validation
194
+ and autocompletion may not function correctly.
195
+ This is allowed in preset files specifying version \fB8\fP or above.
196
+ .TP
197
+ .B \fBversion\fP
198
+ A required integer representing the version of the JSON schema.
199
+ The supported versions are:
200
+ .INDENT 7.0
201
+ .TP
202
+ .B \fB1\fP
203
+ Added in version 3.19.
204
+
205
+ .TP
206
+ .B \fB2\fP
207
+ Added in version 3.20.
208
+
209
+ .TP
210
+ .B \fB3\fP
211
+ Added in version 3.21.
212
+
213
+ .TP
214
+ .B \fB4\fP
215
+ Added in version 3.23.
216
+
217
+ .TP
218
+ .B \fB5\fP
219
+ Added in version 3.24.
220
+
221
+ .TP
222
+ .B \fB6\fP
223
+ Added in version 3.25.
224
+
225
+ .TP
226
+ .B \fB7\fP
227
+ Added in version 3.27.
228
+
229
+ .TP
230
+ .B \fB8\fP
231
+ Added in version 3.28.
232
+
233
+ .TP
234
+ .B \fB9\fP
235
+ Added in version 3.30.
236
+
237
+ .TP
238
+ .B \fB10\fP
239
+ Added in version 3.31.
240
+
241
+ .UNINDENT
242
+ .TP
243
+ .B \fBcmakeMinimumRequired\fP
244
+ An optional object representing the minimum version of CMake needed to
245
+ build this project. This object consists of the following fields:
246
+ .INDENT 7.0
247
+ .TP
248
+ .B \fBmajor\fP
249
+ An optional integer representing the major version.
250
+ .TP
251
+ .B \fBminor\fP
252
+ An optional integer representing the minor version.
253
+ .TP
254
+ .B \fBpatch\fP
255
+ An optional integer representing the patch version.
256
+ .UNINDENT
257
+ .TP
258
+ .B \fBinclude\fP
259
+ An optional array of strings representing files to include. If the filenames
260
+ are not absolute, they are considered relative to the current file.
261
+ This is allowed in preset files specifying version \fB4\fP or above.
262
+ See \fI\%Includes\fP for discussion of the constraints on included files.
263
+ .TP
264
+ .B \fBvendor\fP
265
+ An optional map containing vendor\-specific information. CMake does not
266
+ interpret the contents of this field except to verify that it is a map if
267
+ it does exist. However, the keys should be a vendor\-specific domain name
268
+ followed by a \fB/\fP\-separated path. For example, the Example IDE 1.0 could
269
+ use \fBexample.com/ExampleIDE/1.0\fP\&. The value of each field can be anything
270
+ desired by the vendor, though will typically be a map.
271
+ .TP
272
+ .B \fBconfigurePresets\fP
273
+ An optional array of \fI\%Configure Preset\fP objects.
274
+ This is allowed in preset files specifying version \fB1\fP or above.
275
+ .TP
276
+ .B \fBbuildPresets\fP
277
+ An optional array of \fI\%Build Preset\fP objects.
278
+ This is allowed in preset files specifying version \fB2\fP or above.
279
+ .TP
280
+ .B \fBtestPresets\fP
281
+ An optional array of \fI\%Test Preset\fP objects.
282
+ This is allowed in preset files specifying version \fB2\fP or above.
283
+ .TP
284
+ .B \fBpackagePresets\fP
285
+ An optional array of \fI\%Package Preset\fP objects.
286
+ This is allowed in preset files specifying version \fB6\fP or above.
287
+ .TP
288
+ .B \fBworkflowPresets\fP
289
+ An optional array of \fI\%Workflow Preset\fP objects.
290
+ This is allowed in preset files specifying version \fB6\fP or above.
291
+ .UNINDENT
292
+ .SS Includes
293
+ .sp
294
+ \fBCMakePresets.json\fP and \fBCMakeUserPresets.json\fP can include other files
295
+ with the \fBinclude\fP field in file version \fB4\fP and later. Files included
296
+ by these files can also include other files. If \fBCMakePresets.json\fP and
297
+ \fBCMakeUserPresets.json\fP are both present, \fBCMakeUserPresets.json\fP
298
+ implicitly includes \fBCMakePresets.json\fP, even with no \fBinclude\fP field,
299
+ in all versions of the format.
300
+ .sp
301
+ If a preset file contains presets that inherit from presets in another file,
302
+ the file must include the other file either directly or indirectly.
303
+ Include cycles are not allowed among files. If \fBa.json\fP includes
304
+ \fBb.json\fP, \fBb.json\fP cannot include \fBa.json\fP\&. However, a file may be
305
+ included multiple times from the same file or from different files.
306
+ .sp
307
+ Files directly or indirectly included from \fBCMakePresets.json\fP should be
308
+ guaranteed to be provided by the project. \fBCMakeUserPresets.json\fP may
309
+ include files from anywhere.
310
+ .sp
311
+ Starting from version \fB7\fP, the \fBinclude\fP field supports
312
+ \fI\%macro expansion\fP, but only \fB$penv{}\fP macro expansion. Starting from version
313
+ \fB9\fP, other macro expansions are also available, except for \fB$env{}\fP and
314
+ preset\-specific macros, i.e., those derived from the fields inside a preset\(aqs
315
+ definition like \fBpresetName\fP\&.
316
+ .SS Configure Preset
317
+ .sp
318
+ Each entry of the \fBconfigurePresets\fP array is a JSON object
319
+ that may contain the following fields:
320
+ .INDENT 0.0
321
+ .TP
322
+ .B \fBname\fP
323
+ A required string representing the machine\-friendly name of the preset.
324
+ This identifier is used in the \X'tty: link #cmake-options'\fI\%cmake \-\-preset\fP\X'tty: link' option.
325
+ There must not be two configure presets in the union of \fBCMakePresets.json\fP
326
+ and \fBCMakeUserPresets.json\fP in the same directory with the same name.
327
+ However, a configure preset may have the same name as a build, test,
328
+ package, or workflow preset.
329
+ .TP
330
+ .B \fBhidden\fP
331
+ An optional boolean specifying whether or not a preset should be hidden.
332
+ If a preset is hidden, it cannot be used in the \fB\-\-preset=\fP argument,
333
+ will not show up in the \X'tty: link #manual:cmake-gui(1)'\fI\%CMake GUI\fP\X'tty: link', and does not
334
+ have to have a valid \fBgenerator\fP or \fBbinaryDir\fP, even from
335
+ inheritance. \fBhidden\fP presets are intended to be used as a base for
336
+ other presets to inherit via the \fBinherits\fP field.
337
+ .TP
338
+ .B \fBinherits\fP
339
+ An optional array of strings representing the names of presets to inherit
340
+ from. This field can also be a string, which is equivalent to an array
341
+ containing one string.
342
+ .sp
343
+ The preset will inherit all of the fields from the \fBinherits\fP
344
+ presets by default (except \fBname\fP, \fBhidden\fP, \fBinherits\fP,
345
+ \fBdescription\fP, and \fBdisplayName\fP), but can override them as
346
+ desired. If multiple \fBinherits\fP presets provide conflicting values for
347
+ the same field, the earlier preset in the \fBinherits\fP array will be
348
+ preferred.
349
+ .sp
350
+ A preset can only inherit from another preset that is defined in the
351
+ same file or in one of the files it includes (directly or indirectly).
352
+ Presets in \fBCMakePresets.json\fP may not inherit from presets in
353
+ \fBCMakeUserPresets.json\fP\&.
354
+ .TP
355
+ .B \fBcondition\fP
356
+ An optional \fI\%Condition\fP object. This is allowed in preset files specifying
357
+ version \fB3\fP or above.
358
+ .TP
359
+ .B \fBvendor\fP
360
+ An optional map containing vendor\-specific information. CMake does not
361
+ interpret the contents of this field except to verify that it is a map
362
+ if it does exist. However, it should follow the same conventions as the
363
+ root\-level \fBvendor\fP field. If vendors use their own per\-preset
364
+ \fBvendor\fP field, they should implement inheritance in a sensible manner
365
+ when appropriate.
366
+ .TP
367
+ .B \fBdisplayName\fP
368
+ An optional string with a human\-friendly name of the preset.
369
+ .TP
370
+ .B \fBdescription\fP
371
+ An optional string with a human\-friendly description of the preset.
372
+ .TP
373
+ .B \fBgenerator\fP
374
+ An optional string representing the generator to use for the preset. If
375
+ \fBgenerator\fP is not specified, it must be inherited from the
376
+ \fBinherits\fP preset (unless this preset is \fBhidden\fP). In version \fB3\fP
377
+ or above, this field may be omitted to fall back to regular generator
378
+ discovery procedure.
379
+ .sp
380
+ Note that for Visual Studio generators, unlike in the command line
381
+ \X'tty: link #cmdoption-cmake-G'\fI\%\-G\fP\X'tty: link' argument, you cannot include the platform name
382
+ in the generator name. Use the \fBarchitecture\fP field instead.
383
+ .TP
384
+ .B \fBarchitecture\fP, \fBtoolset\fP
385
+ Optional fields representing the platform and toolset, respectively, for
386
+ \X'tty: link #manual:cmake-generators(7)'\fI\%generators\fP\X'tty: link' that support them.
387
+ .sp
388
+ See \X'tty: link #cmdoption-cmake-A'\fI\%cmake \-A\fP\X'tty: link' option for possible values for \fBarchitecture\fP
389
+ and \X'tty: link #cmdoption-cmake-T'\fI\%cmake \-T\fP\X'tty: link' for \fBtoolset\fP\&.
390
+ .sp
391
+ Each may be either a string or an object with the following fields:
392
+ .INDENT 7.0
393
+ .TP
394
+ .B \fBvalue\fP
395
+ An optional string representing the value.
396
+ .TP
397
+ .B \fBstrategy\fP
398
+ An optional string telling CMake how to handle the \fBarchitecture\fP or
399
+ \fBtoolset\fP field. Valid values are:
400
+ .INDENT 7.0
401
+ .TP
402
+ .B \fB\(dqset\(dq\fP
403
+ Set the respective value. This will result in an error for generators
404
+ that do not support the respective field.
405
+ .TP
406
+ .B \fB\(dqexternal\(dq\fP
407
+ Do not set the value, even if the generator supports it. This is
408
+ useful if, for example, a preset uses the Ninja generator, and an IDE
409
+ knows how to set up the Visual C++ environment from the
410
+ \fBarchitecture\fP and \fBtoolset\fP fields. In that case, CMake will
411
+ ignore the field, but the IDE can use them to set up the environment
412
+ before invoking CMake.
413
+ .UNINDENT
414
+ .sp
415
+ If no \fBstrategy\fP field is given, or if the field uses the string form
416
+ rather than the object form, the behavior is the same as \fB\(dqset\(dq\fP\&.
417
+ .UNINDENT
418
+ .TP
419
+ .B \fBtoolchainFile\fP
420
+ An optional string representing the path to the toolchain file.
421
+ This field supports \fI\%macro expansion\fP\&. If a relative path is specified,
422
+ it is calculated relative to the build directory, and if not found,
423
+ relative to the source directory. This field takes precedence over any
424
+ \X'tty: link #variable:CMAKE_TOOLCHAIN_FILE'\fI\%CMAKE_TOOLCHAIN_FILE\fP\X'tty: link' value. It is allowed in preset files
425
+ specifying version \fB3\fP or above.
426
+ .TP
427
+ .B \fBgraphviz\fP
428
+ An optional string representing the path to the graphviz input file,
429
+ that will contain all the library and executable dependencies
430
+ in the project. See the documentation for \X'tty: link #module:CMakeGraphVizOptions'\fI\%CMakeGraphVizOptions\fP\X'tty: link'
431
+ for more details.
432
+ .sp
433
+ This field supports \fI\%macro expansion\fP\&. If a relative path is specified,
434
+ it is calculated relative to the current working directory. It is allowed
435
+ in preset files specifying version \fB10\fP or above.
436
+ .TP
437
+ .B \fBbinaryDir\fP
438
+ An optional string representing the path to the output binary directory.
439
+ This field supports \fI\%macro expansion\fP\&. If a relative path is specified,
440
+ it is calculated relative to the source directory. If \fBbinaryDir\fP is not
441
+ specified, it must be inherited from the \fBinherits\fP preset (unless this
442
+ preset is \fBhidden\fP). In version \fB3\fP or above, this field may be
443
+ omitted.
444
+ .TP
445
+ .B \fBinstallDir\fP
446
+ An optional string representing the path to the installation directory.
447
+ This field supports \fI\%macro expansion\fP\&. If a relative path is specified,
448
+ it is calculated relative to the source directory. This is allowed in
449
+ preset files specifying version \fB3\fP or above.
450
+ .TP
451
+ .B \fBcmakeExecutable\fP
452
+ An optional string representing the path to the CMake executable to use
453
+ for this preset. This is reserved for use by IDEs, and is not used by
454
+ CMake itself. IDEs that use this field should expand any macros in it.
455
+ .TP
456
+ .B \fBcacheVariables\fP
457
+ An optional map of cache variables. The key is the variable name (which
458
+ may not be an empty string), and the value is either \fBnull\fP, a boolean
459
+ (which is equivalent to a value of \fB\(dqTRUE\(dq\fP or \fB\(dqFALSE\(dq\fP and a type
460
+ of \fBBOOL\fP), a string representing the value of the variable (which
461
+ supports \fI\%macro expansion\fP), or an object with the following fields:
462
+ .INDENT 7.0
463
+ .TP
464
+ .B \fBtype\fP
465
+ An optional string representing the type of the variable.
466
+ .TP
467
+ .B \fBvalue\fP
468
+ A required string or boolean representing the value of the variable.
469
+ A boolean is equivalent to \fB\(dqTRUE\(dq\fP or \fB\(dqFALSE\(dq\fP\&. This field
470
+ supports \fI\%macro expansion\fP\&.
471
+ .UNINDENT
472
+ .sp
473
+ Cache variables are inherited through the \fBinherits\fP field, and the
474
+ preset\(aqs variables will be the union of its own \fBcacheVariables\fP and
475
+ the \fBcacheVariables\fP from all its parents. If multiple presets in this
476
+ union define the same variable, the standard rules of \fBinherits\fP are
477
+ applied. Setting a variable to \fBnull\fP causes it to not be set, even if
478
+ a value was inherited from another preset.
479
+ .TP
480
+ .B \fBenvironment\fP
481
+ An optional map of environment variables. The key is the variable name
482
+ (which may not be an empty string), and the value is either \fBnull\fP or
483
+ a string representing the value of the variable. Each variable is set
484
+ regardless of whether or not a value was given to it by the process\(aqs
485
+ environment.
486
+ .sp
487
+ This field supports \fI\%macro expansion\fP, and environment variables in this map
488
+ may reference each other, and may be listed in any order, as long as such
489
+ references do not cause a cycle (for example, if \fBENV_1\fP is
490
+ \fB$env{ENV_2}\fP, \fBENV_2\fP may not be \fB$env{ENV_1}\fP). \fB$penv{NAME}\fP
491
+ allows one to prepend or append values to existing environment variables by
492
+ accessing only values from the parent environment.
493
+ .sp
494
+ Environment variables are inherited through the \fBinherits\fP field, and
495
+ the preset\(aqs environment will be the union of its own \fBenvironment\fP and
496
+ the \fBenvironment\fP from all its parents. If multiple presets in this
497
+ union define the same variable, the standard rules of \fBinherits\fP are
498
+ applied. Setting a variable to \fBnull\fP causes it to not be set, even if
499
+ a value was inherited from another preset.
500
+ .TP
501
+ .B \fBwarnings\fP
502
+ An optional object specifying the warnings to enable. The object may
503
+ contain the following fields:
504
+ .INDENT 7.0
505
+ .TP
506
+ .B \fBdev\fP
507
+ An optional boolean. Equivalent to passing \X'tty: link #cmdoption-cmake-Wdev'\fI\%\-Wdev\fP\X'tty: link'
508
+ or \X'tty: link #cmdoption-cmake-Wno-dev'\fI\%\-Wno\-dev\fP\X'tty: link' on the command line. This may not
509
+ be set to \fBfalse\fP if \fBerrors.dev\fP is set to \fBtrue\fP\&.
510
+ .TP
511
+ .B \fBdeprecated\fP
512
+ An optional boolean. Equivalent to passing
513
+ \X'tty: link #cmdoption-cmake-Wdeprecated'\fI\%\-Wdeprecated\fP\X'tty: link' or
514
+ \X'tty: link #cmdoption-cmake-Wno-deprecated'\fI\%\-Wno\-deprecated\fP\X'tty: link' on the command line.
515
+ This may not be set to \fBfalse\fP if \fBerrors.deprecated\fP is set to
516
+ \fBtrue\fP\&.
517
+ .TP
518
+ .B \fBuninitialized\fP
519
+ An optional boolean. Setting this to \fBtrue\fP is equivalent to passing
520
+ \X'tty: link #cmdoption-cmake-warn-uninitialized'\fI\%\-\-warn\-uninitialized\fP\X'tty: link' on the command
521
+ line.
522
+ .TP
523
+ .B \fBunusedCli\fP
524
+ An optional boolean. Setting this to \fBfalse\fP is equivalent to passing
525
+ \X'tty: link #cmdoption-cmake-no-warn-unused-cli'\fI\%\-\-no\-warn\-unused\-cli\fP\X'tty: link' on the command
526
+ line.
527
+ .TP
528
+ .B \fBsystemVars\fP
529
+ An optional boolean. Setting this to \fBtrue\fP is equivalent to passing
530
+ \X'tty: link #cmdoption-cmake-check-system-vars'\fI\%\-\-check\-system\-vars\fP\X'tty: link' on the command
531
+ line.
532
+ .UNINDENT
533
+ .TP
534
+ .B \fBerrors\fP
535
+ An optional object specifying the errors to enable. The object may
536
+ contain the following fields:
537
+ .INDENT 7.0
538
+ .TP
539
+ .B \fBdev\fP
540
+ An optional boolean. Equivalent to passing \X'tty: link #cmdoption-cmake-Werror'\fI\%\-Werror=dev\fP\X'tty: link'
541
+ or \X'tty: link #cmdoption-cmake-Werror'\fI\%\-Wno\-error=dev\fP\X'tty: link' on the command line.
542
+ This may not be set to \fBtrue\fP if \fBwarnings.dev\fP is set to \fBfalse\fP\&.
543
+ .TP
544
+ .B \fBdeprecated\fP
545
+ An optional boolean. Equivalent to passing
546
+ \X'tty: link #cmdoption-cmake-Werror'\fI\%\-Werror=deprecated\fP\X'tty: link' or
547
+ \X'tty: link #cmdoption-cmake-Werror'\fI\%\-Wno\-error=deprecated\fP\X'tty: link' on the command line.
548
+ This may not be set to \fBtrue\fP if \fBwarnings.deprecated\fP is set to
549
+ \fBfalse\fP\&.
550
+ .UNINDENT
551
+ .TP
552
+ .B \fBdebug\fP
553
+ An optional object specifying debug options. The object may contain the
554
+ following fields:
555
+ .INDENT 7.0
556
+ .TP
557
+ .B \fBoutput\fP
558
+ An optional boolean. Setting this to \fBtrue\fP is equivalent to passing
559
+ \X'tty: link #cmdoption-cmake-debug-output'\fI\%\-\-debug\-output\fP\X'tty: link' on the command line.
560
+ .TP
561
+ .B \fBtryCompile\fP
562
+ An optional boolean. Setting this to \fBtrue\fP is equivalent to passing
563
+ \X'tty: link #cmdoption-cmake-debug-trycompile'\fI\%\-\-debug\-trycompile\fP\X'tty: link' on the command
564
+ line.
565
+ .TP
566
+ .B \fBfind\fP
567
+ An optional boolean. Setting this to \fBtrue\fP is equivalent to passing
568
+ \X'tty: link #cmdoption-cmake-debug-find'\fI\%\-\-debug\-find\fP\X'tty: link' on the command line.
569
+ .UNINDENT
570
+ .TP
571
+ .B \fBtrace\fP
572
+ An optional object specifying trace options. This is allowed in preset
573
+ files specifying version \fB7\fP\&. The object may contain the following fields:
574
+ .INDENT 7.0
575
+ .TP
576
+ .B \fBmode\fP
577
+ An optional string that specifies the trace mode. Valid values are:
578
+ .INDENT 7.0
579
+ .TP
580
+ .B \fBon\fP
581
+ Causes a trace of all calls made and from where to be printed.
582
+ Equivalent to passing \X'tty: link #cmdoption-cmake-trace'\fI\%\-\-trace\fP\X'tty: link' on the command
583
+ line.
584
+ .TP
585
+ .B \fBoff\fP
586
+ A trace of all calls will not be printed.
587
+ .TP
588
+ .B \fBexpand\fP
589
+ Causes a trace with variables expanded of all calls made and from where
590
+ to be printed. Equivalent to passing \X'tty: link #cmdoption-cmake-trace-expand'\fI\%\-\-trace\-expand\fP\X'tty: link'
591
+ on the command line.
592
+ .UNINDENT
593
+ .TP
594
+ .B \fBformat\fP
595
+ An optional string that specifies the format output of the trace.
596
+ Valid values are:
597
+ .INDENT 7.0
598
+ .TP
599
+ .B \fBhuman\fP
600
+ Prints each trace line in a human\-readable format.
601
+ This is the default format. Equivalent to passing
602
+ \X'tty: link #cmdoption-cmake-trace-format'\fI\%\-\-trace\-format=human\fP\X'tty: link'
603
+ on the command line.
604
+ .TP
605
+ .B \fBjson\-v1\fP
606
+ Prints each line as a separate JSON document. Equivalent to passing
607
+ \X'tty: link #cmdoption-cmake-trace-format'\fI\%\-\-trace\-format=json\-v1\fP\X'tty: link'
608
+ on the command line.
609
+ .UNINDENT
610
+ .TP
611
+ .B \fBsource\fP
612
+ An optional array of strings representing the paths of source files to
613
+ be traced. This field can also be a string, which is equivalent to an
614
+ array containing one string. Equivalent to passing
615
+ \X'tty: link #cmdoption-cmake-trace-source'\fI\%\-\-trace\-source\fP\X'tty: link' on the command line.
616
+ .TP
617
+ .B \fBredirect\fP
618
+ An optional string specifying a path to a trace output file. Equivalent
619
+ to passing \X'tty: link #cmdoption-cmake-trace-redirect'\fI\%\-\-trace\-redirect\fP\X'tty: link'
620
+ on the command line.
621
+ .UNINDENT
622
+ .UNINDENT
623
+ .SS Build Preset
624
+ .sp
625
+ Each entry of the \fBbuildPresets\fP array is a JSON object
626
+ that may contain the following fields:
627
+ .INDENT 0.0
628
+ .TP
629
+ .B \fBname\fP
630
+ A required string representing the machine\-friendly name of the preset.
631
+ This identifier is used in the
632
+ \X'tty: link #build-tool-mode'\fI\%cmake \-\-build \-\-preset\fP\X'tty: link' option.
633
+ There must not be two build presets in the union of \fBCMakePresets.json\fP
634
+ and \fBCMakeUserPresets.json\fP in the same directory with the same name.
635
+ However, a build preset may have the same name as a configure, test,
636
+ package, or workflow preset.
637
+ .TP
638
+ .B \fBhidden\fP
639
+ An optional boolean specifying whether or not a preset should be hidden.
640
+ If a preset is hidden, it cannot be used in the
641
+ \X'tty: link #cmdoption-cmake-preset'\fI\%\-\-preset\fP\X'tty: link' argument
642
+ and does not have to have a valid \fBconfigurePreset\fP, even from
643
+ inheritance. \fBhidden\fP presets are intended to be used as a base for
644
+ other presets to inherit via the \fBinherits\fP field.
645
+ .TP
646
+ .B \fBinherits\fP
647
+ An optional array of strings representing the names of presets to inherit
648
+ from. This field can also be a string, which is equivalent to an array
649
+ containing one string.
650
+ .sp
651
+ The preset will inherit all of the fields from the
652
+ \fBinherits\fP presets by default (except \fBname\fP, \fBhidden\fP,
653
+ \fBinherits\fP, \fBdescription\fP, and \fBdisplayName\fP), but can override
654
+ them as desired. If multiple \fBinherits\fP presets provide conflicting
655
+ values for the same field, the earlier preset in the \fBinherits\fP array
656
+ will be preferred.
657
+ .sp
658
+ A preset can only inherit from another preset that is defined in the
659
+ same file or in one of the files it includes (directly or indirectly).
660
+ Presets in \fBCMakePresets.json\fP may not inherit from presets in
661
+ \fBCMakeUserPresets.json\fP\&.
662
+ .TP
663
+ .B \fBcondition\fP
664
+ An optional \fI\%Condition\fP object. This is allowed in preset files specifying
665
+ version \fB3\fP or above.
666
+ .TP
667
+ .B \fBvendor\fP
668
+ An optional map containing vendor\-specific information. CMake does not
669
+ interpret the contents of this field except to verify that it is a map
670
+ if it does exist. However, it should follow the same conventions as the
671
+ root\-level \fBvendor\fP field. If vendors use their own per\-preset
672
+ \fBvendor\fP field, they should implement inheritance in a sensible manner
673
+ when appropriate.
674
+ .TP
675
+ .B \fBdisplayName\fP
676
+ An optional string with a human\-friendly name of the preset.
677
+ .TP
678
+ .B \fBdescription\fP
679
+ An optional string with a human\-friendly description of the preset.
680
+ .TP
681
+ .B \fBenvironment\fP
682
+ An optional map of environment variables. The key is the variable name
683
+ (which may not be an empty string), and the value is either \fBnull\fP or
684
+ a string representing the value of the variable. Each variable is set
685
+ regardless of whether or not a value was given to it by the process\(aqs
686
+ environment.
687
+ .sp
688
+ This field supports \fI\%macro expansion\fP, and environment variables in this map
689
+ may reference each other, and may be listed in any order, as long as such
690
+ references do not cause a cycle (for example, if \fBENV_1\fP is
691
+ \fB$env{ENV_2}\fP, \fBENV_2\fP may not be \fB$env{ENV_1}\fP). \fB$penv{NAME}\fP
692
+ allows one to prepend or append values to existing environment variables by
693
+ accessing only values from the parent environment.
694
+ .sp
695
+ Environment variables are inherited through the \fBinherits\fP field, and
696
+ the preset\(aqs environment will be the union of its own \fBenvironment\fP
697
+ and the \fBenvironment\fP from all its parents. If multiple presets in
698
+ this union define the same variable, the standard rules of \fBinherits\fP
699
+ are applied. Setting a variable to \fBnull\fP causes it to not be set,
700
+ even if a value was inherited from another preset.
701
+ .sp
702
+ \fBNOTE:\fP
703
+ .INDENT 7.0
704
+ .INDENT 3.5
705
+ For a CMake project using ExternalProject with a configuration preset
706
+ having environment variables needed in the ExternalProject, use a build
707
+ preset that inherits that configuration preset or the ExternalProject
708
+ will not have the environment variables set in the configuration preset.
709
+ Example: suppose the host defaults to one compiler (say Clang)
710
+ and the user wishes to use another compiler (say GCC). Set configuration
711
+ preset environment variables \fBCC\fP and \fBCXX\fP and use a build preset
712
+ that inherits that configuration preset. Otherwise the ExternalProject
713
+ may use a different (system default) compiler than the top\-level CMake
714
+ project.
715
+ .UNINDENT
716
+ .UNINDENT
717
+ .TP
718
+ .B \fBconfigurePreset\fP
719
+ An optional string specifying the name of a configure preset to
720
+ associate with this build preset. If \fBconfigurePreset\fP is not
721
+ specified, it must be inherited from the inherits preset (unless this
722
+ preset is hidden). The build directory is inferred from the configure
723
+ preset, so the build will take place in the same \fBbinaryDir\fP that the
724
+ configuration did.
725
+ .TP
726
+ .B \fBinheritConfigureEnvironment\fP
727
+ An optional boolean that defaults to true. If true, the environment
728
+ variables from the associated configure preset are inherited after all
729
+ inherited build preset environments, but before environment variables
730
+ explicitly specified in this build preset.
731
+ .TP
732
+ .B \fBjobs\fP
733
+ An optional integer. Equivalent to passing
734
+ \X'tty: link #cmdoption-cmake-build-j'\fI\%\-\-parallel\fP\X'tty: link' or \fB\-j\fP on the command line.
735
+ .TP
736
+ .B \fBtargets\fP
737
+ An optional string or array of strings. Equivalent to passing
738
+ \X'tty: link #cmdoption-cmake-build-t'\fI\%\-\-target\fP\X'tty: link' or \fB\-t\fP on the command line.
739
+ Vendors may ignore the targets property or hide build presets that
740
+ explicitly specify targets. This field supports macro expansion.
741
+ .TP
742
+ .B \fBconfiguration\fP
743
+ An optional string. Equivalent to passing
744
+ \X'tty: link #cmdoption-cmake-build-config'\fI\%\-\-config\fP\X'tty: link' on the command line.
745
+ .TP
746
+ .B \fBcleanFirst\fP
747
+ An optional bool. If true, equivalent to passing
748
+ \X'tty: link #cmdoption-cmake-build-clean-first'\fI\%\-\-clean\-first\fP\X'tty: link' on the command line.
749
+ .TP
750
+ .B \fBresolvePackageReferences\fP
751
+ An optional string that specifies the package resolve mode. This is
752
+ allowed in preset files specifying version \fB4\fP or above.
753
+ .sp
754
+ Package references are used to define dependencies to packages from
755
+ external package managers. Currently only NuGet in combination with the
756
+ Visual Studio generator is supported. If there are no targets that define
757
+ package references, this option does nothing. Valid values are:
758
+ .INDENT 7.0
759
+ .TP
760
+ .B \fBon\fP
761
+ Causes package references to be resolved before attempting a build.
762
+ .TP
763
+ .B \fBoff\fP
764
+ Package references will not be resolved. Note that this may cause
765
+ errors in some build environments, such as .NET SDK style projects.
766
+ .TP
767
+ .B \fBonly\fP
768
+ Only resolve package references, but do not perform a build.
769
+ .UNINDENT
770
+ .sp
771
+ \fBNOTE:\fP
772
+ .INDENT 7.0
773
+ .INDENT 3.5
774
+ The command line parameter
775
+ \X'tty: link #cmdoption-cmake-build-resolve-package-references'\fI\%\-\-resolve\-package\-references\fP\X'tty: link'
776
+ will take priority over this setting. If the command line parameter is not
777
+ provided and this setting is not specified, an environment\-specific cache
778
+ variable will be evaluated to decide, if package restoration should be
779
+ performed.
780
+ .sp
781
+ When using the Visual Studio generator, package references are defined
782
+ using the \X'tty: link #prop_tgt:VS_PACKAGE_REFERENCES'\fI\%VS_PACKAGE_REFERENCES\fP\X'tty: link' property. Package references
783
+ are restored using NuGet. It can be disabled by setting the
784
+ \fBCMAKE_VS_NUGET_PACKAGE_RESTORE\fP variable to \fBOFF\fP\&. This can also be
785
+ done from within a configure preset.
786
+ .UNINDENT
787
+ .UNINDENT
788
+ .TP
789
+ .B \fBverbose\fP
790
+ An optional bool. If true, equivalent to passing
791
+ \X'tty: link #cmdoption-cmake-build-v'\fI\%\-\-verbose\fP\X'tty: link' on the command line.
792
+ .TP
793
+ .B \fBnativeToolOptions\fP
794
+ An optional array of strings. Equivalent to passing options after \fB\-\-\fP
795
+ on the command line. The array values support macro expansion.
796
+ .UNINDENT
797
+ .SS Test Preset
798
+ .sp
799
+ Each entry of the \fBtestPresets\fP array is a JSON object
800
+ that may contain the following fields:
801
+ .INDENT 0.0
802
+ .TP
803
+ .B \fBname\fP
804
+ A required string representing the machine\-friendly name of the preset.
805
+ This identifier is used in the \X'tty: link #cmdoption-ctest-preset'\fI\%ctest \-\-preset\fP\X'tty: link' option.
806
+ There must not be two test presets in the union of \fBCMakePresets.json\fP
807
+ and \fBCMakeUserPresets.json\fP in the same directory with the same name.
808
+ However, a test preset may have the same name as a configure, build,
809
+ package, or workflow preset.
810
+ .TP
811
+ .B \fBhidden\fP
812
+ An optional boolean specifying whether or not a preset should be hidden.
813
+ If a preset is hidden, it cannot be used in the
814
+ \X'tty: link #cmdoption-ctest-preset'\fI\%\-\-preset\fP\X'tty: link' argument
815
+ and does not have to have a valid \fBconfigurePreset\fP, even from
816
+ inheritance. \fBhidden\fP presets are intended to be used as a base for
817
+ other presets to inherit via the \fBinherits\fP field.
818
+ .TP
819
+ .B \fBinherits\fP
820
+ An optional array of strings representing the names of presets to inherit
821
+ from. This field can also be a string, which is equivalent to an array
822
+ containing one string.
823
+ .sp
824
+ The preset will inherit all of the fields from the
825
+ \fBinherits\fP presets by default (except \fBname\fP, \fBhidden\fP,
826
+ \fBinherits\fP, \fBdescription\fP, and \fBdisplayName\fP), but can override
827
+ them as desired. If multiple \fBinherits\fP presets provide conflicting
828
+ values for the same field, the earlier preset in the \fBinherits\fP array
829
+ will be preferred.
830
+ .sp
831
+ A preset can only inherit from another preset that is defined in the
832
+ same file or in one of the files it includes (directly or indirectly).
833
+ Presets in \fBCMakePresets.json\fP may not inherit from presets in
834
+ \fBCMakeUserPresets.json\fP\&.
835
+ .TP
836
+ .B \fBcondition\fP
837
+ An optional \fI\%Condition\fP object. This is allowed in preset files specifying
838
+ version \fB3\fP or above.
839
+ .TP
840
+ .B \fBvendor\fP
841
+ An optional map containing vendor\-specific information. CMake does not
842
+ interpret the contents of this field except to verify that it is a map
843
+ if it does exist. However, it should follow the same conventions as the
844
+ root\-level \fBvendor\fP field. If vendors use their own per\-preset
845
+ \fBvendor\fP field, they should implement inheritance in a sensible manner
846
+ when appropriate.
847
+ .TP
848
+ .B \fBdisplayName\fP
849
+ An optional string with a human\-friendly name of the preset.
850
+ .TP
851
+ .B \fBdescription\fP
852
+ An optional string with a human\-friendly description of the preset.
853
+ .TP
854
+ .B \fBenvironment\fP
855
+ An optional map of environment variables. The key is the variable name
856
+ (which may not be an empty string), and the value is either \fBnull\fP or
857
+ a string representing the value of the variable. Each variable is set
858
+ regardless of whether or not a value was given to it by the process\(aqs
859
+ environment.
860
+ .sp
861
+ This field supports \fI\%macro expansion\fP, and environment variables in this map
862
+ may reference each other, and may be listed in any order, as long as such
863
+ references do not cause a cycle (for example, if \fBENV_1\fP is
864
+ \fB$env{ENV_2}\fP, \fBENV_2\fP may not be \fB$env{ENV_1}\fP). \fB$penv{NAME}\fP
865
+ allows one to prepend or append values to existing environment variables by
866
+ accessing only values from the parent environment.
867
+ .sp
868
+ Environment variables are inherited through the \fBinherits\fP field, and
869
+ the preset\(aqs environment will be the union of its own \fBenvironment\fP
870
+ and the \fBenvironment\fP from all its parents. If multiple presets in
871
+ this union define the same variable, the standard rules of \fBinherits\fP
872
+ are applied. Setting a variable to \fBnull\fP causes it to not be set,
873
+ even if a value was inherited from another preset.
874
+ .TP
875
+ .B \fBconfigurePreset\fP
876
+ An optional string specifying the name of a configure preset to
877
+ associate with this test preset. If \fBconfigurePreset\fP is not
878
+ specified, it must be inherited from the inherits preset (unless this
879
+ preset is hidden). The build directory is inferred from the configure
880
+ preset, so tests will run in the same \fBbinaryDir\fP that the
881
+ configuration did and build did.
882
+ .TP
883
+ .B \fBinheritConfigureEnvironment\fP
884
+ An optional boolean that defaults to true. If true, the environment
885
+ variables from the associated configure preset are inherited after all
886
+ inherited test preset environments, but before environment variables
887
+ explicitly specified in this test preset.
888
+ .TP
889
+ .B \fBconfiguration\fP
890
+ An optional string. Equivalent to passing
891
+ \X'tty: link #cmdoption-ctest-C'\fI\%\-\-build\-config\fP\X'tty: link' on the command line.
892
+ .TP
893
+ .B \fBoverwriteConfigurationFile\fP
894
+ An optional array of configuration options to overwrite options
895
+ specified in the CTest configuration file. Equivalent to passing
896
+ \X'tty: link #cmdoption-ctest-overwrite'\fI\%\-\-overwrite\fP\X'tty: link' for each value in the array.
897
+ The array values support macro expansion.
898
+ .TP
899
+ .B \fBoutput\fP
900
+ An optional object specifying output options. The object may contain the
901
+ following fields.
902
+ .INDENT 7.0
903
+ .TP
904
+ .B \fBshortProgress\fP
905
+ An optional bool. If true, equivalent to passing
906
+ \X'tty: link #cmdoption-ctest-progress'\fI\%\-\-progress\fP\X'tty: link' on the command line.
907
+ .TP
908
+ .B \fBverbosity\fP
909
+ An optional string specifying verbosity level. Must be one of the
910
+ following:
911
+ .INDENT 7.0
912
+ .TP
913
+ .B \fBdefault\fP
914
+ Equivalent to passing no verbosity flags on the command line.
915
+ .TP
916
+ .B \fBverbose\fP
917
+ Equivalent to passing \X'tty: link #cmdoption-ctest-V'\fI\%\-\-verbose\fP\X'tty: link' on
918
+ the command line.
919
+ .TP
920
+ .B \fBextra\fP
921
+ Equivalent to passing \X'tty: link #cmdoption-ctest-VV'\fI\%\-\-extra\-verbose\fP\X'tty: link'
922
+ on the command line.
923
+ .UNINDENT
924
+ .TP
925
+ .B \fBdebug\fP
926
+ An optional bool. If true, equivalent to passing
927
+ \X'tty: link #cmdoption-ctest-debug'\fI\%\-\-debug\fP\X'tty: link' on the command line.
928
+ .TP
929
+ .B \fBoutputOnFailure\fP
930
+ An optional bool. If true, equivalent to passing
931
+ \X'tty: link #cmdoption-ctest-output-on-failure'\fI\%\-\-output\-on\-failure\fP\X'tty: link' on the command
932
+ line.
933
+ .TP
934
+ .B \fBquiet\fP
935
+ An optional bool. If true, equivalent to passing
936
+ \X'tty: link #cmdoption-ctest-Q'\fI\%\-\-quiet\fP\X'tty: link' on the command line.
937
+ .TP
938
+ .B \fBoutputLogFile\fP
939
+ An optional string specifying a path to a log file. Equivalent to
940
+ passing \X'tty: link #cmdoption-ctest-O'\fI\%\-\-output\-log\fP\X'tty: link' on the command line.
941
+ This field supports macro expansion.
942
+ .TP
943
+ .B \fBoutputJUnitFile\fP
944
+ An optional string specifying a path to a JUnit file. Equivalent to
945
+ passing \X'tty: link #cmdoption-ctest-output-junit'\fI\%\-\-output\-junit\fP\X'tty: link' on the command line.
946
+ This field supports macro expansion. This is allowed in preset files
947
+ specifying version \fB6\fP or above.
948
+ .TP
949
+ .B \fBlabelSummary\fP
950
+ An optional bool. If false, equivalent to passing
951
+ \X'tty: link #cmdoption-ctest-no-label-summary'\fI\%\-\-no\-label\-summary\fP\X'tty: link' on the command
952
+ line.
953
+ .TP
954
+ .B \fBsubprojectSummary\fP
955
+ An optional bool. If false, equivalent to passing
956
+ \X'tty: link #cmdoption-ctest-no-subproject-summary'\fI\%\-\-no\-subproject\-summary\fP\X'tty: link'
957
+ on the command line.
958
+ .TP
959
+ .B \fBmaxPassedTestOutputSize\fP
960
+ An optional integer specifying the maximum output for passed tests in
961
+ bytes. Equivalent to passing
962
+ \X'tty: link #cmdoption-ctest-test-output-size-passed'\fI\%\-\-test\-output\-size\-passed\fP\X'tty: link'
963
+ on the command line.
964
+ .TP
965
+ .B \fBmaxFailedTestOutputSize\fP
966
+ An optional integer specifying the maximum output for failed tests in
967
+ bytes. Equivalent to passing
968
+ \X'tty: link #cmdoption-ctest-test-output-size-failed'\fI\%\-\-test\-output\-size\-failed\fP\X'tty: link'
969
+ on the command line.
970
+ .TP
971
+ .B \fBtestOutputTruncation\fP
972
+ An optional string specifying the test output truncation mode. Equivalent
973
+ to passing
974
+ \X'tty: link #cmdoption-ctest-test-output-truncation'\fI\%\-\-test\-output\-truncation\fP\X'tty: link' on
975
+ the command line. This is allowed in preset files specifying version
976
+ \fB5\fP or above.
977
+ .TP
978
+ .B \fBmaxTestNameWidth\fP
979
+ An optional integer specifying the maximum width of a test name to
980
+ output. Equivalent to passing \X'tty: link #cmdoption-ctest-max-width'\fI\%\-\-max\-width\fP\X'tty: link'
981
+ on the command line.
982
+ .UNINDENT
983
+ .TP
984
+ .B \fBfilter\fP
985
+ An optional object specifying how to filter the tests to run. The object
986
+ may contain the following fields.
987
+ .INDENT 7.0
988
+ .TP
989
+ .B \fBinclude\fP
990
+ An optional object specifying which tests to include. The object may
991
+ contain the following fields.
992
+ .INDENT 7.0
993
+ .TP
994
+ .B \fBname\fP
995
+ An optional string specifying a regex for test names. Equivalent to
996
+ passing \X'tty: link #cmdoption-ctest-R'\fI\%\-\-tests\-regex\fP\X'tty: link' on the command
997
+ line. This field supports macro expansion. CMake regex syntax is
998
+ described under \X'tty: link #regex-specification'\fI\%string(REGEX)\fP\X'tty: link'\&.
999
+ .TP
1000
+ .B \fBlabel\fP
1001
+ An optional string specifying a regex for test labels. Equivalent to
1002
+ passing \X'tty: link #cmdoption-ctest-L'\fI\%\-\-label\-regex\fP\X'tty: link' on the command
1003
+ line. This field supports macro expansion.
1004
+ .TP
1005
+ .B \fBuseUnion\fP
1006
+ An optional bool. Equivalent to passing \X'tty: link #cmdoption-ctest-U'\fI\%\-\-union\fP\X'tty: link'
1007
+ on the command line.
1008
+ .TP
1009
+ .B \fBindex\fP
1010
+ An optional object specifying tests to include by test index. The
1011
+ object may contain the following fields. Can also be an optional
1012
+ string specifying a file with the command line syntax for
1013
+ \X'tty: link #cmdoption-ctest-I'\fI\%\-\-tests\-information\fP\X'tty: link'\&.
1014
+ If specified as a string, this field supports macro expansion.
1015
+ .INDENT 7.0
1016
+ .TP
1017
+ .B \fBstart\fP
1018
+ An optional integer specifying a test index to start testing at.
1019
+ .TP
1020
+ .B \fBend\fP
1021
+ An optional integer specifying a test index to stop testing at.
1022
+ .TP
1023
+ .B \fBstride\fP
1024
+ An optional integer specifying the increment.
1025
+ .TP
1026
+ .B \fBspecificTests\fP
1027
+ An optional array of integers specifying specific test indices to
1028
+ run.
1029
+ .UNINDENT
1030
+ .UNINDENT
1031
+ .TP
1032
+ .B \fBexclude\fP
1033
+ An optional object specifying which tests to exclude. The object may
1034
+ contain the following fields.
1035
+ .INDENT 7.0
1036
+ .TP
1037
+ .B \fBname\fP
1038
+ An optional string specifying a regex for test names. Equivalent to
1039
+ passing \X'tty: link #cmdoption-ctest-E'\fI\%\-\-exclude\-regex\fP\X'tty: link' on the
1040
+ command line. This field supports macro expansion.
1041
+ .TP
1042
+ .B \fBlabel\fP
1043
+ An optional string specifying a regex for test labels. Equivalent to
1044
+ passing \X'tty: link #cmdoption-ctest-LE'\fI\%\-\-label\-exclude\fP\X'tty: link' on the
1045
+ command line. This field supports macro expansion.
1046
+ .TP
1047
+ .B \fBfixtures\fP
1048
+ An optional object specifying which fixtures to exclude from adding
1049
+ tests. The object may contain the following fields.
1050
+ .INDENT 7.0
1051
+ .TP
1052
+ .B \fBany\fP
1053
+ An optional string specifying a regex for text fixtures to exclude
1054
+ from adding any tests. Equivalent to
1055
+ \X'tty: link #cmdoption-ctest-FA'\fI\%\-\-fixture\-exclude\-any\fP\X'tty: link' on
1056
+ the command line. This field supports macro expansion.
1057
+ .TP
1058
+ .B \fBsetup\fP
1059
+ An optional string specifying a regex for text fixtures to exclude
1060
+ from adding setup tests. Equivalent to
1061
+ \X'tty: link #cmdoption-ctest-FS'\fI\%\-\-fixture\-exclude\-setup\fP\X'tty: link'
1062
+ on the command line. This field supports macro expansion.
1063
+ .TP
1064
+ .B \fBcleanup\fP
1065
+ An optional string specifying a regex for text fixtures to exclude
1066
+ from adding cleanup tests. Equivalent to
1067
+ \X'tty: link #cmdoption-ctest-FC'\fI\%\-\-fixture\-exclude\-cleanup\fP\X'tty: link'
1068
+ on the command line. This field supports macro expansion.
1069
+ .UNINDENT
1070
+ .UNINDENT
1071
+ .UNINDENT
1072
+ .TP
1073
+ .B \fBexecution\fP
1074
+ An optional object specifying options for test execution. The object may
1075
+ contain the following fields.
1076
+ .INDENT 7.0
1077
+ .TP
1078
+ .B \fBstopOnFailure\fP
1079
+ An optional bool. If true, equivalent to passing
1080
+ \X'tty: link #cmdoption-ctest-stop-on-failure'\fI\%\-\-stop\-on\-failure\fP\X'tty: link' on the command
1081
+ line.
1082
+ .TP
1083
+ .B \fBenableFailover\fP
1084
+ An optional bool. If true, equivalent to passing \X'tty: link #cmdoption-ctest-F'\fI\%\-F\fP\X'tty: link'
1085
+ on the command line.
1086
+ .TP
1087
+ .B \fBjobs\fP
1088
+ An optional integer. Equivalent to passing
1089
+ \X'tty: link #cmdoption-ctest-j'\fI\%\-\-parallel\fP\X'tty: link' on the command line.
1090
+ .TP
1091
+ .B \fBresourceSpecFile\fP
1092
+ An optional string. Equivalent to passing
1093
+ \X'tty: link #cmdoption-ctest-resource-spec-file'\fI\%\-\-resource\-spec\-file\fP\X'tty: link' on
1094
+ the command line. This field supports macro expansion.
1095
+ .TP
1096
+ .B \fBtestLoad\fP
1097
+ An optional integer. Equivalent to passing
1098
+ \X'tty: link #cmdoption-ctest-test-load'\fI\%\-\-test\-load\fP\X'tty: link' on the command line.
1099
+ .TP
1100
+ .B \fBshowOnly\fP
1101
+ An optional string. Equivalent to passing
1102
+ \X'tty: link #cmdoption-ctest-N'\fI\%\-\-show\-only\fP\X'tty: link' on the
1103
+ command line. The string must be one of the following values:
1104
+ .sp
1105
+ \fBhuman\fP
1106
+ .sp
1107
+ \fBjson\-v1\fP
1108
+ .TP
1109
+ .B \fBrepeat\fP
1110
+ An optional object specifying how to repeat tests. Equivalent to
1111
+ passing \X'tty: link #cmdoption-ctest-repeat'\fI\%\-\-repeat\fP\X'tty: link' on the command line.
1112
+ The object must have the following fields.
1113
+ .INDENT 7.0
1114
+ .TP
1115
+ .B \fBmode\fP
1116
+ A required string. Must be one of the following values:
1117
+ .sp
1118
+ \fBuntil\-fail\fP
1119
+ .sp
1120
+ \fBuntil\-pass\fP
1121
+ .sp
1122
+ \fBafter\-timeout\fP
1123
+ .TP
1124
+ .B \fBcount\fP
1125
+ A required integer.
1126
+ .UNINDENT
1127
+ .TP
1128
+ .B \fBinteractiveDebugging\fP
1129
+ An optional bool. If true, equivalent to passing
1130
+ \X'tty: link #cmdoption-ctest-interactive-debug-mode'\fI\%\-\-interactive\-debug\-mode 1\fP\X'tty: link'
1131
+ on the command line. If false, equivalent to passing
1132
+ \X'tty: link #cmdoption-ctest-interactive-debug-mode'\fI\%\-\-interactive\-debug\-mode 0\fP\X'tty: link'
1133
+ on the command line.
1134
+ .TP
1135
+ .B \fBscheduleRandom\fP
1136
+ An optional bool. If true, equivalent to passing
1137
+ \X'tty: link #cmdoption-ctest-schedule-random'\fI\%\-\-schedule\-random\fP\X'tty: link' on the command
1138
+ line.
1139
+ .TP
1140
+ .B \fBtimeout\fP
1141
+ An optional integer. Equivalent to passing
1142
+ \X'tty: link #cmdoption-ctest-timeout'\fI\%\-\-timeout\fP\X'tty: link' on the command line.
1143
+ .TP
1144
+ .B \fBnoTestsAction\fP
1145
+ An optional string specifying the behavior if no tests are found. Must
1146
+ be one of the following values:
1147
+ .INDENT 7.0
1148
+ .TP
1149
+ .B \fBdefault\fP
1150
+ Equivalent to not passing any value on the command line.
1151
+ .TP
1152
+ .B \fBerror\fP
1153
+ Equivalent to passing \X'tty: link #cmdoption-ctest-no-tests'\fI\%\-\-no\-tests=error\fP\X'tty: link'
1154
+ on the command line.
1155
+ .TP
1156
+ .B \fBignore\fP
1157
+ Equivalent to passing \X'tty: link #cmdoption-ctest-no-tests'\fI\%\-\-no\-tests=ignore\fP\X'tty: link'
1158
+ on the command line.
1159
+ .UNINDENT
1160
+ .UNINDENT
1161
+ .UNINDENT
1162
+ .SS Package Preset
1163
+ .sp
1164
+ Package presets may be used in schema version \fB6\fP or above. Each entry of
1165
+ the \fBpackagePresets\fP array is a JSON object that may contain the following
1166
+ fields:
1167
+ .INDENT 0.0
1168
+ .TP
1169
+ .B \fBname\fP
1170
+ A required string representing the machine\-friendly name of the preset.
1171
+ This identifier is used in the \X'tty: link #cmdoption-cpack-preset'\fI\%cpack \-\-preset\fP\X'tty: link' option.
1172
+ There must not be two package presets in the union of \fBCMakePresets.json\fP
1173
+ and \fBCMakeUserPresets.json\fP in the same directory with the same name.
1174
+ However, a package preset may have the same name as a configure, build,
1175
+ test, or workflow preset.
1176
+ .TP
1177
+ .B \fBhidden\fP
1178
+ An optional boolean specifying whether or not a preset should be hidden.
1179
+ If a preset is hidden, it cannot be used in the
1180
+ \X'tty: link #cmdoption-cpack-preset'\fI\%\-\-preset\fP\X'tty: link' argument
1181
+ and does not have to have a valid \fBconfigurePreset\fP, even from
1182
+ inheritance. \fBhidden\fP presets are intended to be used as a base for
1183
+ other presets to inherit via the \fBinherits\fP field.
1184
+ .TP
1185
+ .B \fBinherits\fP
1186
+ An optional array of strings representing the names of presets to inherit
1187
+ from. This field can also be a string, which is equivalent to an array
1188
+ containing one string.
1189
+ .sp
1190
+ The preset will inherit all of the fields from the
1191
+ \fBinherits\fP presets by default (except \fBname\fP, \fBhidden\fP,
1192
+ \fBinherits\fP, \fBdescription\fP, and \fBdisplayName\fP), but can override
1193
+ them as desired. If multiple \fBinherits\fP presets provide conflicting
1194
+ values for the same field, the earlier preset in the \fBinherits\fP array
1195
+ will be preferred.
1196
+ .sp
1197
+ A preset can only inherit from another preset that is defined in the
1198
+ same file or in one of the files it includes (directly or indirectly).
1199
+ Presets in \fBCMakePresets.json\fP may not inherit from presets in
1200
+ \fBCMakeUserPresets.json\fP\&.
1201
+ .TP
1202
+ .B \fBcondition\fP
1203
+ An optional \fI\%Condition\fP object.
1204
+ .TP
1205
+ .B \fBvendor\fP
1206
+ An optional map containing vendor\-specific information. CMake does not
1207
+ interpret the contents of this field except to verify that it is a map
1208
+ if it does exist. However, it should follow the same conventions as the
1209
+ root\-level \fBvendor\fP field. If vendors use their own per\-preset
1210
+ \fBvendor\fP field, they should implement inheritance in a sensible manner
1211
+ when appropriate.
1212
+ .TP
1213
+ .B \fBdisplayName\fP
1214
+ An optional string with a human\-friendly name of the preset.
1215
+ .TP
1216
+ .B \fBdescription\fP
1217
+ An optional string with a human\-friendly description of the preset.
1218
+ .TP
1219
+ .B \fBenvironment\fP
1220
+ An optional map of environment variables. The key is the variable name
1221
+ (which may not be an empty string), and the value is either \fBnull\fP or
1222
+ a string representing the value of the variable. Each variable is set
1223
+ regardless of whether or not a value was given to it by the process\(aqs
1224
+ environment.
1225
+ .sp
1226
+ This field supports \fI\%macro expansion\fP, and environment variables in this map
1227
+ may reference each other, and may be listed in any order, as long as such
1228
+ references do not cause a cycle (for example, if \fBENV_1\fP is
1229
+ \fB$env{ENV_2}\fP, \fBENV_2\fP may not be \fB$env{ENV_1}\fP). \fB$penv{NAME}\fP
1230
+ allows one to prepend or append values to existing environment variables by
1231
+ accessing only values from the parent environment.
1232
+ .sp
1233
+ Environment variables are inherited through the \fBinherits\fP field, and
1234
+ the preset\(aqs environment will be the union of its own \fBenvironment\fP
1235
+ and the \fBenvironment\fP from all its parents. If multiple presets in
1236
+ this union define the same variable, the standard rules of \fBinherits\fP
1237
+ are applied. Setting a variable to \fBnull\fP causes it to not be set,
1238
+ even if a value was inherited from another preset.
1239
+ .TP
1240
+ .B \fBconfigurePreset\fP
1241
+ An optional string specifying the name of a configure preset to
1242
+ associate with this package preset. If \fBconfigurePreset\fP is not
1243
+ specified, it must be inherited from the inherits preset (unless this
1244
+ preset is hidden). The build directory is inferred from the configure
1245
+ preset, so packaging will run in the same \fBbinaryDir\fP that the
1246
+ configuration did and build did.
1247
+ .TP
1248
+ .B \fBinheritConfigureEnvironment\fP
1249
+ An optional boolean that defaults to true. If true, the environment
1250
+ variables from the associated configure preset are inherited after all
1251
+ inherited package preset environments, but before environment variables
1252
+ explicitly specified in this package preset.
1253
+ .TP
1254
+ .B \fBgenerators\fP
1255
+ An optional array of strings representing generators for CPack to use.
1256
+ .TP
1257
+ .B \fBconfigurations\fP
1258
+ An optional array of strings representing build configurations for CPack to
1259
+ package.
1260
+ .TP
1261
+ .B \fBvariables\fP
1262
+ An optional map of variables to pass to CPack, equivalent to
1263
+ \X'tty: link #cmdoption-cpack-D'\fI\%\-D\fP\X'tty: link' arguments. Each key is the name of a variable, and
1264
+ the value is the string to assign to that variable.
1265
+ .TP
1266
+ .B \fBconfigFile\fP
1267
+ An optional string representing the config file for CPack to use.
1268
+ .TP
1269
+ .B \fBoutput\fP
1270
+ An optional object specifying output options. Valid keys are:
1271
+ .INDENT 7.0
1272
+ .TP
1273
+ .B \fBdebug\fP
1274
+ An optional boolean specifying whether or not to print debug information.
1275
+ A value of \fBtrue\fP is equivalent to passing
1276
+ \X'tty: link #cmdoption-cpack-debug'\fI\%\-\-debug\fP\X'tty: link' on the command line.
1277
+ .TP
1278
+ .B \fBverbose\fP
1279
+ An optional boolean specifying whether or not to print verbosely. A value
1280
+ of \fBtrue\fP is equivalent to passing \X'tty: link #cmdoption-cpack-V'\fI\%\-\-verbose\fP\X'tty: link'
1281
+ on the command line.
1282
+ .UNINDENT
1283
+ .TP
1284
+ .B \fBpackageName\fP
1285
+ An optional string representing the package name.
1286
+ .TP
1287
+ .B \fBpackageVersion\fP
1288
+ An optional string representing the package version.
1289
+ .TP
1290
+ .B \fBpackageDirectory\fP
1291
+ An optional string representing the directory in which to place the package.
1292
+ .TP
1293
+ .B \fBvendorName\fP
1294
+ An optional string representing the vendor name.
1295
+ .UNINDENT
1296
+ .SS Workflow Preset
1297
+ .sp
1298
+ Workflow presets may be used in schema version \fB6\fP or above. Each entry of
1299
+ the \fBworkflowPresets\fP array is a JSON object that may contain the following
1300
+ fields:
1301
+ .INDENT 0.0
1302
+ .TP
1303
+ .B \fBname\fP
1304
+ A required string representing the machine\-friendly name of the preset.
1305
+ This identifier is used in the
1306
+ \X'tty: link #workflow-mode'\fI\%cmake \-\-workflow \-\-preset\fP\X'tty: link' option. There must not be
1307
+ two workflow presets in the union of \fBCMakePresets.json\fP and
1308
+ \fBCMakeUserPresets.json\fP in the same directory with the same name. However,
1309
+ a workflow preset may have the same name as a configure, build, test, or
1310
+ package preset.
1311
+ .TP
1312
+ .B \fBvendor\fP
1313
+ An optional map containing vendor\-specific information. CMake does not
1314
+ interpret the contents of this field except to verify that it is a map
1315
+ if it does exist. However, it should follow the same conventions as the
1316
+ root\-level \fBvendor\fP field.
1317
+ .TP
1318
+ .B \fBdisplayName\fP
1319
+ An optional string with a human\-friendly name of the preset.
1320
+ .TP
1321
+ .B \fBdescription\fP
1322
+ An optional string with a human\-friendly description of the preset.
1323
+ .TP
1324
+ .B \fBsteps\fP
1325
+ A required array of objects describing the steps of the workflow. The first
1326
+ step must be a configure preset, and all subsequent steps must be non\-
1327
+ configure presets whose \fBconfigurePreset\fP field matches the starting
1328
+ configure preset. Each object may contain the following fields:
1329
+ .INDENT 7.0
1330
+ .TP
1331
+ .B \fBtype\fP
1332
+ A required string. The first step must be \fBconfigure\fP\&. Subsequent steps
1333
+ must be either \fBbuild\fP, \fBtest\fP, or \fBpackage\fP\&.
1334
+ .TP
1335
+ .B \fBname\fP
1336
+ A required string representing the name of the configure, build, test, or
1337
+ package preset to run as this workflow step.
1338
+ .UNINDENT
1339
+ .UNINDENT
1340
+ .SS Condition
1341
+ .sp
1342
+ The \fBcondition\fP field of a preset, allowed in preset files specifying version
1343
+ \fB3\fP or above, is used to determine whether or not the preset is enabled. For
1344
+ example, this can be used to disable a preset on platforms other than Windows.
1345
+ \fBcondition\fP may be either a boolean, \fBnull\fP, or an object. If it is a
1346
+ boolean, the boolean indicates whether the preset is enabled or disabled. If it
1347
+ is \fBnull\fP, the preset is enabled, but the \fBnull\fP condition is not inherited
1348
+ by any presets that may inherit from the preset. Sub\-conditions (for example in
1349
+ a \fBnot\fP, \fBanyOf\fP, or \fBallOf\fP condition) may not be \fBnull\fP\&. If it is an
1350
+ object, it has the following fields:
1351
+ .INDENT 0.0
1352
+ .TP
1353
+ .B \fBtype\fP
1354
+ A required string with one of the following values:
1355
+ .INDENT 7.0
1356
+ .TP
1357
+ .B \fB\(dqconst\(dq\fP
1358
+ Indicates that the condition is constant. This is equivalent to using a
1359
+ boolean in place of the object. The condition object will have the
1360
+ following additional fields:
1361
+ .INDENT 7.0
1362
+ .TP
1363
+ .B \fBvalue\fP
1364
+ A required boolean which provides a constant value for the condition\(aqs
1365
+ evaluation.
1366
+ .UNINDENT
1367
+ .UNINDENT
1368
+ .sp
1369
+ \fB\(dqequals\(dq\fP
1370
+ .INDENT 7.0
1371
+ .TP
1372
+ .B \fB\(dqnotEquals\(dq\fP
1373
+ Indicates that the condition compares two strings to see if they are equal
1374
+ (or not equal). The condition object will have the following additional
1375
+ fields:
1376
+ .INDENT 7.0
1377
+ .TP
1378
+ .B \fBlhs\fP
1379
+ First string to compare. This field supports macro expansion.
1380
+ .TP
1381
+ .B \fBrhs\fP
1382
+ Second string to compare. This field supports macro expansion.
1383
+ .UNINDENT
1384
+ .UNINDENT
1385
+ .sp
1386
+ \fB\(dqinList\(dq\fP
1387
+ .INDENT 7.0
1388
+ .TP
1389
+ .B \fB\(dqnotInList\(dq\fP
1390
+ Indicates that the condition searches for a string in a list of strings.
1391
+ The condition object will have the following additional fields:
1392
+ .INDENT 7.0
1393
+ .TP
1394
+ .B \fBstring\fP
1395
+ A required string to search for. This field supports macro expansion.
1396
+ .TP
1397
+ .B \fBlist\fP
1398
+ A required array of strings to search. This field supports macro
1399
+ expansion, and uses short\-circuit evaluation.
1400
+ .UNINDENT
1401
+ .UNINDENT
1402
+ .sp
1403
+ \fB\(dqmatches\(dq\fP
1404
+ .INDENT 7.0
1405
+ .TP
1406
+ .B \fB\(dqnotMatches\(dq\fP
1407
+ Indicates that the condition searches for a regular expression in a string.
1408
+ The condition object will have the following additional fields:
1409
+ .INDENT 7.0
1410
+ .TP
1411
+ .B \fBstring\fP
1412
+ A required string to search. This field supports macro expansion.
1413
+ .TP
1414
+ .B \fBregex\fP
1415
+ A required regular expression to search for. This field supports macro
1416
+ expansion.
1417
+ .UNINDENT
1418
+ .UNINDENT
1419
+ .sp
1420
+ \fB\(dqanyOf\(dq\fP
1421
+ .sp
1422
+ \fB\(dqallOf\(dq\fP
1423
+ .INDENT 7.0
1424
+ .INDENT 3.5
1425
+ Indicates that the condition is an aggregation of zero or more nested
1426
+ conditions. The condition object will have the following additional fields:
1427
+ .INDENT 0.0
1428
+ .TP
1429
+ .B \fBconditions\fP
1430
+ A required array of condition objects. These conditions use short\-circuit
1431
+ evaluation.
1432
+ .UNINDENT
1433
+ .UNINDENT
1434
+ .UNINDENT
1435
+ .INDENT 7.0
1436
+ .TP
1437
+ .B \fB\(dqnot\(dq\fP
1438
+ Indicates that the condition is an inversion of another condition. The
1439
+ condition object will have the following additional fields:
1440
+ .INDENT 7.0
1441
+ .TP
1442
+ .B \fBcondition\fP
1443
+ A required condition object.
1444
+ .UNINDENT
1445
+ .UNINDENT
1446
+ .UNINDENT
1447
+ .SS Macro Expansion
1448
+ .sp
1449
+ As mentioned above, some fields support macro expansion. Macros are
1450
+ recognized in the form \fB$<macro\-namespace>{<macro\-name>}\fP\&. All macros are
1451
+ evaluated in the context of the preset being used, even if the macro is in a
1452
+ field that was inherited from another preset. For example, if the \fBBase\fP
1453
+ preset sets variable \fBPRESET_NAME\fP to \fB${presetName}\fP, and the
1454
+ \fBDerived\fP preset inherits from \fBBase\fP, \fBPRESET_NAME\fP will be set to
1455
+ \fBDerived\fP\&.
1456
+ .sp
1457
+ It is an error to not put a closing brace at the end of a macro name. For
1458
+ example, \fB${sourceDir\fP is invalid. A dollar sign (\fB$\fP) followed by
1459
+ anything other than a left curly brace (\fB{\fP) with a possible namespace is
1460
+ interpreted as a literal dollar sign.
1461
+ .sp
1462
+ Recognized macros include:
1463
+ .INDENT 0.0
1464
+ .TP
1465
+ .B \fB${sourceDir}\fP
1466
+ Path to the project source directory (i.e. the same as
1467
+ \X'tty: link #variable:CMAKE_SOURCE_DIR'\fI\%CMAKE_SOURCE_DIR\fP\X'tty: link').
1468
+ .TP
1469
+ .B \fB${sourceParentDir}\fP
1470
+ Path to the project source directory\(aqs parent directory.
1471
+ .TP
1472
+ .B \fB${sourceDirName}\fP
1473
+ The last filename component of \fB${sourceDir}\fP\&. For example, if
1474
+ \fB${sourceDir}\fP is \fB/path/to/source\fP, this would be \fBsource\fP\&.
1475
+ .TP
1476
+ .B \fB${presetName}\fP
1477
+ Name specified in the preset\(aqs \fBname\fP field.
1478
+ .sp
1479
+ This is a preset\-specific macro.
1480
+ .TP
1481
+ .B \fB${generator}\fP
1482
+ Generator specified in the preset\(aqs \fBgenerator\fP field. For build and
1483
+ test presets, this will evaluate to the generator specified by
1484
+ \fBconfigurePreset\fP\&.
1485
+ .sp
1486
+ This is a preset\-specific macro.
1487
+ .TP
1488
+ .B \fB${hostSystemName}\fP
1489
+ The name of the host operating system. Contains the same value as
1490
+ \X'tty: link #variable:CMAKE_HOST_SYSTEM_NAME'\fI\%CMAKE_HOST_SYSTEM_NAME\fP\X'tty: link'\&. This is allowed in preset files
1491
+ specifying version \fB3\fP or above.
1492
+ .TP
1493
+ .B \fB${fileDir}\fP
1494
+ Path to the directory containing the preset file which contains the macro.
1495
+ This is allowed in preset files specifying version \fB4\fP or above.
1496
+ .TP
1497
+ .B \fB${dollar}\fP
1498
+ A literal dollar sign (\fB$\fP).
1499
+ .TP
1500
+ .B \fB${pathListSep}\fP
1501
+ Native character for separating lists of paths, such as \fB:\fP or \fB;\fP\&.
1502
+ .sp
1503
+ For example, by setting \fBPATH\fP to
1504
+ \fB/path/to/ninja/bin${pathListSep}$env{PATH}\fP, \fB${pathListSep}\fP will
1505
+ expand to the underlying operating system\(aqs character used for
1506
+ concatenation in \fBPATH\fP\&.
1507
+ .sp
1508
+ This is allowed in preset files specifying version \fB5\fP or above.
1509
+ .TP
1510
+ .B \fB$env{<variable\-name>}\fP
1511
+ Environment variable with name \fB<variable\-name>\fP\&. The variable name may
1512
+ not be an empty string. If the variable is defined in the \fBenvironment\fP
1513
+ field, that value is used instead of the value from the parent environment.
1514
+ If the environment variable is not defined, this evaluates as an empty
1515
+ string.
1516
+ .sp
1517
+ Note that while Windows environment variable names are case\-insensitive,
1518
+ variable names within a preset are still case\-sensitive. This may lead to
1519
+ unexpected results when using inconsistent casing. For best results, keep
1520
+ the casing of environment variable names consistent.
1521
+ .TP
1522
+ .B \fB$penv{<variable\-name>}\fP
1523
+ Similar to \fB$env{<variable\-name>}\fP, except that the value only comes from
1524
+ the parent environment, and never from the \fBenvironment\fP field. This
1525
+ allows one to prepend or append values to existing environment variables.
1526
+ For example, setting \fBPATH\fP to \fB/path/to/ninja/bin:$penv{PATH}\fP will
1527
+ prepend \fB/path/to/ninja/bin\fP to the \fBPATH\fP environment variable. This
1528
+ is needed because \fB$env{<variable\-name>}\fP does not allow circular
1529
+ references.
1530
+ .TP
1531
+ .B \fB$vendor{<macro\-name>}\fP
1532
+ An extension point for vendors to insert their own macros. CMake will not
1533
+ be able to use presets which have a \fB$vendor{<macro\-name>}\fP macro, and
1534
+ effectively ignores such presets. However, it will still be able to use
1535
+ other presets from the same file.
1536
+ .sp
1537
+ CMake does not make any attempt to interpret \fB$vendor{<macro\-name>}\fP
1538
+ macros. However, to avoid name collisions, IDE vendors should prefix
1539
+ \fB<macro\-name>\fP with a very short (preferably <= 4 characters) vendor
1540
+ identifier prefix, followed by a \fB\&.\fP, followed by the macro name. For
1541
+ example, the Example IDE could have \fB$vendor{xide.ideInstallDir}\fP\&.
1542
+ .UNINDENT
1543
+ .SH SCHEMA
1544
+ .sp
1545
+ \fBThis file\fP provides a machine\-readable
1546
+ JSON schema for the \fBCMakePresets.json\fP format.
1547
+ .SH COPYRIGHT
1548
+ 2000-2024 Kitware, Inc. and Contributors
1549
+ .\" Generated by docutils manpage writer.
1550
+ .
cmake/man/man7/cmake-properties.7 ADDED
The diff for this file is too large to render. See raw diff
 
cmake/man/man7/cmake-qt.7 ADDED
@@ -0,0 +1,333 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .\" Man page generated from reStructuredText.
2
+ .
3
+ .
4
+ .nr rst2man-indent-level 0
5
+ .
6
+ .de1 rstReportMargin
7
+ \\$1 \\n[an-margin]
8
+ level \\n[rst2man-indent-level]
9
+ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
10
+ -
11
+ \\n[rst2man-indent0]
12
+ \\n[rst2man-indent1]
13
+ \\n[rst2man-indent2]
14
+ ..
15
+ .de1 INDENT
16
+ .\" .rstReportMargin pre:
17
+ . RS \\$1
18
+ . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
19
+ . nr rst2man-indent-level +1
20
+ .\" .rstReportMargin post:
21
+ ..
22
+ .de UNINDENT
23
+ . RE
24
+ .\" indent \\n[an-margin]
25
+ .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
26
+ .nr rst2man-indent-level -1
27
+ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
28
+ .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
29
+ ..
30
+ .TH "CMAKE-QT" "7" "Jan 10, 2025" "3.31.4" "CMake"
31
+ .SH NAME
32
+ cmake-qt \- CMake Qt Features Reference
33
+ .SH INTRODUCTION
34
+ .sp
35
+ CMake can find and use Qt 4, Qt 5 and Qt 6 libraries. The Qt 4 libraries are
36
+ found by the \X'tty: link #module:FindQt4'\fI\%FindQt4\fP\X'tty: link' find\-module shipped with CMake, whereas the
37
+ Qt 5 and Qt 6 libraries are found using \(dqConfig\-file Packages\(dq shipped with
38
+ Qt 5 and Qt 6. See \X'tty: link #manual:cmake-packages(7)'\fI\%cmake\-packages(7)\fP\X'tty: link' for more information about CMake
39
+ packages, and see \X'tty: link https://doc.qt.io/qt-6/cmake-manual.html'\fI\%the Qt cmake manual\fP\X'tty: link' for your Qt version.
40
+ .sp
41
+ Qt 4, Qt 5 and Qt 6 may be used together in the same
42
+ \X'tty: link #manual:cmake-buildsystem(7)'\fI\%CMake buildsystem\fP\X'tty: link':
43
+ .INDENT 0.0
44
+ .INDENT 3.5
45
+ .sp
46
+ .nf
47
+ .ft C
48
+ cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
49
+
50
+ project(Qt4_5_6)
51
+
52
+ set(CMAKE_AUTOMOC ON)
53
+
54
+ find_package(Qt6 COMPONENTS Widgets DBus REQUIRED)
55
+ add_executable(publisher publisher.cpp)
56
+ target_link_libraries(publisher Qt6::Widgets Qt6::DBus)
57
+
58
+ find_package(Qt5 COMPONENTS Gui DBus REQUIRED)
59
+ add_executable(subscriber1 subscriber1.cpp)
60
+ target_link_libraries(subscriber1 Qt5::Gui Qt5::DBus)
61
+
62
+ find_package(Qt4 REQUIRED)
63
+ add_executable(subscriber2 subscriber2.cpp)
64
+ target_link_libraries(subscriber2 Qt4::QtGui Qt4::QtDBus)
65
+ .ft P
66
+ .fi
67
+ .UNINDENT
68
+ .UNINDENT
69
+ .sp
70
+ A CMake target may not link to more than one Qt version. A diagnostic is issued
71
+ if this is attempted or results from transitive target dependency evaluation.
72
+ .SH QT BUILD TOOLS
73
+ .sp
74
+ Qt relies on some bundled tools for code generation, such as \fBmoc\fP for
75
+ meta\-object code generation, \fBuic\fP for widget layout and population,
76
+ and \fBrcc\fP for virtual file system content generation. These tools may be
77
+ automatically invoked by \X'tty: link #manual:cmake(1)'\fI\%cmake(1)\fP\X'tty: link' if the appropriate conditions
78
+ are met. The automatic tool invocation may be used with Qt version 4 to 6.
79
+ .SS AUTOMOC
80
+ .sp
81
+ The \X'tty: link #prop_tgt:AUTOMOC'\fI\%AUTOMOC\fP\X'tty: link' target property controls whether \X'tty: link #manual:cmake(1)'\fI\%cmake(1)\fP\X'tty: link'
82
+ inspects the C++ files in the target to determine if they require \fBmoc\fP to
83
+ be run, and to create rules to execute \fBmoc\fP at the appropriate time.
84
+ .sp
85
+ If a macro from \X'tty: link #prop_tgt:AUTOMOC_MACRO_NAMES'\fI\%AUTOMOC_MACRO_NAMES\fP\X'tty: link' is found in a header file,
86
+ \fBmoc\fP will be run on the file. The result will be put into a file named
87
+ according to \fBmoc_<basename>.cpp\fP\&.
88
+ If the macro is found in a C++ implementation
89
+ file, the moc output will be put into a file named according to
90
+ \fB<basename>.moc\fP, following the Qt conventions. The \fB<basename>.moc\fP must
91
+ be included by the user in the C++ implementation file with a preprocessor
92
+ \fB#include\fP\&.
93
+ .sp
94
+ Included \fBmoc_*.cpp\fP and \fB*.moc\fP files will be generated in the
95
+ \fB<AUTOGEN_BUILD_DIR>/include\fP directory which is
96
+ automatically added to the target\(aqs \X'tty: link #prop_tgt:INCLUDE_DIRECTORIES'\fI\%INCLUDE_DIRECTORIES\fP\X'tty: link'\&.
97
+ .INDENT 0.0
98
+ .IP \(bu 2
99
+ This differs from CMake 3.7 and below; see their documentation for details.
100
+ .IP \(bu 2
101
+ For \X'tty: link #prop_gbl:GENERATOR_IS_MULTI_CONFIG'\fI\%multi configuration generators\fP\X'tty: link',
102
+ the include directory is \fB<AUTOGEN_BUILD_DIR>/include_<CONFIG>\fP\&.
103
+ .IP \(bu 2
104
+ See \X'tty: link #prop_tgt:AUTOGEN_BUILD_DIR'\fI\%AUTOGEN_BUILD_DIR\fP\X'tty: link'\&.
105
+ .UNINDENT
106
+ .sp
107
+ Not included \fBmoc_<basename>.cpp\fP files will be generated in custom
108
+ folders to avoid name collisions and included in a separate
109
+ file which is compiled into the target, named either
110
+ \fB<AUTOGEN_BUILD_DIR>/mocs_compilation.cpp\fP or
111
+ \fB<AUTOGEN_BUILD_DIR>/mocs_compilation_$<CONFIG>.cpp\fP\&.
112
+ .INDENT 0.0
113
+ .IP \(bu 2
114
+ See \X'tty: link #prop_tgt:AUTOGEN_BUILD_DIR'\fI\%AUTOGEN_BUILD_DIR\fP\X'tty: link'\&.
115
+ .UNINDENT
116
+ .sp
117
+ The \fBmoc\fP command line will consume the \X'tty: link #prop_tgt:COMPILE_DEFINITIONS'\fI\%COMPILE_DEFINITIONS\fP\X'tty: link' and
118
+ \X'tty: link #prop_tgt:INCLUDE_DIRECTORIES'\fI\%INCLUDE_DIRECTORIES\fP\X'tty: link' target properties from the target it is being
119
+ invoked for, and for the appropriate build configuration.
120
+ .sp
121
+ The \X'tty: link #prop_tgt:AUTOMOC'\fI\%AUTOMOC\fP\X'tty: link' target property may be pre\-set for all
122
+ following targets by setting the \X'tty: link #variable:CMAKE_AUTOMOC'\fI\%CMAKE_AUTOMOC\fP\X'tty: link' variable. The
123
+ \X'tty: link #prop_tgt:AUTOMOC_MOC_OPTIONS'\fI\%AUTOMOC_MOC_OPTIONS\fP\X'tty: link' target property may be populated to set
124
+ options to pass to \fBmoc\fP\&. The \X'tty: link #variable:CMAKE_AUTOMOC_MOC_OPTIONS'\fI\%CMAKE_AUTOMOC_MOC_OPTIONS\fP\X'tty: link'
125
+ variable may be populated to pre\-set the options for all following targets.
126
+ .sp
127
+ Additional macro names to search for can be added to
128
+ \X'tty: link #prop_tgt:AUTOMOC_MACRO_NAMES'\fI\%AUTOMOC_MACRO_NAMES\fP\X'tty: link'\&.
129
+ .sp
130
+ Additional \fBmoc\fP dependency file names can be extracted from source code
131
+ by using \X'tty: link #prop_tgt:AUTOMOC_DEPEND_FILTERS'\fI\%AUTOMOC_DEPEND_FILTERS\fP\X'tty: link'\&.
132
+ .sp
133
+ Source C++ files can be excluded from \X'tty: link #prop_tgt:AUTOMOC'\fI\%AUTOMOC\fP\X'tty: link' processing by
134
+ enabling \X'tty: link #prop_sf:SKIP_AUTOMOC'\fI\%SKIP_AUTOMOC\fP\X'tty: link' or the broader \X'tty: link #prop_sf:SKIP_AUTOGEN'\fI\%SKIP_AUTOGEN\fP\X'tty: link'\&.
135
+ .SS AUTOUIC
136
+ .sp
137
+ The \X'tty: link #prop_tgt:AUTOUIC'\fI\%AUTOUIC\fP\X'tty: link' target property controls whether \X'tty: link #manual:cmake(1)'\fI\%cmake(1)\fP\X'tty: link'
138
+ inspects the C++ files in the target to determine if they require \fBuic\fP to
139
+ be run, and to create rules to execute \fBuic\fP at the appropriate time.
140
+ .sp
141
+ If a preprocessor \fB#include\fP directive is found which matches
142
+ \fB<path>ui_<basename>.h\fP, and a \fB<basename>.ui\fP file exists,
143
+ then \fBuic\fP will be executed to generate the appropriate file.
144
+ The \fB<basename>.ui\fP file is searched for in the following places
145
+ .INDENT 0.0
146
+ .IP 1. 3
147
+ \fB<source_dir>/<basename>.ui\fP
148
+ .IP 2. 3
149
+ \fB<source_dir>/<path><basename>.ui\fP
150
+ .IP 3. 3
151
+ \fB<AUTOUIC_SEARCH_PATHS>/<basename>.ui\fP
152
+ .IP 4. 3
153
+ \fB<AUTOUIC_SEARCH_PATHS>/<path><basename>.ui\fP
154
+ .UNINDENT
155
+ .sp
156
+ where \fB<source_dir>\fP is the directory of the C++ file and
157
+ \X'tty: link #prop_tgt:AUTOUIC_SEARCH_PATHS'\fI\%AUTOUIC_SEARCH_PATHS\fP\X'tty: link' is a list of additional search paths.
158
+ .sp
159
+ The generated generated \fBui_*.h\fP files are placed in the
160
+ \fB<AUTOGEN_BUILD_DIR>/include\fP directory which is
161
+ automatically added to the target\(aqs \X'tty: link #prop_tgt:INCLUDE_DIRECTORIES'\fI\%INCLUDE_DIRECTORIES\fP\X'tty: link'\&.
162
+ .INDENT 0.0
163
+ .IP \(bu 2
164
+ This differs from CMake 3.7 and below; see their documentation for details.
165
+ .IP \(bu 2
166
+ For \X'tty: link #prop_gbl:GENERATOR_IS_MULTI_CONFIG'\fI\%multi configuration generators\fP\X'tty: link',
167
+ the include directory is \fB<AUTOGEN_BUILD_DIR>/include_<CONFIG>\fP\&.
168
+ .IP \(bu 2
169
+ See \X'tty: link #prop_tgt:AUTOGEN_BUILD_DIR'\fI\%AUTOGEN_BUILD_DIR\fP\X'tty: link'\&.
170
+ .UNINDENT
171
+ .sp
172
+ The \X'tty: link #prop_tgt:AUTOUIC'\fI\%AUTOUIC\fP\X'tty: link' target property may be pre\-set for all following
173
+ targets by setting the \X'tty: link #variable:CMAKE_AUTOUIC'\fI\%CMAKE_AUTOUIC\fP\X'tty: link' variable. The
174
+ \X'tty: link #prop_tgt:AUTOUIC_OPTIONS'\fI\%AUTOUIC_OPTIONS\fP\X'tty: link' target property may be populated to set options
175
+ to pass to \fBuic\fP\&. The \X'tty: link #variable:CMAKE_AUTOUIC_OPTIONS'\fI\%CMAKE_AUTOUIC_OPTIONS\fP\X'tty: link' variable may be
176
+ populated to pre\-set the options for all following targets. The
177
+ \X'tty: link #prop_sf:AUTOUIC_OPTIONS'\fI\%AUTOUIC_OPTIONS\fP\X'tty: link' source file property may be set on the
178
+ \fB<basename>.ui\fP file to set particular options for the file. This
179
+ overrides options from the \X'tty: link #prop_tgt:AUTOUIC_OPTIONS'\fI\%AUTOUIC_OPTIONS\fP\X'tty: link' target property.
180
+ .sp
181
+ A target may populate the \X'tty: link #prop_tgt:INTERFACE_AUTOUIC_OPTIONS'\fI\%INTERFACE_AUTOUIC_OPTIONS\fP\X'tty: link' target
182
+ property with options that should be used when invoking \fBuic\fP\&. This must be
183
+ consistent with the \X'tty: link #prop_tgt:AUTOUIC_OPTIONS'\fI\%AUTOUIC_OPTIONS\fP\X'tty: link' target property content of the
184
+ depender target. The \X'tty: link #variable:CMAKE_DEBUG_TARGET_PROPERTIES'\fI\%CMAKE_DEBUG_TARGET_PROPERTIES\fP\X'tty: link' variable may
185
+ be used to track the origin target of such
186
+ \X'tty: link #prop_tgt:INTERFACE_AUTOUIC_OPTIONS'\fI\%INTERFACE_AUTOUIC_OPTIONS\fP\X'tty: link'\&. This means that a library which
187
+ provides an alternative translation system for Qt may specify options which
188
+ should be used when running \fBuic\fP:
189
+ .INDENT 0.0
190
+ .INDENT 3.5
191
+ .sp
192
+ .nf
193
+ .ft C
194
+ add_library(KI18n klocalizedstring.cpp)
195
+ target_link_libraries(KI18n Qt6::Core)
196
+
197
+ # KI18n uses the tr2i18n() function instead of tr(). That function is
198
+ # declared in the klocalizedstring.h header.
199
+ set(autouic_options
200
+ \-tr tr2i18n
201
+ \-include klocalizedstring.h
202
+ )
203
+
204
+ set_property(TARGET KI18n APPEND PROPERTY
205
+ INTERFACE_AUTOUIC_OPTIONS ${autouic_options}
206
+ )
207
+ .ft P
208
+ .fi
209
+ .UNINDENT
210
+ .UNINDENT
211
+ .sp
212
+ A consuming project linking to the target exported from upstream automatically
213
+ uses appropriate options when \fBuic\fP is run by \X'tty: link #prop_tgt:AUTOUIC'\fI\%AUTOUIC\fP\X'tty: link', as a
214
+ result of linking with the \X'tty: link #prop_tgt:IMPORTED'\fI\%IMPORTED\fP\X'tty: link' target:
215
+ .INDENT 0.0
216
+ .INDENT 3.5
217
+ .sp
218
+ .nf
219
+ .ft C
220
+ set(CMAKE_AUTOUIC ON)
221
+ # Uses a libwidget.ui file:
222
+ add_library(LibWidget libwidget.cpp)
223
+ target_link_libraries(LibWidget
224
+ KF5::KI18n
225
+ Qt5::Widgets
226
+ )
227
+ .ft P
228
+ .fi
229
+ .UNINDENT
230
+ .UNINDENT
231
+ .sp
232
+ Source files can be excluded from \X'tty: link #prop_tgt:AUTOUIC'\fI\%AUTOUIC\fP\X'tty: link' processing by
233
+ enabling \X'tty: link #prop_sf:SKIP_AUTOUIC'\fI\%SKIP_AUTOUIC\fP\X'tty: link' or the broader \X'tty: link #prop_sf:SKIP_AUTOGEN'\fI\%SKIP_AUTOGEN\fP\X'tty: link'\&.
234
+ .SS AUTORCC
235
+ .sp
236
+ The \X'tty: link #prop_tgt:AUTORCC'\fI\%AUTORCC\fP\X'tty: link' target property controls whether \X'tty: link #manual:cmake(1)'\fI\%cmake(1)\fP\X'tty: link'
237
+ creates rules to execute \fBrcc\fP at the appropriate time on source files
238
+ which have the suffix \fB\&.qrc\fP\&.
239
+ .INDENT 0.0
240
+ .INDENT 3.5
241
+ .sp
242
+ .nf
243
+ .ft C
244
+ add_executable(myexe main.cpp resource_file.qrc)
245
+ .ft P
246
+ .fi
247
+ .UNINDENT
248
+ .UNINDENT
249
+ .sp
250
+ The \X'tty: link #prop_tgt:AUTORCC'\fI\%AUTORCC\fP\X'tty: link' target property may be pre\-set for all following targets
251
+ by setting the \X'tty: link #variable:CMAKE_AUTORCC'\fI\%CMAKE_AUTORCC\fP\X'tty: link' variable. The
252
+ \X'tty: link #prop_tgt:AUTORCC_OPTIONS'\fI\%AUTORCC_OPTIONS\fP\X'tty: link' target property may be populated to set options
253
+ to pass to \fBrcc\fP\&. The \X'tty: link #variable:CMAKE_AUTORCC_OPTIONS'\fI\%CMAKE_AUTORCC_OPTIONS\fP\X'tty: link' variable may be
254
+ populated to pre\-set the options for all following targets. The
255
+ \X'tty: link #prop_sf:AUTORCC_OPTIONS'\fI\%AUTORCC_OPTIONS\fP\X'tty: link' source file property may be set on the
256
+ \fB<name>.qrc\fP file to set particular options for the file. This
257
+ overrides options from the \X'tty: link #prop_tgt:AUTORCC_OPTIONS'\fI\%AUTORCC_OPTIONS\fP\X'tty: link' target property.
258
+ .sp
259
+ Source files can be excluded from \X'tty: link #prop_tgt:AUTORCC'\fI\%AUTORCC\fP\X'tty: link' processing by
260
+ enabling \X'tty: link #prop_sf:SKIP_AUTORCC'\fI\%SKIP_AUTORCC\fP\X'tty: link' or the broader \X'tty: link #prop_sf:SKIP_AUTOGEN'\fI\%SKIP_AUTOGEN\fP\X'tty: link'\&.
261
+ .SH THE <ORIGIN>_AUTOGEN TARGET
262
+ .sp
263
+ The \fBmoc\fP and \fBuic\fP tools are executed as part of a synthesized
264
+ \fI\%The <ORIGIN>_autogen target\fP \X'tty: link #command:add_custom_target'\fI\%custom target\fP\X'tty: link' generated by
265
+ CMake. By default that \fI\%The <ORIGIN>_autogen target\fP target inherits the dependencies
266
+ of the \fB<ORIGIN>\fP target (see \X'tty: link #prop_tgt:AUTOGEN_ORIGIN_DEPENDS'\fI\%AUTOGEN_ORIGIN_DEPENDS\fP\X'tty: link').
267
+ Target dependencies may be added to the \fI\%The <ORIGIN>_autogen target\fP target by adding
268
+ them to the \X'tty: link #prop_tgt:AUTOGEN_TARGET_DEPENDS'\fI\%AUTOGEN_TARGET_DEPENDS\fP\X'tty: link' target property.
269
+ .sp
270
+ \fBNOTE:\fP
271
+ .INDENT 0.0
272
+ .INDENT 3.5
273
+ If Qt 5.15 or later is used and the generator is either \X'tty: link #generator:Ninja'\fI\%Ninja\fP\X'tty: link' or
274
+ \X'tty: link #makefile-generators'\fI\%Makefile Generators\fP\X'tty: link', see \fI\%The <ORIGIN>_autogen_timestamp_deps target\fP\&.
275
+ .UNINDENT
276
+ .UNINDENT
277
+ .SH THE <ORIGIN>_AUTOGEN_TIMESTAMP_DEPS TARGET
278
+ .sp
279
+ If Qt 5.15 or later is used and the generator is either \X'tty: link #generator:Ninja'\fI\%Ninja\fP\X'tty: link' or
280
+ \X'tty: link #makefile-generators'\fI\%Makefile Generators\fP\X'tty: link', the \fB<ORIGIN>_autogen_timestamp_deps\fP target is
281
+ also created in addition to the \fI\%The <ORIGIN>_autogen target\fP target. This target
282
+ does not have any sources or commands to execute, but it has dependencies that
283
+ were previously inherited by the pre\-Qt 5.15 \fI\%The <ORIGIN>_autogen target\fP target.
284
+ These dependencies will serve as a list of order\-only dependencies for the
285
+ custom command, without forcing the custom command to re\-execute.
286
+ .SH VISUAL STUDIO GENERATORS
287
+ .sp
288
+ When using the \X'tty: link #manual:cmake-generators(7)'\fI\%Visual Studio generators\fP\X'tty: link', CMake
289
+ generates a \fBPRE_BUILD\fP \X'tty: link #command:add_custom_command'\fI\%custom command\fP\X'tty: link'
290
+ instead of the \fI\%The <ORIGIN>_autogen target\fP
291
+ \X'tty: link #command:add_custom_target'\fI\%custom target\fP\X'tty: link' (for \X'tty: link #prop_tgt:AUTOMOC'\fI\%AUTOMOC\fP\X'tty: link' and
292
+ \X'tty: link #prop_tgt:AUTOUIC'\fI\%AUTOUIC\fP\X'tty: link'). This isn\(aqt always possible though and an
293
+ \fI\%The <ORIGIN>_autogen target\fP \X'tty: link #command:add_custom_target'\fI\%custom target\fP\X'tty: link' is used,
294
+ when either
295
+ .INDENT 0.0
296
+ .IP \(bu 2
297
+ the \fB<ORIGIN>\fP target depends on \X'tty: link #prop_sf:GENERATED'\fI\%GENERATED\fP\X'tty: link' files which aren\(aqt
298
+ excluded from \X'tty: link #prop_tgt:AUTOMOC'\fI\%AUTOMOC\fP\X'tty: link' and \X'tty: link #prop_tgt:AUTOUIC'\fI\%AUTOUIC\fP\X'tty: link' by
299
+ \X'tty: link #prop_sf:SKIP_AUTOMOC'\fI\%SKIP_AUTOMOC\fP\X'tty: link', \X'tty: link #prop_sf:SKIP_AUTOUIC'\fI\%SKIP_AUTOUIC\fP\X'tty: link', \X'tty: link #prop_sf:SKIP_AUTOGEN'\fI\%SKIP_AUTOGEN\fP\X'tty: link'
300
+ or \X'tty: link #policy:CMP0071'\fI\%CMP0071\fP\X'tty: link'
301
+ .IP \(bu 2
302
+ \X'tty: link #prop_tgt:AUTOGEN_TARGET_DEPENDS'\fI\%AUTOGEN_TARGET_DEPENDS\fP\X'tty: link' lists a source file
303
+ .IP \(bu 2
304
+ \X'tty: link #variable:CMAKE_GLOBAL_AUTOGEN_TARGET'\fI\%CMAKE_GLOBAL_AUTOGEN_TARGET\fP\X'tty: link' is enabled
305
+ .UNINDENT
306
+ .SH QTMAIN.LIB ON WINDOWS
307
+ .sp
308
+ The Qt 4 and 5 \X'tty: link #prop_tgt:IMPORTED'\fI\%IMPORTED\fP\X'tty: link' targets for the QtGui libraries specify
309
+ that the qtmain.lib static library shipped with Qt will be linked by all
310
+ dependent executables which have the \X'tty: link #prop_tgt:WIN32_EXECUTABLE'\fI\%WIN32_EXECUTABLE\fP\X'tty: link' enabled.
311
+ .sp
312
+ To disable this behavior, enable the \fBQt5_NO_LINK_QTMAIN\fP target property for
313
+ Qt 5 based targets or \fBQT4_NO_LINK_QTMAIN\fP target property for Qt 4 based
314
+ targets.
315
+ .INDENT 0.0
316
+ .INDENT 3.5
317
+ .sp
318
+ .nf
319
+ .ft C
320
+ add_executable(myexe WIN32 main.cpp)
321
+ target_link_libraries(myexe Qt4::QtGui)
322
+
323
+ add_executable(myexe_no_qtmain WIN32 main_no_qtmain.cpp)
324
+ set_property(TARGET main_no_qtmain PROPERTY QT4_NO_LINK_QTMAIN ON)
325
+ target_link_libraries(main_no_qtmain Qt4::QtGui)
326
+ .ft P
327
+ .fi
328
+ .UNINDENT
329
+ .UNINDENT
330
+ .SH COPYRIGHT
331
+ 2000-2024 Kitware, Inc. and Contributors
332
+ .\" Generated by docutils manpage writer.
333
+ .
cmake/man/man7/cmake-server.7 ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .\" Man page generated from reStructuredText.
2
+ .
3
+ .
4
+ .nr rst2man-indent-level 0
5
+ .
6
+ .de1 rstReportMargin
7
+ \\$1 \\n[an-margin]
8
+ level \\n[rst2man-indent-level]
9
+ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
10
+ -
11
+ \\n[rst2man-indent0]
12
+ \\n[rst2man-indent1]
13
+ \\n[rst2man-indent2]
14
+ ..
15
+ .de1 INDENT
16
+ .\" .rstReportMargin pre:
17
+ . RS \\$1
18
+ . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
19
+ . nr rst2man-indent-level +1
20
+ .\" .rstReportMargin post:
21
+ ..
22
+ .de UNINDENT
23
+ . RE
24
+ .\" indent \\n[an-margin]
25
+ .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
26
+ .nr rst2man-indent-level -1
27
+ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
28
+ .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
29
+ ..
30
+ .TH "CMAKE-SERVER" "7" "Jan 10, 2025" "3.31.4" "CMake"
31
+ .SH NAME
32
+ cmake-server \- CMake Server
33
+ .sp
34
+ The \X'tty: link #manual:cmake(1)'\fI\%cmake(1)\fP\X'tty: link' server mode has been removed since CMake 3.20.
35
+ Clients should use the \X'tty: link #manual:cmake-file-api(7)'\fI\%cmake\-file\-api(7)\fP\X'tty: link' instead.
36
+ .SH COPYRIGHT
37
+ 2000-2024 Kitware, Inc. and Contributors
38
+ .\" Generated by docutils manpage writer.
39
+ .
cmake/man/man7/cmake-toolchains.7 ADDED
@@ -0,0 +1,906 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .\" Man page generated from reStructuredText.
2
+ .
3
+ .
4
+ .nr rst2man-indent-level 0
5
+ .
6
+ .de1 rstReportMargin
7
+ \\$1 \\n[an-margin]
8
+ level \\n[rst2man-indent-level]
9
+ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
10
+ -
11
+ \\n[rst2man-indent0]
12
+ \\n[rst2man-indent1]
13
+ \\n[rst2man-indent2]
14
+ ..
15
+ .de1 INDENT
16
+ .\" .rstReportMargin pre:
17
+ . RS \\$1
18
+ . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
19
+ . nr rst2man-indent-level +1
20
+ .\" .rstReportMargin post:
21
+ ..
22
+ .de UNINDENT
23
+ . RE
24
+ .\" indent \\n[an-margin]
25
+ .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
26
+ .nr rst2man-indent-level -1
27
+ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
28
+ .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
29
+ ..
30
+ .TH "CMAKE-TOOLCHAINS" "7" "Jan 10, 2025" "3.31.4" "CMake"
31
+ .SH NAME
32
+ cmake-toolchains \- CMake Toolchains Reference
33
+ .SH INTRODUCTION
34
+ .sp
35
+ CMake uses a toolchain of utilities to compile, link libraries and create
36
+ archives, and other tasks to drive the build. The toolchain utilities available
37
+ are determined by the languages enabled. In normal builds, CMake automatically
38
+ determines the toolchain for host builds based on system introspection and
39
+ defaults. In cross\-compiling scenarios, a toolchain file may be specified
40
+ with information about compiler and utility paths.
41
+ .sp
42
+ Added in version 3.19: One may use \X'tty: link #manual:cmake-presets(7)'\fI\%cmake\-presets(7)\fP\X'tty: link' to specify toolchain files.
43
+
44
+ .SH LANGUAGES
45
+ .sp
46
+ Languages are enabled by the \X'tty: link #command:project'\fI\%project()\fP\X'tty: link' command. Language\-specific
47
+ built\-in variables, such as
48
+ \X'tty: link #variable:CMAKE_<LANG>_COMPILER'\fI\%CMAKE_CXX_COMPILER\fP\X'tty: link',
49
+ \X'tty: link #variable:CMAKE_<LANG>_COMPILER_ID'\fI\%CMAKE_CXX_COMPILER_ID\fP\X'tty: link' etc are set by
50
+ invoking the \X'tty: link #command:project'\fI\%project()\fP\X'tty: link' command. If no project command
51
+ is in the top\-level CMakeLists file, one will be implicitly generated. By default
52
+ the enabled languages are \fBC\fP and \fBCXX\fP:
53
+ .INDENT 0.0
54
+ .INDENT 3.5
55
+ .sp
56
+ .nf
57
+ .ft C
58
+ project(C_Only C)
59
+ .ft P
60
+ .fi
61
+ .UNINDENT
62
+ .UNINDENT
63
+ .sp
64
+ A special value of \fBNONE\fP can also be used with the \X'tty: link #command:project'\fI\%project()\fP\X'tty: link' command
65
+ to enable no languages:
66
+ .INDENT 0.0
67
+ .INDENT 3.5
68
+ .sp
69
+ .nf
70
+ .ft C
71
+ project(MyProject NONE)
72
+ .ft P
73
+ .fi
74
+ .UNINDENT
75
+ .UNINDENT
76
+ .sp
77
+ The \X'tty: link #command:enable_language'\fI\%enable_language()\fP\X'tty: link' command can be used to enable languages after the
78
+ \X'tty: link #command:project'\fI\%project()\fP\X'tty: link' command:
79
+ .INDENT 0.0
80
+ .INDENT 3.5
81
+ .sp
82
+ .nf
83
+ .ft C
84
+ enable_language(CXX)
85
+ .ft P
86
+ .fi
87
+ .UNINDENT
88
+ .UNINDENT
89
+ .sp
90
+ When a language is enabled, CMake finds a compiler for that language, and
91
+ determines some information, such as the vendor and version of the compiler,
92
+ the target architecture and bitwidth, the location of corresponding utilities
93
+ etc.
94
+ .sp
95
+ The \X'tty: link #prop_gbl:ENABLED_LANGUAGES'\fI\%ENABLED_LANGUAGES\fP\X'tty: link' global property contains the languages which
96
+ are currently enabled.
97
+ .SH VARIABLES AND PROPERTIES
98
+ .sp
99
+ Several variables relate to the language components of a toolchain which are
100
+ enabled:
101
+ .INDENT 0.0
102
+ .TP
103
+ .B \X'tty: link #variable:CMAKE_<LANG>_COMPILER'\fI\%CMAKE_<LANG>_COMPILER\fP\X'tty: link'
104
+ The full path to the compiler used for \fB<LANG>\fP
105
+ .TP
106
+ .B \X'tty: link #variable:CMAKE_<LANG>_COMPILER_ID'\fI\%CMAKE_<LANG>_COMPILER_ID\fP\X'tty: link'
107
+ The compiler identifier used by CMake
108
+ .TP
109
+ .B \X'tty: link #variable:CMAKE_<LANG>_COMPILER_VERSION'\fI\%CMAKE_<LANG>_COMPILER_VERSION\fP\X'tty: link'
110
+ The version of the compiler.
111
+ .TP
112
+ .B \X'tty: link #variable:CMAKE_<LANG>_FLAGS'\fI\%CMAKE_<LANG>_FLAGS\fP\X'tty: link'
113
+ The variables and the configuration\-specific equivalents contain flags that
114
+ will be added to the compile command when compiling a file of a particular
115
+ language.
116
+ .UNINDENT
117
+ .sp
118
+ CMake needs a way to determine which compiler to use to invoke the linker.
119
+ This is determined by the \X'tty: link #prop_sf:LANGUAGE'\fI\%LANGUAGE\fP\X'tty: link' property of source files of the
120
+ \X'tty: link #manual:cmake-buildsystem(7)'\fI\%target\fP\X'tty: link', and in the case of static libraries,
121
+ the \fBLANGUAGE\fP of the dependent libraries. The choice CMake makes may be overridden
122
+ with the \X'tty: link #prop_tgt:LINKER_LANGUAGE'\fI\%LINKER_LANGUAGE\fP\X'tty: link' target property.
123
+ .SH TOOLCHAIN FEATURES
124
+ .sp
125
+ CMake provides the \X'tty: link #command:try_compile'\fI\%try_compile()\fP\X'tty: link' command and wrapper macros such as
126
+ \X'tty: link #module:CheckSourceCompiles'\fI\%CheckSourceCompiles\fP\X'tty: link', \X'tty: link #module:CheckCXXSymbolExists'\fI\%CheckCXXSymbolExists\fP\X'tty: link' and
127
+ \X'tty: link #module:CheckIncludeFile'\fI\%CheckIncludeFile\fP\X'tty: link' to test capability and availability of various
128
+ toolchain features. These APIs test the toolchain in some way and cache the
129
+ result so that the test does not have to be performed again the next time
130
+ CMake runs.
131
+ .sp
132
+ Some toolchain features have built\-in handling in CMake, and do not require
133
+ compile\-tests. For example, \X'tty: link #prop_tgt:POSITION_INDEPENDENT_CODE'\fI\%POSITION_INDEPENDENT_CODE\fP\X'tty: link' allows
134
+ specifying that a target should be built as position\-independent code, if
135
+ the compiler supports that feature. The \X'tty: link #prop_tgt:<LANG>_VISIBILITY_PRESET'\fI\%<LANG>_VISIBILITY_PRESET\fP\X'tty: link'
136
+ and \X'tty: link #prop_tgt:VISIBILITY_INLINES_HIDDEN'\fI\%VISIBILITY_INLINES_HIDDEN\fP\X'tty: link' target properties add flags for
137
+ hidden visibility, if supported by the compiler.
138
+ .SH CROSS COMPILING
139
+ .sp
140
+ If \X'tty: link #manual:cmake(1)'\fI\%cmake(1)\fP\X'tty: link' is invoked with the command line parameter
141
+ \X'tty: link #cmdoption-cmake-toolchain'\fI\%\-\-toolchain path/to/file\fP\X'tty: link' or
142
+ \X'tty: link #cmdoption-cmake-D'\fI\%\-DCMAKE_TOOLCHAIN_FILE=path/to/file\fP\X'tty: link', the
143
+ file will be loaded early to set values for the compilers.
144
+ The \X'tty: link #variable:CMAKE_CROSSCOMPILING'\fI\%CMAKE_CROSSCOMPILING\fP\X'tty: link' variable is set to true when CMake is
145
+ cross\-compiling.
146
+ .sp
147
+ Note that using the \X'tty: link #variable:CMAKE_SOURCE_DIR'\fI\%CMAKE_SOURCE_DIR\fP\X'tty: link' or \X'tty: link #variable:CMAKE_BINARY_DIR'\fI\%CMAKE_BINARY_DIR\fP\X'tty: link'
148
+ variables inside a toolchain file is typically undesirable. The toolchain
149
+ file is used in contexts where these variables have different values when used
150
+ in different places (e.g. as part of a call to \X'tty: link #command:try_compile'\fI\%try_compile()\fP\X'tty: link'). In most
151
+ cases, where there is a need to evaluate paths inside a toolchain file, the more
152
+ appropriate variable to use would be \X'tty: link #variable:CMAKE_CURRENT_LIST_DIR'\fI\%CMAKE_CURRENT_LIST_DIR\fP\X'tty: link', since
153
+ it always has an unambiguous, predictable value.
154
+ .SS Cross Compiling for Linux
155
+ .sp
156
+ A typical cross\-compiling toolchain for Linux has content such
157
+ as:
158
+ .INDENT 0.0
159
+ .INDENT 3.5
160
+ .sp
161
+ .nf
162
+ .ft C
163
+ set(CMAKE_SYSTEM_NAME Linux)
164
+ set(CMAKE_SYSTEM_PROCESSOR arm)
165
+
166
+ set(CMAKE_SYSROOT /home/devel/rasp\-pi\-rootfs)
167
+ set(CMAKE_STAGING_PREFIX /home/devel/stage)
168
+
169
+ set(tools /home/devel/gcc\-4.7\-linaro\-rpi\-gnueabihf)
170
+ set(CMAKE_C_COMPILER ${tools}/bin/arm\-linux\-gnueabihf\-gcc)
171
+ set(CMAKE_CXX_COMPILER ${tools}/bin/arm\-linux\-gnueabihf\-g++)
172
+
173
+ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
174
+ set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
175
+ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
176
+ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
177
+ .ft P
178
+ .fi
179
+ .UNINDENT
180
+ .UNINDENT
181
+ .sp
182
+ Where:
183
+ .INDENT 0.0
184
+ .TP
185
+ .B \X'tty: link #variable:CMAKE_SYSTEM_NAME'\fI\%CMAKE_SYSTEM_NAME\fP\X'tty: link'
186
+ is the CMake\-identifier of the target platform to build for.
187
+ .TP
188
+ .B \X'tty: link #variable:CMAKE_SYSTEM_PROCESSOR'\fI\%CMAKE_SYSTEM_PROCESSOR\fP\X'tty: link'
189
+ is the CMake\-identifier of the target architecture.
190
+ .TP
191
+ .B \X'tty: link #variable:CMAKE_SYSROOT'\fI\%CMAKE_SYSROOT\fP\X'tty: link'
192
+ is optional, and may be specified if a sysroot is available.
193
+ .TP
194
+ .B \X'tty: link #variable:CMAKE_STAGING_PREFIX'\fI\%CMAKE_STAGING_PREFIX\fP\X'tty: link'
195
+ is also optional. It may be used to specify a path on the host to install to.
196
+ The \X'tty: link #variable:CMAKE_INSTALL_PREFIX'\fI\%CMAKE_INSTALL_PREFIX\fP\X'tty: link' is always the runtime installation
197
+ location, even when cross\-compiling.
198
+ .TP
199
+ .B \X'tty: link #variable:CMAKE_<LANG>_COMPILER'\fI\%CMAKE_<LANG>_COMPILER\fP\X'tty: link'
200
+ variable may be set to full paths, or to names of compilers to search for
201
+ in standard locations. For toolchains that do not support linking binaries
202
+ without custom flags or scripts one may set the
203
+ \X'tty: link #variable:CMAKE_TRY_COMPILE_TARGET_TYPE'\fI\%CMAKE_TRY_COMPILE_TARGET_TYPE\fP\X'tty: link' variable to \fBSTATIC_LIBRARY\fP to
204
+ tell CMake not to try to link executables during its checks.
205
+ .UNINDENT
206
+ .sp
207
+ CMake \fBfind_*\fP commands will look in the sysroot, and the \X'tty: link #variable:CMAKE_FIND_ROOT_PATH'\fI\%CMAKE_FIND_ROOT_PATH\fP\X'tty: link'
208
+ entries by default in all cases, as well as looking in the host system root prefix.
209
+ Although this can be controlled on a case\-by\-case basis, when cross\-compiling, it
210
+ can be useful to exclude looking in either the host or the target for particular
211
+ artifacts. Generally, includes, libraries and packages should be found in the
212
+ target system prefixes, whereas executables which must be run as part of the build
213
+ should be found only on the host and not on the target. This is the purpose of
214
+ the \fBCMAKE_FIND_ROOT_PATH_MODE_*\fP variables.
215
+ .SS Cross Compiling for the Cray Linux Environment
216
+ .sp
217
+ Cross compiling for compute nodes in the Cray Linux Environment can be done
218
+ without needing a separate toolchain file. Specifying
219
+ \fB\-DCMAKE_SYSTEM_NAME=CrayLinuxEnvironment\fP on the CMake command line will
220
+ ensure that the appropriate build settings and search paths are configured.
221
+ The platform will pull its configuration from the current environment
222
+ variables and will configure a project to use the compiler wrappers from the
223
+ Cray Programming Environment\(aqs \fBPrgEnv\-*\fP modules if present and loaded.
224
+ .sp
225
+ The default configuration of the Cray Programming Environment is to only
226
+ support static libraries. This can be overridden and shared libraries
227
+ enabled by setting the \fBCRAYPE_LINK_TYPE\fP environment variable to
228
+ \fBdynamic\fP\&.
229
+ .sp
230
+ Running CMake without specifying \X'tty: link #variable:CMAKE_SYSTEM_NAME'\fI\%CMAKE_SYSTEM_NAME\fP\X'tty: link' will
231
+ run the configure step in host mode assuming a standard Linux environment.
232
+ If not overridden, the \fBPrgEnv\-*\fP compiler wrappers will end up getting used,
233
+ which if targeting the either the login node or compute node, is likely not the
234
+ desired behavior. The exception to this would be if you are building directly
235
+ on a NID instead of cross\-compiling from a login node. If trying to build
236
+ software for a login node, you will need to either first unload the
237
+ currently loaded \fBPrgEnv\-*\fP module or explicitly tell CMake to use the
238
+ system compilers in \fB/usr/bin\fP instead of the Cray wrappers. If instead
239
+ targeting a compute node is desired, just specify the
240
+ \X'tty: link #variable:CMAKE_SYSTEM_NAME'\fI\%CMAKE_SYSTEM_NAME\fP\X'tty: link' as mentioned above.
241
+ .SS Cross Compiling using Clang
242
+ .sp
243
+ Some compilers such as Clang are inherently cross compilers.
244
+ The \X'tty: link #variable:CMAKE_<LANG>_COMPILER_TARGET'\fI\%CMAKE_<LANG>_COMPILER_TARGET\fP\X'tty: link' can be set to pass a
245
+ value to those supported compilers when compiling:
246
+ .INDENT 0.0
247
+ .INDENT 3.5
248
+ .sp
249
+ .nf
250
+ .ft C
251
+ set(CMAKE_SYSTEM_NAME Linux)
252
+ set(CMAKE_SYSTEM_PROCESSOR arm)
253
+
254
+ set(triple arm\-linux\-gnueabihf)
255
+
256
+ set(CMAKE_C_COMPILER clang)
257
+ set(CMAKE_C_COMPILER_TARGET ${triple})
258
+ set(CMAKE_CXX_COMPILER clang++)
259
+ set(CMAKE_CXX_COMPILER_TARGET ${triple})
260
+ .ft P
261
+ .fi
262
+ .UNINDENT
263
+ .UNINDENT
264
+ .sp
265
+ Similarly, some compilers do not ship their own supplementary utilities
266
+ such as linkers, but provide a way to specify the location of the external
267
+ toolchain which will be used by the compiler driver. The
268
+ \X'tty: link #variable:CMAKE_<LANG>_COMPILER_EXTERNAL_TOOLCHAIN'\fI\%CMAKE_<LANG>_COMPILER_EXTERNAL_TOOLCHAIN\fP\X'tty: link' variable can be set in a
269
+ toolchain file to pass the path to the compiler driver.
270
+ .SS Cross Compiling for QNX
271
+ .sp
272
+ As the Clang compiler the QNX QCC compile is inherently a cross compiler.
273
+ And the \X'tty: link #variable:CMAKE_<LANG>_COMPILER_TARGET'\fI\%CMAKE_<LANG>_COMPILER_TARGET\fP\X'tty: link' can be set to pass a
274
+ value to those supported compilers when compiling:
275
+ .INDENT 0.0
276
+ .INDENT 3.5
277
+ .sp
278
+ .nf
279
+ .ft C
280
+ set(CMAKE_SYSTEM_NAME QNX)
281
+
282
+ set(arch gcc_ntoarmv7le)
283
+
284
+ set(CMAKE_C_COMPILER qcc)
285
+ set(CMAKE_C_COMPILER_TARGET ${arch})
286
+ set(CMAKE_CXX_COMPILER QCC)
287
+ set(CMAKE_CXX_COMPILER_TARGET ${arch})
288
+
289
+ set(CMAKE_SYSROOT $ENV{QNX_TARGET})
290
+ .ft P
291
+ .fi
292
+ .UNINDENT
293
+ .UNINDENT
294
+ .SS Cross Compiling for Windows CE
295
+ .sp
296
+ Cross compiling for Windows CE requires the corresponding SDK being
297
+ installed on your system. These SDKs are usually installed under
298
+ \fBC:/Program Files (x86)/Windows CE Tools/SDKs\fP\&.
299
+ .sp
300
+ A toolchain file to configure a Visual Studio generator for
301
+ Windows CE may look like this:
302
+ .INDENT 0.0
303
+ .INDENT 3.5
304
+ .sp
305
+ .nf
306
+ .ft C
307
+ set(CMAKE_SYSTEM_NAME WindowsCE)
308
+
309
+ set(CMAKE_SYSTEM_VERSION 8.0)
310
+ set(CMAKE_SYSTEM_PROCESSOR arm)
311
+
312
+ set(CMAKE_GENERATOR_TOOLSET CE800) # Can be omitted for 8.0
313
+ set(CMAKE_GENERATOR_PLATFORM SDK_AM335X_SK_WEC2013_V310)
314
+ .ft P
315
+ .fi
316
+ .UNINDENT
317
+ .UNINDENT
318
+ .sp
319
+ The \X'tty: link #variable:CMAKE_GENERATOR_PLATFORM'\fI\%CMAKE_GENERATOR_PLATFORM\fP\X'tty: link' tells the generator which SDK to use.
320
+ Further \X'tty: link #variable:CMAKE_SYSTEM_VERSION'\fI\%CMAKE_SYSTEM_VERSION\fP\X'tty: link' tells the generator what version of
321
+ Windows CE to use. Currently version 8.0 (Windows Embedded Compact 2013) is
322
+ supported out of the box. Other versions may require one to set
323
+ \X'tty: link #variable:CMAKE_GENERATOR_TOOLSET'\fI\%CMAKE_GENERATOR_TOOLSET\fP\X'tty: link' to the correct value.
324
+ .SS Cross Compiling for Windows 10 Universal Applications
325
+ .sp
326
+ A toolchain file to configure \X'tty: link #visual-studio-generators'\fI\%Visual Studio Generators\fP\X'tty: link' for a
327
+ Windows 10 Universal Application may look like this:
328
+ .INDENT 0.0
329
+ .INDENT 3.5
330
+ .sp
331
+ .nf
332
+ .ft C
333
+ set(CMAKE_SYSTEM_NAME WindowsStore)
334
+ set(CMAKE_SYSTEM_VERSION 10.0)
335
+ .ft P
336
+ .fi
337
+ .UNINDENT
338
+ .UNINDENT
339
+ .sp
340
+ A Windows 10 Universal Application targets both Windows Store and
341
+ Windows Phone. Specify the \X'tty: link #variable:CMAKE_SYSTEM_VERSION'\fI\%CMAKE_SYSTEM_VERSION\fP\X'tty: link' variable
342
+ to be \fB10.0\fP or higher.
343
+ .sp
344
+ CMake selects a Windows SDK as described by documentation of the
345
+ \X'tty: link #variable:CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION'\fI\%CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION\fP\X'tty: link' variable.
346
+ .SS Cross Compiling for Windows Phone
347
+ .sp
348
+ A toolchain file to configure a Visual Studio generator for
349
+ Windows Phone may look like this:
350
+ .INDENT 0.0
351
+ .INDENT 3.5
352
+ .sp
353
+ .nf
354
+ .ft C
355
+ set(CMAKE_SYSTEM_NAME WindowsPhone)
356
+ set(CMAKE_SYSTEM_VERSION 8.1)
357
+ .ft P
358
+ .fi
359
+ .UNINDENT
360
+ .UNINDENT
361
+ .SS Cross Compiling for Windows Store
362
+ .sp
363
+ A toolchain file to configure a Visual Studio generator for
364
+ Windows Store may look like this:
365
+ .INDENT 0.0
366
+ .INDENT 3.5
367
+ .sp
368
+ .nf
369
+ .ft C
370
+ set(CMAKE_SYSTEM_NAME WindowsStore)
371
+ set(CMAKE_SYSTEM_VERSION 8.1)
372
+ .ft P
373
+ .fi
374
+ .UNINDENT
375
+ .UNINDENT
376
+ .SS Cross Compiling for ADSP SHARC/Blackfin
377
+ .sp
378
+ Cross\-compiling for ADSP SHARC or Blackfin can be configured
379
+ by setting the \X'tty: link #variable:CMAKE_SYSTEM_NAME'\fI\%CMAKE_SYSTEM_NAME\fP\X'tty: link' variable to \fBADSP\fP
380
+ and the \X'tty: link #variable:CMAKE_SYSTEM_PROCESSOR'\fI\%CMAKE_SYSTEM_PROCESSOR\fP\X'tty: link' variable
381
+ to the \(dqpart number\(dq, excluding the \fBADSP\-\fP prefix,
382
+ for example, \fB21594\fP, \fBSC589\fP, etc.
383
+ This value is case insensitive.
384
+ .sp
385
+ CMake will automatically search for CCES or VDSP++ installs
386
+ in their default install locations
387
+ and select the most recent version found.
388
+ CCES will be selected over VDSP++ if both are installed.
389
+ Custom install paths can be set via the \X'tty: link #variable:CMAKE_ADSP_ROOT'\fI\%CMAKE_ADSP_ROOT\fP\X'tty: link' variable
390
+ or the \X'tty: link #envvar:ADSP_ROOT'\fI\%ADSP_ROOT\fP\X'tty: link' environment variable.
391
+ .sp
392
+ The compiler (\fBcc21k\fP vs. \fBccblkfn\fP) is selected automatically
393
+ based on the \X'tty: link #variable:CMAKE_SYSTEM_PROCESSOR'\fI\%CMAKE_SYSTEM_PROCESSOR\fP\X'tty: link' value provided.
394
+ .SS Cross Compiling for Android
395
+ .sp
396
+ A toolchain file may configure cross\-compiling for Android by setting the
397
+ \X'tty: link #variable:CMAKE_SYSTEM_NAME'\fI\%CMAKE_SYSTEM_NAME\fP\X'tty: link' variable to \fBAndroid\fP\&. Further configuration
398
+ is specific to the Android development environment to be used.
399
+ .sp
400
+ For \X'tty: link #visual-studio-generators'\fI\%Visual Studio Generators\fP\X'tty: link', CMake expects \fI\%NVIDIA Nsight Tegra
401
+ Visual Studio Edition\fP or the \fI\%Visual Studio tools for Android\fP to be installed. See those sections
402
+ for further configuration details.
403
+ .sp
404
+ For \X'tty: link #makefile-generators'\fI\%Makefile Generators\fP\X'tty: link' and the \X'tty: link #generator:Ninja'\fI\%Ninja\fP\X'tty: link' generator,
405
+ CMake expects one of these environments:
406
+ .INDENT 0.0
407
+ .IP \(bu 2
408
+ \fI\%NDK\fP
409
+ .IP \(bu 2
410
+ \fI\%Standalone Toolchain\fP
411
+ .UNINDENT
412
+ .sp
413
+ CMake uses the following steps to select one of the environments:
414
+ .INDENT 0.0
415
+ .IP \(bu 2
416
+ If the \X'tty: link #variable:CMAKE_ANDROID_NDK'\fI\%CMAKE_ANDROID_NDK\fP\X'tty: link' variable is set, the NDK at the
417
+ specified location will be used.
418
+ .IP \(bu 2
419
+ Else, if the \X'tty: link #variable:CMAKE_ANDROID_STANDALONE_TOOLCHAIN'\fI\%CMAKE_ANDROID_STANDALONE_TOOLCHAIN\fP\X'tty: link' variable
420
+ is set, the Standalone Toolchain at the specified location will be used.
421
+ .IP \(bu 2
422
+ Else, if the \X'tty: link #variable:CMAKE_SYSROOT'\fI\%CMAKE_SYSROOT\fP\X'tty: link' variable is set to a directory
423
+ of the form \fB<ndk>/platforms/android\-<api>/arch\-<arch>\fP, the \fB<ndk>\fP
424
+ part will be used as the value of \X'tty: link #variable:CMAKE_ANDROID_NDK'\fI\%CMAKE_ANDROID_NDK\fP\X'tty: link' and the
425
+ NDK will be used.
426
+ .IP \(bu 2
427
+ Else, if the \X'tty: link #variable:CMAKE_SYSROOT'\fI\%CMAKE_SYSROOT\fP\X'tty: link' variable is set to a directory of the
428
+ form \fB<standalone\-toolchain>/sysroot\fP, the \fB<standalone\-toolchain>\fP part
429
+ will be used as the value of \X'tty: link #variable:CMAKE_ANDROID_STANDALONE_TOOLCHAIN'\fI\%CMAKE_ANDROID_STANDALONE_TOOLCHAIN\fP\X'tty: link'
430
+ and the Standalone Toolchain will be used.
431
+ .IP \(bu 2
432
+ Else, if a cmake variable \fBANDROID_NDK\fP is set it will be used
433
+ as the value of \X'tty: link #variable:CMAKE_ANDROID_NDK'\fI\%CMAKE_ANDROID_NDK\fP\X'tty: link', and the NDK will be used.
434
+ .IP \(bu 2
435
+ Else, if a cmake variable \fBANDROID_STANDALONE_TOOLCHAIN\fP is set, it will be
436
+ used as the value of \X'tty: link #variable:CMAKE_ANDROID_STANDALONE_TOOLCHAIN'\fI\%CMAKE_ANDROID_STANDALONE_TOOLCHAIN\fP\X'tty: link', and the
437
+ Standalone Toolchain will be used.
438
+ .IP \(bu 2
439
+ Else, if an environment variable \fBANDROID_NDK_ROOT\fP or
440
+ \fBANDROID_NDK\fP is set, it will be used as the value of
441
+ \X'tty: link #variable:CMAKE_ANDROID_NDK'\fI\%CMAKE_ANDROID_NDK\fP\X'tty: link', and the NDK will be used.
442
+ .IP \(bu 2
443
+ Else, if an environment variable \fBANDROID_STANDALONE_TOOLCHAIN\fP is
444
+ set then it will be used as the value of
445
+ \X'tty: link #variable:CMAKE_ANDROID_STANDALONE_TOOLCHAIN'\fI\%CMAKE_ANDROID_STANDALONE_TOOLCHAIN\fP\X'tty: link', and the Standalone
446
+ Toolchain will be used.
447
+ .IP \(bu 2
448
+ Else, an error diagnostic will be issued that neither the NDK or
449
+ Standalone Toolchain can be found.
450
+ .UNINDENT
451
+ .sp
452
+ Added in version 3.20: If an Android NDK is selected, its version number is reported
453
+ in the \X'tty: link #variable:CMAKE_ANDROID_NDK_VERSION'\fI\%CMAKE_ANDROID_NDK_VERSION\fP\X'tty: link' variable.
454
+
455
+ .SS Cross Compiling for Android with the NDK
456
+ .sp
457
+ A toolchain file may configure \X'tty: link #makefile-generators'\fI\%Makefile Generators\fP\X'tty: link',
458
+ \X'tty: link #ninja-generators'\fI\%Ninja Generators\fP\X'tty: link', or \X'tty: link #visual-studio-generators'\fI\%Visual Studio Generators\fP\X'tty: link' to target
459
+ Android for cross\-compiling.
460
+ .sp
461
+ Configure use of an Android NDK with the following variables:
462
+ .INDENT 0.0
463
+ .TP
464
+ .B \X'tty: link #variable:CMAKE_SYSTEM_NAME'\fI\%CMAKE_SYSTEM_NAME\fP\X'tty: link'
465
+ Set to \fBAndroid\fP\&. Must be specified to enable cross compiling
466
+ for Android.
467
+ .TP
468
+ .B \X'tty: link #variable:CMAKE_SYSTEM_VERSION'\fI\%CMAKE_SYSTEM_VERSION\fP\X'tty: link'
469
+ Set to the Android API level. If not specified, the value is
470
+ determined as follows:
471
+ .INDENT 7.0
472
+ .IP \(bu 2
473
+ If the \X'tty: link #variable:CMAKE_ANDROID_API'\fI\%CMAKE_ANDROID_API\fP\X'tty: link' variable is set, its value
474
+ is used as the API level.
475
+ .IP \(bu 2
476
+ If the \X'tty: link #variable:CMAKE_SYSROOT'\fI\%CMAKE_SYSROOT\fP\X'tty: link' variable is set, the API level is
477
+ detected from the NDK directory structure containing the sysroot.
478
+ .IP \(bu 2
479
+ Otherwise, the latest API level available in the NDK is used.
480
+ .UNINDENT
481
+ .TP
482
+ .B \X'tty: link #variable:CMAKE_ANDROID_ARCH_ABI'\fI\%CMAKE_ANDROID_ARCH_ABI\fP\X'tty: link'
483
+ Set to the Android ABI (architecture). If not specified, this
484
+ variable will default to the first supported ABI in the list of
485
+ \fBarmeabi\fP, \fBarmeabi\-v7a\fP and \fBarm64\-v8a\fP\&.
486
+ The \X'tty: link #variable:CMAKE_ANDROID_ARCH'\fI\%CMAKE_ANDROID_ARCH\fP\X'tty: link' variable will be computed
487
+ from \fBCMAKE_ANDROID_ARCH_ABI\fP automatically.
488
+ Also see the \X'tty: link #variable:CMAKE_ANDROID_ARM_MODE'\fI\%CMAKE_ANDROID_ARM_MODE\fP\X'tty: link' and
489
+ \X'tty: link #variable:CMAKE_ANDROID_ARM_NEON'\fI\%CMAKE_ANDROID_ARM_NEON\fP\X'tty: link' variables.
490
+ .TP
491
+ .B \X'tty: link #variable:CMAKE_ANDROID_NDK'\fI\%CMAKE_ANDROID_NDK\fP\X'tty: link'
492
+ Set to the absolute path to the Android NDK root directory.
493
+ If not specified, a default for this variable will be chosen
494
+ as specified \fI\%above\fP\&.
495
+ .TP
496
+ .B \X'tty: link #variable:CMAKE_ANDROID_NDK_DEPRECATED_HEADERS'\fI\%CMAKE_ANDROID_NDK_DEPRECATED_HEADERS\fP\X'tty: link'
497
+ Set to a true value to use the deprecated per\-api\-level headers
498
+ instead of the unified headers. If not specified, the default will
499
+ be false unless using a NDK that does not provide unified headers.
500
+ .TP
501
+ .B \X'tty: link #variable:CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION'\fI\%CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION\fP\X'tty: link'
502
+ On NDK r19 or above, this variable must be unset or set to \fBclang\fP\&.
503
+ On NDK r18 or below, set this to the version of the NDK toolchain to
504
+ be selected as the compiler. If not specified, the default will be
505
+ the latest available GCC toolchain.
506
+ .TP
507
+ .B \X'tty: link #variable:CMAKE_ANDROID_STL_TYPE'\fI\%CMAKE_ANDROID_STL_TYPE\fP\X'tty: link'
508
+ Set to specify which C++ standard library to use. If not specified,
509
+ a default will be selected as described in the variable documentation.
510
+ .UNINDENT
511
+ .sp
512
+ The following variables will be computed and provided automatically:
513
+ .INDENT 0.0
514
+ .TP
515
+ .B \X'tty: link #variable:CMAKE_<LANG>_ANDROID_TOOLCHAIN_PREFIX'\fI\%CMAKE_<LANG>_ANDROID_TOOLCHAIN_PREFIX\fP\X'tty: link'
516
+ The absolute path prefix to the binutils in the NDK toolchain.
517
+ .TP
518
+ .B \X'tty: link #variable:CMAKE_<LANG>_ANDROID_TOOLCHAIN_SUFFIX'\fI\%CMAKE_<LANG>_ANDROID_TOOLCHAIN_SUFFIX\fP\X'tty: link'
519
+ The host platform suffix of the binutils in the NDK toolchain.
520
+ .UNINDENT
521
+ .sp
522
+ For example, a toolchain file might contain:
523
+ .INDENT 0.0
524
+ .INDENT 3.5
525
+ .sp
526
+ .nf
527
+ .ft C
528
+ set(CMAKE_SYSTEM_NAME Android)
529
+ set(CMAKE_SYSTEM_VERSION 21) # API level
530
+ set(CMAKE_ANDROID_ARCH_ABI arm64\-v8a)
531
+ set(CMAKE_ANDROID_NDK /path/to/android\-ndk)
532
+ set(CMAKE_ANDROID_STL_TYPE gnustl_static)
533
+ .ft P
534
+ .fi
535
+ .UNINDENT
536
+ .UNINDENT
537
+ .sp
538
+ Alternatively one may specify the values without a toolchain file:
539
+ .INDENT 0.0
540
+ .INDENT 3.5
541
+ .sp
542
+ .nf
543
+ .ft C
544
+ $ cmake ../src \e
545
+ \-DCMAKE_SYSTEM_NAME=Android \e
546
+ \-DCMAKE_SYSTEM_VERSION=21 \e
547
+ \-DCMAKE_ANDROID_ARCH_ABI=arm64\-v8a \e
548
+ \-DCMAKE_ANDROID_NDK=/path/to/android\-ndk \e
549
+ \-DCMAKE_ANDROID_STL_TYPE=gnustl_static
550
+ .ft P
551
+ .fi
552
+ .UNINDENT
553
+ .UNINDENT
554
+ .SS Cross Compiling for Android with a Standalone Toolchain
555
+ .sp
556
+ A toolchain file may configure \X'tty: link #makefile-generators'\fI\%Makefile Generators\fP\X'tty: link' or the
557
+ \X'tty: link #generator:Ninja'\fI\%Ninja\fP\X'tty: link' generator to target Android for cross\-compiling
558
+ using a standalone toolchain.
559
+ .sp
560
+ Configure use of an Android standalone toolchain with the following variables:
561
+ .INDENT 0.0
562
+ .TP
563
+ .B \X'tty: link #variable:CMAKE_SYSTEM_NAME'\fI\%CMAKE_SYSTEM_NAME\fP\X'tty: link'
564
+ Set to \fBAndroid\fP\&. Must be specified to enable cross compiling
565
+ for Android.
566
+ .TP
567
+ .B \X'tty: link #variable:CMAKE_ANDROID_STANDALONE_TOOLCHAIN'\fI\%CMAKE_ANDROID_STANDALONE_TOOLCHAIN\fP\X'tty: link'
568
+ Set to the absolute path to the standalone toolchain root directory.
569
+ A \fB${CMAKE_ANDROID_STANDALONE_TOOLCHAIN}/sysroot\fP directory
570
+ must exist.
571
+ If not specified, a default for this variable will be chosen
572
+ as specified \fI\%above\fP\&.
573
+ .TP
574
+ .B \X'tty: link #variable:CMAKE_ANDROID_ARM_MODE'\fI\%CMAKE_ANDROID_ARM_MODE\fP\X'tty: link'
575
+ When the standalone toolchain targets ARM, optionally set this to \fBON\fP
576
+ to target 32\-bit ARM instead of 16\-bit Thumb.
577
+ See variable documentation for details.
578
+ .TP
579
+ .B \X'tty: link #variable:CMAKE_ANDROID_ARM_NEON'\fI\%CMAKE_ANDROID_ARM_NEON\fP\X'tty: link'
580
+ When the standalone toolchain targets ARM v7, optionally set thisto \fBON\fP
581
+ to target ARM NEON devices. See variable documentation for details.
582
+ .UNINDENT
583
+ .sp
584
+ The following variables will be computed and provided automatically:
585
+ .INDENT 0.0
586
+ .TP
587
+ .B \X'tty: link #variable:CMAKE_SYSTEM_VERSION'\fI\%CMAKE_SYSTEM_VERSION\fP\X'tty: link'
588
+ The Android API level detected from the standalone toolchain.
589
+ .TP
590
+ .B \X'tty: link #variable:CMAKE_ANDROID_ARCH_ABI'\fI\%CMAKE_ANDROID_ARCH_ABI\fP\X'tty: link'
591
+ The Android ABI detected from the standalone toolchain.
592
+ .TP
593
+ .B \X'tty: link #variable:CMAKE_<LANG>_ANDROID_TOOLCHAIN_PREFIX'\fI\%CMAKE_<LANG>_ANDROID_TOOLCHAIN_PREFIX\fP\X'tty: link'
594
+ The absolute path prefix to the \fBbinutils\fP in the standalone toolchain.
595
+ .TP
596
+ .B \X'tty: link #variable:CMAKE_<LANG>_ANDROID_TOOLCHAIN_SUFFIX'\fI\%CMAKE_<LANG>_ANDROID_TOOLCHAIN_SUFFIX\fP\X'tty: link'
597
+ The host platform suffix of the \fBbinutils\fP in the standalone toolchain.
598
+ .UNINDENT
599
+ .sp
600
+ For example, a toolchain file might contain:
601
+ .INDENT 0.0
602
+ .INDENT 3.5
603
+ .sp
604
+ .nf
605
+ .ft C
606
+ set(CMAKE_SYSTEM_NAME Android)
607
+ set(CMAKE_ANDROID_STANDALONE_TOOLCHAIN /path/to/android\-toolchain)
608
+ .ft P
609
+ .fi
610
+ .UNINDENT
611
+ .UNINDENT
612
+ .sp
613
+ Alternatively one may specify the values without a toolchain file:
614
+ .INDENT 0.0
615
+ .INDENT 3.5
616
+ .sp
617
+ .nf
618
+ .ft C
619
+ $ cmake ../src \e
620
+ \-DCMAKE_SYSTEM_NAME=Android \e
621
+ \-DCMAKE_ANDROID_STANDALONE_TOOLCHAIN=/path/to/android\-toolchain
622
+ .ft P
623
+ .fi
624
+ .UNINDENT
625
+ .UNINDENT
626
+ .SS Cross Compiling for Android with NVIDIA Nsight Tegra Visual Studio Edition
627
+ .sp
628
+ A toolchain file to configure one of the \X'tty: link #visual-studio-generators'\fI\%Visual Studio Generators\fP\X'tty: link'
629
+ to build using NVIDIA Nsight Tegra targeting Android may look like this:
630
+ .INDENT 0.0
631
+ .INDENT 3.5
632
+ .sp
633
+ .nf
634
+ .ft C
635
+ set(CMAKE_SYSTEM_NAME Android)
636
+ .ft P
637
+ .fi
638
+ .UNINDENT
639
+ .UNINDENT
640
+ .sp
641
+ The \X'tty: link #variable:CMAKE_GENERATOR_TOOLSET'\fI\%CMAKE_GENERATOR_TOOLSET\fP\X'tty: link' may be set to select
642
+ the Nsight Tegra \(dqToolchain Version\(dq value.
643
+ .sp
644
+ See also target properties:
645
+ .INDENT 0.0
646
+ .IP \(bu 2
647
+ \X'tty: link #prop_tgt:ANDROID_ANT_ADDITIONAL_OPTIONS'\fI\%ANDROID_ANT_ADDITIONAL_OPTIONS\fP\X'tty: link'
648
+ .IP \(bu 2
649
+ \X'tty: link #prop_tgt:ANDROID_API_MIN'\fI\%ANDROID_API_MIN\fP\X'tty: link'
650
+ .IP \(bu 2
651
+ \X'tty: link #prop_tgt:ANDROID_API'\fI\%ANDROID_API\fP\X'tty: link'
652
+ .IP \(bu 2
653
+ \X'tty: link #prop_tgt:ANDROID_ARCH'\fI\%ANDROID_ARCH\fP\X'tty: link'
654
+ .IP \(bu 2
655
+ \X'tty: link #prop_tgt:ANDROID_ASSETS_DIRECTORIES'\fI\%ANDROID_ASSETS_DIRECTORIES\fP\X'tty: link'
656
+ .IP \(bu 2
657
+ \X'tty: link #prop_tgt:ANDROID_GUI'\fI\%ANDROID_GUI\fP\X'tty: link'
658
+ .IP \(bu 2
659
+ \X'tty: link #prop_tgt:ANDROID_JAR_DEPENDENCIES'\fI\%ANDROID_JAR_DEPENDENCIES\fP\X'tty: link'
660
+ .IP \(bu 2
661
+ \X'tty: link #prop_tgt:ANDROID_JAR_DIRECTORIES'\fI\%ANDROID_JAR_DIRECTORIES\fP\X'tty: link'
662
+ .IP \(bu 2
663
+ \X'tty: link #prop_tgt:ANDROID_JAVA_SOURCE_DIR'\fI\%ANDROID_JAVA_SOURCE_DIR\fP\X'tty: link'
664
+ .IP \(bu 2
665
+ \X'tty: link #prop_tgt:ANDROID_NATIVE_LIB_DEPENDENCIES'\fI\%ANDROID_NATIVE_LIB_DEPENDENCIES\fP\X'tty: link'
666
+ .IP \(bu 2
667
+ \X'tty: link #prop_tgt:ANDROID_NATIVE_LIB_DIRECTORIES'\fI\%ANDROID_NATIVE_LIB_DIRECTORIES\fP\X'tty: link'
668
+ .IP \(bu 2
669
+ \X'tty: link #prop_tgt:ANDROID_PROCESS_MAX'\fI\%ANDROID_PROCESS_MAX\fP\X'tty: link'
670
+ .IP \(bu 2
671
+ \X'tty: link #prop_tgt:ANDROID_PROGUARD_CONFIG_PATH'\fI\%ANDROID_PROGUARD_CONFIG_PATH\fP\X'tty: link'
672
+ .IP \(bu 2
673
+ \X'tty: link #prop_tgt:ANDROID_PROGUARD'\fI\%ANDROID_PROGUARD\fP\X'tty: link'
674
+ .IP \(bu 2
675
+ \X'tty: link #prop_tgt:ANDROID_SECURE_PROPS_PATH'\fI\%ANDROID_SECURE_PROPS_PATH\fP\X'tty: link'
676
+ .IP \(bu 2
677
+ \X'tty: link #prop_tgt:ANDROID_SKIP_ANT_STEP'\fI\%ANDROID_SKIP_ANT_STEP\fP\X'tty: link'
678
+ .IP \(bu 2
679
+ \X'tty: link #prop_tgt:ANDROID_STL_TYPE'\fI\%ANDROID_STL_TYPE\fP\X'tty: link'
680
+ .UNINDENT
681
+ .SS Cross Compiling for iOS, tvOS, visionOS, or watchOS
682
+ .sp
683
+ For cross\-compiling to iOS, tvOS, visionOS, or watchOS, the \X'tty: link #generator:Xcode'\fI\%Xcode\fP\X'tty: link'
684
+ generator is recommended. The \X'tty: link #generator:Unix Makefiles'\fI\%Unix Makefiles\fP\X'tty: link' or
685
+ \X'tty: link #generator:Ninja'\fI\%Ninja\fP\X'tty: link' generators can also be used, but they require the
686
+ project to handle more areas like target CPU selection and code signing.
687
+ .sp
688
+ Any of the Apple device platforms can be targeted by setting the
689
+ \X'tty: link #variable:CMAKE_SYSTEM_NAME'\fI\%CMAKE_SYSTEM_NAME\fP\X'tty: link' variable to a value from the table below.
690
+ By default, the latest Device SDK is chosen. As for all Apple platforms,
691
+ a different SDK (e.g. a simulator) can be selected by setting the
692
+ \X'tty: link #variable:CMAKE_OSX_SYSROOT'\fI\%CMAKE_OSX_SYSROOT\fP\X'tty: link' variable, although this should rarely be
693
+ necessary (see \fI\%Switching Between Device and Simulator\fP below).
694
+ A list of available SDKs can be obtained by running \fBxcodebuild \-showsdks\fP\&.
695
+ .TS
696
+ center;
697
+ |l|l|l|l|l|.
698
+ _
699
+ T{
700
+ OS
701
+ T} T{
702
+ CMAKE_SYSTEM_NAME
703
+ T} T{
704
+ Device SDK (default)
705
+ T} T{
706
+ Simulator SDK
707
+ T} T{
708
+ Catalyst SDK
709
+ T}
710
+ _
711
+ T{
712
+ iOS
713
+ T} T{
714
+ iOS
715
+ T} T{
716
+ iphoneos
717
+ T} T{
718
+ iphonesimulator
719
+ T} T{
720
+ macosx
721
+ T}
722
+ _
723
+ T{
724
+ tvOS
725
+ T} T{
726
+ tvOS
727
+ T} T{
728
+ appletvos
729
+ T} T{
730
+ appletvsimulator
731
+ T} T{
732
+ N/A
733
+ T}
734
+ _
735
+ T{
736
+ visionOS
737
+ T} T{
738
+ visionOS
739
+ T} T{
740
+ xros
741
+ T} T{
742
+ xrsimulator
743
+ T} T{
744
+ N/A
745
+ T}
746
+ _
747
+ T{
748
+ watchOS
749
+ T} T{
750
+ watchOS
751
+ T} T{
752
+ watchos
753
+ T} T{
754
+ watchsimulator
755
+ T} T{
756
+ N/A
757
+ T}
758
+ _
759
+ .TE
760
+ .sp
761
+ For example, to create a CMake configuration for iOS, the following
762
+ command is sufficient:
763
+ .INDENT 0.0
764
+ .INDENT 3.5
765
+ .sp
766
+ .nf
767
+ .ft C
768
+ cmake .. \-GXcode \-DCMAKE_SYSTEM_NAME=iOS
769
+ .ft P
770
+ .fi
771
+ .UNINDENT
772
+ .UNINDENT
773
+ .sp
774
+ Variable \X'tty: link #variable:CMAKE_OSX_ARCHITECTURES'\fI\%CMAKE_OSX_ARCHITECTURES\fP\X'tty: link' can be used to set architectures
775
+ for both device and simulator. Variable \X'tty: link #variable:CMAKE_OSX_DEPLOYMENT_TARGET'\fI\%CMAKE_OSX_DEPLOYMENT_TARGET\fP\X'tty: link'
776
+ can be used to set an iOS/tvOS/visionOS/watchOS deployment target.
777
+ .sp
778
+ The next example installs five architectures in a universal binary for an iOS
779
+ library. It adds the relevant \fB\-miphoneos\-version\-min=9.3\fP or
780
+ \fB\-mios\-simulator\-version\-min=9.3\fP compiler flag where appropriate.
781
+ Note that the \X'tty: link #variable:CMAKE_IOS_INSTALL_COMBINED'\fI\%CMAKE_IOS_INSTALL_COMBINED\fP\X'tty: link' variable used in the
782
+ example is now deprecated, so this approach is no longer recommended.
783
+ .INDENT 0.0
784
+ .INDENT 3.5
785
+ .sp
786
+ .nf
787
+ .ft C
788
+ $ cmake \-S. \-B_builds \-GXcode \e
789
+ \-DCMAKE_SYSTEM_NAME=iOS \e
790
+ \(dq\-DCMAKE_OSX_ARCHITECTURES=armv7;armv7s;arm64;i386;x86_64\(dq \e
791
+ \-DCMAKE_OSX_DEPLOYMENT_TARGET=9.3 \e
792
+ \-DCMAKE_INSTALL_PREFIX=\(gapwd\(ga/_install \e
793
+ \-DCMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=NO \e
794
+ \-DCMAKE_IOS_INSTALL_COMBINED=YES
795
+ .ft P
796
+ .fi
797
+ .UNINDENT
798
+ .UNINDENT
799
+ .sp
800
+ Example:
801
+ .INDENT 0.0
802
+ .INDENT 3.5
803
+ .sp
804
+ .nf
805
+ .ft C
806
+ # CMakeLists.txt
807
+ cmake_minimum_required(VERSION 3.14)
808
+ project(foo)
809
+ add_library(foo foo.cpp)
810
+ install(TARGETS foo DESTINATION lib)
811
+ .ft P
812
+ .fi
813
+ .UNINDENT
814
+ .UNINDENT
815
+ .sp
816
+ Install:
817
+ .INDENT 0.0
818
+ .INDENT 3.5
819
+ .sp
820
+ .nf
821
+ .ft C
822
+ $ cmake \-\-build _builds \-\-config Release \-\-target install
823
+ .ft P
824
+ .fi
825
+ .UNINDENT
826
+ .UNINDENT
827
+ .sp
828
+ Check library:
829
+ .INDENT 0.0
830
+ .INDENT 3.5
831
+ .sp
832
+ .nf
833
+ .ft C
834
+ $ lipo \-info _install/lib/libfoo.a
835
+ Architectures in the fat file: _install/lib/libfoo.a are: i386 armv7 armv7s x86_64 arm64
836
+ .ft P
837
+ .fi
838
+ .UNINDENT
839
+ .UNINDENT
840
+ .INDENT 0.0
841
+ .INDENT 3.5
842
+ .sp
843
+ .nf
844
+ .ft C
845
+ $ otool \-l _install/lib/libfoo.a | grep \-A2 LC_VERSION_MIN_IPHONEOS
846
+ cmd LC_VERSION_MIN_IPHONEOS
847
+ cmdsize 16
848
+ version 9.3
849
+ .ft P
850
+ .fi
851
+ .UNINDENT
852
+ .UNINDENT
853
+ .SS Code Signing
854
+ .sp
855
+ Some build artifacts for the embedded Apple platforms require mandatory
856
+ code signing. If the \X'tty: link #generator:Xcode'\fI\%Xcode\fP\X'tty: link' generator is being used and
857
+ code signing is required or desired, the development team ID can be
858
+ specified via the \fBCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM\fP CMake variable.
859
+ This team ID will then be included in the generated Xcode project.
860
+ By default, CMake avoids the need for code signing during the internal
861
+ configuration phase (i.e compiler ID and feature detection).
862
+ .SS Switching Between Device and Simulator
863
+ .sp
864
+ When configuring for any of the embedded platforms, one can target either
865
+ real devices or the simulator. Both have their own separate SDK, but CMake
866
+ only supports specifying a single SDK for the configuration phase. This
867
+ means the developer must select one or the other at configuration time.
868
+ When using the \X'tty: link #generator:Xcode'\fI\%Xcode\fP\X'tty: link' generator, this is less of a limitation
869
+ because Xcode still allows you to build for either a device or a simulator,
870
+ even though configuration was only performed for one of the two. From
871
+ within the Xcode IDE, builds are performed for the selected \(dqdestination\(dq
872
+ platform. When building from the command line, the desired sdk can be
873
+ specified directly by passing a \fB\-sdk\fP option to the underlying build
874
+ tool (\fBxcodebuild\fP). For example:
875
+ .INDENT 0.0
876
+ .INDENT 3.5
877
+ .sp
878
+ .nf
879
+ .ft C
880
+ $ cmake \-\-build ... \-\- \-sdk iphonesimulator
881
+ .ft P
882
+ .fi
883
+ .UNINDENT
884
+ .UNINDENT
885
+ .sp
886
+ Please note that checks made during configuration were performed against
887
+ the configure\-time SDK and might not hold true for other SDKs. Commands
888
+ like \X'tty: link #command:find_package'\fI\%find_package()\fP\X'tty: link', \X'tty: link #command:find_library'\fI\%find_library()\fP\X'tty: link', etc. store and use
889
+ details only for the configured SDK/platform, so they can be problematic
890
+ if wanting to switch between device and simulator builds. You can follow
891
+ the next rules to make device + simulator configuration work:
892
+ .INDENT 0.0
893
+ .IP \(bu 2
894
+ Use explicit \fB\-l\fP linker flag,
895
+ e.g. \fBtarget_link_libraries(foo PUBLIC \(dq\-lz\(dq)\fP
896
+ .IP \(bu 2
897
+ Use explicit \fB\-framework\fP linker flag,
898
+ e.g. \fBtarget_link_libraries(foo PUBLIC \(dq\-framework CoreFoundation\(dq)\fP
899
+ .IP \(bu 2
900
+ Use \X'tty: link #command:find_package'\fI\%find_package()\fP\X'tty: link' only for libraries installed with
901
+ \X'tty: link #variable:CMAKE_IOS_INSTALL_COMBINED'\fI\%CMAKE_IOS_INSTALL_COMBINED\fP\X'tty: link' feature
902
+ .UNINDENT
903
+ .SH COPYRIGHT
904
+ 2000-2024 Kitware, Inc. and Contributors
905
+ .\" Generated by docutils manpage writer.
906
+ .
cmake/man/man7/cmake-variables.7 ADDED
The diff for this file is too large to render. See raw diff
 
cmake/man/man7/cpack-generators.7 ADDED
The diff for this file is too large to render. See raw diff
 
cmake/share/aclocal/cmake.m4 ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ dnl Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
+ dnl file Copyright.txt or https://cmake.org/licensing for details.
3
+
4
+ AC_DEFUN([CMAKE_FIND_BINARY],
5
+ [AC_ARG_VAR([CMAKE_BINARY], [path to the cmake binary])dnl
6
+
7
+ if test "x$ac_cv_env_CMAKE_BINARY_set" != "xset"; then
8
+ AC_PATH_TOOL([CMAKE_BINARY], [cmake])dnl
9
+ fi
10
+ ])dnl
11
+
12
+ # $1: package name
13
+ # $2: language (e.g. C/CXX/Fortran)
14
+ # $3: The compiler ID, defaults to GNU.
15
+ # Possible values are: GNU, Intel, Clang, SunPro, HP, XL, VisualAge, PGI,
16
+ # PathScale, Cray, SCO, MSVC, LCC
17
+ # $4: optional extra arguments to cmake, e.g. "-DCMAKE_SIZEOF_VOID_P=8"
18
+ # $5: optional path to cmake binary
19
+ AC_DEFUN([CMAKE_FIND_PACKAGE], [
20
+ AC_REQUIRE([CMAKE_FIND_BINARY])dnl
21
+
22
+ AC_ARG_VAR([$1][_][$2][FLAGS], [$2 compiler flags for $1. This overrides the cmake output])dnl
23
+ AC_ARG_VAR([$1][_LIBS], [linker flags for $1. This overrides the cmake output])dnl
24
+
25
+ failed=false
26
+ AC_MSG_CHECKING([for $1])
27
+ if test -z "${$1[]_$2[]FLAGS}"; then
28
+ $1[]_$2[]FLAGS=`$CMAKE_BINARY --find-package "-DNAME=$1" "-DCOMPILER_ID=m4_default([$3], [GNU])" "-DLANGUAGE=$2" -DMODE=COMPILE $4` || failed=true
29
+ fi
30
+ if test -z "${$1[]_LIBS}"; then
31
+ $1[]_LIBS=`$CMAKE_BINARY --find-package "-DNAME=$1" "-DCOMPILER_ID=m4_default([$3], [GNU])" "-DLANGUAGE=$2" -DMODE=LINK $4` || failed=true
32
+ fi
33
+
34
+ if $failed; then
35
+ unset $1[]_$2[]FLAGS
36
+ unset $1[]_LIBS
37
+
38
+ AC_MSG_RESULT([no])
39
+ $6
40
+ else
41
+ AC_MSG_RESULT([yes])
42
+ $5
43
+ fi[]dnl
44
+ ])
cmake/share/bash-completion/completions/cmake ADDED
@@ -0,0 +1,242 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # bash completion for cmake(1) -*- shell-script -*-
2
+
3
+ _cmake()
4
+ {
5
+ local is_old_completion=false
6
+ local is_init_completion=false
7
+
8
+ local cur prev words cword split was_split
9
+ if type -t _comp_initialize >/dev/null; then
10
+ _comp_initialize -s || return
11
+ elif type -t _init_completion >/dev/null; then
12
+ _init_completion -s || return
13
+ is_init_completion=true
14
+ else
15
+ # manual initialization for older bash completion versions
16
+ COMPREPLY=()
17
+ cur="${COMP_WORDS[COMP_CWORD]}"
18
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
19
+ is_old_completion=true
20
+ split=false
21
+ fi
22
+
23
+ # Workaround for options like -DCMAKE_BUILD_TYPE=Release
24
+ local prefix=
25
+ if [[ $cur == -D* ]]; then
26
+ prev=-D
27
+ prefix=-D
28
+ cur="${cur#-D}"
29
+ elif [[ $cur == -U* ]]; then
30
+ prev=-U
31
+ prefix=-U
32
+ cur="${cur#-U}"
33
+ fi
34
+
35
+ case "$prev" in
36
+ -D)
37
+ if [[ $cur == *=* ]]; then
38
+ # complete values for variables
39
+ local var type value
40
+ var="${cur%%[:=]*}"
41
+ value="${cur#*=}"
42
+
43
+ if [[ $cur == CMAKE_BUILD_TYPE* ]]; then # most widely used case
44
+ COMPREPLY=( $( compgen -W 'Debug Release RelWithDebInfo
45
+ MinSizeRel' -- "$value" ) )
46
+ return
47
+ fi
48
+
49
+ if [[ $cur == *:* ]]; then
50
+ type="${cur#*:}"
51
+ type="${type%%=*}"
52
+ else # get type from cache if it's not set explicitly
53
+ type=$( cmake -LA -N 2>/dev/null | grep "$var:" \
54
+ 2>/dev/null )
55
+ type="${type#*:}"
56
+ type="${type%%=*}"
57
+ fi
58
+ case "$type" in
59
+ FILEPATH)
60
+ cur="$value"
61
+ _filedir
62
+ return
63
+ ;;
64
+ PATH)
65
+ cur="$value"
66
+ _filedir -d
67
+ return
68
+ ;;
69
+ BOOL)
70
+ COMPREPLY=( $( compgen -W 'ON OFF TRUE FALSE' -- \
71
+ "$value" ) )
72
+ return
73
+ ;;
74
+ STRING|INTERNAL)
75
+ # no completion available
76
+ return
77
+ ;;
78
+ esac
79
+ elif [[ $cur == *:* ]]; then
80
+ # complete types
81
+ local type="${cur#*:}"
82
+ COMPREPLY=( $( compgen -W 'FILEPATH PATH STRING BOOL INTERNAL'\
83
+ -S = -- "$type" ) )
84
+ compopt -o nospace
85
+ else
86
+ # complete variable names
87
+ COMPREPLY=( $( compgen -W '$( cmake -LA -N 2>/dev/null |
88
+ tail -n +2 | cut -f1 -d: )' -P "$prefix" -- "$cur" ) )
89
+ compopt -o nospace
90
+ fi
91
+ return
92
+ ;;
93
+ -U)
94
+ COMPREPLY=( $( compgen -W '$( cmake -LA -N | tail -n +2 |
95
+ cut -f1 -d: )' -P "$prefix" -- "$cur" ) )
96
+ return
97
+ ;;
98
+ esac
99
+
100
+ if $is_old_completion; then
101
+ _split_longopt && split=true
102
+ fi
103
+
104
+ case "$prev" in
105
+ -C|-P|--graphviz|--system-information)
106
+ _filedir
107
+ return
108
+ ;;
109
+ --build)
110
+ # Seed the reply with non-directory arguments that we know are
111
+ # allowed to follow --build. _filedir will then prepend any valid
112
+ # directory matches to these.
113
+ COMPREPLY=( $( compgen -W "--preset --list-presets" -- "$cur" ) )
114
+ _filedir -d
115
+ return
116
+ ;;
117
+ --install|--open)
118
+ _filedir -d
119
+ return
120
+ ;;
121
+ -E)
122
+ COMPREPLY=( $( compgen -W "$( cmake -E help |& sed -n \
123
+ '/^ [^ ]/{s|^ \([^ ]\{1,\}\) .*$|\1|;p}' 2>/dev/null )" \
124
+ -- "$cur" ) )
125
+ return
126
+ ;;
127
+ -G)
128
+ local IFS=$'\n'
129
+ local quoted
130
+ printf -v quoted %q "$cur"
131
+ COMPREPLY=( $( compgen -W '$( cmake --help 2>/dev/null | sed -n \
132
+ -e "1,/^Generators/d" \
133
+ -e "/^ *[^ =]/{s|^ *\([^=]*[^ =]\).*$|\1|;s| |\\\\ |g;p}" \
134
+ 2>/dev/null )' -- "$quoted" ) )
135
+ return
136
+ ;;
137
+ --loglevel)
138
+ COMPREPLY=( $(compgen -W 'error warning notice status verbose debug trace' -- $cur ) )
139
+ ;;
140
+ --help-command)
141
+ COMPREPLY=( $( compgen -W '$( cmake --help-command-list 2>/dev/null|
142
+ grep -v "^cmake version " )' -- "$cur" ) )
143
+ return
144
+ ;;
145
+ --help-manual)
146
+ COMPREPLY=( $( compgen -W '$( cmake --help-manual-list 2>/dev/null|
147
+ grep -v "^cmake version " | sed -e "s/([0-9])$//" )' -- "$cur" ) )
148
+ return
149
+ ;;
150
+ --help-module)
151
+ COMPREPLY=( $( compgen -W '$( cmake --help-module-list 2>/dev/null|
152
+ grep -v "^cmake version " )' -- "$cur" ) )
153
+ return
154
+ ;;
155
+ --help-policy)
156
+ COMPREPLY=( $( compgen -W '$( cmake --help-policy-list 2>/dev/null |
157
+ grep -v "^cmake version " )' -- "$cur" ) )
158
+ return
159
+ ;;
160
+ --help-property)
161
+ COMPREPLY=( $( compgen -W '$( cmake --help-property-list \
162
+ 2>/dev/null | grep -v "^cmake version " )' -- "$cur" ) )
163
+ return
164
+ ;;
165
+ --help-variable)
166
+ COMPREPLY=( $( compgen -W '$( cmake --help-variable-list \
167
+ 2>/dev/null | grep -v "^cmake version " )' -- "$cur" ) )
168
+ return
169
+ ;;
170
+ --list-presets)
171
+ local IFS=$'\n'
172
+ local quoted
173
+ printf -v quoted %q "$cur"
174
+
175
+ if [[ ! "${IFS}${COMP_WORDS[*]}${IFS}" =~ "${IFS}--build${IFS}" ]]; then
176
+ COMPREPLY=(
177
+ $( compgen -W "configure${IFS}build${IFS}package${IFS}test${IFS}workflow${IFS}all" -- "$quoted" )
178
+ )
179
+ fi
180
+ return
181
+ ;;
182
+ --preset)
183
+ local IFS=$'\n'
184
+ local quoted
185
+ printf -v quoted %q "$cur"
186
+
187
+ local preset_type
188
+ if [[ "${IFS}${COMP_WORDS[*]}${IFS}" =~ "${IFS}--workflow${IFS}" ]]; then
189
+ preset_type="workflow"
190
+ elif [[ "${IFS}${COMP_WORDS[*]}${IFS}" =~ "${IFS}--build${IFS}" ]]; then
191
+ preset_type="build"
192
+ else
193
+ preset_type="configure"
194
+ fi
195
+
196
+ local presets=$( cmake --list-presets="$preset_type" 2>/dev/null |
197
+ grep -o "^ \".*\"" | sed \
198
+ -e "s/^ //g" \
199
+ -e "s/\"//g" \
200
+ -e 's/ /\\\\ /g' )
201
+ COMPREPLY=( $( compgen -W "$presets" -- "$quoted" ) )
202
+ return
203
+ ;;
204
+ --workflow)
205
+ local quoted
206
+ printf -v quoted %q "$cur"
207
+ # Options allowed right after `--workflow`
208
+ local workflow_options='--preset --list-presets --fresh'
209
+
210
+ if [[ "$cur" == -* ]]; then
211
+ COMPREPLY=( $( compgen -W "$workflow_options" -- "$quoted" ) )
212
+ else
213
+ local presets=$( cmake --list-presets=workflow 2>/dev/null |
214
+ grep -o "^ \".*\"" | sed \
215
+ -e "s/^ //g" \
216
+ -e "s/\"//g" \
217
+ -e 's/ /\\\\ /g' )
218
+ COMPREPLY=( $( compgen -W "$presets $workflow_options" -- "$quoted" ) )
219
+ fi
220
+ return
221
+ ;;
222
+ esac
223
+
224
+ if ($is_old_completion || $is_init_completion); then
225
+ $split && return
226
+ else
227
+ [[ $was_split ]] && return
228
+ fi
229
+
230
+ if [[ "$cur" == -* ]]; then
231
+ # FIXME(#26100): `cmake --help` is missing some options and does not
232
+ # have any mode-specific options like `cmake --build`'s `--config`.
233
+ COMPREPLY=( $(compgen -W '$( _parse_help "$1" --help )' -- ${cur}) )
234
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
235
+ [[ $COMPREPLY ]] && return
236
+ fi
237
+
238
+ _filedir
239
+ } &&
240
+ complete -F _cmake cmake
241
+
242
+ # ex: ts=4 sw=4 et filetype=sh
cmake/share/bash-completion/completions/cpack ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # bash completion for cpack(1) -*- shell-script -*-
2
+
3
+ _cpack()
4
+ {
5
+ local cur prev words cword
6
+ if type -t _comp_initialize >/dev/null; then
7
+ _comp_initialize -n = || return
8
+ elif type -t _init_completion >/dev/null; then
9
+ _init_completion -n = || return
10
+ else
11
+ # manual initialization for older bash completion versions
12
+ COMPREPLY=()
13
+ cur="${COMP_WORDS[COMP_CWORD]}"
14
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
15
+ fi
16
+
17
+ case "$prev" in
18
+ -G)
19
+ COMPREPLY=( $( compgen -W '$( cpack --help 2>/dev/null |
20
+ sed -e "1,/^Generators/d" -e "s|^ *\([^ ]*\) .*$|\1|" \
21
+ 2>/dev/null )' -- "$cur" ) )
22
+ return
23
+ ;;
24
+ -C)
25
+ COMPREPLY=( $( compgen -W 'Debug Release RelWithDebInfo
26
+ MinSizeRel' -- "$cur" ) )
27
+ return
28
+ ;;
29
+ -D)
30
+ [[ $cur == *=* ]] && return # no completion for values
31
+ COMPREPLY=( $( compgen -W '$( cpack --help-variable-list \
32
+ 2>/dev/null | grep -v "^cpack version " )' -S = -- "$cur" ) )
33
+ compopt -o nospace
34
+ return
35
+ ;;
36
+ -P|-R|--vendor)
37
+ # argument required but no completions available
38
+ return
39
+ ;;
40
+ -B)
41
+ _filedir -d
42
+ return
43
+ ;;
44
+ --config)
45
+ _filedir
46
+ return
47
+ ;;
48
+ --help-command)
49
+ COMPREPLY=( $( compgen -W '$( cpack --help-command-list 2>/dev/null|
50
+ grep -v "^cpack version " )' -- "$cur" ) )
51
+ return
52
+ ;;
53
+ --help-manual)
54
+ COMPREPLY=( $( compgen -W '$( cpack --help-manual-list 2>/dev/null|
55
+ grep -v "^cpack version " | sed -e "s/([0-9])$//" )' -- "$cur" ) )
56
+ return
57
+ ;;
58
+ --help-module)
59
+ COMPREPLY=( $( compgen -W '$( cpack --help-module-list 2>/dev/null|
60
+ grep -v "^cpack version " )' -- "$cur" ) )
61
+ return
62
+ ;;
63
+ --help-policy)
64
+ COMPREPLY=( $( compgen -W '$( cpack --help-policy-list 2>/dev/null |
65
+ grep -v "^cpack version " )' -- "$cur" ) )
66
+ return
67
+ ;;
68
+ --help-property)
69
+ COMPREPLY=( $( compgen -W '$( cpack --help-property-list \
70
+ 2>/dev/null | grep -v "^cpack version " )' -- "$cur" ) )
71
+ return
72
+ ;;
73
+ --help-variable)
74
+ COMPREPLY=( $( compgen -W '$( cpack --help-variable-list \
75
+ 2>/dev/null | grep -v "^cpack version " )' -- "$cur" ) )
76
+ return
77
+ ;;
78
+ esac
79
+
80
+ if [[ "$cur" == -* ]]; then
81
+ COMPREPLY=( $(compgen -W '$( _parse_help "$1" --help )' -- ${cur}) )
82
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
83
+ [[ $COMPREPLY ]] && return
84
+ fi
85
+
86
+ _filedir
87
+ } &&
88
+ complete -F _cpack cpack
89
+
90
+ # ex: ts=4 sw=4 et filetype=sh
cmake/share/bash-completion/completions/ctest ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # bash completion for ctest(1) -*- shell-script -*-
2
+
3
+ _ctest()
4
+ {
5
+ local cur prev words cword
6
+ if type -t _comp_initialize >/dev/null; then
7
+ _comp_initialize -n = || return
8
+ elif type -t _init_completion >/dev/null; then
9
+ _init_completion -n = || return
10
+ else
11
+ # manual initialization for older bash completion versions
12
+ COMPREPLY=()
13
+ cur="${COMP_WORDS[COMP_CWORD]}"
14
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
15
+ fi
16
+
17
+ case "$prev" in
18
+ -C|--build-config)
19
+ COMPREPLY=( $( compgen -W 'Debug Release RelWithDebInfo
20
+ MinSizeRel' -- "$cur" ) )
21
+ return
22
+ ;;
23
+ -j|--parallel)
24
+ COMPREPLY=( $( compgen -W "{1..$(( $(_ncpus)*2 ))}" -- "$cur" ) )
25
+ return
26
+ ;;
27
+ -O|--output-log|-A|--add-notes|--extra-submit)
28
+ _filedir
29
+ return
30
+ ;;
31
+ -L|--label-regex|-LE|--label-exclude)
32
+ COMPREPLY=( $( compgen -W '$( ctest --print-labels 2>/dev/null |
33
+ grep "^ " 2>/dev/null | cut -d" " -f 3 )' -- "$cur" ) )
34
+ return
35
+ ;;
36
+ --track|-I|--tests-information|--max-width|--timeout|--stop-time)
37
+ # argument required but no completions available
38
+ return
39
+ ;;
40
+ -R|--tests-regex|-E|--exclude-regex)
41
+ COMPREPLY=( $( compgen -W '$( ctest -N 2>/dev/null |
42
+ grep "^ Test" 2>/dev/null | cut -d: -f 2 )' -- "$cur" ) )
43
+ return
44
+ ;;
45
+ -D|--dashboard)
46
+ if [[ $cur == @(Experimental|Nightly|Continuous)* ]]; then
47
+ local model action
48
+ action=${cur#@(Experimental|Nightly|Continuous)}
49
+ model=${cur%"$action"}
50
+ COMPREPLY=( $( compgen -W 'Start Update Configure Build Test
51
+ Coverage Submit MemCheck' -P "$model" -- "$action" ) )
52
+ else
53
+ COMPREPLY=( $( compgen -W 'Experimental Nightly Continuous' \
54
+ -- "$cur" ) )
55
+ compopt -o nospace
56
+ fi
57
+ return
58
+ ;;
59
+ -M|--test-model)
60
+ COMPREPLY=( $( compgen -W 'Experimental Nightly Continuous' -- \
61
+ "$cur" ) )
62
+ return
63
+ ;;
64
+ -T|--test-action)
65
+ COMPREPLY=( $( compgen -W 'Start Update Configure Build Test
66
+ Coverage Submit MemCheck' -- "$cur" ) )
67
+ return
68
+ ;;
69
+ -S|--script|-SP|--script-new-process)
70
+ _filedir '@(cmake|ctest)'
71
+ return
72
+ ;;
73
+ --interactive-debug-mode)
74
+ COMPREPLY=( $( compgen -W '0 1' -- "$cur" ) )
75
+ return
76
+ ;;
77
+
78
+ --help-command)
79
+ COMPREPLY=( $( compgen -W '$( ctest --help-command-list 2>/dev/null|
80
+ grep -v "^ctest version " )' -- "$cur" ) )
81
+ return
82
+ ;;
83
+ --help-manual)
84
+ COMPREPLY=( $( compgen -W '$( ctest --help-manual-list 2>/dev/null|
85
+ grep -v "^ctest version " | sed -e "s/([0-9])$//" )' -- "$cur" ) )
86
+ return
87
+ ;;
88
+ --help-module)
89
+ COMPREPLY=( $( compgen -W '$( ctest --help-module-list 2>/dev/null|
90
+ grep -v "^ctest version " )' -- "$cur" ) )
91
+ return
92
+ ;;
93
+ --help-policy)
94
+ COMPREPLY=( $( compgen -W '$( ctest --help-policy-list 2>/dev/null |
95
+ grep -v "^ctest version " )' -- "$cur" ) )
96
+ return
97
+ ;;
98
+ --help-property)
99
+ COMPREPLY=( $( compgen -W '$( ctest --help-property-list \
100
+ 2>/dev/null | grep -v "^ctest version " )' -- "$cur" ) )
101
+ return
102
+ ;;
103
+ --help-variable)
104
+ COMPREPLY=( $( compgen -W '$( ctest --help-variable-list \
105
+ 2>/dev/null | grep -v "^ctest version " )' -- "$cur" ) )
106
+ return
107
+ ;;
108
+ --preset)
109
+ local IFS=$'\n'
110
+ local quoted
111
+ printf -v quoted %q "$cur"
112
+ COMPREPLY=( $( compgen -W '$( ctest --list-presets 2>/dev/null |
113
+ grep -o "^ \".*\"" | sed \
114
+ -e "s/^ //g" \
115
+ -e "s/\"//g" \
116
+ -e "s/ /\\\\ /g" )' -- "$quoted" ) )
117
+ return
118
+ ;;
119
+ esac
120
+
121
+ if [[ "$cur" == -* ]]; then
122
+ COMPREPLY=( $(compgen -W '$( _parse_help "$1" --help )' -- ${cur}) )
123
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
124
+ [[ $COMPREPLY ]] && return
125
+ fi
126
+
127
+ _filedir
128
+ } &&
129
+ complete -F _ctest ctest
130
+
131
+ # ex: ts=4 sw=4 et filetype=sh
cmake/share/cmake-3.31/Help/index.rst ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .. title:: CMake Reference Documentation
2
+
3
+ Introduction
4
+ ############
5
+
6
+ CMake is a tool to manage building of source code. Originally, CMake was
7
+ designed as a generator for various dialects of ``Makefile``, today
8
+ CMake generates modern buildsystems such as ``Ninja`` as well as project
9
+ files for IDEs such as Visual Studio and Xcode.
10
+
11
+ CMake is widely used for the C and C++ languages, but it may be used to
12
+ build source code of other languages too.
13
+
14
+ People encountering CMake for the first time may have different initial
15
+ goals. To learn how to build a source code package downloaded from the
16
+ internet, start with the :guide:`User Interaction Guide`.
17
+ This will detail the steps needed to run the :manual:`cmake(1)` or
18
+ :manual:`cmake-gui(1)` executable and how to choose a generator, and
19
+ how to complete the build.
20
+
21
+ The :guide:`Using Dependencies Guide` is aimed at developers
22
+ wishing to get started using a third-party library.
23
+
24
+ For developers starting a project using CMake, the :guide:`CMake Tutorial`
25
+ is a suitable starting point. The :manual:`cmake-buildsystem(7)`
26
+ manual is aimed at developers expanding their knowledge of maintaining
27
+ a buildsystem and becoming familiar with the build targets that
28
+ can be represented in CMake. The :manual:`cmake-packages(7)` manual
29
+ explains how to create packages which can easily be consumed by
30
+ third-party CMake-based buildsystems.
31
+
32
+ Command-Line Tools
33
+ ##################
34
+
35
+ .. toctree::
36
+ :maxdepth: 1
37
+
38
+ /manual/cmake.1
39
+ /manual/ctest.1
40
+ /manual/cpack.1
41
+
42
+ Interactive Dialogs
43
+ ###################
44
+
45
+ .. toctree::
46
+ :maxdepth: 1
47
+
48
+ /manual/cmake-gui.1
49
+ /manual/ccmake.1
50
+
51
+ Reference Manuals
52
+ #################
53
+
54
+ .. toctree::
55
+ :maxdepth: 1
56
+
57
+ /manual/cmake-buildsystem.7
58
+ /manual/cmake-commands.7
59
+ /manual/cmake-compile-features.7
60
+ /manual/cmake-configure-log.7
61
+ /manual/cmake-cxxmodules.7
62
+ /manual/cmake-developer.7
63
+ /manual/cmake-env-variables.7
64
+ /manual/cmake-file-api.7
65
+ /manual/cmake-generator-expressions.7
66
+ /manual/cmake-generators.7
67
+ /manual/cmake-language.7
68
+ /manual/cmake-modules.7
69
+ /manual/cmake-packages.7
70
+ /manual/cmake-policies.7
71
+ /manual/cmake-presets.7
72
+ /manual/cmake-properties.7
73
+ /manual/cmake-qt.7
74
+ /manual/cmake-server.7
75
+ /manual/cmake-toolchains.7
76
+ /manual/cmake-variables.7
77
+ /manual/cpack-generators.7
78
+
79
+ .. only:: not man
80
+
81
+ Guides
82
+ ######
83
+
84
+ .. toctree::
85
+ :maxdepth: 1
86
+
87
+ /guide/tutorial/index
88
+ /guide/user-interaction/index
89
+ /guide/using-dependencies/index
90
+ /guide/importing-exporting/index
91
+ /guide/ide-integration/index
92
+
93
+ .. only:: html or text
94
+
95
+ Release Notes
96
+ #############
97
+
98
+ .. toctree::
99
+ :maxdepth: 1
100
+
101
+ /release/index
102
+
103
+ .. only:: html
104
+
105
+ Index and Search
106
+ ################
107
+
108
+ * :ref:`genindex`
109
+ * :ref:`search`
cmake/share/cmake-3.31/Licenses/LGPLv3.txt ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+
9
+ This version of the GNU Lesser General Public License incorporates
10
+ the terms and conditions of version 3 of the GNU General Public
11
+ License, supplemented by the additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, "this License" refers to version 3 of the GNU Lesser
16
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
+ General Public License.
18
+
19
+ "The Library" refers to a covered work governed by this License,
20
+ other than an Application or a Combined Work as defined below.
21
+
22
+ An "Application" is any work that makes use of an interface provided
23
+ by the Library, but which is not otherwise based on the Library.
24
+ Defining a subclass of a class defined by the Library is deemed a mode
25
+ of using an interface provided by the Library.
26
+
27
+ A "Combined Work" is a work produced by combining or linking an
28
+ Application with the Library. The particular version of the Library
29
+ with which the Combined Work was made is also called the "Linked
30
+ Version".
31
+
32
+ The "Minimal Corresponding Source" for a Combined Work means the
33
+ Corresponding Source for the Combined Work, excluding any source code
34
+ for portions of the Combined Work that, considered in isolation, are
35
+ based on the Application, and not on the Linked Version.
36
+
37
+ The "Corresponding Application Code" for a Combined Work means the
38
+ object code and/or source code for the Application, including any data
39
+ and utility programs needed for reproducing the Combined Work from the
40
+ Application, but excluding the System Libraries of the Combined Work.
41
+
42
+ 1. Exception to Section 3 of the GNU GPL.
43
+
44
+ You may convey a covered work under sections 3 and 4 of this License
45
+ without being bound by section 3 of the GNU GPL.
46
+
47
+ 2. Conveying Modified Versions.
48
+
49
+ If you modify a copy of the Library, and, in your modifications, a
50
+ facility refers to a function or data to be supplied by an Application
51
+ that uses the facility (other than as an argument passed when the
52
+ facility is invoked), then you may convey a copy of the modified
53
+ version:
54
+
55
+ a) under this License, provided that you make a good faith effort to
56
+ ensure that, in the event an Application does not supply the
57
+ function or data, the facility still operates, and performs
58
+ whatever part of its purpose remains meaningful, or
59
+
60
+ b) under the GNU GPL, with none of the additional permissions of
61
+ this License applicable to that copy.
62
+
63
+ 3. Object Code Incorporating Material from Library Header Files.
64
+
65
+ The object code form of an Application may incorporate material from
66
+ a header file that is part of the Library. You may convey such object
67
+ code under terms of your choice, provided that, if the incorporated
68
+ material is not limited to numerical parameters, data structure
69
+ layouts and accessors, or small macros, inline functions and templates
70
+ (ten or fewer lines in length), you do both of the following:
71
+
72
+ a) Give prominent notice with each copy of the object code that the
73
+ Library is used in it and that the Library and its use are
74
+ covered by this License.
75
+
76
+ b) Accompany the object code with a copy of the GNU GPL and this license
77
+ document.
78
+
79
+ 4. Combined Works.
80
+
81
+ You may convey a Combined Work under terms of your choice that,
82
+ taken together, effectively do not restrict modification of the
83
+ portions of the Library contained in the Combined Work and reverse
84
+ engineering for debugging such modifications, if you also do each of
85
+ the following:
86
+
87
+ a) Give prominent notice with each copy of the Combined Work that
88
+ the Library is used in it and that the Library and its use are
89
+ covered by this License.
90
+
91
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
+ document.
93
+
94
+ c) For a Combined Work that displays copyright notices during
95
+ execution, include the copyright notice for the Library among
96
+ these notices, as well as a reference directing the user to the
97
+ copies of the GNU GPL and this license document.
98
+
99
+ d) Do one of the following:
100
+
101
+ 0) Convey the Minimal Corresponding Source under the terms of this
102
+ License, and the Corresponding Application Code in a form
103
+ suitable for, and under terms that permit, the user to
104
+ recombine or relink the Application with a modified version of
105
+ the Linked Version to produce a modified Combined Work, in the
106
+ manner specified by section 6 of the GNU GPL for conveying
107
+ Corresponding Source.
108
+
109
+ 1) Use a suitable shared library mechanism for linking with the
110
+ Library. A suitable mechanism is one that (a) uses at run time
111
+ a copy of the Library already present on the user's computer
112
+ system, and (b) will operate properly with a modified version
113
+ of the Library that is interface-compatible with the Linked
114
+ Version.
115
+
116
+ e) Provide Installation Information, but only if you would otherwise
117
+ be required to provide such information under section 6 of the
118
+ GNU GPL, and only to the extent that such information is
119
+ necessary to install and execute a modified version of the
120
+ Combined Work produced by recombining or relinking the
121
+ Application with a modified version of the Linked Version. (If
122
+ you use option 4d0, the Installation Information must accompany
123
+ the Minimal Corresponding Source and Corresponding Application
124
+ Code. If you use option 4d1, you must provide the Installation
125
+ Information in the manner specified by section 6 of the GNU GPL
126
+ for conveying Corresponding Source.)
127
+
128
+ 5. Combined Libraries.
129
+
130
+ You may place library facilities that are a work based on the
131
+ Library side by side in a single library together with other library
132
+ facilities that are not Applications and are not covered by this
133
+ License, and convey such a combined library under terms of your
134
+ choice, if you do both of the following:
135
+
136
+ a) Accompany the combined library with a copy of the same work based
137
+ on the Library, uncombined with any other library facilities,
138
+ conveyed under the terms of this License.
139
+
140
+ b) Give prominent notice with the combined library that part of it
141
+ is a work based on the Library, and explaining where to find the
142
+ accompanying uncombined form of the same work.
143
+
144
+ 6. Revised Versions of the GNU Lesser General Public License.
145
+
146
+ The Free Software Foundation may publish revised and/or new versions
147
+ of the GNU Lesser General Public License from time to time. Such new
148
+ versions will be similar in spirit to the present version, but may
149
+ differ in detail to address new problems or concerns.
150
+
151
+ Each version is given a distinguishing version number. If the
152
+ Library as you received it specifies that a certain numbered version
153
+ of the GNU Lesser General Public License "or any later version"
154
+ applies to it, you have the option of following the terms and
155
+ conditions either of that published version or of any later version
156
+ published by the Free Software Foundation. If the Library as you
157
+ received it does not specify a version number of the GNU Lesser
158
+ General Public License, you may choose any version of the GNU Lesser
159
+ General Public License ever published by the Free Software Foundation.
160
+
161
+ If the Library as you received it specifies that a proxy can decide
162
+ whether future versions of the GNU Lesser General Public License shall
163
+ apply, that proxy's public statement of acceptance of any version is
164
+ permanent authorization for you to choose that version for the
165
+ Library.
cmake/share/cmake-3.31/Modules/AddFileDependencies.cmake ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
+ # file Copyright.txt or https://cmake.org/licensing for details.
3
+
4
+ #[=======================================================================[.rst:
5
+ AddFileDependencies
6
+ -------------------
7
+
8
+ .. deprecated:: 3.20
9
+
10
+ Add dependencies to a source file.
11
+
12
+ .. code-block:: cmake
13
+
14
+ add_file_dependencies(<source> <files>...)
15
+
16
+ Adds the given ``<files>`` to the dependencies of file ``<source>``.
17
+
18
+ Do not use this command in new code. It is just a wrapper around:
19
+
20
+ .. code-block:: cmake
21
+
22
+ set_property(SOURCE <source> APPEND PROPERTY OBJECT_DEPENDS <files>...)
23
+
24
+ Instead use the :command:`set_property` command to append to the
25
+ :prop_sf:`OBJECT_DEPENDS` source file property directly.
26
+
27
+ #]=======================================================================]
28
+
29
+ function(add_file_dependencies _file)
30
+
31
+ set_property(SOURCE "${_file}" APPEND PROPERTY OBJECT_DEPENDS "${ARGN}")
32
+
33
+ endfunction()
cmake/share/cmake-3.31/Modules/AndroidTestUtilities.cmake ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
+ # file Copyright.txt or https://cmake.org/licensing for details.
3
+
4
+ #[======================================================================[.rst:
5
+ AndroidTestUtilities
6
+ ------------------------
7
+
8
+ .. versionadded:: 3.7
9
+
10
+ Create a test that automatically loads specified data onto an Android device.
11
+
12
+ Introduction
13
+ ^^^^^^^^^^^^
14
+
15
+ Use this module to push data needed for testing an Android device behavior
16
+ onto a connected Android device. The module will accept files and libraries as
17
+ well as separate destinations for each. It will create a test that loads the
18
+ files into a device object store and link to them from the specified
19
+ destination. The files are only uploaded if they are not already in the object
20
+ store.
21
+
22
+ For example:
23
+
24
+ .. code-block:: cmake
25
+
26
+ include(AndroidTestUtilities)
27
+ android_add_test_data(
28
+ example_setup_test
29
+ FILES <files>...
30
+ LIBS <libs>...
31
+ DEVICE_TEST_DIR "/data/local/tests/example"
32
+ DEVICE_OBJECT_STORE "/sdcard/.ExternalData/SHA"
33
+ )
34
+
35
+
36
+ At build time a test named "example_setup_test" will be created. Run this test
37
+ on the command line with :manual:`ctest(1)` to load the data onto the Android
38
+ device.
39
+
40
+ Module Functions
41
+ ^^^^^^^^^^^^^^^^
42
+
43
+ .. command:: android_add_test_data
44
+
45
+ .. code-block:: cmake
46
+
47
+ android_add_test_data(<test-name>
48
+ [FILES <files>...] [FILES_DEST <device-dir>]
49
+ [LIBS <libs>...] [LIBS_DEST <device-dir>]
50
+ [DEVICE_OBJECT_STORE <device-dir>]
51
+ [DEVICE_TEST_DIR <device-dir>]
52
+ [NO_LINK_REGEX <strings>...]
53
+ )
54
+
55
+ The ``android_add_test_data`` function is used to copy files and libraries
56
+ needed to run project-specific tests. On the host operating system, this is
57
+ done at build time. For on-device testing, the files are loaded onto the
58
+ device by the manufactured test at run time.
59
+
60
+ This function accepts the following named parameters:
61
+
62
+ ``FILES <files>...``
63
+ zero or more files needed for testing
64
+ ``LIBS <libs>...``
65
+ zero or more libraries needed for testing
66
+ ``FILES_DEST <device-dir>``
67
+ absolute path where the data files are expected to be
68
+ ``LIBS_DEST <device-dir>``
69
+ absolute path where the libraries are expected to be
70
+ ``DEVICE_OBJECT_STORE <device-dir>``
71
+ absolute path to the location where the data is stored on-device
72
+ ``DEVICE_TEST_DIR <device-dir>``
73
+ absolute path to the root directory of the on-device test location
74
+ ``NO_LINK_REGEX <strings>...``
75
+ list of regex strings matching the names of files that should be
76
+ copied from the object store to the testing directory
77
+ #]======================================================================]
78
+
79
+ include(${CMAKE_CURRENT_LIST_DIR}/ExternalData.cmake)
80
+
81
+ # The parameters to this function should be set to the list of directories,
82
+ # files, and libraries that need to be installed prior to testing.
83
+ function(android_add_test_data test_name)
84
+ # As the names suggest, oneValueArgs lists the arguments that specify a
85
+ # single value, while multiValueArgs can contain one or more values.
86
+ set(keywordArgs)
87
+ set(oneValueArgs FILES_DEST LIBS_DEST DEVICE_OBJECT_STORE DEVICE_TEST_DIR)
88
+ set(multiValueArgs FILES LIBS NO_LINK_REGEX)
89
+
90
+ # For example, if you called this function with FILES </path/to/file>
91
+ # then this path would be stored in the variable AST_FILES.
92
+ # The AST prefix stands for the name of this function (android_add_test_data).
93
+ cmake_parse_arguments(AST "${keywordArgs}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
94
+ if(NOT AST_DEVICE_TEST_DIR)
95
+ message(FATAL_ERROR "-- You must specify the location of the on device test directory.")
96
+ endif()
97
+ if(NOT AST_DEVICE_OBJECT_STORE)
98
+ message(FATAL_ERROR "-- You must specify the location of the on device object store.")
99
+ endif()
100
+ if(${AST_DEVICE_TEST_DIR} STREQUAL "/")
101
+ message(FATAL_ERROR "-- The device test directory cannot be '/'")
102
+ endif()
103
+
104
+ # Copy all test data files into the binary directory, where tests are run.
105
+ # ExternalData will handle fetching DATA{...} references.
106
+ string(REPLACE "|" ";" hash_algs "${_ExternalData_REGEX_EXT}")
107
+ # Convert ExternalData placeholder file names to DATA{} syntax.
108
+ foreach(alg ${hash_algs})
109
+ string(REGEX REPLACE "([^ ;]+)\\.${alg}" "DATA{\\1}" AST_FILES "${AST_FILES}")
110
+ endforeach()
111
+
112
+ set(DATA_TARGET_NAME "${test_name}")
113
+ string(FIND "${AST_FILES}" "DATA{" data_files_found)
114
+ if(${data_files_found} GREATER "-1")
115
+ # Use ExternalData if any DATA{} files were found.
116
+ ExternalData_Expand_Arguments(
117
+ ${DATA_TARGET_NAME}
118
+ extern_data_output
119
+ ${AST_FILES})
120
+ ExternalData_Add_Target(${DATA_TARGET_NAME})
121
+ else()
122
+ add_custom_target(${DATA_TARGET_NAME} ALL)
123
+ set(extern_data_output ${AST_FILES})
124
+ endif()
125
+
126
+ # For regular files on Linux, just copy them directly.
127
+ foreach(path ${AST_FILES})
128
+ foreach(output ${extern_data_output})
129
+ if(${output} STREQUAL ${path})
130
+ # Check if a destination was specified. If not, we copy by default
131
+ # into this project's binary directory, preserving its relative path.
132
+ if(AST_${VAR}_DEST)
133
+ set(DEST ${CMAKE_BINARY_DIR}/${parent_dir}/${AST_${VAR}_DEST})
134
+ else()
135
+ get_filename_component(parent_dir ${path} DIRECTORY)
136
+ set(DEST "${CMAKE_BINARY_DIR}/${parent_dir}")
137
+ endif()
138
+ get_filename_component(extern_data_source ${output} REALPATH)
139
+ get_filename_component(extern_data_basename ${output} NAME)
140
+ add_custom_command(
141
+ TARGET ${DATA_TARGET_NAME} POST_BUILD
142
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${extern_data_source} ${DEST}/${extern_data_basename}
143
+ )
144
+ endif()
145
+ endforeach()
146
+ endforeach()
147
+
148
+ if(ANDROID)
149
+ string(REGEX REPLACE "DATA{([^ ;]+)}" "\\1" processed_FILES "${AST_FILES}")
150
+ # There's no target used for this command, so we don't need to do anything
151
+ # here for CMP0178.
152
+ add_test(
153
+ NAME ${test_name}
154
+ COMMAND ${CMAKE_COMMAND}
155
+ "-Darg_files_dest=${AST_FILES_DEST}"
156
+ "-Darg_libs_dest=${AST_LIBS_DEST}"
157
+ "-Darg_dev_test_dir=${AST_DEVICE_TEST_DIR}"
158
+ "-Darg_dev_obj_store=${AST_DEVICE_OBJECT_STORE}"
159
+ "-Darg_no_link_regex=${AST_NO_LINK_REGEX}"
160
+ "-Darg_files=${processed_FILES}"
161
+ "-Darg_libs=${AST_LIBS}"
162
+ "-Darg_src_dir=${CMAKE_CURRENT_SOURCE_DIR}"
163
+ -P ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/AndroidTestUtilities/PushToAndroidDevice.cmake)
164
+ endif()
165
+ endfunction()
cmake/share/cmake-3.31/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This is a basic version file for the Config-mode of find_package().
2
+ # It is used by write_basic_package_version_file() as input file for configure_file()
3
+ # to create a version-file which can be installed along a config.cmake file.
4
+ #
5
+ # The created file sets PACKAGE_VERSION_EXACT if the current version string and
6
+ # the requested version string are exactly the same and it sets
7
+ # PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version.
8
+ # The variable CVF_VERSION must be set before calling configure_file().
9
+
10
+ set(PACKAGE_VERSION "@CVF_VERSION@")
11
+
12
+ if (PACKAGE_FIND_VERSION_RANGE)
13
+ # Package version must be in the requested version range
14
+ if ((PACKAGE_FIND_VERSION_RANGE_MIN STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MIN)
15
+ OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_GREATER PACKAGE_FIND_VERSION_MAX)
16
+ OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_GREATER_EQUAL PACKAGE_FIND_VERSION_MAX)))
17
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
18
+ else()
19
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
20
+ endif()
21
+ else()
22
+ if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
23
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
24
+ else()
25
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
26
+ if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
27
+ set(PACKAGE_VERSION_EXACT TRUE)
28
+ endif()
29
+ endif()
30
+ endif()
31
+
32
+ @CVF_ARCH_INDEPENDENT_CHECK@
cmake/share/cmake-3.31/Modules/BasicConfigVersion-ExactVersion.cmake.in ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This is a basic version file for the Config-mode of find_package().
2
+ # It is used by write_basic_package_version_file() as input file for configure_file()
3
+ # to create a version-file which can be installed along a config.cmake file.
4
+ #
5
+ # The created file sets PACKAGE_VERSION_EXACT if the current version string and
6
+ # the requested version string are exactly the same and it sets
7
+ # PACKAGE_VERSION_COMPATIBLE if the current version is equal to the requested version.
8
+ # The tweak version component is ignored.
9
+ # The variable CVF_VERSION must be set before calling configure_file().
10
+
11
+
12
+ if (PACKAGE_FIND_VERSION_RANGE)
13
+ message(AUTHOR_WARNING
14
+ "`find_package()` specify a version range but the version strategy "
15
+ "(ExactVersion) of the module `${PACKAGE_FIND_NAME}` is incompatible "
16
+ "with this request. Only the lower endpoint of the range will be used.")
17
+ endif()
18
+
19
+ set(PACKAGE_VERSION "@CVF_VERSION@")
20
+
21
+ if("@CVF_VERSION@" MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)") # strip the tweak version
22
+ set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
23
+ set(CVF_VERSION_MINOR "${CMAKE_MATCH_2}")
24
+ set(CVF_VERSION_PATCH "${CMAKE_MATCH_3}")
25
+
26
+ if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0)
27
+ string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}")
28
+ endif()
29
+ if(NOT CVF_VERSION_MINOR VERSION_EQUAL 0)
30
+ string(REGEX REPLACE "^0+" "" CVF_VERSION_MINOR "${CVF_VERSION_MINOR}")
31
+ endif()
32
+ if(NOT CVF_VERSION_PATCH VERSION_EQUAL 0)
33
+ string(REGEX REPLACE "^0+" "" CVF_VERSION_PATCH "${CVF_VERSION_PATCH}")
34
+ endif()
35
+
36
+ set(CVF_VERSION_NO_TWEAK "${CVF_VERSION_MAJOR}.${CVF_VERSION_MINOR}.${CVF_VERSION_PATCH}")
37
+ else()
38
+ set(CVF_VERSION_NO_TWEAK "@CVF_VERSION@")
39
+ endif()
40
+
41
+ if(PACKAGE_FIND_VERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)") # strip the tweak version
42
+ set(REQUESTED_VERSION_MAJOR "${CMAKE_MATCH_1}")
43
+ set(REQUESTED_VERSION_MINOR "${CMAKE_MATCH_2}")
44
+ set(REQUESTED_VERSION_PATCH "${CMAKE_MATCH_3}")
45
+
46
+ if(NOT REQUESTED_VERSION_MAJOR VERSION_EQUAL 0)
47
+ string(REGEX REPLACE "^0+" "" REQUESTED_VERSION_MAJOR "${REQUESTED_VERSION_MAJOR}")
48
+ endif()
49
+ if(NOT REQUESTED_VERSION_MINOR VERSION_EQUAL 0)
50
+ string(REGEX REPLACE "^0+" "" REQUESTED_VERSION_MINOR "${REQUESTED_VERSION_MINOR}")
51
+ endif()
52
+ if(NOT REQUESTED_VERSION_PATCH VERSION_EQUAL 0)
53
+ string(REGEX REPLACE "^0+" "" REQUESTED_VERSION_PATCH "${REQUESTED_VERSION_PATCH}")
54
+ endif()
55
+
56
+ set(REQUESTED_VERSION_NO_TWEAK
57
+ "${REQUESTED_VERSION_MAJOR}.${REQUESTED_VERSION_MINOR}.${REQUESTED_VERSION_PATCH}")
58
+ else()
59
+ set(REQUESTED_VERSION_NO_TWEAK "${PACKAGE_FIND_VERSION}")
60
+ endif()
61
+
62
+ if(REQUESTED_VERSION_NO_TWEAK STREQUAL CVF_VERSION_NO_TWEAK)
63
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
64
+ else()
65
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
66
+ endif()
67
+
68
+ if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
69
+ set(PACKAGE_VERSION_EXACT TRUE)
70
+ endif()
71
+
72
+ @CVF_ARCH_INDEPENDENT_CHECK@
cmake/share/cmake-3.31/Modules/BasicConfigVersion-SameMajorVersion.cmake.in ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This is a basic version file for the Config-mode of find_package().
2
+ # It is used by write_basic_package_version_file() as input file for configure_file()
3
+ # to create a version-file which can be installed along a config.cmake file.
4
+ #
5
+ # The created file sets PACKAGE_VERSION_EXACT if the current version string and
6
+ # the requested version string are exactly the same and it sets
7
+ # PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version,
8
+ # but only if the requested major version is the same as the current one.
9
+ # The variable CVF_VERSION must be set before calling configure_file().
10
+
11
+
12
+ set(PACKAGE_VERSION "@CVF_VERSION@")
13
+
14
+ if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
15
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
16
+ else()
17
+
18
+ if("@CVF_VERSION@" MATCHES "^([0-9]+)\\.")
19
+ set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
20
+ if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0)
21
+ string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}")
22
+ endif()
23
+ else()
24
+ set(CVF_VERSION_MAJOR "@CVF_VERSION@")
25
+ endif()
26
+
27
+ if(PACKAGE_FIND_VERSION_RANGE)
28
+ # both endpoints of the range must have the expected major version
29
+ math (EXPR CVF_VERSION_MAJOR_NEXT "${CVF_VERSION_MAJOR} + 1")
30
+ if (NOT PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR
31
+ OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX_MAJOR STREQUAL CVF_VERSION_MAJOR)
32
+ OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX VERSION_LESS_EQUAL CVF_VERSION_MAJOR_NEXT)))
33
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
34
+ elseif(PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR
35
+ AND ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS_EQUAL PACKAGE_FIND_VERSION_MAX)
36
+ OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MAX)))
37
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
38
+ else()
39
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
40
+ endif()
41
+ else()
42
+ if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR)
43
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
44
+ else()
45
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
46
+ endif()
47
+
48
+ if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
49
+ set(PACKAGE_VERSION_EXACT TRUE)
50
+ endif()
51
+ endif()
52
+ endif()
53
+
54
+ @CVF_ARCH_INDEPENDENT_CHECK@
cmake/share/cmake-3.31/Modules/BasicConfigVersion-SameMinorVersion.cmake.in ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This is a basic version file for the Config-mode of find_package().
2
+ # It is used by write_basic_package_version_file() as input file for configure_file()
3
+ # to create a version-file which can be installed along a config.cmake file.
4
+ #
5
+ # The created file sets PACKAGE_VERSION_EXACT if the current version string and
6
+ # the requested version string are exactly the same and it sets
7
+ # PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version,
8
+ # but only if the requested major and minor versions are the same as the current
9
+ # one.
10
+ # The variable CVF_VERSION must be set before calling configure_file().
11
+
12
+
13
+ set(PACKAGE_VERSION "@CVF_VERSION@")
14
+
15
+ if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
16
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
17
+ else()
18
+
19
+ if("@CVF_VERSION@" MATCHES "^([0-9]+)\\.([0-9]+)")
20
+ set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
21
+ set(CVF_VERSION_MINOR "${CMAKE_MATCH_2}")
22
+
23
+ if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0)
24
+ string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}")
25
+ endif()
26
+ if(NOT CVF_VERSION_MINOR VERSION_EQUAL 0)
27
+ string(REGEX REPLACE "^0+" "" CVF_VERSION_MINOR "${CVF_VERSION_MINOR}")
28
+ endif()
29
+ else()
30
+ set(CVF_VERSION_MAJOR "@CVF_VERSION@")
31
+ set(CVF_VERSION_MINOR "")
32
+ endif()
33
+
34
+ if(PACKAGE_FIND_VERSION_RANGE)
35
+ # both endpoints of the range must have the expected major and minor versions
36
+ math (EXPR CVF_VERSION_MINOR_NEXT "${CVF_VERSION_MINOR} + 1")
37
+ if (NOT (PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR
38
+ AND PACKAGE_FIND_VERSION_MIN_MINOR STREQUAL CVF_VERSION_MINOR)
39
+ OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE"
40
+ AND NOT (PACKAGE_FIND_VERSION_MAX_MAJOR STREQUAL CVF_VERSION_MAJOR
41
+ AND PACKAGE_FIND_VERSION_MAX_MINOR STREQUAL CVF_VERSION_MINOR))
42
+ OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE"
43
+ AND NOT PACKAGE_FIND_VERSION_MAX VERSION_LESS_EQUAL ${CVF_VERSION_MAJOR}.${CVF_VERSION_MINOR_NEXT})))
44
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
45
+ elseif(PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR
46
+ AND PACKAGE_FIND_VERSION_MIN_MINOR STREQUAL CVF_VERSION_MINOR
47
+ AND ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS_EQUAL PACKAGE_FIND_VERSION_MAX)
48
+ OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MAX)))
49
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
50
+ else()
51
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
52
+ endif()
53
+ else()
54
+ if(NOT PACKAGE_FIND_VERSION_MAJOR VERSION_EQUAL 0)
55
+ string(REGEX REPLACE "^0+" "" PACKAGE_FIND_VERSION_MAJOR "${PACKAGE_FIND_VERSION_MAJOR}")
56
+ endif()
57
+ if(NOT PACKAGE_FIND_VERSION_MINOR VERSION_EQUAL 0)
58
+ string(REGEX REPLACE "^0+" "" PACKAGE_FIND_VERSION_MINOR "${PACKAGE_FIND_VERSION_MINOR}")
59
+ endif()
60
+
61
+ if((PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR) AND
62
+ (PACKAGE_FIND_VERSION_MINOR STREQUAL CVF_VERSION_MINOR))
63
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
64
+ else()
65
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
66
+ endif()
67
+
68
+ if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
69
+ set(PACKAGE_VERSION_EXACT TRUE)
70
+ endif()
71
+ endif()
72
+ endif()
73
+
74
+ @CVF_ARCH_INDEPENDENT_CHECK@
cmake/share/cmake-3.31/Modules/BundleUtilities.cmake ADDED
@@ -0,0 +1,1131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
+ # file Copyright.txt or https://cmake.org/licensing for details.
3
+
4
+ #[=======================================================================[.rst:
5
+ BundleUtilities
6
+ ---------------
7
+
8
+ Functions to help assemble a standalone bundle application.
9
+
10
+ A collection of CMake utility functions useful for dealing with ``.app``
11
+ bundles on the Mac and bundle-like directories on any OS.
12
+
13
+ The following functions are provided by this module:
14
+
15
+ .. code-block:: cmake
16
+
17
+ fixup_bundle
18
+ copy_and_fixup_bundle
19
+ verify_app
20
+ get_bundle_main_executable
21
+ get_dotapp_dir
22
+ get_bundle_and_executable
23
+ get_bundle_all_executables
24
+ get_item_key
25
+ get_item_rpaths
26
+ clear_bundle_keys
27
+ set_bundle_key_values
28
+ get_bundle_keys
29
+ copy_resolved_item_into_bundle
30
+ copy_resolved_framework_into_bundle
31
+ fixup_bundle_item
32
+ verify_bundle_prerequisites
33
+ verify_bundle_symlinks
34
+
35
+ Requires CMake 2.6 or greater because it uses function, break and
36
+ ``PARENT_SCOPE``. Also depends on ``GetPrerequisites.cmake``.
37
+
38
+ DO NOT USE THESE FUNCTIONS AT CONFIGURE TIME (from ``CMakeLists.txt``)!
39
+ Instead, invoke them from an :command:`install(CODE)` or
40
+ :command:`install(SCRIPT)` rule.
41
+
42
+ .. code-block:: cmake
43
+
44
+ fixup_bundle(<app> <libs> <dirs>)
45
+
46
+ Fix up ``<app>`` bundle in-place and make it standalone, such that it can be
47
+ drag-n-drop copied to another machine and run on that machine as long
48
+ as all of the system libraries are compatible.
49
+
50
+ If you pass plugins to ``fixup_bundle`` as the libs parameter, you should
51
+ install them or copy them into the bundle before calling ``fixup_bundle``.
52
+ The ``<libs>`` parameter is a list of libraries that must be fixed up, but
53
+ that cannot be determined by ``otool`` output analysis (i.e. ``plugins``).
54
+
55
+ Gather all the keys for all the executables and libraries in a bundle,
56
+ and then, for each key, copy each prerequisite into the bundle. Then
57
+ fix each one up according to its own list of prerequisites.
58
+
59
+ Then clear all the keys and call ``verify_app`` on the final bundle to
60
+ ensure that it is truly standalone.
61
+
62
+ .. versionadded:: 3.6
63
+ As an optional parameter (``IGNORE_ITEM``) a list of file names can be passed,
64
+ which are then ignored
65
+ (e.g. ``IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe"``).
66
+
67
+ .. code-block:: cmake
68
+
69
+ copy_and_fixup_bundle(<src> <dst> <libs> <dirs>)
70
+
71
+ Makes a copy of the bundle ``<src>`` at location ``<dst>`` and then fixes up
72
+ the new copied bundle in-place at ``<dst>``.
73
+
74
+ .. code-block:: cmake
75
+
76
+ verify_app(<app>)
77
+
78
+ Verifies that an application ``<app>`` appears valid based on running
79
+ analysis tools on it. Calls :command:`message(FATAL_ERROR)` if the application
80
+ is not verified.
81
+
82
+ .. versionadded:: 3.6
83
+ As an optional parameter (``IGNORE_ITEM``) a list of file names can be passed,
84
+ which are then ignored
85
+ (e.g. ``IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe"``)
86
+
87
+ .. code-block:: cmake
88
+
89
+ get_bundle_main_executable(<bundle> <result_var>)
90
+
91
+ The result will be the full path name of the bundle's main executable
92
+ file or an ``error:`` prefixed string if it could not be determined.
93
+
94
+ .. code-block:: cmake
95
+
96
+ get_dotapp_dir(<exe> <dotapp_dir_var>)
97
+
98
+ Returns the nearest parent dir whose name ends with ``.app`` given the
99
+ full path to an executable. If there is no such parent dir, then
100
+ simply return the dir containing the executable.
101
+
102
+ The returned directory may or may not exist.
103
+
104
+ .. code-block:: cmake
105
+
106
+ get_bundle_and_executable(<app> <bundle_var> <executable_var> <valid_var>)
107
+
108
+ Takes either a ``.app`` directory name or the name of an executable
109
+ nested inside a ``.app`` directory and returns the path to the ``.app``
110
+ directory in ``<bundle_var>`` and the path to its main executable in
111
+ ``<executable_var>``.
112
+
113
+ .. code-block:: cmake
114
+
115
+ get_bundle_all_executables(<bundle> <exes_var>)
116
+
117
+ Scans ``<bundle>`` bundle recursively for all ``<exes_var>`` executable
118
+ files and accumulates them into a variable.
119
+
120
+ .. code-block:: cmake
121
+
122
+ get_item_key(<item> <key_var>)
123
+
124
+ Given ``<item>`` file name, generate ``<key_var>`` key that should be unique
125
+ considering the set of libraries that need copying or fixing up to
126
+ make a bundle standalone. This is essentially the file name including
127
+ extension with ``.`` replaced by ``_``
128
+
129
+ This key is used as a prefix for CMake variables so that we can
130
+ associate a set of variables with a given item based on its key.
131
+
132
+ .. code-block:: cmake
133
+
134
+ clear_bundle_keys(<keys_var>)
135
+
136
+ Loop over the ``<keys_var>`` list of keys, clearing all the variables
137
+ associated with each key. After the loop, clear the list of keys itself.
138
+
139
+ Caller of ``get_bundle_keys`` should call ``clear_bundle_keys`` when done with
140
+ list of keys.
141
+
142
+ .. code-block:: cmake
143
+
144
+ set_bundle_key_values(<keys_var> <context> <item> <exepath> <dirs>
145
+ <copyflag> [<rpaths>])
146
+
147
+ Add ``<keys_var>`` key to the list (if necessary) for the given item.
148
+ If added, also set all the variables associated with that key.
149
+
150
+ .. code-block:: cmake
151
+
152
+ get_bundle_keys(<app> <libs> <dirs> <keys_var>)
153
+
154
+ Loop over all the executable and library files within ``<app>`` bundle (and
155
+ given as extra ``<libs>``) and accumulate a list of keys representing
156
+ them. Set values associated with each key such that we can loop over
157
+ all of them and copy prerequisite libs into the bundle and then do
158
+ appropriate ``install_name_tool`` fixups.
159
+
160
+ .. versionadded:: 3.6
161
+ As an optional parameter (``IGNORE_ITEM``) a list of file names can be passed,
162
+ which are then ignored
163
+ (e.g. ``IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe"``)
164
+
165
+ .. code-block:: cmake
166
+
167
+ copy_resolved_item_into_bundle(<resolved_item> <resolved_embedded_item>)
168
+
169
+ Copy a resolved item into the bundle if necessary.
170
+ Copy is not necessary, if the ``<resolved_item>`` is "the same as" the
171
+ ``<resolved_embedded_item>``.
172
+
173
+ .. code-block:: cmake
174
+
175
+ copy_resolved_framework_into_bundle(<resolved_item> <resolved_embedded_item>)
176
+
177
+ Copy a resolved framework into the bundle if necessary.
178
+ Copy is not necessary, if the ``<resolved_item>`` is "the same as" the
179
+ ``<resolved_embedded_item>``.
180
+
181
+ By default, ``BU_COPY_FULL_FRAMEWORK_CONTENTS`` is not set. If you want
182
+ full frameworks embedded in your bundles, set
183
+ ``BU_COPY_FULL_FRAMEWORK_CONTENTS`` to ``ON`` before calling fixup_bundle. By
184
+ default, ``COPY_RESOLVED_FRAMEWORK_INTO_BUNDLE`` copies the framework
185
+ dylib itself plus the framework ``Resources`` directory.
186
+
187
+ .. code-block:: cmake
188
+
189
+ fixup_bundle_item(<resolved_embedded_item> <exepath> <dirs>)
190
+
191
+ Get the direct/non-system prerequisites of the ``<resolved_embedded_item>``.
192
+ For each prerequisite, change the way it is referenced to the value of
193
+ the ``_EMBEDDED_ITEM`` keyed variable for that prerequisite. (Most likely
194
+ changing to an ``@executable_path`` style reference.)
195
+
196
+ This function requires that the ``<resolved_embedded_item>`` be ``inside``
197
+ the bundle already. In other words, if you pass plugins to ``fixup_bundle``
198
+ as the libs parameter, you should install them or copy them into the
199
+ bundle before calling ``fixup_bundle``. The ``libs`` parameter is a list of
200
+ libraries that must be fixed up, but that cannot be determined by
201
+ otool output analysis. (i.e., ``plugins``)
202
+
203
+ Also, change the id of the item being fixed up to its own
204
+ ``_EMBEDDED_ITEM`` value.
205
+
206
+ Accumulate changes in a local variable and make *one* call to
207
+ ``install_name_tool`` at the end of the function with all the changes at
208
+ once.
209
+
210
+ If the ``BU_CHMOD_BUNDLE_ITEMS`` variable is set then bundle items will be
211
+ marked writable before ``install_name_tool`` tries to change them.
212
+
213
+ .. code-block:: cmake
214
+
215
+ verify_bundle_prerequisites(<bundle> <result_var> <info_var>)
216
+
217
+ Verifies that the sum of all prerequisites of all files inside the
218
+ bundle are contained within the bundle or are ``system`` libraries,
219
+ presumed to exist everywhere.
220
+
221
+ .. versionadded:: 3.6
222
+ As an optional parameter (``IGNORE_ITEM``) a list of file names can be passed,
223
+ which are then ignored
224
+ (e.g. ``IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe"``)
225
+
226
+ .. code-block:: cmake
227
+
228
+ verify_bundle_symlinks(<bundle> <result_var> <info_var>)
229
+
230
+ Verifies that any symlinks found in the ``<bundle>`` bundle point to other files
231
+ that are already also in the bundle... Anything that points to an
232
+ external file causes this function to fail the verification.
233
+ #]=======================================================================]
234
+
235
+ function(_warn_cmp0080)
236
+ cmake_policy(GET_WARNING CMP0080 _cmp0080_warning)
237
+ message(AUTHOR_WARNING "${_cmp0080_warning}\n")
238
+ endfunction()
239
+
240
+ # Do not include this module at configure time!
241
+ if(DEFINED CMAKE_GENERATOR)
242
+ cmake_policy(GET CMP0080 _BundleUtilities_CMP0080)
243
+ if(_BundleUtilities_CMP0080 STREQUAL "NEW")
244
+ message(FATAL_ERROR "BundleUtilities cannot be included at configure time!")
245
+ elseif(NOT _BundleUtilities_CMP0080 STREQUAL "OLD" AND NOT _CMP0080_SUPPRESS_WARNING)
246
+ _warn_cmp0080()
247
+ endif()
248
+ endif()
249
+
250
+ cmake_policy(PUSH)
251
+ cmake_policy(SET CMP0057 NEW) # if IN_LIST
252
+
253
+ # The functions defined in this file depend on the get_prerequisites function
254
+ # (and possibly others) found in:
255
+ #
256
+ include("${CMAKE_CURRENT_LIST_DIR}/GetPrerequisites.cmake")
257
+
258
+
259
+ function(get_bundle_main_executable bundle result_var)
260
+ set(result "error: '${bundle}/Contents/Info.plist' file does not exist")
261
+
262
+ if(EXISTS "${bundle}/Contents/Info.plist")
263
+ set(result "error: no CFBundleExecutable in '${bundle}/Contents/Info.plist' file")
264
+ set(line_is_main_executable 0)
265
+ set(bundle_executable "")
266
+
267
+ # Read Info.plist as a list of lines:
268
+ #
269
+ set(eol_char "E")
270
+ file(READ "${bundle}/Contents/Info.plist" info_plist)
271
+ string(REPLACE ";" "\\;" info_plist "${info_plist}")
272
+ string(REPLACE "\n" "${eol_char};" info_plist "${info_plist}")
273
+ string(REPLACE "\r" "${eol_char};" info_plist "${info_plist}")
274
+
275
+ # Scan the lines for "<key>CFBundleExecutable</key>" - the line after that
276
+ # is the name of the main executable.
277
+ #
278
+ foreach(line ${info_plist})
279
+ if(line_is_main_executable)
280
+ string(REGEX REPLACE "^.*<string>(.*)</string>.*$" "\\1" bundle_executable "${line}")
281
+ break()
282
+ endif()
283
+
284
+ if(line MATCHES "<key>CFBundleExecutable</key>")
285
+ set(line_is_main_executable 1)
286
+ endif()
287
+ endforeach()
288
+
289
+ if(NOT bundle_executable STREQUAL "")
290
+ if(EXISTS "${bundle}/Contents/MacOS/${bundle_executable}")
291
+ set(result "${bundle}/Contents/MacOS/${bundle_executable}")
292
+ else()
293
+
294
+ # Ultimate goal:
295
+ # If not in "Contents/MacOS" then scan the bundle for matching files. If
296
+ # there is only one executable file that matches, then use it, otherwise
297
+ # it's an error...
298
+ #
299
+ #file(GLOB_RECURSE file_list "${bundle}/${bundle_executable}")
300
+
301
+ # But for now, pragmatically, it's an error. Expect the main executable
302
+ # for the bundle to be in Contents/MacOS, it's an error if it's not:
303
+ #
304
+ set(result "error: '${bundle}/Contents/MacOS/${bundle_executable}' does not exist")
305
+ endif()
306
+ endif()
307
+ else()
308
+ #
309
+ # More inclusive technique... (This one would work on Windows and Linux
310
+ # too, if a developer followed the typical Mac bundle naming convention...)
311
+ #
312
+ # If there is no Info.plist file, try to find an executable with the same
313
+ # base name as the .app directory:
314
+ #
315
+ endif()
316
+
317
+ set(${result_var} "${result}" PARENT_SCOPE)
318
+ endfunction()
319
+
320
+
321
+ function(get_dotapp_dir exe dotapp_dir_var)
322
+ set(s "${exe}")
323
+
324
+ if(s MATCHES "/.*\\.app/")
325
+ # If there is a ".app" parent directory,
326
+ # ascend until we hit it:
327
+ # (typical of a Mac bundle executable)
328
+ #
329
+ set(done 0)
330
+ while(NOT ${done})
331
+ get_filename_component(snamewe "${s}" NAME_WE)
332
+ get_filename_component(sname "${s}" NAME)
333
+ get_filename_component(sdir "${s}" PATH)
334
+ set(s "${sdir}")
335
+ if(sname MATCHES "\\.app$")
336
+ set(done 1)
337
+ set(dotapp_dir "${sdir}/${sname}")
338
+ endif()
339
+ endwhile()
340
+ else()
341
+ # Otherwise use a directory containing the exe
342
+ # (typical of a non-bundle executable on Mac, Windows or Linux)
343
+ #
344
+ is_file_executable("${s}" is_executable)
345
+ if(is_executable)
346
+ get_filename_component(sdir "${s}" PATH)
347
+ set(dotapp_dir "${sdir}")
348
+ else()
349
+ set(dotapp_dir "${s}")
350
+ endif()
351
+ endif()
352
+
353
+
354
+ set(${dotapp_dir_var} "${dotapp_dir}" PARENT_SCOPE)
355
+ endfunction()
356
+
357
+
358
+ function(get_bundle_and_executable app bundle_var executable_var valid_var)
359
+ set(valid 0)
360
+
361
+ if(EXISTS "${app}")
362
+ # Is it a directory ending in .app?
363
+ if(IS_DIRECTORY "${app}")
364
+ if(app MATCHES "\\.app$")
365
+ get_bundle_main_executable("${app}" executable)
366
+ if(EXISTS "${app}" AND EXISTS "${executable}")
367
+ set(${bundle_var} "${app}" PARENT_SCOPE)
368
+ set(${executable_var} "${executable}" PARENT_SCOPE)
369
+ set(valid 1)
370
+ #message(STATUS "info: handled .app directory case...")
371
+ else()
372
+ message(STATUS "warning: *NOT* handled - .app directory case...")
373
+ endif()
374
+ else()
375
+ message(STATUS "warning: *NOT* handled - directory but not .app case...")
376
+ endif()
377
+ else()
378
+ # Is it an executable file?
379
+ is_file_executable("${app}" is_executable)
380
+ if(is_executable)
381
+ get_dotapp_dir("${app}" dotapp_dir)
382
+ if(EXISTS "${dotapp_dir}")
383
+ set(${bundle_var} "${dotapp_dir}" PARENT_SCOPE)
384
+ set(${executable_var} "${app}" PARENT_SCOPE)
385
+ set(valid 1)
386
+ #message(STATUS "info: handled executable file in .app dir case...")
387
+ else()
388
+ get_filename_component(app_dir "${app}" PATH)
389
+ set(${bundle_var} "${app_dir}" PARENT_SCOPE)
390
+ set(${executable_var} "${app}" PARENT_SCOPE)
391
+ set(valid 1)
392
+ #message(STATUS "info: handled executable file in any dir case...")
393
+ endif()
394
+ else()
395
+ message(STATUS "warning: *NOT* handled - not .app dir, not executable file...")
396
+ endif()
397
+ endif()
398
+ else()
399
+ message(STATUS "warning: *NOT* handled - directory/file does not exist...")
400
+ endif()
401
+
402
+ if(NOT valid)
403
+ set(${bundle_var} "error: not a bundle" PARENT_SCOPE)
404
+ set(${executable_var} "error: not a bundle" PARENT_SCOPE)
405
+ endif()
406
+
407
+ set(${valid_var} ${valid} PARENT_SCOPE)
408
+ endfunction()
409
+
410
+
411
+ function(get_bundle_all_executables bundle exes_var)
412
+ set(exes "")
413
+
414
+ if(UNIX)
415
+ find_program(find_cmd "find")
416
+ mark_as_advanced(find_cmd)
417
+ endif()
418
+
419
+ # find command is much quicker than checking every file one by one on Unix
420
+ # which can take long time for large bundles, and since anyway we expect
421
+ # executable to have execute flag set we can narrow the list much quicker.
422
+ if(find_cmd)
423
+ execute_process(COMMAND "${find_cmd}" "${bundle}"
424
+ -type f \( -perm -0100 -o -perm -0010 -o -perm -0001 \)
425
+ OUTPUT_VARIABLE file_list
426
+ OUTPUT_STRIP_TRAILING_WHITESPACE
427
+ )
428
+ string(REPLACE "\n" ";" file_list "${file_list}")
429
+ else()
430
+ file(GLOB_RECURSE file_list "${bundle}/*")
431
+ endif()
432
+
433
+ foreach(f ${file_list})
434
+ is_file_executable("${f}" is_executable)
435
+ if(is_executable)
436
+ set(exes ${exes} "${f}")
437
+ endif()
438
+ endforeach()
439
+
440
+ set(${exes_var} "${exes}" PARENT_SCOPE)
441
+ endfunction()
442
+
443
+
444
+ function(get_item_rpaths item rpaths_var)
445
+ if(APPLE)
446
+ find_program(otool_cmd "otool")
447
+ mark_as_advanced(otool_cmd)
448
+ endif()
449
+
450
+ if(otool_cmd)
451
+ execute_process(
452
+ COMMAND "${otool_cmd}" -l "${item}"
453
+ OUTPUT_VARIABLE load_cmds_ov
454
+ RESULT_VARIABLE otool_rv
455
+ ERROR_VARIABLE otool_ev
456
+ )
457
+ if(NOT otool_rv STREQUAL "0")
458
+ message(FATAL_ERROR "otool -l failed: ${otool_rv}\n${otool_ev}")
459
+ endif()
460
+ string(REGEX REPLACE "[^\n]+cmd LC_RPATH\n[^\n]+\n[^\n]+path ([^\n]+) \\(offset[^\n]+\n" "rpath \\1\n" load_cmds_ov "${load_cmds_ov}")
461
+ string(REGEX MATCHALL "rpath [^\n]+" load_cmds_ov "${load_cmds_ov}")
462
+ string(REGEX REPLACE "rpath " "" load_cmds_ov "${load_cmds_ov}")
463
+ if(load_cmds_ov)
464
+ foreach(rpath ${load_cmds_ov})
465
+ gp_append_unique(${rpaths_var} "${rpath}")
466
+ endforeach()
467
+ endif()
468
+ endif()
469
+
470
+ if(UNIX AND NOT APPLE)
471
+ file(READ_ELF ${item} RPATH rpath_var RUNPATH runpath_var CAPTURE_ERROR error_var)
472
+ get_filename_component(item_dir ${item} DIRECTORY)
473
+ foreach(rpath ${rpath_var} ${runpath_var})
474
+ # Substitute $ORIGIN with the exepath and add to the found rpaths
475
+ string(REPLACE "$ORIGIN" "${item_dir}" rpath "${rpath}")
476
+ gp_append_unique(${rpaths_var} "${rpath}")
477
+ endforeach()
478
+ endif()
479
+
480
+ set(${rpaths_var} ${${rpaths_var}} PARENT_SCOPE)
481
+ endfunction()
482
+
483
+
484
+ function(get_item_key item key_var)
485
+ get_filename_component(item_name "${item}" NAME)
486
+ if(WIN32)
487
+ string(TOLOWER "${item_name}" item_name)
488
+ endif()
489
+ string(REPLACE "." "_" ${key_var} "${item_name}")
490
+ set(${key_var} ${${key_var}} PARENT_SCOPE)
491
+ endfunction()
492
+
493
+
494
+ function(clear_bundle_keys keys_var)
495
+ foreach(key ${${keys_var}})
496
+ set(${key}_ITEM PARENT_SCOPE)
497
+ set(${key}_RESOLVED_ITEM PARENT_SCOPE)
498
+ set(${key}_DEFAULT_EMBEDDED_PATH PARENT_SCOPE)
499
+ set(${key}_EMBEDDED_ITEM PARENT_SCOPE)
500
+ set(${key}_RESOLVED_EMBEDDED_ITEM PARENT_SCOPE)
501
+ set(${key}_COPYFLAG PARENT_SCOPE)
502
+ set(${key}_RPATHS PARENT_SCOPE)
503
+ endforeach()
504
+ set(${keys_var} PARENT_SCOPE)
505
+ endfunction()
506
+
507
+
508
+ function(set_bundle_key_values keys_var context item exepath dirs copyflag)
509
+ if(ARGC GREATER 6)
510
+ set(rpaths "${ARGV6}")
511
+ else()
512
+ set(rpaths "")
513
+ endif()
514
+ get_filename_component(item_name "${item}" NAME)
515
+
516
+ get_item_key("${item}" key)
517
+
518
+ list(LENGTH ${keys_var} length_before)
519
+ gp_append_unique(${keys_var} "${key}")
520
+ list(LENGTH ${keys_var} length_after)
521
+
522
+ if(NOT length_before EQUAL length_after)
523
+ gp_resolve_item("${context}" "${item}" "${exepath}" "${dirs}" resolved_item "${rpaths}")
524
+
525
+ gp_item_default_embedded_path("${item}" default_embedded_path)
526
+
527
+ get_item_rpaths("${resolved_item}" item_rpaths)
528
+
529
+ if((NOT item MATCHES "\\.dylib$") AND (item MATCHES "[^/]+\\.framework/"))
530
+ # For frameworks, construct the name under the embedded path from the
531
+ # opening "${item_name}.framework/" to the closing "/${item_name}":
532
+ #
533
+ string(REGEX REPLACE "^.*(${item_name}.framework/.*/?${item_name}).*$" "${default_embedded_path}/\\1" embedded_item "${item}")
534
+ else()
535
+ # For other items, just use the same name as the original, but in the
536
+ # embedded path:
537
+ #
538
+ set(embedded_item "${default_embedded_path}/${item_name}")
539
+ endif()
540
+
541
+ # Replace @executable_path and resolve ".." references:
542
+ #
543
+ string(REPLACE "@executable_path" "${exepath}" resolved_embedded_item "${embedded_item}")
544
+ get_filename_component(resolved_embedded_item "${resolved_embedded_item}" ABSOLUTE)
545
+
546
+ # *But* -- if we are not copying, then force resolved_embedded_item to be
547
+ # the same as resolved_item. In the case of multiple executables in the
548
+ # original bundle, using the default_embedded_path results in looking for
549
+ # the resolved executable next to the main bundle executable. This is here
550
+ # so that exes in the other sibling directories (like "bin") get fixed up
551
+ # properly...
552
+ #
553
+ if(NOT copyflag)
554
+ set(resolved_embedded_item "${resolved_item}")
555
+ endif()
556
+
557
+ set(${keys_var} ${${keys_var}} PARENT_SCOPE)
558
+ set(${key}_ITEM "${item}" PARENT_SCOPE)
559
+ set(${key}_RESOLVED_ITEM "${resolved_item}" PARENT_SCOPE)
560
+ set(${key}_DEFAULT_EMBEDDED_PATH "${default_embedded_path}" PARENT_SCOPE)
561
+ set(${key}_EMBEDDED_ITEM "${embedded_item}" PARENT_SCOPE)
562
+ set(${key}_RESOLVED_EMBEDDED_ITEM "${resolved_embedded_item}" PARENT_SCOPE)
563
+ set(${key}_COPYFLAG "${copyflag}" PARENT_SCOPE)
564
+ set(${key}_RPATHS "${item_rpaths}" PARENT_SCOPE)
565
+ set(${key}_RDEP_RPATHS "${rpaths}" PARENT_SCOPE)
566
+ else()
567
+ #message("warning: item key '${key}' already in the list, subsequent references assumed identical to first")
568
+ endif()
569
+ endfunction()
570
+
571
+
572
+ function(get_bundle_keys app libs dirs keys_var)
573
+ set(${keys_var} PARENT_SCOPE)
574
+
575
+ set(options)
576
+ set(oneValueArgs)
577
+ set(multiValueArgs IGNORE_ITEM)
578
+ cmake_parse_arguments(CFG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
579
+
580
+ get_bundle_and_executable("${app}" bundle executable valid)
581
+ if(valid)
582
+ # Always use the exepath of the main bundle executable for @executable_path
583
+ # replacements:
584
+ #
585
+ get_filename_component(exepath "${executable}" PATH)
586
+
587
+ # But do fixups on all executables in the bundle:
588
+ #
589
+ get_bundle_all_executables("${bundle}" exes)
590
+
591
+ # Set keys for main executable first:
592
+ #
593
+ set_bundle_key_values(${keys_var} "${executable}" "${executable}" "${exepath}" "${dirs}" 0)
594
+
595
+ # Get rpaths specified by main executable:
596
+ #
597
+ get_item_key("${executable}" executable_key)
598
+ set(main_rpaths "${${executable_key}_RPATHS}")
599
+
600
+ # For each extra lib, accumulate a key as well and then also accumulate
601
+ # any of its prerequisites. (Extra libs are typically dynamically loaded
602
+ # plugins: libraries that are prerequisites for full runtime functionality
603
+ # but that do not show up in otool -L output...)
604
+ #
605
+ foreach(lib ${libs})
606
+ set_bundle_key_values(${keys_var} "${lib}" "${lib}" "${exepath}" "${dirs}" 0 "${main_rpaths}")
607
+
608
+ set(prereqs "")
609
+ get_filename_component(prereq_filename ${lib} NAME)
610
+
611
+ if(NOT prereq_filename IN_LIST CFG_IGNORE_ITEM)
612
+ get_prerequisites("${lib}" prereqs 1 1 "${exepath}" "${dirs}" "${main_rpaths}")
613
+ foreach(pr ${prereqs})
614
+ set_bundle_key_values(${keys_var} "${lib}" "${pr}" "${exepath}" "${dirs}" 1 "${main_rpaths}")
615
+ endforeach()
616
+ else()
617
+ message(STATUS "Ignoring file: ${prereq_filename}")
618
+ endif()
619
+ endforeach()
620
+
621
+ # For each executable found in the bundle, accumulate keys as we go.
622
+ # The list of keys should be complete when all prerequisites of all
623
+ # binaries in the bundle have been analyzed.
624
+ #
625
+ foreach(exe ${exes})
626
+ # Main executable is scanned first above:
627
+ #
628
+ if(NOT exe STREQUAL executable)
629
+ # Add the exe itself to the keys:
630
+ #
631
+ set_bundle_key_values(${keys_var} "${exe}" "${exe}" "${exepath}" "${dirs}" 0 "${main_rpaths}")
632
+
633
+ # Get rpaths specified by executable:
634
+ #
635
+ get_item_key("${exe}" exe_key)
636
+ set(exe_rpaths "${main_rpaths}" "${${exe_key}_RPATHS}")
637
+ else()
638
+ set(exe_rpaths "${main_rpaths}")
639
+ endif()
640
+
641
+ # Add each prerequisite to the keys:
642
+ #
643
+ set(prereqs "")
644
+ get_filename_component(prereq_filename ${exe} NAME)
645
+
646
+ if(NOT prereq_filename IN_LIST CFG_IGNORE_ITEM)
647
+ get_prerequisites("${exe}" prereqs 1 1 "${exepath}" "${dirs}" "${exe_rpaths}")
648
+ foreach(pr ${prereqs})
649
+ set_bundle_key_values(${keys_var} "${exe}" "${pr}" "${exepath}" "${dirs}" 1 "${exe_rpaths}")
650
+ endforeach()
651
+ else()
652
+ message(STATUS "Ignoring file: ${prereq_filename}")
653
+ endif()
654
+ endforeach()
655
+
656
+ # preserve library symlink structure
657
+ foreach(key ${${keys_var}})
658
+ if("${${key}_COPYFLAG}" STREQUAL "1")
659
+ if(IS_SYMLINK "${${key}_RESOLVED_ITEM}")
660
+ get_filename_component(target "${${key}_RESOLVED_ITEM}" REALPATH)
661
+ set_bundle_key_values(${keys_var} "${exe}" "${target}" "${exepath}" "${dirs}" 1 "${exe_rpaths}")
662
+ get_item_key("${target}" targetkey)
663
+
664
+ if(WIN32)
665
+ # ignore case on Windows
666
+ string(TOLOWER "${${key}_RESOLVED_ITEM}" resolved_item_compare)
667
+ string(TOLOWER "${${targetkey}_RESOLVED_EMBEDDED_ITEM}" resolved_embedded_item_compare)
668
+ else()
669
+ set(resolved_item_compare "${${key}_RESOLVED_ITEM}")
670
+ set(resolved_embedded_item_compare "${${targetkey}_RESOLVED_EMBEDDED_ITEM}")
671
+ endif()
672
+ get_filename_component(resolved_item_compare "${resolved_item_compare}" NAME)
673
+ get_filename_component(resolved_embedded_item_compare "${resolved_embedded_item_compare}" NAME)
674
+
675
+ if(NOT resolved_item_compare STREQUAL resolved_embedded_item_compare)
676
+ set(${key}_COPYFLAG "2")
677
+ set(${key}_RESOLVED_ITEM "${${targetkey}_RESOLVED_EMBEDDED_ITEM}")
678
+ endif()
679
+
680
+ endif()
681
+ endif()
682
+ endforeach()
683
+ # Propagate values to caller's scope:
684
+ #
685
+ set(${keys_var} ${${keys_var}} PARENT_SCOPE)
686
+ foreach(key ${${keys_var}})
687
+ set(${key}_ITEM "${${key}_ITEM}" PARENT_SCOPE)
688
+ set(${key}_RESOLVED_ITEM "${${key}_RESOLVED_ITEM}" PARENT_SCOPE)
689
+ set(${key}_DEFAULT_EMBEDDED_PATH "${${key}_DEFAULT_EMBEDDED_PATH}" PARENT_SCOPE)
690
+ set(${key}_EMBEDDED_ITEM "${${key}_EMBEDDED_ITEM}" PARENT_SCOPE)
691
+ set(${key}_RESOLVED_EMBEDDED_ITEM "${${key}_RESOLVED_EMBEDDED_ITEM}" PARENT_SCOPE)
692
+ set(${key}_COPYFLAG "${${key}_COPYFLAG}" PARENT_SCOPE)
693
+ set(${key}_RPATHS "${${key}_RPATHS}" PARENT_SCOPE)
694
+ set(${key}_RDEP_RPATHS "${${key}_RDEP_RPATHS}" PARENT_SCOPE)
695
+ endforeach()
696
+ endif()
697
+ endfunction()
698
+
699
+ function(link_resolved_item_into_bundle resolved_item resolved_embedded_item)
700
+ if(WIN32)
701
+ # ignore case on Windows
702
+ string(TOLOWER "${resolved_item}" resolved_item_compare)
703
+ string(TOLOWER "${resolved_embedded_item}" resolved_embedded_item_compare)
704
+ else()
705
+ set(resolved_item_compare "${resolved_item}")
706
+ set(resolved_embedded_item_compare "${resolved_embedded_item}")
707
+ endif()
708
+
709
+ if(resolved_item_compare STREQUAL resolved_embedded_item_compare)
710
+ message(STATUS "warning: resolved_item == resolved_embedded_item - not linking...")
711
+ else()
712
+ get_filename_component(target_dir "${resolved_embedded_item}" DIRECTORY)
713
+ file(RELATIVE_PATH symlink_target "${target_dir}" "${resolved_item}")
714
+ if (NOT EXISTS "${target_dir}")
715
+ file(MAKE_DIRECTORY "${target_dir}")
716
+ endif()
717
+ execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "${symlink_target}" "${resolved_embedded_item}")
718
+ endif()
719
+ endfunction()
720
+
721
+ function(copy_resolved_item_into_bundle resolved_item resolved_embedded_item)
722
+ if(WIN32)
723
+ # ignore case on Windows
724
+ string(TOLOWER "${resolved_item}" resolved_item_compare)
725
+ string(TOLOWER "${resolved_embedded_item}" resolved_embedded_item_compare)
726
+ else()
727
+ set(resolved_item_compare "${resolved_item}")
728
+ set(resolved_embedded_item_compare "${resolved_embedded_item}")
729
+ endif()
730
+
731
+ if(resolved_item_compare STREQUAL resolved_embedded_item_compare)
732
+ message(STATUS "warning: resolved_item == resolved_embedded_item - not copying...")
733
+ else()
734
+ #message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy ${resolved_item} ${resolved_embedded_item}")
735
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${resolved_item}" "${resolved_embedded_item}")
736
+ if(UNIX AND NOT APPLE)
737
+ file(RPATH_REMOVE FILE "${resolved_embedded_item}")
738
+ endif()
739
+ endif()
740
+
741
+ endfunction()
742
+
743
+
744
+ function(copy_resolved_framework_into_bundle resolved_item resolved_embedded_item)
745
+ if(WIN32)
746
+ # ignore case on Windows
747
+ string(TOLOWER "${resolved_item}" resolved_item_compare)
748
+ string(TOLOWER "${resolved_embedded_item}" resolved_embedded_item_compare)
749
+ else()
750
+ set(resolved_item_compare "${resolved_item}")
751
+ set(resolved_embedded_item_compare "${resolved_embedded_item}")
752
+ endif()
753
+
754
+ if(resolved_item_compare STREQUAL resolved_embedded_item_compare)
755
+ message(STATUS "warning: resolved_item == resolved_embedded_item - not copying...")
756
+ else()
757
+ if(BU_COPY_FULL_FRAMEWORK_CONTENTS)
758
+ # Full Framework (everything):
759
+ get_filename_component(resolved_dir "${resolved_item}" PATH)
760
+ get_filename_component(resolved_dir "${resolved_dir}/../.." ABSOLUTE)
761
+ get_filename_component(resolved_embedded_dir "${resolved_embedded_item}" PATH)
762
+ get_filename_component(resolved_embedded_dir "${resolved_embedded_dir}/../.." ABSOLUTE)
763
+ #message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy_directory '${resolved_dir}' '${resolved_embedded_dir}'")
764
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${resolved_dir}" "${resolved_embedded_dir}")
765
+ else()
766
+ # Framework lib itself:
767
+ #message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy ${resolved_item} ${resolved_embedded_item}")
768
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${resolved_item}" "${resolved_embedded_item}")
769
+
770
+ # Plus Resources, if they exist:
771
+ string(REGEX REPLACE "^(.*)/[^/]+$" "\\1/Resources" resolved_resources "${resolved_item}")
772
+ string(REGEX REPLACE "^(.*)/[^/]+$" "\\1/Resources" resolved_embedded_resources "${resolved_embedded_item}")
773
+ if(EXISTS "${resolved_resources}")
774
+ #message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy_directory '${resolved_resources}' '${resolved_embedded_resources}'")
775
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${resolved_resources}" "${resolved_embedded_resources}")
776
+ endif()
777
+
778
+ # Some frameworks e.g. Qt put Info.plist in wrong place, so when it is
779
+ # missing in resources, copy it from other well known incorrect locations:
780
+ if(NOT EXISTS "${resolved_resources}/Info.plist")
781
+ # Check for Contents/Info.plist in framework root (older Qt SDK):
782
+ string(REGEX REPLACE "^(.*)/[^/]+/[^/]+/[^/]+$" "\\1/Contents/Info.plist" resolved_info_plist "${resolved_item}")
783
+ string(REGEX REPLACE "^(.*)/[^/]+$" "\\1/Resources/Info.plist" resolved_embedded_info_plist "${resolved_embedded_item}")
784
+ if(EXISTS "${resolved_info_plist}")
785
+ #message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy_directory '${resolved_info_plist}' '${resolved_embedded_info_plist}'")
786
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${resolved_info_plist}" "${resolved_embedded_info_plist}")
787
+ endif()
788
+ endif()
789
+
790
+ # Check if framework is versioned and fix it layout
791
+ string(REGEX REPLACE "^.*/([^/]+)/[^/]+$" "\\1" resolved_embedded_version "${resolved_embedded_item}")
792
+ string(REGEX REPLACE "^(.*)/[^/]+/[^/]+$" "\\1" resolved_embedded_versions "${resolved_embedded_item}")
793
+ string(REGEX REPLACE "^.*/([^/]+)/[^/]+/[^/]+$" "\\1" resolved_embedded_versions_basename "${resolved_embedded_item}")
794
+ if(resolved_embedded_versions_basename STREQUAL "Versions")
795
+ # Ensure Current symlink points to the framework version
796
+ if(NOT EXISTS "${resolved_embedded_versions}/Current")
797
+ execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "${resolved_embedded_version}" "${resolved_embedded_versions}/Current")
798
+ endif()
799
+ # Restore symlinks in framework root pointing to current framework
800
+ # binary and resources:
801
+ string(REGEX REPLACE "^(.*)/[^/]+/[^/]+/[^/]+$" "\\1" resolved_embedded_root "${resolved_embedded_item}")
802
+ string(REGEX REPLACE "^.*/([^/]+)$" "\\1" resolved_embedded_item_basename "${resolved_embedded_item}")
803
+ if(NOT EXISTS "${resolved_embedded_root}/${resolved_embedded_item_basename}")
804
+ execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "Versions/Current/${resolved_embedded_item_basename}" "${resolved_embedded_root}/${resolved_embedded_item_basename}")
805
+ endif()
806
+ if(NOT EXISTS "${resolved_embedded_root}/Resources")
807
+ execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "Versions/Current/Resources" "${resolved_embedded_root}/Resources")
808
+ endif()
809
+ endif()
810
+ endif()
811
+ if(UNIX AND NOT APPLE)
812
+ file(RPATH_REMOVE FILE "${resolved_embedded_item}")
813
+ endif()
814
+ endif()
815
+
816
+ endfunction()
817
+
818
+
819
+ function(fixup_bundle_item resolved_embedded_item exepath dirs)
820
+ # This item's key is "ikey":
821
+ #
822
+ get_item_key("${resolved_embedded_item}" ikey)
823
+
824
+ # Ensure the item is "inside the .app bundle" -- it should not be fixed up if
825
+ # it is not in the .app bundle... Otherwise, we'll modify files in the build
826
+ # tree, or in other varied locations around the file system, with our call to
827
+ # install_name_tool. Make sure that doesn't happen here:
828
+ #
829
+ get_dotapp_dir("${exepath}" exe_dotapp_dir)
830
+ string(LENGTH "${exe_dotapp_dir}/" exe_dotapp_dir_length)
831
+ string(LENGTH "${resolved_embedded_item}" resolved_embedded_item_length)
832
+ set(path_too_short 0)
833
+ set(is_embedded 0)
834
+ if(resolved_embedded_item_length LESS exe_dotapp_dir_length)
835
+ set(path_too_short 1)
836
+ endif()
837
+ if(NOT path_too_short)
838
+ string(SUBSTRING "${resolved_embedded_item}" 0 ${exe_dotapp_dir_length} item_substring)
839
+ if("${exe_dotapp_dir}/" STREQUAL item_substring)
840
+ set(is_embedded 1)
841
+ endif()
842
+ endif()
843
+ if(NOT is_embedded)
844
+ message(" exe_dotapp_dir/='${exe_dotapp_dir}/'")
845
+ message(" item_substring='${item_substring}'")
846
+ message(" resolved_embedded_item='${resolved_embedded_item}'")
847
+ message("")
848
+ message("Install or copy the item into the bundle before calling fixup_bundle.")
849
+ message("Or maybe there's a typo or incorrect path in one of the args to fixup_bundle?")
850
+ message("")
851
+ message(FATAL_ERROR "cannot fixup an item that is not in the bundle...")
852
+ endif()
853
+
854
+ set(rpaths "${${ikey}_RPATHS}" "${${ikey}_RDEP_RPATHS}")
855
+
856
+ set(prereqs "")
857
+ get_prerequisites("${resolved_embedded_item}" prereqs 1 0 "${exepath}" "${dirs}" "${rpaths}")
858
+
859
+ set(changes "")
860
+
861
+ foreach(pr ${prereqs})
862
+ # Each referenced item's key is "rkey" in the loop:
863
+ #
864
+ get_item_key("${pr}" rkey)
865
+
866
+ if(NOT "${${rkey}_EMBEDDED_ITEM}" STREQUAL "")
867
+ set(changes ${changes} "-change" "${pr}" "${${rkey}_EMBEDDED_ITEM}")
868
+ else()
869
+ message("warning: unexpected reference to '${pr}'")
870
+ endif()
871
+ endforeach()
872
+
873
+ # CMAKE_INSTALL_NAME_TOOL may not be set if executed in script mode
874
+ # Duplicated from CMakeFindBinUtils.cmake
875
+ find_program(CMAKE_INSTALL_NAME_TOOL NAMES install_name_tool HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
876
+
877
+ # Only if install_name_tool supports -delete_rpath:
878
+ #
879
+ execute_process(COMMAND ${CMAKE_INSTALL_NAME_TOOL}
880
+ OUTPUT_VARIABLE install_name_tool_usage
881
+ ERROR_VARIABLE install_name_tool_usage
882
+ )
883
+ if(install_name_tool_usage MATCHES ".*-delete_rpath.*")
884
+ foreach(rpath ${${ikey}_RPATHS})
885
+ set(changes ${changes} -delete_rpath "${rpath}")
886
+ endforeach()
887
+ endif()
888
+
889
+ if(${ikey}_EMBEDDED_ITEM)
890
+ set(changes ${changes} -id "${${ikey}_EMBEDDED_ITEM}")
891
+ endif()
892
+
893
+ # Change this item's id and all of its references in one call
894
+ # to install_name_tool:
895
+ #
896
+ if(changes)
897
+ # Check for a script by extension (.bat,.sh,...) or if the file starts with "#!" (shebang)
898
+ file(READ ${resolved_embedded_item} file_contents LIMIT 5)
899
+ if(NOT "${resolved_embedded_item}" MATCHES "\\.(bat|c?sh|bash|ksh|cmd)$" AND
900
+ NOT file_contents MATCHES "^#!")
901
+ set(cmd ${CMAKE_INSTALL_NAME_TOOL} ${changes} "${resolved_embedded_item}")
902
+ if(BU_CHMOD_BUNDLE_ITEMS)
903
+ execute_process(COMMAND chmod u+w "${resolved_embedded_item}")
904
+ endif()
905
+ execute_process(COMMAND ${cmd} RESULT_VARIABLE install_name_tool_result)
906
+ if(NOT install_name_tool_result EQUAL 0)
907
+ string(REPLACE ";" "' '" msg "'${cmd}'")
908
+ message(FATAL_ERROR "Command failed:\n ${msg}")
909
+ endif()
910
+ endif()
911
+ endif()
912
+ endfunction()
913
+
914
+
915
+ function(fixup_bundle app libs dirs)
916
+ message(STATUS "fixup_bundle")
917
+ message(STATUS " app='${app}'")
918
+ message(STATUS " libs='${libs}'")
919
+ message(STATUS " dirs='${dirs}'")
920
+
921
+ set(options)
922
+ set(oneValueArgs)
923
+ set(multiValueArgs IGNORE_ITEM)
924
+ cmake_parse_arguments(CFG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
925
+
926
+ message(STATUS " ignoreItems='${CFG_IGNORE_ITEM}'")
927
+
928
+ get_bundle_and_executable("${app}" bundle executable valid)
929
+ if(valid)
930
+ get_filename_component(exepath "${executable}" PATH)
931
+
932
+ message(STATUS "fixup_bundle: preparing...")
933
+ get_bundle_keys("${app}" "${libs}" "${dirs}" keys IGNORE_ITEM "${CFG_IGNORE_ITEM}")
934
+
935
+ message(STATUS "fixup_bundle: copying...")
936
+ list(LENGTH keys n)
937
+ math(EXPR n ${n}*2)
938
+
939
+ set(i 0)
940
+ foreach(key ${keys})
941
+ math(EXPR i ${i}+1)
942
+ if("${${key}_COPYFLAG}" STREQUAL "2")
943
+ message(STATUS "${i}/${n}: linking '${${key}_RESOLVED_ITEM}' -> '${${key}_RESOLVED_EMBEDDED_ITEM}'")
944
+ elseif(${${key}_COPYFLAG})
945
+ message(STATUS "${i}/${n}: copying '${${key}_RESOLVED_ITEM}'")
946
+ else()
947
+ message(STATUS "${i}/${n}: *NOT* copying '${${key}_RESOLVED_ITEM}'")
948
+ endif()
949
+
950
+ set(show_status 0)
951
+ if(show_status)
952
+ message(STATUS "key='${key}'")
953
+ message(STATUS "item='${${key}_ITEM}'")
954
+ message(STATUS "resolved_item='${${key}_RESOLVED_ITEM}'")
955
+ message(STATUS "default_embedded_path='${${key}_DEFAULT_EMBEDDED_PATH}'")
956
+ message(STATUS "embedded_item='${${key}_EMBEDDED_ITEM}'")
957
+ message(STATUS "resolved_embedded_item='${${key}_RESOLVED_EMBEDDED_ITEM}'")
958
+ message(STATUS "copyflag='${${key}_COPYFLAG}'")
959
+ message(STATUS "")
960
+ endif()
961
+
962
+ if("${${key}_COPYFLAG}" STREQUAL "2")
963
+ link_resolved_item_into_bundle("${${key}_RESOLVED_ITEM}"
964
+ "${${key}_RESOLVED_EMBEDDED_ITEM}")
965
+ elseif(${${key}_COPYFLAG})
966
+ set(item "${${key}_ITEM}")
967
+ if(item MATCHES "[^/]+\\.framework/")
968
+ copy_resolved_framework_into_bundle("${${key}_RESOLVED_ITEM}"
969
+ "${${key}_RESOLVED_EMBEDDED_ITEM}")
970
+ else()
971
+ copy_resolved_item_into_bundle("${${key}_RESOLVED_ITEM}"
972
+ "${${key}_RESOLVED_EMBEDDED_ITEM}")
973
+ endif()
974
+ endif()
975
+ endforeach()
976
+
977
+ message(STATUS "fixup_bundle: fixing...")
978
+ foreach(key ${keys})
979
+ math(EXPR i ${i}+1)
980
+ if(APPLE)
981
+ message(STATUS "${i}/${n}: fixing up '${${key}_RESOLVED_EMBEDDED_ITEM}'")
982
+ if(NOT "${${key}_COPYFLAG}" STREQUAL "2")
983
+ fixup_bundle_item("${${key}_RESOLVED_EMBEDDED_ITEM}" "${exepath}" "${dirs}")
984
+ endif()
985
+ else()
986
+ message(STATUS "${i}/${n}: fix-up not required on this platform '${${key}_RESOLVED_EMBEDDED_ITEM}'")
987
+ endif()
988
+ endforeach()
989
+
990
+ message(STATUS "fixup_bundle: cleaning up...")
991
+ clear_bundle_keys(keys)
992
+
993
+ message(STATUS "fixup_bundle: verifying...")
994
+ verify_app("${app}" IGNORE_ITEM "${CFG_IGNORE_ITEM}")
995
+ else()
996
+ message(SEND_ERROR "error: fixup_bundle: not a valid bundle")
997
+ endif()
998
+
999
+ message(STATUS "fixup_bundle: done")
1000
+ endfunction()
1001
+
1002
+
1003
+ function(copy_and_fixup_bundle src dst libs dirs)
1004
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${src}" "${dst}")
1005
+ fixup_bundle("${dst}" "${libs}" "${dirs}")
1006
+ endfunction()
1007
+
1008
+
1009
+ function(verify_bundle_prerequisites bundle result_var info_var)
1010
+ set(result 1)
1011
+ set(info "")
1012
+ set(count 0)
1013
+
1014
+ set(options)
1015
+ set(oneValueArgs)
1016
+ set(multiValueArgs IGNORE_ITEM)
1017
+ cmake_parse_arguments(CFG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
1018
+
1019
+ get_bundle_main_executable("${bundle}" main_bundle_exe)
1020
+
1021
+ get_bundle_all_executables("${bundle}" file_list)
1022
+ foreach(f ${file_list})
1023
+ get_filename_component(exepath "${f}" PATH)
1024
+ math(EXPR count "${count} + 1")
1025
+
1026
+ message(STATUS "executable file ${count}: ${f}")
1027
+
1028
+ set(prereqs "")
1029
+ get_filename_component(prereq_filename ${f} NAME)
1030
+
1031
+ if(NOT prereq_filename IN_LIST CFG_IGNORE_ITEM)
1032
+ get_item_rpaths(${f} _main_exe_rpaths)
1033
+ get_prerequisites("${f}" prereqs 1 1 "${exepath}" "${_main_exe_rpaths}")
1034
+
1035
+ # On the Mac,
1036
+ # "embedded" and "system" prerequisites are fine... anything else means
1037
+ # the bundle's prerequisites are not verified (i.e., the bundle is not
1038
+ # really "standalone")
1039
+ #
1040
+ # On Windows (and others? Linux/Unix/...?)
1041
+ # "local" and "system" prereqs are fine...
1042
+ #
1043
+
1044
+ set(external_prereqs "")
1045
+
1046
+ foreach(p ${prereqs})
1047
+ set(p_type "")
1048
+ gp_file_type("${f}" "${p}" p_type)
1049
+
1050
+ if(APPLE)
1051
+ if(NOT p_type STREQUAL "embedded" AND NOT p_type STREQUAL "system")
1052
+ set(external_prereqs ${external_prereqs} "${p}")
1053
+ endif()
1054
+ else()
1055
+ if(NOT p_type STREQUAL "local" AND NOT p_type STREQUAL "system")
1056
+ set(external_prereqs ${external_prereqs} "${p}")
1057
+ endif()
1058
+ endif()
1059
+ endforeach()
1060
+
1061
+ if(external_prereqs)
1062
+ # Found non-system/somehow-unacceptable prerequisites:
1063
+ set(result 0)
1064
+ set(info ${info} "external prerequisites found:\nf='${f}'\nexternal_prereqs='${external_prereqs}'\n")
1065
+ endif()
1066
+ else()
1067
+ message(STATUS "Ignoring file: ${prereq_filename}")
1068
+ endif()
1069
+ endforeach()
1070
+
1071
+ if(result)
1072
+ set(info "Verified ${count} executable files in '${bundle}'")
1073
+ endif()
1074
+
1075
+ set(${result_var} "${result}" PARENT_SCOPE)
1076
+ set(${info_var} "${info}" PARENT_SCOPE)
1077
+ endfunction()
1078
+
1079
+
1080
+ function(verify_bundle_symlinks bundle result_var info_var)
1081
+ set(result 1)
1082
+ set(info "")
1083
+ set(count 0)
1084
+
1085
+ # TODO: implement this function for real...
1086
+ # Right now, it is just a stub that verifies unconditionally...
1087
+
1088
+ set(${result_var} "${result}" PARENT_SCOPE)
1089
+ set(${info_var} "${info}" PARENT_SCOPE)
1090
+ endfunction()
1091
+
1092
+
1093
+ function(verify_app app)
1094
+ set(verified 0)
1095
+ set(info "")
1096
+
1097
+ set(options)
1098
+ set(oneValueArgs)
1099
+ set(multiValueArgs IGNORE_ITEM)
1100
+ cmake_parse_arguments(CFG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
1101
+
1102
+ get_bundle_and_executable("${app}" bundle executable valid)
1103
+
1104
+ message(STATUS "===========================================================================")
1105
+ message(STATUS "Analyzing app='${app}'")
1106
+ message(STATUS "bundle='${bundle}'")
1107
+ message(STATUS "executable='${executable}'")
1108
+ message(STATUS "valid='${valid}'")
1109
+
1110
+ # Verify that the bundle does not have any "external" prerequisites:
1111
+ #
1112
+ verify_bundle_prerequisites("${bundle}" verified info IGNORE_ITEM "${CFG_IGNORE_ITEM}")
1113
+ message(STATUS "verified='${verified}'")
1114
+ message(STATUS "info='${info}'")
1115
+ message(STATUS "")
1116
+
1117
+ if(verified)
1118
+ # Verify that the bundle does not have any symlinks to external files:
1119
+ #
1120
+ verify_bundle_symlinks("${bundle}" verified info)
1121
+ message(STATUS "verified='${verified}'")
1122
+ message(STATUS "info='${info}'")
1123
+ message(STATUS "")
1124
+ endif()
1125
+
1126
+ if(NOT verified)
1127
+ message(FATAL_ERROR "error: verify_app failed")
1128
+ endif()
1129
+ endfunction()
1130
+
1131
+ cmake_policy(POP)
cmake/share/cmake-3.31/Modules/CMakeCSharpCompiler.cmake.in ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ set(CMAKE_CSharp_COMPILER "@CMAKE_CSharp_COMPILER@")
2
+ set(CMAKE_CSharp_COMPILER_ID "@CMAKE_CSharp_COMPILER_ID@")
3
+ set(CMAKE_CSharp_COMPILER_VERSION "@CMAKE_CSharp_COMPILER_VERSION@")
4
+
5
+ set(CMAKE_CSharp_COMPILER_LOADED 1)
6
+ set(CMAKE_CSharp_COMPILER_WORKS "@CMAKE_CSharp_COMPILER_WORKS@")
7
+
8
+ set(CMAKE_CSharp_COMPILER_ID_RUN "@CMAKE_CSharp_COMPILER_ID_RUN@")
9
+ set(CMAKE_CSharp_IGNORE_EXTENSIONS "inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC")
10
+ set(CMAKE_CSharp_SOURCE_FILE_EXTENSIONS "cs")
cmake/share/cmake-3.31/Modules/CMakeCSharpCompilerId.cs.in ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ using System;
2
+
3
+ namespace CSharp
4
+ {
5
+ public class CSharpApp
6
+ {
7
+ const string InfoCompiler = "INFO:compiler[Microsoft "
8
+ #if PlatformToolsetv100
9
+ + "Visual Studio"
10
+ #elif PlatformToolsetv110
11
+ + "Visual Studio"
12
+ #elif PlatformToolsetv120
13
+ + "Visual Studio"
14
+ #elif PlatformToolsetv140
15
+ + "Visual Studio"
16
+ #elif PlatformToolsetv141
17
+ + "Visual Studio"
18
+ #elif PlatformToolsetv142
19
+ + "Visual Studio"
20
+ #elif PlatformToolsetv143
21
+ + "Visual Studio"
22
+ #else
23
+ + "unknown"
24
+ #endif
25
+ + "]";
26
+
27
+ const string InfoPlatform = "INFO:platform[Windows]";
28
+
29
+ const string InfoArchitecture = "INFO:arch["
30
+ #if Platformx64
31
+ + "x64"
32
+ #elif Platformx86
33
+ + "x86"
34
+ #elif PlatformxWin32
35
+ + "Win32]"
36
+ #else
37
+ + "unknown"
38
+ #endif
39
+ + "]";
40
+
41
+ const string InfoCompilerVersion = "INFO:compiler_version["
42
+ #if PlatformToolsetv100
43
+ + "2010"
44
+ #elif PlatformToolsetv110
45
+ + "2012"
46
+ #elif PlatformToolsetv120
47
+ + "2013"
48
+ #elif PlatformToolsetv140
49
+ + "2015"
50
+ #elif PlatformToolsetv141
51
+ + "2017"
52
+ #elif PlatformToolsetv142
53
+ + "2019"
54
+ #elif PlatformToolsetv143
55
+ + "2022"
56
+ #else
57
+ + "9999"
58
+ #endif
59
+ + "]";
60
+
61
+ static void Main(string[] args)
62
+ {
63
+ // we have to print the lines to make sure
64
+ // the compiler does not optimize them away ...
65
+ System.Console.WriteLine(InfoCompiler);
66
+ System.Console.WriteLine(InfoPlatform);
67
+ System.Console.WriteLine(InfoArchitecture);
68
+ System.Console.WriteLine(InfoCompilerVersion);
69
+ }
70
+ }
71
+ }
cmake/share/cmake-3.31/Modules/CMakeCSharpInformation.cmake ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
+ # file Copyright.txt or https://cmake.org/licensing for details.
3
+
4
+ # This file sets the basic flags for the C# language in CMake.
5
+ # It also loads the available platform file for the system-compiler
6
+ # if it exists.
7
+
8
+ set(CMAKE_BASE_NAME)
9
+ get_filename_component(CMAKE_BASE_NAME "${CMAKE_CSharp_COMPILER}" NAME_WE)
10
+
11
+ set(CMAKE_BUILD_TYPE_INIT Debug)
12
+
13
+ set(CMAKE_CSharp_FLAGS_INIT "/define:TRACE")
14
+ set(CMAKE_CSharp_FLAGS_DEBUG_INIT "/debug:full /optimize- /warn:3 /errorreport:prompt /define:DEBUG")
15
+ set(CMAKE_CSharp_FLAGS_RELEASE_INIT "/debug:none /optimize /warn:1 /errorreport:queue")
16
+ set(CMAKE_CSharp_FLAGS_RELWITHDEBINFO_INIT "/debug:full /optimize-")
17
+ set(CMAKE_CSharp_FLAGS_MINSIZEREL_INIT "/debug:none /optimize")
18
+ set(CMAKE_CSharp_LINKER_SUPPORTS_PDB ON)
19
+
20
+ set(CMAKE_CSharp_STANDARD_LIBRARIES_INIT "System")
21
+
22
+ if(CMAKE_SIZEOF_VOID_P EQUAL 4)
23
+ set(CMAKE_CSharp_FLAGS_INIT "/platform:x86 ${CMAKE_CSharp_FLAGS_INIT}")
24
+ else()
25
+ set(CMAKE_CSharp_FLAGS_INIT "/platform:x64 ${CMAKE_CSharp_FLAGS_INIT}")
26
+ endif()
27
+
28
+ # This should be included before the _INIT variables are
29
+ # used to initialize the cache. Since the rule variables
30
+ # have if blocks on them, users can still define them here.
31
+ # But, it should still be after the platform file so changes can
32
+ # be made to those values.
33
+
34
+ # for most systems a module is the same as a shared library
35
+ # so unless the variable CMAKE_MODULE_EXISTS is set just
36
+ # copy the values from the LIBRARY variables
37
+ if(NOT CMAKE_MODULE_EXISTS)
38
+ set(CMAKE_SHARED_MODULE_CSharp_FLAGS ${CMAKE_SHARED_LIBRARY_CSharp_FLAGS})
39
+ set(CMAKE_SHARED_MODULE_CREATE_CSharp_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_CSharp_FLAGS})
40
+ endif()
41
+
42
+ # add the flags to the cache based
43
+ # on the initial values computed in the platform/*.cmake files
44
+ # use _INIT variables so that this only happens the first time
45
+ # and you can set these flags in the cmake cache
46
+ set(CMAKE_CSharp_FLAGS_INIT "$ENV{CSFLAGS} ${CMAKE_CSharp_FLAGS_INIT}")
47
+
48
+ cmake_initialize_per_config_variable(CMAKE_CSharp_FLAGS "Flags used by the C# compiler")
49
+
50
+ if(CMAKE_CSharp_STANDARD_LIBRARIES_INIT)
51
+ set(CMAKE_CSharp_STANDARD_LIBRARIES "${CMAKE_CSharp_STANDARD_LIBRARIES_INIT}"
52
+ CACHE STRING "Libraries linked by default with all C# applications.")
53
+ mark_as_advanced(CMAKE_CSharp_STANDARD_LIBRARIES)
54
+ endif()
55
+
56
+ # set missing flags (if they are not defined). This is needed in the
57
+ # unlikely case that you have only C# and no C/C++ targets in your
58
+ # project.
59
+ cmake_initialize_per_config_variable(CMAKE_EXE_LINKER_FLAGS "Flags used by the linker")
60
+ cmake_initialize_per_config_variable(CMAKE_SHARED_LINKER_FLAGS "Flags used by the linker during the creation of shared libraries")
61
+
62
+ set(CMAKE_CSharp_CREATE_SHARED_LIBRARY "CSharp_NO_CREATE_SHARED_LIBRARY")
63
+ set(CMAKE_CSharp_CREATE_SHARED_MODULE "CSharp_NO_CREATE_SHARED_MODULE")
64
+ set(CMAKE_CSharp_LINK_EXECUTABLE "CSharp_NO_LINK_EXECUTABLE")
65
+
66
+ set(CMAKE_CSharp_USE_RESPONSE_FILE_FOR_OBJECTS 1)
67
+
68
+ set(CMAKE_CSharp_USE_LINKER_INFORMATION FALSE)
69
+
70
+ set(CMAKE_CSharp_INFORMATION_LOADED 1)
cmake/share/cmake-3.31/Modules/CMakeCUDACompiler.cmake.in ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ set(CMAKE_CUDA_COMPILER "@CMAKE_CUDA_COMPILER@")
2
+ set(CMAKE_CUDA_HOST_COMPILER "@CMAKE_CUDA_HOST_COMPILER@")
3
+ set(CMAKE_CUDA_HOST_LINK_LAUNCHER "@CMAKE_CUDA_HOST_LINK_LAUNCHER@")
4
+ set(CMAKE_CUDA_COMPILER_ID "@CMAKE_CUDA_COMPILER_ID@")
5
+ set(CMAKE_CUDA_COMPILER_VERSION "@CMAKE_CUDA_COMPILER_VERSION@")
6
+ set(CMAKE_CUDA_HOST_COMPILER_ID "@CMAKE_CUDA_HOST_COMPILER_ID@")
7
+ set(CMAKE_CUDA_HOST_COMPILER_VERSION "@CMAKE_CUDA_HOST_COMPILER_VERSION@")
8
+ set(CMAKE_CUDA_DEVICE_LINKER "@CMAKE_CUDA_DEVICE_LINKER@")
9
+ set(CMAKE_CUDA_FATBINARY "@CMAKE_CUDA_FATBINARY@")
10
+ set(CMAKE_CUDA_STANDARD_COMPUTED_DEFAULT "@CMAKE_CUDA_STANDARD_COMPUTED_DEFAULT@")
11
+ set(CMAKE_CUDA_EXTENSIONS_COMPUTED_DEFAULT "@CMAKE_CUDA_EXTENSIONS_COMPUTED_DEFAULT@")
12
+ set(CMAKE_CUDA_STANDARD_LATEST "@CMAKE_CUDA_STANDARD_LATEST@")
13
+ set(CMAKE_CUDA_COMPILE_FEATURES "@CMAKE_CUDA_COMPILE_FEATURES@")
14
+ set(CMAKE_CUDA03_COMPILE_FEATURES "@CMAKE_CUDA03_COMPILE_FEATURES@")
15
+ set(CMAKE_CUDA11_COMPILE_FEATURES "@CMAKE_CUDA11_COMPILE_FEATURES@")
16
+ set(CMAKE_CUDA14_COMPILE_FEATURES "@CMAKE_CUDA14_COMPILE_FEATURES@")
17
+ set(CMAKE_CUDA17_COMPILE_FEATURES "@CMAKE_CUDA17_COMPILE_FEATURES@")
18
+ set(CMAKE_CUDA20_COMPILE_FEATURES "@CMAKE_CUDA20_COMPILE_FEATURES@")
19
+ set(CMAKE_CUDA23_COMPILE_FEATURES "@CMAKE_CUDA23_COMPILE_FEATURES@")
20
+ set(CMAKE_CUDA26_COMPILE_FEATURES "@CMAKE_CUDA26_COMPILE_FEATURES@")
21
+
22
+ set(CMAKE_CUDA_PLATFORM_ID "@CMAKE_CUDA_PLATFORM_ID@")
23
+ set(CMAKE_CUDA_SIMULATE_ID "@CMAKE_CUDA_SIMULATE_ID@")
24
+ set(CMAKE_CUDA_COMPILER_FRONTEND_VARIANT "@CMAKE_CUDA_COMPILER_FRONTEND_VARIANT@")
25
+ set(CMAKE_CUDA_SIMULATE_VERSION "@CMAKE_CUDA_SIMULATE_VERSION@")
26
+ @SET_MSVC_CUDA_ARCHITECTURE_ID@
27
+ @_SET_CMAKE_CUDA_COMPILER_SYSROOT@
28
+
29
+ set(CMAKE_CUDA_COMPILER_ENV_VAR "CUDACXX")
30
+ set(CMAKE_CUDA_HOST_COMPILER_ENV_VAR "CUDAHOSTCXX")
31
+
32
+ set(CMAKE_CUDA_COMPILER_LOADED 1)
33
+ set(CMAKE_CUDA_COMPILER_ID_RUN 1)
34
+ set(CMAKE_CUDA_SOURCE_FILE_EXTENSIONS cu)
35
+ set(CMAKE_CUDA_LINKER_PREFERENCE 15)
36
+ set(CMAKE_CUDA_LINKER_PREFERENCE_PROPAGATES 1)
37
+ set(CMAKE_CUDA_LINKER_DEPFILE_SUPPORTED @CMAKE_CUDA_LINKER_DEPFILE_SUPPORTED@)
38
+
39
+ set(CMAKE_CUDA_SIZEOF_DATA_PTR "@CMAKE_CUDA_SIZEOF_DATA_PTR@")
40
+ set(CMAKE_CUDA_COMPILER_ABI "@CMAKE_CUDA_COMPILER_ABI@")
41
+ set(CMAKE_CUDA_BYTE_ORDER "@CMAKE_CUDA_BYTE_ORDER@")
42
+ set(CMAKE_CUDA_LIBRARY_ARCHITECTURE "@CMAKE_CUDA_LIBRARY_ARCHITECTURE@")
43
+
44
+ if(CMAKE_CUDA_SIZEOF_DATA_PTR)
45
+ set(CMAKE_SIZEOF_VOID_P "${CMAKE_CUDA_SIZEOF_DATA_PTR}")
46
+ endif()
47
+
48
+ if(CMAKE_CUDA_COMPILER_ABI)
49
+ set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CUDA_COMPILER_ABI}")
50
+ endif()
51
+
52
+ if(CMAKE_CUDA_LIBRARY_ARCHITECTURE)
53
+ set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_CUDA_LIBRARY_ARCHITECTURE@")
54
+ endif()
55
+
56
+ set(CMAKE_CUDA_COMPILER_TOOLKIT_ROOT "@CMAKE_CUDA_COMPILER_TOOLKIT_ROOT@")
57
+ set(CMAKE_CUDA_COMPILER_TOOLKIT_LIBRARY_ROOT "@CMAKE_CUDA_COMPILER_TOOLKIT_LIBRARY_ROOT@")
58
+ set(CMAKE_CUDA_COMPILER_TOOLKIT_VERSION "@CMAKE_CUDA_COMPILER_TOOLKIT_VERSION@")
59
+ set(CMAKE_CUDA_COMPILER_LIBRARY_ROOT "@CMAKE_CUDA_COMPILER_LIBRARY_ROOT@")
60
+
61
+ set(CMAKE_CUDA_ARCHITECTURES_ALL "@CMAKE_CUDA_ARCHITECTURES_ALL@")
62
+ set(CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR "@CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR@")
63
+ set(CMAKE_CUDA_ARCHITECTURES_NATIVE "@CMAKE_CUDA_ARCHITECTURES_NATIVE@")
64
+
65
+ set(CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES "@CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES@")
66
+
67
+ set(CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES "@CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES@")
68
+ set(CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES "@CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES@")
69
+ set(CMAKE_CUDA_HOST_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_CUDA_HOST_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")
70
+
71
+ set(CMAKE_CUDA_IMPLICIT_INCLUDE_DIRECTORIES "@CMAKE_CUDA_IMPLICIT_INCLUDE_DIRECTORIES@")
72
+ set(CMAKE_CUDA_IMPLICIT_LINK_LIBRARIES "@CMAKE_CUDA_IMPLICIT_LINK_LIBRARIES@")
73
+ set(CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES "@CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES@")
74
+ set(CMAKE_CUDA_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_CUDA_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")
75
+
76
+ @_SET_CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT@
77
+
78
+ set(CMAKE_LINKER "@CMAKE_LINKER@")
79
+ set(CMAKE_LINKER_LINK "@CMAKE_LINKER_LINK@")
80
+ set(CMAKE_LINKER_LLD "@CMAKE_LINKER_LLD@")
81
+ set(CMAKE_CUDA_COMPILER_LINKER "@CMAKE_CUDA_COMPILER_LINKER@")
82
+ set(CMAKE_CUDA_COMPILER_LINKER_ID "@CMAKE_CUDA_COMPILER_LINKER_ID@")
83
+ set(CMAKE_CUDA_COMPILER_LINKER_VERSION @CMAKE_CUDA_COMPILER_LINKER_VERSION@)
84
+ set(CMAKE_CUDA_COMPILER_LINKER_FRONTEND_VARIANT @CMAKE_CUDA_COMPILER_LINKER_FRONTEND_VARIANT@)
85
+ set(CMAKE_AR "@CMAKE_AR@")
86
+ set(CMAKE_RANLIB "@CMAKE_RANLIB@")
87
+ set(CMAKE_MT "@CMAKE_MT@")
cmake/share/cmake-3.31/Modules/CMakeCUDACompilerABI.cu ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef __CUDACC__
2
+ # error "A C or C++ compiler has been selected for CUDA"
3
+ #endif
4
+
5
+ #include "CMakeCompilerABI.h"
6
+ #include "CMakeCompilerCUDAArch.h"
7
+
8
+ int main(int argc, char* argv[])
9
+ {
10
+ int require = 0;
11
+ require += info_sizeof_dptr[argc];
12
+ require += info_byte_order_big_endian[argc];
13
+ require += info_byte_order_little_endian[argc];
14
+ #if defined(ABI_ID)
15
+ require += info_abi[argc];
16
+ #endif
17
+ static_cast<void>(argv);
18
+
19
+ if (!cmakeCompilerCUDAArch()) {
20
+ // Convince the compiler that the non-zero return value depends
21
+ // on the info strings so they are not optimized out.
22
+ return require ? -1 : 1;
23
+ }
24
+
25
+ return 0;
26
+ }
cmake/share/cmake-3.31/Modules/CMakeCUDACompilerId.cu.in ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef __CUDACC__
2
+ # error "A C or C++ compiler has been selected for CUDA"
3
+ #endif
4
+
5
+ @CMAKE_CUDA_COMPILER_ID_CONTENT@
6
+
7
+ /* Construct the string literal in pieces to prevent the source from
8
+ getting matched. Store it in a pointer rather than an array
9
+ because some compilers will just produce instructions to fill the
10
+ array rather than assigning a pointer to a static array. */
11
+ char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
12
+ #ifdef SIMULATE_ID
13
+ char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
14
+ #endif
15
+
16
+ @CMAKE_CUDA_COMPILER_ID_PLATFORM_CONTENT@
17
+ @CMAKE_CUDA_COMPILER_ID_ERROR_FOR_TEST@
18
+
19
+ #ifdef HOST_COMPILER_ID
20
+ char const* info_host_compiler = "INFO" ":" "host_compiler[" HOST_COMPILER_ID "]";
21
+ #endif
22
+ #ifdef HOST_COMPILER_VERSION
23
+ char const* info_host_compiler_version = "INFO" ":" "host_compiler_version[" HOST_COMPILER_VERSION "]";
24
+ #elif defined(HOST_COMPILER_VERSION_MAJOR)
25
+ char const info_host_compiler_version[] = {
26
+ 'I', 'N', 'F', 'O', ':','h','o','s','t','_',
27
+ 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
28
+ HOST_COMPILER_VERSION_MAJOR,
29
+ # ifdef HOST_COMPILER_VERSION_MINOR
30
+ '.', HOST_COMPILER_VERSION_MINOR,
31
+ # ifdef HOST_COMPILER_VERSION_PATCH
32
+ '.', HOST_COMPILER_VERSION_PATCH,
33
+ # ifdef HOST_COMPILER_VERSION_TWEAK
34
+ '.', HOST_COMPILER_VERSION_TWEAK,
35
+ # endif
36
+ # endif
37
+ # endif
38
+ ']','\0'};
39
+ #endif
40
+
41
+ #define CXX_STD_11 201103L
42
+ #define CXX_STD_14 201402L
43
+ #define CXX_STD_17 201703L
44
+ #define CXX_STD_20 202002L
45
+ #define CXX_STD_23 202302L
46
+
47
+ #if defined(_MSC_VER) && defined(_MSVC_LANG)
48
+ # if _MSVC_LANG > __cplusplus
49
+ # define CXX_STD _MSVC_LANG
50
+ # else
51
+ # define CXX_STD __cplusplus
52
+ # endif
53
+ #else
54
+ # define CXX_STD __cplusplus
55
+ #endif
56
+
57
+ const char* info_language_standard_default = "INFO" ":" "standard_default["
58
+ #if CXX_STD > CXX_STD_23
59
+ "26"
60
+ #elif CXX_STD > CXX_STD_20
61
+ "23"
62
+ #elif CXX_STD > CXX_STD_17
63
+ "20"
64
+ #elif CXX_STD > CXX_STD_14
65
+ "17"
66
+ #elif CXX_STD > CXX_STD_11
67
+ "14"
68
+ #elif CXX_STD >= CXX_STD_11
69
+ "11"
70
+ #else
71
+ "03"
72
+ #endif
73
+ "]";
74
+
75
+ const char* info_language_extensions_default = "INFO" ":" "extensions_default["
76
+ #if (defined(__clang__) || defined(__GNUC__)) && \
77
+ !defined(__STRICT_ANSI__)
78
+ "ON"
79
+ #else
80
+ "OFF"
81
+ #endif
82
+ "]";
83
+
84
+ /*--------------------------------------------------------------------------*/
85
+
86
+ int main(int argc, char* argv[])
87
+ {
88
+ int require = 0;
89
+ require += info_compiler[argc];
90
+ require += info_platform[argc];
91
+ #ifdef COMPILER_VERSION_MAJOR
92
+ require += info_version[argc];
93
+ #endif
94
+ #ifdef SIMULATE_ID
95
+ require += info_simulate[argc];
96
+ #endif
97
+ #ifdef SIMULATE_VERSION_MAJOR
98
+ require += info_simulate_version[argc];
99
+ #endif
100
+ #ifdef HOST_COMPILER_ID
101
+ require += info_host_compiler[argc];
102
+ #endif
103
+ #ifdef HOST_COMPILER_VERSION_MAJOR
104
+ require += info_host_compiler_version[argc];
105
+ #endif
106
+ require += info_language_standard_default[argc];
107
+ require += info_language_extensions_default[argc];
108
+ (void)argv;
109
+ return require;
110
+ }
cmake/share/cmake-3.31/Modules/CMakeCUDAInformation.cmake ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
+ # file Copyright.txt or https://cmake.org/licensing for details.
3
+
4
+ if(UNIX)
5
+ set(CMAKE_CUDA_OUTPUT_EXTENSION .o)
6
+ else()
7
+ set(CMAKE_CUDA_OUTPUT_EXTENSION .obj)
8
+ endif()
9
+ set(CMAKE_INCLUDE_FLAG_CUDA "-I")
10
+
11
+ # Set implicit links early so compiler-specific modules can use them.
12
+ set(__IMPLICIT_LINKS)
13
+ foreach(dir ${CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES})
14
+ string(APPEND __IMPLICIT_LINKS " -L\"${dir}\"")
15
+ endforeach()
16
+ foreach(lib ${CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES})
17
+ if(${lib} MATCHES "/")
18
+ string(APPEND __IMPLICIT_LINKS " \"${lib}\"")
19
+ else()
20
+ string(APPEND __IMPLICIT_LINKS " -l${lib}")
21
+ endif()
22
+ endforeach()
23
+
24
+ # Load compiler-specific information.
25
+ if(CMAKE_CUDA_COMPILER_ID)
26
+ include(Compiler/${CMAKE_CUDA_COMPILER_ID}-CUDA OPTIONAL)
27
+ endif()
28
+
29
+ # load the system- and compiler specific files
30
+ if(CMAKE_CUDA_COMPILER_ID)
31
+ # load a hardware specific file, mostly useful for embedded compilers
32
+ if(CMAKE_SYSTEM_PROCESSOR)
33
+ include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_CUDA_COMPILER_ID}-CUDA-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
34
+ endif()
35
+ include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_CUDA_COMPILER_ID}-CUDA OPTIONAL)
36
+ endif()
37
+
38
+
39
+ # This should be included before the _INIT variables are
40
+ # used to initialize the cache. Since the rule variables
41
+ # have if blocks on them, users can still define them here.
42
+ # But, it should still be after the platform file so changes can
43
+ # be made to those values.
44
+
45
+ if(CMAKE_USER_MAKE_RULES_OVERRIDE)
46
+ # Save the full path of the file so try_compile can use it.
47
+ include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
48
+ set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
49
+ endif()
50
+
51
+ if(CMAKE_USER_MAKE_RULES_OVERRIDE_CUDA)
52
+ # Save the full path of the file so try_compile can use it.
53
+ include(${CMAKE_USER_MAKE_RULES_OVERRIDE_CUDA} RESULT_VARIABLE _override)
54
+ set(CMAKE_USER_MAKE_RULES_OVERRIDE_CUDA "${_override}")
55
+ endif()
56
+
57
+
58
+
59
+ # add the flags to the cache based
60
+ # on the initial values computed in the platform/*.cmake files
61
+ # use _INIT variables so that this only happens the first time
62
+ # and you can set these flags in the cmake cache
63
+ set(CMAKE_CUDA_FLAGS_INIT "$ENV{CUDAFLAGS} ${CMAKE_CUDA_FLAGS_INIT}")
64
+
65
+ cmake_initialize_per_config_variable(CMAKE_CUDA_FLAGS "Flags used by the CUDA compiler")
66
+
67
+ if(CMAKE_CUDA_STANDARD_LIBRARIES_INIT)
68
+ set(CMAKE_CUDA_STANDARD_LIBRARIES "${CMAKE_CUDA_STANDARD_LIBRARIES_INIT}"
69
+ CACHE STRING "Libraries linked by default with all CUDA applications.")
70
+ mark_as_advanced(CMAKE_CUDA_STANDARD_LIBRARIES)
71
+ endif()
72
+
73
+ if(NOT CMAKE_CUDA_COMPILER_LAUNCHER AND DEFINED ENV{CMAKE_CUDA_COMPILER_LAUNCHER})
74
+ set(CMAKE_CUDA_COMPILER_LAUNCHER "$ENV{CMAKE_CUDA_COMPILER_LAUNCHER}"
75
+ CACHE STRING "Compiler launcher for CUDA.")
76
+ endif()
77
+
78
+ include(CMakeCommonLanguageInclude)
79
+ _cmake_common_language_platform_flags(CUDA)
80
+
81
+ # now define the following rules:
82
+ # CMAKE_CUDA_CREATE_SHARED_LIBRARY
83
+ # CMAKE_CUDA_CREATE_SHARED_MODULE
84
+ # CMAKE_CUDA_COMPILE_WHOLE_COMPILATION
85
+ # CMAKE_CUDA_COMPILE_SEPARABLE_COMPILATION
86
+ # CMAKE_CUDA_LINK_EXECUTABLE
87
+
88
+ # create a shared library
89
+ if(NOT CMAKE_CUDA_CREATE_SHARED_LIBRARY)
90
+ set(CMAKE_CUDA_CREATE_SHARED_LIBRARY
91
+ "<CMAKE_CUDA_HOST_LINK_LAUNCHER> <CMAKE_SHARED_LIBRARY_CUDA_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CUDA_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>${__IMPLICIT_LINKS}")
92
+ endif()
93
+
94
+ # create a shared module copy the shared library rule by default
95
+ if(NOT CMAKE_CUDA_CREATE_SHARED_MODULE)
96
+ set(CMAKE_CUDA_CREATE_SHARED_MODULE ${CMAKE_CUDA_CREATE_SHARED_LIBRARY})
97
+ endif()
98
+
99
+ # Create a static archive incrementally for large object file counts.
100
+ if(NOT DEFINED CMAKE_CUDA_ARCHIVE_CREATE)
101
+ set(CMAKE_CUDA_ARCHIVE_CREATE "<CMAKE_AR> qc <TARGET> <LINK_FLAGS> <OBJECTS>")
102
+ endif()
103
+ if(NOT DEFINED CMAKE_CUDA_ARCHIVE_APPEND)
104
+ set(CMAKE_CUDA_ARCHIVE_APPEND "<CMAKE_AR> q <TARGET> <LINK_FLAGS> <OBJECTS>")
105
+ endif()
106
+ if(NOT DEFINED CMAKE_CUDA_ARCHIVE_FINISH)
107
+ set(CMAKE_CUDA_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
108
+ endif()
109
+
110
+ if(NOT CMAKE_CUDA_COMPILE_OBJECT)
111
+ set(CMAKE_CUDA_COMPILE_OBJECT
112
+ "<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <DEFINES> <INCLUDES> <FLAGS> ${_CMAKE_COMPILE_AS_CUDA_FLAG} <CUDA_COMPILE_MODE> <SOURCE> -o <OBJECT>")
113
+ endif()
114
+
115
+ # compile a cu file into an executable
116
+ if(NOT CMAKE_CUDA_LINK_EXECUTABLE)
117
+ set(CMAKE_CUDA_LINK_EXECUTABLE
118
+ "<CMAKE_CUDA_HOST_LINK_LAUNCHER> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>${__IMPLICIT_LINKS}")
119
+ endif()
120
+
121
+ # Add implicit host link directories that contain device libraries
122
+ # to the device link line.
123
+ set(__IMPLICIT_DLINK_DIRS ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
124
+ if(__IMPLICIT_DLINK_DIRS)
125
+ list(REMOVE_ITEM __IMPLICIT_DLINK_DIRS ${CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES})
126
+ endif()
127
+ set(__IMPLICIT_DLINK_FLAGS)
128
+ foreach(dir ${__IMPLICIT_DLINK_DIRS})
129
+ if(EXISTS "${dir}/libcurand_static.a")
130
+ string(APPEND __IMPLICIT_DLINK_FLAGS " -L\"${dir}\"")
131
+ endif()
132
+ endforeach()
133
+ unset(__IMPLICIT_DLINK_DIRS)
134
+
135
+
136
+ #These are used when linking relocatable (dc) cuda code
137
+ if(NOT CMAKE_CUDA_DEVICE_LINK_LIBRARY)
138
+ set(CMAKE_CUDA_DEVICE_LINK_LIBRARY
139
+ "<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES>${__IMPLICIT_DLINK_FLAGS}")
140
+ endif()
141
+ if(NOT CMAKE_CUDA_DEVICE_LINK_EXECUTABLE)
142
+ set(CMAKE_CUDA_DEVICE_LINK_EXECUTABLE
143
+ "<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES>${__IMPLICIT_DLINK_FLAGS}")
144
+ endif()
145
+
146
+ # Used when device linking is handled by CMake.
147
+ if(NOT CMAKE_CUDA_DEVICE_LINK_COMPILE)
148
+ set(CMAKE_CUDA_DEVICE_LINK_COMPILE "<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <FLAGS> <LINK_FLAGS> -D__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ -D__NV_EXTRA_INITIALIZATION=\"\" -D__NV_EXTRA_FINALIZATION=\"\" -DREGISTERLINKBINARYFILE=\\\"<REGISTER_FILE>\\\" -DFATBINFILE=\\\"<FATBINARY>\\\" ${_CMAKE_COMPILE_AS_CUDA_FLAG} -c \"${CMAKE_CUDA_COMPILER_TOOLKIT_LIBRARY_ROOT}/bin/crt/link.stub\" -o <OBJECT>")
149
+ endif()
150
+
151
+ unset(__IMPLICIT_DLINK_FLAGS)
152
+
153
+ set(CMAKE_CUDA_USE_LINKER_INFORMATION TRUE)
154
+
155
+ set(CMAKE_CUDA_INFORMATION_LOADED 1)
cmake/share/cmake-3.31/Modules/CMakeCXXCompilerABI.cpp ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef __cplusplus
2
+ # error "A C compiler has been selected for C++."
3
+ #endif
4
+
5
+ #include "CMakeCompilerABI.h"
6
+
7
+ int main(int argc, char* argv[])
8
+ {
9
+ int require = 0;
10
+ require += info_sizeof_dptr[argc];
11
+ require += info_byte_order_big_endian[argc];
12
+ require += info_byte_order_little_endian[argc];
13
+ #if defined(ABI_ID)
14
+ require += info_abi[argc];
15
+ #endif
16
+ (void)argv;
17
+ return require;
18
+ }
cmake/share/cmake-3.31/Modules/CMakeCompilerIdDetection.cmake ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
+ # file Copyright.txt or https://cmake.org/licensing for details.
3
+
4
+
5
+ function(_readFile file)
6
+ include(${file})
7
+ get_filename_component(name ${file} NAME_WE)
8
+ string(REGEX REPLACE "-.*" "" CompilerId ${name})
9
+ set(_compiler_id_version_compute_${CompilerId} ${_compiler_id_version_compute} PARENT_SCOPE)
10
+ set(_compiler_id_simulate_${CompilerId} ${_compiler_id_simulate} PARENT_SCOPE)
11
+ set(_compiler_id_pp_test_${CompilerId} ${_compiler_id_pp_test} PARENT_SCOPE)
12
+ endfunction()
13
+
14
+ function(compiler_id_detection outvar lang)
15
+
16
+ if (NOT "x${lang}" STREQUAL "xFortran" AND NOT "x${lang}" STREQUAL "xCSharp"
17
+ AND NOT "x${lang}" STREQUAL "xISPC")
18
+ file(GLOB lang_files
19
+ "${CMAKE_ROOT}/Modules/Compiler/*-DetermineCompiler.cmake")
20
+ set(nonlang CXX)
21
+ if ("x${lang}" STREQUAL "xCXX")
22
+ set(nonlang C)
23
+ endif()
24
+
25
+ file(GLOB nonlang_files
26
+ "${CMAKE_ROOT}/Modules/Compiler/*-${nonlang}-DetermineCompiler.cmake")
27
+ list(REMOVE_ITEM lang_files ${nonlang_files})
28
+ endif()
29
+
30
+ set(files ${lang_files})
31
+ if (files)
32
+ foreach(file ${files})
33
+ _readFile(${file})
34
+ endforeach()
35
+
36
+ set(options ID_STRING VERSION_STRINGS ID_DEFINE PLATFORM_DEFAULT_COMPILER)
37
+ set(oneValueArgs PREFIX)
38
+ cmake_parse_arguments(CID "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
39
+ if (CID_UNPARSED_ARGUMENTS)
40
+ message(FATAL_ERROR "Unrecognized arguments: \"${CID_UNPARSED_ARGUMENTS}\"")
41
+ endif()
42
+
43
+ # Order is relevant here. For example, compilers which pretend to be
44
+ # GCC must appear before the actual GCC.
45
+ list(APPEND ordered_compilers
46
+ Intel
47
+ IntelLLVM
48
+ PathScale
49
+ Embarcadero
50
+ Borland
51
+ Watcom
52
+ OpenWatcom
53
+ SunPro
54
+ HP
55
+ Compaq
56
+ zOS
57
+ IBMClang
58
+ XLClang
59
+ XL
60
+ VisualAge
61
+ NVHPC
62
+ PGI
63
+ CrayClang
64
+ Cray
65
+ TI
66
+ FujitsuClang
67
+ Fujitsu
68
+ GHS
69
+ Tasking
70
+ OrangeC
71
+ )
72
+ if ("x${lang}" STREQUAL "xC")
73
+ list(APPEND ordered_compilers
74
+ TinyCC
75
+ Bruce
76
+ )
77
+ endif()
78
+ list(APPEND ordered_compilers
79
+ SCO
80
+ ARMCC
81
+ AppleClang
82
+ ARMClang
83
+ TIClang
84
+ )
85
+ list(APPEND ordered_compilers
86
+ Clang
87
+ LCC
88
+ GNU
89
+ MSVC
90
+ ADSP
91
+ IAR
92
+ )
93
+ if ("x${lang}" STREQUAL "xC")
94
+ list(APPEND ordered_compilers
95
+ SDCC
96
+ )
97
+ endif()
98
+
99
+ if("x${lang}" STREQUAL "xCUDA")
100
+ set(ordered_compilers NVIDIA Clang)
101
+ endif()
102
+
103
+ if("x${lang}" STREQUAL "xHIP")
104
+ set(ordered_compilers NVIDIA Clang)
105
+ endif()
106
+
107
+ if(CID_ID_DEFINE)
108
+ foreach(Id ${ordered_compilers})
109
+ string(APPEND CMAKE_${lang}_COMPILER_ID_CONTENT "# define ${CID_PREFIX}COMPILER_IS_${Id} 0\n")
110
+ endforeach()
111
+ # Hard-code definitions for compilers that are no longer supported.
112
+ string(APPEND CMAKE_${lang}_COMPILER_ID_CONTENT "# define ${CID_PREFIX}COMPILER_IS_MIPSpro 0\n")
113
+ endif()
114
+
115
+ set(pp_if "#if")
116
+ if (CID_VERSION_STRINGS)
117
+ string(APPEND CMAKE_${lang}_COMPILER_ID_CONTENT "\n/* Version number components: V=Version, R=Revision, P=Patch
118
+ Version date components: YYYY=Year, MM=Month, DD=Day */\n")
119
+ endif()
120
+
121
+ foreach(Id ${ordered_compilers})
122
+ if (NOT _compiler_id_pp_test_${Id})
123
+ message(FATAL_ERROR "No preprocessor test for \"${Id}\"")
124
+ endif()
125
+ set(id_content "${pp_if} ${_compiler_id_pp_test_${Id}}\n")
126
+ if (CID_ID_STRING)
127
+ set(PREFIX ${CID_PREFIX})
128
+ string(CONFIGURE "${_compiler_id_simulate_${Id}}" SIMULATE_BLOCK @ONLY)
129
+ string(APPEND id_content "# define ${CID_PREFIX}COMPILER_ID \"${Id}\"${SIMULATE_BLOCK}")
130
+ endif()
131
+ if (CID_ID_DEFINE)
132
+ string(APPEND id_content "# undef ${CID_PREFIX}COMPILER_IS_${Id}\n")
133
+ string(APPEND id_content "# define ${CID_PREFIX}COMPILER_IS_${Id} 1\n")
134
+ endif()
135
+ if (CID_VERSION_STRINGS)
136
+ set(PREFIX ${CID_PREFIX})
137
+ set(MACRO_DEC DEC)
138
+ set(MACRO_HEX HEX)
139
+ string(CONFIGURE "${_compiler_id_version_compute_${Id}}" VERSION_BLOCK @ONLY)
140
+ string(APPEND id_content "${VERSION_BLOCK}\n")
141
+ endif()
142
+ string(APPEND CMAKE_${lang}_COMPILER_ID_CONTENT "\n${id_content}")
143
+ set(pp_if "#elif")
144
+ endforeach()
145
+
146
+ if (CID_PLATFORM_DEFAULT_COMPILER)
147
+ set(platform_compiler_detection "
148
+ /* These compilers are either not known or too old to define an
149
+ identification macro. Try to identify the platform and guess that
150
+ it is the native compiler. */
151
+ #elif defined(__hpux) || defined(__hpua)
152
+ # define ${CID_PREFIX}COMPILER_ID \"HP\"
153
+
154
+ #else /* unknown compiler */
155
+ # define ${CID_PREFIX}COMPILER_ID \"\"")
156
+ endif()
157
+
158
+ string(APPEND CMAKE_${lang}_COMPILER_ID_CONTENT "\n${platform_compiler_detection}\n#endif")
159
+ endif()
160
+
161
+ set(${outvar} ${CMAKE_${lang}_COMPILER_ID_CONTENT} PARENT_SCOPE)
162
+ endfunction()
cmake/share/cmake-3.31/Modules/CMakeConfigurableFile.in ADDED
@@ -0,0 +1 @@
 
 
1
+ @CMAKE_CONFIGURABLE_FILE_CONTENT@
cmake/share/cmake-3.31/Modules/CheckCCompilerFlag.cmake ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
+ # file Copyright.txt or https://cmake.org/licensing for details.
3
+
4
+ #[=======================================================================[.rst:
5
+ CheckCCompilerFlag
6
+ ------------------
7
+
8
+ Check once whether the C compiler supports a given flag.
9
+
10
+ .. command:: check_c_compiler_flag
11
+
12
+ .. code-block:: cmake
13
+
14
+ check_c_compiler_flag(<flag> <resultVar>)
15
+
16
+ Check once that the ``<flag>`` is accepted by the compiler without a diagnostic.
17
+ The result is stored in the internal cache variable specified by
18
+ ``<resultVar>``, with boolean ``true`` for success and boolean ``false`` for
19
+ failure.
20
+
21
+ ``true`` indicates only that the compiler did not issue a diagnostic message
22
+ when given the flag. Whether the flag has any effect is beyond the scope of
23
+ this module.
24
+
25
+ Internally, :command:`try_compile` is used to perform the check. If
26
+ :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` is set to ``EXECUTABLE`` (default),
27
+ the check compiles and links an executable program. If set to
28
+ ``STATIC_LIBRARY``, the check is compiled but not linked.
29
+
30
+ See also :command:`check_compiler_flag` for a more general command syntax.
31
+
32
+ The compile and link commands can be influenced by setting any of the
33
+ following variables prior to calling ``check_c_compiler_flag()``. Unknown flags
34
+ in these variables can case a false negative result.
35
+
36
+ .. include:: /module/CMAKE_REQUIRED_FLAGS.txt
37
+
38
+ .. include:: /module/CMAKE_REQUIRED_DEFINITIONS.txt
39
+
40
+ .. include:: /module/CMAKE_REQUIRED_INCLUDES.txt
41
+
42
+ .. include:: /module/CMAKE_REQUIRED_LINK_OPTIONS.txt
43
+
44
+ .. include:: /module/CMAKE_REQUIRED_LIBRARIES.txt
45
+
46
+ .. include:: /module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt
47
+
48
+ .. include:: /module/CMAKE_REQUIRED_QUIET.txt
49
+
50
+ #]=======================================================================]
51
+
52
+ include_guard(GLOBAL)
53
+ include(Internal/CheckCompilerFlag)
54
+
55
+ macro (CHECK_C_COMPILER_FLAG _FLAG _RESULT)
56
+ cmake_check_compiler_flag(C "${_FLAG}" ${_RESULT})
57
+ endmacro ()
58
+
59
+ # FIXME(#24994): The following module is included only for compatibility
60
+ # with projects that accidentally relied on it with CMake 3.26 and below.
61
+ include(CheckCSourceCompiles)
cmake/share/cmake-3.31/Modules/CheckCSourceCompiles.cmake ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
+ # file Copyright.txt or https://cmake.org/licensing for details.
3
+
4
+ #[=======================================================================[.rst:
5
+ CheckCSourceCompiles
6
+ --------------------
7
+
8
+ Check once if C source code can be built.
9
+
10
+ .. command:: check_c_source_compiles
11
+
12
+ .. code-block:: cmake
13
+
14
+ check_c_source_compiles(<code> <resultVar>
15
+ [FAIL_REGEX <regex1> [<regex2>...]])
16
+
17
+ Check once that the source supplied in ``<code>`` can be built. The result is
18
+ stored in the internal cache variable specified by ``<resultVar>``, with
19
+ boolean ``true`` for success and boolean ``false`` for failure.
20
+
21
+ If ``FAIL_REGEX`` is provided, then failure is determined by checking
22
+ if anything in the compiler output matches any of the specified regular
23
+ expressions.
24
+
25
+ Internally, :command:`try_compile` is used to compile the source. If
26
+ :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` is set to ``EXECUTABLE`` (default),
27
+ the source is compiled and linked as an executable program. If set to
28
+ ``STATIC_LIBRARY``, the source is compiled but not linked. In any case, all
29
+ functions must be declared as usual.
30
+
31
+ See also :command:`check_source_compiles` for a more general command syntax.
32
+
33
+ See also :command:`check_source_runs` to run compiled source.
34
+
35
+ The compile and link commands can be influenced by setting any of the
36
+ following variables prior to calling ``check_c_source_compiles()``:
37
+
38
+ .. include:: /module/CMAKE_REQUIRED_FLAGS.txt
39
+
40
+ .. include:: /module/CMAKE_REQUIRED_DEFINITIONS.txt
41
+
42
+ .. include:: /module/CMAKE_REQUIRED_INCLUDES.txt
43
+
44
+ .. include:: /module/CMAKE_REQUIRED_LINK_OPTIONS.txt
45
+
46
+ .. include:: /module/CMAKE_REQUIRED_LIBRARIES.txt
47
+
48
+ .. include:: /module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt
49
+
50
+ .. include:: /module/CMAKE_REQUIRED_QUIET.txt
51
+
52
+ #]=======================================================================]
53
+
54
+ include_guard(GLOBAL)
55
+ include(Internal/CheckSourceCompiles)
56
+
57
+ macro(CHECK_C_SOURCE_COMPILES SOURCE VAR)
58
+ cmake_check_source_compiles(C "${SOURCE}" ${VAR} ${ARGN})
59
+ endmacro()