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_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
31   SSL_CERT_DIR
32       New in version 3.25.
33
34
35       This is a CMake Environment Variable. Its initial value is  taken  from
36       the calling process environment.
37
38       Specify default directory containing CA certificates.  It overrides the
39       default CA directory used.
40
41   SSL_CERT_FILE
42       New in version 3.25.
43
44
45       This is a CMake Environment Variable. Its initial value is  taken  from
46       the calling process environment.
47
48       Specify the file name containing CA certificates.  It overrides the de‐
49       fault, os-specific CA file used.
50

ENVIRONMENT VARIABLES THAT CONTROL THE BUILD

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

ENVIRONMENT VARIABLES FOR LANGUAGES

462   ASM<DIALECT>
463       This is a CMake Environment Variable. Its initial value is  taken  from
464       the calling process environment.
465
466       Preferred  executable for compiling a specific dialect of assembly lan‐
467       guage files. ASM<DIALECT> can be  ASM,  ASM_NASM  (Netwide  Assembler),
468       ASM_MASM  (Microsoft Assembler) or ASM-ATT (Assembler AT&T).  Will only
469       be used by CMake on the first configuration to  determine  ASM<DIALECT>
470       compiler, after which the value for ASM<DIALECT> is stored in the cache
471       as CMAKE_ASM<DIALECT>_COMPILER. For subsequent configuration runs,  the
472       environment     variable     will    be    ignored    in    favor    of
473       CMAKE_ASM<DIALECT>_COMPILER.
474
475       NOTE:
476          Options that are required to make the compiler work correctly can be
477          included; they can not be changed.
478
479          $ export ASM="custom-compiler --arg1 --arg2"
480
481   ASM<DIALECT>FLAGS
482       This  is  a CMake Environment Variable. Its initial value is taken from
483       the calling process environment.
484
485       Add default compilation flags to be used when compiling a specific  di‐
486       alect of an assembly language.  ASM<DIALECT>FLAGS can be one of:
487
488ASMFLAGS
489
490ASM_NASMFLAGS
491
492ASM_MASMFLAGS
493
494ASM-ATTFLAGS
495
496       CMake uses this environment variable value, in combination with its own
497       builtin default flags for the toolchain, to initialize  and  store  the
498       CMAKE_ASM<DIALECT>_FLAGS  cache  entry.   This  occurs the first time a
499       build tree is configured for language ASM<DIALECT>.  For any configura‐
500       tion  run  (including  the first), the environment variable will be ig‐
501       nored if the CMAKE_ASM<DIALECT>_FLAGS variable is already defined.
502
503       See also CMAKE_ASM<DIALECT>_FLAGS_INIT.
504
505   CC
506       This is a CMake Environment Variable. Its initial value is  taken  from
507       the calling process environment.
508
509       Preferred  executable for compiling C language files. Will only be used
510       by CMake on the first configuration  to  determine  C  compiler,  after
511       which  the value for CC is stored in the cache as CMAKE_C_COMPILER. For
512       any configuration run (including the first), the  environment  variable
513       will be ignored if the CMAKE_C_COMPILER variable is defined.
514
515       NOTE:
516          Options that are required to make the compiler work correctly can be
517          included; they can not be changed.
518
519          $ export CC="custom-compiler --arg1 --arg2"
520
521   CFLAGS
522       This is a CMake Environment Variable. Its initial value is  taken  from
523       the calling process environment.
524
525       Add default compilation flags to be used when compiling C files.
526
527       CMake uses this environment variable value, in combination with its own
528       builtin default flags for the toolchain, to initialize  and  store  the
529       CMAKE_C_FLAGS  cache entry.  This occurs the first time a build tree is
530       configured for language C.  For any configuration  run  (including  the
531       first),  the  environment variable will be ignored if the CMAKE_C_FLAGS
532       variable is already defined.
533
534       See also CMAKE_C_FLAGS_INIT.
535
536   CSFLAGS
537       New in version 3.9.2.
538
539
540       This is a CMake Environment Variable. Its initial value is  taken  from
541       the calling process environment.
542
543       Add default compilation flags to be used when compiling CSharp files.
544
545       CMake uses this environment variable value, in combination with its own
546       builtin default flags for the toolchain, to initialize  and  store  the
547       CMAKE_CSharp_FLAGS  cache  entry.   This  occurs the first time a build
548       tree is configured for language CSharp.  For any configuration run (in‐
549       cluding  the  first),  the  environment variable will be ignored if the
550       CMAKE_CSharp_FLAGS variable is already defined.
551
552       See also CMAKE_CSharp_FLAGS_INIT.
553
554   CUDAARCHS
555       New in version 3.20.
556
557
558       This is a CMake Environment Variable. Its initial value is  taken  from
559       the calling process environment.
560
561       Value used to initialize CMAKE_CUDA_ARCHITECTURES on the first configu‐
562       ration. Subsequent runs will use the value stored in the cache.
563
564       This is a semicolon-separated list of  architectures  as  described  in
565       CUDA_ARCHITECTURES.
566
567   CUDACXX
568       New in version 3.8.
569
570
571       This  is  a CMake Environment Variable. Its initial value is taken from
572       the calling process environment.
573
574       Preferred executable for compiling CUDA language files.  Will  only  be
575       used  by  CMake  on the first configuration to determine CUDA compiler,
576       after  which  the  value  for  CUDA  is  stored   in   the   cache   as
577       CMAKE_CUDA_COMPILER.  For  any configuration run (including the first),
578       the environment variable will be  ignored  if  the  CMAKE_CUDA_COMPILER
579       variable is defined.
580
581       NOTE:
582          Options that are required to make the compiler work correctly can be
583          included; they can not be changed.
584
585          $ export CUDACXX="custom-compiler --arg1 --arg2"
586
587   CUDAFLAGS
588       New in version 3.8.
589
590
591       This is a CMake Environment Variable. Its initial value is  taken  from
592       the calling process environment.
593
594       Add default compilation flags to be used when compiling CUDA files.
595
596       CMake uses this environment variable value, in combination with its own
597       builtin default flags for the toolchain, to initialize  and  store  the
598       CMAKE_CUDA_FLAGS  cache entry.  This occurs the first time a build tree
599       is configured for language CUDA.  For any configuration run  (including
600       the   first),   the   environment  variable  will  be  ignored  if  the
601       CMAKE_CUDA_FLAGS variable is already defined.
602
603       See also CMAKE_CUDA_FLAGS_INIT.
604
605   CUDAHOSTCXX
606       New in version 3.8.
607
608
609       This is a CMake Environment Variable. Its initial value is  taken  from
610       the calling process environment.
611
612       Preferred  executable  for compiling host code when compiling CUDA lan‐
613       guage files. Will only be used by CMake on the first  configuration  to
614       determine  CUDA host compiler, after which the value for CUDAHOSTCXX is
615       stored in the cache as CMAKE_CUDA_HOST_COMPILER. This environment vari‐
616       able is preferred over CMAKE_CUDA_HOST_COMPILER.
617
618       This environment variable is primarily meant for use with projects that
619       enable CUDA as a first-class language.
620
621       NOTE:
622          Ignored when using Visual Studio Generators.
623
624       New in version 3.13: The FindCUDA module will use this variable to ini‐
625       tialize its CUDA_HOST_COMPILER setting.
626
627
628   CXX
629       This  is  a CMake Environment Variable. Its initial value is taken from
630       the calling process environment.
631
632       Preferred executable for compiling CXX language  files.  Will  only  be
633       used by CMake on the first configuration to determine CXX compiler, af‐
634       ter  which  the  value  for   CXX   is   stored   in   the   cache   as
635       CMAKE_CXX_COMPILER.  For  any  configuration run (including the first),
636       the environment variable will  be  ignored  if  the  CMAKE_CXX_COMPILER
637       variable is defined.
638
639       NOTE:
640          Options that are required to make the compiler work correctly can be
641          included; they can not be changed.
642
643          $ export CXX="custom-compiler --arg1 --arg2"
644
645   CXXFLAGS
646       This is a CMake Environment Variable. Its initial value is  taken  from
647       the calling process environment.
648
649       Add  default  compilation  flags  to  be  used when compiling CXX (C++)
650       files.
651
652       CMake uses this environment variable value, in combination with its own
653       builtin  default  flags  for the toolchain, to initialize and store the
654       CMAKE_CXX_FLAGS cache entry.  This occurs the first time a  build  tree
655       is  configured  for language CXX.  For any configuration run (including
656       the  first),  the  environment  variable  will  be   ignored   if   the
657       CMAKE_CXX_FLAGS variable is already defined.
658
659       See also CMAKE_CXX_FLAGS_INIT.
660
661   FC
662       This  is  a CMake Environment Variable. Its initial value is taken from
663       the calling process environment.
664
665       Preferred executable for compiling Fortran language files. Will only be
666       used by CMake on the first configuration to determine Fortran compiler,
667       after  which  the  value  for  Fortran  is  stored  in  the  cache   as
668       CMAKE_Fortran_COMPILER.   For  any  configuration  run  (including  the
669       first),   the   environment   variable   will   be   ignored   if   the
670       CMAKE_Fortran_COMPILER variable is defined.
671
672       NOTE:
673          Options that are required to make the compiler work correctly can be
674          included; they can not be changed.
675
676          $ export FC="custom-compiler --arg1 --arg2"
677
678   FFLAGS
679       This is a CMake Environment Variable. Its initial value is  taken  from
680       the calling process environment.
681
682       Add default compilation flags to be used when compiling Fortran files.
683
684       CMake uses this environment variable value, in combination with its own
685       builtin default flags for the toolchain, to initialize  and  store  the
686       CMAKE_Fortran_FLAGS  cache  entry.   This occurs the first time a build
687       tree is configured for language Fortran.   For  any  configuration  run
688       (including  the first), the environment variable will be ignored if the
689       CMAKE_Fortran_FLAGS variable is already defined.
690
691       See also CMAKE_Fortran_FLAGS_INIT.
692
693   HIPCXX
694       New in version 3.21.
695
696
697       This is a CMake Environment Variable. Its initial value is  taken  from
698       the calling process environment.
699
700       Preferred  executable  for  compiling  HIP language files. Will only be
701       used by CMake on the first configuration to determine HIP compiler, af‐
702       ter   which   the   value   for   HIP   is   stored  in  the  cache  as
703       CMAKE_HIP_COMPILER. For any configuration run  (including  the  first),
704       the  environment  variable  will  be  ignored if the CMAKE_HIP_COMPILER
705       variable is defined.
706
707   HIPFLAGS
708       New in version 3.21.
709
710
711       This is a CMake Environment Variable. Its initial value is  taken  from
712       the calling process environment.
713
714       Add default compilation flags to be used when compiling HIP files.
715
716       CMake uses this environment variable value, in combination with its own
717       builtin default flags for the toolchain, to initialize  and  store  the
718       CMAKE_HIP_FLAGS  cache  entry.  This occurs the first time a build tree
719       is configured for language HIP.  For any configuration  run  (including
720       the   first),   the   environment  variable  will  be  ignored  if  the
721       CMAKE_HIP_FLAGS variable is already defined.
722
723       See also CMAKE_HIP_FLAGS_INIT.
724
725   ISPC
726       New in version 3.19.
727
728
729       This is a CMake Environment Variable. Its initial value is  taken  from
730       the calling process environment.
731
732       Preferred  executable  for  compiling ISPC language files. Will only be
733       used by CMake on the first configuration to  determine  ISPC  compiler,
734       after   which   the   value   for  ISPC  is  stored  in  the  cache  as
735       CMAKE_ISPC_COMPILER. For any configuration run (including  the  first),
736       the  environment  variable  will  be ignored if the CMAKE_ISPC_COMPILER
737       variable is defined.
738
739   ISPCFLAGS
740       New in version 3.19.
741
742
743       This is a CMake Environment Variable. Its initial value is  taken  from
744       the calling process environment.
745
746       Add default compilation flags to be used when compiling ISPC files.
747
748       CMake uses this environment variable value, in combination with its own
749       builtin default flags for the toolchain, to initialize  and  store  the
750       CMAKE_ISPC_FLAGS  cache entry.  This occurs the first time a build tree
751       is configured for language ISPC.  For any configuration run  (including
752       the   first),   the   environment  variable  will  be  ignored  if  the
753       CMAKE_ISPC_FLAGS variable is already defined.
754
755       See also CMAKE_ISPC_FLAGS_INIT.
756
757   OBJC
758       New in version 3.16.7.
759
760
761       This is a CMake Environment Variable. Its initial value is  taken  from
762       the calling process environment.
763
764       Preferred  executable  for  compiling OBJC language files. Will only be
765       used by CMake on the first configuration to  determine  OBJC  compiler,
766       after   which   the   value   for  OBJC  is  stored  in  the  cache  as
767       CMAKE_OBJC_COMPILER. For any configuration run (including  the  first),
768       the  environment  variable  will  be ignored if the CMAKE_OBJC_COMPILER
769       variable is defined.
770
771       If OBJC is not defined, the CC environment variable will be checked in‐
772       stead.
773
774   OBJCXX
775       New in version 3.16.7.
776
777
778       This  is  a CMake Environment Variable. Its initial value is taken from
779       the calling process environment.
780
781       Preferred executable for compiling OBJCXX language files. Will only  be
782       used  by CMake on the first configuration to determine OBJCXX compiler,
783       after  which  the  value  for  OBJCXX  is  stored  in  the   cache   as
784       CMAKE_OBJCXX_COMPILER. For any configuration run (including the first),
785       the environment variable will be ignored if  the  CMAKE_OBJCXX_COMPILER
786       variable is defined.
787
788       If  OBJCXX is not defined, the CXX environment variable will be checked
789       instead.
790
791   RC
792       This is a CMake Environment Variable. Its initial value is  taken  from
793       the calling process environment.
794
795       Preferred executable for compiling resource files. Will only be used by
796       CMake on the first configuration to determine resource compiler,  after
797       which the value for RC is stored in the cache as CMAKE_RC_COMPILER. For
798       any configuration run (including the first), the  environment  variable
799       will be ignored if the CMAKE_RC_COMPILER variable is defined.
800
801       NOTE:
802          Options that are required to make the compiler work correctly can be
803          included; they can not be changed.
804
805          $ export RC="custom-compiler --arg1 --arg2"
806
807   RCFLAGS
808       This is a CMake Environment Variable. Its initial value is  taken  from
809       the calling process environment.
810
811       Add  default  compilation flags to be used when compiling RC (resource)
812       files.
813
814       CMake uses this environment variable value, in combination with its own
815       builtin  default  flags  for the toolchain, to initialize and store the
816       CMAKE_RC_FLAGS cache entry.  This occurs the first time a build tree is
817       configured  for  language RC.  For any configuration run (including the
818       first), the environment variable will be ignored if the  CMAKE_RC_FLAGS
819       variable is already defined.
820
821       See also CMAKE_RC_FLAGS_INIT.
822
823   SWIFTC
824       New in version 3.15.
825
826
827       This  is  a CMake Environment Variable. Its initial value is taken from
828       the calling process environment.
829
830       Preferred executable for compiling Swift language files. Will  only  be
831       used  by  CMake on the first configuration to determine Swift compiler,
832       after  which  the  value  for  SWIFTC  is  stored  in  the   cache   as
833       CMAKE_Swift_COMPILER.  For any configuration run (including the first),
834       the environment variable will be ignored  if  the  CMAKE_Swift_COMPILER
835       variable is defined.
836
837       NOTE:
838          Options that are required to make the compiler work correctly can be
839          included; they can not be changed.
840
841          $ export SWIFTC="custom-compiler --arg1 --arg2"
842

