1CMAKE-ENV-VARIABLES(7)               CMake              CMAKE-ENV-VARIABLES(7)
2
3
4

NAME

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

ENVIRONMENT VARIABLES THAT CHANGE BEHAVIOR

15   CMAKE_APPBUNDLE_PATH
16       This  is  a CMake Environment Variable. Its initial value is taken from
17       the calling process environment.
18
19       The CMAKE_APPBUNDLE_PATH environment variable may be set to a  list  of
20       directories  to  be  searched  for  macOS  application  bundles  by the
21       find_program() and find_package() commands.
22
23       This variable may hold a single directory or a list of directories sep‐
24       arated  by  : on UNIX or ; on Windows (the same as the PATH environment
25       variable convention on those platforms).
26
27       See also the CMAKE_APPBUNDLE_PATH CMake variable.
28
29   CMAKE_FRAMEWORK_PATH
30       This is a CMake Environment Variable. Its initial value is  taken  from
31       the calling process environment.
32
33       The  CMAKE_FRAMEWORK_PATH  environment variable may be set to a list of
34       directories to be searched for macOS frameworks by the  find_library(),
35       find_package(), find_path() and find_file() commands.
36
37       This variable may hold a single directory or a list of directories sep‐
38       arated by : on UNIX or ; on Windows (the same as the  PATH  environment
39       variable convention on those platforms).
40
41       See also the CMAKE_FRAMEWORK_PATH CMake variable.
42
43   CMAKE_INCLUDE_PATH
44       This  is  a CMake Environment Variable. Its initial value is taken from
45       the calling process environment.
46
47       The CMAKE_INCLUDE_PATH environment variable may be set to a list of di‐
48       rectories to be searched by the find_file() and find_path() commands.
49
50       This variable may hold a single directory or a list of directories sep‐
51       arated by : on UNIX or ; on Windows (the same as the  PATH  environment
52       variable convention on those platforms).
53
54       See also the CMAKE_INCLUDE_PATH CMake variable.
55
56   CMAKE_LIBRARY_PATH
57       This  is  a CMake Environment Variable. Its initial value is taken from
58       the calling process environment.
59
60       The CMAKE_LIBRARY_PATH environment variable may be set to a list of di‐
61       rectories to be searched by the find_library() command.
62
63       This variable may hold a single directory or a list of directories sep‐
64       arated by : on UNIX or ; on Windows (the same as the  PATH  environment
65       variable convention on those platforms).
66
67       See also the CMAKE_LIBRARY_PATH CMake variable.
68
69   CMAKE_MAXIMUM_RECURSION_DEPTH
70       New in version 3.27.
71
72
73       This  is  a CMake Environment Variable. Its initial value is taken from
74       the calling process environment.
75
76       Maximum recursion depth for CMake scripts.  This  environment  variable
77       is  used if the CMAKE_MAXIMUM_RECURSION_DEPTH variable is not set.  See
78       that variable's documentation for details.
79
80   CMAKE_PREFIX_PATH
81       This is a CMake Environment Variable. Its initial value is  taken  from
82       the calling process environment.
83
84       The  CMAKE_PREFIX_PATH environment variable may be set to a list of di‐
85       rectories specifying  installation  prefixes  to  be  searched  by  the
86       find_package(),   find_program(),   find_library(),   find_file(),  and
87       find_path() commands.  Each command will add appropriate subdirectories
88       (like bin, lib, or include) as specified in its own documentation.
89
90       This  variable may hold a single prefix or a list of prefixes separated
91       by : on UNIX or ; on Windows (the same as the PATH environment variable
92       convention on those platforms).
93
94       See also the CMAKE_PREFIX_PATH CMake variable.
95
96   CMAKE_PROGRAM_PATH
97       This  is  a CMake Environment Variable. Its initial value is taken from
98       the calling process environment.
99
100       The CMAKE_PROGRAM_PATH environment variable may be set to a list of di‐
101       rectories to be searched by the find_program() command.
102
103       This variable may hold a single directory or a list of directories sep‐
104       arated by : on UNIX or ; on Windows (the same as the  PATH  environment
105       variable convention on those platforms).
106
107       See also the CMAKE_PROGRAM_PATH CMake variable.
108
109   SSL_CERT_DIR
110       New in version 3.25.
111
112
113       This  is  a CMake Environment Variable. Its initial value is taken from
114       the calling process environment.
115
116       Specify default directory containing CA certificates.  It overrides the
117       default CA directory used.
118
119   SSL_CERT_FILE
120       New in version 3.25.
121
122
123       This  is  a CMake Environment Variable. Its initial value is taken from
124       the calling process environment.
125
126       Specify the file name containing CA certificates.  It overrides the de‐
127       fault, os-specific CA file used.
128

ENVIRONMENT VARIABLES THAT CONTROL THE BUILD

