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 CONTROL THE BUILD

15   CMAKE_BUILD_PARALLEL_LEVEL
16       This  is  a CMake Environment Variable. Its initial value is taken from
17       the calling process environment.
18
19       Specifies the maximum number of concurrent processes to use when build‐
20       ing using the cmake --build command line Build Tool Mode.
21
22       If  this variable is defined empty the native build tool’s default num‐
23       ber is used.
24
25   CMAKE_CONFIG_TYPE
26       This is a CMake Environment Variable. Its initial value is  taken  from
27       the calling process environment.
28
29       The  default  build  configuration  for Build Tool Mode and ctest build
30       handler when there is no explicit configuration given.
31
32   CMAKE_MSVCIDE_RUN_PATH
33       This is a CMake Environment Variable. Its initial value is  taken  from
34       the calling process environment.
35
36       Extra  PATH  locations  for  custom commands when using Visual Studio 9
37       2008 (or above) generators.
38
39       The CMAKE_MSVCIDE_RUN_PATH environment variable sets the default  value
40       for the CMAKE_MSVCIDE_RUN_PATH variable if not already explicitly set.
41
42   CMAKE_NO_VERBOSE
43       Disables verbose output from CMake when VERBOSE environment variable is
44       set.
45
46       Only your build tool of choice will still print verbose output when you
47       start to actually build your project.
48
49   CMAKE_OSX_ARCHITECTURES
50       This  is  a CMake Environment Variable. Its initial value is taken from
51       the calling process environment.
52
53       Target specific architectures for macOS.
54
55       The CMAKE_OSX_ARCHITECTURES environment variable sets the default value
56       for  the  CMAKE_OSX_ARCHITECTURES  variable.  See OSX_ARCHITECTURES for
57       more information.
58
59   DESTDIR
60       This is a CMake Environment Variable. Its initial value is  taken  from
61       the calling process environment.
62
63       On  UNIX  one  can  use  the DESTDIR mechanism in order to relocate the
64       whole installation.  DESTDIR means DESTination DIRectory.  It  is  com‐
65       monly   used  by  makefile  users  in  order  to  install  software  at
66       non-default location.  It is usually invoked like this:
67
68          make DESTDIR=/home/john install
69
70       which will install the concerned software using the  installation  pre‐
71       fix,  e.g.   /usr/local  prepended with the DESTDIR value which finally
72       gives /home/john/usr/local.
73
74       WARNING: DESTDIR may not be used on Windows because installation prefix
75       usually  contains  a drive letter like in C:/Program Files which cannot
76       be prepended with some other prefix.
77
78   LDFLAGS
79       This is a CMake Environment Variable. Its initial value is  taken  from
80       the calling process environment.
81
82       Will  only be used by CMake on the first configuration to determine the
83       default linker flags, after which the value for LDFLAGS  is  stored  in
84       the           cache           as           CMAKE_EXE_LINKER_FLAGS_INIT,
85       CMAKE_SHARED_LINKER_FLAGS_INIT, and CMAKE_MODULE_LINKER_FLAGS_INIT. For
86       any  configuration  run (including the first), the environment variable
87       will be ignored if the equivalent  CMAKE_<TYPE>_LINKER_FLAGS_INIT vari‐
88       able is defined.
89
90   MACOSX_DEPLOYMENT_TARGET
91       This  is  a CMake Environment Variable. Its initial value is taken from
92       the calling process environment.
93
94       Specify the minimum version of macOS on which the target  binaries  are
95       to be deployed.
96
97       The  MACOSX_DEPLOYMENT_TARGET  environment  variable  sets  the default
98       value for the CMAKE_OSX_DEPLOYMENT_TARGET variable.
99
100   <PackageName>_ROOT
101       This is a CMake Environment Variable. Its initial value is  taken  from
102       the calling process environment.
103
104       Calls  to find_package(<PackageName>) will search in prefixes specified
105       by the <PackageName>_ROOT environment variable, where <PackageName>  is
106       the  name  given  to  the  find_package call and _ROOT is literal.  For
107       example,  find_package(Foo)  will  search  prefixes  specified  in  the
108       Foo_ROOT environment variable (if set).  See policy CMP0074.
109
110       This  variable may hold a single prefix or a list of prefixes separated
111       by : on UNIX or ; on Windows (the same as the PATH environment variable
112       convention on those platforms).
113
114       See also the <PackageName>_ROOT CMake variable.
115
116   VERBOSE
117       Activates verbose output from CMake and your build tools of choice when
118       you start to actually build your project.
119
120       Note that any given value is ignored. It’s just checked for existence.
121
122       See also Build Tool Mode and CMAKE_NO_VERBOSE environment variable
123

ENVIRONMENT VARIABLES FOR LANGUAGES

