1cmakevars(1) General Commands Manual cmakevars(1)
2
3
4
6 cmakevars - Reference of CMake variables.
7
8
10 variables defined by cmake, that give information about the project,
11 and cmake
12
13
14 CMAKE_AR
15 Name of archiving tool for static libraries.
16
17 This specifies the name of the program that creates archive or
18 static libraries.
19
20
21 CMAKE_ARGC
22 Number of command line arguments passed to CMake in script mode.
23
24 When run in -P script mode, CMake sets this variable to the num‐
25 ber of command line arguments. See also CMAKE_ARGV0, 1, 2 ...
26
27
28 CMAKE_ARGV0
29 Command line argument passed to CMake in script mode.
30
31 When run in -P script mode, CMake sets this variable to the
32 first command line argument. It then also sets CMAKE_ARGV1,
33 CMAKE_ARGV2, ... and so on, up to the number of command line
34 arguments given. See also CMAKE_ARGC.
35
36
37 CMAKE_BINARY_DIR
38 The path to the top level of the build tree.
39
40 This is the full path to the top level of the current CMake
41 build tree. For an in-source build, this would be the same as
42 CMAKE_SOURCE_DIR.
43
44
45 CMAKE_BUILD_TOOL
46 Tool used for the actual build process.
47
48 This variable is set to the program that will be needed to build
49 the output of CMake. If the generator selected was Visual Stu‐
50 dio 6, the CMAKE_BUILD_TOOL will be set to msdev, for Unix Make‐
51 files it will be set to make or gmake, and for Visual Studio 7
52 it set to devenv. For NMake Makefiles the value is nmake. This
53 can be useful for adding special flags and commands based on the
54 final build environment.
55
56
57 CMAKE_CACHEFILE_DIR
58 The directory with the CMakeCache.txt file.
59
60 This is the full path to the directory that has the CMake‐
61 Cache.txt file in it. This is the same as CMAKE_BINARY_DIR.
62
63
64 CMAKE_CACHE_MAJOR_VERSION
65 Major version of CMake used to create the CMakeCache.txt file
66
67 This stores the major version of CMake used to write a CMake
68 cache file. It is only different when a different version of
69 CMake is run on a previously created cache file.
70
71
72 CMAKE_CACHE_MINOR_VERSION
73 Minor version of CMake used to create the CMakeCache.txt file
74
75 This stores the minor version of CMake used to write a CMake
76 cache file. It is only different when a different version of
77 CMake is run on a previously created cache file.
78
79
80 CMAKE_CACHE_PATCH_VERSION
81 Patch version of CMake used to create the CMakeCache.txt file
82
83 This stores the patch version of CMake used to write a CMake
84 cache file. It is only different when a different version of
85 CMake is run on a previously created cache file.
86
87
88 CMAKE_CFG_INTDIR
89 Build-time reference to per-configuration output subdirectory.
90
91 For native build systems supporting multiple configurations in
92 the build tree (such as Visual Studio and Xcode), the value is a
93 reference to a build-time variable specifying the name of the
94 per-configuration output subdirectory. On Makefile generators
95 this evaluates to "." because there is only one configuration in
96 a build tree. Example values:
97
98
99 $(IntDir) = Visual Studio 6
100 $(OutDir) = Visual Studio 7, 8, 9
101 $(Configuration) = Visual Studio 10
102 $(CONFIGURATION) = Xcode
103 . = Make-based tools
104
105 Since these values are evaluated by the native build system,
106 this variable is suitable only for use in command lines that
107 will be evaluated at build time. Example of intended usage:
108
109
110 add_executable(mytool mytool.c)
111 add_custom_command(
112 OUTPUT out.txt
113 COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/mytool
114 ${CMAKE_CURRENT_SOURCE_DIR}/in.txt out.txt
115 DEPENDS mytool in.txt
116 )
117 add_custom_target(drive ALL DEPENDS out.txt)
118
119 Note that CMAKE_CFG_INTDIR is no longer necessary for this pur‐
120 pose but has been left for compatibility with existing projects.
121 Instead add_custom_command() recognizes executable target names
122 in its COMMAND option, so "${CMAKE_CUR‐
123 RENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/mytool" can be replaced by
124 just "mytool".
125
126
127 This variable is read-only. Setting it is undefined behavior.
128 In multi-configuration build systems the value of this variable
129 is passed as the value of preprocessor symbol "CMAKE_INTDIR" to
130 the compilation of all source files.
131
132
133 CMAKE_COMMAND
134 The full path to the cmake executable.
135
136 This is the full path to the CMake executable cmake which is
137 useful from custom commands that want to use the cmake -E option
138 for portable system commands. (e.g. /usr/local/bin/cmake
139
140
141 CMAKE_CROSSCOMPILING
142 Is CMake currently cross compiling.
143
144 This variable will be set to true by CMake if CMake is cross
145 compiling. Specifically if the build platform is different from
146 the target platform.
147
148
149 CMAKE_CTEST_COMMAND
150 Full path to ctest command installed with cmake.
151
152 This is the full path to the CTest executable ctest which is
153 useful from custom commands that want to use the cmake -E option
154 for portable system commands.
155
156
157 CMAKE_CURRENT_BINARY_DIR
158 The path to the binary directory currently being processed.
159
160 This the full path to the build directory that is currently
161 being processed by cmake. Each directory added by add_subdirec‐
162 tory will create a binary directory in the build tree, and as it
163 is being processed this variable will be set. For in-source
164 builds this is the current source directory being processed.
165
166
167 CMAKE_CURRENT_LIST_DIR
168 Full directory of the listfile currently being processed.
169
170 As CMake processes the listfiles in your project this variable
171 will always be set to the directory where the listfile which is
172 currently being processed (CMAKE_CURRENT_LIST_FILE) is located.
173 The value has dynamic scope. When CMake starts processing com‐
174 mands in a source file it sets this variable to the directory
175 where this file is located. When CMake finishes processing com‐
176 mands from the file it restores the previous value. Therefore
177 the value of the variable inside a macro or function is the
178 directory of the file invoking the bottom-most entry on the call
179 stack, not the directory of the file containing the macro or
180 function definition.
181
182
183 See also CMAKE_CURRENT_LIST_FILE.
184
185
186 CMAKE_CURRENT_LIST_FILE
187 Full path to the listfile currently being processed.
188
189 As CMake processes the listfiles in your project this variable
190 will always be set to the one currently being processed. The
191 value has dynamic scope. When CMake starts processing commands
192 in a source file it sets this variable to the location of the
193 file. When CMake finishes processing commands from the file it
194 restores the previous value. Therefore the value of the vari‐
195 able inside a macro or function is the file invoking the bot‐
196 tom-most entry on the call stack, not the file containing the
197 macro or function definition.
198
199
200 See also CMAKE_PARENT_LIST_FILE.
201
202
203 CMAKE_CURRENT_LIST_LINE
204 The line number of the current file being processed.
205
206 This is the line number of the file currently being processed by
207 cmake.
208
209
210 CMAKE_CURRENT_SOURCE_DIR
211 The path to the source directory currently being processed.
212
213 This the full path to the source directory that is currently
214 being processed by cmake.
215
216
217 CMAKE_DL_LIBS
218 Name of library containing dlopen and dlcose.
219
220 The name of the library that has dlopen and dlclose in it, usu‐
221 ally -ldl on most UNIX machines.
222
223
224 CMAKE_EDIT_COMMAND
225 Full path to cmake-gui or ccmake.
226
227 This is the full path to the CMake executable that can graphi‐
228 cally edit the cache. For example, cmake-gui, ccmake, or cmake
229 -i.
230
231
232 CMAKE_EXECUTABLE_SUFFIX
233 The suffix for executables on this platform.
234
235 The suffix to use for the end of an executable filename if any,
236 .exe on Windows.
237
238
239 CMAKE_EXECUTABLE_SUFFIX_<LANG> overrides this for language
240 <LANG>.
241
242
243 CMAKE_EXTRA_GENERATOR
244 The extra generator used to build the project.
245
246 When using the Eclipse, CodeBlocks or KDevelop generators, CMake
247 generates Makefiles (CMAKE_GENERATOR) and additionally project
248 files for the respective IDE. This IDE project file generator is
249 stored in CMAKE_EXTRA_GENERATOR (e.g. "Eclipse CDT4").
250
251
252 CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES
253 Additional suffixes for shared libraries.
254
255 Extensions for shared libraries other than that specified by
256 CMAKE_SHARED_LIBRARY_SUFFIX, if any. CMake uses this to recog‐
257 nize external shared library files during analysis of libraries
258 linked by a target.
259
260
261 CMAKE_GENERATOR
262 The generator used to build the project.
263
264 The name of the generator that is being used to generate the
265 build files. (e.g. "Unix Makefiles", "Visual Studio 6", etc.)
266
267
268 CMAKE_GENERATOR_TOOLSET
269 Native build system toolset name specified by user.
270
271 Some CMake generators support a toolset name to be given to the
272 native build system to choose a compiler. If the user specifies
273 a toolset name (e.g. via the cmake -T option) the value will be
274 available in this variable.
275
276
277 CMAKE_HOME_DIRECTORY
278 Path to top of source tree.
279
280 This is the path to the top level of the source tree.
281
282
283 CMAKE_IMPORT_LIBRARY_PREFIX
284 The prefix for import libraries that you link to.
285
286 The prefix to use for the name of an import library if used on
287 this platform.
288
289
290 CMAKE_IMPORT_LIBRARY_PREFIX_<LANG> overrides this for language
291 <LANG>.
292
293
294 CMAKE_IMPORT_LIBRARY_SUFFIX
295 The suffix for import libraries that you link to.
296
297 The suffix to use for the end of an import library filename if
298 used on this platform.
299
300
301 CMAKE_IMPORT_LIBRARY_SUFFIX_<LANG> overrides this for language
302 <LANG>.
303
304
305 CMAKE_LINK_LIBRARY_SUFFIX
306 The suffix for libraries that you link to.
307
308 The suffix to use for the end of a library filename, .lib on
309 Windows.
310
311
312 CMAKE_MAJOR_VERSION
313 The Major version of cmake (i.e. the 2 in 2.X.X)
314
315 This specifies the major version of the CMake executable being
316 run.
317
318
319 CMAKE_MAKE_PROGRAM
320 See CMAKE_BUILD_TOOL.
321
322 This variable is around for backwards compatibility, see
323 CMAKE_BUILD_TOOL.
324
325
326 CMAKE_MINIMUM_REQUIRED_VERSION
327 Version specified to cmake_minimum_required command
328
329 Variable containing the VERSION component specified in the
330 cmake_minimum_required command.
331
332
333 CMAKE_MINOR_VERSION
334 The Minor version of cmake (i.e. the 4 in X.4.X).
335
336 This specifies the minor version of the CMake executable being
337 run.
338
339
340 CMAKE_PARENT_LIST_FILE
341 Full path to the CMake file that included the current one.
342
343 While processing a CMake file loaded by include() or find_pack‐
344 age() this variable contains the full path to the file including
345 it. The top of the include stack is always the CMakeLists.txt
346 for the current directory. See also CMAKE_CURRENT_LIST_FILE.
347
348
349 CMAKE_PATCH_VERSION
350 The patch version of cmake (i.e. the 3 in X.X.3).
351
352 This specifies the patch version of the CMake executable being
353 run.
354
355
356 CMAKE_PROJECT_NAME
357 The name of the current project.
358
359 This specifies name of the current project from the closest
360 inherited PROJECT command.
361
362
363 CMAKE_RANLIB
364 Name of randomizing tool for static libraries.
365
366 This specifies name of the program that randomizes libraries on
367 UNIX, not used on Windows, but may be present.
368
369
370 CMAKE_ROOT
371 Install directory for running cmake.
372
373 This is the install root for the running CMake and the Modules
374 directory can be found here. This is commonly used in this for‐
375 mat: ${CMAKE_ROOT}/Modules
376
377
378 CMAKE_SCRIPT_MODE_FILE
379 Full path to the -P script file currently being processed.
380
381 When run in -P script mode, CMake sets this variable to the full
382 path of the script file. When run to configure a CMakeLists.txt
383 file, this variable is not set.
384
385
386 CMAKE_SHARED_LIBRARY_PREFIX
387 The prefix for shared libraries that you link to.
388
389 The prefix to use for the name of a shared library, lib on UNIX.
390
391
392 CMAKE_SHARED_LIBRARY_PREFIX_<LANG> overrides this for language
393 <LANG>.
394
395
396 CMAKE_SHARED_LIBRARY_SUFFIX
397 The suffix for shared libraries that you link to.
398
399 The suffix to use for the end of a shared library filename, .dll
400 on Windows.
401
402
403 CMAKE_SHARED_LIBRARY_SUFFIX_<LANG> overrides this for language
404 <LANG>.
405
406
407 CMAKE_SHARED_MODULE_PREFIX
408 The prefix for loadable modules that you link to.
409
410 The prefix to use for the name of a loadable module on this
411 platform.
412
413
414 CMAKE_SHARED_MODULE_PREFIX_<LANG> overrides this for language
415 <LANG>.
416
417
418 CMAKE_SHARED_MODULE_SUFFIX
419 The suffix for shared libraries that you link to.
420
421 The suffix to use for the end of a loadable module filename on
422 this platform
423
424
425 CMAKE_SHARED_MODULE_SUFFIX_<LANG> overrides this for language
426 <LANG>.
427
428
429 CMAKE_SIZEOF_VOID_P
430 Size of a void pointer.
431
432 This is set to the size of a pointer on the machine, and is
433 determined by a try compile. If a 64 bit size is found, then the
434 library search path is modified to look for 64 bit libraries
435 first.
436
437
438 CMAKE_SKIP_RPATH
439 If true, do not add run time path information.
440
441 If this is set to TRUE, then the rpath information is not added
442 to compiled executables. The default is to add rpath informa‐
443 tion if the platform supports it. This allows for easy running
444 from the build tree. To omit RPATH in the install step, but not
445 the build step, use CMAKE_SKIP_INSTALL_RPATH instead.
446
447
448 CMAKE_SOURCE_DIR
449 The path to the top level of the source tree.
450
451 This is the full path to the top level of the current CMake
452 source tree. For an in-source build, this would be the same as
453 CMAKE_BINARY_DIR.
454
455
456 CMAKE_STANDARD_LIBRARIES
457 Libraries linked into every executable and shared library.
458
459 This is the list of libraries that are linked into all executa‐
460 bles and libraries.
461
462
463 CMAKE_STATIC_LIBRARY_PREFIX
464 The prefix for static libraries that you link to.
465
466 The prefix to use for the name of a static library, lib on UNIX.
467
468
469 CMAKE_STATIC_LIBRARY_PREFIX_<LANG> overrides this for language
470 <LANG>.
471
472
473 CMAKE_STATIC_LIBRARY_SUFFIX
474 The suffix for static libraries that you link to.
475
476 The suffix to use for the end of a static library filename, .lib
477 on Windows.
478
479
480 CMAKE_STATIC_LIBRARY_SUFFIX_<LANG> overrides this for language
481 <LANG>.
482
483
484 CMAKE_TWEAK_VERSION
485 The tweak version of cmake (i.e. the 1 in X.X.X.1).
486
487 This specifies the tweak version of the CMake executable being
488 run. Releases use tweak < 20000000 and development versions use
489 the date format CCYYMMDD for the tweak level.
490
491
492 CMAKE_VERBOSE_MAKEFILE
493 Create verbose makefiles if on.
494
495 This variable defaults to false. You can set this variable to
496 true to make CMake produce verbose makefiles that show each com‐
497 mand line as it is used.
498
499
500 CMAKE_VERSION
501 The full version of cmake in major.minor.patch[.tweak[-id]] for‐
502 mat.
503
504 This specifies the full version of the CMake executable being
505 run. This variable is defined by versions 2.6.3 and higher.
506 See variables CMAKE_MAJOR_VERSION, CMAKE_MINOR_VERSION,
507 CMAKE_PATCH_VERSION, and CMAKE_TWEAK_VERSION for individual ver‐
508 sion components. The [-id] component appears in non-release
509 versions and may be arbitrary text.
510
511
512 CMAKE_VS_PLATFORM_TOOLSET
513 Visual Studio Platform Toolset name.
514
515 VS 10 and above use MSBuild under the hood and support multiple
516 compiler toolchains. CMake may specify a toolset explicitly,
517 such as "v110" for VS 11 or "Windows7.1SDK" for 64-bit support
518 in VS 10 Express. CMake provides the name of the chosen toolset
519 in this variable.
520
521
522 CMAKE_XCODE_PLATFORM_TOOLSET
523 Xcode compiler selection.
524
525 Xcode supports selection of a compiler from one of the installed
526 toolsets. CMake provides the name of the chosen toolset in this
527 variable, if any is explicitly selected (e.g. via the cmake -T
528 option).
529
530
531 PROJECT_BINARY_DIR
532 Full path to build directory for project.
533
534 This is the binary directory of the most recent PROJECT command.
535
536
537 PROJECT_NAME
538 Name of the project given to the project command.
539
540 This is the name given to the most recent PROJECT command.
541
542
543 PROJECT_SOURCE_DIR
544 Top level source directory for the current project.
545
546 This is the source directory of the most recent PROJECT command.
547
548
549 [Project name]_BINARY_DIR
550 Top level binary directory for the named project.
551
552 A variable is created with the name used in the PROJECT command,
553 and is the binary directory for the project. This can be use‐
554 ful when SUBDIR is used to connect several projects.
555
556
557 [Project name]_SOURCE_DIR
558 Top level source directory for the named project.
559
560 A variable is created with the name used in the PROJECT command,
561 and is the source directory for the project. This can be use‐
562 ful when add_subdirectory is used to connect several projects.
563
564
566 BUILD_SHARED_LIBS
567 Global flag to cause add_library to create shared libraries if
568 on.
569
570 If present and true, this will cause all libraries to be built
571 shared unless the library was explicitly added as a static
572 library. This variable is often added to projects as an OPTION
573 so that each user of a project can decide if they want to build
574 the project using shared or static libraries.
575
576
577 CMAKE_ABSOLUTE_DESTINATION_FILES
578 List of files which have been installed using an ABSOLUTE DES‐
579 TINATION path.
580
581 This variable is defined by CMake-generated cmake_install.cmake
582 scripts. It can be used (read-only) by programs or scripts that
583 source those install scripts. This is used by some CPack genera‐
584 tors (e.g. RPM).
585
586
587 CMAKE_AUTOMOC_RELAXED_MODE
588 Switch between strict and relaxed automoc mode.
589
590 By default, automoc behaves exactly as described in the documen‐
591 tation of the AUTOMOC target property. When set to TRUE, it
592 accepts more input and tries to find the correct input file for
593 moc even if it differs from the documented behaviour. In this
594 mode it e.g. also checks whether a header file is intended to be
595 processed by moc when a "foo.moc" file has been included.
596
597
598 Relaxed mode has to be enabled for KDE4 compatibility.
599
600
601 CMAKE_BACKWARDS_COMPATIBILITY
602 Version of cmake required to build project
603
604 From the point of view of backwards compatibility, this speci‐
605 fies what version of CMake should be supported. By default this
606 value is the version number of CMake that you are running. You
607 can set this to an older version of CMake to support deprecated
608 commands of CMake in projects that were written to use older
609 versions of CMake. This can be set by the user or set at the
610 beginning of a CMakeLists file.
611
612
613 CMAKE_BUILD_TYPE
614 Specifies the build type on single-configuration generators.
615
616 This statically specifies what build type (configuration) will
617 be built in this build tree. Possible values are empty, Debug,
618 Release, RelWithDebInfo and MinSizeRel. This variable is only
619 meaningful to single-configuration generators (such as make and
620 Ninja) i.e. those which choose a single configuration when CMake
621 runs to generate a build tree as opposed to multi-configuration
622 generators which offer selection of the build configuration
623 within the generated build environment. There are many per-con‐
624 fig properties and variables (usually following clean
625 SOME_VAR_<CONFIG> order conventions), such as
626 CMAKE_C_FLAGS_<CONFIG>, specified as uppercase:
627 CMAKE_C_FLAGS_[DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL]. For
628 example, in a build tree configured to build type Debug, CMake
629 will see to having CMAKE_C_FLAGS_DEBUG settings get added to the
630 CMAKE_C_FLAGS settings. See also CMAKE_CONFIGURATION_TYPES.
631
632
633 CMAKE_COLOR_MAKEFILE
634 Enables color output when using the Makefile generator.
635
636 When enabled, the generated Makefiles will produce colored out‐
637 put. Default is ON.
638
639
640 CMAKE_CONFIGURATION_TYPES
641 Specifies the available build types on multi-config generators.
642
643 This specifies what build types (configurations) will be avail‐
644 able such as Debug, Release, RelWithDebInfo etc. This has rea‐
645 sonable defaults on most platforms, but can be extended to pro‐
646 vide other build types. See also CMAKE_BUILD_TYPE for details
647 of managing configuration data, and CMAKE_CFG_INTDIR.
648
649
650 CMAKE_DEBUG_TARGET_PROPERTIES
651 Enables tracing output for target properties.
652
653 This variable can be populated with a list of properties to gen‐
654 erate debug output for when evaluating target properties. Cur‐
655 rently it can only be used when evaluating the INCLUDE_DIRECTO‐
656 RIES, COMPILE_DEFINITIONS and COMPILE_OPTIONS target properties.
657 In that case, it outputs a backtrace for each entry in the tar‐
658 get property. Default is unset.
659
660
661 CMAKE_DISABLE_FIND_PACKAGE_<PackageName>
662 Variable for disabling find_package() calls.
663
664 Every non-REQUIRED find_package() call in a project can be dis‐
665 abled by setting the variable CMAKE_DISABLE_FIND_PACKAGE_<Packa‐
666 geName> to TRUE. This can be used to build a project without an
667 optional package, although that package is installed.
668
669
670 This switch should be used during the initial CMake run. Other‐
671 wise if the package has already been found in a previous CMake
672 run, the variables which have been stored in the cache will
673 still be there. In that case it is recommended to remove the
674 cache variables for this package from the cache using the cache
675 editor or cmake -U
676
677
678 CMAKE_ERROR_DEPRECATED
679 Whether to issue deprecation errors for macros and functions.
680
681 If TRUE, this can be used by macros and functions to issue fatal
682 errors when deprecated macros or functions are used. This vari‐
683 able is FALSE by default.
684
685
686 CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION
687 Ask cmake_install.cmake script to error out as soon as a file
688 with absolute INSTALL DESTINATION is encountered.
689
690 The fatal error is emitted before the installation of the
691 offending file takes place. This variable is used by CMake-gen‐
692 erated cmake_install.cmake scripts. If one sets this variable to
693 ON while running the script, it may get fatal error messages
694 from the script.
695
696
697 CMAKE_FIND_LIBRARY_PREFIXES
698 Prefixes to prepend when looking for libraries.
699
700 This specifies what prefixes to add to library names when the
701 find_library command looks for libraries. On UNIX systems this
702 is typically lib, meaning that when trying to find the foo
703 library it will look for libfoo.
704
705
706 CMAKE_FIND_LIBRARY_SUFFIXES
707 Suffixes to append when looking for libraries.
708
709 This specifies what suffixes to add to library names when the
710 find_library command looks for libraries. On Windows systems
711 this is typically .lib and .dll, meaning that when trying to
712 find the foo library it will look for foo.dll etc.
713
714
715 CMAKE_FIND_PACKAGE_WARN_NO_MODULE
716 Tell find_package to warn if called without an explicit mode.
717
718 If find_package is called without an explicit mode option (MOD‐
719 ULE, CONFIG or NO_MODULE) and no Find<pkg>.cmake module is in
720 CMAKE_MODULE_PATH then CMake implicitly assumes that the caller
721 intends to search for a package configuration file. If no pack‐
722 age configuration file is found then the wording of the failure
723 message must account for both the case that the package is
724 really missing and the case that the project has a bug and
725 failed to provide the intended Find module. If instead the
726 caller specifies an explicit mode option then the failure mes‐
727 sage can be more specific.
728
729
730 Set CMAKE_FIND_PACKAGE_WARN_NO_MODULE to TRUE to tell find_pack‐
731 age to warn when it implicitly assumes Config mode. This helps
732 developers enforce use of an explicit mode in all calls to
733 find_package within a project.
734
735
736 CMAKE_IGNORE_PATH
737 Path to be ignored by FIND_XXX() commands.
738
739 Specifies directories to be ignored by searches in FIND_XXX()
740 commands. This is useful in cross-compiled environments where
741 some system directories contain incompatible but possibly link‐
742 able libraries. For example, on cross-compiled cluster environ‐
743 ments, this allows a user to ignore directories containing
744 libraries meant for the front-end machine that modules like
745 FindX11 (and others) would normally search. By default this is
746 empty; it is intended to be set by the project. Note that
747 CMAKE_IGNORE_PATH takes a list of directory names, NOT a list of
748 prefixes. If you want to ignore paths under prefixes (bin,
749 include, lib, etc.), you'll need to specify them explicitly.
750 See also CMAKE_PREFIX_PATH, CMAKE_LIBRARY_PATH,
751 CMAKE_INCLUDE_PATH, CMAKE_PROGRAM_PATH.
752
753
754 CMAKE_INCLUDE_PATH
755 Path used for searching by FIND_FILE() and FIND_PATH().
756
757 Specifies a path which will be used both by FIND_FILE() and
758 FIND_PATH(). Both commands will check each of the contained
759 directories for the existence of the file which is currently
760 searched. By default it is empty, it is intended to be set by
761 the project. See also CMAKE_SYSTEM_INCLUDE_PATH, CMAKE_PRE‐
762 FIX_PATH.
763
764
765 CMAKE_INSTALL_DEFAULT_COMPONENT_NAME
766 Default component used in install() commands.
767
768 If an install() command is used without the COMPONENT argument,
769 these files will be grouped into a default component. The name
770 of this default install component will be taken from this vari‐
771 able. It defaults to "Unspecified".
772
773
774 CMAKE_INSTALL_PREFIX
775 Install directory used by install.
776
777 If "make install" is invoked or INSTALL is built, this directory
778 is prepended onto all install directories. This variable
779 defaults to /usr/local on UNIX and c:/Program Files on Windows.
780
781
782 On UNIX one can use the DESTDIR mechanism in order to relocate
783 the whole installation. DESTDIR means DESTination DIRectory. It
784 is commonly used by makefile users in order to install software
785 at non-default location. It is usually invoked like this:
786
787
788 make DESTDIR=/home/john install
789
790 which will install the concerned software using the installation
791 prefix, e.g. "/usr/local" prepended with the DESTDIR value which
792 finally gives "/home/john/usr/local".
793
794
795 WARNING: DESTDIR may not be used on Windows because installation
796 prefix usually contains a drive letter like in "C:/Program
797 Files" which cannot be prepended with some other prefix.
798
799
800 The installation prefix is also added to CMAKE_SYSTEM_PRE‐
801 FIX_PATH so that find_package, find_program, find_library,
802 find_path, and find_file will search the prefix for other soft‐
803 ware.
804
805
806 CMAKE_LIBRARY_PATH
807 Path used for searching by FIND_LIBRARY().
808
809 Specifies a path which will be used by FIND_LIBRARY().
810 FIND_LIBRARY() will check each of the contained directories for
811 the existence of the library which is currently searched. By
812 default it is empty, it is intended to be set by the project.
813 See also CMAKE_SYSTEM_LIBRARY_PATH, CMAKE_PREFIX_PATH.
814
815
816 CMAKE_MFC_FLAG
817 Tell cmake to use MFC for an executable or dll.
818
819 This can be set in a CMakeLists.txt file and will enable MFC in
820 the application. It should be set to 1 for the static MFC
821 library, and 2 for the shared MFC library. This is used in Vis‐
822 ual Studio 6 and 7 project files. The CMakeSetup dialog used
823 MFC and the CMakeLists.txt looks like this:
824
825
826 add_definitions(-D_AFXDLL)
827 set(CMAKE_MFC_FLAG 2)
828 add_executable(CMakeSetup WIN32 ${SRCS})
829
830
831 CMAKE_MODULE_PATH
832 List of directories to search for CMake modules.
833
834 Commands like include() and find_package() search for files in
835 directories listed by this variable before checking the default
836 modules that come with CMake.
837
838
839 CMAKE_NOT_USING_CONFIG_FLAGS
840 Skip _BUILD_TYPE flags if true.
841
842 This is an internal flag used by the generators in CMake to tell
843 CMake to skip the _BUILD_TYPE flags.
844
845
846 CMAKE_POLICY_DEFAULT_CMP<NNNN>
847 Default for CMake Policy CMP<NNNN> when it is otherwise left
848 unset.
849
850 Commands cmake_minimum_required(VERSION) and cmake_policy(VER‐
851 SION) by default leave policies introduced after the given ver‐
852 sion unset. Set CMAKE_POLICY_DEFAULT_CMP<NNNN> to OLD or NEW to
853 specify the default for policy CMP<NNNN>, where <NNNN> is the
854 policy number.
855
856
857 This variable should not be set by a project in CMake code; use
858 cmake_policy(SET) instead. Users running CMake may set this
859 variable in the cache (e.g. -DCMAKE_POL‐
860 ICY_DEFAULT_CMP<NNNN>=<OLD|NEW>) to set a policy not otherwise
861 set by the project. Set to OLD to quiet a policy warning while
862 using old behavior or to NEW to try building the project with
863 new behavior.
864
865
866 CMAKE_PREFIX_PATH
867 Path used for searching by FIND_XXX(), with appropriate suffixes
868 added.
869
870 Specifies a path which will be used by the FIND_XXX() commands.
871 It contains the "base" directories, the FIND_XXX() commands
872 append appropriate subdirectories to the base directories. So
873 FIND_PROGRAM() adds /bin to each of the directories in the path,
874 FIND_LIBRARY() appends /lib to each of the directories, and
875 FIND_PATH() and FIND_FILE() append /include . By default it is
876 empty, it is intended to be set by the project. See also
877 CMAKE_SYSTEM_PREFIX_PATH, CMAKE_INCLUDE_PATH,
878 CMAKE_LIBRARY_PATH, CMAKE_PROGRAM_PATH.
879
880
881 CMAKE_PROGRAM_PATH
882 Path used for searching by FIND_PROGRAM().
883
884 Specifies a path which will be used by FIND_PROGRAM(). FIND_PRO‐
885 GRAM() will check each of the contained directories for the
886 existence of the program which is currently searched. By default
887 it is empty, it is intended to be set by the project. See also
888 CMAKE_SYSTEM_PROGRAM_PATH, CMAKE_PREFIX_PATH.
889
890
891 CMAKE_SKIP_INSTALL_ALL_DEPENDENCY
892 Don't make the install target depend on the all target.
893
894 By default, the "install" target depends on the "all" target.
895 This has the effect, that when "make install" is invoked or
896 INSTALL is built, first the "all" target is built, then the
897 installation starts. If CMAKE_SKIP_INSTALL_ALL_DEPENDENCY is
898 set to TRUE, this dependency is not created, so the installation
899 process will start immediately, independent from whether the
900 project has been completely built or not.
901
902
903 CMAKE_SYSTEM_IGNORE_PATH
904 Path to be ignored by FIND_XXX() commands.
905
906 Specifies directories to be ignored by searches in FIND_XXX()
907 commands. This is useful in cross-compiled environments where
908 some system directories contain incompatible but possibly link‐
909 able libraries. For example, on cross-compiled cluster environ‐
910 ments, this allows a user to ignore directories containing
911 libraries meant for the front-end machine that modules like
912 FindX11 (and others) would normally search. By default this
913 contains a list of directories containing incompatible binaries
914 for the host system. See also CMAKE_SYSTEM_PREFIX_PATH,
915 CMAKE_SYSTEM_LIBRARY_PATH, CMAKE_SYSTEM_INCLUDE_PATH, and
916 CMAKE_SYSTEM_PROGRAM_PATH.
917
918
919 CMAKE_SYSTEM_INCLUDE_PATH
920 Path used for searching by FIND_FILE() and FIND_PATH().
921
922 Specifies a path which will be used both by FIND_FILE() and
923 FIND_PATH(). Both commands will check each of the contained
924 directories for the existence of the file which is currently
925 searched. By default it contains the standard directories for
926 the current system. It is NOT intended to be modified by the
927 project, use CMAKE_INCLUDE_PATH for this. See also CMAKE_SYS‐
928 TEM_PREFIX_PATH.
929
930
931 CMAKE_SYSTEM_LIBRARY_PATH
932 Path used for searching by FIND_LIBRARY().
933
934 Specifies a path which will be used by FIND_LIBRARY().
935 FIND_LIBRARY() will check each of the contained directories for
936 the existence of the library which is currently searched. By
937 default it contains the standard directories for the current
938 system. It is NOT intended to be modified by the project, use
939 CMAKE_LIBRARY_PATH for this. See also CMAKE_SYSTEM_PREFIX_PATH.
940
941
942 CMAKE_SYSTEM_PREFIX_PATH
943 Path used for searching by FIND_XXX(), with appropriate suffixes
944 added.
945
946 Specifies a path which will be used by the FIND_XXX() commands.
947 It contains the "base" directories, the FIND_XXX() commands
948 append appropriate subdirectories to the base directories. So
949 FIND_PROGRAM() adds /bin to each of the directories in the path,
950 FIND_LIBRARY() appends /lib to each of the directories, and
951 FIND_PATH() and FIND_FILE() append /include . By default this
952 contains the standard directories for the current system and the
953 CMAKE_INSTALL_PREFIX. It is NOT intended to be modified by the
954 project, use CMAKE_PREFIX_PATH for this. See also CMAKE_SYS‐
955 TEM_INCLUDE_PATH, CMAKE_SYSTEM_LIBRARY_PATH, CMAKE_SYSTEM_PRO‐
956 GRAM_PATH, and CMAKE_SYSTEM_IGNORE_PATH.
957
958
959 CMAKE_SYSTEM_PROGRAM_PATH
960 Path used for searching by FIND_PROGRAM().
961
962 Specifies a path which will be used by FIND_PROGRAM(). FIND_PRO‐
963 GRAM() will check each of the contained directories for the
964 existence of the program which is currently searched. By default
965 it contains the standard directories for the current system. It
966 is NOT intended to be modified by the project, use CMAKE_PRO‐
967 GRAM_PATH for this. See also CMAKE_SYSTEM_PREFIX_PATH.
968
969
970 CMAKE_USER_MAKE_RULES_OVERRIDE
971 Specify a CMake file that overrides platform information.
972
973 CMake loads the specified file while enabling support for each
974 language from either the project() or enable_language() com‐
975 mands. It is loaded after CMake's builtin compiler and platform
976 information modules have been loaded but before the information
977 is used. The file may set platform information variables to
978 override CMake's defaults.
979
980
981 This feature is intended for use only in overriding information
982 variables that must be set before CMake builds its first test
983 project to check that the compiler for a language works. It
984 should not be used to load a file in cases that a normal
985 include() will work. Use it only as a last resort for behavior
986 that cannot be achieved any other way. For example, one may set
987 CMAKE_C_FLAGS_INIT to change the default value used to initial‐
988 ize CMAKE_C_FLAGS before it is cached. The override file should
989 NOT be used to set anything that could be set after languages
990 are enabled, such as variables like CMAKE_RUNTIME_OUTPUT_DIREC‐
991 TORY that affect the placement of binaries. Information set in
992 the file will be used for try_compile and try_run builds too.
993
994
995 CMAKE_WARN_DEPRECATED
996 Whether to issue deprecation warnings for macros and functions.
997
998 If TRUE, this can be used by macros and functions to issue dep‐
999 recation warnings. This variable is FALSE by default.
1000
1001
1002 CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION
1003 Ask cmake_install.cmake script to warn each time a file with
1004 absolute INSTALL DESTINATION is encountered.
1005
1006 This variable is used by CMake-generated cmake_install.cmake
1007 scripts. If one sets this variable to ON while running the
1008 script, it may get warning messages from the script.
1009
1010
1012 APPLE True if running on Mac OS X.
1013
1014 Set to true on Mac OS X.
1015
1016
1017 BORLAND
1018 True if the Borland compiler is being used.
1019
1020 This is set to true if the Borland compiler is being used.
1021
1022
1023 CMAKE_CL_64
1024 Using the 64 bit compiler from Microsoft
1025
1026 Set to true when using the 64 bit cl compiler from Microsoft.
1027
1028
1029 CMAKE_COMPILER_2005
1030 Using the Visual Studio 2005 compiler from Microsoft
1031
1032 Set to true when using the Visual Studio 2005 compiler from Mi‐
1033 crosoft.
1034
1035
1036 CMAKE_HOST_APPLE
1037 True for Apple OS X operating systems.
1038
1039 Set to true when the host system is Apple OS X.
1040
1041
1042 CMAKE_HOST_SYSTEM
1043 Name of system cmake is being run on.
1044
1045 The same as CMAKE_SYSTEM but for the host system instead of the
1046 target system when cross compiling.
1047
1048
1049 CMAKE_HOST_SYSTEM_NAME
1050 Name of the OS CMake is running on.
1051
1052 The same as CMAKE_SYSTEM_NAME but for the host system instead of
1053 the target system when cross compiling.
1054
1055
1056 CMAKE_HOST_SYSTEM_PROCESSOR
1057 The name of the CPU CMake is running on.
1058
1059 The same as CMAKE_SYSTEM_PROCESSOR but for the host system
1060 instead of the target system when cross compiling.
1061
1062
1063 CMAKE_HOST_SYSTEM_VERSION
1064 OS version CMake is running on.
1065
1066 The same as CMAKE_SYSTEM_VERSION but for the host system instead
1067 of the target system when cross compiling.
1068
1069
1070 CMAKE_HOST_UNIX
1071 True for UNIX and UNIX like operating systems.
1072
1073 Set to true when the host system is UNIX or UNIX like (i.e.
1074 APPLE and CYGWIN).
1075
1076
1077 CMAKE_HOST_WIN32
1078 True on windows systems, including win64.
1079
1080 Set to true when the host system is Windows and on Cygwin.
1081
1082
1083 CMAKE_LIBRARY_ARCHITECTURE
1084 Target architecture library directory name, if detected.
1085
1086 This is the value of CMAKE_<lang>_LIBRARY_ARCHITECTURE as
1087 detected for one of the enabled languages.
1088
1089
1090 CMAKE_LIBRARY_ARCHITECTURE_REGEX
1091 Regex matching possible target architecture library directory
1092 names.
1093
1094 This is used to detect CMAKE_<lang>_LIBRARY_ARCHITECTURE from
1095 the implicit linker search path by matching the <arch> name.
1096
1097
1098 CMAKE_OBJECT_PATH_MAX
1099 Maximum object file full-path length allowed by native build
1100 tools.
1101
1102 CMake computes for every source file an object file name that is
1103 unique to the source file and deterministic with respect to the
1104 full path to the source file. This allows multiple source files
1105 in a target to share the same name if they lie in different
1106 directories without rebuilding when one is added or removed.
1107 However, it can produce long full paths in a few cases, so CMake
1108 shortens the path using a hashing scheme when the full path to
1109 an object file exceeds a limit. CMake has a built-in limit for
1110 each platform that is sufficient for common tools, but some
1111 native tools may have a lower limit. This variable may be set
1112 to specify the limit explicitly. The value must be an integer
1113 no less than 128.
1114
1115
1116 CMAKE_SYSTEM
1117 Name of system cmake is compiling for.
1118
1119 This variable is the composite of CMAKE_SYSTEM_NAME and
1120 CMAKE_SYSTEM_VERSION, like this ${CMAKE_SYS‐
1121 TEM_NAME}-${CMAKE_SYSTEM_VERSION}. If CMAKE_SYSTEM_VERSION is
1122 not set, then CMAKE_SYSTEM is the same as CMAKE_SYSTEM_NAME.
1123
1124
1125 CMAKE_SYSTEM_NAME
1126 Name of the OS CMake is building for.
1127
1128 This is the name of the operating system on which CMake is tar‐
1129 geting. On systems that have the uname command, this variable
1130 is set to the output of uname -s. Linux, Windows, and Darwin
1131 for Mac OS X are the values found on the big three operating
1132 systems.
1133
1134
1135 CMAKE_SYSTEM_PROCESSOR
1136 The name of the CPU CMake is building for.
1137
1138 On systems that support uname, this variable is set to the out‐
1139 put of uname -p, on windows it is set to the value of the envi‐
1140 ronment variable PROCESSOR_ARCHITECTURE
1141
1142
1143 CMAKE_SYSTEM_VERSION
1144 OS version CMake is building for.
1145
1146 A numeric version string for the system, on systems that support
1147 uname, this variable is set to the output of uname -r. On other
1148 systems this is set to major-minor version numbers.
1149
1150
1151 CYGWIN True for Cygwin.
1152
1153 Set to true when using Cygwin.
1154
1155
1156 ENV Access environment variables.
1157
1158 Use the syntax $ENV{VAR} to read environment variable VAR. See
1159 also the set() command to set ENV{VAR}.
1160
1161
1162 MSVC True when using Microsoft Visual C
1163
1164 Set to true when the compiler is some version of Microsoft Vis‐
1165 ual C.
1166
1167
1168 MSVC10 True when using Microsoft Visual C 10.0
1169
1170 Set to true when the compiler is version 10.0 of Microsoft Vis‐
1171 ual C.
1172
1173
1174 MSVC11 True when using Microsoft Visual C 11.0
1175
1176 Set to true when the compiler is version 11.0 of Microsoft Vis‐
1177 ual C.
1178
1179
1180 MSVC12 True when using Microsoft Visual C 12.0
1181
1182 Set to true when the compiler is version 12.0 of Microsoft Vis‐
1183 ual C.
1184
1185
1186 MSVC60 True when using Microsoft Visual C 6.0
1187
1188 Set to true when the compiler is version 6.0 of Microsoft Visual
1189 C.
1190
1191
1192 MSVC70 True when using Microsoft Visual C 7.0
1193
1194 Set to true when the compiler is version 7.0 of Microsoft Visual
1195 C.
1196
1197
1198 MSVC71 True when using Microsoft Visual C 7.1
1199
1200 Set to true when the compiler is version 7.1 of Microsoft Visual
1201 C.
1202
1203
1204 MSVC80 True when using Microsoft Visual C 8.0
1205
1206 Set to true when the compiler is version 8.0 of Microsoft Visual
1207 C.
1208
1209
1210 MSVC90 True when using Microsoft Visual C 9.0
1211
1212 Set to true when the compiler is version 9.0 of Microsoft Visual
1213 C.
1214
1215
1216 MSVC_IDE
1217 True when using the Microsoft Visual C IDE
1218
1219 Set to true when the target platform is the Microsoft Visual C
1220 IDE, as opposed to the command line compiler.
1221
1222
1223 MSVC_VERSION
1224 The version of Microsoft Visual C/C++ being used if any.
1225
1226 Known version numbers are:
1227
1228
1229 1200 = VS 6.0
1230 1300 = VS 7.0
1231 1310 = VS 7.1
1232 1400 = VS 8.0
1233 1500 = VS 9.0
1234 1600 = VS 10.0
1235 1700 = VS 11.0
1236 1800 = VS 12.0
1237
1238
1239 UNIX True for UNIX and UNIX like operating systems.
1240
1241 Set to true when the target system is UNIX or UNIX like (i.e.
1242 APPLE and CYGWIN).
1243
1244
1245 WIN32 True on windows systems, including win64.
1246
1247 Set to true when the target system is Windows.
1248
1249
1250 XCODE_VERSION
1251 Version of Xcode (Xcode generator only).
1252
1253 Under the Xcode generator, this is the version of Xcode as spec‐
1254 ified in "Xcode.app/Contents/version.plist" (such as "3.1.2").
1255
1256
1258 CMAKE_<CONFIG>_POSTFIX
1259 Default filename postfix for libraries under configuration <CON‐
1260 FIG>.
1261
1262 When a non-executable target is created its <CONFIG>_POSTFIX
1263 target property is initialized with the value of this variable
1264 if it is set.
1265
1266
1267 CMAKE_<LANG>_VISIBILITY_PRESET
1268 Default value for <LANG>_VISIBILITY_PRESET of targets.
1269
1270 This variable is used to initialize the <LANG>_VISIBILITY_PRESET
1271 property on all the targets. See that target property for addi‐
1272 tional information.
1273
1274
1275 CMAKE_ARCHIVE_OUTPUT_DIRECTORY
1276 Where to put all the ARCHIVE targets when built.
1277
1278 This variable is used to initialize the ARCHIVE_OUTPUT_DIRECTORY
1279 property on all the targets. See that target property for addi‐
1280 tional information.
1281
1282
1283 CMAKE_AUTOMOC
1284 Whether to handle moc automatically for Qt targets.
1285
1286 This variable is used to initialize the AUTOMOC property on all
1287 the targets. See that target property for additional informa‐
1288 tion.
1289
1290
1291 CMAKE_AUTOMOC_MOC_OPTIONS
1292 Additional options for moc when using automoc (see CMAKE_AUTO‐
1293 MOC).
1294
1295 This variable is used to initialize the AUTOMOC_MOC_OPTIONS
1296 property on all the targets. See that target property for addi‐
1297 tional information.
1298
1299
1300 CMAKE_BUILD_WITH_INSTALL_RPATH
1301 Use the install path for the RPATH
1302
1303 Normally CMake uses the build tree for the RPATH when building
1304 executables etc on systems that use RPATH. When the software is
1305 installed the executables etc are relinked by CMake to have the
1306 install RPATH. If this variable is set to true then the software
1307 is always built with the install path for the RPATH and does not
1308 need to be relinked when installed.
1309
1310
1311 CMAKE_DEBUG_POSTFIX
1312 See variable CMAKE_<CONFIG>_POSTFIX.
1313
1314 This variable is a special case of the more-general CMAKE_<CON‐
1315 FIG>_POSTFIX variable for the DEBUG configuration.
1316
1317
1318 CMAKE_EXE_LINKER_FLAGS
1319 Linker flags to be used to create executables.
1320
1321 These flags will be used by the linker when creating an exe‐
1322 cutable.
1323
1324
1325 CMAKE_EXE_LINKER_FLAGS_<CONFIG>
1326 Flags to be used when linking an executable.
1327
1328 Same as CMAKE_C_FLAGS_* but used by the linker when creating
1329 executables.
1330
1331
1332 CMAKE_Fortran_FORMAT
1333 Set to FIXED or FREE to indicate the Fortran source layout.
1334
1335 This variable is used to initialize the Fortran_FORMAT property
1336 on all the targets. See that target property for additional
1337 information.
1338
1339
1340 CMAKE_Fortran_MODULE_DIRECTORY
1341 Fortran module output directory.
1342
1343 This variable is used to initialize the Fortran_MODULE_DIRECTORY
1344 property on all the targets. See that target property for addi‐
1345 tional information.
1346
1347
1348 CMAKE_GNUtoMS
1349 Convert GNU import libraries (.dll.a) to MS format (.lib).
1350
1351 This variable is used to initialize the GNUtoMS property on tar‐
1352 gets when they are created. See that target property for addi‐
1353 tional information.
1354
1355
1356 CMAKE_INCLUDE_CURRENT_DIR
1357 Automatically add the current source- and build directories to
1358 the include path.
1359
1360 If this variable is enabled, CMake automatically adds in each
1361 directory ${CMAKE_CURRENT_SOURCE_DIR} and ${CMAKE_CUR‐
1362 RENT_BINARY_DIR} to the include path for this directory. These
1363 additional include directories do not propagate down to subdi‐
1364 rectories. This is useful mainly for out-of-source builds, where
1365 files generated into the build tree are included by files
1366 located in the source tree.
1367
1368
1369 By default CMAKE_INCLUDE_CURRENT_DIR is OFF.
1370
1371
1372 CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE
1373 Automatically add the current source- and build directories to
1374 the INTERFACE_INCLUDE_DIRECTORIES.
1375
1376 If this variable is enabled, CMake automatically adds for each
1377 shared library target, static library target, module target and
1378 executable target, ${CMAKE_CURRENT_SOURCE_DIR} and ${CMAKE_CUR‐
1379 RENT_BINARY_DIR} to the INTERFACE_INCLUDE_DIRECTORIES.By default
1380 CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE is OFF.
1381
1382
1383 CMAKE_INSTALL_NAME_DIR
1384 Mac OS X directory name for installed targets.
1385
1386 CMAKE_INSTALL_NAME_DIR is used to initialize the
1387 INSTALL_NAME_DIR property on all targets. See that target prop‐
1388 erty for more information.
1389
1390
1391 CMAKE_INSTALL_RPATH
1392 The rpath to use for installed targets.
1393
1394 A semicolon-separated list specifying the rpath to use in
1395 installed targets (for platforms that support it). This is used
1396 to initialize the target property INSTALL_RPATH for all targets.
1397
1398
1399 CMAKE_INSTALL_RPATH_USE_LINK_PATH
1400 Add paths to linker search and installed rpath.
1401
1402 CMAKE_INSTALL_RPATH_USE_LINK_PATH is a boolean that if set to
1403 true will append directories in the linker search path and out‐
1404 side the project to the INSTALL_RPATH. This is used to initial‐
1405 ize the target property INSTALL_RPATH_USE_LINK_PATH for all tar‐
1406 gets.
1407
1408
1409 CMAKE_LIBRARY_OUTPUT_DIRECTORY
1410 Where to put all the LIBRARY targets when built.
1411
1412 This variable is used to initialize the LIBRARY_OUTPUT_DIRECTORY
1413 property on all the targets. See that target property for addi‐
1414 tional information.
1415
1416
1417 CMAKE_LIBRARY_PATH_FLAG
1418 The flag to be used to add a library search path to a compiler.
1419
1420 The flag will be used to specify a library directory to the com‐
1421 piler. On most compilers this is "-L".
1422
1423
1424 CMAKE_LINK_DEF_FILE_FLAG
1425 Linker flag to be used to specify a .def file for dll creation.
1426
1427 The flag will be used to add a .def file when creating a dll on
1428 Windows; this is only defined on Windows.
1429
1430
1431 CMAKE_LINK_DEPENDS_NO_SHARED
1432 Whether to skip link dependencies on shared library files.
1433
1434 This variable initializes the LINK_DEPENDS_NO_SHARED property on
1435 targets when they are created. See that target property for
1436 additional information.
1437
1438
1439 CMAKE_LINK_INTERFACE_LIBRARIES
1440 Default value for LINK_INTERFACE_LIBRARIES of targets.
1441
1442 This variable is used to initialize the LINK_INTERFACE_LIBRARIES
1443 property on all the targets. See that target property for addi‐
1444 tional information.
1445
1446
1447 CMAKE_LINK_LIBRARY_FILE_FLAG
1448 Flag to be used to link a library specified by a path to its
1449 file.
1450
1451 The flag will be used before a library file path is given to the
1452 linker. This is needed only on very few platforms.
1453
1454
1455 CMAKE_LINK_LIBRARY_FLAG
1456 Flag to be used to link a library into an executable.
1457
1458 The flag will be used to specify a library to link to an exe‐
1459 cutable. On most compilers this is "-l".
1460
1461
1462 CMAKE_MACOSX_BUNDLE
1463 Default value for MACOSX_BUNDLE of targets.
1464
1465 This variable is used to initialize the MACOSX_BUNDLE property
1466 on all the targets. See that target property for additional
1467 information.
1468
1469
1470 CMAKE_MODULE_LINKER_FLAGS
1471 Linker flags to be used to create modules.
1472
1473 These flags will be used by the linker when creating a module.
1474
1475
1476 CMAKE_MODULE_LINKER_FLAGS_<CONFIG>
1477 Flags to be used when linking a module.
1478
1479 Same as CMAKE_C_FLAGS_* but used by the linker when creating
1480 modules.
1481
1482
1483 CMAKE_NO_BUILTIN_CHRPATH
1484 Do not use the builtin ELF editor to fix RPATHs on installation.
1485
1486 When an ELF binary needs to have a different RPATH after instal‐
1487 lation than it does in the build tree, CMake uses a builtin edi‐
1488 tor to change the RPATH in the installed copy. If this variable
1489 is set to true then CMake will relink the binary before instal‐
1490 lation instead of using its builtin editor.
1491
1492
1493 CMAKE_PDB_OUTPUT_DIRECTORY
1494 Where to put all the MS debug symbol files from linker.
1495
1496 This variable is used to initialize the PDB_OUTPUT_DIRECTORY
1497 property on all the targets. See that target property for addi‐
1498 tional information.
1499
1500
1501 CMAKE_POSITION_INDEPENDENT_CODE
1502 Default value for POSITION_INDEPENDENT_CODE of targets.
1503
1504 This variable is used to initialize the POSITION_INDEPEN‐
1505 DENT_CODE property on all the targets. See that target property
1506 for additional information.
1507
1508
1509 CMAKE_RUNTIME_OUTPUT_DIRECTORY
1510 Where to put all the RUNTIME targets when built.
1511
1512 This variable is used to initialize the RUNTIME_OUTPUT_DIRECTORY
1513 property on all the targets. See that target property for addi‐
1514 tional information.
1515
1516
1517 CMAKE_SHARED_LINKER_FLAGS
1518 Linker flags to be used to create shared libraries.
1519
1520 These flags will be used by the linker when creating a shared
1521 library.
1522
1523
1524 CMAKE_SHARED_LINKER_FLAGS_<CONFIG>
1525 Flags to be used when linking a shared library.
1526
1527 Same as CMAKE_C_FLAGS_* but used by the linker when creating
1528 shared libraries.
1529
1530
1531 CMAKE_SKIP_BUILD_RPATH
1532 Do not include RPATHs in the build tree.
1533
1534 Normally CMake uses the build tree for the RPATH when building
1535 executables etc on systems that use RPATH. When the software is
1536 installed the executables etc are relinked by CMake to have the
1537 install RPATH. If this variable is set to true then the software
1538 is always built with no RPATH.
1539
1540
1541 CMAKE_SKIP_INSTALL_RPATH
1542 Do not include RPATHs in the install tree.
1543
1544 Normally CMake uses the build tree for the RPATH when building
1545 executables etc on systems that use RPATH. When the software is
1546 installed the executables etc are relinked by CMake to have the
1547 install RPATH. If this variable is set to true then the software
1548 is always installed without RPATH, even if RPATH is enabled when
1549 building. This can be useful for example to allow running tests
1550 from the build directory with RPATH enabled before the installa‐
1551 tion step. To omit RPATH in both the build and install steps,
1552 use CMAKE_SKIP_RPATH instead.
1553
1554
1555 CMAKE_STATIC_LINKER_FLAGS
1556 Linker flags to be used to create static libraries.
1557
1558 These flags will be used by the linker when creating a static
1559 library.
1560
1561
1562 CMAKE_STATIC_LINKER_FLAGS_<CONFIG>
1563 Flags to be used when linking a static library.
1564
1565 Same as CMAKE_C_FLAGS_* but used by the linker when creating
1566 static libraries.
1567
1568
1569 CMAKE_TRY_COMPILE_CONFIGURATION
1570 Build configuration used for try_compile and try_run projects.
1571
1572 Projects built by try_compile and try_run are built syn‐
1573 chronously during the CMake configuration step. Therefore a
1574 specific build configuration must be chosen even if the gener‐
1575 ated build system supports multiple configurations.
1576
1577
1578 CMAKE_USE_RELATIVE_PATHS
1579 Use relative paths (May not work!).
1580
1581 If this is set to TRUE, then CMake will use relative paths
1582 between the source and binary tree. This option does not work
1583 for more complicated projects, and relative paths are used when
1584 possible. In general, it is not possible to move CMake gener‐
1585 ated makefiles to a different location regardless of the value
1586 of this variable.
1587
1588
1589 CMAKE_VISIBILITY_INLINES_HIDDEN
1590 Default value for VISIBILITY_INLINES_HIDDEN of targets.
1591
1592 This variable is used to initialize the VISIBILITY_INLINES_HID‐
1593 DEN property on all the targets. See that target property for
1594 additional information.
1595
1596
1597 CMAKE_WIN32_EXECUTABLE
1598 Default value for WIN32_EXECUTABLE of targets.
1599
1600 This variable is used to initialize the WIN32_EXECUTABLE prop‐
1601 erty on all the targets. See that target property for addi‐
1602 tional information.
1603
1604
1605 EXECUTABLE_OUTPUT_PATH
1606 Old executable location variable.
1607
1608 The target property RUNTIME_OUTPUT_DIRECTORY supercedes this
1609 variable for a target if it is set. Executable targets are oth‐
1610 erwise placed in this directory.
1611
1612
1613 LIBRARY_OUTPUT_PATH
1614 Old library location variable.
1615
1616 The target properties ARCHIVE_OUTPUT_DIRECTORY, LIBRARY_OUT‐
1617 PUT_DIRECTORY, and RUNTIME_OUTPUT_DIRECTORY supercede this vari‐
1618 able for a target if they are set. Library targets are other‐
1619 wise placed in this directory.
1620
1621
1623 CMAKE_<LANG>_ARCHIVE_APPEND
1624 Rule variable to append to a static archive.
1625
1626 This is a rule variable that tells CMake how to append to a
1627 static archive. It is used in place of CMAKE_<LANG>_CRE‐
1628 ATE_STATIC_LIBRARY on some platforms in order to support large
1629 object counts. See also CMAKE_<LANG>_ARCHIVE_CREATE and
1630 CMAKE_<LANG>_ARCHIVE_FINISH.
1631
1632
1633 CMAKE_<LANG>_ARCHIVE_CREATE
1634 Rule variable to create a new static archive.
1635
1636 This is a rule variable that tells CMake how to create a static
1637 archive. It is used in place of CMAKE_<LANG>_CRE‐
1638 ATE_STATIC_LIBRARY on some platforms in order to support large
1639 object counts. See also CMAKE_<LANG>_ARCHIVE_APPEND and
1640 CMAKE_<LANG>_ARCHIVE_FINISH.
1641
1642
1643 CMAKE_<LANG>_ARCHIVE_FINISH
1644 Rule variable to finish an existing static archive.
1645
1646 This is a rule variable that tells CMake how to finish a static
1647 archive. It is used in place of CMAKE_<LANG>_CRE‐
1648 ATE_STATIC_LIBRARY on some platforms in order to support large
1649 object counts. See also CMAKE_<LANG>_ARCHIVE_CREATE and
1650 CMAKE_<LANG>_ARCHIVE_APPEND.
1651
1652
1653 CMAKE_<LANG>_COMPILER
1654 The full path to the compiler for LANG.
1655
1656 This is the command that will be used as the <LANG> compiler.
1657 Once set, you can not change this variable.
1658
1659
1660 CMAKE_<LANG>_COMPILER_ABI
1661 An internal variable subject to change.
1662
1663 This is used in determining the compiler ABI and is subject to
1664 change.
1665
1666
1667 CMAKE_<LANG>_COMPILER_ID
1668 Compiler identification string.
1669
1670 A short string unique to the compiler vendor. Possible values
1671 include:
1672
1673
1674 Absoft = Absoft Fortran (absoft.com)
1675 ADSP = Analog VisualDSP++ (analog.com)
1676 Clang = LLVM Clang (clang.llvm.org)
1677 Cray = Cray Compiler (cray.com)
1678 Embarcadero, Borland = Embarcadero (embarcadero.com)
1679 G95 = G95 Fortran (g95.org)
1680 GNU = GNU Compiler Collection (gcc.gnu.org)
1681 HP = Hewlett-Packard Compiler (hp.com)
1682 Intel = Intel Compiler (intel.com)
1683 MIPSpro = SGI MIPSpro (sgi.com)
1684 MSVC = Microsoft Visual Studio (microsoft.com)
1685 PGI = The Portland Group (pgroup.com)
1686 PathScale = PathScale (pathscale.com)
1687 SDCC = Small Device C Compiler (sdcc.sourceforge.net)
1688 SunPro = Oracle Solaris Studio (oracle.com)
1689 TI = Texas Instruments (ti.com)
1690 TinyCC = Tiny C Compiler (tinycc.org)
1691 Watcom = Open Watcom (openwatcom.org)
1692 XL, VisualAge, zOS = IBM XL (ibm.com)
1693
1694 This variable is not guaranteed to be defined for all compilers
1695 or languages.
1696
1697
1698 CMAKE_<LANG>_COMPILER_LOADED
1699 Defined to true if the language is enabled.
1700
1701 When language <LANG> is enabled by project() or enable_lan‐
1702 guage() this variable is defined to 1.
1703
1704
1705 CMAKE_<LANG>_COMPILER_VERSION
1706 Compiler version string.
1707
1708 Compiler version in major[.minor[.patch[.tweak]]] format. This
1709 variable is not guaranteed to be defined for all compilers or
1710 languages.
1711
1712
1713 CMAKE_<LANG>_COMPILE_OBJECT
1714 Rule variable to compile a single object file.
1715
1716 This is a rule variable that tells CMake how to compile a single
1717 object file for the language <LANG>.
1718
1719
1720 CMAKE_<LANG>_CREATE_SHARED_LIBRARY
1721 Rule variable to create a shared library.
1722
1723 This is a rule variable that tells CMake how to create a shared
1724 library for the language <LANG>.
1725
1726
1727 CMAKE_<LANG>_CREATE_SHARED_MODULE
1728 Rule variable to create a shared module.
1729
1730 This is a rule variable that tells CMake how to create a shared
1731 library for the language <LANG>.
1732
1733
1734 CMAKE_<LANG>_CREATE_STATIC_LIBRARY
1735 Rule variable to create a static library.
1736
1737 This is a rule variable that tells CMake how to create a static
1738 library for the language <LANG>.
1739
1740
1741 CMAKE_<LANG>_FLAGS
1742 Flags for all build types.
1743
1744 <LANG> flags used regardless of the value of CMAKE_BUILD_TYPE.
1745
1746
1747 CMAKE_<LANG>_FLAGS_DEBUG
1748 Flags for Debug build type or configuration.
1749
1750 <LANG> flags used when CMAKE_BUILD_TYPE is Debug.
1751
1752
1753 CMAKE_<LANG>_FLAGS_MINSIZEREL
1754 Flags for MinSizeRel build type or configuration.
1755
1756 <LANG> flags used when CMAKE_BUILD_TYPE is MinSizeRel.Short for
1757 minimum size release.
1758
1759
1760 CMAKE_<LANG>_FLAGS_RELEASE
1761 Flags for Release build type or configuration.
1762
1763 <LANG> flags used when CMAKE_BUILD_TYPE is Release
1764
1765
1766 CMAKE_<LANG>_FLAGS_RELWITHDEBINFO
1767 Flags for RelWithDebInfo type or configuration.
1768
1769 <LANG> flags used when CMAKE_BUILD_TYPE is RelWithDebInfo.
1770 Short for Release With Debug Information.
1771
1772
1773 CMAKE_<LANG>_IGNORE_EXTENSIONS
1774 File extensions that should be ignored by the build.
1775
1776 This is a list of file extensions that may be part of a project
1777 for a given language but are not compiled.
1778
1779
1780 CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES
1781 Directories implicitly searched by the compiler for header
1782 files.
1783
1784 CMake does not explicitly specify these directories on compiler
1785 command lines for language <LANG>. This prevents system include
1786 directories from being treated as user include directories on
1787 some compilers.
1788
1789
1790 CMAKE_<LANG>_IMPLICIT_LINK_DIRECTORIES
1791 Implicit linker search path detected for language <LANG>.
1792
1793 Compilers typically pass directories containing language runtime
1794 libraries and default library search paths when they invoke a
1795 linker. These paths are implicit linker search directories for
1796 the compiler's language. CMake automatically detects these
1797 directories for each language and reports the results in this
1798 variable.
1799
1800
1801 When a library in one of these directories is given by full path
1802 to target_link_libraries() CMake will generate the -l<name> form
1803 on link lines to ensure the linker searches its implicit direc‐
1804 tories for the library. Note that some toolchains read implicit
1805 directories from an environment variable such as LIBRARY_PATH so
1806 keep its value consistent when operating in a given build tree.
1807
1808
1809 CMAKE_<LANG>_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES
1810 Implicit linker framework search path detected for language
1811 <LANG>.
1812
1813 These paths are implicit linker framework search directories for
1814 the compiler's language. CMake automatically detects these
1815 directories for each language and reports the results in this
1816 variable.
1817
1818
1819 CMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES
1820 Implicit link libraries and flags detected for language <LANG>.
1821
1822 Compilers typically pass language runtime library names and
1823 other flags when they invoke a linker. These flags are implicit
1824 link options for the compiler's language. CMake automatically
1825 detects these libraries and flags for each language and reports
1826 the results in this variable.
1827
1828
1829 CMAKE_<LANG>_LIBRARY_ARCHITECTURE
1830 Target architecture library directory name detected for <lang>.
1831
1832 If the <lang> compiler passes to the linker an architecture-spe‐
1833 cific system library search directory such as <pre‐
1834 fix>/lib/<arch> this variable contains the <arch> name if/as
1835 detected by CMake.
1836
1837
1838 CMAKE_<LANG>_LINKER_PREFERENCE
1839 Preference value for linker language selection.
1840
1841 The "linker language" for executable, shared library, and module
1842 targets is the language whose compiler will invoke the linker.
1843 The LINKER_LANGUAGE target property sets the language explic‐
1844 itly. Otherwise, the linker language is that whose linker pref‐
1845 erence value is highest among languages compiled and linked into
1846 the target. See also the CMAKE_<LANG>_LINKER_PREFERENCE_PROPA‐
1847 GATES variable.
1848
1849
1850 CMAKE_<LANG>_LINKER_PREFERENCE_PROPAGATES
1851 True if CMAKE_<LANG>_LINKER_PREFERENCE propagates across tar‐
1852 gets.
1853
1854 This is used when CMake selects a linker language for a target.
1855 Languages compiled directly into the target are always consid‐
1856 ered. A language compiled into static libraries linked by the
1857 target is considered if this variable is true.
1858
1859
1860 CMAKE_<LANG>_LINK_EXECUTABLE
1861 Rule variable to link an executable.
1862
1863 Rule variable to link an executable for the given language.
1864
1865
1866 CMAKE_<LANG>_OUTPUT_EXTENSION
1867 Extension for the output of a compile for a single file.
1868
1869 This is the extension for an object file for the given <LANG>.
1870 For example .obj for C on Windows.
1871
1872
1873 CMAKE_<LANG>_PLATFORM_ID
1874 An internal variable subject to change.
1875
1876 This is used in determining the platform and is subject to
1877 change.
1878
1879
1880 CMAKE_<LANG>_SIZEOF_DATA_PTR
1881 Size of pointer-to-data types for language <LANG>.
1882
1883 This holds the size (in bytes) of pointer-to-data types in the
1884 target platform ABI. It is defined for languages C and CXX
1885 (C++).
1886
1887
1888 CMAKE_<LANG>_SOURCE_FILE_EXTENSIONS
1889 Extensions of source files for the given language.
1890
1891 This is the list of extensions for a given language's source
1892 files.
1893
1894
1895 CMAKE_COMPILER_IS_GNU<LANG>
1896 True if the compiler is GNU.
1897
1898 If the selected <LANG> compiler is the GNU compiler then this is
1899 TRUE, if not it is FALSE. Unlike the other per-language vari‐
1900 ables, this uses the GNU syntax for identifying languages
1901 instead of the CMake syntax. Recognized values of the <LANG>
1902 suffix are:
1903
1904
1905 CC = C compiler
1906 CXX = C++ compiler
1907 G77 = Fortran compiler
1908
1909
1910 CMAKE_Fortran_MODDIR_DEFAULT
1911 Fortran default module output directory.
1912
1913 Most Fortran compilers write .mod files to the current working
1914 directory. For those that do not, this is set to "." and used
1915 when the Fortran_MODULE_DIRECTORY target property is not set.
1916
1917
1918 CMAKE_Fortran_MODDIR_FLAG
1919 Fortran flag for module output directory.
1920
1921 This stores the flag needed to pass the value of the For‐
1922 tran_MODULE_DIRECTORY target property to the compiler.
1923
1924
1925 CMAKE_Fortran_MODOUT_FLAG
1926 Fortran flag to enable module output.
1927
1928 Most Fortran compilers write .mod files out by default. For
1929 others, this stores the flag needed to enable module output.
1930
1931
1932 CMAKE_INTERNAL_PLATFORM_ABI
1933 An internal variable subject to change.
1934
1935 This is used in determining the compiler ABI and is subject to
1936 change.
1937
1938
1939 CMAKE_USER_MAKE_RULES_OVERRIDE_<LANG>
1940 Specify a CMake file that overrides platform information for
1941 <LANG>.
1942
1943 This is a language-specific version of
1944 CMAKE_USER_MAKE_RULES_OVERRIDE loaded only when enabling lan‐
1945 guage <LANG>.
1946
1947
1949 Copyright 2000-2012 Kitware, Inc., Insight Software Consortium. All
1950 rights reserved.
1951
1952
1953 Redistribution and use in source and binary forms, with or without mod‐
1954 ification, are permitted provided that the following conditions are
1955 met:
1956
1957
1958 Redistributions of source code must retain the above copyright notice,
1959 this list of conditions and the following disclaimer.
1960
1961
1962 Redistributions in binary form must reproduce the above copyright
1963 notice, this list of conditions and the following disclaimer in the
1964 documentation and/or other materials provided with the distribution.
1965
1966
1967 Neither the names of Kitware, Inc., the Insight Software Consortium,
1968 nor the names of their contributors may be used to endorse or promote
1969 products derived from this software without specific prior written per‐
1970 mission.
1971
1972
1973 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
1974 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
1975 TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTIC‐
1976 ULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
1977 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
1978 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
1979 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
1980 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
1981 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
1982 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
1983 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1984
1985
1987 The following resources are available to get help using CMake:
1988
1989
1990 Home Page
1991 http://www.cmake.org
1992
1993 The primary starting point for learning about CMake.
1994
1995
1996 Frequently Asked Questions
1997 http://www.cmake.org/Wiki/CMake_FAQ
1998
1999 A Wiki is provided containing answers to frequently asked ques‐
2000 tions.
2001
2002
2003 Online Documentation
2004 http://www.cmake.org/HTML/Documentation.html
2005
2006 Links to available documentation may be found on this web page.
2007
2008
2009 Mailing List
2010 http://www.cmake.org/HTML/MailingLists.html
2011
2012 For help and discussion about using cmake, a mailing list is
2013 provided at cmake@cmake.org. The list is member-post-only but
2014 one may sign up on the CMake web page. Please first read the
2015 full documentation at http://www.cmake.org before posting ques‐
2016 tions to the list.
2017
2018
2019
2020
2021cmake 2.8.12.2 October 15, 2014 cmakevars(1)