130   ADSP_ROOT
131       New in version 3.24.
132
133
134       This  is  a CMake Environment Variable. Its initial value is taken from
135       the calling process environment.
136
137       The ADSP_ROOT environment variable specifies a default  value  for  the
138       CMAKE_ADSP_ROOT  variable when there is no explicit configuration given
139       on the first run while creating a new build tree.
140
141   CMAKE_APPLE_SILICON_PROCESSOR
142       New in version 3.19.2.
143
144
145       This is a CMake Environment Variable. Its initial value is  taken  from
146       the calling process environment.
147
148       On  Apple Silicon hosts running macOS, set this environment variable to
149       tell CMake what architecture to  use  for  CMAKE_HOST_SYSTEM_PROCESSOR.
150       The value must be either arm64 or x86_64.
151
152       The  CMAKE_APPLE_SILICON_PROCESSOR  normal  variable, if set, overrides
153       this environment variable.
154
155   CMAKE_BUILD_PARALLEL_LEVEL
156       New in version 3.12.
157
158
159       This is a CMake Environment Variable. Its initial value is  taken  from
160       the calling process environment.
161
162       Specifies the maximum number of concurrent processes to use when build‐
163       ing using the cmake --build command line Build Tool Mode.
164
165       If this variable is defined empty the native build tool's default  num‐
166       ber is used.
167
168   CMAKE_BUILD_TYPE
169       New in version 3.22.
170
171
172       This  is  a CMake Environment Variable. Its initial value is taken from
173       the calling process environment.
174
175       The CMAKE_BUILD_TYPE environment variable specifies a default value for
176       the  CMAKE_BUILD_TYPE  variable when there is no explicit configuration
177       given on the first run while creating a new build tree.
178
179   CMAKE_COLOR_DIAGNOSTICS
180       New in version 3.24.
181
182
183       This is a CMake Environment Variable. Its initial value is  taken  from
184       the calling process environment.
185
186       Specifies a default value for the CMAKE_COLOR_DIAGNOSTICS variable when
187       there is no explicit value given on the first run.
188
189   CMAKE_CONFIGURATION_TYPES
190       New in version 3.22.
191
192
193       This is a CMake Environment Variable. Its initial value is  taken  from
194       the calling process environment.
195
196       The  CMAKE_CONFIGURATION_TYPES environment variable specifies a default
197       value for the CMAKE_CONFIGURATION_TYPES variable when there is  no  ex‐
198       plicit  configuration given on the first run while creating a new build
199       tree.
200
201   CMAKE_CONFIG_TYPE
202       This is a CMake Environment Variable. Its initial value is  taken  from
203       the calling process environment.
204
205       The  default  build  configuration  for Build a Project and ctest build
206       handler when there is no explicit configuration given.
207
208   CMAKE_EXPORT_COMPILE_COMMANDS
209       New in version 3.17.
210
211
212       This is a CMake Environment Variable. Its initial value is  taken  from
213       the calling process environment.
214
215       The  default  value  for CMAKE_EXPORT_COMPILE_COMMANDS when there is no
216       explicit configuration given on the first  run  while  creating  a  new
217       build tree.  On later runs in an existing build tree the value persists
218       in the cache as CMAKE_EXPORT_COMPILE_COMMANDS.
219
220   CMAKE_GENERATOR
221       New in version 3.15.
222
223
224       This is a CMake Environment Variable. Its initial value is  taken  from
225       the calling process environment.
226
227       Specifies  the CMake default generator to use when no generator is sup‐
228       plied with -G. If the provided value doesn't name a generator known  by
229       CMake,  the internal default is used.  Either way the resulting genera‐
230       tor selection is stored in the CMAKE_GENERATOR variable.
231
232       Some generators may be additionally configured  using  the  environment
233       variables:
234
235CMAKE_GENERATOR_PLATFORM
236
237CMAKE_GENERATOR_TOOLSET
238
239CMAKE_GENERATOR_INSTANCE
240
241   CMAKE_GENERATOR_INSTANCE
242       New in version 3.15.
243
244
245       This  is  a CMake Environment Variable. Its initial value is taken from
246       the calling process environment.
247
248       Default  value  for  CMAKE_GENERATOR_INSTANCE  if  no  Cache  entry  is
249       present. This value is only applied if CMAKE_GENERATOR is set.
250
251   CMAKE_GENERATOR_PLATFORM
252       New in version 3.15.
253
254
255       This  is  a CMake Environment Variable. Its initial value is taken from
256       the calling process environment.
257
258       Default value for CMAKE_GENERATOR_PLATFORM if no Cache entry is present
259       and  no  value is specified by cmake -A option.  This value is only ap‐
260       plied if CMAKE_GENERATOR is set.
261
262   CMAKE_GENERATOR_TOOLSET
263       New in version 3.15.
264
265
266       This is a CMake Environment Variable. Its initial value is  taken  from
267       the calling process environment.
268
269       Default  value for CMAKE_GENERATOR_TOOLSET if no Cache entry is present
270       and no value is specified by cmake -T option.  This value is  only  ap‐
271       plied if CMAKE_GENERATOR is set.
272
273   CMAKE_INSTALL_MODE
274       New in version 3.22.
275
276
277       This  is  a CMake Environment Variable. Its initial value is taken from
278       the calling process environment.
279
280       The CMAKE_INSTALL_MODE environment variable  allows  users  to  operate
281       CMake in an alternate mode of file(INSTALL) and install().
282
283       The  default behavior for an installation is to copy a source file from
284       a source directory into a destination directory. This environment vari‐
285       able  however  allows the user to override this behavior, causing CMake
286       to create symbolic links instead.
287
288   Usage Scenarios
289       Installing symbolic links rather than copying files  can  help  in  the
290       following ways:
291
292       • Conserving  storage  space because files do not have to be duplicated
293         on disk.
294
295       • Changes to the source of the symbolic link are seen  at  the  install
296         destination without having to re-run the install step.
297
298       • Editing  through  the link at the install destination will modify the
299         source of the link. This  may  be  useful  when  dealing  with  CMake
300         project hierarchies, i.e. using ExternalProject and consistent source
301         navigation and refactoring is desired across projects.
302
303   Allowed Values
304       The following values are allowed for CMAKE_INSTALL_MODE:
305
306       COPY, empty or unset
307              Duplicate the file at its destination.  This is the default  be‐
308              havior.
309
310       ABS_SYMLINK
311              Create  an absolute symbolic link to the source file at the des‐
312              tination.  Halt with an error if the link cannot be created.
313
314       ABS_SYMLINK_OR_COPY
315              Like ABS_SYMLINK but fall back to silently copying if  the  sym‐
316              link couldn't be created.
317
318       REL_SYMLINK
319              Create a relative symbolic link to the source file at the desti‐
320              nation.  Halt with an error if the link cannot be created.
321
322       REL_SYMLINK_OR_COPY
323              Like REL_SYMLINK but fall back to silently copying if  the  sym‐
324              link couldn't be created.
325
326       SYMLINK
327              Try  as  if  through REL_SYMLINK and fall back to ABS_SYMLINK if
328              the referenced file cannot be expressed using a  relative  path.
329              Halt with an error if the link cannot be created.
330
331       SYMLINK_OR_COPY
332              Like  SYMLINK  but  fall back to silently copying if the symlink
333              couldn't be created.
334
335       NOTE:
336          A symbolic link consists of a reference file path rather  than  con‐
337          tents  of its own, hence there are two ways to express the relation,
338          either by a relative or an absolute path.
339
340   When To Set The Environment Variable
341       For the environment variable to take effect, it must be set during  the
342       correct build phase(s).
343
344       • If the project calls file(INSTALL) directly, the environment variable
345         must be set during the configuration phase.
346
347       • In order to apply to install(), the environment variable must be  set
348         during  installation.   This could be during a build if using the in‐
349         stall or package build targets, or separate from the build  when  in‐
350         voking an install or running cpack from the command line.
351
352       • When  using  ExternalProject,  it  might be required during the build
353         phase, since the external project's own configure, build and  install
354         steps will execute during the main project's build phase.
355
356       Given the above, it is recommended to set the environment variable con‐
357       sistently across all phases (configure, build and install).
358
359   Caveats
360       Use this environment variable with caution.  The  following  highlights
361       some points to be considered:
362
363CMAKE_INSTALL_MODE only affects files, not directories.
364
365       • Symbolic links are not available on all platforms.
366
367       • The  way this environment variable interacts with the install step of
368         ExternalProject is more complex. For further details, see  that  mod‐
369         ule's documentation.
370
371       • A  symbolic  link  ties the destination to the source in a persistent
372         way.  Writing to either of the two affects both file system  objects.
373         This  is  in  contrast  to  normal install behavior which only copies
374         files as they were at the time the install was performed, with no en‐
375         during  relationship  between  the  source and destination of the in‐
376         stall.
377
378       • Combining CMAKE_INSTALL_MODE with IOS_INSTALL_COMBINED  is  not  sup‐
379         ported.
380
381       • Changing  CMAKE_INSTALL_MODE  from  what it was on a previous run can
382         lead to unexpected results.  Moving from a non-symlinking mode  to  a
383         symlinking  mode  will  discard any previous file at the destination,
384         but the reverse is not true.  Once a symlink exists at  the  destina‐
385         tion, even if you switch to a non-symlink mode, the symlink will con‐
386         tinue to exist at the destination and will not be replaced by an  ac‐
387         tual file.
388
389   CMAKE_<LANG>_COMPILER_LAUNCHER
390       New in version 3.17.
391
392
393       This  is  a CMake Environment Variable. Its initial value is taken from
394       the calling process environment.
395
396       Default compiler launcher to use for the specified language. Will  only
397       be used by CMake to initialize the variable on the first configuration.
398       Afterwards, it is available through the cache setting of  the  variable
399       of  the same name. For any configuration run (including the first), the
400       environment     variable     will      be      ignored      if      the
401       CMAKE_<LANG>_COMPILER_LAUNCHER variable is defined.
402
403   CMAKE_<LANG>_IMPLICIT_LINK_DIRECTORIES_EXCLUDE
404       New in version 3.27.
405
406
407       This  is  a CMake Environment Variable. Its initial value is taken from
408       the calling process environment.
409
410       A  semicolon-separated  list  of  directories  to  exclude   from   the
411       CMAKE_<LANG>_IMPLICIT_LINK_DIRECTORIES  variable  when  it is automati‐
412       cally detected from the <LANG> compiler.
413
414       This may be used to work around  misconfigured  compiler  drivers  that
415       pass extraneous implicit link directories to their linker.
416
417   CMAKE_<LANG>_LINKER_LAUNCHER
418       New in version 3.21.
419
420
421       This  is  a CMake Environment Variable. Its initial value is taken from
422       the calling process environment.
423
424       Default launcher to use when linking a target  of  the  specified  lan‐
425       guage.  Will  only  be  used by CMake to initialize the variable on the
426       first configuration.  Afterwards, it is  available  through  the  cache
427       setting  of  the  variable  of the same name. For any configuration run
428       (including the first), the environment variable will be ignored if  the
429       CMAKE_<LANG>_LINKER_LAUNCHER variable is defined.
430
431   CMAKE_MSVCIDE_RUN_PATH
432       This  is  a CMake Environment Variable. Its initial value is taken from
433       the calling process environment.
434
435       Extra PATH locations for custom commands when  using  Visual  Studio  9
436       2008 (or above) generators.
437
438       The  CMAKE_MSVCIDE_RUN_PATH environment variable sets the default value
439       for the CMAKE_MSVCIDE_RUN_PATH variable if not already explicitly set.
440
441   CMAKE_NO_VERBOSE
442       New in version 3.14.
443
444
445       Disables verbose output from CMake when VERBOSE environment variable is
446       set.
447
448       Only your build tool of choice will still print verbose output when you
449       start to actually build your project.
450
451   CMAKE_OSX_ARCHITECTURES
452       This is a CMake Environment Variable. Its initial value is  taken  from
453       the calling process environment.
454
455       Target specific architectures for macOS.
456
457       The CMAKE_OSX_ARCHITECTURES environment variable sets the default value
458       for the CMAKE_OSX_ARCHITECTURES  variable.  See  OSX_ARCHITECTURES  for
459       more information.
460
461   CMAKE_TOOLCHAIN_FILE
462       New in version 3.21.
463
464
465       This  is  a CMake Environment Variable. Its initial value is taken from
466       the calling process environment.
467
468       The CMAKE_TOOLCHAIN_FILE environment variable specifies a default value
469       for the CMAKE_TOOLCHAIN_FILE variable when there is no explicit config‐
470       uration given on the first run while creating a  new  build  tree.   On
471       later runs in an existing build tree the value persists in the cache as
472       CMAKE_TOOLCHAIN_FILE.
473
474   DESTDIR
475       This is a CMake Environment Variable. Its initial value is  taken  from
476       the calling process environment.
477
478       On  UNIX  one  can  use  the DESTDIR mechanism in order to relocate the
479       whole installation.  DESTDIR means DESTination DIRectory.  It  is  com‐
480       monly used by packagers to install software in a staging directory.
481
482       For example, running
483
484          make DESTDIR=/package/stage install
485
486       will  install the software using the installation prefix, e.g. /usr/lo‐
487       cal,  prepended   with   the   DESTDIR   value   which   gives   /pack‐
488       age/stage/usr/local.  The packaging tool may then construct the package
489       from the content of the /package/stage directory.
490
491       See the CMAKE_INSTALL_PREFIX variable to control the installation  pre‐
492       fix  when  configuring  a build tree.  Or, when using the cmake(1) com‐
493       mand-line tool's --install mode, one may specify a different prefix us‐
494       ing the --prefix option.
495
496       NOTE:
497          DESTDIR  may not be used on Windows because installation prefix usu‐
498          ally contains a drive letter like in C:/Program Files  which  cannot
499          be prepended with some other prefix.
500
501   LDFLAGS
502       This  is  a CMake Environment Variable. Its initial value is taken from
503       the calling process environment.
504
505       Will only be used by CMake on the first configuration to determine  the
506       default  linker  flags,  after which the value for LDFLAGS is stored in
507       the           cache           as           CMAKE_EXE_LINKER_FLAGS_INIT,
508       CMAKE_SHARED_LINKER_FLAGS_INIT, and CMAKE_MODULE_LINKER_FLAGS_INIT. For
509       any configuration run (including the first), the  environment  variable
510       will be ignored if the equivalent  CMAKE_<TYPE>_LINKER_FLAGS_INIT vari‐
511       able is defined.
512
513   MACOSX_DEPLOYMENT_TARGET
514       This is a CMake Environment Variable. Its initial value is  taken  from
515       the calling process environment.
516
517       Specify  the  minimum version of macOS on which the target binaries are
518       to be deployed.
519
520       The MACOSX_DEPLOYMENT_TARGET  environment  variable  sets  the  default
521       value for the CMAKE_OSX_DEPLOYMENT_TARGET variable.
522
523   <PackageName>_ROOT
524       New in version 3.12.
525
526
527       This  is  a CMake Environment Variable. Its initial value is taken from
528       the calling process environment.
529
530       Calls to find_package(<PackageName>) will search in prefixes  specified
531       by  the <PackageName>_ROOT environment variable, where <PackageName> is
532       the (case-preserved) name given to the find_package() call and _ROOT is
533       literal.  For example, find_package(Foo) will search prefixes specified
534       in the Foo_ROOT environment variable (if set).  See policy CMP0074.
535
536       This variable may hold a single prefix or a list of prefixes  separated
537       by : on UNIX or ; on Windows (the same as the PATH environment variable
538       convention on those platforms).
539
540       See also the <PackageName>_ROOT CMake variable.
541
542       <PACKAGENAME>_ROOT
543              New in version 3.27.
544
545
546              Calls to find_package(<PackageName>) will also  search  in  pre‐
547              fixes specified by the upper-case <PACKAGENAME>_ROOT environment
548              variable.  See policy CMP0144.
549
550       NOTE:
551          Note that the <PackageName>_ROOT and <PACKAGENAME>_ROOT  environment
552          variables  are  distinct  only on platforms that have case-sensitive
553          environments.
554
555   VERBOSE
556       New in version 3.14.
557
558
559       Activates verbose output from CMake and your build tools of choice when
560       you start to actually build your project.
561
562       Note that any given value is ignored. It's just checked for existence.
563
564       See also Build Tool Mode and CMAKE_NO_VERBOSE environment variable
565

