1CMAKE-ENV-VARIABLES(7) CMake CMAKE-ENV-VARIABLES(7)
2
3
4
6 cmake-env-variables - CMake Environment Variables Reference
7
8 This page lists environment variables that have special meaning to
9 CMake.
10
11 For general information on environment variables, see the Environment
12 Variables section in the cmake-language manual.
13
15 CMAKE_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_GENERATOR
33 This is a CMake Environment Variable. Its initial value is taken from
34 the calling process environment.
35
36 Specifies the CMake default generator to use when no generator is sup‐
37 plied with -G. If the provided value doesn’t name a generator known by
38 CMake, the internal default is used. Either way the resulting genera‐
39 tor selection is stored in the CMAKE_GENERATOR variable.
40
41 Some generators may be additionally configured using the environment
42 variables:
43
44 · CMAKE_GENERATOR_PLATFORM
45
46 · CMAKE_GENERATOR_TOOLSET
47
48 · CMAKE_GENERATOR_INSTANCE
49
50 CMAKE_GENERATOR_INSTANCE
51 This is a CMake Environment Variable. Its initial value is taken from
52 the calling process environment.
53
54 Default value for CMAKE_GENERATOR_INSTANCE if no Cache entry is
55 present. This value is only applied if CMAKE_GENERATOR is set.
56
57 CMAKE_GENERATOR_PLATFORM
58 This is a CMake Environment Variable. Its initial value is taken from
59 the calling process environment.
60
61 Default value for CMAKE_GENERATOR_PLATFORM if no Cache entry is present
62 and no value is specified by cmake(1) -A option. This value is only
63 applied if CMAKE_GENERATOR is set.
64
65 CMAKE_GENERATOR_TOOLSET
66 This is a CMake Environment Variable. Its initial value is taken from
67 the calling process environment.
68
69 Default value for CMAKE_GENERATOR_TOOLSET if no Cache entry is present
70 and no value is specified by cmake(1) -T option. This value is only
71 applied if CMAKE_GENERATOR is set.
72
73 CMAKE_MSVCIDE_RUN_PATH
74 This is a CMake Environment Variable. Its initial value is taken from
75 the calling process environment.
76
77 Extra PATH locations for custom commands when using Visual Studio 9
78 2008 (or above) generators.
79
80 The CMAKE_MSVCIDE_RUN_PATH environment variable sets the default value
81 for the CMAKE_MSVCIDE_RUN_PATH variable if not already explicitly set.
82
83 CMAKE_NO_VERBOSE
84 Disables verbose output from CMake when VERBOSE environment variable is
85 set.
86
87 Only your build tool of choice will still print verbose output when you
88 start to actually build your project.
89
90 CMAKE_OSX_ARCHITECTURES
91 This is a CMake Environment Variable. Its initial value is taken from
92 the calling process environment.
93
94 Target specific architectures for macOS.
95
96 The CMAKE_OSX_ARCHITECTURES environment variable sets the default value
97 for the CMAKE_OSX_ARCHITECTURES variable. See OSX_ARCHITECTURES for
98 more information.
99
100 DESTDIR
101 This is a CMake Environment Variable. Its initial value is taken from
102 the calling process environment.
103
104 On UNIX one can use the DESTDIR mechanism in order to relocate the
105 whole installation. DESTDIR means DESTination DIRectory. It is com‐
106 monly used by makefile users in order to install software at
107 non-default location. It is usually invoked like this:
108
109 make DESTDIR=/home/john install
110
111 which will install the concerned software using the installation pre‐
112 fix, e.g. /usr/local prepended with the DESTDIR value which finally
113 gives /home/john/usr/local.
114
115 WARNING: DESTDIR may not be used on Windows because installation prefix
116 usually contains a drive letter like in C:/Program Files which cannot
117 be prepended with some other prefix.
118
119 LDFLAGS
120 This is a CMake Environment Variable. Its initial value is taken from
121 the calling process environment.
122
123 Will only be used by CMake on the first configuration to determine the
124 default linker flags, after which the value for LDFLAGS is stored in
125 the cache as CMAKE_EXE_LINKER_FLAGS_INIT,
126 CMAKE_SHARED_LINKER_FLAGS_INIT, and CMAKE_MODULE_LINKER_FLAGS_INIT. For
127 any configuration run (including the first), the environment variable
128 will be ignored if the equivalent CMAKE_<TYPE>_LINKER_FLAGS_INIT vari‐
129 able is defined.
130
131 MACOSX_DEPLOYMENT_TARGET
132 This is a CMake Environment Variable. Its initial value is taken from
133 the calling process environment.
134
135 Specify the minimum version of macOS on which the target binaries are
136 to be deployed.
137
138 The MACOSX_DEPLOYMENT_TARGET environment variable sets the default
139 value for the CMAKE_OSX_DEPLOYMENT_TARGET variable.
140
141 <PackageName>_ROOT
142 This is a CMake Environment Variable. Its initial value is taken from
143 the calling process environment.
144
145 Calls to find_package(<PackageName>) will search in prefixes specified
146 by the <PackageName>_ROOT environment variable, where <PackageName> is
147 the name given to the find_package() call and _ROOT is literal. For
148 example, find_package(Foo) will search prefixes specified in the
149 Foo_ROOT environment variable (if set). See policy CMP0074.
150
151 This variable may hold a single prefix or a list of prefixes separated
152 by : on UNIX or ; on Windows (the same as the PATH environment variable
153 convention on those platforms).
154
155 See also the <PackageName>_ROOT CMake variable.
156
157 VERBOSE
158 Activates verbose output from CMake and your build tools of choice when
159 you start to actually build your project.
160
161 Note that any given value is ignored. It’s just checked for existence.
162
163 See also Build Tool Mode and CMAKE_NO_VERBOSE environment variable
164
166 ASM<DIALECT>
167 This is a CMake Environment Variable. Its initial value is taken from
168 the calling process environment.
169
170 Preferred executable for compiling a specific dialect of assembly lan‐
171 guage files. ASM<DIALECT> can be ASM, ASM_NASM (Netwide Assembler),
172 ASM_MASM (Microsoft Assembler) or ASM-ATT (Assembler AT&T). Will only
173 be used by CMake on the first configuration to determine ASM<DIALECT>
174 compiler, after which the value for ASM<DIALECT> is stored in the cache
175 as CMAKE_ASM<DIALECT>_COMPILER. For subsequent configuration runs, the
176 environment variable will be ignored in favor of
177 CMAKE_ASM<DIALECT>_COMPILER.
178
179 ASM<DIALECT>FLAGS
180 This is a CMake Environment Variable. Its initial value is taken from
181 the calling process environment.
182
183 Default compilation flags to be used when compiling a specific dialect
184 of an assembly language. ASM<DIALECT>FLAGS can be ASMFLAGS, ASM_NASM‐
185 FLAGS, ASM_MASMFLAGS or ASM-ATTFLAGS. Will only be used by CMake on the
186 first configuration to determine ASM_<DIALECT> default compilation
187 flags, after which the value for ASM<DIALECT>FLAGS is stored in the
188 cache as CMAKE_ASM<DIALECT>_FLAGS <CMAKE_<LANG>_FLAGS>. For any con‐
189 figuration run (including the first), the environment variable will be
190 ignored, if the CMAKE_ASM<DIALECT>_FLAGS <CMAKE_<LANG>_FLAGS> variable
191 is defined.
192
193 CC
194 This is a CMake Environment Variable. Its initial value is taken from
195 the calling process environment.
196
197 Preferred executable for compiling C language files. Will only be used
198 by CMake on the first configuration to determine C compiler, after
199 which the value for CC is stored in the cache as CMAKE_C_COMPILER. For
200 any configuration run (including the first), the environment variable
201 will be ignored if the CMAKE_C_COMPILER variable is defined.
202
203 CFLAGS
204 This is a CMake Environment Variable. Its initial value is taken from
205 the calling process environment.
206
207 Default compilation flags to be used when compiling C files. Will only
208 be used by CMake on the first configuration to determine CC default
209 compilation flags, after which the value for CFLAGS is stored in the
210 cache as CMAKE_C_FLAGS. For any configuration run (including the
211 first), the environment variable will be ignored if the CMAKE_C_FLAGS
212 variable is defined.
213
214 CSFLAGS
215 This is a CMake Environment Variable. Its initial value is taken from
216 the calling process environment.
217
218 Preferred executable for compiling CSharp language files. Will only be
219 used by CMake on the first configuration to determine CSharp default
220 compilation flags, after which the value for CSFLAGS is stored in the
221 cache as CMAKE_CSharp_FLAGS. For any configuration run (including the
222 first), the environment variable will be ignored if the
223 CMAKE_CSharp_FLAGS variable is defined.
224
225 CUDACXX
226 This is a CMake Environment Variable. Its initial value is taken from
227 the calling process environment.
228
229 Preferred executable for compiling CUDA language files. Will only be
230 used by CMake on the first configuration to determine CUDA compiler,
231 after which the value for CUDA is stored in the cache as
232 CMAKE_CUDA_COMPILER. For any configuration run (including the first),
233 the environment variable will be ignored if the CMAKE_CUDA_COMPILER
234 variable is defined.
235
236 CUDAFLAGS
237 This is a CMake Environment Variable. Its initial value is taken from
238 the calling process environment.
239
240 Default compilation flags to be used when compiling CUDA files. Will
241 only be used by CMake on the first configuration to determine CUDA
242 default compilation flags, after which the value for CUDAFLAGS is
243 stored in the cache as CMAKE_CUDA_FLAGS. For any configuration run
244 (including the first), the environment variable will be ignored if the
245 CMAKE_CUDA_FLAGS variable is defined.
246
247 CUDAHOSTCXX
248 This is a CMake Environment Variable. Its initial value is taken from
249 the calling process environment.
250
251 Preferred executable for compiling host code when compiling CUDA lan‐
252 guage files. Will only be used by CMake on the first configuration to
253 determine CUDA host compiler, after which the value for CUDAHOSTCXX is
254 stored in the cache as CMAKE_CUDA_HOST_COMPILER. For any configuration
255 run (including the first), the environment variable will be ignored if
256 the CMAKE_CUDA_HOST_COMPILER variable is defined.
257
258 This environment variable is primarily meant for use with projects that
259 enable CUDA as a first-class language. The FindCUDA module will also
260 use it to initialize its CUDA_HOST_COMPILER setting.
261
262 CXX
263 This is a CMake Environment Variable. Its initial value is taken from
264 the calling process environment.
265
266 Preferred executable for compiling CXX language files. Will only be
267 used by CMake on the first configuration to determine CXX compiler,
268 after which the value for CXX is stored in the cache as CMAKE_CXX_COM‐
269 PILER. For any configuration run (including the first), the environment
270 variable will be ignored if the CMAKE_CXX_COMPILER variable is defined.
271
272 CXXFLAGS
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 CXX (C++) files.
277 Will only be used by CMake on the first configuration to determine CXX
278 default compilation flags, after which the value for CXXFLAGS is stored
279 in the cache as CMAKE_CXX_FLAGS. For any configuration run ( including
280 the first), the environment variable will be ignored if the
281 CMAKE_CXX_FLAGS variable is defined.
282
283 FC
284 This is a CMake Environment Variable. Its initial value is taken from
285 the calling process environment.
286
287 Preferred executable for compiling Fortran language files. Will only be
288 used by CMake on the first configuration to determine Fortran compiler,
289 after which the value for Fortran is stored in the cache as CMAKE_For‐
290 tran_COMPILER. For any configuration run (including the first), the
291 environment variable will be ignored if the CMAKE_Fortran_COMPILER
292 variable is defined.
293
294 FFLAGS
295 This is a CMake Environment Variable. Its initial value is taken from
296 the calling process environment.
297
298 Default compilation flags to be used when compiling Fortran files. Will
299 only be used by CMake on the first configuration to determine Fortran
300 default compilation flags, after which the value for FFLAGS is stored
301 in the cache as CMAKE_Fortran_FLAGS. For any configuration run (includ‐
302 ing the first), the environment variable will be ignored if the
303 CMAKE_Fortran_FLAGS variable is defined.
304
305 RC
306 This is a CMake Environment Variable. Its initial value is taken from
307 the calling process environment.
308
309 Preferred executable for compiling resource files. Will only be used by
310 CMake on the first configuration to determine resource compiler, after
311 which the value for RC is stored in the cache as CMAKE_RC_COMPILER. For
312 any configuration run (including the first), the environment variable
313 will be ignored if the CMAKE_RC_COMPILER variable is defined.
314
315 RCFLAGS
316 This is a CMake Environment Variable. Its initial value is taken from
317 the calling process environment.
318
319 Default compilation flags to be used when compiling resource files.
320 Will only be used by CMake on the first configuration to determine
321 resource default compilation flags, after which the value for RCFLAGS
322 is stored in the cache as CMAKE_RC_FLAGS. For any configuration run
323 (including the first), the environment variable will be ignored if the
324 CMAKE_RC_FLAGS variable is defined.
325
326 SWIFTC
327 This is a CMake Environment Variable. Its initial value is taken from
328 the calling process environment.
329
330 Preferred executable for compiling Swift language files. Will only be
331 used by CMake on the first configuration to determine Swift compiler,
332 after which the value for SWIFTC is stored in the cache as
333 CMAKE_Swift_COMPILER. For any configuration run (including the first),
334 the environment variable will be ignored if the CMAKE_Swift_COMPILER
335 variable is defined.
336
338 CTEST_INTERACTIVE_DEBUG_MODE
339 This is a CMake Environment Variable. Its initial value is taken from
340 the calling process environment.
341
342 Environment variable that will exist and be set to 1 when a test exe‐
343 cuted by ctest(1) is run in interactive mode.
344
345 CTEST_OUTPUT_ON_FAILURE
346 This is a CMake Environment Variable. Its initial value is taken from
347 the calling process environment.
348
349 Boolean environment variable that controls if the output should be
350 logged for failed tests. Set the value to 1, True, or ON to enable out‐
351 put on failure. See ctest(1) for more information on controlling out‐
352 put of failed tests.
353
354 CTEST_PARALLEL_LEVEL
355 This is a CMake Environment Variable. Its initial value is taken from
356 the calling process environment.
357
358 Specify the number of tests for CTest to run in parallel. See ctest(1)
359 for more information on parallel test execution.
360
361 CTEST_PROGRESS_OUTPUT
362 This is a CMake Environment Variable. Its initial value is taken from
363 the calling process environment.
364
365 Boolean environment variable that affects how ctest command output
366 reports overall progress. When set to 1, TRUE, ON or anything else
367 that evaluates to boolean true, progress is reported by repeatedly
368 updating the same line. This greatly reduces the overall verbosity,
369 but is only supported when output is sent directly to a terminal. If
370 the environment variable is not set or has a value that evaluates to
371 false, output is reported normally with each test having its own start
372 and end lines logged to the output.
373
374 The --progress option to ctest overrides this environment variable if
375 both are given.
376
377 CTEST_USE_LAUNCHERS_DEFAULT
378 This is a CMake Environment Variable. Its initial value is taken from
379 the calling process environment.
380
381 Initializes the CTEST_USE_LAUNCHERS variable if not already defined.
382
383 DASHBOARD_TEST_FROM_CTEST
384 This is a CMake Environment Variable. Its initial value is taken from
385 the calling process environment.
386
387 Environment variable that will exist when a test executed by ctest(1)
388 is run in non-interactive mode. The value will be equal to CMAKE_VER‐
389 SION.
390
392 2000-2019 Kitware, Inc. and Contributors
393
394
395
396
3973.16.1 Dec 14, 2019 CMAKE-ENV-VARIABLES(7)