125   ASM<DIALECT>
126       This is a CMake Environment Variable. Its initial value is  taken  from
127       the calling process environment.
128
129       Preferred  executable for compiling a specific dialect of assembly lan‐
130       guage files. ASM<DIALECT> can be ASM, ASM_NASM,  ASM_MASM  or  ASM-ATT.
131       Will  only  be  used  by  CMake on the first configuration to determine
132       ASM<DIALECT> compiler, after which the value for ASM<DIALECT> is stored
133       in  the cache as CMAKE_ASM<DIALECT>_COMPILER. For subsequent configura‐
134       tion runs, the  environment  variable  will  be  ignored  in  favor  of
135       CMAKE_ASM<DIALECT>_COMPILER.
136
137   ASM<DIALECT>FLAGS
138       This  is  a CMake Environment Variable. Its initial value is taken from
139       the calling process environment.
140
141       Default compilation flags to be used when compiling a specific  dialect
142       of  an  assembly language. ASM<DIALECT>FLAGS can be ASMFLAGS, ASM_NASM‐
143       FLAGS, ASM_MASMFLAGS or ASM-ATTFLAGS. Will only be used by CMake on the
144       first  configuration  to  determine  ASM<DIALECT>  default  compilation
145       flags, after which the value for ASM<DIALECT>FLAGS  is  stored  in  the
146       cache as CMAKE_ASM<DIALECT>_FLAGS. For any configuration run (including
147       the  first),  the  environment  variable  will  be   ignored   if   the
148       CMAKE_ASM<DIALECT>_FLAGS variable is defined.
149
150   CC
151       This  is  a CMake Environment Variable. Its initial value is taken from
152       the calling process environment.
153
154       Preferred executable for compiling C language files. Will only be  used
155       by  CMake  on  the  first  configuration to determine C compiler, after
156       which the value for CC is stored in the cache as CMAKE_C_COMPILER.  For
157       any  configuration  run (including the first), the environment variable
158       will be ignored if the CMAKE_C_COMPILER variable is defined.
159
160   CFLAGS
161       This is a CMake Environment Variable. Its initial value is  taken  from
162       the calling process environment.
163
164       Default  compilation flags to be used when compiling C files. Will only
165       be used by CMake on the first configuration  to  determine  CC  default
166       compilation  flags,  after  which the value for CFLAGS is stored in the
167       cache as  CMAKE_C_FLAGS.  For  any  configuration  run  (including  the
168       first),  the  environment variable will be ignored if the CMAKE_C_FLAGS
169       variable is defined.
170
171   CSFLAGS
172       This is a CMake Environment Variable. Its initial value is  taken  from
173       the calling process environment.
174
175       Preferred  executable for compiling CSharp language files. Will only be
176       used by CMake on the first configuration to  determine  CSharp  default
177       compilation  flags,  after which the value for CSFLAGS is stored in the
178       cache as CMAKE_CSharp_FLAGS. For any configuration run  (including  the
179       first),   the   environment   variable   will   be   ignored   if   the
180       CMAKE_CSharp_FLAGS variable is defined.
181
182   CUDACXX
183       This is a CMake Environment Variable. Its initial value is  taken  from
184       the calling process environment.
185
186       Preferred  executable  for  compiling CUDA language files. Will only be
187       used by CMake on the first configuration to  determine  CUDA  compiler,
188       after   which   the   value   for  CUDA  is  stored  in  the  cache  as
189       CMAKE_CUDA_COMPILER. For any configuration run (including  the  first),
190       the  environment  variable  will  be ignored if the CMAKE_CUDA_COMPILER
191       variable is defined.
192
193   CUDAFLAGS
194       This is a CMake Environment Variable. Its initial value is  taken  from
195       the calling process environment.
196
197       Default  compilation  flags  to be used when compiling CUDA files. Will
198       only be used by CMake on the  first  configuration  to  determine  CUDA
199       default  compilation  flags,  after  which  the  value for CUDAFLAGS is
200       stored in the cache as  CMAKE_CUDA_FLAGS.  For  any  configuration  run
201       (including  the first), the environment variable will be ignored if the
202       CMAKE_CUDA_FLAGS variable is defined.
203
204   CUDAHOSTCXX
205       This is a CMake Environment Variable. Its initial value is  taken  from
206       the calling process environment.
207
208       Preferred  executable  for compiling host code when compiling CUDA lan‐
209       guage files. Will only be used by CMake on the first  configuration  to
210       determine  CUDA host compiler, after which the value for CUDAHOSTCXX is
211       stored in the cache as CMAKE_CUDA_HOST_COMPILER. For any  configuration
212       run  (including the first), the environment variable will be ignored if
213       the CMAKE_CUDA_HOST_COMPILER variable is defined.
214
215       This environment variable is primarily meant for use with projects that
216       enable  CUDA  as a first-class language.  The FindCUDA module will also
217       use it to initialize its CUDA_HOST_COMPILER setting.
218
219   CXX
220       This is a CMake Environment Variable. Its initial value is  taken  from
221       the calling process environment.
222
223       Preferred  executable  for  compiling  CXX language files. Will only be
224       used by CMake on the first configuration  to  determine  CXX  compiler,
225       after  which the value for CXX is stored in the cache as CMAKE_CXX_COM‐
226       PILER. For any configuration run (including the first), the environment
227       variable will be ignored if the CMAKE_CXX_COMPILER variable is defined.
228
229   CXXFLAGS
230       This  is  a CMake Environment Variable. Its initial value is taken from
231       the calling process environment.
232
233       Default compilation flags to be used when compiling  CXX  (C++)  files.
234       Will  only be used by CMake on the first configuration to determine CXX
235       default compilation flags, after which the value for CXXFLAGS is stored
236       in  the cache as CMAKE_CXX_FLAGS. For any configuration run ( including
237       the  first),  the  environment  variable  will  be   ignored   if   the
238       CMAKE_CXX_FLAGS variable is defined.
239
240   FC
241       This  is  a CMake Environment Variable. Its initial value is taken from
242       the calling process environment.
243
244       Preferred executable for compiling Fortran language files. Will only be
245       used by CMake on the first configuration to determine Fortran compiler,
246       after which the value for Fortran is stored in the cache as  CMAKE_For‐
247       tran_COMPILER.  For  any  configuration  run (including the first), the
248       environment variable will  be  ignored  if  the  CMAKE_Fortran_COMPILER
249       variable is defined.
250
251   FFLAGS
252       This  is  a CMake Environment Variable. Its initial value is taken from
253       the calling process environment.
254
255       Default compilation flags to be used when compiling Fortran files. Will
256       only  be  used by CMake on the first configuration to determine Fortran
257       default compilation flags, after which the value for FFLAGS  is  stored
258       in the cache as CMAKE_Fortran_FLAGS. For any configuration run (includ‐
259       ing the first),  the  environment  variable  will  be  ignored  if  the
260       CMAKE_Fortran_FLAGS variable is defined.
261
262   RC
263       This  is  a CMake Environment Variable. Its initial value is taken from
264       the calling process environment.
265
266       Preferred executable for compiling resource files. Will only be used by
267       CMake  on the first configuration to determine resource compiler, after
268       which the value for RC is stored in the cache as CMAKE_RC_COMPILER. For
269       any  configuration  run (including the first), the environment variable
270       will be ignored if the CMAKE_RC_COMPILER variable is defined.
271
272   RCFLAGS
273       This is a CMake Environment Variable. Its initial value is  taken  from
274       the calling process environment.
275
276       Default  compilation  flags  to  be used when compiling resource files.
277       Will only be used by CMake on  the  first  configuration  to  determine
278       resource  default  compilation flags, after which the value for RCFLAGS
279       is stored in the cache as CMAKE_RC_FLAGS.  For  any  configuration  run
280       (including  the first), the environment variable will be ignored if the
281       CMAKE_RC_FLAGS variable is defined.
282