ENVIRONMENT VARIABLES FOR LANGUAGES

567   ASM<DIALECT>
568       This  is  a CMake Environment Variable. Its initial value is taken from
569       the calling process environment.
570
571       Preferred executable for compiling a specific dialect of assembly  lan‐
572       guage files. ASM<DIALECT> can be one of:
573
574ASM
575
576ASM_NASM (Netwide Assembler)
577
578ASM_MASM (Microsoft Assembler)
579
580ASM_MARMASM (Microsoft ARM Assembler)
581
582ASM-ATT (Assembler AT&T)
583
584       Will  only  be  used  by  CMake on the first configuration to determine
585       ASM<DIALECT> compiler, after which the value for ASM<DIALECT> is stored
586       in  the cache as CMAKE_ASM<DIALECT>_COMPILER. For subsequent configura‐
587       tion runs, the  environment  variable  will  be  ignored  in  favor  of
588       CMAKE_ASM<DIALECT>_COMPILER.
589
590       NOTE:
591          Options that are required to make the compiler work correctly can be
592          included; they can not be changed.
593
594          $ export ASM="custom-compiler --arg1 --arg2"
595
596   ASM<DIALECT>FLAGS
597       This is a CMake Environment Variable. Its initial value is  taken  from
598       the calling process environment.
599
600       Add  default compilation flags to be used when compiling a specific di‐
601       alect of an assembly language.  ASM<DIALECT>FLAGS can be one of:
602
603ASMFLAGS
604
605ASM_NASMFLAGS
606
607ASM_MASMFLAGS
608
609ASM_MARMASMFLAGS
610
611ASM-ATTFLAGS
612
613       CMake uses this environment variable value, in combination with its own
614       builtin  default  flags  for the toolchain, to initialize and store the
615       CMAKE_ASM<DIALECT>_FLAGS cache entry.  This occurs  the  first  time  a
616       build tree is configured for language ASM<DIALECT>.  For any configura‐
617       tion run (including the first), the environment variable  will  be  ig‐
618       nored if the CMAKE_ASM<DIALECT>_FLAGS variable is already defined.
619
620       See also CMAKE_ASM<DIALECT>_FLAGS_INIT.
621
622   CC
623       This  is  a CMake Environment Variable. Its initial value is taken from
624       the calling process environment.
625
626       Preferred executable for compiling C language files. Will only be  used
627       by  CMake  on  the  first  configuration to determine C compiler, after
628       which the value for CC is stored in the cache as CMAKE_C_COMPILER.  For
629       any  configuration  run (including the first), the environment variable
630       will be ignored if the CMAKE_C_COMPILER variable is defined.
631
632       NOTE:
633          Options that are required to make the compiler work correctly can be
634          included; they can not be changed.
635
636          $ export CC="custom-compiler --arg1 --arg2"
637
638   CFLAGS
639       This  is  a CMake Environment Variable. Its initial value is taken from
640       the calling process environment.
641
642       Add default compilation flags to be used when compiling C files.
643
644       CMake uses this environment variable value, in combination with its own
645       builtin  default  flags  for the toolchain, to initialize and store the
646       CMAKE_C_FLAGS cache entry.  This occurs the first time a build tree  is
647       configured  for  language  C.  For any configuration run (including the
648       first), the environment variable will be ignored if  the  CMAKE_C_FLAGS
649       variable is already defined.
650
651       See also CMAKE_C_FLAGS_INIT.
652
653   CSFLAGS
654       New in version 3.9.2.
655
656
657       This  is  a CMake Environment Variable. Its initial value is taken from
658       the calling process environment.
659
660       Add default compilation flags to be used when compiling CSharp files.
661
662       CMake uses this environment variable value, in combination with its own
663       builtin  default  flags  for the toolchain, to initialize and store the
664       CMAKE_CSharp_FLAGS cache entry.  This occurs the  first  time  a  build
665       tree is configured for language CSharp.  For any configuration run (in‐
666       cluding the first), the environment variable will  be  ignored  if  the
667       CMAKE_CSharp_FLAGS variable is already defined.
668
669       See also CMAKE_CSharp_FLAGS_INIT.
670
671   CUDAARCHS
672       New in version 3.20.
673
674
675       This  is  a CMake Environment Variable. Its initial value is taken from
676       the calling process environment.
677
678       Value used to initialize CMAKE_CUDA_ARCHITECTURES on the first configu‐
679       ration. Subsequent runs will use the value stored in the cache.
680
681       This  is  a  semicolon-separated  list of architectures as described in
682       CUDA_ARCHITECTURES.
683
684   CUDACXX
685       New in version 3.8.
686
687
688       This is a CMake Environment Variable. Its initial value is  taken  from
689       the calling process environment.
690
691       Preferred  executable  for  compiling CUDA language files. Will only be
692       used by CMake on the first configuration to  determine  CUDA  compiler,
693       after   which   the   value   for  CUDA  is  stored  in  the  cache  as
694       CMAKE_CUDA_COMPILER. For any configuration run (including  the  first),
695       the  environment  variable  will  be ignored if the CMAKE_CUDA_COMPILER
696       variable is defined.
697
698       NOTE:
699          Options that are required to make the compiler work correctly can be
700          included; they can not be changed.
701
702          $ export CUDACXX="custom-compiler --arg1 --arg2"
703
704   CUDAFLAGS
705       New in version 3.8.
706
707
708       This  is  a CMake Environment Variable. Its initial value is taken from
709       the calling process environment.
710
711       Add default compilation flags to be used when compiling CUDA files.
712
713       CMake uses this environment variable value, in combination with its own
714       builtin  default  flags  for the toolchain, to initialize and store the
715       CMAKE_CUDA_FLAGS cache entry.  This occurs the first time a build  tree
716       is  configured for language CUDA.  For any configuration run (including
717       the  first),  the  environment  variable  will  be   ignored   if   the
718       CMAKE_CUDA_FLAGS variable is already defined.
719
720       See also CMAKE_CUDA_FLAGS_INIT.
721
722   CUDAHOSTCXX
723       New in version 3.8.
724
725
726       This  is  a CMake Environment Variable. Its initial value is taken from
727       the calling process environment.
728
729       Preferred executable for compiling host code when compiling  CUDA  lan‐
730       guage  files.  Will only be used by CMake on the first configuration to
731       determine CUDA host compiler, after which the value for CUDAHOSTCXX  is
732       stored in the cache as CMAKE_CUDA_HOST_COMPILER. This environment vari‐
733       able is preferred over CMAKE_CUDA_HOST_COMPILER.
734
735       This environment variable is primarily meant for use with projects that
736       enable CUDA as a first-class language.
737
738       NOTE:
739          Ignored when using Visual Studio Generators.
740
741       New in version 3.13: The FindCUDA module will use this variable to ini‐
742       tialize its CUDA_HOST_COMPILER setting.
743
744
745   CXX
746       This is a CMake Environment Variable. Its initial value is  taken  from
747       the calling process environment.
748
749       Preferred  executable  for  compiling  CXX language files. Will only be
750       used by CMake on the first configuration to determine CXX compiler, af‐
751       ter   which   the   value   for   CXX   is   stored  in  the  cache  as
752       CMAKE_CXX_COMPILER. For any configuration run  (including  the  first),
753       the  environment  variable  will  be  ignored if the CMAKE_CXX_COMPILER
754       variable is defined.
755
756       NOTE:
757          Options that are required to make the compiler work correctly can be
758          included; they can not be changed.
759
760          $ export CXX="custom-compiler --arg1 --arg2"
761
762   CXXFLAGS
763       This  is  a CMake Environment Variable. Its initial value is taken from
764       the calling process environment.
765
766       Add default compilation flags to  be  used  when  compiling  CXX  (C++)
767       files.
768
769       CMake uses this environment variable value, in combination with its own
770       builtin default flags for the toolchain, to initialize  and  store  the
771       CMAKE_CXX_FLAGS  cache  entry.  This occurs the first time a build tree
772       is configured for language CXX.  For any configuration  run  (including
773       the   first),   the   environment  variable  will  be  ignored  if  the
774       CMAKE_CXX_FLAGS variable is already defined.
775
776       See also CMAKE_CXX_FLAGS_INIT.
777
778   FC
779       This is a CMake Environment Variable. Its initial value is  taken  from
780       the calling process environment.
781
782       Preferred executable for compiling Fortran language files. Will only be
783       used by CMake on the first configuration to determine Fortran compiler,
784       after   which  the  value  for  Fortran  is  stored  in  the  cache  as
785       CMAKE_Fortran_COMPILER.  For  any  configuration  run  (including   the
786       first),   the   environment   variable   will   be   ignored   if   the
787       CMAKE_Fortran_COMPILER variable is defined.
788
789       NOTE:
790          Options that are required to make the compiler work correctly can be
791          included; they can not be changed.
792
793          $ export FC="custom-compiler --arg1 --arg2"
794
795   FFLAGS
796       This  is  a CMake Environment Variable. Its initial value is taken from
797       the calling process environment.
798
799       Add default compilation flags to be used when compiling Fortran files.
800
801       CMake uses this environment variable value, in combination with its own
802       builtin  default  flags  for the toolchain, to initialize and store the
803       CMAKE_Fortran_FLAGS cache entry.  This occurs the first  time  a  build
804       tree  is  configured  for  language Fortran.  For any configuration run
805       (including the first), the environment variable will be ignored if  the
806       CMAKE_Fortran_FLAGS variable is already defined.
807
808       See also CMAKE_Fortran_FLAGS_INIT.
809
810   HIPCXX
811       New in version 3.21.
812
813
814       This  is  a CMake Environment Variable. Its initial value is taken from
815       the calling process environment.
816
817       Preferred executable for compiling HIP language  files.  Will  only  be
818       used by CMake on the first configuration to determine HIP compiler, af‐
819       ter  which  the  value  for   HIP   is   stored   in   the   cache   as
820       CMAKE_HIP_COMPILER.  For  any  configuration run (including the first),
821       the environment variable will  be  ignored  if  the  CMAKE_HIP_COMPILER
822       variable is defined.
823
824   HIPFLAGS
825       New in version 3.21.
826
827
828       This  is  a CMake Environment Variable. Its initial value is taken from
829       the calling process environment.
830
831       Add default compilation flags to be used when compiling HIP files.
832
833       CMake uses this environment variable value, in combination with its own
834       builtin  default  flags  for the toolchain, to initialize and store the
835       CMAKE_HIP_FLAGS cache entry.  This occurs the first time a  build  tree
836       is  configured  for language HIP.  For any configuration run (including
837       the  first),  the  environment  variable  will  be   ignored   if   the
838       CMAKE_HIP_FLAGS variable is already defined.
839
840       See also CMAKE_HIP_FLAGS_INIT.
841
842   ISPC
843       New in version 3.19.
844
845
846       This  is  a CMake Environment Variable. Its initial value is taken from
847       the calling process environment.
848
849       Preferred executable for compiling ISPC language files.  Will  only  be
850       used  by  CMake  on the first configuration to determine ISPC compiler,
851       after  which  the  value  for  ISPC  is  stored   in   the   cache   as
852       CMAKE_ISPC_COMPILER.  For  any configuration run (including the first),
853       the environment variable will be  ignored  if  the  CMAKE_ISPC_COMPILER
854       variable is defined.
855
856   ISPCFLAGS
857       New in version 3.19.
858
859
860       This  is  a CMake Environment Variable. Its initial value is taken from
861       the calling process environment.
862
863       Add default compilation flags to be used when compiling ISPC files.
864
865       CMake uses this environment variable value, in combination with its own
866       builtin  default  flags  for the toolchain, to initialize and store the
867       CMAKE_ISPC_FLAGS cache entry.  This occurs the first time a build  tree
868       is  configured for language ISPC.  For any configuration run (including
869       the  first),  the  environment  variable  will  be   ignored   if   the
870       CMAKE_ISPC_FLAGS variable is already defined.
871
872       See also CMAKE_ISPC_FLAGS_INIT.
873
874   OBJC
875       New in version 3.16.7.
876
877
878       This  is  a CMake Environment Variable. Its initial value is taken from
879       the calling process environment.
880
881       Preferred executable for compiling OBJC language files.  Will  only  be
882       used  by  CMake  on the first configuration to determine OBJC compiler,
883       after  which  the  value  for  OBJC  is  stored   in   the   cache   as
884       CMAKE_OBJC_COMPILER.  For  any configuration run (including the first),
885       the environment variable will be  ignored  if  the  CMAKE_OBJC_COMPILER
886       variable is defined.
887
888       If OBJC is not defined, the CC environment variable will be checked in‐
889       stead.
890
891   OBJCXX
892       New in version 3.16.7.
893
894
895       This is a CMake Environment Variable. Its initial value is  taken  from
896       the calling process environment.
897
898       Preferred  executable for compiling OBJCXX language files. Will only be
899       used by CMake on the first configuration to determine OBJCXX  compiler,
900       after   which   the  value  for  OBJCXX  is  stored  in  the  cache  as
901       CMAKE_OBJCXX_COMPILER. For any configuration run (including the first),
902       the  environment  variable will be ignored if the CMAKE_OBJCXX_COMPILER
903       variable is defined.
904
905       If OBJCXX is not defined, the CXX environment variable will be  checked
906       instead.
907
908   RC
909       This  is  a CMake Environment Variable. Its initial value is taken from
910       the calling process environment.
911
912       Preferred executable for compiling resource files. Will only be used by
913       CMake  on the first configuration to determine resource compiler, after
914       which the value for RC is stored in the cache as CMAKE_RC_COMPILER. For
915       any  configuration  run (including the first), the environment variable
916       will be ignored if the CMAKE_RC_COMPILER variable is defined.
917
918       NOTE:
919          Options that are required to make the compiler work correctly can be
920          included; they can not be changed.
921
922          $ export RC="custom-compiler --arg1 --arg2"
923
924   RCFLAGS
925       This  is  a CMake Environment Variable. Its initial value is taken from
926       the calling process environment.
927
928       Add default compilation flags to be used when compiling  RC  (resource)
929       files.
930
931       CMake uses this environment variable value, in combination with its own
932       builtin default flags for the toolchain, to initialize  and  store  the
933       CMAKE_RC_FLAGS cache entry.  This occurs the first time a build tree is
934       configured for language RC.  For any configuration run  (including  the
935       first),  the environment variable will be ignored if the CMAKE_RC_FLAGS
936       variable is already defined.
937
938       See also CMAKE_RC_FLAGS_INIT.
939
940   SWIFTC
941       New in version 3.15.
942
943
944       This is a CMake Environment Variable. Its initial value is  taken  from
945       the calling process environment.
946
947       Preferred  executable  for compiling Swift language files. Will only be
948       used by CMake on the first configuration to determine  Swift  compiler,
949       after   which   the  value  for  SWIFTC  is  stored  in  the  cache  as
950       CMAKE_Swift_COMPILER. For any configuration run (including the  first),
951       the  environment  variable  will be ignored if the CMAKE_Swift_COMPILER
952       variable is defined.
953
954       NOTE:
955          Options that are required to make the compiler work correctly can be
956          included; they can not be changed.
957
958          $ export SWIFTC="custom-compiler --arg1 --arg2"
959