ENVIRONMENT VARIABLES FOR CTEST

844   CTEST_INTERACTIVE_DEBUG_MODE
845       This is a CMake Environment Variable. Its initial value is  taken  from
846       the calling process environment.
847
848       Environment  variable  that will exist and be set to 1 when a test exe‐
849       cuted by ctest(1) is run in interactive mode.
850
851   CTEST_OUTPUT_ON_FAILURE
852       This is a CMake Environment Variable. Its initial value is  taken  from
853       the calling process environment.
854
855       Boolean  environment  variable  that  controls  if the output should be
856       logged for failed tests. Set the value to 1, True, or ON to enable out‐
857       put  on failure.  See ctest(1) for more information on controlling out‐
858       put of failed tests.
859
860   CTEST_PARALLEL_LEVEL
861       This is a CMake Environment Variable. Its initial value is  taken  from
862       the calling process environment.
863
864       Specify  the number of tests for CTest to run in parallel. See ctest(1)
865       for more information on parallel test execution.
866
867   CTEST_PROGRESS_OUTPUT
868       New in version 3.13.
869
870
871       This is a CMake Environment Variable. Its initial value is  taken  from
872       the calling process environment.
873
874       Boolean  environment variable that affects how ctest command output re‐
875       ports overall progress.  When set to 1, TRUE, ON or anything else  that
876       evaluates  to boolean true, progress is reported by repeatedly updating
877       the same line.  This greatly reduces the overall verbosity, but is only
878       supported  when output is sent directly to a terminal.  If the environ‐
879       ment variable is not set or has a value that evaluates to false, output
880       is  reported normally with each test having its own start and end lines
881       logged to the output.
882
883       The --progress option to ctest overrides this environment  variable  if
884       both are given.
885
886   CTEST_USE_LAUNCHERS_DEFAULT
887       This  is  a CMake Environment Variable. Its initial value is taken from
888       the calling process environment.
889
890       Initializes the CTEST_USE_LAUNCHERS variable if not already defined.
891
892   DASHBOARD_TEST_FROM_CTEST
893       This is a CMake Environment Variable. Its initial value is  taken  from
894       the calling process environment.
895
896       Environment  variable  that will exist when a test executed by ctest(1)
897       is  run  in  non-interactive  mode.   The  value  will  be   equal   to
898       CMAKE_VERSION.
899

