1CMAKE-ENV-VARIABLES(7) CMake CMAKE-ENV-VARIABLES(7)
2
3
4
6 cmake-env-variables - CMake Environment Variables Reference
7
8 This page lists environment variables that have special meaning to
9 CMake.
10
11 For general information on environment variables, see the Environment
12 Variables section in the cmake-language manual.
13
15 CMAKE_PREFIX_PATH
16 This is a CMake Environment Variable. Its initial value is taken from
17 the calling process environment.
18
19 The CMAKE_PREFIX_PATH environment variable may be set to a list of di‐
20 rectories specifying installation prefixes to be searched by the
21 find_package(), find_program(), find_library(), find_file(), and
22 find_path() commands. Each command will add appropriate subdirectories
23 (like bin, lib, or include) as specified in its own documentation.
24
25 This variable may hold a single prefix or a list of prefixes separated
26 by : on UNIX or ; on Windows (the same as the PATH environment variable
27 convention on those platforms).
28
29 See also the CMAKE_PREFIX_PATH CMake variable.
30
32 CMAKE_APPLE_SILICON_PROCESSOR
33 New in version 3.19.2.
34
35
36 This is a CMake Environment Variable. Its initial value is taken from
37 the calling process environment.
38
39 On Apple Silicon hosts running macOS, set this environment variable to
40 tell CMake what architecture to use for CMAKE_HOST_SYSTEM_PROCESSOR.
41 The value must be either arm64 or x86_64.
42
43 The CMAKE_APPLE_SILICON_PROCESSOR normal variable, if set, overrides
44 this environment variable.
45
46 CMAKE_BUILD_PARALLEL_LEVEL
47 New in version 3.12.
48
49
50 This is a CMake Environment Variable. Its initial value is taken from
51 the calling process environment.
52
53 Specifies the maximum number of concurrent processes to use when build‐
54 ing using the cmake --build command line Build Tool Mode.
55
56 If this variable is defined empty the native build tool's default num‐
57 ber is used.
58
59 CMAKE_BUILD_TYPE
60 New in version 3.22.
61
62
63 This is a CMake Environment Variable. Its initial value is taken from
64 the calling process environment.
65
66 The CMAKE_BUILD_TYPE environment variable specifies a default value for
67 the CMAKE_BUILD_TYPE variable when there is no explicit configuration
68 given on the first run while creating a new build tree.
69
70 CMAKE_CONFIGURATION_TYPES
71 New in version 3.22.
72
73
74 This is a CMake Environment Variable. Its initial value is taken from
75 the calling process environment.
76
77 The CMAKE_CONFIGURATION_TYPES environment variable specifies a default
78 value for the CMAKE_CONFIGURATION_TYPES variable when there is no ex‐
79 plicit configuration given on the first run while creating a new build
80 tree.
81
82 CMAKE_CONFIG_TYPE
83 This is a CMake Environment Variable. Its initial value is taken from
84 the calling process environment.
85
86 The default build configuration for Build Tool Mode and ctest build
87 handler when there is no explicit configuration given.
88
89 CMAKE_EXPORT_COMPILE_COMMANDS
90 New in version 3.17.
91
92
93 This is a CMake Environment Variable. Its initial value is taken from
94 the calling process environment.
95
96 The default value for CMAKE_EXPORT_COMPILE_COMMANDS when there is no
97 explicit configuration given on the first run while creating a new
98 build tree. On later runs in an existing build tree the value persists
99 in the cache as CMAKE_EXPORT_COMPILE_COMMANDS.
100
101 CMAKE_GENERATOR
102 New in version 3.15.
103
104
105 This is a CMake Environment Variable. Its initial value is taken from
106 the calling process environment.
107
108 Specifies the CMake default generator to use when no generator is sup‐
109 plied with -G. If the provided value doesn't name a generator known by
110 CMake, the internal default is used. Either way the resulting genera‐
111 tor selection is stored in the CMAKE_GENERATOR variable.
112
113 Some generators may be additionally configured using the environment
114 variables:
115
116 • CMAKE_GENERATOR_PLATFORM
117
118 • CMAKE_GENERATOR_TOOLSET
119
120 • CMAKE_GENERATOR_INSTANCE
121
122 CMAKE_GENERATOR_INSTANCE
123 New in version 3.15.
124
125
126 This is a CMake Environment Variable. Its initial value is taken from
127 the calling process environment.
128
129 Default value for CMAKE_GENERATOR_INSTANCE if no Cache entry is
130 present. This value is only applied if CMAKE_GENERATOR is set.
131
132 CMAKE_GENERATOR_PLATFORM
133 New in version 3.15.
134
135
136 This is a CMake Environment Variable. Its initial value is taken from
137 the calling process environment.
138
139 Default value for CMAKE_GENERATOR_PLATFORM if no Cache entry is present
140 and no value is specified by cmake(1) -A option. This value is only
141 applied if CMAKE_GENERATOR is set.
142
143 CMAKE_GENERATOR_TOOLSET
144 New in version 3.15.
145
146
147 This is a CMake Environment Variable. Its initial value is taken from
148 the calling process environment.
149
150 Default value for CMAKE_GENERATOR_TOOLSET if no Cache entry is present
151 and no value is specified by cmake(1) -T option. This value is only
152 applied if CMAKE_GENERATOR is set.
153
154 CMAKE_INSTALL_MODE
155 New in version 3.22.
156
157
158 This is a CMake Environment Variable. Its initial value is taken from
159 the calling process environment.
160
161 The CMAKE_INSTALL_MODE environment variable allows users to operate
162 CMake in an alternate mode of file(INSTALL) and install().
163
164 The default behavior for an installation is to copy a source file from
165 a source directory into a destination directory. This environment vari‐
166 able however allows the user to override this behavior, causing CMake
167 to create symbolic links instead.
168
169 Usage Scenarios
170 Installing symbolic links rather than copying files can help in the
171 following ways:
172
173 • Conserving storage space because files do not have to be duplicated
174 on disk.
175
176 • Changes to the source of the symbolic link are seen at the install
177 destination without having to re-run the install step.
178
179 • Editing through the link at the install destination will modify the
180 source of the link. This may be useful when dealing with CMake
181 project hierarchies, i.e. using ExternalProject and consistent source
182 navigation and refactoring is desired across projects.
183
184 Allowed Values
185 The following values are allowed for CMAKE_INSTALL_MODE:
186
187 COPY, empty or unset
188 Duplicate the file at its destination. This is the default be‐
189 havior.
190
191 ABS_SYMLINK
192 Create an absolute symbolic link to the source file at the des‐
193 tination. Halt with an error if the link cannot be created.
194
195 ABS_SYMLINK_OR_COPY
196 Like ABS_SYMLINK but fall back to silently copying if the sym‐
197 link couldn't be created.
198
199 REL_SYMLINK
200 Create a relative symbolic link to the source file at the desti‐
201 nation. Halt with an error if the link cannot be created.
202
203 REL_SYMLINK_OR_COPY
204 Like REL_SYMLINK but fall back to silently copying if the sym‐
205 link couldn't be created.
206
207 SYMLINK
208 Try as if through REL_SYMLINK and fall back to ABS_SYMLINK if
209 the referenced file cannot be expressed using a relative path.
210 Halt with an error if the link cannot be created.
211
212 SYMLINK_OR_COPY
213 Like SYMLINK but fall back to silently copying if the symlink
214 couldn't be created.
215
216 NOTE:
217 A symbolic link consists of a reference file path rather than con‐
218 tents of its own, hence there are two ways to express the relation,
219 either by a relative or an absolute path.
220
221 When To Set The Environment Variable
222 For the environment variable to take effect, it must be set during the
223 correct build phase(s).
224
225 • If the project calls file(INSTALL) directly, the environment variable
226 must be set during the configuration phase.
227
228 • In order to apply to install(), the environment variable must be set
229 during installation. This could be during a build if using the in‐
230 stall or package build targets, or separate from the build when in‐
231 voking an install or running cpack from the command line.
232
233 • When using ExternalProject, it might be required during the build
234 phase, since the external project's own configure, build and install
235 steps will execute during the main project's build phase.
236
237 Given the above, it is recommended to set the environment variable con‐
238 sistently across all phases (configure, build and install).
239
240 Caveats
241 Use this environment variable with caution. The following highlights
242 some points to be considered:
243
244 • CMAKE_INSTALL_MODE only affects files, not directories.
245
246 • Symbolic links are not available on all platforms.
247
248 • The way this environment variable interacts with the install step of
249 ExternalProject is more complex. For further details, see that mod‐
250 ule's documentation.
251
252 • A symbolic link ties the destination to the source in a persistent
253 way. Writing to either of the two affects both file system objects.
254 This is in contrast to normal install behavior which only copies
255 files as they were at the time the install was performed, with no en‐
256 during relationship between the source and destination of the in‐
257 stall.
258
259 • Combining CMAKE_INSTALL_MODE with IOS_INSTALL_COMBINED is not sup‐
260 ported.
261
262 • Changing CMAKE_INSTALL_MODE from what it was on a previous run can
263 lead to unexpected results. Moving from a non-symlinking mode to a
264 symlinking mode will discard any previous file at the destination,
265 but the reverse is not true. Once a symlink exists at the destina‐
266 tion, even if you switch to a non-symlink mode, the symlink will con‐
267 tinue to exist at the destination and will not be replaced by an ac‐
268 tual file.
269
270 CMAKE_<LANG>_COMPILER_LAUNCHER
271 New in version 3.17.
272
273
274 This is a CMake Environment Variable. Its initial value is taken from
275 the calling process environment.
276
277 Default compiler launcher to use for the specified language. Will only
278 be used by CMake to initialize the variable on the first configuration.
279 Afterwards, it is available through the cache setting of the variable
280 of the same name. For any configuration run (including the first), the
281 environment variable will be ignored if the CMAKE_<LANG>_COM‐
282 PILER_LAUNCHER variable is defined.
283
284 CMAKE_<LANG>_LINKER_LAUNCHER
285 New in version 3.21.
286
287
288 This is a CMake Environment Variable. Its initial value is taken from
289 the calling process environment.
290
291 Default launcher to use when linking a target of the specified lan‐
292 guage. Will only be used by CMake to initialize the variable on the
293 first configuration. Afterwards, it is available through the cache
294 setting of the variable of the same name. For any configuration run
295 (including the first), the environment variable will be ignored if the
296 CMAKE_<LANG>_LINKER_LAUNCHER variable is defined.
297
298 CMAKE_MSVCIDE_RUN_PATH
299 This is a CMake Environment Variable. Its initial value is taken from
300 the calling process environment.
301
302 Extra PATH locations for custom commands when using Visual Studio 9
303 2008 (or above) generators.
304
305 The CMAKE_MSVCIDE_RUN_PATH environment variable sets the default value
306 for the CMAKE_MSVCIDE_RUN_PATH variable if not already explicitly set.
307
308 CMAKE_NO_VERBOSE
309 New in version 3.14.
310
311
312 Disables verbose output from CMake when VERBOSE environment variable is
313 set.
314
315 Only your build tool of choice will still print verbose output when you
316 start to actually build your project.
317
318 CMAKE_OSX_ARCHITECTURES
319 This is a CMake Environment Variable. Its initial value is taken from
320 the calling process environment.
321
322 Target specific architectures for macOS.
323
324 The CMAKE_OSX_ARCHITECTURES environment variable sets the default value
325 for the CMAKE_OSX_ARCHITECTURES variable. See OSX_ARCHITECTURES for
326 more information.
327
328 CMAKE_TOOLCHAIN_FILE
329 New in version 3.21.
330
331
332 This is a CMake Environment Variable. Its initial value is taken from
333 the calling process environment.
334
335 The CMAKE_TOOLCHAIN_FILE environment variable specifies a default value
336 for the CMAKE_TOOLCHAIN_FILE variable when there is no explicit config‐
337 uration given on the first run while creating a new build tree. On
338 later runs in an existing build tree the value persists in the cache as
339 CMAKE_TOOLCHAIN_FILE.
340
341 DESTDIR
342 This is a CMake Environment Variable. Its initial value is taken from
343 the calling process environment.
344
345 On UNIX one can use the DESTDIR mechanism in order to relocate the
346 whole installation. DESTDIR means DESTination DIRectory. It is com‐
347 monly used by makefile users in order to install software at non-de‐
348 fault location. It is usually invoked like this:
349
350 make DESTDIR=/home/john install
351
352 which will install the concerned software using the installation pre‐
353 fix, e.g. /usr/local prepended with the DESTDIR value which finally
354 gives /home/john/usr/local.
355
356 WARNING: DESTDIR may not be used on Windows because installation prefix
357 usually contains a drive letter like in C:/Program Files which cannot
358 be prepended with some other prefix.
359
360 LDFLAGS
361 This is a CMake Environment Variable. Its initial value is taken from
362 the calling process environment.
363
364 Will only be used by CMake on the first configuration to determine the
365 default linker flags, after which the value for LDFLAGS is stored in
366 the cache as CMAKE_EXE_LINKER_FLAGS_INIT,
367 CMAKE_SHARED_LINKER_FLAGS_INIT, and CMAKE_MODULE_LINKER_FLAGS_INIT. For
368 any configuration run (including the first), the environment variable
369 will be ignored if the equivalent CMAKE_<TYPE>_LINKER_FLAGS_INIT vari‐
370 able is defined.
371
372 MACOSX_DEPLOYMENT_TARGET
373 This is a CMake Environment Variable. Its initial value is taken from
374 the calling process environment.
375
376 Specify the minimum version of macOS on which the target binaries are
377 to be deployed.
378
379 The MACOSX_DEPLOYMENT_TARGET environment variable sets the default
380 value for the CMAKE_OSX_DEPLOYMENT_TARGET variable.
381
382 <PackageName>_ROOT
383 New in version 3.12.
384
385
386 This is a CMake Environment Variable. Its initial value is taken from
387 the calling process environment.
388
389 Calls to find_package(<PackageName>) will search in prefixes specified
390 by the <PackageName>_ROOT environment variable, where <PackageName> is
391 the name given to the find_package() call and _ROOT is literal. For
392 example, find_package(Foo) will search prefixes specified in the
393 Foo_ROOT environment variable (if set). See policy CMP0074.
394
395 This variable may hold a single prefix or a list of prefixes separated
396 by : on UNIX or ; on Windows (the same as the PATH environment variable
397 convention on those platforms).
398
399 See also the <PackageName>_ROOT CMake variable.
400
401 VERBOSE
402 New in version 3.14.
403
404
405 Activates verbose output from CMake and your build tools of choice when
406 you start to actually build your project.
407
408 Note that any given value is ignored. It's just checked for existence.
409
410 See also Build Tool Mode and CMAKE_NO_VERBOSE environment variable
411
413 ASM<DIALECT>
414 This is a CMake Environment Variable. Its initial value is taken from
415 the calling process environment.
416
417 Preferred executable for compiling a specific dialect of assembly lan‐
418 guage files. ASM<DIALECT> can be ASM, ASM_NASM (Netwide Assembler),
419 ASM_MASM (Microsoft Assembler) or ASM-ATT (Assembler AT&T). Will only
420 be used by CMake on the first configuration to determine ASM<DIALECT>
421 compiler, after which the value for ASM<DIALECT> is stored in the cache
422 as CMAKE_ASM<DIALECT>_COMPILER. For subsequent configuration runs, the
423 environment variable will be ignored in favor of CMAKE_ASM<DI‐
424 ALECT>_COMPILER.
425
426 NOTE:
427 Options that are required to make the compiler work correctly can be
428 included; they can not be changed.
429
430 $ export ASM="custom-compiler --arg1 --arg2"
431
432 ASM<DIALECT>FLAGS
433 This is a CMake Environment Variable. Its initial value is taken from
434 the calling process environment.
435
436 Default compilation flags to be used when compiling a specific dialect
437 of an assembly language. ASM<DIALECT>FLAGS can be ASMFLAGS, ASM_NASM‐
438 FLAGS, ASM_MASMFLAGS or ASM-ATTFLAGS. Will only be used by CMake on the
439 first configuration to determine ASM_<DIALECT> default compilation
440 flags, after which the value for ASM<DIALECT>FLAGS is stored in the
441 cache as CMAKE_ASM<DIALECT>_FLAGS <CMAKE_<LANG>_FLAGS>. For any con‐
442 figuration run (including the first), the environment variable will be
443 ignored, if the CMAKE_ASM<DIALECT>_FLAGS <CMAKE_<LANG>_FLAGS> variable
444 is defined.
445
446 See also CMAKE_ASM<DIALECT>_FLAGS_INIT.
447
448 CC
449 This is a CMake Environment Variable. Its initial value is taken from
450 the calling process environment.
451
452 Preferred executable for compiling C language files. Will only be used
453 by CMake on the first configuration to determine C compiler, after
454 which the value for CC is stored in the cache as CMAKE_C_COMPILER. For
455 any configuration run (including the first), the environment variable
456 will be ignored if the CMAKE_C_COMPILER variable is defined.
457
458 NOTE:
459 Options that are required to make the compiler work correctly can be
460 included; they can not be changed.
461
462 $ export CC="custom-compiler --arg1 --arg2"
463
464 CFLAGS
465 This is a CMake Environment Variable. Its initial value is taken from
466 the calling process environment.
467
468 Default compilation flags to be used when compiling C files. Will only
469 be used by CMake on the first configuration to determine CC default
470 compilation flags, after which the value for CFLAGS is stored in the
471 cache as CMAKE_C_FLAGS. For any configuration run (including the
472 first), the environment variable will be ignored if the CMAKE_C_FLAGS
473 variable is defined.
474
475 See also CMAKE_C_FLAGS_INIT.
476
477 CSFLAGS
478 New in version 3.9.2.
479
480
481 This is a CMake Environment Variable. Its initial value is taken from
482 the calling process environment.
483
484 Default compilation flags to be used when compiling CSharp files. Will
485 only be used by CMake on the first configuration to determine CSharp
486 default compilation flags, after which the value for CSFLAGS is stored
487 in the cache as CMAKE_CSharp_FLAGS. For any configuration run (includ‐
488 ing the first), the environment variable will be ignored if the
489 CMAKE_CSharp_FLAGS variable is defined.
490
491 See also CMAKE_CSharp_FLAGS_INIT.
492
493 CUDAARCHS
494 New in version 3.20.
495
496
497 This is a CMake Environment Variable. Its initial value is taken from
498 the calling process environment.
499
500 Value used to initialize CMAKE_CUDA_ARCHITECTURES on the first configu‐
501 ration if it's not already defined. Subsequent runs will use the value
502 stored in the cache.
503
504 This is a semicolon-separated list of architectures as described in
505 CUDA_ARCHITECTURES.
506
507 CUDACXX
508 New in version 3.8.
509
510
511 This is a CMake Environment Variable. Its initial value is taken from
512 the calling process environment.
513
514 Preferred executable for compiling CUDA language files. Will only be
515 used by CMake on the first configuration to determine CUDA compiler,
516 after which the value for CUDA is stored in the cache as
517 CMAKE_CUDA_COMPILER. For any configuration run (including the first),
518 the environment variable will be ignored if the CMAKE_CUDA_COMPILER
519 variable is defined.
520
521 NOTE:
522 Options that are required to make the compiler work correctly can be
523 included; they can not be changed.
524
525 $ export CUDACXX="custom-compiler --arg1 --arg2"
526
527 CUDAFLAGS
528 New in version 3.8.
529
530
531 This is a CMake Environment Variable. Its initial value is taken from
532 the calling process environment.
533
534 Default compilation flags to be used when compiling CUDA files. Will
535 only be used by CMake on the first configuration to determine CUDA de‐
536 fault compilation flags, after which the value for CUDAFLAGS is stored
537 in the cache as CMAKE_CUDA_FLAGS. For any configuration run (including
538 the first), the environment variable will be ignored if the
539 CMAKE_CUDA_FLAGS variable is defined.
540
541 See also CMAKE_CUDA_FLAGS_INIT.
542
543 CUDAHOSTCXX
544 New in version 3.8.
545
546
547 This is a CMake Environment Variable. Its initial value is taken from
548 the calling process environment.
549
550 Preferred executable for compiling host code when compiling CUDA lan‐
551 guage files. Will only be used by CMake on the first configuration to
552 determine CUDA host compiler, after which the value for CUDAHOSTCXX is
553 stored in the cache as CMAKE_CUDA_HOST_COMPILER. For any configuration
554 run (including the first), the environment variable will be ignored if
555 the CMAKE_CUDA_HOST_COMPILER variable is defined.
556
557 This environment variable is primarily meant for use with projects that
558 enable CUDA as a first-class language.
559
560 NOTE:
561 Ignored when using Visual Studio Generators.
562
563 New in version 3.13: The FindCUDA module will use this variable to ini‐
564 tialize its CUDA_HOST_COMPILER setting.
565
566
567 CXX
568 This is a CMake Environment Variable. Its initial value is taken from
569 the calling process environment.
570
571 Preferred executable for compiling CXX language files. Will only be
572 used by CMake on the first configuration to determine CXX compiler, af‐
573 ter which the value for CXX is stored in the cache as CMAKE_CXX_COM‐
574 PILER. For any configuration run (including the first), the environment
575 variable will be ignored if the CMAKE_CXX_COMPILER variable is defined.
576
577 NOTE:
578 Options that are required to make the compiler work correctly can be
579 included; they can not be changed.
580
581 $ export CXX="custom-compiler --arg1 --arg2"
582
583 CXXFLAGS
584 This is a CMake Environment Variable. Its initial value is taken from
585 the calling process environment.
586
587 Default compilation flags to be used when compiling CXX (C++) files.
588 Will only be used by CMake on the first configuration to determine CXX
589 default compilation flags, after which the value for CXXFLAGS is stored
590 in the cache as CMAKE_CXX_FLAGS. For any configuration run ( including
591 the first), the environment variable will be ignored if the
592 CMAKE_CXX_FLAGS variable is defined.
593
594 See also CMAKE_CXX_FLAGS_INIT.
595
596 FC
597 This is a CMake Environment Variable. Its initial value is taken from
598 the calling process environment.
599
600 Preferred executable for compiling Fortran language files. Will only be
601 used by CMake on the first configuration to determine Fortran compiler,
602 after which the value for Fortran is stored in the cache as CMAKE_For‐
603 tran_COMPILER. For any configuration run (including the first), the en‐
604 vironment variable will be ignored if the CMAKE_Fortran_COMPILER vari‐
605 able is defined.
606
607 NOTE:
608 Options that are required to make the compiler work correctly can be
609 included; they can not be changed.
610
611 $ export FC="custom-compiler --arg1 --arg2"
612
613 FFLAGS
614 This is a CMake Environment Variable. Its initial value is taken from
615 the calling process environment.
616
617 Default compilation flags to be used when compiling Fortran files. Will
618 only be used by CMake on the first configuration to determine Fortran
619 default compilation flags, after which the value for FFLAGS is stored
620 in the cache as CMAKE_Fortran_FLAGS. For any configuration run (includ‐
621 ing the first), the environment variable will be ignored if the
622 CMAKE_Fortran_FLAGS variable is defined.
623
624 See also CMAKE_Fortran_FLAGS_INIT.
625
626 HIPCXX
627 New in version 3.21.
628
629
630 This is a CMake Environment Variable. Its initial value is taken from
631 the calling process environment.
632
633 Preferred executable for compiling HIP language files. Will only be
634 used by CMake on the first configuration to determine HIP compiler, af‐
635 ter which the value for HIP is stored in the cache as CMAKE_HIP_COM‐
636 PILER. For any configuration run (including the first), the environment
637 variable will be ignored if the CMAKE_HIP_COMPILER variable is defined.
638
639 HIPFLAGS
640 New in version 3.21.
641
642
643 This is a CMake Environment Variable. Its initial value is taken from
644 the calling process environment.
645
646 Default compilation flags to be used when compiling HIP files. Will
647 only be used by CMake on the first configuration to determine HIP de‐
648 fault compilation flags, after which the value for HIPFLAGS is stored
649 in the cache as CMAKE_HIP_FLAGS. For any configuration run (including
650 the first), the environment variable will be ignored if the
651 CMAKE_HIP_FLAGS variable is defined.
652
653 See also CMAKE_HIP_FLAGS_INIT.
654
655 ISPC
656 New in version 3.19.
657
658
659 This is a CMake Environment Variable. Its initial value is taken from
660 the calling process environment.
661
662 Preferred executable for compiling ISPC language files. Will only be
663 used by CMake on the first configuration to determine ISPC compiler,
664 after which the value for ISPC is stored in the cache as
665 CMAKE_ISPC_COMPILER. For any configuration run (including the first),
666 the environment variable will be ignored if the CMAKE_ISPC_COMPILER
667 variable is defined.
668
669 ISPCFLAGS
670 New in version 3.19.
671
672
673 This is a CMake Environment Variable. Its initial value is taken from
674 the calling process environment.
675
676 Default compilation flags to be used when compiling ISPC files. Will
677 only be used by CMake on the first configuration to determine ISPC de‐
678 fault compilation flags, after which the value for ISPCFLAGS is stored
679 in the cache as CMAKE_ISPC_FLAGS. For any configuration run (including
680 the first), the environment variable will be ignored if the
681 CMAKE_ISPC_FLAGS variable is defined.
682
683 See also CMAKE_ISPC_FLAGS_INIT.
684
685 OBJC
686 New in version 3.16.7.
687
688
689 This is a CMake Environment Variable. Its initial value is taken from
690 the calling process environment.
691
692 Preferred executable for compiling OBJC language files. Will only be
693 used by CMake on the first configuration to determine OBJC compiler,
694 after which the value for OBJC is stored in the cache as
695 CMAKE_OBJC_COMPILER. For any configuration run (including the first),
696 the environment variable will be ignored if the CMAKE_OBJC_COMPILER
697 variable is defined.
698
699 If OBJC is not defined, the CC environment variable will be checked in‐
700 stead.
701
702 OBJCXX
703 New in version 3.16.7.
704
705
706 This is a CMake Environment Variable. Its initial value is taken from
707 the calling process environment.
708
709 Preferred executable for compiling OBJCXX language files. Will only be
710 used by CMake on the first configuration to determine OBJCXX compiler,
711 after which the value for OBJCXX is stored in the cache as CMAKE_OB‐
712 JCXX_COMPILER. For any configuration run (including the first), the en‐
713 vironment variable will be ignored if the CMAKE_OBJCXX_COMPILER vari‐
714 able is defined.
715
716 If OBJCXX is not defined, the CXX environment variable will be checked
717 instead.
718
719 RC
720 This is a CMake Environment Variable. Its initial value is taken from
721 the calling process environment.
722
723 Preferred executable for compiling resource files. Will only be used by
724 CMake on the first configuration to determine resource compiler, after
725 which the value for RC is stored in the cache as CMAKE_RC_COMPILER. For
726 any configuration run (including the first), the environment variable
727 will be ignored if the CMAKE_RC_COMPILER variable is defined.
728
729 NOTE:
730 Options that are required to make the compiler work correctly can be
731 included; they can not be changed.
732
733 $ export RC="custom-compiler --arg1 --arg2"
734
735 RCFLAGS
736 This is a CMake Environment Variable. Its initial value is taken from
737 the calling process environment.
738
739 Default compilation flags to be used when compiling resource files.
740 Will only be used by CMake on the first configuration to determine re‐
741 source default compilation flags, after which the value for RCFLAGS is
742 stored in the cache as CMAKE_RC_FLAGS. For any configuration run (in‐
743 cluding the first), the environment variable will be ignored if the
744 CMAKE_RC_FLAGS variable is defined.
745
746 See also CMAKE_RC_FLAGS_INIT.
747
748 SWIFTC
749 New in version 3.15.
750
751
752 This is a CMake Environment Variable. Its initial value is taken from
753 the calling process environment.
754
755 Preferred executable for compiling Swift language files. Will only be
756 used by CMake on the first configuration to determine Swift compiler,
757 after which the value for SWIFTC is stored in the cache as
758 CMAKE_Swift_COMPILER. For any configuration run (including the first),
759 the environment variable will be ignored if the CMAKE_Swift_COMPILER
760 variable is defined.
761
762 NOTE:
763 Options that are required to make the compiler work correctly can be
764 included; they can not be changed.
765
766 $ export SWIFTC="custom-compiler --arg1 --arg2"
767
769 CTEST_INTERACTIVE_DEBUG_MODE
770 This is a CMake Environment Variable. Its initial value is taken from
771 the calling process environment.
772
773 Environment variable that will exist and be set to 1 when a test exe‐
774 cuted by ctest(1) is run in interactive mode.
775
776 CTEST_OUTPUT_ON_FAILURE
777 This is a CMake Environment Variable. Its initial value is taken from
778 the calling process environment.
779
780 Boolean environment variable that controls if the output should be
781 logged for failed tests. Set the value to 1, True, or ON to enable out‐
782 put on failure. See ctest(1) for more information on controlling out‐
783 put of failed tests.
784
785 CTEST_PARALLEL_LEVEL
786 This is a CMake Environment Variable. Its initial value is taken from
787 the calling process environment.
788
789 Specify the number of tests for CTest to run in parallel. See ctest(1)
790 for more information on parallel test execution.
791
792 CTEST_PROGRESS_OUTPUT
793 New in version 3.13.
794
795
796 This is a CMake Environment Variable. Its initial value is taken from
797 the calling process environment.
798
799 Boolean environment variable that affects how ctest command output re‐
800 ports overall progress. When set to 1, TRUE, ON or anything else that
801 evaluates to boolean true, progress is reported by repeatedly updating
802 the same line. This greatly reduces the overall verbosity, but is only
803 supported when output is sent directly to a terminal. If the environ‐
804 ment variable is not set or has a value that evaluates to false, output
805 is reported normally with each test having its own start and end lines
806 logged to the output.
807
808 The --progress option to ctest overrides this environment variable if
809 both are given.
810
811 CTEST_USE_LAUNCHERS_DEFAULT
812 This is a CMake Environment Variable. Its initial value is taken from
813 the calling process environment.
814
815 Initializes the CTEST_USE_LAUNCHERS variable if not already defined.
816
817 DASHBOARD_TEST_FROM_CTEST
818 This is a CMake Environment Variable. Its initial value is taken from
819 the calling process environment.
820
821 Environment variable that will exist when a test executed by ctest(1)
822 is run in non-interactive mode. The value will be equal to CMAKE_VER‐
823 SION.
824
826 CCMAKE_COLORS
827 New in version 3.18.
828
829
830 Determines what colors are used by the CMake curses interface, when run
831 on a terminal that supports colors. The syntax follows the same con‐
832 ventions as LS_COLORS; that is, a list of key/value pairs separated by
833 :.
834
835 Keys are a single letter corresponding to a CMake cache variable type:
836
837 • s: A STRING.
838
839 • p: A FILEPATH.
840
841 • c: A value which has an associated list of choices.
842
843 • y: A BOOL which has a true-like value (e.g. ON, YES).
844
845 • n: A BOOL which has a false-like value (e.g. OFF, NO).
846
847 Values are an integer number that specifies what color to use. 0 is
848 black (you probably don't want to use that). Others are determined by
849 your terminal's color support. Most (color) terminals will support at
850 least 8 or 16 colors. Some will support up to 256 colors. The colors
851 will likely match this chart, although the first 16 colors may match
852 the original CGA color palette. (Many modern terminal emulators also
853 allow their color palette, at least for the first 16 colors, to be con‐
854 figured by the user.)
855
856 Note that fairly minimal checking is done for bad colors (although a
857 value higher than what curses believes your terminal supports will be
858 silently ignored) or bad syntax.
859
860 For example:
861
862 CCMAKE_COLORS='s=39:p=220:c=207:n=196:y=46'
863
865 2000-2022 Kitware, Inc. and Contributors
866
867
868
869
8703.22.2 Jan 25, 2022 CMAKE-ENV-VARIABLES(7)