ENVIRONMENT VARIABLES FOR CTEST

961   CTEST_INTERACTIVE_DEBUG_MODE
962       This  is  a CMake Environment Variable. Its initial value is taken from
963       the calling process environment.
964
965       Environment variable that will exist and be set to 1 when a  test  exe‐
966       cuted by ctest(1) is run in interactive mode.
967
968   CTEST_NO_TESTS_ACTION
969       New in version 3.26.
970
971
972       This  is  a CMake Environment Variable. Its initial value is taken from
973       the calling process environment.
974
975       Environment variable that controls how ctest handles cases  when  there
976       are  no  tests to run. Possible values are: error, ignore, empty or un‐
977       set.
978
979       The --no-tests=<action> option  to  ctest  overrides  this  environment
980       variable if both are given.
981
982   CTEST_OUTPUT_ON_FAILURE
983       This  is  a CMake Environment Variable. Its initial value is taken from
984       the calling process environment.
985
986       Boolean environment variable that controls  if  the  output  should  be
987       logged for failed tests. Set the value to 1, True, or ON to enable out‐
988       put on failure.  See ctest(1) for more information on controlling  out‐
989       put of failed tests.
990
991   CTEST_PARALLEL_LEVEL
992       This  is  a CMake Environment Variable. Its initial value is taken from
993       the calling process environment.
994
995       Specify the number of tests for CTest to run in parallel. See  ctest(1)
996       for more information on parallel test execution.
997
998   CTEST_PROGRESS_OUTPUT
999       New in version 3.13.
1000
1001
1002       This  is  a CMake Environment Variable. Its initial value is taken from
1003       the calling process environment.
1004
1005       Boolean environment variable that affects how ctest command output  re‐
1006       ports  overall progress.  When set to 1, TRUE, ON or anything else that
1007       evaluates to boolean true, progress is reported by repeatedly  updating
1008       the same line.  This greatly reduces the overall verbosity, but is only
1009       supported when output is sent directly to a terminal.  If the  environ‐
1010       ment variable is not set or has a value that evaluates to false, output
1011       is reported normally with each test having its own start and end  lines
1012       logged to the output.
1013
1014       The  --progress  option to ctest overrides this environment variable if
1015       both are given.
1016
1017   CTEST_USE_LAUNCHERS_DEFAULT
1018       This is a CMake Environment Variable. Its initial value is  taken  from
1019       the calling process environment.
1020
1021       Initializes the CTEST_USE_LAUNCHERS variable if not already defined.
1022
1023   DASHBOARD_TEST_FROM_CTEST
1024       This  is  a CMake Environment Variable. Its initial value is taken from
1025       the calling process environment.
1026
1027       Environment variable that will exist when a test executed  by  ctest(1)
1028       is   run   in  non-interactive  mode.   The  value  will  be  equal  to
1029       CMAKE_VERSION.
1030