ENVIRONMENT VARIABLES FOR THE CMAKE CURSES INTERFACE

901   CCMAKE_COLORS
902       New in version 3.18.
903
904
905       Determines what colors are used by the CMake curses interface, when run
906       on a terminal that supports colors.  The syntax follows the  same  con‐
907       ventions  as LS_COLORS; that is, a list of key/value pairs separated by
908       :.
909
910       Keys are a single letter corresponding to a CMake cache variable type:
911
912s: A STRING.
913
914p: A FILEPATH.
915
916c: A value which has an associated list of choices.
917
918y: A BOOL which has a true-like value (e.g. ON, YES).
919
920n: A BOOL which has a false-like value (e.g. OFF, NO).
921
922       Values are an integer number that specifies what color to  use.   0  is
923       black  (you probably don't want to use that).  Others are determined by
924       your terminal's color support.  Most (color) terminals will support  at
925       least  8  or 16 colors.  Some will support up to 256 colors. The colors
926       will likely match this chart, although the first 16  colors  may  match
927       the  original  CGA color palette.  (Many modern terminal emulators also
928       allow their color palette, at least for the first 16 colors, to be con‐
929       figured by the user.)
930
931       Note  that  fairly  minimal checking is done for bad colors (although a
932       value higher than what curses believes your terminal supports  will  be
933       silently ignored) or bad syntax.
934
935       For example:
936
937          CCMAKE_COLORS='s=39:p=220:c=207:n=196:y=46'
938
940       2000-2023 Kitware, Inc. and Contributors
941
942
943
944
9453.25.2                           Jan 19, 2023           CMAKE-ENV-VARIABLES(7)
Impressum