1CMAKE-VARIABLES(7) CMake CMAKE-VARIABLES(7)
2
3
4
6 cmake-variables - CMake Variables Reference
7
8 This page documents variables that are provided by CMake or have mean‐
9 ing to CMake when set by project code.
10
11 For general information on variables, see the Variables section in the
12 cmake-language manual.
13
15 CMAKE_AR
16 Name of archiving tool for static libraries.
17
18 This specifies the name of the program that creates archive or static
19 libraries.
20
21 CMAKE_ARGC
22 Number of command line arguments passed to CMake in script mode.
23
24 When run in -P script mode, CMake sets this variable to the number of
25 command line arguments. See also CMAKE_ARGV0, 1, 2 …
26
27 CMAKE_ARGV0
28 Command line argument passed to CMake in script mode.
29
30 When run in -P script mode, CMake sets this variable to the first com‐
31 mand line argument. It then also sets CMAKE_ARGV1, CMAKE_ARGV2, … and
32 so on, up to the number of command line arguments given. See also
33 CMAKE_ARGC.
34
35 CMAKE_BINARY_DIR
36 The path to the top level of the build tree.
37
38 This is the full path to the top level of the current CMake build tree.
39 For an in-source build, this would be the same as CMAKE_SOURCE_DIR.
40
41 When run in -P script mode, CMake sets the variables CMAKE_BINARY_DIR,
42 CMAKE_SOURCE_DIR, CMAKE_CURRENT_BINARY_DIR and CMAKE_CURRENT_SOURCE_DIR
43 to the current working directory.
44
45 CMAKE_BUILD_TOOL
46 This variable exists only for backwards compatibility. It contains the
47 same value as CMAKE_MAKE_PROGRAM. Use that variable instead.
48
49 CMAKE_CACHEFILE_DIR
50 The directory with the CMakeCache.txt file.
51
52 This is the full path to the directory that has the CMakeCache.txt file
53 in it. This is the same as CMAKE_BINARY_DIR.
54
55 CMAKE_CACHE_MAJOR_VERSION
56 Major version of CMake used to create the CMakeCache.txt file
57
58 This stores the major version of CMake used to write a CMake cache
59 file. It is only different when a different version of CMake is run on
60 a previously created cache file.
61
62 CMAKE_CACHE_MINOR_VERSION
63 Minor version of CMake used to create the CMakeCache.txt file
64
65 This stores the minor version of CMake used to write a CMake cache
66 file. It is only different when a different version of CMake is run on
67 a previously created cache file.
68
69 CMAKE_CACHE_PATCH_VERSION
70 Patch version of CMake used to create the CMakeCache.txt file
71
72 This stores the patch version of CMake used to write a CMake cache
73 file. It is only different when a different version of CMake is run on
74 a previously created cache file.
75
76 CMAKE_CFG_INTDIR
77 Build-time reference to per-configuration output subdirectory.
78
79 For native build systems supporting multiple configurations in the
80 build tree (such as Visual Studio Generators and Xcode), the value is a
81 reference to a build-time variable specifying the name of the per-con‐
82 figuration output subdirectory. On Makefile Generators this evaluates
83 to . because there is only one configuration in a build tree. Example
84 values:
85
86 $(ConfigurationName) = Visual Studio 9
87 $(Configuration) = Visual Studio 10
88 $(CONFIGURATION) = Xcode
89 . = Make-based tools
90
91 Since these values are evaluated by the native build system, this vari‐
92 able is suitable only for use in command lines that will be evaluated
93 at build time. Example of intended usage:
94
95 add_executable(mytool mytool.c)
96 add_custom_command(
97 OUTPUT out.txt
98 COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/mytool
99 ${CMAKE_CURRENT_SOURCE_DIR}/in.txt out.txt
100 DEPENDS mytool in.txt
101 )
102 add_custom_target(drive ALL DEPENDS out.txt)
103
104 Note that CMAKE_CFG_INTDIR is no longer necessary for this purpose but
105 has been left for compatibility with existing projects. Instead
106 add_custom_command() recognizes executable target names in its COMMAND
107 option, so ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/mytool can
108 be replaced by just mytool.
109
110 This variable is read-only. Setting it is undefined behavior. In
111 multi-configuration build systems the value of this variable is passed
112 as the value of preprocessor symbol CMAKE_INTDIR to the compilation of
113 all source files.
114
115 CMAKE_COMMAND
116 The full path to the cmake(1) executable.
117
118 This is the full path to the CMake executable cmake(1) which is useful
119 from custom commands that want to use the cmake -E option for portable
120 system commands. (e.g. /usr/local/bin/cmake)
121
122 CMAKE_CPACK_COMMAND
123 Full path to cpack(1) command installed with CMake.
124
125 This is the full path to the CPack executable cpack(1) which is useful
126 from custom commands that want to use the cmake(1) -E option for porta‐
127 ble system commands.
128
129 CMAKE_CROSSCOMPILING
130 Intended to indicate whether CMake is cross compiling, but note limita‐
131 tions discussed below.
132
133 This variable will be set to true by CMake if the CMAKE_SYSTEM_NAME
134 variable has been set manually (i.e. in a toolchain file or as a cache
135 entry from the cmake command line). In most cases, manually setting
136 CMAKE_SYSTEM_NAME will only be done when cross compiling, since it will
137 otherwise be given the same value as CMAKE_HOST_SYSTEM_NAME if not man‐
138 ually set, which is correct for the non-cross-compiling case. In the
139 event that CMAKE_SYSTEM_NAME is manually set to the same value as
140 CMAKE_HOST_SYSTEM_NAME, then CMAKE_CROSSCOMPILING will still be set to
141 true.
142
143 Another case to be aware of is that builds targeting Apple platforms
144 other than macOS are handled differently to other cross compiling sce‐
145 narios. Rather than relying on CMAKE_SYSTEM_NAME to select the target
146 platform, Apple device builds use CMAKE_OSX_SYSROOT to select the
147 appropriate SDK, which indirectly determines the target platform. Fur‐
148 thermore, when using the Xcode generator, developers can switch between
149 device and simulator builds at build time rather than having a single
150 choice at configure time, so the concept of whether the build is cross
151 compiling or not is more complex. Therefore, the use of CMAKE_CROSSCOM‐
152 PILING is not recommended for projects targeting Apple devices.
153
154 CMAKE_CROSSCOMPILING_EMULATOR
155 This variable is only used when CMAKE_CROSSCOMPILING is on. It should
156 point to a command on the host system that can run executable built for
157 the target system.
158
159 If this variable contains a semicolon-separated list, then the first
160 value is the command and remaining values are its arguments.
161
162 The command will be used to run try_run() generated executables, which
163 avoids manual population of the TryRunResults.cmake file.
164
165 It is also used as the default value for the CROSSCOMPILING_EMULATOR
166 target property of executables.
167
168 CMAKE_CTEST_COMMAND
169 Full path to ctest(1) command installed with CMake.
170
171 This is the full path to the CTest executable ctest(1) which is useful
172 from custom commands that want to use the cmake(1) -E option for porta‐
173 ble system commands.
174
175 CMAKE_CURRENT_BINARY_DIR
176 The path to the binary directory currently being processed.
177
178 This the full path to the build directory that is currently being pro‐
179 cessed by cmake. Each directory added by add_subdirectory() will cre‐
180 ate a binary directory in the build tree, and as it is being processed
181 this variable will be set. For in-source builds this is the current
182 source directory being processed.
183
184 When run in -P script mode, CMake sets the variables CMAKE_BINARY_DIR,
185 CMAKE_SOURCE_DIR, CMAKE_CURRENT_BINARY_DIR and CMAKE_CURRENT_SOURCE_DIR
186 to the current working directory.
187
188 CMAKE_CURRENT_LIST_DIR
189 Full directory of the listfile currently being processed.
190
191 As CMake processes the listfiles in your project this variable will
192 always be set to the directory where the listfile which is currently
193 being processed (CMAKE_CURRENT_LIST_FILE) is located. The value has
194 dynamic scope. When CMake starts processing commands in a source file
195 it sets this variable to the directory where this file is located.
196 When CMake finishes processing commands from the file it restores the
197 previous value. Therefore the value of the variable inside a macro or
198 function is the directory of the file invoking the bottom-most entry on
199 the call stack, not the directory of the file containing the macro or
200 function definition.
201
202 See also CMAKE_CURRENT_LIST_FILE.
203
204 CMAKE_CURRENT_LIST_FILE
205 Full path to the listfile currently being processed.
206
207 As CMake processes the listfiles in your project this variable will
208 always be set to the one currently being processed. The value has
209 dynamic scope. When CMake starts processing commands in a source file
210 it sets this variable to the location of the file. When CMake finishes
211 processing commands from the file it restores the previous value.
212 Therefore the value of the variable inside a macro or function is the
213 file invoking the bottom-most entry on the call stack, not the file
214 containing the macro or function definition.
215
216 See also CMAKE_PARENT_LIST_FILE.
217
218 CMAKE_CURRENT_LIST_LINE
219 The line number of the current file being processed.
220
221 This is the line number of the file currently being processed by cmake.
222
223 CMAKE_CURRENT_SOURCE_DIR
224 The path to the source directory currently being processed.
225
226 This the full path to the source directory that is currently being pro‐
227 cessed by cmake.
228
229 When run in -P script mode, CMake sets the variables CMAKE_BINARY_DIR,
230 CMAKE_SOURCE_DIR, CMAKE_CURRENT_BINARY_DIR and CMAKE_CURRENT_SOURCE_DIR
231 to the current working directory.
232
233 CMAKE_DIRECTORY_LABELS
234 Specify labels for the current directory.
235
236 This is used to initialize the LABELS directory property.
237
238 CMAKE_DL_LIBS
239 Name of library containing dlopen and dlclose.
240
241 The name of the library that has dlopen and dlclose in it, usually -ldl
242 on most UNIX machines.
243
244 CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION
245 Default value for DOTNET_TARGET_FRAMEWORK_VERSION property of targets.
246
247 This variable is used to initialize the DOTNET_TARGET_FRAMEWORK_VERSION
248 property on all targets. See that target property for additional infor‐
249 mation.
250
251 Setting CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION may be necessary when
252 working with C# and newer .NET framework versions to avoid referencing
253 errors with the ALL_BUILD CMake target.
254
255 This variable is only evaluated for Visual Studio Generators VS 2010
256 and above.
257
258 CMAKE_EDIT_COMMAND
259 Full path to cmake-gui(1) or ccmake(1). Defined only for Makefile Gen‐
260 erators when not using an “extra” generator for an IDE.
261
262 This is the full path to the CMake executable that can graphically edit
263 the cache. For example, cmake-gui(1) or ccmake(1).
264
265 CMAKE_EXECUTABLE_SUFFIX
266 The suffix for executables on this platform.
267
268 The suffix to use for the end of an executable filename if any, .exe on
269 Windows.
270
271 CMAKE_EXECUTABLE_SUFFIX_<LANG> overrides this for language <LANG>.
272
273 CMAKE_EXTRA_GENERATOR
274 The extra generator used to build the project. See cmake-genera‐
275 tors(7).
276
277 When using the Eclipse, CodeBlocks, CodeLite, Kate or Sublime genera‐
278 tors, CMake generates Makefiles (CMAKE_GENERATOR) and additionally
279 project files for the respective IDE. This IDE project file generator
280 is stored in CMAKE_EXTRA_GENERATOR (e.g. Eclipse CDT4).
281
282 CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES
283 Additional suffixes for shared libraries.
284
285 Extensions for shared libraries other than that specified by
286 CMAKE_SHARED_LIBRARY_SUFFIX, if any. CMake uses this to recognize
287 external shared library files during analysis of libraries linked by a
288 target.
289
290 CMAKE_FIND_PACKAGE_NAME
291 Defined by the find_package() command while loading a find module to
292 record the caller-specified package name. See command documentation
293 for details.
294
295 CMAKE_FIND_PACKAGE_SORT_DIRECTION
296 The sorting direction used by CMAKE_FIND_PACKAGE_SORT_ORDER. It can
297 assume one of the following values:
298
299 DEC Default. Ordering is done in descending mode. The highest
300 folder found will be tested first.
301
302 ASC Ordering is done in ascending mode. The lowest folder found
303 will be tested first.
304
305 If CMAKE_FIND_PACKAGE_SORT_ORDER is not set or is set to NONE this
306 variable has no effect.
307
308 CMAKE_FIND_PACKAGE_SORT_ORDER
309 The default order for sorting packages found using find_package(). It
310 can assume one of the following values:
311
312 NONE Default. No attempt is done to sort packages. The first valid
313 package found will be selected.
314
315 NAME Sort packages lexicographically before selecting one.
316
317 NATURAL
318 Sort packages using natural order (see strverscmp(3) manual),
319 i.e. such that contiguous digits are compared as whole numbers.
320
321 Natural sorting can be employed to return the highest version when mul‐
322 tiple versions of the same library are found by find_package(). For
323 example suppose that the following libraries have been found:
324
325 · libX-1.1.0
326
327 · libX-1.2.9
328
329 · libX-1.2.10
330
331 By setting NATURAL order we can select the one with the highest version
332 number libX-1.2.10.
333
334 set(CMAKE_FIND_PACKAGE_SORT_ORDER NATURAL)
335 find_package(libX CONFIG)
336
337 The sort direction can be controlled using the CMAKE_FIND_PACK‐
338 AGE_SORT_DIRECTION variable (by default decrescent, e.g. lib-B will be
339 tested before lib-A).
340
341 CMAKE_GENERATOR
342 The generator used to build the project. See cmake-generators(7).
343
344 The name of the generator that is being used to generate the build
345 files. (e.g. Unix Makefiles, Ninja, etc.)
346
347 The value of this variable should never be modified by project code. A
348 generator may be selected via the cmake(1) -G option, interactively in
349 cmake-gui(1), or via the CMAKE_GENERATOR environment variable.
350
351 CMAKE_GENERATOR_INSTANCE
352 Generator-specific instance specification provided by user.
353
354 Some CMake generators support selection of an instance of the native
355 build system when multiple instances are available. If the user speci‐
356 fies an instance (e.g. by setting this cache entry or via the
357 CMAKE_GENERATOR_INSTANCE environment variable), or after a default
358 instance is chosen when a build tree is first configured, the value
359 will be available in this variable.
360
361 The value of this variable should never be modified by project code. A
362 toolchain file specified by the CMAKE_TOOLCHAIN_FILE variable may ini‐
363 tialize CMAKE_GENERATOR_INSTANCE as a cache entry. Once a given build
364 tree has been initialized with a particular value for this variable,
365 changing the value has undefined behavior.
366
367 Instance specification is supported only on specific generators:
368
369 · For the Visual Studio 15 2017 generator (and above) this specifies
370 the absolute path to the VS installation directory of the selected VS
371 instance.
372
373 See native build system documentation for allowed instance values.
374
375 CMAKE_GENERATOR_PLATFORM
376 Generator-specific target platform specification provided by user.
377
378 Some CMake generators support a target platform name to be given to the
379 native build system to choose a compiler toolchain. If the user speci‐
380 fies a platform name (e.g. via the cmake(1) -A option or via the
381 CMAKE_GENERATOR_PLATFORM environment variable) the value will be avail‐
382 able in this variable.
383
384 The value of this variable should never be modified by project code. A
385 toolchain file specified by the CMAKE_TOOLCHAIN_FILE variable may ini‐
386 tialize CMAKE_GENERATOR_PLATFORM. Once a given build tree has been
387 initialized with a particular value for this variable, changing the
388 value has undefined behavior.
389
390 Platform specification is supported only on specific generators:
391
392 · For Visual Studio Generators with VS 2005 and above this specifies
393 the target architecture.
394
395 · For Green Hills MULTI this specifies the target architecture.
396
397 See native build system documentation for allowed platform names.
398
399 Visual Studio Platform Selection
400 On Visual Studio Generators the selected platform name is provided in
401 the CMAKE_VS_PLATFORM_NAME variable.
402
403 CMAKE_GENERATOR_TOOLSET
404 Native build system toolset specification provided by user.
405
406 Some CMake generators support a toolset specification to tell the
407 native build system how to choose a compiler. If the user specifies a
408 toolset (e.g. via the cmake(1) -T option or via the CMAKE_GENERA‐
409 TOR_TOOLSET environment variable) the value will be available in this
410 variable.
411
412 The value of this variable should never be modified by project code. A
413 toolchain file specified by the CMAKE_TOOLCHAIN_FILE variable may ini‐
414 tialize CMAKE_GENERATOR_TOOLSET. Once a given build tree has been ini‐
415 tialized with a particular value for this variable, changing the value
416 has undefined behavior.
417
418 Toolset specification is supported only on specific generators:
419
420 · Visual Studio Generators for VS 2010 and above
421
422 · The Xcode generator for Xcode 3.0 and above
423
424 · The Green Hills MULTI generator
425
426 See native build system documentation for allowed toolset names.
427
428 Visual Studio Toolset Selection
429 The Visual Studio Generators support toolset specification using one of
430 these forms:
431
432 · toolset
433
434 · toolset[,key=value]*
435
436 · key=value[,key=value]*
437
438 The toolset specifies the toolset name. The selected toolset name is
439 provided in the CMAKE_VS_PLATFORM_TOOLSET variable.
440
441 The key=value pairs form a comma-separated list of options to specify
442 generator-specific details of the toolset selection. Supported pairs
443 are:
444
445 cuda=<version>|<path>
446 Specify the CUDA toolkit version to use or the path to a stand‐
447 alone CUDA toolkit directory. Supported by VS 2010 and above.
448 The version can only be used with the CUDA toolkit VS integra‐
449 tion globally installed. See the CMAKE_VS_PLATFORM_TOOLSET_CUDA
450 and CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR variables.
451
452 host=<arch>
453 Specify the host tools architecture as x64 or x86. Supported by
454 VS 2013 and above. See the CMAKE_VS_PLAT‐
455 FORM_TOOLSET_HOST_ARCHITECTURE variable.
456
457 version=<version>
458 Specify the toolset version to use. Supported by VS 2017 and
459 above with the specified toolset installed. See the
460 CMAKE_VS_PLATFORM_TOOLSET_VERSION variable.
461
462 CMAKE_IMPORT_LIBRARY_PREFIX
463 The prefix for import libraries that you link to.
464
465 The prefix to use for the name of an import library if used on this
466 platform.
467
468 CMAKE_IMPORT_LIBRARY_PREFIX_<LANG> overrides this for language <LANG>.
469
470 CMAKE_IMPORT_LIBRARY_SUFFIX
471 The suffix for import libraries that you link to.
472
473 The suffix to use for the end of an import library filename if used on
474 this platform.
475
476 CMAKE_IMPORT_LIBRARY_SUFFIX_<LANG> overrides this for language <LANG>.
477
478 CMAKE_JOB_POOL_COMPILE
479 This variable is used to initialize the JOB_POOL_COMPILE property on
480 all the targets. See JOB_POOL_COMPILE for additional information.
481
482 CMAKE_JOB_POOL_LINK
483 This variable is used to initialize the JOB_POOL_LINK property on all
484 the targets. See JOB_POOL_LINK for additional information.
485
486 CMAKE_JOB_POOLS
487 If the JOB_POOLS global property is not set, the value of this variable
488 is used in its place. See JOB_POOLS for additional information.
489
490 CMAKE_<LANG>_COMPILER_AR
491 A wrapper around ar adding the appropriate --plugin option for the com‐
492 piler.
493
494 See also CMAKE_AR.
495
496 CMAKE_<LANG>_COMPILER_RANLIB
497 A wrapper around ranlib adding the appropriate --plugin option for the
498 compiler.
499
500 See also CMAKE_RANLIB.
501
502 CMAKE_<LANG>_LINK_LIBRARY_SUFFIX
503 Language-specific suffix for libraries that you link to.
504
505 The suffix to use for the end of a library filename, .lib on Windows.
506
507 CMAKE_LINK_LIBRARY_SUFFIX
508 The suffix for libraries that you link to.
509
510 The suffix to use for the end of a library filename, .lib on Windows.
511
512 CMAKE_LINK_SEARCH_END_STATIC
513 End a link line such that static system libraries are used.
514
515 Some linkers support switches such as -Bstatic and -Bdynamic to deter‐
516 mine whether to use static or shared libraries for -lXXX options.
517 CMake uses these options to set the link type for libraries whose full
518 paths are not known or (in some cases) are in implicit link directories
519 for the platform. By default CMake adds an option at the end of the
520 library list (if necessary) to set the linker search type back to its
521 starting type. This property switches the final linker search type to
522 -Bstatic regardless of how it started.
523
524 This variable is used to initialize the target property
525 LINK_SEARCH_END_STATIC for all targets. If set, it’s value is also used
526 by the try_compile() command.
527
528 See also CMAKE_LINK_SEARCH_START_STATIC.
529
530 CMAKE_LINK_SEARCH_START_STATIC
531 Assume the linker looks for static libraries by default.
532
533 Some linkers support switches such as -Bstatic and -Bdynamic to deter‐
534 mine whether to use static or shared libraries for -lXXX options.
535 CMake uses these options to set the link type for libraries whose full
536 paths are not known or (in some cases) are in implicit link directories
537 for the platform. By default the linker search type is assumed to be
538 -Bdynamic at the beginning of the library list. This property switches
539 the assumption to -Bstatic. It is intended for use when linking an
540 executable statically (e.g. with the GNU -static option).
541
542 This variable is used to initialize the target property
543 LINK_SEARCH_START_STATIC for all targets. If set, it’s value is also
544 used by the try_compile() command.
545
546 See also CMAKE_LINK_SEARCH_END_STATIC.
547
548 CMAKE_MAJOR_VERSION
549 First version number component of the CMAKE_VERSION variable.
550
551 CMAKE_MAKE_PROGRAM
552 Tool that can launch the native build system. The value may be the
553 full path to an executable or just the tool name if it is expected to
554 be in the PATH.
555
556 The tool selected depends on the CMAKE_GENERATOR used to configure the
557 project:
558
559 · The Makefile Generators set this to make, gmake, or a generator-spe‐
560 cific tool (e.g. nmake for NMake Makefiles).
561
562 These generators store CMAKE_MAKE_PROGRAM in the CMake cache so that
563 it may be edited by the user.
564
565 · The Ninja generator sets this to ninja.
566
567 This generator stores CMAKE_MAKE_PROGRAM in the CMake cache so that
568 it may be edited by the user.
569
570 · The Xcode generator sets this to xcodebuild.
571
572 This generator prefers to lookup the build tool at build time rather
573 than to store CMAKE_MAKE_PROGRAM in the CMake cache ahead of time.
574 This is because xcodebuild is easy to find.
575
576 For compatibility with versions of CMake prior to 3.2, if a user or
577 project explicitly adds CMAKE_MAKE_PROGRAM to the CMake cache then
578 CMake will use the specified value.
579
580 · The Visual Studio Generators set this to the full path to MSBuild.exe
581 (VS >= 10), devenv.com (VS 7,8,9), or VCExpress.exe (VS Express 8,9).
582 (See also variables CMAKE_VS_MSBUILD_COMMAND and CMAKE_VS_DEVENV_COM‐
583 MAND.
584
585 These generators prefer to lookup the build tool at build time rather
586 than to store CMAKE_MAKE_PROGRAM in the CMake cache ahead of time.
587 This is because the tools are version-specific and can be located
588 using the Windows Registry. It is also necessary because the proper
589 build tool may depend on the project content (e.g. the Intel Fortran
590 plugin to VS 10 and 11 requires devenv.com to build its .vfproj
591 project files even though MSBuild.exe is normally preferred to sup‐
592 port the CMAKE_GENERATOR_TOOLSET).
593
594 For compatibility with versions of CMake prior to 3.0, if a user or
595 project explicitly adds CMAKE_MAKE_PROGRAM to the CMake cache then
596 CMake will use the specified value if possible.
597
598 · The Green Hills MULTI generator sets this to the full path to
599 gbuild.exe(Windows) or gbuild(Linux) based upon the toolset being
600 used.
601
602 Once the generator has initialized a particular value for this vari‐
603 able, changing the value has undefined behavior.
604
605 The CMAKE_MAKE_PROGRAM variable is set for use by project code. The
606 value is also used by the cmake(1) --build and ctest(1)
607 --build-and-test tools to launch the native build process.
608
609 CMAKE_MATCH_COUNT
610 The number of matches with the last regular expression.
611
612 When a regular expression match is used, CMake fills in CMAKE_MATCH_<n>
613 variables with the match contents. The CMAKE_MATCH_COUNT variable
614 holds the number of match expressions when these are filled.
615
616 CMAKE_MATCH_<n>
617 Capture group <n> matched by the last regular expression, for groups 0
618 through 9. Group 0 is the entire match. Groups 1 through 9 are the
619 subexpressions captured by () syntax.
620
621 When a regular expression match is used, CMake fills in CMAKE_MATCH_<n>
622 variables with the match contents. The CMAKE_MATCH_COUNT variable
623 holds the number of match expressions when these are filled.
624
625 CMAKE_MESSAGE_INDENT
626 The message() command joins the strings from this list and for log lev‐
627 els of NOTICE and below, it prepends the resultant string to each line
628 of the message.
629
630 Example:
631
632 list(APPEND listVar one two three)
633
634 message(VERBOSE [[Collected items in the "listVar":]])
635 list(APPEND CMAKE_MESSAGE_INDENT " ")
636
637 foreach(item IN LISTS listVar)
638 message(VERBOSE ${item})
639 endforeach()
640
641 list(POP_BACK CMAKE_MESSAGE_INDENT)
642 message(VERBOSE "No more indent")
643
644 Which results in the following output:
645
646 -- Collected items in the "listVar":
647 -- one
648 -- two
649 -- three
650 -- No more indent
651
652 CMAKE_MINIMUM_REQUIRED_VERSION
653 The <min> version of CMake given to the most recent call to the
654 cmake_minimum_required(VERSION) command.
655
656 CMAKE_MINOR_VERSION
657 Second version number component of the CMAKE_VERSION variable.
658
659 CMAKE_NETRC
660 This variable is used to initialize the NETRC option for file(DOWNLOAD)
661 and file(UPLOAD) commands and the module ExternalProject. See those
662 commands for additional information.
663
664 The local option takes precedence over this variable.
665
666 CMAKE_NETRC_FILE
667 This variable is used to initialize the NETRC_FILE option for
668 file(DOWNLOAD) and file(UPLOAD) commands and the module ExternalPro‐
669 ject. See those commands for additional information.
670
671 The local option takes precedence over this variable.
672
673 CMAKE_PARENT_LIST_FILE
674 Full path to the CMake file that included the current one.
675
676 While processing a CMake file loaded by include() or find_package()
677 this variable contains the full path to the file including it. The top
678 of the include stack is always the CMakeLists.txt for the current
679 directory. See also CMAKE_CURRENT_LIST_FILE.
680
681 CMAKE_PATCH_VERSION
682 Third version number component of the CMAKE_VERSION variable.
683
684 CMAKE_PROJECT_DESCRIPTION
685 The description of the top level project.
686
687 This variable holds the description of the project as specified in the
688 top level CMakeLists.txt file by a project() command. In the event
689 that the top level CMakeLists.txt contains multiple project() calls,
690 the most recently called one from that top level CMakeLists.txt will
691 determine the value that CMAKE_PROJECT_DESCRIPTION contains. For exam‐
692 ple, consider the following top level CMakeLists.txt:
693
694 cmake_minimum_required(VERSION 3.0)
695 project(First DESCRIPTION "I am First")
696 project(Second DESCRIPTION "I am Second")
697 add_subdirectory(sub)
698 project(Third DESCRIPTION "I am Third")
699
700 And sub/CMakeLists.txt with the following contents:
701
702 project(SubProj DESCRIPTION "I am SubProj")
703 message("CMAKE_PROJECT_DESCRIPTION = ${CMAKE_PROJECT_DESCRIPTION}")
704
705 The most recently seen project() command from the top level CMake‐
706 Lists.txt would be project(Second ...), so this will print:
707
708 CMAKE_PROJECT_DESCRIPTION = I am Second
709
710 To obtain the description from the most recent call to project() in the
711 current directory scope or above, see the PROJECT_DESCRIPTION variable.
712
713 CMAKE_PROJECT_HOMEPAGE_URL
714 The homepage URL of the top level project.
715
716 This variable holds the homepage URL of the project as specified in the
717 top level CMakeLists.txt file by a project() command. In the event
718 that the top level CMakeLists.txt contains multiple project() calls,
719 the most recently called one from that top level CMakeLists.txt will
720 determine the value that CMAKE_PROJECT_HOMEPAGE_URL contains. For
721 example, consider the following top level CMakeLists.txt:
722
723 cmake_minimum_required(VERSION 3.0)
724 project(First HOMEPAGE_URL "http://first.example.com")
725 project(Second HOMEPAGE_URL "http://second.example.com")
726 add_subdirectory(sub)
727 project(Third HOMEPAGE_URL "http://third.example.com")
728
729 And sub/CMakeLists.txt with the following contents:
730
731 project(SubProj HOMEPAGE_URL "http://subproj.example.com")
732 message("CMAKE_PROJECT_HOMEPAGE_URL = ${CMAKE_PROJECT_HOMEPAGE_URL}")
733
734 The most recently seen project() command from the top level CMake‐
735 Lists.txt would be project(Second ...), so this will print:
736
737 CMAKE_PROJECT_HOMEPAGE_URL = http://second.example.com
738
739 To obtain the homepage URL from the most recent call to project() in
740 the current directory scope or above, see the PROJECT_HOMEPAGE_URL
741 variable.
742
743 CMAKE_PROJECT_NAME
744 The name of the top level project.
745
746 This variable holds the name of the project as specified in the top
747 level CMakeLists.txt file by a project() command. In the event that
748 the top level CMakeLists.txt contains multiple project() calls, the
749 most recently called one from that top level CMakeLists.txt will deter‐
750 mine the name that CMAKE_PROJECT_NAME contains. For example, consider
751 the following top level CMakeLists.txt:
752
753 cmake_minimum_required(VERSION 3.0)
754 project(First)
755 project(Second)
756 add_subdirectory(sub)
757 project(Third)
758
759 And sub/CMakeLists.txt with the following contents:
760
761 project(SubProj)
762 message("CMAKE_PROJECT_NAME = ${CMAKE_PROJECT_NAME}")
763
764 The most recently seen project() command from the top level CMake‐
765 Lists.txt would be project(Second), so this will print:
766
767 CMAKE_PROJECT_NAME = Second
768
769 To obtain the name from the most recent call to project() in the cur‐
770 rent directory scope or above, see the PROJECT_NAME variable.
771
772 CMAKE_PROJECT_VERSION
773 The version of the top level project.
774
775 This variable holds the version of the project as specified in the top
776 level CMakeLists.txt file by a project() command. In the event that
777 the top level CMakeLists.txt contains multiple project() calls, the
778 most recently called one from that top level CMakeLists.txt will deter‐
779 mine the value that CMAKE_PROJECT_VERSION contains. For example, con‐
780 sider the following top level CMakeLists.txt:
781
782 cmake_minimum_required(VERSION 3.0)
783 project(First VERSION 1.2.3)
784 project(Second VERSION 3.4.5)
785 add_subdirectory(sub)
786 project(Third VERSION 6.7.8)
787
788 And sub/CMakeLists.txt with the following contents:
789
790 project(SubProj VERSION 1)
791 message("CMAKE_PROJECT_VERSION = ${CMAKE_PROJECT_VERSION}")
792
793 The most recently seen project() command from the top level CMake‐
794 Lists.txt would be project(Second ...), so this will print:
795
796 CMAKE_PROJECT_VERSION = 3.4.5
797
798 To obtain the version from the most recent call to project() in the
799 current directory scope or above, see the PROJECT_VERSION variable.
800
801 CMAKE_PROJECT_VERSION_MAJOR
802 The major version of the top level project.
803
804 This variable holds the major version of the project as specified in
805 the top level CMakeLists.txt file by a project() command. Please see
806 CMAKE_PROJECT_VERSION documentation for the behavior when multiple
807 project() commands are used in the sources.
808
809 CMAKE_PROJECT_VERSION_MINOR
810 The minor version of the top level project.
811
812 This variable holds the minor version of the project as specified in
813 the top level CMakeLists.txt file by a project() command. Please see
814 CMAKE_PROJECT_VERSION documentation for the behavior when multiple
815 project() commands are used in the sources.
816
817 CMAKE_PROJECT_VERSION_PATCH
818 The patch version of the top level project.
819
820 This variable holds the patch version of the project as specified in
821 the top level CMakeLists.txt file by a project() command. Please see
822 CMAKE_PROJECT_VERSION documentation for the behavior when multiple
823 project() commands are used in the sources.
824
825 CMAKE_PROJECT_VERSION_TWEAK
826 The tweak version of the top level project.
827
828 This variable holds the tweak version of the project as specified in
829 the top level CMakeLists.txt file by a project() command. Please see
830 CMAKE_PROJECT_VERSION documentation for the behavior when multiple
831 project() commands are used in the sources.
832
833 CMAKE_RANLIB
834 Name of randomizing tool for static libraries.
835
836 This specifies name of the program that randomizes libraries on UNIX,
837 not used on Windows, but may be present.
838
839 CMAKE_ROOT
840 Install directory for running cmake.
841
842 This is the install root for the running CMake and the Modules direc‐
843 tory can be found here. This is commonly used in this format:
844 ${CMAKE_ROOT}/Modules
845
846 CMAKE_RULE_MESSAGES
847 Specify whether to report a message for each make rule.
848
849 If set in the cache it is used to initialize the value of the RULE_MES‐
850 SAGES property. Users may disable the option in their local build tree
851 to disable granular messages and report only as each target completes
852 in Makefile builds.
853
854 CMAKE_SCRIPT_MODE_FILE
855 Full path to the cmake(1) -P script file currently being processed.
856
857 When run in cmake(1) -P script mode, CMake sets this variable to the
858 full path of the script file. When run to configure a CMakeLists.txt
859 file, this variable is not set.
860
861 CMAKE_SHARED_LIBRARY_PREFIX
862 The prefix for shared libraries that you link to.
863
864 The prefix to use for the name of a shared library, lib on UNIX.
865
866 CMAKE_SHARED_LIBRARY_PREFIX_<LANG> overrides this for language <LANG>.
867
868 CMAKE_SHARED_LIBRARY_SUFFIX
869 The suffix for shared libraries that you link to.
870
871 The suffix to use for the end of a shared library filename, .dll on
872 Windows.
873
874 CMAKE_SHARED_LIBRARY_SUFFIX_<LANG> overrides this for language <LANG>.
875
876 CMAKE_SHARED_MODULE_PREFIX
877 The prefix for loadable modules that you link to.
878
879 The prefix to use for the name of a loadable module on this platform.
880
881 CMAKE_SHARED_MODULE_PREFIX_<LANG> overrides this for language <LANG>.
882
883 CMAKE_SHARED_MODULE_SUFFIX
884 The suffix for shared libraries that you link to.
885
886 The suffix to use for the end of a loadable module filename on this
887 platform
888
889 CMAKE_SHARED_MODULE_SUFFIX_<LANG> overrides this for language <LANG>.
890
891 CMAKE_SIZEOF_VOID_P
892 Size of a void pointer.
893
894 This is set to the size of a pointer on the target machine, and is
895 determined by a try compile. If a 64-bit size is found, then the
896 library search path is modified to look for 64-bit libraries first.
897
898 CMAKE_SKIP_INSTALL_RULES
899 Whether to disable generation of installation rules.
900
901 If TRUE, CMake will neither generate installation rules nor will it
902 generate cmake_install.cmake files. This variable is FALSE by default.
903
904 CMAKE_SKIP_RPATH
905 If true, do not add run time path information.
906
907 If this is set to TRUE, then the rpath information is not added to com‐
908 piled executables. The default is to add rpath information if the
909 platform supports it. This allows for easy running from the build
910 tree. To omit RPATH in the install step, but not the build step, use
911 CMAKE_SKIP_INSTALL_RPATH instead.
912
913 CMAKE_SOURCE_DIR
914 The path to the top level of the source tree.
915
916 This is the full path to the top level of the current CMake source
917 tree. For an in-source build, this would be the same as
918 CMAKE_BINARY_DIR.
919
920 When run in -P script mode, CMake sets the variables CMAKE_BINARY_DIR,
921 CMAKE_SOURCE_DIR, CMAKE_CURRENT_BINARY_DIR and CMAKE_CURRENT_SOURCE_DIR
922 to the current working directory.
923
924 CMAKE_STATIC_LIBRARY_PREFIX
925 The prefix for static libraries that you link to.
926
927 The prefix to use for the name of a static library, lib on UNIX.
928
929 CMAKE_STATIC_LIBRARY_PREFIX_<LANG> overrides this for language <LANG>.
930
931 CMAKE_STATIC_LIBRARY_SUFFIX
932 The suffix for static libraries that you link to.
933
934 The suffix to use for the end of a static library filename, .lib on
935 Windows.
936
937 CMAKE_STATIC_LIBRARY_SUFFIX_<LANG> overrides this for language <LANG>.
938
939 CMAKE_Swift_MODULE_DIRECTORY
940 Swift module output directory.
941
942 This variable is used to initialise the Swift_MODULE_DIRECTORY property
943 on all the targets. See the target property for additional informa‐
944 tion.
945
946 CMAKE_Swift_NUM_THREADS
947 Number of threads for parallel compilation for Swift targets.
948
949 This variable controls the number of parallel jobs that the swift
950 driver creates for building targets. If not specified, it will default
951 to the number of logical CPUs on the host.
952
953 CMAKE_TOOLCHAIN_FILE
954 Path to toolchain file supplied to cmake(1).
955
956 This variable is specified on the command line when cross-compiling
957 with CMake. It is the path to a file which is read early in the CMake
958 run and which specifies locations for compilers and toolchain utili‐
959 ties, and other target platform and compiler related information.
960
961 CMAKE_TWEAK_VERSION
962 Defined to 0 for compatibility with code written for older CMake ver‐
963 sions that may have defined higher values.
964
965 NOTE:
966 In CMake versions 2.8.2 through 2.8.12, this variable holds the
967 fourth version number component of the CMAKE_VERSION variable.
968
969 CMAKE_VERBOSE_MAKEFILE
970 Enable verbose output from Makefile builds.
971
972 This variable is a cache entry initialized (to FALSE) by the project()
973 command. Users may enable the option in their local build tree to get
974 more verbose output from Makefile builds and show each command line as
975 it is launched.
976
977 CMAKE_VERSION
978 The CMake version string as three non-negative integer components sepa‐
979 rated by . and possibly followed by - and other information. The first
980 two components represent the feature level and the third component rep‐
981 resents either a bug-fix level or development date.
982
983 Release versions and release candidate versions of CMake use the for‐
984 mat:
985
986 <major>.<minor>.<patch>[-rc<n>]
987
988 where the <patch> component is less than 20000000. Development ver‐
989 sions of CMake use the format:
990
991 <major>.<minor>.<date>[-<id>]
992
993 where the <date> component is of format CCYYMMDD and <id> may contain
994 arbitrary text. This represents development as of a particular date
995 following the <major>.<minor> feature release.
996
997 Individual component values are also available in variables:
998
999 · CMAKE_MAJOR_VERSION
1000
1001 · CMAKE_MINOR_VERSION
1002
1003 · CMAKE_PATCH_VERSION
1004
1005 · CMAKE_TWEAK_VERSION
1006
1007 Use the if() command VERSION_LESS, VERSION_GREATER, VERSION_EQUAL, VER‐
1008 SION_LESS_EQUAL, or VERSION_GREATER_EQUAL operators to compare version
1009 string values against CMAKE_VERSION using a component-wise test. Ver‐
1010 sion component values may be 10 or larger so do not attempt to compare
1011 version strings as floating-point numbers.
1012
1013 NOTE:
1014 CMake versions 2.8.2 through 2.8.12 used three components for the
1015 feature level. Release versions represented the bug-fix level in a
1016 fourth component, i.e. <major>.<minor>.<patch>[.<tweak>][-rc<n>].
1017 Development versions represented the development date in the fourth
1018 component, i.e. <major>.<minor>.<patch>.<date>[-<id>].
1019
1020 CMake versions prior to 2.8.2 used three components for the feature
1021 level and had no bug-fix component. Release versions used an
1022 even-valued second component, i.e.
1023 <major>.<even-minor>.<patch>[-rc<n>]. Development versions used an
1024 odd-valued second component with the development date as the third
1025 component, i.e. <major>.<odd-minor>.<date>.
1026
1027 The CMAKE_VERSION variable is defined by CMake 2.6.3 and higher.
1028 Earlier versions defined only the individual component variables.
1029
1030 CMAKE_VS_DEVENV_COMMAND
1031 The generators for Visual Studio 9 2008 and above set this variable to
1032 the devenv.com command installed with the corresponding Visual Studio
1033 version. Note that this variable may be empty on Visual Studio Express
1034 editions because they do not provide this tool.
1035
1036 This variable is not defined by other generators even if devenv.com is
1037 installed on the computer.
1038
1039 The CMAKE_VS_MSBUILD_COMMAND is also provided for Visual Studio 10 2010
1040 and above. See also the CMAKE_MAKE_PROGRAM variable.
1041
1042 CMAKE_VS_MSBUILD_COMMAND
1043 The generators for Visual Studio 10 2010 and above set this variable to
1044 the MSBuild.exe command installed with the corresponding Visual Studio
1045 version.
1046
1047 This variable is not defined by other generators even if MSBuild.exe is
1048 installed on the computer.
1049
1050 The CMAKE_VS_DEVENV_COMMAND is also provided for the non-Express edi‐
1051 tions of Visual Studio. See also the CMAKE_MAKE_PROGRAM variable.
1052
1053 CMAKE_VS_NsightTegra_VERSION
1054 When using a Visual Studio generator with the CMAKE_SYSTEM_NAME vari‐
1055 able set to Android, this variable contains the version number of the
1056 installed NVIDIA Nsight Tegra Visual Studio Edition.
1057
1058 CMAKE_VS_PLATFORM_NAME
1059 Visual Studio target platform name used by the current generator.
1060
1061 VS 8 and above allow project files to specify a target platform. CMake
1062 provides the name of the chosen platform in this variable. See the
1063 CMAKE_GENERATOR_PLATFORM variable for details.
1064
1065 See also the CMAKE_VS_PLATFORM_NAME_DEFAULT variable.
1066
1067 CMAKE_VS_PLATFORM_NAME_DEFAULT
1068 Default for the Visual Studio target platform name for the current gen‐
1069 erator without considering the value of the CMAKE_GENERATOR_PLATFORM
1070 variable. For Visual Studio Generators for VS 2017 and below this is
1071 always Win32. For VS 2019 and above this is based on the host plat‐
1072 form.
1073
1074 See also the CMAKE_VS_PLATFORM_NAME variable.
1075
1076 CMAKE_VS_PLATFORM_TOOLSET
1077 Visual Studio Platform Toolset name.
1078
1079 VS 10 and above use MSBuild under the hood and support multiple com‐
1080 piler toolchains. CMake may specify a toolset explicitly, such as v110
1081 for VS 11 or Windows7.1SDK for 64-bit support in VS 10 Express. CMake
1082 provides the name of the chosen toolset in this variable.
1083
1084 See the CMAKE_GENERATOR_TOOLSET variable for details.
1085
1086 CMAKE_VS_PLATFORM_TOOLSET_CUDA
1087 NVIDIA CUDA Toolkit version whose Visual Studio toolset to use.
1088
1089 The Visual Studio Generators for VS 2010 and above support using a CUDA
1090 toolset provided by a CUDA Toolkit. The toolset version number may be
1091 specified by a field in CMAKE_GENERATOR_TOOLSET of the form cuda=8.0.
1092 Or it is automatically detected if a path to a standalone CUDA direc‐
1093 tory is specified in the form cuda=C:\path\to\cuda. If none is speci‐
1094 fied CMake will choose a default version. CMake provides the selected
1095 CUDA toolset version in this variable. The value may be empty if no
1096 CUDA Toolkit with Visual Studio integration is installed.
1097
1098 CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR
1099 Path to standalone NVIDIA CUDA Toolkit (eg. extracted from installer).
1100
1101 The Visual Studio Generators for VS 2010 and above support using a
1102 standalone (non-installed) NVIDIA CUDA toolkit. The path may be speci‐
1103 fied by a field in CMAKE_GENERATOR_TOOLSET of the form
1104 cuda=C:\path\to\cuda. The given directory must at least contain a
1105 folder .\nvcc and must provide Visual Studio integration files in path
1106 .\CUDAVisualStudioIntegration\extras\ visual_studio_integra‐
1107 tion\MSBuildExtensions\. One can create a standalone CUDA toolkit
1108 directory by either opening a installer with 7zip or copying the files
1109 that are extracted by the running installer. The value may be empty if
1110 no path to a standalone CUDA Toolkit was specified.
1111
1112 CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE
1113 Visual Studio preferred tool architecture.
1114
1115 The Visual Studio Generators for VS 2013 and above support using either
1116 the 32-bit or 64-bit host toolchains by specifying a host=x86 or
1117 host=x64 value in the CMAKE_GENERATOR_TOOLSET option. CMake provides
1118 the selected toolchain architecture preference in this variable (x86,
1119 x64, or empty).
1120
1121 CMAKE_VS_PLATFORM_TOOLSET_VERSION
1122 Visual Studio Platform Toolset version.
1123
1124 The Visual Studio Generators for VS 2017 and above allow to select
1125 minor versions of the same toolset. The toolset version number may be
1126 specified by a field in CMAKE_GENERATOR_TOOLSET of the form ver‐
1127 sion=14.11. If none is specified CMake will choose a default toolset.
1128 The value may be empty if no minor version was selected and the default
1129 is used.
1130
1131 CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION
1132 Visual Studio Windows Target Platform Version.
1133
1134 When targeting Windows 10 and above Visual Studio 2015 and above sup‐
1135 port specification of a target Windows version to select a correspond‐
1136 ing SDK. The CMAKE_SYSTEM_VERSION variable may be set to specify a
1137 version. Otherwise CMake computes a default version based on the Win‐
1138 dows SDK versions available. The chosen Windows target version number
1139 is provided in CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION. If no Windows
1140 10 SDK is available this value will be empty.
1141
1142 One may set a CMAKE_WINDOWS_KITS_10_DIR environment variable to an
1143 absolute path to tell CMake to look for Windows 10 SDKs in a custom
1144 location. The specified directory is expected to contain
1145 Include/10.0.* directories.
1146
1147 CMAKE_XCODE_GENERATE_SCHEME
1148 If enabled, the Xcode generator will generate schema files. These are
1149 useful to invoke analyze, archive, build-for-testing and test actions
1150 from the command line.
1151
1152 This variable initializes the XCODE_GENERATE_SCHEME target property on
1153 all targets.
1154
1155 CMAKE_XCODE_PLATFORM_TOOLSET
1156 Xcode compiler selection.
1157
1158 Xcode supports selection of a compiler from one of the installed
1159 toolsets. CMake provides the name of the chosen toolset in this vari‐
1160 able, if any is explicitly selected (e.g. via the cmake(1) -T option).
1161
1162 <PROJECT-NAME>_BINARY_DIR
1163 Top level binary directory for the named project.
1164
1165 A variable is created with the name used in the project() command, and
1166 is the binary directory for the project. This can be useful when
1167 add_subdirectory() is used to connect several projects.
1168
1169 <PROJECT-NAME>_DESCRIPTION
1170 Value given to the DESCRIPTION option of the most recent call to the
1171 project() command with project name <PROJECT-NAME>, if any.
1172
1173 <PROJECT-NAME>_HOMEPAGE_URL
1174 Value given to the HOMEPAGE_URL option of the most recent call to the
1175 project() command with project name <PROJECT-NAME>, if any.
1176
1177 <PROJECT-NAME>_SOURCE_DIR
1178 Top level source directory for the named project.
1179
1180 A variable is created with the name used in the project() command, and
1181 is the source directory for the project. This can be useful when
1182 add_subdirectory() is used to connect several projects.
1183
1184 <PROJECT-NAME>_VERSION
1185 Value given to the VERSION option of the most recent call to the
1186 project() command with project name <PROJECT-NAME>, if any.
1187
1188 See also the component-wise version variables <PROJECT-NAME>_VER‐
1189 SION_MAJOR, <PROJECT-NAME>_VERSION_MINOR, <PROJECT-NAME>_VERSION_PATCH,
1190 and <PROJECT-NAME>_VERSION_TWEAK.
1191
1192 <PROJECT-NAME>_VERSION_MAJOR
1193 First version number component of the <PROJECT-NAME>_VERSION variable
1194 as set by the project() command.
1195
1196 <PROJECT-NAME>_VERSION_MINOR
1197 Second version number component of the <PROJECT-NAME>_VERSION variable
1198 as set by the project() command.
1199
1200 <PROJECT-NAME>_VERSION_PATCH
1201 Third version number component of the <PROJECT-NAME>_VERSION variable
1202 as set by the project() command.
1203
1204 <PROJECT-NAME>_VERSION_TWEAK
1205 Fourth version number component of the <PROJECT-NAME>_VERSION variable
1206 as set by the project() command.
1207
1208 PROJECT_BINARY_DIR
1209 Full path to build directory for project.
1210
1211 This is the binary directory of the most recent project() command.
1212
1213 PROJECT_DESCRIPTION
1214 Short project description given to the project command.
1215
1216 This is the description given to the most recently called project()
1217 command in the current directory scope or above. To obtain the
1218 description of the top level project, see the CMAKE_PROJECT_DESCRIPTION
1219 variable.
1220
1221 PROJECT_HOMEPAGE_URL
1222 The homepage URL of the project.
1223
1224 This is the homepage URL given to the most recently called project()
1225 command in the current directory scope or above. To obtain the home‐
1226 page URL of the top level project, see the CMAKE_PROJECT_HOMEPAGE_URL
1227 variable.
1228
1229 PROJECT_NAME
1230 Name of the project given to the project command.
1231
1232 This is the name given to the most recently called project() command in
1233 the current directory scope or above. To obtain the name of the top
1234 level project, see the CMAKE_PROJECT_NAME variable.
1235
1236 PROJECT_SOURCE_DIR
1237 Top level source directory for the current project.
1238
1239 This is the source directory of the most recent project() command.
1240
1241 PROJECT_VERSION
1242 Value given to the VERSION option of the most recent call to the
1243 project() command, if any.
1244
1245 See also the component-wise version variables PROJECT_VERSION_MAJOR,
1246 PROJECT_VERSION_MINOR, PROJECT_VERSION_PATCH, and PROJECT_VER‐
1247 SION_TWEAK.
1248
1249 PROJECT_VERSION_MAJOR
1250 First version number component of the PROJECT_VERSION variable as set
1251 by the project() command.
1252
1253 PROJECT_VERSION_MINOR
1254 Second version number component of the PROJECT_VERSION variable as set
1255 by the project() command.
1256
1257 PROJECT_VERSION_PATCH
1258 Third version number component of the PROJECT_VERSION variable as set
1259 by the project() command.
1260
1261 PROJECT_VERSION_TWEAK
1262 Fourth version number component of the PROJECT_VERSION variable as set
1263 by the project() command.
1264
1266 BUILD_SHARED_LIBS
1267 Global flag to cause add_library() to create shared libraries if on.
1268
1269 If present and true, this will cause all libraries to be built shared
1270 unless the library was explicitly added as a static library. This
1271 variable is often added to projects as an option() so that each user of
1272 a project can decide if they want to build the project using shared or
1273 static libraries.
1274
1275 CMAKE_ABSOLUTE_DESTINATION_FILES
1276 List of files which have been installed using an ABSOLUTE DESTINATION
1277 path.
1278
1279 This variable is defined by CMake-generated cmake_install.cmake
1280 scripts. It can be used (read-only) by programs or scripts that source
1281 those install scripts. This is used by some CPack generators (e.g.
1282 RPM).
1283
1284 CMAKE_APPBUNDLE_PATH
1285 Semicolon-separated list of directories specifying a search path for
1286 macOS application bundles used by the find_program(), and find_pack‐
1287 age() commands.
1288
1289 CMAKE_AUTOMOC_RELAXED_MODE
1290 Deprecated since version 3.15.
1291
1292
1293 Switch between strict and relaxed automoc mode.
1294
1295 By default, AUTOMOC behaves exactly as described in the documentation
1296 of the AUTOMOC target property. When set to TRUE, it accepts more
1297 input and tries to find the correct input file for moc even if it dif‐
1298 fers from the documented behaviour. In this mode it e.g. also checks
1299 whether a header file is intended to be processed by moc when a
1300 "foo.moc" file has been included.
1301
1302 Relaxed mode has to be enabled for KDE4 compatibility.
1303
1304 CMAKE_BACKWARDS_COMPATIBILITY
1305 Deprecated. See CMake Policy CMP0001 documentation.
1306
1307 CMAKE_BUILD_TYPE
1308 Specifies the build type on single-configuration generators.
1309
1310 This statically specifies what build type (configuration) will be built
1311 in this build tree. Possible values are empty, Debug, Release, Rel‐
1312 WithDebInfo, MinSizeRel, … This variable is only meaningful to sin‐
1313 gle-configuration generators (such as Makefile Generators and Ninja)
1314 i.e. those which choose a single configuration when CMake runs to gen‐
1315 erate a build tree as opposed to multi-configuration generators which
1316 offer selection of the build configuration within the generated build
1317 environment. There are many per-config properties and variables (usu‐
1318 ally following clean SOME_VAR_<CONFIG> order conventions), such as
1319 CMAKE_C_FLAGS_<CONFIG>, specified as uppercase:
1320 CMAKE_C_FLAGS_[DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL|...]. For exam‐
1321 ple, in a build tree configured to build type Debug, CMake will see to
1322 having CMAKE_C_FLAGS_DEBUG settings get added to the CMAKE_C_FLAGS set‐
1323 tings. See also CMAKE_CONFIGURATION_TYPES.
1324
1325 CMAKE_CODEBLOCKS_COMPILER_ID
1326 Change the compiler id in the generated CodeBlocks project files.
1327
1328 CodeBlocks uses its own compiler id string which differs from
1329 CMAKE_<LANG>_COMPILER_ID. If this variable is left empty, CMake tries
1330 to recognize the CodeBlocks compiler id automatically. Otherwise the
1331 specified string is used in the CodeBlocks project file. See the Code‐
1332 Blocks documentation for valid compiler id strings.
1333
1334 Other IDEs like QtCreator that also use the CodeBlocks generator may
1335 ignore this setting.
1336
1337 CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES
1338 Change the way the CodeBlocks generator creates project files.
1339
1340 If this variable evaluates to ON the generator excludes from the
1341 project file any files that are located outside the project root.
1342
1343 CMAKE_CODELITE_USE_TARGETS
1344 Change the way the CodeLite generator creates projectfiles.
1345
1346 If this variable evaluates to ON at the end of the top-level CMake‐
1347 Lists.txt file, the generator creates projectfiles based on targets
1348 rather than projects.
1349
1350 CMAKE_COLOR_MAKEFILE
1351 Enables color output when using the Makefile Generators.
1352
1353 When enabled, the generated Makefiles will produce colored output.
1354 Default is ON.
1355
1356 CMAKE_CONFIGURATION_TYPES
1357 Specifies the available build types on multi-config generators.
1358
1359 This specifies what build types (configurations) will be available such
1360 as Debug, Release, RelWithDebInfo etc. This has reasonable defaults on
1361 most platforms, but can be extended to provide other build types. See
1362 also CMAKE_BUILD_TYPE for details of managing configuration data, and
1363 CMAKE_CFG_INTDIR.
1364
1365 CMAKE_DEBUG_TARGET_PROPERTIES
1366 Enables tracing output for target properties.
1367
1368 This variable can be populated with a list of properties to generate
1369 debug output for when evaluating target properties. Currently it can
1370 only be used when evaluating:
1371
1372 · AUTOUIC_OPTIONS
1373
1374 · COMPILE_DEFINITIONS
1375
1376 · COMPILE_FEATURES
1377
1378 · COMPILE_OPTIONS
1379
1380 · INCLUDE_DIRECTORIES
1381
1382 · LINK_DIRECTORIES
1383
1384 · LINK_OPTIONS
1385
1386 · POSITION_INDEPENDENT_CODE
1387
1388 · SOURCES
1389
1390 target properties and any other property listed in COMPATIBLE_INTER‐
1391 FACE_STRING and other COMPATIBLE_INTERFACE_ properties. It outputs an
1392 origin for each entry in the target property. Default is unset.
1393
1394 CMAKE_DEPENDS_IN_PROJECT_ONLY
1395 When set to TRUE in a directory, the build system produced by the Make‐
1396 file Generators is set up to only consider dependencies on source files
1397 that appear either in the source or in the binary directories. Changes
1398 to source files outside of these directories will not cause rebuilds.
1399
1400 This should be used carefully in cases where some source files are
1401 picked up through external headers during the build.
1402
1403 CMAKE_DISABLE_FIND_PACKAGE_<PackageName>
1404 Variable for disabling find_package() calls.
1405
1406 Every non-REQUIRED find_package() call in a project can be disabled by
1407 setting the variable CMAKE_DISABLE_FIND_PACKAGE_<PackageName> to TRUE.
1408 This can be used to build a project without an optional package,
1409 although that package is installed.
1410
1411 This switch should be used during the initial CMake run. Otherwise if
1412 the package has already been found in a previous CMake run, the vari‐
1413 ables which have been stored in the cache will still be there. In that
1414 case it is recommended to remove the cache variables for this package
1415 from the cache using the cache editor or cmake(1) -U
1416
1417 CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES
1418 This cache variable is used by the Eclipse project generator. See
1419 cmake-generators(7).
1420
1421 The Eclipse project generator generates so-called linked resources e.g.
1422 to the subproject root dirs in the source tree or to the source files
1423 of targets. This can be disabled by setting this variable to FALSE.
1424
1425 CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT
1426 This cache variable is used by the Eclipse project generator. See
1427 cmake-generators(7).
1428
1429 If this variable is set to TRUE, the Eclipse project generator will
1430 generate an Eclipse project in CMAKE_SOURCE_DIR . This project can then
1431 be used in Eclipse e.g. for the version control functionality.
1432 CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT defaults to FALSE; so nothing is
1433 written into the source directory.
1434
1435 CMAKE_ECLIPSE_MAKE_ARGUMENTS
1436 This cache variable is used by the Eclipse project generator. See
1437 cmake-generators(7).
1438
1439 This variable holds arguments which are used when Eclipse invokes the
1440 make tool. By default it is initialized to hold flags to enable paral‐
1441 lel builds (using -j typically).
1442
1443 CMAKE_ECLIPSE_RESOURCE_ENCODING
1444 This cache variable tells the Eclipse CDT4 project generator to set the
1445 resource encoding to the given value in generated project files. If no
1446 value is given, no encoding will be set.
1447
1448 CMAKE_ECLIPSE_VERSION
1449 This cache variable is used by the Eclipse project generator. See
1450 cmake-generators(7).
1451
1452 When using the Eclipse project generator, CMake tries to find the
1453 Eclipse executable and detect the version of it. Depending on the ver‐
1454 sion it finds, some features are enabled or disabled. If CMake doesn’t
1455 find Eclipse, it assumes the oldest supported version, Eclipse Callisto
1456 (3.2).
1457
1458 CMAKE_ERROR_DEPRECATED
1459 Whether to issue errors for deprecated functionality.
1460
1461 If TRUE, use of deprecated functionality will issue fatal errors. If
1462 this variable is not set, CMake behaves as if it were set to FALSE.
1463
1464 CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION
1465 Ask cmake_install.cmake script to error out as soon as a file with
1466 absolute INSTALL DESTINATION is encountered.
1467
1468 The fatal error is emitted before the installation of the offending
1469 file takes place. This variable is used by CMake-generated
1470 cmake_install.cmake scripts. If one sets this variable to ON while
1471 running the script, it may get fatal error messages from the script.
1472
1473 CMAKE_EXECUTE_PROCESS_COMMAND_ECHO
1474 If this variable is set to STDERR, STDOUT or NONE then commands in exe‐
1475 cute_process() calls will be printed to either stderr or stdout or not
1476 at all.
1477
1478 CMAKE_EXPORT_COMPILE_COMMANDS
1479 Enable/Disable output of compile commands during generation.
1480
1481 If enabled, generates a compile_commands.json file containing the exact
1482 compiler calls for all translation units of the project in
1483 machine-readable form. The format of the JSON file looks like:
1484
1485 [
1486 {
1487 "directory": "/home/user/development/project",
1488 "command": "/usr/bin/c++ ... -c ../foo/foo.cc",
1489 "file": "../foo/foo.cc"
1490 },
1491
1492 ...
1493
1494 {
1495 "directory": "/home/user/development/project",
1496 "command": "/usr/bin/c++ ... -c ../foo/bar.cc",
1497 "file": "../foo/bar.cc"
1498 }
1499 ]
1500
1501 NOTE:
1502 This option is implemented only by Makefile Generators and the
1503 Ninja. It is ignored on other generators.
1504
1505 This option currently does not work well in combination with the
1506 UNITY_BUILD target property or the CMAKE_UNITY_BUILD variable.
1507
1508 CMAKE_EXPORT_PACKAGE_REGISTRY
1509 Enables the export(PACKAGE) command when CMP0090 is set to NEW.
1510
1511 The export(PACKAGE) command does nothing by default. In some cases it
1512 is desirable to write to the user package registry, so the
1513 CMAKE_EXPORT_PACKAGE_REGISTRY variable may be set to enable it.
1514
1515 If CMP0090 is not set to NEW this variable does nothing, and the
1516 CMAKE_EXPORT_NO_PACKAGE_REGISTRY variable controls the behavior
1517 instead.
1518
1519 See also Disabling the Package Registry.
1520
1521 CMAKE_EXPORT_NO_PACKAGE_REGISTRY
1522 Disable the export(PACKAGE) command when CMP0090 is not set to NEW.
1523
1524 In some cases, for example for packaging and for system wide installa‐
1525 tions, it is not desirable to write the user package registry. If the
1526 CMAKE_EXPORT_NO_PACKAGE_REGISTRY variable is enabled, the export(PACK‐
1527 AGE) command will do nothing.
1528
1529 If CMP0090 is set to NEW this variable does nothing, and the
1530 CMAKE_EXPORT_PACKAGE_REGISTRY variable controls the behavior instead.
1531
1532 See also Disabling the Package Registry.
1533
1534 CMAKE_FIND_APPBUNDLE
1535 This variable affects how find_* commands choose between macOS Applica‐
1536 tion Bundles and unix-style package components.
1537
1538 On Darwin or systems supporting macOS Application Bundles, the
1539 CMAKE_FIND_APPBUNDLE variable can be set to empty or one of the follow‐
1540 ing:
1541
1542 FIRST Try to find application bundles before standard programs. This
1543 is the default on Darwin.
1544
1545 LAST Try to find application bundles after standard programs.
1546
1547 ONLY Only try to find application bundles.
1548
1549 NEVER Never try to find application bundles.
1550
1551 CMAKE_FIND_FRAMEWORK
1552 This variable affects how find_* commands choose between macOS Frame‐
1553 works and unix-style package components.
1554
1555 On Darwin or systems supporting macOS Frameworks, the CMAKE_FIND_FRAME‐
1556 WORK variable can be set to empty or one of the following:
1557
1558 FIRST Try to find frameworks before standard libraries or headers.
1559 This is the default on Darwin.
1560
1561 LAST Try to find frameworks after standard libraries or headers.
1562
1563 ONLY Only try to find frameworks.
1564
1565 NEVER Never try to find frameworks.
1566
1567 CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX
1568 Specify a <suffix> to tell the find_library() command to search in a
1569 lib<suffix> directory before each lib directory that would normally be
1570 searched.
1571
1572 This overrides the behavior of related global properties:
1573
1574 · FIND_LIBRARY_USE_LIB32_PATHS
1575
1576 · FIND_LIBRARY_USE_LIB64_PATHS
1577
1578 · FIND_LIBRARY_USE_LIBX32_PATHS
1579
1580 CMAKE_FIND_LIBRARY_PREFIXES
1581 Prefixes to prepend when looking for libraries.
1582
1583 This specifies what prefixes to add to library names when the
1584 find_library() command looks for libraries. On UNIX systems this is
1585 typically lib, meaning that when trying to find the foo library it will
1586 look for libfoo.
1587
1588 CMAKE_FIND_LIBRARY_SUFFIXES
1589 Suffixes to append when looking for libraries.
1590
1591 This specifies what suffixes to add to library names when the
1592 find_library() command looks for libraries. On Windows systems this is
1593 typically .lib and .dll, meaning that when trying to find the foo
1594 library it will look for foo.dll etc.
1595
1596 CMAKE_FIND_NO_INSTALL_PREFIX
1597 Exclude the values of the CMAKE_INSTALL_PREFIX and CMAKE_STAGING_PREFIX
1598 variables from CMAKE_SYSTEM_PREFIX_PATH. CMake adds these project-des‐
1599 tination prefixes to CMAKE_SYSTEM_PREFIX_PATH by default in order to
1600 support building a series of dependent packages and installing them
1601 into a common prefix. Set CMAKE_FIND_NO_INSTALL_PREFIX to TRUE to sup‐
1602 press this behavior.
1603
1604 The CMAKE_SYSTEM_PREFIX_PATH is initialized on the first call to a
1605 project() or enable_language() command. Therefore one must set
1606 CMAKE_FIND_NO_INSTALL_PREFIX before this in order to take effect. A
1607 user may set the variable as a cache entry on the command line to
1608 achieve this.
1609
1610 Note that the prefix(es) may still be searched for other reasons, such
1611 as being the same prefix as the CMake installation, or for being a
1612 built-in system prefix.
1613
1614 CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY
1615 Deprecated since version 3.16: Use the CMAKE_FIND_USE_PACKAGE_REGISTRY
1616 variable instead.
1617
1618
1619 By default this variable is not set. If neither CMAKE_FIND_USE_PACK‐
1620 AGE_REGISTRY nor CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY is set, then
1621 find_package() will use the User Package Registry unless the
1622 NO_CMAKE_PACKAGE_REGISTRY option is provided.
1623
1624 CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY is ignored if
1625 CMAKE_FIND_USE_PACKAGE_REGISTRY is set.
1626
1627 In some cases, for example to locate only system wide installations, it
1628 is not desirable to use the User Package Registry when searching for
1629 packages. If the CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY variable is
1630 TRUE, all the find_package() commands will skip the User Package Reg‐
1631 istry as if they were called with the NO_CMAKE_PACKAGE_REGISTRY argu‐
1632 ment.
1633
1634 See also Disabling the Package Registry.
1635
1636 CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY
1637 Deprecated since version 3.16: Use the CMAKE_FIND_USE_SYSTEM_PACK‐
1638 AGE_REGISTRY variable instead.
1639
1640
1641 By default this variable is not set. If neither CMAKE_FIND_USE_SYS‐
1642 TEM_PACKAGE_REGISTRY nor CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY
1643 is set, then find_package() will use the System Package Registry unless
1644 the NO_CMAKE_SYSTEM_PACKAGE_REGISTRY option is provided.
1645
1646 CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY is ignored if
1647 CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY is set.
1648
1649 In some cases, it is not desirable to use the System Package Registry
1650 when searching for packages. If the
1651 CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY variable is TRUE, all the
1652 find_package() commands will skip the System Package Registry as if
1653 they were called with the NO_CMAKE_SYSTEM_PACKAGE_REGISTRY argument.
1654
1655 See also Disabling the Package Registry.
1656
1657 CMAKE_FIND_PACKAGE_PREFER_CONFIG
1658 Tell find_package() to try “Config” mode before “Module” mode if no
1659 mode was specified.
1660
1661 The command find_package() operates without an explicit mode when the
1662 reduced signature is used without the MODULE option. In this case, by
1663 default, CMake first tries Module mode by searching for a
1664 Find<pkg>.cmake module. If it fails, CMake then searches for the pack‐
1665 age using Config mode.
1666
1667 Set CMAKE_FIND_PACKAGE_PREFER_CONFIG to TRUE to tell find_package() to
1668 first search using Config mode before falling back to Module mode.
1669
1670 This variable may be useful when a developer has compiled a custom ver‐
1671 sion of a common library and wishes to link it to a dependent project.
1672 If this variable is set to TRUE, it would prevent a dependent project’s
1673 call to find_package() from selecting the default library located by
1674 the system’s Find<pkg>.cmake module before finding the developer’s cus‐
1675 tom built library.
1676
1677 Once this variable is set, it is the responsibility of the exported
1678 <pkg>Config.cmake files to provide the same result variables as the
1679 Find<pkg>.cmake modules so that dependent projects can use them inter‐
1680 changeably.
1681
1682 CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS
1683 Set to TRUE to tell find_package() calls to resolve symbolic links in
1684 the value of <PackageName>_DIR.
1685
1686 This is helpful in use cases where the package search path points at a
1687 proxy directory in which symlinks to the real package locations appear.
1688 This is not enabled by default because there are also common use cases
1689 in which the symlinks should be preserved.
1690
1691 CMAKE_FIND_PACKAGE_WARN_NO_MODULE
1692 Tell find_package() to warn if called without an explicit mode.
1693
1694 If find_package() is called without an explicit mode option (MODULE,
1695 CONFIG, or NO_MODULE) and no Find<pkg>.cmake module is in CMAKE_MOD‐
1696 ULE_PATH then CMake implicitly assumes that the caller intends to
1697 search for a package configuration file. If no package configuration
1698 file is found then the wording of the failure message must account for
1699 both the case that the package is really missing and the case that the
1700 project has a bug and failed to provide the intended Find module. If
1701 instead the caller specifies an explicit mode option then the failure
1702 message can be more specific.
1703
1704 Set CMAKE_FIND_PACKAGE_WARN_NO_MODULE to TRUE to tell find_package() to
1705 warn when it implicitly assumes Config mode. This helps developers
1706 enforce use of an explicit mode in all calls to find_package() within a
1707 project.
1708
1709 This variable has no effect if CMAKE_FIND_PACKAGE_PREFER_CONFIG is set
1710 to TRUE.
1711
1712 CMAKE_FIND_ROOT_PATH
1713 Semicolon-separated list of root paths to search on the filesystem.
1714
1715 This variable is most useful when cross-compiling. CMake uses the paths
1716 in this list as alternative roots to find filesystem items with
1717 find_package(), find_library() etc.
1718
1719 CMAKE_FIND_ROOT_PATH_MODE_INCLUDE
1720 This variable controls whether the CMAKE_FIND_ROOT_PATH and CMAKE_SYS‐
1721 ROOT are used by find_file() and find_path().
1722
1723 If set to ONLY, then only the roots in CMAKE_FIND_ROOT_PATH will be
1724 searched. If set to NEVER, then the roots in CMAKE_FIND_ROOT_PATH will
1725 be ignored and only the host system root will be used. If set to BOTH,
1726 then the host system paths and the paths in CMAKE_FIND_ROOT_PATH will
1727 be searched.
1728
1729 CMAKE_FIND_ROOT_PATH_MODE_LIBRARY
1730 This variable controls whether the CMAKE_FIND_ROOT_PATH and CMAKE_SYS‐
1731 ROOT are used by find_library().
1732
1733 If set to ONLY, then only the roots in CMAKE_FIND_ROOT_PATH will be
1734 searched. If set to NEVER, then the roots in CMAKE_FIND_ROOT_PATH will
1735 be ignored and only the host system root will be used. If set to BOTH,
1736 then the host system paths and the paths in CMAKE_FIND_ROOT_PATH will
1737 be searched.
1738
1739 CMAKE_FIND_ROOT_PATH_MODE_PACKAGE
1740 This variable controls whether the CMAKE_FIND_ROOT_PATH and CMAKE_SYS‐
1741 ROOT are used by find_package().
1742
1743 If set to ONLY, then only the roots in CMAKE_FIND_ROOT_PATH will be
1744 searched. If set to NEVER, then the roots in CMAKE_FIND_ROOT_PATH will
1745 be ignored and only the host system root will be used. If set to BOTH,
1746 then the host system paths and the paths in CMAKE_FIND_ROOT_PATH will
1747 be searched.
1748
1749 CMAKE_FIND_ROOT_PATH_MODE_PROGRAM
1750 This variable controls whether the CMAKE_FIND_ROOT_PATH and CMAKE_SYS‐
1751 ROOT are used by find_program().
1752
1753 If set to ONLY, then only the roots in CMAKE_FIND_ROOT_PATH will be
1754 searched. If set to NEVER, then the roots in CMAKE_FIND_ROOT_PATH will
1755 be ignored and only the host system root will be used. If set to BOTH,
1756 then the host system paths and the paths in CMAKE_FIND_ROOT_PATH will
1757 be searched.
1758
1759 CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH
1760 Controls the default behavior of the following commands for whether or
1761 not to search paths provided by cmake-specific environment variables:
1762
1763 · find_program()
1764
1765 · find_library()
1766
1767 · find_file()
1768
1769 · find_path()
1770
1771 · find_package()
1772
1773 This is useful in cross-compiling environments.
1774
1775 By default this variable is not set, which is equivalent to it having a
1776 value of TRUE. Explicit options given to the above commands take
1777 precedence over this variable.
1778
1779 See also the CMAKE_FIND_USE_CMAKE_PATH, CMAKE_FIND_USE_CMAKE_SYS‐
1780 TEM_PATH, CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH, CMAKE_FIND_USE_SYS‐
1781 TEM_PACKAGE_REGISTRY, CMAKE_FIND_USE_PACKAGE_REGISTRY, and
1782 CMAKE_FIND_USE_PACKAGE_ROOT_PATH variables.
1783
1784 CMAKE_FIND_USE_CMAKE_PATH
1785 Controls the default behavior of the following commands for whether or
1786 not to search paths provided by cmake-specific cache variables:
1787
1788 · find_program()
1789
1790 · find_library()
1791
1792 · find_file()
1793
1794 · find_path()
1795
1796 · find_package()
1797
1798 This is useful in cross-compiling environments.
1799
1800 By default this variable is not set, which is equivalent to it having a
1801 value of TRUE. Explicit options given to the above commands take
1802 precedence over this variable.
1803
1804 See also the CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH,
1805 CMAKE_FIND_USE_CMAKE_SYSTEM_PATH, CMAKE_FIND_USE_SYSTEM_ENVIRON‐
1806 MENT_PATH, CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY, CMAKE_FIND_USE_PACK‐
1807 AGE_REGISTRY, and CMAKE_FIND_USE_PACKAGE_ROOT_PATH variables.
1808
1809 CMAKE_FIND_USE_CMAKE_SYSTEM_PATH
1810 Controls the default behavior of the following commands for whether or
1811 not to search paths provided by platform-specific cmake variables:
1812
1813 · find_program()
1814
1815 · find_library()
1816
1817 · find_file()
1818
1819 · find_path()
1820
1821 · find_package()
1822
1823 This is useful in cross-compiling environments.
1824
1825 By default this variable is not set, which is equivalent to it having a
1826 value of TRUE. Explicit options given to the above commands take
1827 precedence over this variable.
1828
1829 See also the CMAKE_FIND_USE_CMAKE_PATH, CMAKE_FIND_USE_CMAKE_ENVIRON‐
1830 MENT_PATH, CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH, CMAKE_FIND_USE_SYS‐
1831 TEM_PACKAGE_REGISTRY, CMAKE_FIND_USE_PACKAGE_REGISTRY, and
1832 CMAKE_FIND_USE_PACKAGE_ROOT_PATH variables.
1833
1834 CMAKE_FIND_USE_PACKAGE_REGISTRY
1835 Controls the default behavior of the find_package() command for whether
1836 or not to search paths provided by the User Package Registry.
1837
1838 By default this variable is not set and the behavior will fall back to
1839 that determined by the deprecated CMAKE_FIND_PACKAGE_NO_PACKAGE_REG‐
1840 ISTRY variable. If that is also not set, then find_package() will use
1841 the User Package Registry unless the NO_CMAKE_PACKAGE_REGISTRY option
1842 is provided.
1843
1844 This variable takes precedence over CMAKE_FIND_PACKAGE_NO_PACKAGE_REG‐
1845 ISTRY when both are set.
1846
1847 In some cases, for example to locate only system wide installations, it
1848 is not desirable to use the User Package Registry when searching for
1849 packages. If the CMAKE_FIND_USE_PACKAGE_REGISTRY variable is FALSE,
1850 all the find_package() commands will skip the User Package Registry as
1851 if they were called with the NO_CMAKE_PACKAGE_REGISTRY argument.
1852
1853 See also Disabling the Package Registry and the
1854 CMAKE_FIND_USE_CMAKE_PATH, CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH,
1855 CMAKE_FIND_USE_CMAKE_SYSTEM_PATH, CMAKE_FIND_USE_SYSTEM_ENVIRON‐
1856 MENT_PATH, CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY, and
1857 CMAKE_FIND_USE_PACKAGE_ROOT_PATH variables.
1858
1859 CMAKE_FIND_USE_PACKAGE_ROOT_PATH
1860 Controls the default behavior of the following commands for whether or
1861 not to search paths provided by <PackageName>_ROOT variables:
1862
1863 · find_program()
1864
1865 · find_library()
1866
1867 · find_file()
1868
1869 · find_path()
1870
1871 · find_package()
1872
1873 By default this variable is not set, which is equivalent to it having a
1874 value of TRUE. Explicit options given to the above commands take
1875 precedence over this variable.
1876
1877 See also the CMAKE_FIND_USE_CMAKE_PATH, CMAKE_FIND_USE_CMAKE_ENVIRON‐
1878 MENT_PATH, CMAKE_FIND_USE_CMAKE_SYSTEM_PATH, CMAKE_FIND_USE_SYS‐
1879 TEM_ENVIRONMENT_PATH, CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY, and
1880 CMAKE_FIND_USE_PACKAGE_REGISTRY variables.
1881
1882 CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH
1883 Controls the default behavior of the following commands for whether or
1884 not to search paths provided by standard system environment variables:
1885
1886 · find_program()
1887
1888 · find_library()
1889
1890 · find_file()
1891
1892 · find_path()
1893
1894 · find_package()
1895
1896 This is useful in cross-compiling environments.
1897
1898 By default this variable is not set, which is equivalent to it having a
1899 value of TRUE. Explicit options given to the above commands take
1900 precedence over this variable.
1901
1902 See also the CMAKE_FIND_USE_CMAKE_PATH, CMAKE_FIND_USE_CMAKE_ENVIRON‐
1903 MENT_PATH, CMAKE_FIND_USE_CMAKE_SYSTEM_PATH, CMAKE_FIND_USE_PACK‐
1904 AGE_REGISTRY, CMAKE_FIND_USE_PACKAGE_ROOT_PATH, and CMAKE_FIND_USE_SYS‐
1905 TEM_PACKAGE_REGISTRY variables.
1906
1907 CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY
1908 Controls searching the System Package Registry by the find_package()
1909 command.
1910
1911 By default this variable is not set and the behavior will fall back to
1912 that determined by the deprecated CMAKE_FIND_PACKAGE_NO_SYSTEM_PACK‐
1913 AGE_REGISTRY variable. If that is also not set, then find_package()
1914 will use the System Package Registry unless the NO_CMAKE_SYSTEM_PACK‐
1915 AGE_REGISTRY option is provided.
1916
1917 This variable takes precedence over CMAKE_FIND_PACKAGE_NO_SYSTEM_PACK‐
1918 AGE_REGISTRY when both are set.
1919
1920 In some cases, for example to locate only user specific installations,
1921 it is not desirable to use the System Package Registry when searching
1922 for packages. If the CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY variable is
1923 FALSE, all the find_package() commands will skip the System Package
1924 Registry as if they were called with the NO_CMAKE_SYSTEM_PACKAGE_REG‐
1925 ISTRY argument.
1926
1927 See also Disabling the Package Registry.
1928
1929 See also the CMAKE_FIND_USE_CMAKE_PATH, CMAKE_FIND_USE_CMAKE_ENVIRON‐
1930 MENT_PATH, CMAKE_FIND_USE_CMAKE_SYSTEM_PATH, CMAKE_FIND_USE_SYS‐
1931 TEM_ENVIRONMENT_PATH, CMAKE_FIND_USE_PACKAGE_REGISTRY, and
1932 CMAKE_FIND_USE_PACKAGE_ROOT_PATH variables.
1933
1934 CMAKE_FRAMEWORK_PATH
1935 Semicolon-separated list of directories specifying a search path for
1936 macOS frameworks used by the find_library(), find_package(),
1937 find_path(), and find_file() commands.
1938
1939 CMAKE_IGNORE_PATH
1940 Semicolon-separated list of directories to be ignored by the find_pro‐
1941 gram(), find_library(), find_file(), and find_path() commands. This is
1942 useful in cross-compiling environments where some system directories
1943 contain incompatible but possibly linkable libraries. For example, on
1944 cross-compiled cluster environments, this allows a user to ignore
1945 directories containing libraries meant for the front-end machine.
1946
1947 By default this is empty; it is intended to be set by the project.
1948 Note that CMAKE_IGNORE_PATH takes a list of directory names, not a list
1949 of prefixes. To ignore paths under prefixes (bin, include, lib, etc.),
1950 specify them explicitly.
1951
1952 See also the CMAKE_PREFIX_PATH, CMAKE_LIBRARY_PATH, CMAKE_INCLUDE_PATH,
1953 and CMAKE_PROGRAM_PATH variables.
1954
1955 CMAKE_INCLUDE_DIRECTORIES_BEFORE
1956 Whether to append or prepend directories by default in include_directo‐
1957 ries().
1958
1959 This variable affects the default behavior of the include_directories()
1960 command. Setting this variable to ON is equivalent to using the BEFORE
1961 option in all uses of that command.
1962
1963 CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE
1964 Whether to force prepending of project include directories.
1965
1966 This variable affects the order of include directories generated in
1967 compiler command lines. If set to ON, it causes the CMAKE_SOURCE_DIR
1968 and the CMAKE_BINARY_DIR to appear first.
1969
1970 CMAKE_INCLUDE_PATH
1971 Semicolon-separated list of directories specifying a search path for
1972 the find_file() and find_path() commands. By default it is empty, it
1973 is intended to be set by the project. See also CMAKE_SYS‐
1974 TEM_INCLUDE_PATH and CMAKE_PREFIX_PATH.
1975
1976 CMAKE_INSTALL_DEFAULT_COMPONENT_NAME
1977 Default component used in install() commands.
1978
1979 If an install() command is used without the COMPONENT argument, these
1980 files will be grouped into a default component. The name of this
1981 default install component will be taken from this variable. It
1982 defaults to Unspecified.
1983
1984 CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS
1985 Default permissions for directories created implicitly during installa‐
1986 tion of files by install() and file(INSTALL).
1987
1988 If make install is invoked and directories are implicitly created they
1989 get permissions set by CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS
1990 variable or platform specific default permissions if the variable is
1991 not set.
1992
1993 Implicitly created directories are created if they are not explicitly
1994 installed by install() command but are needed to install a file on a
1995 certain path. Example of such locations are directories created due to
1996 the setting of CMAKE_INSTALL_PREFIX.
1997
1998 Expected content of the CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS
1999 variable is a list of permissions that can be used by install() command
2000 PERMISSIONS section.
2001
2002 Example usage:
2003
2004 set(CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS
2005 OWNER_READ
2006 OWNER_WRITE
2007 OWNER_EXECUTE
2008 GROUP_READ
2009 )
2010
2011 CMAKE_INSTALL_MESSAGE
2012 Specify verbosity of installation script code generated by the
2013 install() command (using the file(INSTALL) command). For paths that
2014 are newly installed or updated, installation may print lines like:
2015
2016 -- Installing: /some/destination/path
2017
2018 For paths that are already up to date, installation may print lines
2019 like:
2020
2021 -- Up-to-date: /some/destination/path
2022
2023 The CMAKE_INSTALL_MESSAGE variable may be set to control which messages
2024 are printed:
2025
2026 ALWAYS Print both Installing and Up-to-date messages.
2027
2028 LAZY Print Installing but not Up-to-date messages.
2029
2030 NEVER Print neither Installing nor Up-to-date messages.
2031
2032 Other values have undefined behavior and may not be diagnosed.
2033
2034 If this variable is not set, the default behavior is ALWAYS.
2035
2036 CMAKE_INSTALL_PREFIX
2037 Install directory used by install().
2038
2039 If make install is invoked or INSTALL is built, this directory is
2040 prepended onto all install directories. This variable defaults to
2041 /usr/local on UNIX and c:/Program Files/${PROJECT_NAME} on Windows.
2042 See CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT for how a project might
2043 choose its own default.
2044
2045 On UNIX one can use the DESTDIR mechanism in order to relocate the
2046 whole installation. See DESTDIR for more information.
2047
2048 The installation prefix is also added to CMAKE_SYSTEM_PREFIX_PATH so
2049 that find_package(), find_program(), find_library(), find_path(), and
2050 find_file() will search the prefix for other software.
2051
2052 NOTE:
2053 Use the GNUInstallDirs module to provide GNU-style options for the
2054 layout of directories within the installation.
2055
2056 CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT
2057 CMake sets this variable to a TRUE value when the CMAKE_INSTALL_PREFIX
2058 has just been initialized to its default value, typically on the first
2059 run of CMake within a new build tree. This can be used by project code
2060 to change the default without overriding a user-provided value:
2061
2062 if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
2063 set(CMAKE_INSTALL_PREFIX "/my/default" CACHE PATH "..." FORCE)
2064 endif()
2065
2066 CMAKE_LIBRARY_PATH
2067 Semicolon-separated list of directories specifying a search path for
2068 the find_library() command. By default it is empty, it is intended to
2069 be set by the project. See also CMAKE_SYSTEM_LIBRARY_PATH and
2070 CMAKE_PREFIX_PATH.
2071
2072 CMAKE_LINK_DIRECTORIES_BEFORE
2073 Whether to append or prepend directories by default in link_directo‐
2074 ries().
2075
2076 This variable affects the default behavior of the link_directories()
2077 command. Setting this variable to ON is equivalent to using the BEFORE
2078 option in all uses of that command.
2079
2080 CMAKE_MFC_FLAG
2081 Use the MFC library for an executable or dll.
2082
2083 Enables the use of the Microsoft Foundation Classes (MFC). It should
2084 be set to 1 for the static MFC library, and 2 for the shared MFC
2085 library. This is used in Visual Studio project files.
2086
2087 Usage example:
2088
2089 add_definitions(-D_AFXDLL)
2090 set(CMAKE_MFC_FLAG 2)
2091 add_executable(CMakeSetup WIN32 ${SRCS})
2092
2093 CMAKE_MAXIMUM_RECURSION_DEPTH
2094 Maximum recursion depth for CMake scripts. It is intended to be set on
2095 the command line with -DCMAKE_MAXIMUM_RECURSION_DEPTH=<x>, or within
2096 CMakeLists.txt by projects that require a large recursion depth.
2097 Projects that set this variable should provide the user with a way to
2098 override it. For example:
2099
2100 # About to perform deeply recursive actions
2101 if(NOT CMAKE_MAXIMUM_RECURSION_DEPTH)
2102 set(CMAKE_MAXIMUM_RECURSION_DEPTH 2000)
2103 endif()
2104
2105 If it is not set, or is set to a non-integer value, a sensible default
2106 limit is used. If the recursion limit is reached, the script terminates
2107 immediately with a fatal error.
2108
2109 Calling any of the following commands increases the recursion depth:
2110
2111 · include()
2112
2113 · find_package()
2114
2115 · add_subdirectory()
2116
2117 · try_compile()
2118
2119 · ctest_read_custom_files()
2120
2121 · ctest_run_script() (unless NEW_PROCESS is specified)
2122
2123 · User-defined function()’s and macro()’s (note that function() and
2124 macro() themselves don’t increase recursion depth)
2125
2126 · Reading or writing variables that are being watched by a vari‐
2127 able_watch()
2128
2129 CMAKE_MODULE_PATH
2130 Semicolon-separated list of directories specifying a search path for
2131 CMake modules to be loaded by the include() or find_package() commands
2132 before checking the default modules that come with CMake. By default
2133 it is empty, it is intended to be set by the project.
2134
2135 CMAKE_POLICY_DEFAULT_CMP<NNNN>
2136 Default for CMake Policy CMP<NNNN> when it is otherwise left unset.
2137
2138 Commands cmake_minimum_required(VERSION) and cmake_policy(VERSION) by
2139 default leave policies introduced after the given version unset. Set
2140 CMAKE_POLICY_DEFAULT_CMP<NNNN> to OLD or NEW to specify the default for
2141 policy CMP<NNNN>, where <NNNN> is the policy number.
2142
2143 This variable should not be set by a project in CMake code; use
2144 cmake_policy(SET) instead. Users running CMake may set this variable
2145 in the cache (e.g. -DCMAKE_POLICY_DEFAULT_CMP<NNNN>=<OLD|NEW>) to set a
2146 policy not otherwise set by the project. Set to OLD to quiet a policy
2147 warning while using old behavior or to NEW to try building the project
2148 with new behavior.
2149
2150 CMAKE_POLICY_WARNING_CMP<NNNN>
2151 Explicitly enable or disable the warning when CMake Policy CMP<NNNN> is
2152 not set. This is meaningful only for the few policies that do not warn
2153 by default:
2154
2155 · CMAKE_POLICY_WARNING_CMP0025 controls the warning for policy CMP0025.
2156
2157 · CMAKE_POLICY_WARNING_CMP0047 controls the warning for policy CMP0047.
2158
2159 · CMAKE_POLICY_WARNING_CMP0056 controls the warning for policy CMP0056.
2160
2161 · CMAKE_POLICY_WARNING_CMP0060 controls the warning for policy CMP0060.
2162
2163 · CMAKE_POLICY_WARNING_CMP0065 controls the warning for policy CMP0065.
2164
2165 · CMAKE_POLICY_WARNING_CMP0066 controls the warning for policy CMP0066.
2166
2167 · CMAKE_POLICY_WARNING_CMP0067 controls the warning for policy CMP0067.
2168
2169 · CMAKE_POLICY_WARNING_CMP0082 controls the warning for policy CMP0082.
2170
2171 · CMAKE_POLICY_WARNING_CMP0089 controls the warning for policy CMP0089.
2172
2173 This variable should not be set by a project in CMake code. Project
2174 developers running CMake may set this variable in their cache to enable
2175 the warning (e.g. -DCMAKE_POLICY_WARNING_CMP<NNNN>=ON). Alternatively,
2176 running cmake(1) with the --debug-output, --trace, or --trace-expand
2177 option will also enable the warning.
2178
2179 CMAKE_PREFIX_PATH
2180 Semicolon-separated list of directories specifying installation pre‐
2181 fixes to be searched by the find_package(), find_program(),
2182 find_library(), find_file(), and find_path() commands. Each command
2183 will add appropriate subdirectories (like bin, lib, or include) as
2184 specified in its own documentation.
2185
2186 By default this is empty. It is intended to be set by the project.
2187
2188 See also CMAKE_SYSTEM_PREFIX_PATH, CMAKE_INCLUDE_PATH,
2189 CMAKE_LIBRARY_PATH, CMAKE_PROGRAM_PATH, and CMAKE_IGNORE_PATH.
2190
2191 CMAKE_PROGRAM_PATH
2192 Semicolon-separated list of directories specifying a search path for
2193 the find_program() command. By default it is empty, it is intended to
2194 be set by the project. See also CMAKE_SYSTEM_PROGRAM_PATH and
2195 CMAKE_PREFIX_PATH.
2196
2197 CMAKE_PROJECT_INCLUDE
2198 A CMake language file or module to be included as the last step of all
2199 project() command calls. This is intended for injecting custom code
2200 into project builds without modifying their source.
2201
2202 See also the CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE and
2203 CMAKE_PROJECT_INCLUDE_BEFORE variables.
2204
2205 CMAKE_PROJECT_INCLUDE_BEFORE
2206 A CMake language file or module to be included as the first step of all
2207 project() command calls. This is intended for injecting custom code
2208 into project builds without modifying their source.
2209
2210 See also the CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE and
2211 CMAKE_PROJECT_INCLUDE variables.
2212
2213 CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE
2214 A CMake language file or module to be included as the last step of any
2215 project() command calls that specify <PROJECT-NAME> as the project
2216 name. This is intended for injecting custom code into project builds
2217 without modifying their source.
2218
2219 See also the CMAKE_PROJECT_INCLUDE and CMAKE_PROJECT_INCLUDE_BEFORE
2220 variables.
2221
2222 CMAKE_SKIP_INSTALL_ALL_DEPENDENCY
2223 Don’t make the install target depend on the all target.
2224
2225 By default, the install target depends on the all target. This has the
2226 effect, that when make install is invoked or INSTALL is built, first
2227 the all target is built, then the installation starts. If
2228 CMAKE_SKIP_INSTALL_ALL_DEPENDENCY is set to TRUE, this dependency is
2229 not created, so the installation process will start immediately, inde‐
2230 pendent from whether the project has been completely built or not.
2231
2232 CMAKE_STAGING_PREFIX
2233 This variable may be set to a path to install to when cross-compiling.
2234 This can be useful if the path in CMAKE_SYSROOT is read-only, or other‐
2235 wise should remain pristine.
2236
2237 The CMAKE_STAGING_PREFIX location is also used as a search prefix by
2238 the find_* commands. This can be controlled by setting the
2239 CMAKE_FIND_NO_INSTALL_PREFIX variable.
2240
2241 If any RPATH/RUNPATH entries passed to the linker contain the
2242 CMAKE_STAGING_PREFIX, the matching path fragments are replaced with the
2243 CMAKE_INSTALL_PREFIX.
2244
2245 CMAKE_SUBLIME_TEXT_2_ENV_SETTINGS
2246 This variable contains a list of env vars as a list of tokens with the
2247 syntax var=value.
2248
2249 Example:
2250
2251 set(CMAKE_SUBLIME_TEXT_2_ENV_SETTINGS
2252 "FOO=FOO1\;FOO2\;FOON"
2253 "BAR=BAR1\;BAR2\;BARN"
2254 "BAZ=BAZ1\;BAZ2\;BAZN"
2255 "FOOBAR=FOOBAR1\;FOOBAR2\;FOOBARN"
2256 "VALID="
2257 )
2258
2259 In case of malformed variables CMake will fail:
2260
2261 set(CMAKE_SUBLIME_TEXT_2_ENV_SETTINGS
2262 "THIS_IS_NOT_VALID"
2263 )
2264
2265 CMAKE_SUBLIME_TEXT_2_EXCLUDE_BUILD_TREE
2266 If this variable evaluates to ON at the end of the top-level CMake‐
2267 Lists.txt file, the Sublime Text 2 extra generator excludes the build
2268 tree from the .sublime-project if it is inside the source tree.
2269
2270 CMAKE_SUPPRESS_REGENERATION
2271 If CMAKE_SUPPRESS_REGENERATION is OFF, which is default, then CMake
2272 adds a special target on which all other targets depend that checks the
2273 build system and optionally re-runs CMake to regenerate the build sys‐
2274 tem when the target specification source changes.
2275
2276 If this variable evaluates to ON at the end of the top-level CMake‐
2277 Lists.txt file, CMake will not add the regeneration target to the build
2278 system or perform any build system checks.
2279
2280 CMAKE_SYSROOT
2281 Path to pass to the compiler in the --sysroot flag.
2282
2283 The CMAKE_SYSROOT content is passed to the compiler in the --sysroot
2284 flag, if supported. The path is also stripped from the RPATH/RUNPATH
2285 if necessary on installation. The CMAKE_SYSROOT is also used to prefix
2286 paths searched by the find_* commands.
2287
2288 This variable may only be set in a toolchain file specified by the
2289 CMAKE_TOOLCHAIN_FILE variable.
2290
2291 See also the CMAKE_SYSROOT_COMPILE and CMAKE_SYSROOT_LINK variables.
2292
2293 CMAKE_SYSROOT_COMPILE
2294 Path to pass to the compiler in the --sysroot flag when compiling
2295 source files. This is the same as CMAKE_SYSROOT but is used only for
2296 compiling sources and not linking.
2297
2298 This variable may only be set in a toolchain file specified by the
2299 CMAKE_TOOLCHAIN_FILE variable.
2300
2301 CMAKE_SYSROOT_LINK
2302 Path to pass to the compiler in the --sysroot flag when linking. This
2303 is the same as CMAKE_SYSROOT but is used only for linking and not com‐
2304 piling sources.
2305
2306 This variable may only be set in a toolchain file specified by the
2307 CMAKE_TOOLCHAIN_FILE variable.
2308
2309 CMAKE_SYSTEM_APPBUNDLE_PATH
2310 Search path for macOS application bundles used by the find_program(),
2311 and find_package() commands. By default it contains the standard
2312 directories for the current system. It is not intended to be modified
2313 by the project, use CMAKE_APPBUNDLE_PATH for this.
2314
2315 CMAKE_SYSTEM_FRAMEWORK_PATH
2316 Search path for macOS frameworks used by the find_library(), find_pack‐
2317 age(), find_path(), and find_file() commands. By default it contains
2318 the standard directories for the current system. It is not intended to
2319 be modified by the project, use CMAKE_FRAMEWORK_PATH for this.
2320
2321 CMAKE_SYSTEM_IGNORE_PATH
2322 Semicolon-separated list of directories to be ignored by the find_pro‐
2323 gram(), find_library(), find_file(), and find_path() commands. This is
2324 useful in cross-compiling environments where some system directories
2325 contain incompatible but possibly linkable libraries. For example, on
2326 cross-compiled cluster environments, this allows a user to ignore
2327 directories containing libraries meant for the front-end machine.
2328
2329 By default this contains a list of directories containing incompatible
2330 binaries for the host system. See the CMAKE_IGNORE_PATH variable that
2331 is intended to be set by the project.
2332
2333 See also the CMAKE_SYSTEM_PREFIX_PATH, CMAKE_SYSTEM_LIBRARY_PATH,
2334 CMAKE_SYSTEM_INCLUDE_PATH, and CMAKE_SYSTEM_PROGRAM_PATH variables.
2335
2336 CMAKE_SYSTEM_INCLUDE_PATH
2337 Semicolon-separated list of directories specifying a search path for
2338 the find_file() and find_path() commands. By default this contains the
2339 standard directories for the current system. It is not intended to be
2340 modified by the project; use CMAKE_INCLUDE_PATH for this. See also
2341 CMAKE_SYSTEM_PREFIX_PATH.
2342
2343 CMAKE_SYSTEM_LIBRARY_PATH
2344 Semicolon-separated list of directories specifying a search path for
2345 the find_library() command. By default this contains the standard
2346 directories for the current system. It is not intended to be modified
2347 by the project; use CMAKE_LIBRARY_PATH for this. See also CMAKE_SYS‐
2348 TEM_PREFIX_PATH.
2349
2350 CMAKE_SYSTEM_PREFIX_PATH
2351 Semicolon-separated list of directories specifying installation pre‐
2352 fixes to be searched by the find_package(), find_program(),
2353 find_library(), find_file(), and find_path() commands. Each command
2354 will add appropriate subdirectories (like bin, lib, or include) as
2355 specified in its own documentation.
2356
2357 By default this contains the standard directories for the current sys‐
2358 tem, the CMAKE_INSTALL_PREFIX, and the CMAKE_STAGING_PREFIX. The
2359 installation and staging prefixes may be excluded by setting the
2360 CMAKE_FIND_NO_INSTALL_PREFIX variable.
2361
2362 CMAKE_SYSTEM_PREFIX_PATH is not intended to be modified by the project;
2363 use CMAKE_PREFIX_PATH for this.
2364
2365 See also CMAKE_SYSTEM_INCLUDE_PATH, CMAKE_SYSTEM_LIBRARY_PATH,
2366 CMAKE_SYSTEM_PROGRAM_PATH, and CMAKE_SYSTEM_IGNORE_PATH.
2367
2368 CMAKE_SYSTEM_PROGRAM_PATH
2369 Semicolon-separated list of directories specifying a search path for
2370 the find_program() command. By default this contains the standard
2371 directories for the current system. It is not intended to be modified
2372 by the project; use CMAKE_PROGRAM_PATH for this. See also CMAKE_SYS‐
2373 TEM_PREFIX_PATH.
2374
2375 CMAKE_USER_MAKE_RULES_OVERRIDE
2376 Specify a CMake file that overrides platform information.
2377
2378 CMake loads the specified file while enabling support for each language
2379 from either the project() or enable_language() commands. It is loaded
2380 after CMake’s builtin compiler and platform information modules have
2381 been loaded but before the information is used. The file may set plat‐
2382 form information variables to override CMake’s defaults.
2383
2384 This feature is intended for use only in overriding information vari‐
2385 ables that must be set before CMake builds its first test project to
2386 check that the compiler for a language works. It should not be used to
2387 load a file in cases that a normal include() will work. Use it only as
2388 a last resort for behavior that cannot be achieved any other way. For
2389 example, one may set the CMAKE_C_FLAGS_INIT variable to change the
2390 default value used to initialize the CMAKE_C_FLAGS variable before it
2391 is cached. The override file should NOT be used to set anything that
2392 could be set after languages are enabled, such as variables like
2393 CMAKE_RUNTIME_OUTPUT_DIRECTORY that affect the placement of binaries.
2394 Information set in the file will be used for try_compile() and
2395 try_run() builds too.
2396
2397 CMAKE_WARN_DEPRECATED
2398 Whether to issue warnings for deprecated functionality.
2399
2400 If not FALSE, use of deprecated functionality will issue warnings. If
2401 this variable is not set, CMake behaves as if it were set to TRUE.
2402
2403 When running cmake(1), this option can be enabled with the -Wdeprecated
2404 option, or disabled with the -Wno-deprecated option.
2405
2406 CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION
2407 Ask cmake_install.cmake script to warn each time a file with absolute
2408 INSTALL DESTINATION is encountered.
2409
2410 This variable is used by CMake-generated cmake_install.cmake scripts.
2411 If one sets this variable to ON while running the script, it may get
2412 warning messages from the script.
2413
2414 CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY
2415 If enabled, the Xcode generator will generate only a single Xcode
2416 project file for the topmost project() command instead of generating
2417 one for every project() command.
2418
2419 This could be useful to speed up the CMake generation step for large
2420 projects and to work-around a bug in the ZERO_CHECK logic.
2421
2422 CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER
2423 Whether to enable Address Sanitizer in the Diagnostics section of the
2424 generated Xcode scheme.
2425
2426 This variable initializes the XCODE_SCHEME_ADDRESS_SANITIZER property
2427 on all targets.
2428
2429 Please refer to the XCODE_GENERATE_SCHEME target property documentation
2430 to see all Xcode schema related properties.
2431
2432 CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN
2433 Whether to enable Detect use of stack after return in the Diagnostics
2434 section of the generated Xcode scheme.
2435
2436 This variable initializes the XCODE_SCHEME_ADDRESS_SANI‐
2437 TIZER_USE_AFTER_RETURN property on all targets.
2438
2439 Please refer to the XCODE_GENERATE_SCHEME target property documentation
2440 to see all Xcode schema related properties.
2441
2442 CMAKE_XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING
2443 Whether to enable Allow debugging when using document Versions Browser
2444 in the Options section of the generated Xcode scheme.
2445
2446 This variable initializes the XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING
2447 property on all targets.
2448
2449 Please refer to the XCODE_GENERATE_SCHEME target property documentation
2450 to see all Xcode schema related properties.
2451
2452 CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER
2453 Whether to disable the Main Thread Checker in the Diagnostics section
2454 of the generated Xcode scheme.
2455
2456 This variable initializes the XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER
2457 property on all targets.
2458
2459 Please refer to the XCODE_GENERATE_SCHEME target property documentation
2460 to see all Xcode schema related properties.
2461
2462 CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS
2463 Whether to enable Dynamic Library Loads in the Diagnostics section of
2464 the generated Xcode scheme.
2465
2466 This variable initializes the XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS prop‐
2467 erty on all targets.
2468
2469 Please refer to the XCODE_GENERATE_SCHEME target property documentation
2470 to see all Xcode schema related properties.
2471
2472 CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE
2473 Whether to enable Dynamic Linker API usage in the Diagnostics section
2474 of the generated Xcode scheme.
2475
2476 This variable initializes the XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE
2477 property on all targets.
2478
2479 Please refer to the XCODE_GENERATE_SCHEME target property documentation
2480 to see all Xcode schema related properties.
2481
2482 CMAKE_XCODE_SCHEME_GUARD_MALLOC
2483 Whether to enable Guard Malloc in the Diagnostics section of the gener‐
2484 ated Xcode scheme.
2485
2486 This variable initializes the XCODE_SCHEME_GUARD_MALLOC property on all
2487 targets.
2488
2489 Please refer to the XCODE_GENERATE_SCHEME target property documentation
2490 to see all Xcode schema related properties.
2491
2492 CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP
2493 Whether to enable the Main Thread Checker option Pause on issues in the
2494 Diagnostics section of the generated Xcode scheme.
2495
2496 This variable initializes the XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP
2497 property on all targets.
2498
2499 Please refer to the XCODE_GENERATE_SCHEME target property documentation
2500 to see all Xcode schema related properties.
2501
2502 CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES
2503 Whether to enable Malloc Guard Edges in the Diagnostics section of the
2504 generated Xcode scheme.
2505
2506 This variable initializes the XCODE_SCHEME_MALLOC_GUARD_EDGES property
2507 on all targets.
2508
2509 Please refer to the XCODE_GENERATE_SCHEME target property documentation
2510 to see all Xcode schema related properties.
2511
2512 CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE
2513 Whether to enable Malloc Scribble in the Diagnostics section of the
2514 generated Xcode scheme.
2515
2516 This variable initializes the XCODE_SCHEME_MALLOC_SCRIBBLE property on
2517 all targets.
2518
2519 Please refer to the XCODE_GENERATE_SCHEME target property documentation
2520 to see all Xcode schema related properties.
2521
2522 CMAKE_XCODE_SCHEME_MALLOC_STACK
2523 Whether to enable Malloc Stack in the Diagnostics section of the gener‐
2524 ated Xcode scheme.
2525
2526 This variable initializes the XCODE_SCHEME_MALLOC_STACK property on all
2527 targets.
2528
2529 Please refer to the XCODE_GENERATE_SCHEME target property documentation
2530 to see all Xcode schema related properties.
2531
2532 CMAKE_XCODE_SCHEME_THREAD_SANITIZER
2533 Whether to enable Thread Sanitizer in the Diagnostics section of the
2534 generated Xcode scheme.
2535
2536 This variable initializes the XCODE_SCHEME_THREAD_SANITIZER property on
2537 all targets.
2538
2539 Please refer to the XCODE_GENERATE_SCHEME target property documentation
2540 to see all Xcode schema related properties.
2541
2542 CMAKE_XCODE_SCHEME_THREAD_SANITIZER_STOP
2543 Whether to enable Thread Sanitizer - Pause on issues in the Diagnostics
2544 section of the generated Xcode scheme.
2545
2546 This variable initializes the XCODE_SCHEME_THREAD_SANITIZER_STOP prop‐
2547 erty on all targets.
2548
2549 Please refer to the XCODE_GENERATE_SCHEME target property documentation
2550 to see all Xcode schema related properties.
2551
2552 CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER
2553 Whether to enable Undefined Behavior Sanitizer in the Diagnostics sec‐
2554 tion of the generated Xcode scheme.
2555
2556 This variable initializes the XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANI‐
2557 TIZER property on all targets.
2558
2559 Please refer to the XCODE_GENERATE_SCHEME target property documentation
2560 to see all Xcode schema related properties.
2561
2562 CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP
2563 Whether to enable Undefined Behavior Sanitizer option Pause on issues
2564 in the Diagnostics section of the generated Xcode scheme.
2565
2566 This variable initializes the XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANI‐
2567 TIZER_STOP property on all targets.
2568
2569 Please refer to the XCODE_GENERATE_SCHEME target property documentation
2570 to see all Xcode schema related properties.
2571
2572 CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS
2573 Whether to enable Zombie Objects in the Diagnostics section of the gen‐
2574 erated Xcode scheme.
2575
2576 This variable initializes the XCODE_SCHEME_ZOMBIE_OBJECTS property on
2577 all targets.
2578
2579 Please refer to the XCODE_GENERATE_SCHEME target property documentation
2580 to see all Xcode schema related properties.
2581
2582 <PackageName>_ROOT
2583 Calls to find_package(<PackageName>) will search in prefixes specified
2584 by the <PackageName>_ROOT CMake variable, where <PackageName> is the
2585 name given to the find_package() call and _ROOT is literal. For exam‐
2586 ple, find_package(Foo) will search prefixes specified in the Foo_ROOT
2587 CMake variable (if set). See policy CMP0074.
2588
2589 This variable may hold a single prefix or a semicolon-separated list of
2590 multiple prefixes.
2591
2592 See also the <PackageName>_ROOT environment variable.
2593
2595 ANDROID
2596 Set to 1 when the target system (CMAKE_SYSTEM_NAME) is Android.
2597
2598 APPLE
2599 Set to True when the target system is an Apple platform (macOS, iOS,
2600 tvOS or watchOS).
2601
2602 BORLAND
2603 True if the Borland compiler is being used.
2604
2605 This is set to true if the Borland compiler is being used.
2606
2607 CMAKE_CL_64
2608 Discouraged. Use CMAKE_SIZEOF_VOID_P instead.
2609
2610 Set to a true value when using a Microsoft Visual Studio cl compiler
2611 that targets a 64-bit architecture.
2612
2613 CMAKE_COMPILER_2005
2614 Using the Visual Studio 2005 compiler from Microsoft
2615
2616 Set to true when using the Visual Studio 2005 compiler from Microsoft.
2617
2618 CMAKE_HOST_APPLE
2619 True for Apple macOS operating systems.
2620
2621 Set to true when the host system is Apple macOS.
2622
2623 CMAKE_HOST_SOLARIS
2624 True for Oracle Solaris operating systems.
2625
2626 Set to true when the host system is Oracle Solaris.
2627
2628 CMAKE_HOST_SYSTEM
2629 Composite Name of OS CMake is being run on.
2630
2631 This variable is the composite of CMAKE_HOST_SYSTEM_NAME and
2632 CMAKE_HOST_SYSTEM_VERSION, e.g. ${CMAKE_HOST_SYS‐
2633 TEM_NAME}-${CMAKE_HOST_SYSTEM_VERSION}. If CMAKE_HOST_SYSTEM_VERSION
2634 is not set, then this variable is the same as CMAKE_HOST_SYSTEM_NAME.
2635
2636 CMAKE_HOST_SYSTEM_NAME
2637 Name of the OS CMake is running on.
2638
2639 On systems that have the uname command, this variable is set to the
2640 output of uname -s. Linux, Windows, and Darwin for macOS are the val‐
2641 ues found on the big three operating systems.
2642
2643 CMAKE_HOST_SYSTEM_PROCESSOR
2644 The name of the CPU CMake is running on.
2645
2646 On systems that support uname, this variable is set to the output of
2647 uname -p. On Windows it is set to the value of the environment vari‐
2648 able PROCESSOR_ARCHITECTURE.
2649
2650 CMAKE_HOST_SYSTEM_VERSION
2651 The OS version CMake is running on.
2652
2653 A numeric version string for the system. On systems that support
2654 uname, this variable is set to the output of uname -r. On other systems
2655 this is set to major-minor version numbers.
2656
2657 CMAKE_HOST_UNIX
2658 True for UNIX and UNIX like operating systems.
2659
2660 Set to true when the host system is UNIX or UNIX like (i.e. APPLE and
2661 CYGWIN).
2662
2663 CMAKE_HOST_WIN32
2664 True if the host system is running Windows, including Windows 64-bit
2665 and MSYS.
2666
2667 Set to false on Cygwin.
2668
2669 CMAKE_LIBRARY_ARCHITECTURE
2670 Target architecture library directory name, if detected.
2671
2672 This is the value of CMAKE_<LANG>_LIBRARY_ARCHITECTURE as detected for
2673 one of the enabled languages.
2674
2675 CMAKE_LIBRARY_ARCHITECTURE_REGEX
2676 Regex matching possible target architecture library directory names.
2677
2678 This is used to detect CMAKE_<LANG>_LIBRARY_ARCHITECTURE from the
2679 implicit linker search path by matching the <arch> name.
2680
2681 CMAKE_OBJECT_PATH_MAX
2682 Maximum object file full-path length allowed by native build tools.
2683
2684 CMake computes for every source file an object file name that is unique
2685 to the source file and deterministic with respect to the full path to
2686 the source file. This allows multiple source files in a target to
2687 share the same name if they lie in different directories without
2688 rebuilding when one is added or removed. However, it can produce long
2689 full paths in a few cases, so CMake shortens the path using a hashing
2690 scheme when the full path to an object file exceeds a limit. CMake has
2691 a built-in limit for each platform that is sufficient for common tools,
2692 but some native tools may have a lower limit. This variable may be set
2693 to specify the limit explicitly. The value must be an integer no less
2694 than 128.
2695
2696 CMAKE_SYSTEM
2697 Composite name of operating system CMake is compiling for.
2698
2699 This variable is the composite of CMAKE_SYSTEM_NAME and CMAKE_SYS‐
2700 TEM_VERSION, e.g. ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_VERSION}. If
2701 CMAKE_SYSTEM_VERSION is not set, then this variable is the same as
2702 CMAKE_SYSTEM_NAME.
2703
2704 CMAKE_SYSTEM_NAME
2705 The name of the operating system for which CMake is to build. See the
2706 CMAKE_SYSTEM_VERSION variable for the OS version.
2707
2708 Note that CMAKE_SYSTEM_NAME is not set to anything by default when run‐
2709 ning in script mode, since it’s not building anything.
2710
2711 System Name for Host Builds
2712 CMAKE_SYSTEM_NAME is by default set to the same value as the
2713 CMAKE_HOST_SYSTEM_NAME variable so that the build targets the host sys‐
2714 tem.
2715
2716 System Name for Cross Compiling
2717 CMAKE_SYSTEM_NAME may be set explicitly when first configuring a new
2718 build tree in order to enable cross compiling. In this case the
2719 CMAKE_SYSTEM_VERSION variable must also be set explicitly.
2720
2721 CMAKE_SYSTEM_PROCESSOR
2722 The name of the CPU CMake is building for.
2723
2724 This variable is the same as CMAKE_HOST_SYSTEM_PROCESSOR if you build
2725 for the host system instead of the target system when cross compiling.
2726
2727 CMAKE_SYSTEM_VERSION
2728 The version of the operating system for which CMake is to build. See
2729 the CMAKE_SYSTEM_NAME variable for the OS name.
2730
2731 System Version for Host Builds
2732 When the CMAKE_SYSTEM_NAME variable takes its default value then
2733 CMAKE_SYSTEM_VERSION is by default set to the same value as the
2734 CMAKE_HOST_SYSTEM_VERSION variable so that the build targets the host
2735 system version.
2736
2737 In the case of a host build then CMAKE_SYSTEM_VERSION may be set
2738 explicitly when first configuring a new build tree in order to enable
2739 targeting the build for a different version of the host operating sys‐
2740 tem than is actually running on the host. This is allowed and not con‐
2741 sidered cross compiling so long as the binaries built for the specified
2742 OS version can still run on the host.
2743
2744 System Version for Cross Compiling
2745 When the CMAKE_SYSTEM_NAME variable is set explicitly to enable cross
2746 compiling then the value of CMAKE_SYSTEM_VERSION must also be set
2747 explicitly to specify the target system version.
2748
2749 CYGWIN
2750 True for Cygwin.
2751
2752 Set to true when using Cygwin.
2753
2754 GHS-MULTI
2755 True when using Green Hills MULTI generator.
2756
2757 IOS
2758 Set to 1 when the target system (CMAKE_SYSTEM_NAME) is iOS.
2759
2760 MINGW
2761 True when using MinGW
2762
2763 Set to true when the compiler is some version of MinGW.
2764
2765 MSVC
2766 Set to true when the compiler is some version of Microsoft Visual C++
2767 or another compiler simulating Visual C++. Any compiler defining
2768 _MSC_VER is considered simulating Visual C++.
2769
2770 See also the MSVC_VERSION variable.
2771
2772 MSVC10
2773 Discouraged. Use the MSVC_VERSION variable instead.
2774
2775 True when using the Microsoft Visual Studio v100 toolset (cl version
2776 16) or another compiler that simulates it.
2777
2778 MSVC11
2779 Discouraged. Use the MSVC_VERSION variable instead.
2780
2781 True when using the Microsoft Visual Studio v110 toolset (cl version
2782 17) or another compiler that simulates it.
2783
2784 MSVC12
2785 Discouraged. Use the MSVC_VERSION variable instead.
2786
2787 True when using the Microsoft Visual Studio v120 toolset (cl version
2788 18) or another compiler that simulates it.
2789
2790 MSVC14
2791 Discouraged. Use the MSVC_VERSION variable instead.
2792
2793 True when using the Microsoft Visual Studio v140 or v141 toolset (cl
2794 version 19) or another compiler that simulates it.
2795
2796 MSVC60
2797 Discouraged. Use the MSVC_VERSION variable instead.
2798
2799 True when using Microsoft Visual C++ 6.0.
2800
2801 Set to true when the compiler is version 6.0 of Microsoft Visual C++.
2802
2803 MSVC70
2804 Discouraged. Use the MSVC_VERSION variable instead.
2805
2806 True when using Microsoft Visual C++ 7.0.
2807
2808 Set to true when the compiler is version 7.0 of Microsoft Visual C++.
2809
2810 MSVC71
2811 Discouraged. Use the MSVC_VERSION variable instead.
2812
2813 True when using Microsoft Visual C++ 7.1.
2814
2815 Set to true when the compiler is version 7.1 of Microsoft Visual C++.
2816
2817 MSVC80
2818 Discouraged. Use the MSVC_VERSION variable instead.
2819
2820 True when using the Microsoft Visual Studio v80 toolset (cl version 14)
2821 or another compiler that simulates it.
2822
2823 MSVC90
2824 Discouraged. Use the MSVC_VERSION variable instead.
2825
2826 True when using the Microsoft Visual Studio v90 toolset (cl version 15)
2827 or another compiler that simulates it.
2828
2829 MSVC_IDE
2830 True when using the Microsoft Visual C++ IDE.
2831
2832 Set to true when the target platform is the Microsoft Visual C++ IDE,
2833 as opposed to the command line compiler.
2834
2835 MSVC_TOOLSET_VERSION
2836 The toolset version of Microsoft Visual C/C++ being used if any. If
2837 MSVC-like is being used, this variable is set based on the version of
2838 the compiler as given by the MSVC_VERSION variable.
2839
2840 Known toolset version numbers are:
2841
2842 80 = VS 2005 (8.0)
2843 90 = VS 2008 (9.0)
2844 100 = VS 2010 (10.0)
2845 110 = VS 2012 (11.0)
2846 120 = VS 2013 (12.0)
2847 140 = VS 2015 (14.0)
2848 141 = VS 2017 (15.0)
2849 142 = VS 2019 (16.0)
2850
2851 Compiler versions newer than those known to CMake will be reported as
2852 the latest known toolset version.
2853
2854 See also the MSVC_VERSION variable.
2855
2856 MSVC_VERSION
2857 The version of Microsoft Visual C/C++ being used if any. If a compiler
2858 simulating Visual C++ is being used, this variable is set to the
2859 toolset version simulated as given by the _MSC_VER preprocessor defini‐
2860 tion.
2861
2862 Known version numbers are:
2863
2864 1200 = VS 6.0
2865 1300 = VS 7.0
2866 1310 = VS 7.1
2867 1400 = VS 8.0 (v80 toolset)
2868 1500 = VS 9.0 (v90 toolset)
2869 1600 = VS 10.0 (v100 toolset)
2870 1700 = VS 11.0 (v110 toolset)
2871 1800 = VS 12.0 (v120 toolset)
2872 1900 = VS 14.0 (v140 toolset)
2873 1910-1919 = VS 15.0 (v141 toolset)
2874 1920-1929 = VS 16.0 (v142 toolset)
2875
2876 See also the CMAKE_<LANG>_COMPILER_VERSION and MSVC_TOOLSET_VERSION
2877 variable.
2878
2879 MSYS
2880 True when using the MSYS Makefiles generator.
2881
2882 UNIX
2883 Set to True when the target system is UNIX or UNIX-like (e.g. APPLE and
2884 CYGWIN). The CMAKE_SYSTEM_NAME variable should be queried if a more
2885 specific understanding of the target system is required.
2886
2887 WIN32
2888 Set to True when the target system is Windows, including Win64.
2889
2890 WINCE
2891 True when the CMAKE_SYSTEM_NAME variable is set to WindowsCE.
2892
2893 WINDOWS_PHONE
2894 True when the CMAKE_SYSTEM_NAME variable is set to WindowsPhone.
2895
2896 WINDOWS_STORE
2897 True when the CMAKE_SYSTEM_NAME variable is set to WindowsStore.
2898
2899 XCODE
2900 True when using Xcode generator.
2901
2902 XCODE_VERSION
2903 Version of Xcode (Xcode generator only).
2904
2905 Under the Xcode generator, this is the version of Xcode as specified in
2906 Xcode.app/Contents/version.plist (such as 3.1.2).
2907
2909 CMAKE_ANDROID_ANT_ADDITIONAL_OPTIONS
2910 Default value for the ANDROID_ANT_ADDITIONAL_OPTIONS target property.
2911 See that target property for additional information.
2912
2913 CMAKE_ANDROID_API
2914 When Cross Compiling for Android with NVIDIA Nsight Tegra Visual Studio
2915 Edition, this variable may be set to specify the default value for the
2916 ANDROID_API target property. See that target property for additional
2917 information.
2918
2919 Otherwise, when Cross Compiling for Android, this variable provides the
2920 Android API version number targeted. This will be the same value as
2921 the CMAKE_SYSTEM_VERSION variable for Android platforms.
2922
2923 CMAKE_ANDROID_API_MIN
2924 Default value for the ANDROID_API_MIN target property. See that target
2925 property for additional information.
2926
2927 CMAKE_ANDROID_ARCH
2928 When Cross Compiling for Android with NVIDIA Nsight Tegra Visual Studio
2929 Edition, this variable may be set to specify the default value for the
2930 ANDROID_ARCH target property. See that target property for additional
2931 information.
2932
2933 Otherwise, when Cross Compiling for Android, this variable provides the
2934 name of the Android architecture corresponding to the value of the
2935 CMAKE_ANDROID_ARCH_ABI variable. The architecture name may be one of:
2936
2937 · arm
2938
2939 · arm64
2940
2941 · mips
2942
2943 · mips64
2944
2945 · x86
2946
2947 · x86_64
2948
2949 CMAKE_ANDROID_ARCH_ABI
2950 When Cross Compiling for Android, this variable specifies the target
2951 architecture and ABI to be used. Valid values are:
2952
2953 · arm64-v8a
2954
2955 · armeabi-v7a
2956
2957 · armeabi-v6
2958
2959 · armeabi
2960
2961 · mips
2962
2963 · mips64
2964
2965 · x86
2966
2967 · x86_64
2968
2969 See also the CMAKE_ANDROID_ARM_MODE and CMAKE_ANDROID_ARM_NEON vari‐
2970 ables.
2971
2972 CMAKE_ANDROID_ARM_MODE
2973 When Cross Compiling for Android and CMAKE_ANDROID_ARCH_ABI is set to
2974 one of the armeabi architectures, set CMAKE_ANDROID_ARM_MODE to ON to
2975 target 32-bit ARM processors (-marm). Otherwise, the default is to
2976 target the 16-bit Thumb processors (-mthumb).
2977
2978 CMAKE_ANDROID_ARM_NEON
2979 When Cross Compiling for Android and CMAKE_ANDROID_ARCH_ABI is set to
2980 armeabi-v7a set CMAKE_ANDROID_ARM_NEON to ON to target ARM NEON
2981 devices.
2982
2983 CMAKE_ANDROID_ASSETS_DIRECTORIES
2984 Default value for the ANDROID_ASSETS_DIRECTORIES target property. See
2985 that target property for additional information.
2986
2987 CMAKE_ANDROID_GUI
2988 Default value for the ANDROID_GUI target property of executables. See
2989 that target property for additional information.
2990
2991 CMAKE_ANDROID_JAR_DEPENDENCIES
2992 Default value for the ANDROID_JAR_DEPENDENCIES target property. See
2993 that target property for additional information.
2994
2995 CMAKE_ANDROID_JAR_DIRECTORIES
2996 Default value for the ANDROID_JAR_DIRECTORIES target property. See
2997 that target property for additional information.
2998
2999 CMAKE_ANDROID_JAVA_SOURCE_DIR
3000 Default value for the ANDROID_JAVA_SOURCE_DIR target property. See
3001 that target property for additional information.
3002
3003 CMAKE_ANDROID_NATIVE_LIB_DEPENDENCIES
3004 Default value for the ANDROID_NATIVE_LIB_DEPENDENCIES target property.
3005 See that target property for additional information.
3006
3007 CMAKE_ANDROID_NATIVE_LIB_DIRECTORIES
3008 Default value for the ANDROID_NATIVE_LIB_DIRECTORIES target property.
3009 See that target property for additional information.
3010
3011 CMAKE_ANDROID_NDK
3012 When Cross Compiling for Android with the NDK, this variable holds the
3013 absolute path to the root directory of the NDK. The directory must
3014 contain a platforms subdirectory holding the android-<api> directories.
3015
3016 CMAKE_ANDROID_NDK_DEPRECATED_HEADERS
3017 When Cross Compiling for Android with the NDK, this variable may be set
3018 to specify whether to use the deprecated per-api-level headers instead
3019 of the unified headers.
3020
3021 If not specified, the default will be false if using a NDK version that
3022 provides the unified headers and true otherwise.
3023
3024 CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG
3025 When Cross Compiling for Android with the NDK, this variable provides
3026 the NDK’s “host tag” used to construct the path to prebuilt toolchains
3027 that run on the host.
3028
3029 CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION
3030 When Cross Compiling for Android with the NDK, this variable may be set
3031 to specify the version of the toolchain to be used as the compiler.
3032
3033 On NDK r19 or above, this variable must be unset or set to clang.
3034
3035 On NDK r18 or below, this variable must be set to one of these forms:
3036
3037 · <major>.<minor>: GCC of specified version
3038
3039 · clang<major>.<minor>: Clang of specified version
3040
3041 · clang: Clang of most recent available version
3042
3043 A toolchain of the requested version will be selected automatically to
3044 match the ABI named in the CMAKE_ANDROID_ARCH_ABI variable.
3045
3046 If not specified, the default will be a value that selects the latest
3047 available GCC toolchain.
3048
3049 CMAKE_ANDROID_PROCESS_MAX
3050 Default value for the ANDROID_PROCESS_MAX target property. See that
3051 target property for additional information.
3052
3053 CMAKE_ANDROID_PROGUARD
3054 Default value for the ANDROID_PROGUARD target property. See that tar‐
3055 get property for additional information.
3056
3057 CMAKE_ANDROID_PROGUARD_CONFIG_PATH
3058 Default value for the ANDROID_PROGUARD_CONFIG_PATH target property.
3059 See that target property for additional information.
3060
3061 CMAKE_ANDROID_SECURE_PROPS_PATH
3062 Default value for the ANDROID_SECURE_PROPS_PATH target property. See
3063 that target property for additional information.
3064
3065 CMAKE_ANDROID_SKIP_ANT_STEP
3066 Default value for the ANDROID_SKIP_ANT_STEP target property. See that
3067 target property for additional information.
3068
3069 CMAKE_ANDROID_STANDALONE_TOOLCHAIN
3070 When Cross Compiling for Android with a Standalone Toolchain, this
3071 variable holds the absolute path to the root directory of the
3072 toolchain. The specified directory must contain a sysroot subdirec‐
3073 tory.
3074
3075 CMAKE_ANDROID_STL_TYPE
3076 When Cross Compiling for Android with NVIDIA Nsight Tegra Visual Studio
3077 Edition, this variable may be set to specify the default value for the
3078 ANDROID_STL_TYPE target property. See that target property for addi‐
3079 tional information.
3080
3081 When Cross Compiling for Android with the NDK, this variable may be set
3082 to specify the STL variant to be used. The value may be one of:
3083
3084 none No C++ Support
3085
3086 system Minimal C++ without STL
3087
3088 gabi++_static
3089 GAbi++ Static
3090
3091 gabi++_shared
3092 GAbi++ Shared
3093
3094 gnustl_static
3095 GNU libstdc++ Static
3096
3097 gnustl_shared
3098 GNU libstdc++ Shared
3099
3100 c++_static
3101 LLVM libc++ Static
3102
3103 c++_shared
3104 LLVM libc++ Shared
3105
3106 stlport_static
3107 STLport Static
3108
3109 stlport_shared
3110 STLport Shared
3111
3112 The default value is gnustl_static on NDK versions that provide it and
3113 otherwise c++_static. Note that this default differs from the native
3114 NDK build system because CMake may be used to build projects for
3115 Android that are not natively implemented for it and use the C++ stan‐
3116 dard library.
3117
3118 CMAKE_ARCHIVE_OUTPUT_DIRECTORY
3119 Where to put all the ARCHIVE target files when built.
3120
3121 This variable is used to initialize the ARCHIVE_OUTPUT_DIRECTORY prop‐
3122 erty on all the targets. See that target property for additional
3123 information.
3124
3125 CMAKE_ARCHIVE_OUTPUT_DIRECTORY_<CONFIG>
3126 Where to put all the ARCHIVE target files when built for a specific
3127 configuration.
3128
3129 This variable is used to initialize the ARCHIVE_OUTPUT_DIRECTORY_<CON‐
3130 FIG> property on all the targets. See that target property for addi‐
3131 tional information.
3132
3133 CMAKE_AUTOGEN_ORIGIN_DEPENDS
3134 Switch for forwarding origin target dependencies to the corresponding
3135 _autogen targets.
3136
3137 This variable is used to initialize the AUTOGEN_ORIGIN_DEPENDS property
3138 on all the targets. See that target property for additional informa‐
3139 tion.
3140
3141 By default CMAKE_AUTOGEN_ORIGIN_DEPENDS is ON.
3142
3143 CMAKE_AUTOGEN_PARALLEL
3144 Number of parallel moc or uic processes to start when using AUTOMOC and
3145 AUTOUIC.
3146
3147 This variable is used to initialize the AUTOGEN_PARALLEL property on
3148 all the targets. See that target property for additional information.
3149
3150 By default CMAKE_AUTOGEN_PARALLEL is unset.
3151
3152 CMAKE_AUTOGEN_VERBOSE
3153 Sets the verbosity of AUTOMOC, AUTOUIC and AUTORCC. A positive integer
3154 value or a true boolean value lets the AUTO* generators output addi‐
3155 tional processing information.
3156
3157 Setting CMAKE_AUTOGEN_VERBOSE has the same effect as setting the VER‐
3158 BOSE environment variable during generation (e.g. by calling make VER‐
3159 BOSE=1). The extra verbosity is limited to the AUTO* generators
3160 though.
3161
3162 By default CMAKE_AUTOGEN_VERBOSE is unset.
3163
3164 CMAKE_AUTOMOC
3165 Whether to handle moc automatically for Qt targets.
3166
3167 This variable is used to initialize the AUTOMOC property on all the
3168 targets. See that target property for additional information.
3169
3170 CMAKE_AUTOMOC_COMPILER_PREDEFINES
3171 This variable is used to initialize the AUTOMOC_COMPILER_PREDEFINES
3172 property on all the targets. See that target property for additional
3173 information.
3174
3175 By default it is ON.
3176
3177 CMAKE_AUTOMOC_DEPEND_FILTERS
3178 Filter definitions used by CMAKE_AUTOMOC to extract file names from
3179 source code as additional dependencies for the moc file.
3180
3181 This variable is used to initialize the AUTOMOC_DEPEND_FILTERS property
3182 on all the targets. See that target property for additional informa‐
3183 tion.
3184
3185 By default it is empty.
3186
3187 CMAKE_AUTOMOC_MACRO_NAMES
3188 Semicolon-separated list list of macro names used by CMAKE_AUTOMOC to
3189 determine if a C++ file needs to be processed by moc.
3190
3191 This variable is used to initialize the AUTOMOC_MACRO_NAMES property on
3192 all the targets. See that target property for additional information.
3193
3194 The default value is Q_OBJECT;Q_GADGET;Q_NAMESPACE.
3195
3196 Example
3197 Let CMake know that source files that contain CUSTOM_MACRO must be moc
3198 processed as well:
3199
3200 set(CMAKE_AUTOMOC ON)
3201 list(APPEND CMAKE_AUTOMOC_MACRO_NAMES "CUSTOM_MACRO")
3202
3203 CMAKE_AUTOMOC_MOC_OPTIONS
3204 Additional options for moc when using CMAKE_AUTOMOC.
3205
3206 This variable is used to initialize the AUTOMOC_MOC_OPTIONS property on
3207 all the targets. See that target property for additional information.
3208
3209 CMAKE_AUTOMOC_PATH_PREFIX
3210 Whether to generate the -p path prefix option for moc on AUTOMOC
3211 enabled Qt targets.
3212
3213 This variable is used to initialize the AUTOMOC_PATH_PREFIX property on
3214 all the targets. See that target property for additional information.
3215
3216 The default value is ON.
3217
3218 CMAKE_AUTORCC
3219 Whether to handle rcc automatically for Qt targets.
3220
3221 This variable is used to initialize the AUTORCC property on all the
3222 targets. See that target property for additional information.
3223
3224 CMAKE_AUTORCC_OPTIONS
3225 Additional options for rcc when using CMAKE_AUTORCC.
3226
3227 This variable is used to initialize the AUTORCC_OPTIONS property on all
3228 the targets. See that target property for additional information.
3229
3230 EXAMPLE
3231 # ...
3232 set(CMAKE_AUTORCC_OPTIONS "--compress;9")
3233 # ...
3234
3235 CMAKE_AUTOUIC
3236 Whether to handle uic automatically for Qt targets.
3237
3238 This variable is used to initialize the AUTOUIC property on all the
3239 targets. See that target property for additional information.
3240
3241 CMAKE_AUTOUIC_OPTIONS
3242 Additional options for uic when using CMAKE_AUTOUIC.
3243
3244 This variable is used to initialize the AUTOUIC_OPTIONS property on all
3245 the targets. See that target property for additional information.
3246
3247 EXAMPLE
3248 # ...
3249 set_property(CMAKE_AUTOUIC_OPTIONS "--no-protection")
3250 # ...
3251
3252 CMAKE_AUTOUIC_SEARCH_PATHS
3253 Search path list used by CMAKE_AUTOUIC to find included .ui files.
3254
3255 This variable is used to initialize the AUTOUIC_SEARCH_PATHS property
3256 on all the targets. See that target property for additional informa‐
3257 tion.
3258
3259 By default it is empty.
3260
3261 CMAKE_BUILD_RPATH
3262 Semicolon-separated list specifying runtime path (RPATH) entries to add
3263 to binaries linked in the build tree (for platforms that support it).
3264 The entries will not be used for binaries in the install tree. See
3265 also the CMAKE_INSTALL_RPATH variable.
3266
3267 This is used to initialize the BUILD_RPATH target property for all tar‐
3268 gets.
3269
3270 CMAKE_BUILD_RPATH_USE_ORIGIN
3271 Whether to use relative paths for the build RPATH.
3272
3273 This is used to initialize the BUILD_RPATH_USE_ORIGIN target property
3274 for all targets, see that property for more details.
3275
3276 CMAKE_BUILD_WITH_INSTALL_NAME_DIR
3277 Whether to use INSTALL_NAME_DIR on targets in the build tree.
3278
3279 This variable is used to initialize the BUILD_WITH_INSTALL_NAME_DIR
3280 property on all targets.
3281
3282 CMAKE_BUILD_WITH_INSTALL_RPATH
3283 Use the install path for the RPATH.
3284
3285 Normally CMake uses the build tree for the RPATH when building executa‐
3286 bles etc on systems that use RPATH. When the software is installed the
3287 executables etc are relinked by CMake to have the install RPATH. If
3288 this variable is set to true then the software is always built with the
3289 install path for the RPATH and does not need to be relinked when
3290 installed.
3291
3292 CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY
3293 Output directory for MS debug symbol .pdb files generated by the com‐
3294 piler while building source files.
3295
3296 This variable is used to initialize the COMPILE_PDB_OUTPUT_DIRECTORY
3297 property on all the targets.
3298
3299 CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG>
3300 Per-configuration output directory for MS debug symbol .pdb files gen‐
3301 erated by the compiler while building source files.
3302
3303 This is a per-configuration version of CMAKE_COMPILE_PDB_OUTPUT_DIREC‐
3304 TORY. This variable is used to initialize the COMPILE_PDB_OUT‐
3305 PUT_DIRECTORY_<CONFIG> property on all the targets.
3306
3307 CMAKE_<CONFIG>_POSTFIX
3308 Default filename postfix for libraries under configuration <CONFIG>.
3309
3310 When a non-executable target is created its <CONFIG>_POSTFIX target
3311 property is initialized with the value of this variable if it is set.
3312
3313 CMAKE_CUDA_SEPARABLE_COMPILATION
3314 Default value for CUDA_SEPARABLE_COMPILATION target property. This
3315 variable is used to initialize the property on each target as it is
3316 created.
3317
3318 CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS
3319 Default value for CUDA_RESOLVE_DEVICE_SYMBOLS target property. This
3320 variable is used to initialize the property on each target as it is
3321 created.
3322
3323 CMAKE_DEBUG_POSTFIX
3324 See variable CMAKE_<CONFIG>_POSTFIX.
3325
3326 This variable is a special case of the more-general CMAKE_<CON‐
3327 FIG>_POSTFIX variable for the DEBUG configuration.
3328
3329 CMAKE_DISABLE_PRECOMPILE_HEADERS
3330 Default value for DISABLE_PRECOMPILE_HEADERS of targets.
3331
3332 By default CMAKE_DISABLE_PRECOMPILE_HEADERS is OFF.
3333
3334 CMAKE_ENABLE_EXPORTS
3335 Specify whether executables export symbols for loadable modules.
3336
3337 This variable is used to initialize the ENABLE_EXPORTS target property
3338 for executable targets when they are created by calls to the add_exe‐
3339 cutable() command. See the property documentation for details.
3340
3341 CMAKE_EXE_LINKER_FLAGS
3342 Linker flags to be used to create executables.
3343
3344 These flags will be used by the linker when creating an executable.
3345
3346 CMAKE_EXE_LINKER_FLAGS_<CONFIG>
3347 Flags to be used when linking an executable.
3348
3349 Same as CMAKE_C_FLAGS_* but used by the linker when creating executa‐
3350 bles.
3351
3352 CMAKE_EXE_LINKER_FLAGS_<CONFIG>_INIT
3353 Value used to initialize the CMAKE_EXE_LINKER_FLAGS_<CONFIG> cache
3354 entry the first time a build tree is configured. This variable is
3355 meant to be set by a toolchain file. CMake may prepend or append con‐
3356 tent to the value based on the environment and target platform.
3357
3358 See also CMAKE_EXE_LINKER_FLAGS_INIT.
3359
3360 CMAKE_EXE_LINKER_FLAGS_INIT
3361 Value used to initialize the CMAKE_EXE_LINKER_FLAGS cache entry the
3362 first time a build tree is configured. This variable is meant to be
3363 set by a toolchain file. CMake may prepend or append content to the
3364 value based on the environment and target platform.
3365
3366 See also the configuration-specific variable
3367 CMAKE_EXE_LINKER_FLAGS_<CONFIG>_INIT.
3368
3369 CMAKE_FOLDER
3370 Set the folder name. Use to organize targets in an IDE.
3371
3372 This variable is used to initialize the FOLDER property on all the tar‐
3373 gets. See that target property for additional information.
3374
3375 CMAKE_FRAMEWORK
3376 Default value for FRAMEWORK of targets.
3377
3378 This variable is used to initialize the FRAMEWORK property on all the
3379 targets. See that target property for additional information.
3380
3381 CMAKE_Fortran_FORMAT
3382 Set to FIXED or FREE to indicate the Fortran source layout.
3383
3384 This variable is used to initialize the Fortran_FORMAT property on all
3385 the targets. See that target property for additional information.
3386
3387 CMAKE_Fortran_MODULE_DIRECTORY
3388 Fortran module output directory.
3389
3390 This variable is used to initialize the Fortran_MODULE_DIRECTORY prop‐
3391 erty on all the targets. See that target property for additional
3392 information.
3393
3394 CMAKE_GHS_NO_SOURCE_GROUP_FILE
3395 ON / OFF boolean to control if the project file for a target should be
3396 one single file or multiple files. Refer to GHS_NO_SOURCE_GROUP_FILE
3397 for further details.
3398
3399 CMAKE_GLOBAL_AUTOGEN_TARGET
3400 Switch to enable generation of a global autogen target.
3401
3402 When CMAKE_GLOBAL_AUTORCC_TARGET is enabled, a custom target autogen is
3403 generated. This target depends on all AUTOMOC and AUTOUIC generated
3404 <ORIGIN>_autogen targets in the project. By building the global auto‐
3405 gen target, all AUTOMOC and AUTOUIC files in the project will be gener‐
3406 ated.
3407
3408 The name of the global autogen target can be changed by setting
3409 CMAKE_GLOBAL_AUTOGEN_TARGET_NAME.
3410
3411 By default CMAKE_GLOBAL_AUTOGEN_TARGET is unset.
3412
3413 See the cmake-qt(7) manual for more information on using CMake with Qt.
3414
3415 Note
3416 <ORIGIN>_autogen targets by default inherit their origin target’s
3417 dependencies. This might result in unintended dependency target builds
3418 when only <ORIGIN>_autogen targets are built. A solution is to disable
3419 AUTOGEN_ORIGIN_DEPENDS on the respective origin targets.
3420
3421 CMAKE_GLOBAL_AUTOGEN_TARGET_NAME
3422 Change the name of the global autogen target.
3423
3424 When CMAKE_GLOBAL_AUTOGEN_TARGET is enabled, a global custom target
3425 named autogen is created. CMAKE_GLOBAL_AUTOGEN_TARGET_NAME allows to
3426 set a different name for that target.
3427
3428 By default CMAKE_GLOBAL_AUTOGEN_TARGET_NAME is unset.
3429
3430 See the cmake-qt(7) manual for more information on using CMake with Qt.
3431
3432 CMAKE_GLOBAL_AUTORCC_TARGET
3433 Switch to enable generation of a global autorcc target.
3434
3435 When CMAKE_GLOBAL_AUTORCC_TARGET is enabled, a custom target autorcc is
3436 generated. This target depends on all AUTORCC generated <ORI‐
3437 GIN>_arcc_<QRC> targets in the project. By building the global autorcc
3438 target, all AUTORCC files in the project will be generated.
3439
3440 The name of the global autorcc target can be changed by setting
3441 CMAKE_GLOBAL_AUTORCC_TARGET_NAME.
3442
3443 By default CMAKE_GLOBAL_AUTORCC_TARGET is unset.
3444
3445 See the cmake-qt(7) manual for more information on using CMake with Qt.
3446
3447 CMAKE_GLOBAL_AUTORCC_TARGET_NAME
3448 Change the name of the global autorcc target.
3449
3450 When CMAKE_GLOBAL_AUTORCC_TARGET is enabled, a global custom target
3451 named autorcc is created. CMAKE_GLOBAL_AUTORCC_TARGET_NAME allows to
3452 set a different name for that target.
3453
3454 By default CMAKE_GLOBAL_AUTOGEN_TARGET_NAME is unset.
3455
3456 See the cmake-qt(7) manual for more information on using CMake with Qt.
3457
3458 CMAKE_GNUtoMS
3459 Convert GNU import libraries (.dll.a) to MS format (.lib).
3460
3461 This variable is used to initialize the GNUtoMS property on targets
3462 when they are created. See that target property for additional infor‐
3463 mation.
3464
3465 CMAKE_INCLUDE_CURRENT_DIR
3466 Automatically add the current source and build directories to the
3467 include path.
3468
3469 If this variable is enabled, CMake automatically adds CMAKE_CUR‐
3470 RENT_SOURCE_DIR and CMAKE_CURRENT_BINARY_DIR to the include path for
3471 each directory. These additional include directories do not propagate
3472 down to subdirectories. This is useful mainly for out-of-source
3473 builds, where files generated into the build tree are included by files
3474 located in the source tree.
3475
3476 By default CMAKE_INCLUDE_CURRENT_DIR is OFF.
3477
3478 CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE
3479 Automatically add the current source and build directories to the
3480 INTERFACE_INCLUDE_DIRECTORIES target property.
3481
3482 If this variable is enabled, CMake automatically adds for each shared
3483 library target, static library target, module target and executable
3484 target, CMAKE_CURRENT_SOURCE_DIR and CMAKE_CURRENT_BINARY_DIR to the
3485 INTERFACE_INCLUDE_DIRECTORIES target property. By default
3486 CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE is OFF.
3487
3488 CMAKE_INSTALL_NAME_DIR
3489 macOS directory name for installed targets.
3490
3491 CMAKE_INSTALL_NAME_DIR is used to initialize the INSTALL_NAME_DIR prop‐
3492 erty on all targets. See that target property for more information.
3493
3494 CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH
3495 Sets the default for whether toolchain-defined rpaths should be removed
3496 during installation.
3497
3498 CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH is a boolean that provides the
3499 default value for the INSTALL_REMOVE_ENVIRONMENT_RPATH property of all
3500 subsequently created targets.
3501
3502 CMAKE_INSTALL_RPATH
3503 The rpath to use for installed targets.
3504
3505 A semicolon-separated list specifying the rpath to use in installed
3506 targets (for platforms that support it). This is used to initialize
3507 the target property INSTALL_RPATH for all targets.
3508
3509 CMAKE_INSTALL_RPATH_USE_LINK_PATH
3510 Add paths to linker search and installed rpath.
3511
3512 CMAKE_INSTALL_RPATH_USE_LINK_PATH is a boolean that if set to true will
3513 append directories in the linker search path and outside the project to
3514 the INSTALL_RPATH. This is used to initialize the target property
3515 INSTALL_RPATH_USE_LINK_PATH for all targets.
3516
3517 CMAKE_INTERPROCEDURAL_OPTIMIZATION
3518 Default value for INTERPROCEDURAL_OPTIMIZATION of targets.
3519
3520 This variable is used to initialize the INTERPROCEDURAL_OPTIMIZATION
3521 property on all the targets. See that target property for additional
3522 information.
3523
3524 CMAKE_INTERPROCEDURAL_OPTIMIZATION_<CONFIG>
3525 Default value for INTERPROCEDURAL_OPTIMIZATION_<CONFIG> of targets.
3526
3527 This variable is used to initialize the INTERPROCEDURAL_OPTIMIZA‐
3528 TION_<CONFIG> property on all the targets. See that target property
3529 for additional information.
3530
3531 CMAKE_IOS_INSTALL_COMBINED
3532 Default value for IOS_INSTALL_COMBINED of targets.
3533
3534 This variable is used to initialize the IOS_INSTALL_COMBINED property
3535 on all the targets. See that target property for additional informa‐
3536 tion.
3537
3538 CMAKE_<LANG>_CLANG_TIDY
3539 Default value for <LANG>_CLANG_TIDY target property when <LANG> is C or
3540 CXX.
3541
3542 This variable is used to initialize the property on each target as it
3543 is created. For example:
3544
3545 set(CMAKE_CXX_CLANG_TIDY clang-tidy -checks=-*,readability-*)
3546 add_executable(foo foo.cxx)
3547
3548 CMAKE_<LANG>_COMPILER_LAUNCHER
3549 Default value for <LANG>_COMPILER_LAUNCHER target property. This vari‐
3550 able is used to initialize the property on each target as it is cre‐
3551 ated. This is done only when <LANG> is C, CXX, Fortran, or CUDA.
3552
3553 CMAKE_<LANG>_CPPCHECK
3554 Default value for <LANG>_CPPCHECK target property. This variable is
3555 used to initialize the property on each target as it is created. This
3556 is done only when <LANG> is C or CXX.
3557
3558 CMAKE_<LANG>_CPPLINT
3559 Default value for <LANG>_CPPLINT target property. This variable is used
3560 to initialize the property on each target as it is created. This is
3561 done only when <LANG> is C or CXX.
3562
3563 CMAKE_<LANG>_INCLUDE_WHAT_YOU_USE
3564 Default value for <LANG>_INCLUDE_WHAT_YOU_USE target property. This
3565 variable is used to initialize the property on each target as it is
3566 created. This is done only when <LANG> is C or CXX.
3567
3568 CMAKE_<LANG>_LINK_LIBRARY_FILE_FLAG
3569 Language-specific flag to be used to link a library specified by a path
3570 to its file.
3571
3572 The flag will be used before a library file path is given to the
3573 linker. This is needed only on very few platforms.
3574
3575 CMAKE_<LANG>_LINK_LIBRARY_FLAG
3576 Flag to be used to link a library into a shared library or executable.
3577
3578 This flag will be used to specify a library to link to a shared library
3579 or an executable for the specific language. On most compilers this is
3580 -l.
3581
3582 CMAKE_<LANG>_VISIBILITY_PRESET
3583 Default value for the <LANG>_VISIBILITY_PRESET target property when a
3584 target is created.
3585
3586 CMAKE_LIBRARY_OUTPUT_DIRECTORY
3587 Where to put all the LIBRARY target files when built.
3588
3589 This variable is used to initialize the LIBRARY_OUTPUT_DIRECTORY prop‐
3590 erty on all the targets. See that target property for additional
3591 information.
3592
3593 CMAKE_LIBRARY_OUTPUT_DIRECTORY_<CONFIG>
3594 Where to put all the LIBRARY target files when built for a specific
3595 configuration.
3596
3597 This variable is used to initialize the LIBRARY_OUTPUT_DIRECTORY_<CON‐
3598 FIG> property on all the targets. See that target property for addi‐
3599 tional information.
3600
3601 CMAKE_LIBRARY_PATH_FLAG
3602 The flag to be used to add a library search path to a compiler.
3603
3604 The flag will be used to specify a library directory to the compiler.
3605 On most compilers this is -L.
3606
3607 CMAKE_LINK_DEF_FILE_FLAG
3608 Linker flag to be used to specify a .def file for dll creation.
3609
3610 The flag will be used to add a .def file when creating a dll on Win‐
3611 dows; this is only defined on Windows.
3612
3613 CMAKE_LINK_DEPENDS_NO_SHARED
3614 Whether to skip link dependencies on shared library files.
3615
3616 This variable initializes the LINK_DEPENDS_NO_SHARED property on tar‐
3617 gets when they are created. See that target property for additional
3618 information.
3619
3620 CMAKE_LINK_INTERFACE_LIBRARIES
3621 Default value for LINK_INTERFACE_LIBRARIES of targets.
3622
3623 This variable is used to initialize the LINK_INTERFACE_LIBRARIES prop‐
3624 erty on all the targets. See that target property for additional
3625 information.
3626
3627 CMAKE_LINK_LIBRARY_FILE_FLAG
3628 Flag to be used to link a library specified by a path to its file.
3629
3630 The flag will be used before a library file path is given to the
3631 linker. This is needed only on very few platforms.
3632
3633 CMAKE_LINK_LIBRARY_FLAG
3634 Flag to be used to link a library into an executable.
3635
3636 The flag will be used to specify a library to link to an executable.
3637 On most compilers this is -l.
3638
3639 CMAKE_LINK_WHAT_YOU_USE
3640 Default value for LINK_WHAT_YOU_USE target property. This variable is
3641 used to initialize the property on each target as it is created.
3642
3643 CMAKE_MACOSX_BUNDLE
3644 Default value for MACOSX_BUNDLE of targets.
3645
3646 This variable is used to initialize the MACOSX_BUNDLE property on all
3647 the targets. See that target property for additional information.
3648
3649 This variable is set to ON by default if CMAKE_SYSTEM_NAME equals to
3650 iOS, tvOS or watchOS.
3651
3652 CMAKE_MACOSX_RPATH
3653 Whether to use rpaths on macOS and iOS.
3654
3655 This variable is used to initialize the MACOSX_RPATH property on all
3656 targets.
3657
3658 CMAKE_MAP_IMPORTED_CONFIG_<CONFIG>
3659 Default value for MAP_IMPORTED_CONFIG_<CONFIG> of targets.
3660
3661 This variable is used to initialize the MAP_IMPORTED_CONFIG_<CONFIG>
3662 property on all the targets. See that target property for additional
3663 information.
3664
3665 CMAKE_MODULE_LINKER_FLAGS
3666 Linker flags to be used to create modules.
3667
3668 These flags will be used by the linker when creating a module.
3669
3670 CMAKE_MODULE_LINKER_FLAGS_<CONFIG>
3671 Flags to be used when linking a module.
3672
3673 Same as CMAKE_C_FLAGS_* but used by the linker when creating modules.
3674
3675 CMAKE_MODULE_LINKER_FLAGS_<CONFIG>_INIT
3676 Value used to initialize the CMAKE_MODULE_LINKER_FLAGS_<CONFIG> cache
3677 entry the first time a build tree is configured. This variable is
3678 meant to be set by a toolchain file. CMake may prepend or append con‐
3679 tent to the value based on the environment and target platform.
3680
3681 See also CMAKE_MODULE_LINKER_FLAGS_INIT.
3682
3683 CMAKE_MODULE_LINKER_FLAGS_INIT
3684 Value used to initialize the CMAKE_MODULE_LINKER_FLAGS cache entry the
3685 first time a build tree is configured. This variable is meant to be
3686 set by a toolchain file. CMake may prepend or append content to the
3687 value based on the environment and target platform.
3688
3689 See also the configuration-specific variable CMAKE_MOD‐
3690 ULE_LINKER_FLAGS_<CONFIG>_INIT.
3691
3692 CMAKE_MSVCIDE_RUN_PATH
3693 Extra PATH locations that should be used when executing add_custom_com‐
3694 mand() or add_custom_target() when using the Visual Studio 9 2008 (or
3695 above) generator. This allows for running commands and using dll’s that
3696 the IDE environment is not aware of.
3697
3698 If not set explicitly the value is initialized by the CMAKE_MSV‐
3699 CIDE_RUN_PATH environment variable, if set, and otherwise left empty.
3700
3701 CMAKE_MSVC_RUNTIME_LIBRARY
3702 Select the MSVC runtime library for use by compilers targeting the MSVC
3703 ABI. This variable is used to initialize the MSVC_RUNTIME_LIBRARY
3704 property on all targets as they are created. It is also propagated by
3705 calls to the try_compile() command into the test project.
3706
3707 The allowed values are:
3708
3709 MultiThreaded
3710 Compile with -MT or equivalent flag(s) to use a multi-threaded
3711 statically-linked runtime library.
3712
3713 MultiThreadedDLL
3714 Compile with -MD or equivalent flag(s) to use a multi-threaded
3715 dynamically-linked runtime library.
3716
3717 MultiThreadedDebug
3718 Compile with -MTd or equivalent flag(s) to use a multi-threaded
3719 statically-linked runtime library.
3720
3721 MultiThreadedDebugDLL
3722 Compile with -MDd or equivalent flag(s) to use a multi-threaded
3723 dynamically-linked runtime library.
3724
3725 The value is ignored on non-MSVC compilers but an unsupported value
3726 will be rejected as an error when using a compiler targeting the MSVC
3727 ABI.
3728
3729 The value may also be the empty string ("") in which case no runtime
3730 library selection flag will be added explicitly by CMake. Note that
3731 with Visual Studio Generators the native build system may choose to add
3732 its own default runtime library selection flag.
3733
3734 Use generator expressions to support per-configuration specification.
3735 For example, the code:
3736
3737 set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
3738
3739 selects for all following targets a multi-threaded statically-linked
3740 runtime library with or without debug information depending on the con‐
3741 figuration.
3742
3743 If this variable is not set then the MSVC_RUNTIME_LIBRARY target prop‐
3744 erty will not be set automatically. If that property is not set then
3745 CMake uses the default value MultiThreaded$<$<CONFIG:Debug>:Debug>DLL
3746 to select a MSVC runtime library.
3747
3748 NOTE:
3749 This variable has effect only when policy CMP0091 is set to NEW
3750 prior to the first project() or enable_language() command that
3751 enables a language using a compiler targeting the MSVC ABI.
3752
3753 CMAKE_NINJA_OUTPUT_PATH_PREFIX
3754 Set output files path prefix for the Ninja generator.
3755
3756 Every output files listed in the generated build.ninja will be prefixed
3757 by the contents of this variable (a trailing slash is appended if miss‐
3758 ing). This is useful when the generated ninja file is meant to be
3759 embedded as a subninja file into a super ninja project. For example, a
3760 ninja build file generated with a command like:
3761
3762 cd top-build-dir/sub &&
3763 cmake -G Ninja -DCMAKE_NINJA_OUTPUT_PATH_PREFIX=sub/ path/to/source
3764
3765 can be embedded in top-build-dir/build.ninja with a directive like
3766 this:
3767
3768 subninja sub/build.ninja
3769
3770 The auto-regeneration rule in top-build-dir/build.ninja must have an
3771 order-only dependency on sub/build.ninja.
3772
3773 NOTE:
3774 When CMAKE_NINJA_OUTPUT_PATH_PREFIX is set, the project generated by
3775 CMake cannot be used as a standalone project. No default targets
3776 are specified.
3777
3778 CMAKE_NO_BUILTIN_CHRPATH
3779 Do not use the builtin ELF editor to fix RPATHs on installation.
3780
3781 When an ELF binary needs to have a different RPATH after installation
3782 than it does in the build tree, CMake uses a builtin editor to change
3783 the RPATH in the installed copy. If this variable is set to true then
3784 CMake will relink the binary before installation instead of using its
3785 builtin editor.
3786
3787 CMAKE_NO_SYSTEM_FROM_IMPORTED
3788 Default value for NO_SYSTEM_FROM_IMPORTED of targets.
3789
3790 This variable is used to initialize the NO_SYSTEM_FROM_IMPORTED prop‐
3791 erty on all the targets. See that target property for additional
3792 information.
3793
3794 CMAKE_OSX_ARCHITECTURES
3795 Target specific architectures for macOS and iOS.
3796
3797 This variable is used to initialize the OSX_ARCHITECTURES property on
3798 each target as it is created. See that target property for additional
3799 information.
3800
3801 The value of this variable should be set prior to the first project()
3802 or enable_language() command invocation because it may influence con‐
3803 figuration of the toolchain and flags. It is intended to be set
3804 locally by the user creating a build tree. This variable should be set
3805 as a CACHE entry (or else CMake may remove it while initializing a
3806 cache entry of the same name).
3807
3808 Despite the OSX part in the variable name(s) they apply also to other
3809 SDKs than macOS like iOS, tvOS, or watchOS.
3810
3811 This variable is ignored on platforms other than Apple.
3812
3813 CMAKE_OSX_DEPLOYMENT_TARGET
3814 Specify the minimum version of the target platform (e.g. macOS or iOS)
3815 on which the target binaries are to be deployed. CMake uses this vari‐
3816 able value for the -mmacosx-version-min flag or their respective target
3817 platform equivalents. For older Xcode versions that shipped multiple
3818 macOS SDKs this variable also helps to choose the SDK in case
3819 CMAKE_OSX_SYSROOT is unset.
3820
3821 If not set explicitly the value is initialized by the MACOSX_DEPLOY‐
3822 MENT_TARGET environment variable, if set, and otherwise computed based
3823 on the host platform.
3824
3825 The value of this variable should be set prior to the first project()
3826 or enable_language() command invocation because it may influence con‐
3827 figuration of the toolchain and flags. It is intended to be set
3828 locally by the user creating a build tree. This variable should be set
3829 as a CACHE entry (or else CMake may remove it while initializing a
3830 cache entry of the same name).
3831
3832 Despite the OSX part in the variable name(s) they apply also to other
3833 SDKs than macOS like iOS, tvOS, or watchOS.
3834
3835 This variable is ignored on platforms other than Apple.
3836
3837 CMAKE_OSX_SYSROOT
3838 Specify the location or name of the macOS platform SDK to be used.
3839 CMake uses this value to compute the value of the -isysroot flag or
3840 equivalent and to help the find_* commands locate files in the SDK.
3841
3842 If not set explicitly the value is initialized by the SDKROOT environ‐
3843 ment variable, if set, and otherwise computed based on the
3844 CMAKE_OSX_DEPLOYMENT_TARGET or the host platform.
3845
3846 The value of this variable should be set prior to the first project()
3847 or enable_language() command invocation because it may influence con‐
3848 figuration of the toolchain and flags. It is intended to be set
3849 locally by the user creating a build tree. This variable should be set
3850 as a CACHE entry (or else CMake may remove it while initializing a
3851 cache entry of the same name).
3852
3853 Despite the OSX part in the variable name(s) they apply also to other
3854 SDKs than macOS like iOS, tvOS, or watchOS.
3855
3856 This variable is ignored on platforms other than Apple.
3857
3858 CMAKE_PDB_OUTPUT_DIRECTORY
3859 Output directory for MS debug symbol .pdb files generated by the linker
3860 for executable and shared library targets.
3861
3862 This variable is used to initialize the PDB_OUTPUT_DIRECTORY property
3863 on all the targets. See that target property for additional informa‐
3864 tion.
3865
3866 CMAKE_PDB_OUTPUT_DIRECTORY_<CONFIG>
3867 Per-configuration output directory for MS debug symbol .pdb files gen‐
3868 erated by the linker for executable and shared library targets.
3869
3870 This is a per-configuration version of CMAKE_PDB_OUTPUT_DIRECTORY.
3871 This variable is used to initialize the PDB_OUTPUT_DIRECTORY_<CONFIG>
3872 property on all the targets. See that target property for additional
3873 information.
3874
3875 CMAKE_POSITION_INDEPENDENT_CODE
3876 Default value for POSITION_INDEPENDENT_CODE of targets.
3877
3878 This variable is used to initialize the POSITION_INDEPENDENT_CODE prop‐
3879 erty on all the targets. See that target property for additional
3880 information. If set, it’s value is also used by the try_compile() com‐
3881 mand.
3882
3883 CMAKE_RUNTIME_OUTPUT_DIRECTORY
3884 Where to put all the RUNTIME target files when built.
3885
3886 This variable is used to initialize the RUNTIME_OUTPUT_DIRECTORY prop‐
3887 erty on all the targets. See that target property for additional
3888 information.
3889
3890 CMAKE_RUNTIME_OUTPUT_DIRECTORY_<CONFIG>
3891 Where to put all the RUNTIME target files when built for a specific
3892 configuration.
3893
3894 This variable is used to initialize the RUNTIME_OUTPUT_DIRECTORY_<CON‐
3895 FIG> property on all the targets. See that target property for addi‐
3896 tional information.
3897
3898 CMAKE_SHARED_LINKER_FLAGS
3899 Linker flags to be used to create shared libraries.
3900
3901 These flags will be used by the linker when creating a shared library.
3902
3903 CMAKE_SHARED_LINKER_FLAGS_<CONFIG>
3904 Flags to be used when linking a shared library.
3905
3906 Same as CMAKE_C_FLAGS_* but used by the linker when creating shared
3907 libraries.
3908
3909 CMAKE_SHARED_LINKER_FLAGS_<CONFIG>_INIT
3910 Value used to initialize the CMAKE_SHARED_LINKER_FLAGS_<CONFIG> cache
3911 entry the first time a build tree is configured. This variable is
3912 meant to be set by a toolchain file. CMake may prepend or append con‐
3913 tent to the value based on the environment and target platform.
3914
3915 See also CMAKE_SHARED_LINKER_FLAGS_INIT.
3916
3917 CMAKE_SHARED_LINKER_FLAGS_INIT
3918 Value used to initialize the CMAKE_SHARED_LINKER_FLAGS cache entry the
3919 first time a build tree is configured. This variable is meant to be
3920 set by a toolchain file. CMake may prepend or append content to the
3921 value based on the environment and target platform.
3922
3923 See also the configuration-specific variable
3924 CMAKE_SHARED_LINKER_FLAGS_<CONFIG>_INIT.
3925
3926 CMAKE_SKIP_BUILD_RPATH
3927 Do not include RPATHs in the build tree.
3928
3929 Normally CMake uses the build tree for the RPATH when building executa‐
3930 bles etc on systems that use RPATH. When the software is installed the
3931 executables etc are relinked by CMake to have the install RPATH. If
3932 this variable is set to true then the software is always built with no
3933 RPATH.
3934
3935 CMAKE_SKIP_INSTALL_RPATH
3936 Do not include RPATHs in the install tree.
3937
3938 Normally CMake uses the build tree for the RPATH when building executa‐
3939 bles etc on systems that use RPATH. When the software is installed the
3940 executables etc are relinked by CMake to have the install RPATH. If
3941 this variable is set to true then the software is always installed
3942 without RPATH, even if RPATH is enabled when building. This can be
3943 useful for example to allow running tests from the build directory with
3944 RPATH enabled before the installation step. To omit RPATH in both the
3945 build and install steps, use CMAKE_SKIP_RPATH instead.
3946
3947 CMAKE_STATIC_LINKER_FLAGS
3948 Flags to be used to create static libraries. These flags will be
3949 passed to the archiver when creating a static library.
3950
3951 See also CMAKE_STATIC_LINKER_FLAGS_<CONFIG>.
3952
3953 NOTE:
3954 Static libraries do not actually link. They are essentially ar‐
3955 chives of object files. The use of the name “linker” in the name of
3956 this variable is kept for compatibility.
3957
3958 CMAKE_STATIC_LINKER_FLAGS_<CONFIG>
3959 Flags to be used to create static libraries. These flags will be
3960 passed to the archiver when creating a static library in the <CONFIG>
3961 configuration.
3962
3963 See also CMAKE_STATIC_LINKER_FLAGS.
3964
3965 NOTE:
3966 Static libraries do not actually link. They are essentially ar‐
3967 chives of object files. The use of the name “linker” in the name of
3968 this variable is kept for compatibility.
3969
3970 CMAKE_STATIC_LINKER_FLAGS_<CONFIG>_INIT
3971 Value used to initialize the CMAKE_STATIC_LINKER_FLAGS_<CONFIG> cache
3972 entry the first time a build tree is configured. This variable is
3973 meant to be set by a toolchain file. CMake may prepend or append con‐
3974 tent to the value based on the environment and target platform.
3975
3976 See also CMAKE_STATIC_LINKER_FLAGS_INIT.
3977
3978 CMAKE_STATIC_LINKER_FLAGS_INIT
3979 Value used to initialize the CMAKE_STATIC_LINKER_FLAGS cache entry the
3980 first time a build tree is configured. This variable is meant to be
3981 set by a toolchain file. CMake may prepend or append content to the
3982 value based on the environment and target platform.
3983
3984 See also the configuration-specific variable
3985 CMAKE_STATIC_LINKER_FLAGS_<CONFIG>_INIT.
3986
3987 CMAKE_TRY_COMPILE_CONFIGURATION
3988 Build configuration used for try_compile() and try_run() projects.
3989
3990 Projects built by try_compile() and try_run() are built synchronously
3991 during the CMake configuration step. Therefore a specific build con‐
3992 figuration must be chosen even if the generated build system supports
3993 multiple configurations.
3994
3995 CMAKE_TRY_COMPILE_PLATFORM_VARIABLES
3996 List of variables that the try_compile() command source file signature
3997 must propagate into the test project in order to target the same plat‐
3998 form as the host project.
3999
4000 This variable should not be set by project code. It is meant to be set
4001 by CMake’s platform information modules for the current toolchain, or
4002 by a toolchain file when used with CMAKE_TOOLCHAIN_FILE.
4003
4004 Variables meaningful to CMake, such as CMAKE_<LANG>_FLAGS, are propa‐
4005 gated automatically. The CMAKE_TRY_COMPILE_PLATFORM_VARIABLES variable
4006 may be set to pass custom variables meaningful to a toolchain file.
4007 For example, a toolchain file may contain:
4008
4009 set(CMAKE_SYSTEM_NAME ...)
4010 set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES MY_CUSTOM_VARIABLE)
4011 # ... use MY_CUSTOM_VARIABLE ...
4012
4013 If a user passes -DMY_CUSTOM_VARIABLE=SomeValue to CMake then this set‐
4014 ting will be made visible to the toolchain file both for the main
4015 project and for test projects generated by the try_compile() command
4016 source file signature.
4017
4018 CMAKE_TRY_COMPILE_TARGET_TYPE
4019 Type of target generated for try_compile() calls using the source file
4020 signature. Valid values are:
4021
4022 EXECUTABLE
4023 Use add_executable() to name the source file in the generated
4024 project. This is the default if no value is given.
4025
4026 STATIC_LIBRARY
4027 Use add_library() with the STATIC option to name the source file
4028 in the generated project. This avoids running the linker and is
4029 intended for use with cross-compiling toolchains that cannot
4030 link without custom flags or linker scripts.
4031
4032 CMAKE_UNITY_BUILD
4033 This variable is used to initialize the UNITY_BUILD property of targets
4034 when they are created. Setting it to true enables batch compilation of
4035 multiple sources within each target. This feature is known as a Unity
4036 or Jumbo build.
4037
4038 Projects should not set this variable, it is intended as a developer
4039 control to be set on the cmake(1) command line or other equivalent
4040 methods. The developer must have the ability to enable or disable
4041 unity builds according to the capabilities of their own machine and
4042 compiler.
4043
4044 By default, this variable is not set, which will result in unity builds
4045 being disabled.
4046
4047 NOTE:
4048 This option currently does not work well in combination with the
4049 CMAKE_EXPORT_COMPILE_COMMANDS variable.
4050
4051 CMAKE_UNITY_BUILD_BATCH_SIZE
4052 This variable is used to initialize the UNITY_BUILD_BATCH_SIZE property
4053 of targets when they are created. It specifies the default upper limit
4054 on the number of source files that may be combined in any one unity
4055 source file when unity builds are enabled for a target.
4056
4057 CMAKE_USE_RELATIVE_PATHS
4058 This variable has no effect. The partially implemented effect it had
4059 in previous releases was removed in CMake 3.4.
4060
4061 CMAKE_VISIBILITY_INLINES_HIDDEN
4062 Default value for the VISIBILITY_INLINES_HIDDEN target property when a
4063 target is created.
4064
4065 CMAKE_VS_GLOBALS
4066 List of Key=Value records to be set per target as target properties
4067 VS_GLOBAL_<variable> with variable=Key and value Value.
4068
4069 For example:
4070
4071 set(CMAKE_VS_GLOBALS
4072 "DefaultLanguage=en-US"
4073 "MinimumVisualStudioVersion=14.0"
4074 )
4075
4076 will set properties VS_GLOBAL_DefaultLanguage to en-US and
4077 VS_GLOBAL_MinimumVisualStudioVersion to 14.0 for all targets (except
4078 for INTERFACE libraries).
4079
4080 This variable is meant to be set by a toolchain file.
4081
4082 CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD
4083 Include INSTALL target to default build.
4084
4085 In Visual Studio solution, by default the INSTALL target will not be
4086 part of the default build. Setting this variable will enable the
4087 INSTALL target to be part of the default build.
4088
4089 CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD
4090 Include PACKAGE target to default build.
4091
4092 In Visual Studio solution, by default the PACKAGE target will not be
4093 part of the default build. Setting this variable will enable the PACK‐
4094 AGE target to be part of the default build.
4095
4096 CMAKE_VS_JUST_MY_CODE_DEBUGGING
4097 Enable Just My Code with Visual Studio debugger.
4098
4099 This variable is used to initialize the VS_JUST_MY_CODE_DEBUGGING prop‐
4100 erty on all targets when they are created. See that target property
4101 for additional information.
4102
4103 CMAKE_VS_SDK_EXCLUDE_DIRECTORIES
4104 This variable allows to override Visual Studio default Exclude Directo‐
4105 ries.
4106
4107 CMAKE_VS_SDK_EXECUTABLE_DIRECTORIES
4108 This variable allows to override Visual Studio default Executable
4109 Directories.
4110
4111 CMAKE_VS_SDK_INCLUDE_DIRECTORIES
4112 This variable allows to override Visual Studio default Include Directo‐
4113 ries.
4114
4115 CMAKE_VS_SDK_LIBRARY_DIRECTORIES
4116 This variable allows to override Visual Studio default Library Directo‐
4117 ries.
4118
4119 CMAKE_VS_SDK_LIBRARY_WINRT_DIRECTORIES
4120 This variable allows to override Visual Studio default Library WinRT
4121 Directories.
4122
4123 CMAKE_VS_SDK_REFERENCE_DIRECTORIES
4124 This variable allows to override Visual Studio default Reference Direc‐
4125 tories.
4126
4127 CMAKE_VS_SDK_SOURCE_DIRECTORIES
4128 This variable allows to override Visual Studio default Source Directo‐
4129 ries.
4130
4131 CMAKE_VS_WINRT_BY_DEFAULT
4132 Tell Visual Studio Generators for VS 2010 and above that the target
4133 platform compiles as WinRT by default (compiles with /ZW).
4134
4135 This variable is meant to be set by a toolchain file for such plat‐
4136 forms.
4137
4138 CMAKE_WIN32_EXECUTABLE
4139 Default value for WIN32_EXECUTABLE of targets.
4140
4141 This variable is used to initialize the WIN32_EXECUTABLE property on
4142 all the targets. See that target property for additional information.
4143
4144 CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS
4145 Default value for WINDOWS_EXPORT_ALL_SYMBOLS target property. This
4146 variable is used to initialize the property on each target as it is
4147 created.
4148
4149 CMAKE_XCODE_ATTRIBUTE_<an-attribute>
4150 Set Xcode target attributes directly.
4151
4152 Tell the Xcode generator to set ‘<an-attribute>’ to a given value in
4153 the generated Xcode project. Ignored on other generators.
4154
4155 See the XCODE_ATTRIBUTE_<an-attribute> target property to set
4156 attributes on a specific target.
4157
4158 Contents of CMAKE_XCODE_ATTRIBUTE_<an-attribute> may use “generator
4159 expressions” with the syntax $<...>. See the cmake-generator-expres‐
4160 sions(7) manual for available expressions. See the cmake-buildsys‐
4161 tem(7) manual for more on defining buildsystem properties.
4162
4163 EXECUTABLE_OUTPUT_PATH
4164 Old executable location variable.
4165
4166 The target property RUNTIME_OUTPUT_DIRECTORY supercedes this variable
4167 for a target if it is set. Executable targets are otherwise placed in
4168 this directory.
4169
4170 LIBRARY_OUTPUT_PATH
4171 Old library location variable.
4172
4173 The target properties ARCHIVE_OUTPUT_DIRECTORY, LIBRARY_OUTPUT_DIREC‐
4174 TORY, and RUNTIME_OUTPUT_DIRECTORY supersede this variable for a target
4175 if they are set. Library targets are otherwise placed in this direc‐
4176 tory.
4177
4179 CMAKE_COMPILER_IS_GNUCC
4180 True if the C compiler is GNU. Use CMAKE_C_COMPILER_ID instead.
4181
4182 CMAKE_COMPILER_IS_GNUCXX
4183 True if the C++ (CXX) compiler is GNU. Use CMAKE_CXX_COMPILER_ID
4184 instead.
4185
4186 CMAKE_COMPILER_IS_GNUG77
4187 True if the Fortran compiler is GNU. Use CMAKE_Fortran_COMPILER_ID
4188 instead.
4189
4190 CMAKE_CUDA_HOST_COMPILER
4191 Executable to use when compiling host code when compiling CUDA language
4192 files. Maps to the nvcc -ccbin option. Will only be used by CMake on
4193 the first configuration to determine a valid host compiler for CUDA.
4194 After a valid host compiler has been found, this value is read-only.
4195 This variable takes priority over the CUDAHOSTCXX environment variable.
4196
4197 CMAKE_CUDA_EXTENSIONS
4198 Default value for CUDA_EXTENSIONS property of targets.
4199
4200 This variable is used to initialize the CUDA_EXTENSIONS property on all
4201 targets. See that target property for additional information.
4202
4203 See the cmake-compile-features(7) manual for information on compile
4204 features and a list of supported compilers.
4205
4206 CMAKE_CUDA_STANDARD
4207 Default value for CUDA_STANDARD property of targets.
4208
4209 This variable is used to initialize the CUDA_STANDARD property on all
4210 targets. See that target property for additional information.
4211
4212 See the cmake-compile-features(7) manual for information on compile
4213 features and a list of supported compilers.
4214
4215 CMAKE_CUDA_STANDARD_REQUIRED
4216 Default value for CUDA_STANDARD_REQUIRED property of targets.
4217
4218 This variable is used to initialize the CUDA_STANDARD_REQUIRED property
4219 on all targets. See that target property for additional information.
4220
4221 See the cmake-compile-features(7) manual for information on compile
4222 features and a list of supported compilers.
4223
4224 CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES
4225 When the CUDA language has been enabled, this provides a semicolon-sep‐
4226 arated list of include directories provided by the CUDA Toolkit. The
4227 value may be useful for C++ source files to include CUDA headers.
4228
4229 CMAKE_CXX_COMPILE_FEATURES
4230 List of features known to the C++ compiler
4231
4232 These features are known to be available for use with the C++ compiler.
4233 This list is a subset of the features listed in the
4234 CMAKE_CXX_KNOWN_FEATURES global property.
4235
4236 See the cmake-compile-features(7) manual for information on compile
4237 features and a list of supported compilers.
4238
4239 CMAKE_CXX_EXTENSIONS
4240 Default value for CXX_EXTENSIONS property of targets.
4241
4242 This variable is used to initialize the CXX_EXTENSIONS property on all
4243 targets. See that target property for additional information.
4244
4245 See the cmake-compile-features(7) manual for information on compile
4246 features and a list of supported compilers.
4247
4248 CMAKE_CXX_STANDARD
4249 Default value for CXX_STANDARD property of targets.
4250
4251 This variable is used to initialize the CXX_STANDARD property on all
4252 targets. See that target property for additional information.
4253
4254 See the cmake-compile-features(7) manual for information on compile
4255 features and a list of supported compilers.
4256
4257 CMAKE_CXX_STANDARD_REQUIRED
4258 Default value for CXX_STANDARD_REQUIRED property of targets.
4259
4260 This variable is used to initialize the CXX_STANDARD_REQUIRED property
4261 on all targets. See that target property for additional information.
4262
4263 See the cmake-compile-features(7) manual for information on compile
4264 features and a list of supported compilers.
4265
4266 CMAKE_C_COMPILE_FEATURES
4267 List of features known to the C compiler
4268
4269 These features are known to be available for use with the C compiler.
4270 This list is a subset of the features listed in the CMAKE_C_KNOWN_FEA‐
4271 TURES global property.
4272
4273 See the cmake-compile-features(7) manual for information on compile
4274 features and a list of supported compilers.
4275
4276 CMAKE_C_EXTENSIONS
4277 Default value for C_EXTENSIONS property of targets.
4278
4279 This variable is used to initialize the C_EXTENSIONS property on all
4280 targets. See that target property for additional information.
4281
4282 See the cmake-compile-features(7) manual for information on compile
4283 features and a list of supported compilers.
4284
4285 CMAKE_C_STANDARD
4286 Default value for C_STANDARD property of targets.
4287
4288 This variable is used to initialize the C_STANDARD property on all tar‐
4289 gets. See that target property for additional information.
4290
4291 See the cmake-compile-features(7) manual for information on compile
4292 features and a list of supported compilers.
4293
4294 CMAKE_C_STANDARD_REQUIRED
4295 Default value for C_STANDARD_REQUIRED property of targets.
4296
4297 This variable is used to initialize the C_STANDARD_REQUIRED property on
4298 all targets. See that target property for additional information.
4299
4300 See the cmake-compile-features(7) manual for information on compile
4301 features and a list of supported compilers.
4302
4303 CMAKE_Fortran_MODDIR_DEFAULT
4304 Fortran default module output directory.
4305
4306 Most Fortran compilers write .mod files to the current working direc‐
4307 tory. For those that do not, this is set to . and used when the For‐
4308 tran_MODULE_DIRECTORY target property is not set.
4309
4310 CMAKE_Fortran_MODDIR_FLAG
4311 Fortran flag for module output directory.
4312
4313 This stores the flag needed to pass the value of the Fortran_MOD‐
4314 ULE_DIRECTORY target property to the compiler.
4315
4316 CMAKE_Fortran_MODOUT_FLAG
4317 Fortran flag to enable module output.
4318
4319 Most Fortran compilers write .mod files out by default. For others,
4320 this stores the flag needed to enable module output.
4321
4322 CMAKE_<LANG>_ANDROID_TOOLCHAIN_MACHINE
4323 When Cross Compiling for Android this variable contains the toolchain
4324 binutils machine name (e.g. gcc -dumpmachine). The binutils typically
4325 have a <machine>- prefix on their name.
4326
4327 See also CMAKE_<LANG>_ANDROID_TOOLCHAIN_PREFIX and
4328 CMAKE_<LANG>_ANDROID_TOOLCHAIN_SUFFIX.
4329
4330 CMAKE_<LANG>_ANDROID_TOOLCHAIN_PREFIX
4331 When Cross Compiling for Android this variable contains the absolute
4332 path prefixing the toolchain GNU compiler and its binutils.
4333
4334 See also CMAKE_<LANG>_ANDROID_TOOLCHAIN_SUFFIX and
4335 CMAKE_<LANG>_ANDROID_TOOLCHAIN_MACHINE.
4336
4337 For example, the path to the linker is:
4338
4339 ${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}ld${CMAKE_CXX_ANDROID_TOOLCHAIN_SUFFIX}
4340
4341 CMAKE_<LANG>_ANDROID_TOOLCHAIN_SUFFIX
4342 When Cross Compiling for Android this variable contains the host plat‐
4343 form suffix of the toolchain GNU compiler and its binutils.
4344
4345 See also CMAKE_<LANG>_ANDROID_TOOLCHAIN_PREFIX and
4346 CMAKE_<LANG>_ANDROID_TOOLCHAIN_MACHINE.
4347
4348 CMAKE_<LANG>_ARCHIVE_APPEND
4349 Rule variable to append to a static archive.
4350
4351 This is a rule variable that tells CMake how to append to a static ar‐
4352 chive. It is used in place of CMAKE_<LANG>_CREATE_STATIC_LIBRARY on
4353 some platforms in order to support large object counts. See also
4354 CMAKE_<LANG>_ARCHIVE_CREATE and CMAKE_<LANG>_ARCHIVE_FINISH.
4355
4356 CMAKE_<LANG>_ARCHIVE_CREATE
4357 Rule variable to create a new static archive.
4358
4359 This is a rule variable that tells CMake how to create a static ar‐
4360 chive. It is used in place of CMAKE_<LANG>_CREATE_STATIC_LIBRARY on
4361 some platforms in order to support large object counts. See also
4362 CMAKE_<LANG>_ARCHIVE_APPEND and CMAKE_<LANG>_ARCHIVE_FINISH.
4363
4364 CMAKE_<LANG>_ARCHIVE_FINISH
4365 Rule variable to finish an existing static archive.
4366
4367 This is a rule variable that tells CMake how to finish a static ar‐
4368 chive. It is used in place of CMAKE_<LANG>_CREATE_STATIC_LIBRARY on
4369 some platforms in order to support large object counts. See also
4370 CMAKE_<LANG>_ARCHIVE_CREATE and CMAKE_<LANG>_ARCHIVE_APPEND.
4371
4372 CMAKE_<LANG>_COMPILER
4373 The full path to the compiler for LANG.
4374
4375 This is the command that will be used as the <LANG> compiler. Once
4376 set, you can not change this variable.
4377
4378 CMAKE_<LANG>_COMPILER_EXTERNAL_TOOLCHAIN
4379 The external toolchain for cross-compiling, if supported.
4380
4381 Some compiler toolchains do not ship their own auxiliary utilities such
4382 as archivers and linkers. The compiler driver may support a com‐
4383 mand-line argument to specify the location of such tools.
4384 CMAKE_<LANG>_COMPILER_EXTERNAL_TOOLCHAIN may be set to a path to the
4385 external toolchain and will be passed to the compiler driver if sup‐
4386 ported.
4387
4388 This variable may only be set in a toolchain file specified by the
4389 CMAKE_TOOLCHAIN_FILE variable.
4390
4391 CMAKE_<LANG>_COMPILER_ID
4392 Compiler identification string.
4393
4394 A short string unique to the compiler vendor. Possible values include:
4395
4396 Absoft = Absoft Fortran (absoft.com)
4397 ADSP = Analog VisualDSP++ (analog.com)
4398 AppleClang = Apple Clang (apple.com)
4399 ARMCC = ARM Compiler (arm.com)
4400 ARMClang = ARM Compiler based on Clang (arm.com)
4401 Bruce = Bruce C Compiler
4402 CCur = Concurrent Fortran (ccur.com)
4403 Clang = LLVM Clang (clang.llvm.org)
4404 Cray = Cray Compiler (cray.com)
4405 Embarcadero, Borland = Embarcadero (embarcadero.com)
4406 Flang = Flang LLVM Fortran Compiler
4407 G95 = G95 Fortran (g95.org)
4408 GNU = GNU Compiler Collection (gcc.gnu.org)
4409 GHS = Green Hills Software (www.ghs.com)
4410 HP = Hewlett-Packard Compiler (hp.com)
4411 IAR = IAR Systems (iar.com)
4412 Intel = Intel Compiler (intel.com)
4413 MSVC = Microsoft Visual Studio (microsoft.com)
4414 NVIDIA = NVIDIA CUDA Compiler (nvidia.com)
4415 OpenWatcom = Open Watcom (openwatcom.org)
4416 PGI = The Portland Group (pgroup.com)
4417 PathScale = PathScale (pathscale.com)
4418 SDCC = Small Device C Compiler (sdcc.sourceforge.net)
4419 SunPro = Oracle Solaris Studio (oracle.com)
4420 TI = Texas Instruments (ti.com)
4421 TinyCC = Tiny C Compiler (tinycc.org)
4422 XL, VisualAge, zOS = IBM XL (ibm.com)
4423 XLClang = IBM Clang-based XL (ibm.com)
4424
4425 This variable is not guaranteed to be defined for all compilers or lan‐
4426 guages.
4427
4428 CMAKE_<LANG>_COMPILER_LOADED
4429 Defined to true if the language is enabled.
4430
4431 When language <LANG> is enabled by project() or enable_language() this
4432 variable is defined to 1.
4433
4434 CMAKE_<LANG>_COMPILER_PREDEFINES_COMMAND
4435 Command that outputs the compiler pre definitions.
4436
4437 See AUTOMOC which uses CMAKE_CXX_COMPILER_PREDEFINES_COMMAND to gener‐
4438 ate the AUTOMOC_COMPILER_PREDEFINES.
4439
4440 CMAKE_<LANG>_COMPILER_TARGET
4441 The target for cross-compiling, if supported.
4442
4443 Some compiler drivers are inherently cross-compilers, such as clang and
4444 QNX qcc. These compiler drivers support a command-line argument to
4445 specify the target to cross-compile for.
4446
4447 This variable may only be set in a toolchain file specified by the
4448 CMAKE_TOOLCHAIN_FILE variable.
4449
4450 CMAKE_<LANG>_COMPILER_VERSION
4451 Compiler version string.
4452
4453 Compiler version in major[.minor[.patch[.tweak]]] format. This vari‐
4454 able is not guaranteed to be defined for all compilers or languages.
4455
4456 For example CMAKE_C_COMPILER_VERSION and CMAKE_CXX_COMPILER_VERSION
4457 might indicate the respective C and C++ compiler version.
4458
4459 CMAKE_<LANG>_COMPILE_OBJECT
4460 Rule variable to compile a single object file.
4461
4462 This is a rule variable that tells CMake how to compile a single object
4463 file for the language <LANG>.
4464
4465 CMAKE_<LANG>_CREATE_SHARED_LIBRARY
4466 Rule variable to create a shared library.
4467
4468 This is a rule variable that tells CMake how to create a shared library
4469 for the language <LANG>. This rule variable is a ; delimited list of
4470 commands to run to perform the linking step.
4471
4472 CMAKE_<LANG>_CREATE_SHARED_MODULE
4473 Rule variable to create a shared module.
4474
4475 This is a rule variable that tells CMake how to create a shared library
4476 for the language <LANG>. This rule variable is a ; delimited list of
4477 commands to run.
4478
4479 CMAKE_<LANG>_CREATE_STATIC_LIBRARY
4480 Rule variable to create a static library.
4481
4482 This is a rule variable that tells CMake how to create a static library
4483 for the language <LANG>.
4484
4485 CMAKE_<LANG>_FLAGS
4486 Flags for all build types.
4487
4488 <LANG> flags used regardless of the value of CMAKE_BUILD_TYPE.
4489
4490 This is initialized for each language from environment variables:
4491
4492 · CMAKE_C_FLAGS: Initialized by the CFLAGS environment variable.
4493
4494 · CMAKE_CXX_FLAGS: Initialized by the CXXFLAGS environment variable.
4495
4496 · CMAKE_CUDA_FLAGS: Initialized by the CUDAFLAGS environment variable.
4497
4498 · CMAKE_Fortran_FLAGS: Initialized by the FFLAGS environment variable.
4499
4500 CMAKE_<LANG>_FLAGS_<CONFIG>
4501 Flags for language <LANG> when building for the <CONFIG> configuration.
4502
4503 CMAKE_<LANG>_FLAGS_<CONFIG>_INIT
4504 Value used to initialize the CMAKE_<LANG>_FLAGS_<CONFIG> cache entry
4505 the first time a build tree is configured for language <LANG>. This
4506 variable is meant to be set by a toolchain file. CMake may prepend or
4507 append content to the value based on the environment and target plat‐
4508 form.
4509
4510 See also CMAKE_<LANG>_FLAGS_INIT.
4511
4512 CMAKE_<LANG>_FLAGS_DEBUG
4513 This variable is the Debug variant of the CMAKE_<LANG>_FLAGS_<CONFIG>
4514 variable.
4515
4516 CMAKE_<LANG>_FLAGS_DEBUG_INIT
4517 This variable is the Debug variant of the CMAKE_<LANG>_FLAGS_<CON‐
4518 FIG>_INIT variable.
4519
4520 CMAKE_<LANG>_FLAGS_INIT
4521 Value used to initialize the CMAKE_<LANG>_FLAGS cache entry the first
4522 time a build tree is configured for language <LANG>. This variable is
4523 meant to be set by a toolchain file. CMake may prepend or append con‐
4524 tent to the value based on the environment and target platform.
4525
4526 See also the configuration-specific CMAKE_<LANG>_FLAGS_<CONFIG>_INIT
4527 variable.
4528
4529 CMAKE_<LANG>_FLAGS_MINSIZEREL
4530 This variable is the MinSizeRel variant of the CMAKE_<LANG>_FLAGS_<CON‐
4531 FIG> variable.
4532
4533 CMAKE_<LANG>_FLAGS_MINSIZEREL_INIT
4534 This variable is the MinSizeRel variant of the CMAKE_<LANG>_FLAGS_<CON‐
4535 FIG>_INIT variable.
4536
4537 CMAKE_<LANG>_FLAGS_RELEASE
4538 This variable is the Release variant of the CMAKE_<LANG>_FLAGS_<CONFIG>
4539 variable.
4540
4541 CMAKE_<LANG>_FLAGS_RELEASE_INIT
4542 This variable is the Release variant of the CMAKE_<LANG>_FLAGS_<CON‐
4543 FIG>_INIT variable.
4544
4545 CMAKE_<LANG>_FLAGS_RELWITHDEBINFO
4546 This variable is the RelWithDebInfo variant of the
4547 CMAKE_<LANG>_FLAGS_<CONFIG> variable.
4548
4549 CMAKE_<LANG>_FLAGS_RELWITHDEBINFO_INIT
4550 This variable is the RelWithDebInfo variant of the
4551 CMAKE_<LANG>_FLAGS_<CONFIG>_INIT variable.
4552
4553 CMAKE_<LANG>_IGNORE_EXTENSIONS
4554 File extensions that should be ignored by the build.
4555
4556 This is a list of file extensions that may be part of a project for a
4557 given language but are not compiled.
4558
4559 CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES
4560 Directories implicitly searched by the compiler for header files.
4561
4562 CMake does not explicitly specify these directories on compiler command
4563 lines for language <LANG>. This prevents system include directories
4564 from being treated as user include directories on some compilers, which
4565 is important for C, CXX, and CUDA to avoid overriding standard library
4566 headers.
4567
4568 This value is not used for Fortran because it has no standard library
4569 headers and some compilers do not search their implicit include direc‐
4570 tories for module .mod files.
4571
4572 CMAKE_<LANG>_IMPLICIT_LINK_DIRECTORIES
4573 Implicit linker search path detected for language <LANG>.
4574
4575 Compilers typically pass directories containing language runtime
4576 libraries and default library search paths when they invoke a linker.
4577 These paths are implicit linker search directories for the compiler’s
4578 language. CMake automatically detects these directories for each lan‐
4579 guage and reports the results in this variable.
4580
4581 Some toolchains read implicit directories from an environment variable
4582 such as LIBRARY_PATH. If using such an environment variable, keep its
4583 value consistent when operating in a given build tree because CMake
4584 saves the value detected when first creating a build tree.
4585
4586 If policy CMP0060 is not set to NEW, then when a library in one of
4587 these directories is given by full path to target_link_libraries()
4588 CMake will generate the -l<name> form on link lines for historical pur‐
4589 poses.
4590
4591 CMAKE_<LANG>_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES
4592 Implicit linker framework search path detected for language <LANG>.
4593
4594 These paths are implicit linker framework search directories for the
4595 compiler’s language. CMake automatically detects these directories for
4596 each language and reports the results in this variable.
4597
4598 CMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES
4599 Implicit link libraries and flags detected for language <LANG>.
4600
4601 Compilers typically pass language runtime library names and other flags
4602 when they invoke a linker. These flags are implicit link options for
4603 the compiler’s language. CMake automatically detects these libraries
4604 and flags for each language and reports the results in this variable.
4605
4606 CMAKE_<LANG>_LIBRARY_ARCHITECTURE
4607 Target architecture library directory name detected for <LANG>.
4608
4609 If the <LANG> compiler passes to the linker an architecture-specific
4610 system library search directory such as <prefix>/lib/<arch> this vari‐
4611 able contains the <arch> name if/as detected by CMake.
4612
4613 CMAKE_<LANG>_LINKER_PREFERENCE
4614 Preference value for linker language selection.
4615
4616 The “linker language” for executable, shared library, and module tar‐
4617 gets is the language whose compiler will invoke the linker. The
4618 LINKER_LANGUAGE target property sets the language explicitly. Other‐
4619 wise, the linker language is that whose linker preference value is
4620 highest among languages compiled and linked into the target. See also
4621 the CMAKE_<LANG>_LINKER_PREFERENCE_PROPAGATES variable.
4622
4623 CMAKE_<LANG>_LINKER_PREFERENCE_PROPAGATES
4624 True if CMAKE_<LANG>_LINKER_PREFERENCE propagates across targets.
4625
4626 This is used when CMake selects a linker language for a target. Lan‐
4627 guages compiled directly into the target are always considered. A lan‐
4628 guage compiled into static libraries linked by the target is considered
4629 if this variable is true.
4630
4631 CMAKE_<LANG>_LINKER_WRAPPER_FLAG
4632 Defines the syntax of compiler driver option to pass options to the
4633 linker tool. It will be used to translate the LINKER: prefix in the
4634 link options (see add_link_options() and target_link_options()).
4635
4636 This variable holds a semicolon-separated list of tokens. If a space
4637 (i.e. ” “) is specified as last token, flag and LINKER: arguments will
4638 be specified as separate arguments to the compiler driver. The
4639 CMAKE_<LANG>_LINKER_WRAPPER_FLAG_SEP variable can be specified to man‐
4640 age concatenation of arguments.
4641
4642 For example, for Clang we have:
4643
4644 set (CMAKE_C_LINKER_WRAPPER_FLAG "-Xlinker" " ")
4645
4646 Specifying "LINKER:-z,defs" will be transformed in -Xlinker -z -Xlinker
4647 defs.
4648
4649 For GNU GCC:
4650
4651 set (CMAKE_C_LINKER_WRAPPER_FLAG "-Wl,")
4652 set (CMAKE_C_LINKER_WRAPPER_FLAG_SEP ",")
4653
4654 Specifying "LINKER:-z,defs" will be transformed in -Wl,-z,defs.
4655
4656 And for SunPro:
4657
4658 set (CMAKE_C_LINKER_WRAPPER_FLAG "-Qoption" "ld" " ")
4659 set (CMAKE_C_LINKER_WRAPPER_FLAG_SEP ",")
4660
4661 Specifying "LINKER:-z,defs" will be transformed in -Qoption ld -z,defs.
4662
4663 CMAKE_<LANG>_LINKER_WRAPPER_FLAG_SEP
4664 This variable is used with CMAKE_<LANG>_LINKER_WRAPPER_FLAG variable to
4665 format LINKER: prefix in the link options (see add_link_options() and
4666 target_link_options()).
4667
4668 When specified, arguments of the LINKER: prefix will be concatenated
4669 using this value as separator.
4670
4671 CMAKE_<LANG>_LINK_EXECUTABLE
4672 Rule variable to link an executable.
4673
4674 Rule variable to link an executable for the given language.
4675
4676 CMAKE_<LANG>_OUTPUT_EXTENSION
4677 Extension for the output of a compile for a single file.
4678
4679 This is the extension for an object file for the given <LANG>. For
4680 example .obj for C on Windows.
4681
4682 CMAKE_<LANG>_SIMULATE_ID
4683 Identification string of “simulated” compiler.
4684
4685 Some compilers simulate other compilers to serve as drop-in replace‐
4686 ments. When CMake detects such a compiler it sets this variable to
4687 what would have been the CMAKE_<LANG>_COMPILER_ID for the simulated
4688 compiler.
4689
4690 CMAKE_<LANG>_SIMULATE_VERSION
4691 Version string of “simulated” compiler.
4692
4693 Some compilers simulate other compilers to serve as drop-in replace‐
4694 ments. When CMake detects such a compiler it sets this variable to
4695 what would have been the CMAKE_<LANG>_COMPILER_VERSION for the simu‐
4696 lated compiler.
4697
4698 CMAKE_<LANG>_SIZEOF_DATA_PTR
4699 Size of pointer-to-data types for language <LANG>.
4700
4701 This holds the size (in bytes) of pointer-to-data types in the target
4702 platform ABI. It is defined for languages C and CXX (C++).
4703
4704 CMAKE_<LANG>_SOURCE_FILE_EXTENSIONS
4705 Extensions of source files for the given language.
4706
4707 This is the list of extensions for a given language’s source files.
4708
4709 CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES
4710 Include directories to be used for every source file compiled with the
4711 <LANG> compiler. This is meant for specification of system include
4712 directories needed by the language for the current platform. The
4713 directories always appear at the end of the include path passed to the
4714 compiler.
4715
4716 This variable should not be set by project code. It is meant to be set
4717 by CMake’s platform information modules for the current toolchain, or
4718 by a toolchain file when used with CMAKE_TOOLCHAIN_FILE.
4719
4720 See also CMAKE_<LANG>_STANDARD_LIBRARIES.
4721
4722 CMAKE_<LANG>_STANDARD_LIBRARIES
4723 Libraries linked into every executable and shared library linked for
4724 language <LANG>. This is meant for specification of system libraries
4725 needed by the language for the current platform.
4726
4727 This variable should not be set by project code. It is meant to be set
4728 by CMake’s platform information modules for the current toolchain, or
4729 by a toolchain file when used with CMAKE_TOOLCHAIN_FILE.
4730
4731 See also CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES.
4732
4733 CMAKE_OBJC_EXTENSIONS
4734 Default value for OBJC_EXTENSIONS property of targets.
4735
4736 This variable is used to initialize the OBJC_EXTENSIONS property on all
4737 targets. See that target property for additional information.
4738
4739 See the cmake-compile-features(7) manual for information on compile
4740 features and a list of supported compilers.
4741
4742 CMAKE_OBJC_STANDARD
4743 Default value for OBJC_STANDARD property of targets.
4744
4745 This variable is used to initialize the OBJC_STANDARD property on all
4746 targets. See that target property for additional information.
4747
4748 See the cmake-compile-features(7) manual for information on compile
4749 features and a list of supported compilers.
4750
4751 CMAKE_OBJC_STANDARD_REQUIRED
4752 Default value for OBJC_STANDARD_REQUIRED property of targets.
4753
4754 This variable is used to initialize the OBJC_STANDARD_REQUIRED property
4755 on all targets. See that target property for additional information.
4756
4757 See the cmake-compile-features(7) manual for information on compile
4758 features and a list of supported compilers.
4759
4760 CMAKE_OBJCXX_EXTENSIONS
4761 Default value for OBJCXX_EXTENSIONS property of targets.
4762
4763 This variable is used to initialize the OBJCXX_EXTENSIONS property on
4764 all targets. See that target property for additional information.
4765
4766 See the cmake-compile-features(7) manual for information on compile
4767 features and a list of supported compilers.
4768
4769 CMAKE_OBJCXX_STANDARD
4770 Default value for OBJCXX_STANDARD property of targets.
4771
4772 This variable is used to initialize the OBJCXX_STANDARD property on all
4773 targets. See that target property for additional information.
4774
4775 See the cmake-compile-features(7) manual for information on compile
4776 features and a list of supported compilers.
4777
4778 CMAKE_OBJCXX_STANDARD_REQUIRED
4779 Default value for OBJCXX_STANDARD_REQUIRED property of targets.
4780
4781 This variable is used to initialize the OBJCXX_STANDARD_REQUIRED prop‐
4782 erty on all targets. See that target property for additional informa‐
4783 tion.
4784
4785 See the cmake-compile-features(7) manual for information on compile
4786 features and a list of supported compilers.
4787
4788 CMAKE_Swift_LANGUAGE_VERSION
4789 Set to the Swift language version number. If not set, the oldest
4790 legacy version known to be available in the host Xcode version is
4791 assumed:
4792
4793 · Swift 4.0 for Xcode 10.2 and above.
4794
4795 · Swift 3.0 for Xcode 8.3 and above.
4796
4797 · Swift 2.3 for Xcode 8.2 and below.
4798
4799 CMAKE_USER_MAKE_RULES_OVERRIDE_<LANG>
4800 Specify a CMake file that overrides platform information for <LANG>.
4801
4802 This is a language-specific version of CMAKE_USER_MAKE_RULES_OVERRIDE
4803 loaded only when enabling language <LANG>.
4804
4806 CTEST_BINARY_DIRECTORY
4807 Specify the CTest BuildDirectory setting in a ctest(1) dashboard client
4808 script.
4809
4810 CTEST_BUILD_COMMAND
4811 Specify the CTest MakeCommand setting in a ctest(1) dashboard client
4812 script.
4813
4814 CTEST_BUILD_NAME
4815 Specify the CTest BuildName setting in a ctest(1) dashboard client
4816 script.
4817
4818 CTEST_BZR_COMMAND
4819 Specify the CTest BZRCommand setting in a ctest(1) dashboard client
4820 script.
4821
4822 CTEST_BZR_UPDATE_OPTIONS
4823 Specify the CTest BZRUpdateOptions setting in a ctest(1) dashboard
4824 client script.
4825
4826 CTEST_CHANGE_ID
4827 Specify the CTest ChangeId setting in a ctest(1) dashboard client
4828 script.
4829
4830 This setting allows CTest to pass arbitrary information about this
4831 build up to CDash. One use of this feature is to allow CDash to post
4832 comments on your pull request if anything goes wrong with your build.
4833
4834 CTEST_CHECKOUT_COMMAND
4835 Tell the ctest_start() command how to checkout or initialize the source
4836 directory in a ctest(1) dashboard client script.
4837
4838 CTEST_CONFIGURATION_TYPE
4839 Specify the CTest DefaultCTestConfigurationType setting in a ctest(1)
4840 dashboard client script.
4841
4842 CTEST_CONFIGURE_COMMAND
4843 Specify the CTest ConfigureCommand setting in a ctest(1) dashboard
4844 client script.
4845
4846 CTEST_COVERAGE_COMMAND
4847 Specify the CTest CoverageCommand setting in a ctest(1) dashboard
4848 client script.
4849
4850 Cobertura
4851 Using Cobertura as the coverage generation within your multi-module
4852 Java project can generate a series of XML files.
4853
4854 The Cobertura Coverage parser expects to read the coverage data from a
4855 single XML file which contains the coverage data for all modules.
4856 Cobertura has a program with the ability to merge given cobertura.ser
4857 files and then another program to generate a combined XML file from the
4858 previous merged file. For command line testing, this can be done by
4859 hand prior to CTest looking for the coverage files. For script builds,
4860 set the CTEST_COVERAGE_COMMAND variable to point to a file which will
4861 perform these same steps, such as a .sh or .bat file.
4862
4863 set(CTEST_COVERAGE_COMMAND .../run-coverage-and-consolidate.sh)
4864
4865 where the run-coverage-and-consolidate.sh script is perhaps created by
4866 the configure_file() command and might contain the following code:
4867
4868 #!/usr/bin/env bash
4869 CoberturaFiles="$(find "/path/to/source" -name "cobertura.ser")"
4870 SourceDirs="$(find "/path/to/source" -name "java" -type d)"
4871 cobertura-merge --datafile coberturamerge.ser $CoberturaFiles
4872 cobertura-report --datafile coberturamerge.ser --destination . \
4873 --format xml $SourceDirs
4874
4875 The script uses find to capture the paths to all of the cobertura.ser
4876 files found below the project’s source directory. It keeps the list of
4877 files and supplies it as an argument to the cobertura-merge program.
4878 The --datafile argument signifies where the result of the merge will be
4879 kept.
4880
4881 The combined coberturamerge.ser file is then used to generate the XML
4882 report using the cobertura-report program. The call to the cober‐
4883 tura-report program requires some named arguments.
4884
4885 --datafila
4886 path to the merged .ser file
4887
4888 --destination
4889 path to put the output files(s)
4890
4891 --format
4892 file format to write output in: xml or html
4893
4894 The rest of the supplied arguments consist of the full paths to the
4895 /src/main/java directories of each module within the source tree. These
4896 directories are needed and should not be forgotten.
4897
4898 CTEST_COVERAGE_EXTRA_FLAGS
4899 Specify the CTest CoverageExtraFlags setting in a ctest(1) dashboard
4900 client script.
4901
4902 CTEST_CURL_OPTIONS
4903 Specify the CTest CurlOptions setting in a ctest(1) dashboard client
4904 script.
4905
4906 CTEST_CUSTOM_COVERAGE_EXCLUDE
4907 A list of regular expressions which will be used to exclude files by
4908 their path from coverage output by the ctest_coverage() command.
4909
4910 It is initialized by ctest(1), but may be edited in a CTestCustom file.
4911 See ctest_read_custom_files() documentation.
4912
4913 CTEST_CUSTOM_ERROR_EXCEPTION
4914 A list of regular expressions which will be used to exclude when
4915 detecting error messages in build outputs by the ctest_test() command.
4916
4917 It is initialized by ctest(1), but may be edited in a CTestCustom file.
4918 See ctest_read_custom_files() documentation.
4919
4920 CTEST_CUSTOM_ERROR_MATCH
4921 A list of regular expressions which will be used to detect error mes‐
4922 sages in build outputs by the ctest_test() command.
4923
4924 It is initialized by ctest(1), but may be edited in a CTestCustom file.
4925 See ctest_read_custom_files() documentation.
4926
4927 CTEST_CUSTOM_ERROR_POST_CONTEXT
4928 The number of lines to include as context which follow an error message
4929 by the ctest_test() command. The default is 10.
4930
4931 It is initialized by ctest(1), but may be edited in a CTestCustom file.
4932 See ctest_read_custom_files() documentation.
4933
4934 CTEST_CUSTOM_ERROR_PRE_CONTEXT
4935 The number of lines to include as context which precede an error mes‐
4936 sage by the ctest_test() command. The default is 10.
4937
4938 It is initialized by ctest(1), but may be edited in a CTestCustom file.
4939 See ctest_read_custom_files() documentation.
4940
4941 CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE
4942 When saving a failing test’s output, this is the maximum size, in
4943 bytes, that will be collected by the ctest_test() command. Defaults to
4944 307200 (300 KiB).
4945
4946 It is initialized by ctest(1), but may be edited in a CTestCustom file.
4947 See ctest_read_custom_files() documentation.
4948
4949 CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS
4950 The maximum number of errors in a single build step which will be
4951 detected. After this, the ctest_test() command will truncate the out‐
4952 put. Defaults to 50.
4953
4954 It is initialized by ctest(1), but may be edited in a CTestCustom file.
4955 See ctest_read_custom_files() documentation.
4956
4957 CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS
4958 The maximum number of warnings in a single build step which will be
4959 detected. After this, the ctest_test() command will truncate the out‐
4960 put. Defaults to 50.
4961
4962 It is initialized by ctest(1), but may be edited in a CTestCustom file.
4963 See ctest_read_custom_files() documentation.
4964
4965 CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE
4966 When saving a passing test’s output, this is the maximum size, in
4967 bytes, that will be collected by the ctest_test() command. Defaults to
4968 1024 (1 KiB).
4969
4970 It is initialized by ctest(1), but may be edited in a CTestCustom file.
4971 See ctest_read_custom_files() documentation.
4972
4973 CTEST_CUSTOM_MEMCHECK_IGNORE
4974 A list of regular expressions to use to exclude tests during the
4975 ctest_memcheck() command.
4976
4977 It is initialized by ctest(1), but may be edited in a CTestCustom file.
4978 See ctest_read_custom_files() documentation.
4979
4980 CTEST_CUSTOM_POST_MEMCHECK
4981 A list of commands to run at the end of the ctest_memcheck() command.
4982
4983 It is initialized by ctest(1), but may be edited in a CTestCustom file.
4984 See ctest_read_custom_files() documentation.
4985
4986 CTEST_CUSTOM_POST_TEST
4987 A list of commands to run at the end of the ctest_test() command.
4988
4989 It is initialized by ctest(1), but may be edited in a CTestCustom file.
4990 See ctest_read_custom_files() documentation.
4991
4992 CTEST_CUSTOM_PRE_MEMCHECK
4993 A list of commands to run at the start of the ctest_memcheck() command.
4994
4995 It is initialized by ctest(1), but may be edited in a CTestCustom file.
4996 See ctest_read_custom_files() documentation.
4997
4998 CTEST_CUSTOM_PRE_TEST
4999 A list of commands to run at the start of the ctest_test() command.
5000
5001 It is initialized by ctest(1), but may be edited in a CTestCustom file.
5002 See ctest_read_custom_files() documentation.
5003
5004 CTEST_CUSTOM_TESTS_IGNORE
5005 A list of regular expressions to use to exclude tests during the
5006 ctest_test() command.
5007
5008 It is initialized by ctest(1), but may be edited in a CTestCustom file.
5009 See ctest_read_custom_files() documentation.
5010
5011 CTEST_CUSTOM_WARNING_EXCEPTION
5012 A list of regular expressions which will be used to exclude when
5013 detecting warning messages in build outputs by the ctest_build() com‐
5014 mand.
5015
5016 It is initialized by ctest(1), but may be edited in a CTestCustom file.
5017 See ctest_read_custom_files() documentation.
5018
5019 CTEST_CUSTOM_WARNING_MATCH
5020 A list of regular expressions which will be used to detect warning mes‐
5021 sages in build outputs by the ctest_build() command.
5022
5023 It is initialized by ctest(1), but may be edited in a CTestCustom file.
5024 See ctest_read_custom_files() documentation.
5025
5026 CTEST_CVS_CHECKOUT
5027 Deprecated. Use CTEST_CHECKOUT_COMMAND instead.
5028
5029 CTEST_CVS_COMMAND
5030 Specify the CTest CVSCommand setting in a ctest(1) dashboard client
5031 script.
5032
5033 CTEST_CVS_UPDATE_OPTIONS
5034 Specify the CTest CVSUpdateOptions setting in a ctest(1) dashboard
5035 client script.
5036
5037 CTEST_DROP_LOCATION
5038 Specify the CTest DropLocation setting in a ctest(1) dashboard client
5039 script.
5040
5041 CTEST_DROP_METHOD
5042 Specify the CTest DropMethod setting in a ctest(1) dashboard client
5043 script.
5044
5045 CTEST_DROP_SITE
5046 Specify the CTest DropSite setting in a ctest(1) dashboard client
5047 script.
5048
5049 CTEST_DROP_SITE_CDASH
5050 Specify the CTest IsCDash setting in a ctest(1) dashboard client
5051 script.
5052
5053 CTEST_DROP_SITE_PASSWORD
5054 Specify the CTest DropSitePassword setting in a ctest(1) dashboard
5055 client script.
5056
5057 CTEST_DROP_SITE_USER
5058 Specify the CTest DropSiteUser setting in a ctest(1) dashboard client
5059 script.
5060
5061 CTEST_EXTRA_COVERAGE_GLOB
5062 A list of regular expressions which will be used to find files which
5063 should be covered by the ctest_coverage() command.
5064
5065 It is initialized by ctest(1), but may be edited in a CTestCustom file.
5066 See ctest_read_custom_files() documentation.
5067
5068 CTEST_GIT_COMMAND
5069 Specify the CTest GITCommand setting in a ctest(1) dashboard client
5070 script.
5071
5072 CTEST_GIT_INIT_SUBMODULES
5073 Specify the CTest GITInitSubmodules setting in a ctest(1) dashboard
5074 client script.
5075
5076 CTEST_GIT_UPDATE_CUSTOM
5077 Specify the CTest GITUpdateCustom setting in a ctest(1) dashboard
5078 client script.
5079
5080 CTEST_GIT_UPDATE_OPTIONS
5081 Specify the CTest GITUpdateOptions setting in a ctest(1) dashboard
5082 client script.
5083
5084 CTEST_HG_COMMAND
5085 Specify the CTest HGCommand setting in a ctest(1) dashboard client
5086 script.
5087
5088 CTEST_HG_UPDATE_OPTIONS
5089 Specify the CTest HGUpdateOptions setting in a ctest(1) dashboard
5090 client script.
5091
5092 CTEST_LABELS_FOR_SUBPROJECTS
5093 Specify the CTest LabelsForSubprojects setting in a ctest(1) dashboard
5094 client script.
5095
5096 CTEST_MEMORYCHECK_COMMAND
5097 Specify the CTest MemoryCheckCommand setting in a ctest(1) dashboard
5098 client script.
5099
5100 CTEST_MEMORYCHECK_COMMAND_OPTIONS
5101 Specify the CTest MemoryCheckCommandOptions setting in a ctest(1) dash‐
5102 board client script.
5103
5104 CTEST_MEMORYCHECK_SANITIZER_OPTIONS
5105 Specify the CTest MemoryCheckSanitizerOptions setting in a ctest(1)
5106 dashboard client script.
5107
5108 CTEST_MEMORYCHECK_SUPPRESSIONS_FILE
5109 Specify the CTest MemoryCheckSuppressionFile setting in a ctest(1)
5110 dashboard client script.
5111
5112 CTEST_MEMORYCHECK_TYPE
5113 Specify the CTest MemoryCheckType setting in a ctest(1) dashboard
5114 client script. Valid values are Valgrind, Purify, BoundsChecker, and
5115 ThreadSanitizer, AddressSanitizer, LeakSanitizer, MemorySanitizer, and
5116 UndefinedBehaviorSanitizer.
5117
5118 CTEST_NIGHTLY_START_TIME
5119 Specify the CTest NightlyStartTime setting in a ctest(1) dashboard
5120 client script.
5121
5122 CTEST_P4_CLIENT
5123 Specify the CTest P4Client setting in a ctest(1) dashboard client
5124 script.
5125
5126 CTEST_P4_COMMAND
5127 Specify the CTest P4Command setting in a ctest(1) dashboard client
5128 script.
5129
5130 CTEST_P4_OPTIONS
5131 Specify the CTest P4Options setting in a ctest(1) dashboard client
5132 script.
5133
5134 CTEST_P4_UPDATE_OPTIONS
5135 Specify the CTest P4UpdateOptions setting in a ctest(1) dashboard
5136 client script.
5137
5138 CTEST_RUN_CURRENT_SCRIPT
5139 Setting this to 0 prevents ctest(1) from being run again when it
5140 reaches the end of a script run by calling ctest -S.
5141
5142 CTEST_SCP_COMMAND
5143 Legacy option. Not used.
5144
5145 CTEST_SITE
5146 Specify the CTest Site setting in a ctest(1) dashboard client script.
5147
5148 CTEST_SUBMIT_URL
5149 Specify the CTest SubmitURL setting in a ctest(1) dashboard client
5150 script.
5151
5152 CTEST_SOURCE_DIRECTORY
5153 Specify the CTest SourceDirectory setting in a ctest(1) dashboard
5154 client script.
5155
5156 CTEST_SVN_COMMAND
5157 Specify the CTest SVNCommand setting in a ctest(1) dashboard client
5158 script.
5159
5160 CTEST_SVN_OPTIONS
5161 Specify the CTest SVNOptions setting in a ctest(1) dashboard client
5162 script.
5163
5164 CTEST_SVN_UPDATE_OPTIONS
5165 Specify the CTest SVNUpdateOptions setting in a ctest(1) dashboard
5166 client script.
5167
5168 CTEST_TEST_LOAD
5169 Specify the TestLoad setting in the CTest Test Step of a ctest(1) dash‐
5170 board client script. This sets the default value for the TEST_LOAD
5171 option of the ctest_test() command.
5172
5173 CTEST_TEST_TIMEOUT
5174 Specify the CTest TimeOut setting in a ctest(1) dashboard client
5175 script.
5176
5177 CTEST_TRIGGER_SITE
5178 Legacy option. Not used.
5179
5180 CTEST_UPDATE_COMMAND
5181 Specify the CTest UpdateCommand setting in a ctest(1) dashboard client
5182 script.
5183
5184 CTEST_UPDATE_OPTIONS
5185 Specify the CTest UpdateOptions setting in a ctest(1) dashboard client
5186 script.
5187
5188 CTEST_UPDATE_VERSION_ONLY
5189 Specify the CTest UpdateVersionOnly setting in a ctest(1) dashboard
5190 client script.
5191
5192 CTEST_UPDATE_VERSION_OVERRIDE
5193 Specify the CTest UpdateVersionOverride setting in a ctest(1) dashboard
5194 client script.
5195
5196 CTEST_USE_LAUNCHERS
5197 Specify the CTest UseLaunchers setting in a ctest(1) dashboard client
5198 script.
5199
5201 CPACK_ABSOLUTE_DESTINATION_FILES
5202 List of files which have been installed using an ABSOLUTE DESTINATION
5203 path.
5204
5205 This variable is a Read-Only variable which is set internally by CPack
5206 during installation and before packaging using CMAKE_ABSOLUTE_DESTINA‐
5207 TION_FILES defined in cmake_install.cmake scripts. The value can be
5208 used within CPack project configuration file and/or CPack<GEN>.cmake
5209 file of <GEN> generator.
5210
5211 CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY
5212 Boolean toggle to include/exclude top level directory (component case).
5213
5214 Similar usage as CPACK_INCLUDE_TOPLEVEL_DIRECTORY but for the component
5215 case. See CPACK_INCLUDE_TOPLEVEL_DIRECTORY documentation for the
5216 detail.
5217
5218 CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION
5219 Ask CPack to error out as soon as a file with absolute INSTALL DESTINA‐
5220 TION is encountered.
5221
5222 The fatal error is emitted before the installation of the offending
5223 file takes place. Some CPack generators, like NSIS, enforce this
5224 internally. This variable triggers the definition of
5225 CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION when CPack runs.
5226
5227 CPACK_INCLUDE_TOPLEVEL_DIRECTORY
5228 Boolean toggle to include/exclude top level directory.
5229
5230 When preparing a package CPack installs the item under the so-called
5231 top level directory. The purpose of is to include (set to 1 or ON or
5232 TRUE) the top level directory in the package or not (set to 0 or OFF or
5233 FALSE).
5234
5235 Each CPack generator has a built-in default value for this variable.
5236 E.g. Archive generators (ZIP, TGZ, …) includes the top level whereas
5237 RPM or DEB don’t. The user may override the default value by setting
5238 this variable.
5239
5240 There is a similar variable CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY
5241 which may be used to override the behavior for the component packaging
5242 case which may have different default value for historical (now back‐
5243 ward compatibility) reason.
5244
5245 CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS
5246 Default permissions for implicitly created directories during packag‐
5247 ing.
5248
5249 This variable serves the same purpose during packaging as the
5250 CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS variable serves during
5251 installation (e.g. make install).
5252
5253 If include(CPack) is used then by default this variable is set to the
5254 content of CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS.
5255
5256 CPACK_PACKAGING_INSTALL_PREFIX
5257 The prefix used in the built package.
5258
5259 Each CPack generator has a default value (like /usr). This default
5260 value may be overwritten from the CMakeLists.txt or the cpack(1) com‐
5261 mand line by setting an alternative value. Example:
5262
5263 set(CPACK_PACKAGING_INSTALL_PREFIX "/opt")
5264
5265 This is not the same purpose as CMAKE_INSTALL_PREFIX which is used when
5266 installing from the build tree without building a package.
5267
5268 CPACK_SET_DESTDIR
5269 Boolean toggle to make CPack use DESTDIR mechanism when packaging.
5270
5271 DESTDIR means DESTination DIRectory. It is commonly used by makefile
5272 users in order to install software at non-default location. It is a
5273 basic relocation mechanism that should not be used on Windows (see
5274 CMAKE_INSTALL_PREFIX documentation). It is usually invoked like this:
5275
5276 make DESTDIR=/home/john install
5277
5278 which will install the concerned software using the installation pre‐
5279 fix, e.g. /usr/local prepended with the DESTDIR value which finally
5280 gives /home/john/usr/local. When preparing a package, CPack first
5281 installs the items to be packaged in a local (to the build tree) direc‐
5282 tory by using the same DESTDIR mechanism. Nevertheless, if
5283 CPACK_SET_DESTDIR is set then CPack will set DESTDIR before doing the
5284 local install. The most noticeable difference is that without
5285 CPACK_SET_DESTDIR, CPack uses CPACK_PACKAGING_INSTALL_PREFIX as a pre‐
5286 fix whereas with CPACK_SET_DESTDIR set, CPack will use
5287 CMAKE_INSTALL_PREFIX as a prefix.
5288
5289 Manually setting CPACK_SET_DESTDIR may help (or simply be necessary) if
5290 some install rules uses absolute DESTINATION (see CMake install() com‐
5291 mand). However, starting with CPack/CMake 2.8.3 RPM and DEB installers
5292 tries to handle DESTDIR automatically so that it is seldom necessary
5293 for the user to set it.
5294
5295 CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION
5296 Ask CPack to warn each time a file with absolute INSTALL DESTINATION is
5297 encountered.
5298
5299 This variable triggers the definition of CMAKE_WARN_ON_ABSO‐
5300 LUTE_INSTALL_DESTINATION when CPack runs cmake_install.cmake scripts.
5301
5303 CACHE
5304 Operator to read cache variables.
5305
5306 Use the syntax $CACHE{VAR} to read cache entry VAR. See the cmake-lan‐
5307 guage(7) variables documentation for more complete documentation of the
5308 interaction of normal variables and cache entries.
5309
5310 When evaluating Variable References of the form ${VAR}, CMake first
5311 searches for a normal variable with that name, and if not found CMake
5312 will search for a cache entry with that name. The $CACHE{VAR} syntax
5313 can be used to do direct cache lookup and ignore any existing normal
5314 variable.
5315
5316 See the set() and unset() commands to see how to write or remove cache
5317 variables.
5318
5319 ENV
5320 Operator to read environment variables.
5321
5322 Use the syntax $ENV{VAR} to read environment variable VAR.
5323
5324 To test whether an environment variable is defined, use the signature
5325 if(DEFINED ENV{<name>}) of the if() command.
5326
5327 See the set() and unset() commands to see how to write or remove envi‐
5328 ronment variables.
5329
5331 CMake has many internal variables. Most of them are undocumented.
5332 Some of them, however, were at some point described as normal vari‐
5333 ables, and therefore may be encountered in legacy code. They are sub‐
5334 ject to change, and not recommended for use in project code.
5335
5336 CMAKE_HOME_DIRECTORY
5337 Path to top of source tree. Same as CMAKE_SOURCE_DIR.
5338
5339 This is an internal cache entry used to locate the source directory
5340 when loading a CMakeCache.txt from a build tree. It should not be used
5341 in project code. The variable CMAKE_SOURCE_DIR has the same value and
5342 should be preferred.
5343
5344 CMAKE_INTERNAL_PLATFORM_ABI
5345 An internal variable subject to change.
5346
5347 This is used in determining the compiler ABI and is subject to change.
5348
5349 CMAKE_<LANG>_COMPILER_ABI
5350 An internal variable subject to change.
5351
5352 This is used in determining the compiler ABI and is subject to change.
5353
5354 CMAKE_<LANG>_COMPILER_ARCHITECTURE_ID
5355 An internal variable subject to change.
5356
5357 This is used to identify the variant of a compiler based on its target
5358 architecture. For some compilers this is needed to determine the cor‐
5359 rect usage.
5360
5361 CMAKE_<LANG>_COMPILER_VERSION_INTERNAL
5362 An internal variable subject to change.
5363
5364 This is used to identify the variant of a compiler based on an internal
5365 version number. For some compilers this is needed to determine the
5366 correct usage.
5367
5368 CMAKE_<LANG>_PLATFORM_ID
5369 An internal variable subject to change.
5370
5371 This is used in determining the platform and is subject to change.
5372
5373 CMAKE_NOT_USING_CONFIG_FLAGS
5374 Skip _BUILD_TYPE flags if true.
5375
5376 This is an internal flag used by the generators in CMake to tell CMake
5377 to skip the _BUILD_TYPE flags.
5378
5379 CMAKE_VS_INTEL_Fortran_PROJECT_VERSION
5380 When generating for Visual Studio 9 2008 or greater with the Intel For‐
5381 tran plugin installed, this specifies the .vfproj project file format
5382 version. This is intended for internal use by CMake and should not be
5383 used by project code.
5384
5386 2000-2019 Kitware, Inc. and Contributors
5387
5388
5389
5390
53913.16.1 Dec 14, 2019 CMAKE-VARIABLES(7)