ENVIRONMENT VARIABLES FOR THE CMAKE CURSES INTERFACE

1032   CCMAKE_COLORS
1033       New in version 3.18.
1034
1035
1036       Determines what colors are used by the CMake curses interface, when run
1037       on  a  terminal that supports colors.  The syntax follows the same con‐
1038       ventions as LS_COLORS; that is, a list of key/value pairs separated  by
1039       :.
1040
1041       Keys are a single letter corresponding to a CMake cache variable type:
1042
1043s: A STRING.
1044
1045p: A FILEPATH.
1046
1047c: A value which has an associated list of choices.
1048
1049y: A BOOL which has a true-like value (e.g. ON, YES).
1050
1051n: A BOOL which has a false-like value (e.g. OFF, NO).
1052
1053       Values  are  an  integer number that specifies what color to use.  0 is
1054       black (you probably don't want to use that).  Others are determined  by
1055       your  terminal's color support.  Most (color) terminals will support at
1056       least 8 or 16 colors.  Some will support up to 256 colors.  The  colors
1057       will  likely  match  this chart, although the first 16 colors may match
1058       the original CGA color palette.  (Many modern terminal  emulators  also
1059       allow their color palette, at least for the first 16 colors, to be con‐
1060       figured by the user.)
1061
1062       Note that fairly minimal checking is done for bad  colors  (although  a
1063       value  higher  than what curses believes your terminal supports will be
1064       silently ignored) or bad syntax.
1065
1066       For example:
1067
1068          CCMAKE_COLORS='s=39:p=220:c=207:n=196:y=46'
1069
1071       2000-2023 Kitware, Inc. and Contributors
1072
1073
1074
1075
10763.27.7                           Oct 07, 2023           CMAKE-ENV-VARIABLES(7)
Impressum