ENVIRONMENT VARIABLES FOR CTEST

284   CTEST_INTERACTIVE_DEBUG_MODE
285       This is a CMake Environment Variable. Its initial value is  taken  from
286       the calling process environment.
287
288       Environment  variable  that will exist and be set to 1 when a test exe‐
289       cuted by CTest is run in interactive mode.
290
291   CTEST_OUTPUT_ON_FAILURE
292       This is a CMake Environment Variable. Its initial value is  taken  from
293       the calling process environment.
294
295       Boolean  environment  variable  that  controls  if the output should be
296       logged for failed tests. Set the value to 1, True, or ON to enable out‐
297       put  on failure.  See ctest(1) for more information on controlling out‐
298       put of failed tests.
299
300   CTEST_PARALLEL_LEVEL
301       This is a CMake Environment Variable. Its initial value is  taken  from
302       the calling process environment.
303
304       Specify  the number of tests for CTest to run in parallel. See ctest(1)
305       for more information on parallel test execution.
306
307   CTEST_PROGRESS_OUTPUT
308       This is a CMake Environment Variable. Its initial value is  taken  from
309       the calling process environment.
310
311       Boolean  environment  variable  that  affects  how ctest command output
312       reports overall progress.  When set to 1, TRUE,  ON  or  anything  else
313       that  evaluates  to  boolean  true,  progress is reported by repeatedly
314       updating the same line.  This greatly reduces  the  overall  verbosity,
315       but  is  only supported when output is sent directly to a terminal.  If
316       the environment variable is not set or has a value  that  evaluates  to
317       false,  output is reported normally with each test having its own start
318       and end lines logged to the output.
319
320       The --progress option to ctest overrides this environment  variable  if
321       both are given.
322
323   CTEST_USE_LAUNCHERS_DEFAULT
324       This  is  a CMake Environment Variable. Its initial value is taken from
325       the calling process environment.
326
327       Initializes the CTEST_USE_LAUNCHERS variable if not already defined.
328
329   DASHBOARD_TEST_FROM_CTEST
330       This is a CMake Environment Variable. Its initial value is  taken  from
331       the calling process environment.
332
333       Environment  variable  that will exist when a test executed by CTest is
334       run in non-interactive mode. The value will be equal to CMAKE_VERSION.
335
337       2000-2019 Kitware, Inc. and Contributors
338
339
340
341
3423.14.5                           Jun 01, 2019           CMAKE-ENV-VARIABLES(7)
Impressum