1cmake(1) General Commands Manual cmake(1)
2
3
4
6 cmake-gui - CMake GUI.
7
8
10 cmake-gui [options]
11 cmake-gui [options] <path-to-source>
12 cmake-gui [options] <path-to-existing-build>
13
14
16 The "cmake-gui" executable is the CMake GUI. Project configuration
17 settings may be specified interactively. Brief instructions are pro‐
18 vided at the bottom of the window when the program is running.
19
20
21 CMake is a cross-platform build system generator. Projects specify
22 their build process with platform-independent CMake listfiles included
23 in each directory of a source tree with the name CMakeLists.txt. Users
24 build a project by using CMake to generate a build system for a native
25 tool on their platform.
26
27
29 --copyright [file]
30 Print the CMake copyright and exit.
31
32 If a file is specified, the copyright is written into it.
33
34
35 --help Print usage information and exit.
36
37 Usage describes the basic command line interface and its
38 options.
39
40
41 --help-full [file]
42 Print full help and exit.
43
44 Full help displays most of the documentation provided by the
45 UNIX man page. It is provided for use on non-UNIX platforms,
46 but is also convenient if the man page is not installed. If a
47 file is specified, the help is written into it.
48
49
50 --help-html [file]
51 Print full help in HTML format.
52
53 This option is used by CMake authors to help produce web pages.
54 If a file is specified, the help is written into it.
55
56
57 --help-man [file]
58 Print full help as a UNIX man page and exit.
59
60 This option is used by the cmake build to generate the UNIX man
61 page. If a file is specified, the help is written into it.
62
63
64 --version [file]
65 Show program name/version banner and exit.
66
67 If a file is specified, the version is written into it.
68
69
71 The following generators are available on this platform:
72
73
74 Unix Makefiles
75 Generates standard UNIX makefiles.
76
77 A hierarchy of UNIX makefiles is generated into the build tree.
78 Any standard UNIX-style make program can build the project
79 through the default make target. A "make install" target is
80 also provided.
81
82
83 CodeBlocks - Unix Makefiles
84 Generates CodeBlocks project files.
85
86 Project files for CodeBlocks will be created in the top direc‐
87 tory and in every subdirectory which features a CMakeLists.txt
88 file containing a PROJECT() call. Additionally a hierarchy of
89 makefiles is generated into the build tree. The appropriate
90 make program can build the project through the default make tar‐
91 get. A "make install" target is also provided.
92
93
94 Eclipse CDT4 - Unix Makefiles
95 Generates Eclipse CDT 4.0 project files.
96
97 Project files for Eclipse will be created in the top directory.
98 In out of source builds, a linked resource to the top level
99 source directory will be created.Additionally a hierarchy of
100 makefiles is generated into the build tree. The appropriate make
101 program can build the project through the default make target. A
102 "make install" target is also provided.
103
104
105 KDevelop3
106 Generates KDevelop 3 project files.
107
108 Project files for KDevelop 3 will be created in the top direc‐
109 tory and in every subdirectory which features a CMakeLists.txt
110 file containing a PROJECT() call. If you change the settings
111 using KDevelop cmake will try its best to keep your changes when
112 regenerating the project files. Additionally a hierarchy of UNIX
113 makefiles is generated into the build tree. Any standard
114 UNIX-style make program can build the project through the
115 default make target. A "make install" target is also provided.
116
117
118 KDevelop3 - Unix Makefiles
119 Generates KDevelop 3 project files.
120
121 Project files for KDevelop 3 will be created in the top direc‐
122 tory and in every subdirectory which features a CMakeLists.txt
123 file containing a PROJECT() call. If you change the settings
124 using KDevelop cmake will try its best to keep your changes when
125 regenerating the project files. Additionally a hierarchy of UNIX
126 makefiles is generated into the build tree. Any standard
127 UNIX-style make program can build the project through the
128 default make target. A "make install" target is also provided.
129
130
132 add_custom_command
133 Add a custom build rule to the generated build system.
134
135 There are two main signatures for add_custom_command The first
136 signature is for adding a custom command to produce an output.
137
138
139 add_custom_command(OUTPUT output1 [output2 ...]
140 COMMAND command1 [ARGS] [args1...]
141 [COMMAND command2 [ARGS] [args2...] ...]
142 [MAIN_DEPENDENCY depend]
143 [DEPENDS [depends...]]
144 [IMPLICIT_DEPENDS <lang1> depend1 ...]
145 [WORKING_DIRECTORY dir]
146 [COMMENT comment] [VERBATIM] [APPEND])
147
148 This defines a command to generate specified OUTPUT file(s). A
149 target created in the same directory (CMakeLists.txt file) that
150 specifies any output of the custom command as a source file is
151 given a rule to generate the file using the command at build
152 time. If an output name is a relative path it will be inter‐
153 preted relative to the build tree directory corresponding to the
154 current source directory. Note that MAIN_DEPENDENCY is com‐
155 pletely optional and is used as a suggestion to visual studio
156 about where to hang the custom command. In makefile terms this
157 creates a new target in the following form:
158
159
160 OUTPUT: MAIN_DEPENDENCY DEPENDS
161 COMMAND
162
163 If more than one command is specified they will be executed in
164 order. The optional ARGS argument is for backward compatibility
165 and will be ignored.
166
167
168 The second signature adds a custom command to a target such as a
169 library or executable. This is useful for performing an opera‐
170 tion before or after building the target. The command becomes
171 part of the target and will only execute when the target itself
172 is built. If the target is already built, the command will not
173 execute.
174
175
176 add_custom_command(TARGET target
177 PRE_BUILD | PRE_LINK | POST_BUILD
178 COMMAND command1 [ARGS] [args1...]
179 [COMMAND command2 [ARGS] [args2...] ...]
180 [WORKING_DIRECTORY dir]
181 [COMMENT comment] [VERBATIM])
182
183 This defines a new command that will be associated with building
184 the specified target. When the command will happen is determined
185 by which of the following is specified:
186
187
188 PRE_BUILD - run before all other dependencies
189 PRE_LINK - run after other dependencies
190 POST_BUILD - run after the target has been built
191
192 Note that the PRE_BUILD option is only supported on Visual Stu‐
193 dio 7 or later. For all other generators PRE_BUILD will be
194 treated as PRE_LINK.
195
196
197 If WORKING_DIRECTORY is specified the command will be executed
198 in the directory given. If COMMENT is set, the value will be
199 displayed as a message before the commands are executed at build
200 time. If APPEND is specified the COMMAND and DEPENDS option val‐
201 ues are appended to the custom command for the first output
202 specified. There must have already been a previous call to this
203 command with the same output. The COMMENT, WORKING_DIRECTORY,
204 and MAIN_DEPENDENCY options are currently ignored when APPEND is
205 given, but may be used in the future.
206
207
208 If VERBATIM is given then all arguments to the commands will be
209 escaped properly for the build tool so that the invoked command
210 receives each argument unchanged. Note that one level of
211 escapes is still used by the CMake language processor before
212 add_custom_command even sees the arguments. Use of VERBATIM is
213 recommended as it enables correct behavior. When VERBATIM is not
214 given the behavior is platform specific because there is no pro‐
215 tection of tool-specific special characters.
216
217
218 If the output of the custom command is not actually created as a
219 file on disk it should be marked as SYMBOLIC with
220 SET_SOURCE_FILES_PROPERTIES.
221
222
223 The IMPLICIT_DEPENDS option requests scanning of implicit depen‐
224 dencies of an input file. The language given specifies the pro‐
225 gramming language whose corresponding dependency scanner should
226 be used. Currently only C and CXX language scanners are sup‐
227 ported. Dependencies discovered from the scanning are added to
228 those of the custom command at build time. Note that the
229 IMPLICIT_DEPENDS option is currently supported only for Makefile
230 generators and will be ignored by other generators.
231
232
233 If COMMAND specifies an executable target (created by ADD_EXE‐
234 CUTABLE) it will automatically be replaced by the location of
235 the executable created at build time. Additionally a tar‐
236 get-level dependency will be added so that the executable target
237 will be built before any target using this custom command. How‐
238 ever this does NOT add a file-level dependency that would cause
239 the custom command to re-run whenever the executable is recom‐
240 piled.
241
242
243 Arguments to COMMAND may use "generator expressions" with the
244 syntax "$<...>". Generator expressions are evaluted during
245 build system generation to produce information specific to each
246 build configuration. Valid expressions are:
247
248
249 $<CONFIGURATION> = configuration name
250 $<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)
251 $<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)
252 $<TARGET_SONAME_FILE:tgt> = file with soname (.so.3)
253
254 where "tgt" is the name of a target. Target file expressions
255 produce a full path, but _DIR and _NAME versions can produce the
256 directory and file name components:
257
258
259 $<TARGET_FILE_DIR:tgt>/$<TARGET_FILE_NAME:tgt>
260 $<TARGET_LINKER_FILE_DIR:tgt>/$<TARGET_LINKER_FILE_NAME:tgt>
261 $<TARGET_SONAME_FILE_DIR:tgt>/$<TARGET_SONAME_FILE_NAME:tgt>
262
263 References to target names in generator expressions imply tar‐
264 get-level dependencies, but NOT file-level dependencies. List
265 target names with the DEPENDS option to add file dependencies.
266
267
268 The DEPENDS option specifies files on which the command depends.
269 If any dependency is an OUTPUT of another custom command in the
270 same directory (CMakeLists.txt file) CMake automatically brings
271 the other custom command into the target in which this command
272 is built. If DEPENDS is not specified the command will run
273 whenever the OUTPUT is missing; if the command does not actually
274 create the OUTPUT then the rule will always run. If DEPENDS
275 specifies any target (created by an ADD_* command) a tar‐
276 get-level dependency is created to make sure the target is built
277 before any target using this custom command. Additionally, if
278 the target is an executable or library a file-level dependency
279 is created to cause the custom command to re-run whenever the
280 target is recompiled.
281
282
283
284 add_custom_target
285 Add a target with no output so it will always be built.
286
287 add_custom_target(Name [ALL] [command1 [args1...]]
288 [COMMAND command2 [args2...] ...]
289 [DEPENDS depend depend depend ... ]
290 [WORKING_DIRECTORY dir]
291 [COMMENT comment] [VERBATIM]
292 [SOURCES src1 [src2...]])
293
294 Adds a target with the given name that executes the given com‐
295 mands. The target has no output file and is ALWAYS CONSIDERED
296 OUT OF DATE even if the commands try to create a file with the
297 name of the target. Use ADD_CUSTOM_COMMAND to generate a file
298 with dependencies. By default nothing depends on the custom tar‐
299 get. Use ADD_DEPENDENCIES to add dependencies to or from other
300 targets. If the ALL option is specified it indicates that this
301 target should be added to the default build target so that it
302 will be run every time (the command cannot be called ALL). The
303 command and arguments are optional and if not specified an empty
304 target will be created. If WORKING_DIRECTORY is set, then the
305 command will be run in that directory. If COMMENT is set, the
306 value will be displayed as a message before the commands are
307 executed at build time. Dependencies listed with the DEPENDS
308 argument may reference files and outputs of custom commands cre‐
309 ated with add_custom_command() in the same directory (CMake‐
310 Lists.txt file).
311
312
313 If VERBATIM is given then all arguments to the commands will be
314 escaped properly for the build tool so that the invoked command
315 receives each argument unchanged. Note that one level of
316 escapes is still used by the CMake language processor before
317 add_custom_target even sees the arguments. Use of VERBATIM is
318 recommended as it enables correct behavior. When VERBATIM is not
319 given the behavior is platform specific because there is no pro‐
320 tection of tool-specific special characters.
321
322
323 The SOURCES option specifies additional source files to be
324 included in the custom target. Specified source files will be
325 added to IDE project files for convenience in editing even if
326 they have not build rules.
327
328
329 add_definitions
330 Adds -D define flags to the compilation of source files.
331
332 add_definitions(-DFOO -DBAR ...)
333
334 Adds flags to the compiler command line for sources in the cur‐
335 rent directory and below. This command can be used to add any
336 flags, but it was originally intended to add preprocessor defi‐
337 nitions. Flags beginning in -D or /D that look like preproces‐
338 sor definitions are automatically added to the COMPILE_DEFINI‐
339 TIONS property for the current directory. Definitions with
340 non-trival values may be left in the set of flags instead of
341 being converted for reasons of backwards compatibility. See
342 documentation of the directory, target, and source file COM‐
343 PILE_DEFINITIONS properties for details on adding preprocessor
344 definitions to specific scopes and configurations.
345
346
347 add_dependencies
348 Add a dependency between top-level targets.
349
350 add_dependencies(target-name depend-target1
351 depend-target2 ...)
352
353 Make a top-level target depend on other top-level targets. A
354 top-level target is one created by ADD_EXECUTABLE, ADD_LIBRARY,
355 or ADD_CUSTOM_TARGET. Adding dependencies with this command can
356 be used to make sure one target is built before another target.
357 Dependencies added to an IMPORTED target are followed transi‐
358 tively in its place since the target itself does not build. See
359 the DEPENDS option of ADD_CUSTOM_TARGET and ADD_CUSTOM_COMMAND
360 for adding file-level dependencies in custom rules. See the
361 OBJECT_DEPENDS option in SET_SOURCE_FILES_PROPERTIES to add
362 file-level dependencies to object files.
363
364
365 add_executable
366 Add an executable to the project using the specified source
367 files.
368
369 add_executable(<name> [WIN32] [MACOSX_BUNDLE]
370 [EXCLUDE_FROM_ALL]
371 source1 source2 ... sourceN)
372
373 Adds an executable target called <name> to be built from the
374 source files listed in the command invocation. The <name> cor‐
375 responds to the logical target name and must be globally unique
376 within a project. The actual file name of the executable built
377 is constructed based on conventions of the native platform (such
378 as <name>.exe or just <name>).
379
380
381 By default the executable file will be created in the build tree
382 directory corresponding to the source tree directory in which
383 the command was invoked. See documentation of the RUNTIME_OUT‐
384 PUT_DIRECTORY target property to change this location. See doc‐
385 umentation of the OUTPUT_NAME target property to change the
386 <name> part of the final file name.
387
388
389 If WIN32 is given the property WIN32_EXECUTABLE will be set on
390 the target created. See documentation of that target property
391 for details.
392
393
394 If MACOSX_BUNDLE is given the corresponding property will be set
395 on the created target. See documentation of the MACOSX_BUNDLE
396 target property for details.
397
398
399 If EXCLUDE_FROM_ALL is given the corresponding property will be
400 set on the created target. See documentation of the
401 EXCLUDE_FROM_ALL target property for details.
402
403
404 The add_executable command can also create IMPORTED executable
405 targets using this signature:
406
407
408 add_executable(<name> IMPORTED)
409
410 An IMPORTED executable target references an executable file
411 located outside the project. No rules are generated to build
412 it. The target name has scope in the directory in which it is
413 created and below. It may be referenced like any target built
414 within the project. IMPORTED executables are useful for conve‐
415 nient reference from commands like add_custom_command. Details
416 about the imported executable are specified by setting proper‐
417 ties whose names begin in "IMPORTED_". The most important such
418 property is IMPORTED_LOCATION (and its per-configuration version
419 IMPORTED_LOCATION_<CONFIG>) which specifies the location of the
420 main executable file on disk. See documentation of the
421 IMPORTED_* properties for more information.
422
423
424 add_library
425 Add a library to the project using the specified source files.
426
427 add_library(<name> [STATIC | SHARED | MODULE]
428 [EXCLUDE_FROM_ALL]
429 source1 source2 ... sourceN)
430
431 Adds a library target called <name> to be built from the source
432 files listed in the command invocation. The <name> corresponds
433 to the logical target name and must be globally unique within a
434 project. The actual file name of the library built is con‐
435 structed based on conventions of the native platform (such as
436 lib<name>.a or <name>.lib).
437
438
439 STATIC, SHARED, or MODULE may be given to specify the type of
440 library to be created. STATIC libraries are archives of object
441 files for use when linking other targets. SHARED libraries are
442 linked dynamically and loaded at runtime. MODULE libraries are
443 plugins that are not linked into other targets but may be loaded
444 dynamically at runtime using dlopen-like functionality. If no
445 type is given explicitly the type is STATIC or SHARED based on
446 whether the current value of the variable BUILD_SHARED_LIBS is
447 true.
448
449
450 By default the library file will be created in the build tree
451 directory corresponding to the source tree directory in which
452 the command was invoked. See documentation of the ARCHIVE_OUT‐
453 PUT_DIRECTORY, LIBRARY_OUTPUT_DIRECTORY, and RUNTIME_OUT‐
454 PUT_DIRECTORY target properties to change this location. See
455 documentation of the OUTPUT_NAME target property to change the
456 <name> part of the final file name.
457
458
459 If EXCLUDE_FROM_ALL is given the corresponding property will be
460 set on the created target. See documentation of the
461 EXCLUDE_FROM_ALL target property for details.
462
463
464 The add_library command can also create IMPORTED library targets
465 using this signature:
466
467
468 add_library(<name> <SHARED|STATIC|MODULE|UNKNOWN> IMPORTED)
469
470 An IMPORTED library target references a library file located
471 outside the project. No rules are generated to build it. The
472 target name has scope in the directory in which it is created
473 and below. It may be referenced like any target built within
474 the project. IMPORTED libraries are useful for convenient ref‐
475 erence from commands like target_link_libraries. Details about
476 the imported library are specified by setting properties whose
477 names begin in "IMPORTED_". The most important such property is
478 IMPORTED_LOCATION (and its per-configuration version
479 IMPORTED_LOCATION_<CONFIG>) which specifies the location of the
480 main library file on disk. See documentation of the IMPORTED_*
481 properties for more information.
482
483
484 add_subdirectory
485 Add a subdirectory to the build.
486
487 add_subdirectory(source_dir [binary_dir]
488 [EXCLUDE_FROM_ALL])
489
490 Add a subdirectory to the build. The source_dir specifies the
491 directory in which the source CmakeLists.txt and code files are
492 located. If it is a relative path it will be evaluated with
493 respect to the current directory (the typical usage), but it may
494 also be an absolute path. The binary_dir specifies the directory
495 in which to place the output files. If it is a relative path it
496 will be evaluated with respect to the current output directory,
497 but it may also be an absolute path. If binary_dir is not speci‐
498 fied, the value of source_dir, before expanding any relative
499 path, will be used (the typical usage). The CMakeLists.txt file
500 in the specified source directory will be processed immediately
501 by CMake before processing in the current input file continues
502 beyond this command.
503
504
505 If the EXCLUDE_FROM_ALL argument is provided then targets in the
506 subdirectory will not be included in the ALL target of the par‐
507 ent directory by default, and will be excluded from IDE project
508 files. Users must explicitly build targets in the subdirectory.
509 This is meant for use when the subdirectory contains a separate
510 part of the project that is useful but not necessary, such as a
511 set of examples. Typically the subdirectory should contain its
512 own project() command invocation so that a full build system
513 will be generated in the subdirectory (such as a VS IDE solution
514 file). Note that inter-target dependencies supercede this
515 exclusion. If a target built by the parent project depends on a
516 target in the subdirectory, the dependee target will be included
517 in the parent project build system to satisfy the dependency.
518
519
520 add_test
521 Add a test to the project with the specified arguments.
522
523 add_test(testname Exename arg1 arg2 ... )
524
525 If the ENABLE_TESTING command has been run, this command adds a
526 test target to the current directory. If ENABLE_TESTING has not
527 been run, this command does nothing. The tests are run by the
528 testing subsystem by executing Exename with the specified argu‐
529 ments. Exename can be either an executable built by this
530 project or an arbitrary executable on the system (like tclsh).
531 The test will be run with the current working directory set to
532 the CMakeList.txt files corresponding directory in the binary
533 tree.
534
535
536
537
538
539 add_test(NAME <name> [CONFIGURATIONS [Debug|Release|...]]
540 [WORKING_DIRECTORY dir]
541 COMMAND <command> [arg1 [arg2 ...]])
542
543 If COMMAND specifies an executable target (created by add_exe‐
544 cutable) it will automatically be replaced by the location of
545 the executable created at build time. If a CONFIGURATIONS
546 option is given then the test will be executed only when testing
547 under one of the named configurations. If a WORKING_DIRECTORY
548 option is given then the test will be executed in the given
549 directory.
550
551
552 Arguments after COMMAND may use "generator expressions" with the
553 syntax "$<...>". Generator expressions are evaluted during
554 build system generation to produce information specific to each
555 build configuration. Valid expressions are:
556
557
558 $<CONFIGURATION> = configuration name
559 $<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)
560 $<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)
561 $<TARGET_SONAME_FILE:tgt> = file with soname (.so.3)
562
563 where "tgt" is the name of a target. Target file expressions
564 produce a full path, but _DIR and _NAME versions can produce the
565 directory and file name components:
566
567
568 $<TARGET_FILE_DIR:tgt>/$<TARGET_FILE_NAME:tgt>
569 $<TARGET_LINKER_FILE_DIR:tgt>/$<TARGET_LINKER_FILE_NAME:tgt>
570 $<TARGET_SONAME_FILE_DIR:tgt>/$<TARGET_SONAME_FILE_NAME:tgt>
571
572 Example usage:
573
574
575 add_test(NAME mytest
576 COMMAND testDriver --config $<CONFIGURATION>
577 --exe $<TARGET_FILE:myexe>)
578
579 This creates a test "mytest" whose command runs a testDriver
580 tool passing the configuration name and the full path to the
581 executable file produced by target "myexe".
582
583
584 aux_source_directory
585 Find all source files in a directory.
586
587 aux_source_directory(<dir> <variable>)
588
589 Collects the names of all the source files in the specified
590 directory and stores the list in the <variable> provided. This
591 command is intended to be used by projects that use explicit
592 template instantiation. Template instantiation files can be
593 stored in a "Templates" subdirectory and collected automatically
594 using this command to avoid manually listing all instantiations.
595
596
597 It is tempting to use this command to avoid writing the list of
598 source files for a library or executable target. While this
599 seems to work, there is no way for CMake to generate a build
600 system that knows when a new source file has been added. Nor‐
601 mally the generated build system knows when it needs to rerun
602 CMake because the CMakeLists.txt file is modified to add a new
603 source. When the source is just added to the directory without
604 modifying this file, one would have to manually rerun CMake to
605 generate a build system incorporating the new file.
606
607
608 break Break from an enclosing foreach or while loop.
609
610 break()
611
612 Breaks from an enclosing foreach loop or while loop
613
614
615 build_command
616 Get the command line to build this project.
617
618 build_command(<variable>
619 [CONFIGURATION <config>]
620 [PROJECT_NAME <projname>]
621 [TARGET <target>])
622
623 Sets the given <variable> to a string containing the command
624 line for building one configuration of a target in a project
625 using the build tool appropriate for the current CMAKE_GENERA‐
626 TOR.
627
628
629 If CONFIGURATION is omitted, CMake chooses a reasonable default
630 value for multi-configuration generators. CONFIGURATION is
631 ignored for single-configuration generators.
632
633
634 If PROJECT_NAME is omitted, the resulting command line will
635 build the top level PROJECT in the current build tree.
636
637
638 If TARGET is omitted, the resulting command line will build
639 everything, effectively using build target 'all' or 'ALL_BUILD'.
640
641
642 build_command(<cachevariable> <makecommand>)
643
644 This second signature is deprecated, but still available for
645 backwards compatibility. Use the first signature instead.
646
647
648 Sets the given <cachevariable> to a string containing the com‐
649 mand to build this project from the root of the build tree using
650 the build tool given by <makecommand>. <makecommand> should be
651 the full path to msdev, devenv, nmake, make or one of the end
652 user build tools.
653
654
655 cmake_minimum_required
656 Set the minimum required version of cmake for a project.
657
658 cmake_minimum_required(VERSION major[.minor[.patch[.tweak]]]
659 [FATAL_ERROR])
660
661 If the current version of CMake is lower than that required it
662 will stop processing the project and report an error. When a
663 version higher than 2.4 is specified the command implicitly
664 invokes
665
666
667 cmake_policy(VERSION major[.minor[.patch[.tweak]]])
668
669 which sets the cmake policy version level to the version speci‐
670 fied. When version 2.4 or lower is given the command implicitly
671 invokes
672
673
674 cmake_policy(VERSION 2.4)
675
676 which enables compatibility features for CMake 2.4 and lower.
677
678
679 The FATAL_ERROR option is accepted but ignored by CMake 2.6 and
680 higher. It should be specified so CMake versions 2.4 and lower
681 fail with an error instead of just a warning.
682
683
684 cmake_policy
685 Manage CMake Policy settings.
686
687 As CMake evolves it is sometimes necessary to change existing
688 behavior in order to fix bugs or improve implementations of
689 existing features. The CMake Policy mechanism is designed to
690 help keep existing projects building as new versions of CMake
691 introduce changes in behavior. Each new policy (behavioral
692 change) is given an identifier of the form "CMP<NNNN>" where
693 "<NNNN>" is an integer index. Documentation associated with
694 each policy describes the OLD and NEW behavior and the reason
695 the policy was introduced. Projects may set each policy to
696 select the desired behavior. When CMake needs to know which
697 behavior to use it checks for a setting specified by the
698 project. If no setting is available the OLD behavior is assumed
699 and a warning is produced requesting that the policy be set.
700
701
702 The cmake_policy command is used to set policies to OLD or NEW
703 behavior. While setting policies individually is supported, we
704 encourage projects to set policies based on CMake versions.
705
706
707 cmake_policy(VERSION major.minor[.patch[.tweak]])
708
709 Specify that the current CMake list file is written for the
710 given version of CMake. All policies introduced in the speci‐
711 fied version or earlier will be set to use NEW behavior. All
712 policies introduced after the specified version will be unset
713 (unless variable CMAKE_POLICY_DEFAULT_CMP<NNNN> sets a default).
714 This effectively requests behavior preferred as of a given CMake
715 version and tells newer CMake versions to warn about their new
716 policies. The policy version specified must be at least 2.4 or
717 the command will report an error. In order to get compatibility
718 features supporting versions earlier than 2.4 see documentation
719 of policy CMP0001.
720
721
722 cmake_policy(SET CMP<NNNN> NEW)
723 cmake_policy(SET CMP<NNNN> OLD)
724
725 Tell CMake to use the OLD or NEW behavior for a given policy.
726 Projects depending on the old behavior of a given policy may
727 silence a policy warning by setting the policy state to OLD.
728 Alternatively one may fix the project to work with the new
729 behavior and set the policy state to NEW.
730
731
732 cmake_policy(GET CMP<NNNN> <variable>)
733
734 Check whether a given policy is set to OLD or NEW behavior. The
735 output variable value will be "OLD" or "NEW" if the policy is
736 set, and empty otherwise.
737
738
739 CMake keeps policy settings on a stack, so changes made by the
740 cmake_policy command affect only the top of the stack. A new
741 entry on the policy stack is managed automatically for each sub‐
742 directory to protect its parents and siblings. CMake also man‐
743 ages a new entry for scripts loaded by include() and find_pack‐
744 age() commands except when invoked with the NO_POLICY_SCOPE
745 option (see also policy CMP0011). The cmake_policy command pro‐
746 vides an interface to manage custom entries on the policy stack:
747
748
749 cmake_policy(PUSH)
750 cmake_policy(POP)
751
752 Each PUSH must have a matching POP to erase any changes. This
753 is useful to make temporary changes to policy settings.
754
755
756 Functions and macros record policy settings when they are cre‐
757 ated and use the pre-record policies when they are invoked. If
758 the function or macro implementation sets policies, the changes
759 automatically propagate up through callers until they reach the
760 closest nested policy stack entry.
761
762
763 configure_file
764 Copy a file to another location and modify its contents.
765
766 configure_file(<input> <output>
767 [COPYONLY] [ESCAPE_QUOTES] [@ONLY])
768
769 Copies a file <input> to file <output> and substitutes variable
770 values referenced in the file content. If <input> is a relative
771 path it is evaluated with respect to the current source direc‐
772 tory. The <input> must be a file, not a directory. If <output>
773 is a relative path it is evaluated with respect to the current
774 binary directory. If <output> names an existing directory the
775 input file is placed in that directory with its original name.
776
777
778 This command replaces any variables in the input file referenced
779 as ${VAR} or @VAR@ with their values as determined by CMake. If
780 a variable is not defined, it will be replaced with nothing. If
781 COPYONLY is specified, then no variable expansion will take
782 place. If ESCAPE_QUOTES is specified then any substituted
783 quotes will be C-style escaped. The file will be configured
784 with the current values of CMake variables. If @ONLY is speci‐
785 fied, only variables of the form @VAR@ will be replaces and
786 ${VAR} will be ignored. This is useful for configuring scripts
787 that use ${VAR}. Any occurrences of #cmakedefine VAR will be
788 replaced with either #define VAR or /* #undef VAR */ depending
789 on the setting of VAR in CMake. Any occurrences of #cmakede‐
790 fine01 VAR will be replaced with either #define VAR 1 or #define
791 VAR 0 depending on whether VAR evaluates to TRUE or FALSE in
792 CMake
793
794
795 create_test_sourcelist
796 Create a test driver and source list for building test programs.
797
798 create_test_sourcelist(sourceListName driverName
799 test1 test2 test3
800 EXTRA_INCLUDE include.h
801 FUNCTION function)
802
803 A test driver is a program that links together many small tests
804 into a single executable. This is useful when building static
805 executables with large libraries to shrink the total required
806 size. The list of source files needed to build the test driver
807 will be in sourceListName. DriverName is the name of the test
808 driver program. The rest of the arguments consist of a list of
809 test source files, can be semicolon separated. Each test source
810 file should have a function in it that is the same name as the
811 file with no extension (foo.cxx should have int foo(int,
812 char*[]);) DriverName will be able to call each of the tests by
813 name on the command line. If EXTRA_INCLUDE is specified, then
814 the next argument is included into the generated file. If FUNC‐
815 TION is specified, then the next argument is taken as a function
816 name that is passed a pointer to ac and av. This can be used to
817 add extra command line processing to each test. The cmake vari‐
818 able CMAKE_TESTDRIVER_BEFORE_TESTMAIN can be set to have code
819 that will be placed directly before calling the test main func‐
820 tion. CMAKE_TESTDRIVER_AFTER_TESTMAIN can be set to have code
821 that will be placed directly after the call to the test main
822 function.
823
824
825 define_property
826 Define and document custom properties.
827
828 define_property(<GLOBAL | DIRECTORY | TARGET | SOURCE |
829 TEST | VARIABLE | CACHED_VARIABLE>
830 PROPERTY <name> [INHERITED]
831 BRIEF_DOCS <brief-doc> [docs...]
832 FULL_DOCS <full-doc> [docs...])
833
834 Define one property in a scope for use with the set_property and
835 get_property commands. This is primarily useful to associate
836 documentation with property names that may be retrieved with the
837 get_property command. The first argument determines the kind of
838 scope in which the property should be used. It must be one of
839 the following:
840
841
842 GLOBAL = associated with the global namespace
843 DIRECTORY = associated with one directory
844 TARGET = associated with one target
845 SOURCE = associated with one source file
846 TEST = associated with a test named with add_test
847 VARIABLE = documents a CMake language variable
848 CACHED_VARIABLE = documents a CMake cache variable
849
850 Note that unlike set_property and get_property no actual scope
851 needs to be given; only the kind of scope is important.
852
853
854 The required PROPERTY option is immediately followed by the name
855 of the property being defined.
856
857
858 If the INHERITED option then the get_property command will chain
859 up to the next higher scope when the requested property is not
860 set in the scope given to the command. DIRECTORY scope chains
861 to GLOBAL. TARGET, SOURCE, and TEST chain to DIRECTORY.
862
863
864 The BRIEF_DOCS and FULL_DOCS options are followed by strings to
865 be associated with the property as its brief and full documenta‐
866 tion. Corresponding options to the get_property command will
867 retrieve the documentation.
868
869
870 else Starts the else portion of an if block.
871
872 else(expression)
873
874 See the if command.
875
876
877 elseif Starts the elseif portion of an if block.
878
879 elseif(expression)
880
881 See the if command.
882
883
884 enable_language
885 Enable a language (CXX/C/Fortran/etc)
886
887 enable_language(languageName [OPTIONAL] )
888
889 This command enables support for the named language in CMake.
890 This is the same as the project command but does not create any
891 of the extra variables that are created by the project command.
892 Example languages are CXX, C, Fortran. If OPTIONAL is used, use
893 the CMAKE_<languageName>_COMPILER_WORKS variable to check
894 whether the language has been enabled successfully.
895
896
897 enable_testing
898 Enable testing for current directory and below.
899
900 enable_testing()
901
902 Enables testing for this directory and below. See also the
903 add_test command. Note that ctest expects to find a test file
904 in the build directory root. Therefore, this command should be
905 in the source directory root.
906
907
908 endforeach
909 Ends a list of commands in a FOREACH block.
910
911 endforeach(expression)
912
913 See the FOREACH command.
914
915
916 endfunction
917 Ends a list of commands in a function block.
918
919 endfunction(expression)
920
921 See the function command.
922
923
924 endif Ends a list of commands in an if block.
925
926 endif(expression)
927
928 See the if command.
929
930
931 endmacro
932 Ends a list of commands in a macro block.
933
934 endmacro(expression)
935
936 See the macro command.
937
938
939 endwhile
940 Ends a list of commands in a while block.
941
942 endwhile(expression)
943
944 See the while command.
945
946
947 execute_process
948 Execute one or more child processes.
949
950 execute_process(COMMAND <cmd1> [args1...]]
951 [COMMAND <cmd2> [args2...] [...]]
952 [WORKING_DIRECTORY <directory>]
953 [TIMEOUT <seconds>]
954 [RESULT_VARIABLE <variable>]
955 [OUTPUT_VARIABLE <variable>]
956 [ERROR_VARIABLE <variable>]
957 [INPUT_FILE <file>]
958 [OUTPUT_FILE <file>]
959 [ERROR_FILE <file>]
960 [OUTPUT_QUIET]
961 [ERROR_QUIET]
962 [OUTPUT_STRIP_TRAILING_WHITESPACE]
963 [ERROR_STRIP_TRAILING_WHITESPACE])
964
965 Runs the given sequence of one or more commands with the stan‐
966 dard output of each process piped to the standard input of the
967 next. A single standard error pipe is used for all processes.
968 If WORKING_DIRECTORY is given the named directory will be set as
969 the current working directory of the child processes. If TIME‐
970 OUT is given the child processes will be terminated if they do
971 not finish in the specified number of seconds (fractions are
972 allowed). If RESULT_VARIABLE is given the variable will be set
973 to contain the result of running the processes. This will be an
974 integer return code from the last child or a string describing
975 an error condition. If OUTPUT_VARIABLE or ERROR_VARIABLE are
976 given the variable named will be set with the contents of the
977 standard output and standard error pipes respectively. If the
978 same variable is named for both pipes their output will be
979 merged in the order produced. If INPUT_FILE, OUTPUT_FILE, or
980 ERROR_FILE is given the file named will be attached to the stan‐
981 dard input of the first process, standard output of the last
982 process, or standard error of all processes respectively. If
983 OUTPUT_QUIET or ERROR_QUIET is given then the standard output or
984 standard error results will be quietly ignored. If more than
985 one OUTPUT_* or ERROR_* option is given for the same pipe the
986 precedence is not specified. If no OUTPUT_* or ERROR_* options
987 are given the output will be shared with the corresponding pipes
988 of the CMake process itself.
989
990
991 The execute_process command is a newer more powerful version of
992 exec_program, but the old command has been kept for compatibil‐
993 ity.
994
995
996 export Export targets from the build tree for use by outside projects.
997
998 export(TARGETS [target1 [target2 [...]]] [NAMESPACE <namespace>]
999 [APPEND] FILE <filename>)
1000
1001 Create a file <filename> that may be included by outside
1002 projects to import targets from the current project's build
1003 tree. This is useful during cross-compiling to build utility
1004 executables that can run on the host platform in one project and
1005 then import them into another project being compiled for the
1006 target platform. If the NAMESPACE option is given the <names‐
1007 pace> string will be prepended to all target names written to
1008 the file. If the APPEND option is given the generated code will
1009 be appended to the file instead of overwriting it. If a library
1010 target is included in the export but a target to which it links
1011 is not included the behavior is unspecified.
1012
1013
1014 The file created by this command is specific to the build tree
1015 and should never be installed. See the install(EXPORT) command
1016 to export targets from an installation tree.
1017
1018
1019 export(PACKAGE <name>)
1020
1021 Store the current build directory in the CMake user package reg‐
1022 istry for package <name>. The find_package command may consider
1023 the directory while searching for package <name>. This helps
1024 dependent projects find and use a package from the current
1025 project's build tree without help from the user. Note that the
1026 entry in the package registry that this command creates works
1027 only in conjunction with a package configuration file
1028 (<name>Config.cmake) that works with the build tree.
1029
1030
1031 file File manipulation command.
1032
1033 file(WRITE filename "message to write"... )
1034 file(APPEND filename "message to write"... )
1035 file(READ filename variable [LIMIT numBytes] [OFFSET offset] [HEX])
1036 file(STRINGS filename variable [LIMIT_COUNT num]
1037 [LIMIT_INPUT numBytes] [LIMIT_OUTPUT numBytes]
1038 [LENGTH_MINIMUM numBytes] [LENGTH_MAXIMUM numBytes]
1039 [NEWLINE_CONSUME] [REGEX regex]
1040 [NO_HEX_CONVERSION])
1041 file(GLOB variable [RELATIVE path] [globbing expressions]...)
1042 file(GLOB_RECURSE variable [RELATIVE path]
1043 [FOLLOW_SYMLINKS] [globbing expressions]...)
1044 file(RENAME <oldname> <newname>)
1045 file(REMOVE [file1 ...])
1046 file(REMOVE_RECURSE [file1 ...])
1047 file(MAKE_DIRECTORY [directory1 directory2 ...])
1048 file(RELATIVE_PATH variable directory file)
1049 file(TO_CMAKE_PATH path result)
1050 file(TO_NATIVE_PATH path result)
1051 file(DOWNLOAD url file [TIMEOUT timeout] [STATUS status] [LOG log]
1052 [EXPECTED_MD5 sum] [SHOW_PROGRESS])
1053
1054 WRITE will write a message into a file called 'filename'. It
1055 overwrites the file if it already exists, and creates the file
1056 if it does not exist.
1057
1058
1059 APPEND will write a message into a file same as WRITE, except it
1060 will append it to the end of the file
1061
1062
1063 READ will read the content of a file and store it into the vari‐
1064 able. It will start at the given offset and read up to numBytes.
1065 If the argument HEX is given, the binary data will be converted
1066 to hexadecimal representation and this will be stored in the
1067 variable.
1068
1069
1070 STRINGS will parse a list of ASCII strings from a file and store
1071 it in a variable. Binary data in the file are ignored. Carriage
1072 return (CR) characters are ignored. It works also for Intel Hex
1073 and Motorola S-record files, which are automatically converted
1074 to binary format when reading them. Disable this using
1075 NO_HEX_CONVERSION.
1076
1077
1078 LIMIT_COUNT sets the maximum number of strings to return.
1079 LIMIT_INPUT sets the maximum number of bytes to read from the
1080 input file. LIMIT_OUTPUT sets the maximum number of bytes to
1081 store in the output variable. LENGTH_MINIMUM sets the minimum
1082 length of a string to return. Shorter strings are ignored.
1083 LENGTH_MAXIMUM sets the maximum length of a string to return.
1084 Longer strings are split into strings no longer than the maximum
1085 length. NEWLINE_CONSUME allows newlines to be included in
1086 strings instead of terminating them.
1087
1088
1089 REGEX specifies a regular expression that a string must match to
1090 be returned. Typical usage
1091
1092
1093 file(STRINGS myfile.txt myfile)
1094
1095 stores a list in the variable "myfile" in which each item is a
1096 line from the input file.
1097
1098
1099 GLOB will generate a list of all files that match the globbing
1100 expressions and store it into the variable. Globbing expressions
1101 are similar to regular expressions, but much simpler. If RELA‐
1102 TIVE flag is specified for an expression, the results will be
1103 returned as a relative path to the given path. (We do not rec‐
1104 ommend using GLOB to collect a list of source files from your
1105 source tree. If no CMakeLists.txt file changes when a source is
1106 added or removed then the generated build system cannot know
1107 when to ask CMake to regenerate.)
1108
1109
1110 Examples of globbing expressions include:
1111
1112
1113 *.cxx - match all files with extension cxx
1114 *.vt? - match all files with extension vta,...,vtz
1115 f[3-5].txt - match files f3.txt, f4.txt, f5.txt
1116
1117 GLOB_RECURSE will generate a list similar to the regular GLOB,
1118 except it will traverse all the subdirectories of the matched
1119 directory and match the files. Subdirectories that are symlinks
1120 are only traversed if FOLLOW_SYMLINKS is given or cmake policy
1121 CMP0009 is not set to NEW. See cmake --help-policy CMP0009 for
1122 more information.
1123
1124
1125 Examples of recursive globbing include:
1126
1127
1128 /dir/*.py - match all python files in /dir and subdirectories
1129
1130 MAKE_DIRECTORY will create the given directories, also if their
1131 parent directories don't exist yet
1132
1133
1134 RENAME moves a file or directory within a filesystem, replacing
1135 the destination atomically.
1136
1137
1138 REMOVE will remove the given files, also in subdirectories
1139
1140
1141 REMOVE_RECURSE will remove the given files and directories, also
1142 non-empty directories
1143
1144
1145 RELATIVE_PATH will determine relative path from directory to the
1146 given file.
1147
1148
1149 TO_CMAKE_PATH will convert path into a cmake style path with
1150 unix /. The input can be a single path or a system path like
1151 "$ENV{PATH}". Note the double quotes around the ENV call
1152 TO_CMAKE_PATH only takes one argument.
1153
1154
1155 TO_NATIVE_PATH works just like TO_CMAKE_PATH, but will convert
1156 from a cmake style path into the native path style \ for win‐
1157 dows and / for UNIX.
1158
1159
1160 DOWNLOAD will download the given URL to the given file. If LOG
1161 var is specified a log of the download will be put in var. If
1162 STATUS var is specified the status of the operation will be put
1163 in var. The status is returned in a list of length 2. The first
1164 element is the numeric return value for the operation, and the
1165 second element is a string value for the error. A 0 numeric
1166 error means no error in the operation. If TIMEOUT time is speci‐
1167 fied, the operation will timeout after time seconds, time should
1168 be specified as an integer. If EXPECTED_MD5 sum is specified,
1169 the operation will verify that the downloaded file's actual md5
1170 sum matches the expected value. If it does not match, the opera‐
1171 tion fails with an error. If SHOW_PROGRESS is specified,
1172 progress information will be printed as status messages until
1173 the operation is complete.
1174
1175
1176 The file() command also provides COPY and INSTALL signatures:
1177
1178
1179 file(<COPY|INSTALL> files... DESTINATION <dir>
1180 [FILE_PERMISSIONS permissions...]
1181 [DIRECTORY_PERMISSIONS permissions...]
1182 [NO_SOURCE_PERMISSIONS] [USE_SOURCE_PERMISSIONS]
1183 [FILES_MATCHING]
1184 [[PATTERN <pattern> | REGEX <regex>]
1185 [EXCLUDE] [PERMISSIONS permissions...]] [...])
1186
1187 The COPY signature copies files, directories, and symlinks to a
1188 destination folder. Relative input paths are evaluated with
1189 respect to the current source directory, and a relative destina‐
1190 tion is evaluated with respect to the current build directory.
1191 Copying preserves input file timestamps, and optimizes out a
1192 file if it exists at the destination with the same timestamp.
1193 Copying preserves input permissions unless explicit permissions
1194 or NO_SOURCE_PERMISSIONS are given (default is USE_SOURCE_PER‐
1195 MISSIONS). See the install(DIRECTORY) command for documentation
1196 of permissions, PATTERN, REGEX, and EXCLUDE options.
1197
1198
1199 The INSTALL signature differs slightly from COPY: it prints sta‐
1200 tus messages, and NO_SOURCE_PERMISSIONS is default. Installa‐
1201 tion scripts generated by the install() command use this signa‐
1202 ture (with some undocumented options for internal use).
1203
1204
1205 find_file
1206 Find the full path to a file.
1207
1208 find_file(<VAR> name1 [path1 path2 ...])
1209
1210 This is the short-hand signature for the command that is suffi‐
1211 cient in many cases. It is the same as find_file(<VAR> name1
1212 [PATHS path1 path2 ...])
1213
1214
1215 find_file(
1216 <VAR>
1217 name | NAMES name1 [name2 ...]
1218 [HINTS path1 [path2 ... ENV var]]
1219 [PATHS path1 [path2 ... ENV var]]
1220 [PATH_SUFFIXES suffix1 [suffix2 ...]]
1221 [DOC "cache documentation string"]
1222 [NO_DEFAULT_PATH]
1223 [NO_CMAKE_ENVIRONMENT_PATH]
1224 [NO_CMAKE_PATH]
1225 [NO_SYSTEM_ENVIRONMENT_PATH]
1226 [NO_CMAKE_SYSTEM_PATH]
1227 [CMAKE_FIND_ROOT_PATH_BOTH |
1228 ONLY_CMAKE_FIND_ROOT_PATH |
1229 NO_CMAKE_FIND_ROOT_PATH]
1230 )
1231
1232 This command is used to find a full path to named file. A cache
1233 entry named by <VAR> is created to store the result of this com‐
1234 mand. If the full path to a file is found the result is stored
1235 in the variable and the search will not be repeated unless the
1236 variable is cleared. If nothing is found, the result will be
1237 <VAR>-NOTFOUND, and the search will be attempted again the next
1238 time find_file is invoked with the same variable. The name of
1239 the full path to a file that is searched for is specified by the
1240 names listed after the NAMES argument. Additional search loca‐
1241 tions can be specified after the PATHS argument. If ENV var is
1242 found in the HINTS or PATHS section the environment variable var
1243 will be read and converted from a system environment variable to
1244 a cmake style list of paths. For example ENV PATH would be a
1245 way to list the system path variable. The argument after DOC
1246 will be used for the documentation string in the cache.
1247 PATH_SUFFIXES specifies additional subdirectories to check below
1248 each search path.
1249
1250
1251 If NO_DEFAULT_PATH is specified, then no additional paths are
1252 added to the search. If NO_DEFAULT_PATH is not specified, the
1253 search process is as follows:
1254
1255
1256 1. Search paths specified in cmake-specific cache variables.
1257 These are intended to be used on the command line with a
1258 -DVAR=value. This can be skipped if NO_CMAKE_PATH is passed.
1259
1260
1261 <prefix>/include for each <prefix> in CMAKE_PREFIX_PATH
1262 CMAKE_INCLUDE_PATH
1263 CMAKE_FRAMEWORK_PATH
1264
1265 2. Search paths specified in cmake-specific environment vari‐
1266 ables. These are intended to be set in the user's shell config‐
1267 uration. This can be skipped if NO_CMAKE_ENVIRONMENT_PATH is
1268 passed.
1269
1270
1271 <prefix>/include for each <prefix> in CMAKE_PREFIX_PATH
1272 CMAKE_INCLUDE_PATH
1273 CMAKE_FRAMEWORK_PATH
1274
1275 3. Search the paths specified by the HINTS option. These should
1276 be paths computed by system introspection, such as a hint pro‐
1277 vided by the location of another item already found. Hard-coded
1278 guesses should be specified with the PATHS option.
1279
1280
1281 4. Search the standard system environment variables. This can be
1282 skipped if NO_SYSTEM_ENVIRONMENT_PATH is an argument.
1283
1284
1285 PATH
1286 INCLUDE
1287
1288 5. Search cmake variables defined in the Platform files for the
1289 current system. This can be skipped if NO_CMAKE_SYSTEM_PATH is
1290 passed.
1291
1292
1293 <prefix>/include for each <prefix> in CMAKE_SYSTEM_PREFIX_PATH
1294 CMAKE_SYSTEM_INCLUDE_PATH
1295 CMAKE_SYSTEM_FRAMEWORK_PATH
1296
1297 6. Search the paths specified by the PATHS option or in the
1298 short-hand version of the command. These are typically
1299 hard-coded guesses.
1300
1301
1302 On Darwin or systems supporting OS X Frameworks, the cmake vari‐
1303 able CMAKE_FIND_FRAMEWORK can be set to empty or one of the
1304 following:
1305
1306
1307 "FIRST" - Try to find frameworks before standard
1308 libraries or headers. This is the default on Darwin.
1309 "LAST" - Try to find frameworks after standard
1310 libraries or headers.
1311 "ONLY" - Only try to find frameworks.
1312 "NEVER" - Never try to find frameworks.
1313
1314 On Darwin or systems supporting OS X Application Bundles, the
1315 cmake variable CMAKE_FIND_APPBUNDLE can be set to empty or one
1316 of the following:
1317
1318
1319 "FIRST" - Try to find application bundles before standard
1320 programs. This is the default on Darwin.
1321 "LAST" - Try to find application bundles after standard
1322 programs.
1323 "ONLY" - Only try to find application bundles.
1324 "NEVER" - Never try to find application bundles.
1325
1326 The CMake variable CMAKE_FIND_ROOT_PATH specifies one or more
1327 directories to be prepended to all other search directories.
1328 This effectively "re-roots" the entire search under given loca‐
1329 tions. By default it is empty. It is especially useful when
1330 cross-compiling to point to the root directory of the target
1331 environment and CMake will search there too. By default at first
1332 the directories listed in CMAKE_FIND_ROOT_PATH and then the
1333 non-rooted directories will be searched. The default behavior
1334 can be adjusted by setting CMAKE_FIND_ROOT_PATH_MODE_INCLUDE.
1335 This behavior can be manually overridden on a per-call basis. By
1336 using CMAKE_FIND_ROOT_PATH_BOTH the search order will be as
1337 described above. If NO_CMAKE_FIND_ROOT_PATH is used then
1338 CMAKE_FIND_ROOT_PATH will not be used. If
1339 ONLY_CMAKE_FIND_ROOT_PATH is used then only the re-rooted direc‐
1340 tories will be searched.
1341
1342
1343 The default search order is designed to be most-specific to
1344 least-specific for common use cases. Projects may override the
1345 order by simply calling the command multiple times and using the
1346 NO_* options:
1347
1348
1349 find_file(<VAR> NAMES name PATHS paths... NO_DEFAULT_PATH)
1350 find_file(<VAR> NAMES name)
1351
1352 Once one of the calls succeeds the result variable will be set
1353 and stored in the cache so that no call will search again.
1354
1355
1356 find_library
1357 Find a library.
1358
1359 find_library(<VAR> name1 [path1 path2 ...])
1360
1361 This is the short-hand signature for the command that is suffi‐
1362 cient in many cases. It is the same as find_library(<VAR> name1
1363 [PATHS path1 path2 ...])
1364
1365
1366 find_library(
1367 <VAR>
1368 name | NAMES name1 [name2 ...]
1369 [HINTS path1 [path2 ... ENV var]]
1370 [PATHS path1 [path2 ... ENV var]]
1371 [PATH_SUFFIXES suffix1 [suffix2 ...]]
1372 [DOC "cache documentation string"]
1373 [NO_DEFAULT_PATH]
1374 [NO_CMAKE_ENVIRONMENT_PATH]
1375 [NO_CMAKE_PATH]
1376 [NO_SYSTEM_ENVIRONMENT_PATH]
1377 [NO_CMAKE_SYSTEM_PATH]
1378 [CMAKE_FIND_ROOT_PATH_BOTH |
1379 ONLY_CMAKE_FIND_ROOT_PATH |
1380 NO_CMAKE_FIND_ROOT_PATH]
1381 )
1382
1383 This command is used to find a library. A cache entry named by
1384 <VAR> is created to store the result of this command. If the
1385 library is found the result is stored in the variable and the
1386 search will not be repeated unless the variable is cleared. If
1387 nothing is found, the result will be <VAR>-NOTFOUND, and the
1388 search will be attempted again the next time find_library is
1389 invoked with the same variable. The name of the library that is
1390 searched for is specified by the names listed after the NAMES
1391 argument. Additional search locations can be specified after
1392 the PATHS argument. If ENV var is found in the HINTS or PATHS
1393 section the environment variable var will be read and converted
1394 from a system environment variable to a cmake style list of
1395 paths. For example ENV PATH would be a way to list the system
1396 path variable. The argument after DOC will be used for the docu‐
1397 mentation string in the cache. PATH_SUFFIXES specifies addi‐
1398 tional subdirectories to check below each search path.
1399
1400
1401 If NO_DEFAULT_PATH is specified, then no additional paths are
1402 added to the search. If NO_DEFAULT_PATH is not specified, the
1403 search process is as follows:
1404
1405
1406 1. Search paths specified in cmake-specific cache variables.
1407 These are intended to be used on the command line with a
1408 -DVAR=value. This can be skipped if NO_CMAKE_PATH is passed.
1409
1410
1411 <prefix>/lib for each <prefix> in CMAKE_PREFIX_PATH
1412 CMAKE_LIBRARY_PATH
1413 CMAKE_FRAMEWORK_PATH
1414
1415 2. Search paths specified in cmake-specific environment vari‐
1416 ables. These are intended to be set in the user's shell config‐
1417 uration. This can be skipped if NO_CMAKE_ENVIRONMENT_PATH is
1418 passed.
1419
1420
1421 <prefix>/lib for each <prefix> in CMAKE_PREFIX_PATH
1422 CMAKE_LIBRARY_PATH
1423 CMAKE_FRAMEWORK_PATH
1424
1425 3. Search the paths specified by the HINTS option. These should
1426 be paths computed by system introspection, such as a hint pro‐
1427 vided by the location of another item already found. Hard-coded
1428 guesses should be specified with the PATHS option.
1429
1430
1431 4. Search the standard system environment variables. This can be
1432 skipped if NO_SYSTEM_ENVIRONMENT_PATH is an argument.
1433
1434
1435 PATH
1436 LIB
1437
1438 5. Search cmake variables defined in the Platform files for the
1439 current system. This can be skipped if NO_CMAKE_SYSTEM_PATH is
1440 passed.
1441
1442
1443 <prefix>/lib for each <prefix> in CMAKE_SYSTEM_PREFIX_PATH
1444 CMAKE_SYSTEM_LIBRARY_PATH
1445 CMAKE_SYSTEM_FRAMEWORK_PATH
1446
1447 6. Search the paths specified by the PATHS option or in the
1448 short-hand version of the command. These are typically
1449 hard-coded guesses.
1450
1451
1452 On Darwin or systems supporting OS X Frameworks, the cmake vari‐
1453 able CMAKE_FIND_FRAMEWORK can be set to empty or one of the
1454 following:
1455
1456
1457 "FIRST" - Try to find frameworks before standard
1458 libraries or headers. This is the default on Darwin.
1459 "LAST" - Try to find frameworks after standard
1460 libraries or headers.
1461 "ONLY" - Only try to find frameworks.
1462 "NEVER" - Never try to find frameworks.
1463
1464 On Darwin or systems supporting OS X Application Bundles, the
1465 cmake variable CMAKE_FIND_APPBUNDLE can be set to empty or one
1466 of the following:
1467
1468
1469 "FIRST" - Try to find application bundles before standard
1470 programs. This is the default on Darwin.
1471 "LAST" - Try to find application bundles after standard
1472 programs.
1473 "ONLY" - Only try to find application bundles.
1474 "NEVER" - Never try to find application bundles.
1475
1476 The CMake variable CMAKE_FIND_ROOT_PATH specifies one or more
1477 directories to be prepended to all other search directories.
1478 This effectively "re-roots" the entire search under given loca‐
1479 tions. By default it is empty. It is especially useful when
1480 cross-compiling to point to the root directory of the target
1481 environment and CMake will search there too. By default at first
1482 the directories listed in CMAKE_FIND_ROOT_PATH and then the
1483 non-rooted directories will be searched. The default behavior
1484 can be adjusted by setting CMAKE_FIND_ROOT_PATH_MODE_LIBRARY.
1485 This behavior can be manually overridden on a per-call basis. By
1486 using CMAKE_FIND_ROOT_PATH_BOTH the search order will be as
1487 described above. If NO_CMAKE_FIND_ROOT_PATH is used then
1488 CMAKE_FIND_ROOT_PATH will not be used. If
1489 ONLY_CMAKE_FIND_ROOT_PATH is used then only the re-rooted direc‐
1490 tories will be searched.
1491
1492
1493 The default search order is designed to be most-specific to
1494 least-specific for common use cases. Projects may override the
1495 order by simply calling the command multiple times and using the
1496 NO_* options:
1497
1498
1499 find_library(<VAR> NAMES name PATHS paths... NO_DEFAULT_PATH)
1500 find_library(<VAR> NAMES name)
1501
1502 Once one of the calls succeeds the result variable will be set
1503 and stored in the cache so that no call will search again.
1504
1505
1506 If the library found is a framework, then VAR will be set to the
1507 full path to the framework <fullPath>/A.framework. When a full
1508 path to a framework is used as a library, CMake will use a
1509 -framework A, and a -F<fullPath> to link the framework to the
1510 target.
1511
1512
1513 find_package
1514 Load settings for an external project.
1515
1516 find_package(<package> [version] [EXACT] [QUIET]
1517 [[REQUIRED|COMPONENTS] [components...]]
1518 [NO_POLICY_SCOPE])
1519
1520 Finds and loads settings from an external project. <pack‐
1521 age>_FOUND will be set to indicate whether the package was
1522 found. When the package is found package-specific information
1523 is provided through variables documented by the package itself.
1524 The QUIET option disables messages if the package cannot be
1525 found. The REQUIRED option stops processing with an error mes‐
1526 sage if the package cannot be found. A package-specific list of
1527 components may be listed after the REQUIRED option or after the
1528 COMPONENTS option if no REQUIRED option is given. The [version]
1529 argument requests a version with which the package found should
1530 be compatible (format is major[.minor[.patch[.tweak]]]). The
1531 EXACT option requests that the version be matched exactly. If
1532 no [version] is given to a recursive invocation inside a
1533 find-module, the [version] and EXACT arguments are forwarded
1534 automatically from the outer call. Version support is currently
1535 provided only on a package-by-package basis (details below).
1536
1537
1538 User code should generally look for packages using the above
1539 simple signature. The remainder of this command documentation
1540 specifies the full command signature and details of the search
1541 process. Project maintainers wishing to provide a package to be
1542 found by this command are encouraged to read on.
1543
1544
1545 The command has two modes by which it searches for packages:
1546 "Module" mode and "Config" mode. Module mode is available when
1547 the command is invoked with the above reduced signature. CMake
1548 searches for a file called "Find<package>.cmake" in the
1549 CMAKE_MODULE_PATH followed by the CMake installation. If the
1550 file is found, it is read and processed by CMake. It is respon‐
1551 sible for finding the package, checking the version, and produc‐
1552 ing any needed messages. Many find-modules provide limited or
1553 no support for versioning; check the module documentation. If
1554 no module is found the command proceeds to Config mode.
1555
1556
1557 The complete Config mode command signature is:
1558
1559
1560 find_package(<package> [version] [EXACT] [QUIET]
1561 [[REQUIRED|COMPONENTS] [components...]] [NO_MODULE]
1562 [NO_POLICY_SCOPE]
1563 [NAMES name1 [name2 ...]]
1564 [CONFIGS config1 [config2 ...]]
1565 [HINTS path1 [path2 ... ]]
1566 [PATHS path1 [path2 ... ]]
1567 [PATH_SUFFIXES suffix1 [suffix2 ...]]
1568 [NO_DEFAULT_PATH]
1569 [NO_CMAKE_ENVIRONMENT_PATH]
1570 [NO_CMAKE_PATH]
1571 [NO_SYSTEM_ENVIRONMENT_PATH]
1572 [NO_CMAKE_PACKAGE_REGISTRY]
1573 [NO_CMAKE_BUILDS_PATH]
1574 [NO_CMAKE_SYSTEM_PATH]
1575 [CMAKE_FIND_ROOT_PATH_BOTH |
1576 ONLY_CMAKE_FIND_ROOT_PATH |
1577 NO_CMAKE_FIND_ROOT_PATH])
1578
1579 The NO_MODULE option may be used to skip Module mode explicitly.
1580 It is also implied by use of options not specified in the
1581 reduced signature.
1582
1583
1584 Config mode attempts to locate a configuration file provided by
1585 the package to be found. A cache entry called <package>_DIR is
1586 created to hold the directory containing the file. By default
1587 the command searches for a package with the name <package>. If
1588 the NAMES option is given the names following it are used
1589 instead of <package>. The command searches for a file called
1590 "<name>Config.cmake" or "<lower-case-name>-config.cmake" for
1591 each name specified. A replacement set of possible configura‐
1592 tion file names may be given using the CONFIGS option. The
1593 search procedure is specified below. Once found, the configura‐
1594 tion file is read and processed by CMake. Since the file is
1595 provided by the package it already knows the location of package
1596 contents. The full path to the configuration file is stored in
1597 the cmake variable <package>_CONFIG.
1598
1599
1600 All configuration files which have been considered by CMake
1601 while searching for an installation of the package with an
1602 appropriate version are stored in the cmake variable <pack‐
1603 age>_CONSIDERED_CONFIGS, the associated versions in <pack‐
1604 age>_CONSIDERED_VERSIONS.
1605
1606
1607 If the package configuration file cannot be found CMake will
1608 generate an error describing the problem unless the QUIET argu‐
1609 ment is specified. If REQUIRED is specified and the package is
1610 not found a fatal error is generated and the configure step
1611 stops executing. If <package>_DIR has been set to a directory
1612 not containing a configuration file CMake will ignore it and
1613 search from scratch.
1614
1615
1616 When the [version] argument is given Config mode will only find
1617 a version of the package that claims compatibility with the
1618 requested version (format is major[.minor[.patch[.tweak]]]). If
1619 the EXACT option is given only a version of the package claiming
1620 an exact match of the requested version may be found. CMake
1621 does not establish any convention for the meaning of version
1622 numbers. Package version numbers are checked by "version" files
1623 provided by the packages themselves. For a candidate package
1624 configuration file "<config-file>.cmake" the corresponding ver‐
1625 sion file is located next to it and named either "<con‐
1626 fig-file>-version.cmake" or "<config-file>Version.cmake". If no
1627 such version file is available then the configuration file is
1628 assumed to not be compatible with any requested version. When a
1629 version file is found it is loaded to check the requested ver‐
1630 sion number. The version file is loaded in a nested scope in
1631 which the following variables have been defined:
1632
1633
1634 PACKAGE_FIND_NAME = the <package> name
1635 PACKAGE_FIND_VERSION = full requested version string
1636 PACKAGE_FIND_VERSION_MAJOR = major version if requested, else 0
1637 PACKAGE_FIND_VERSION_MINOR = minor version if requested, else 0
1638 PACKAGE_FIND_VERSION_PATCH = patch version if requested, else 0
1639 PACKAGE_FIND_VERSION_TWEAK = tweak version if requested, else 0
1640 PACKAGE_FIND_VERSION_COUNT = number of version components, 0 to 4
1641
1642 The version file checks whether it satisfies the requested ver‐
1643 sion and sets these variables:
1644
1645
1646 PACKAGE_VERSION = full provided version string
1647 PACKAGE_VERSION_EXACT = true if version is exact match
1648 PACKAGE_VERSION_COMPATIBLE = true if version is compatible
1649 PACKAGE_VERSION_UNSUITABLE = true if unsuitable as any version
1650
1651 These variables are checked by the find_package command to
1652 determine whether the configuration file provides an acceptable
1653 version. They are not available after the find_package call
1654 returns. If the version is acceptable the following variables
1655 are set:
1656
1657
1658 <package>_VERSION = full provided version string
1659 <package>_VERSION_MAJOR = major version if provided, else 0
1660 <package>_VERSION_MINOR = minor version if provided, else 0
1661 <package>_VERSION_PATCH = patch version if provided, else 0
1662 <package>_VERSION_TWEAK = tweak version if provided, else 0
1663 <package>_VERSION_COUNT = number of version components, 0 to 4
1664
1665 and the corresponding package configuration file is loaded.
1666 When multiple package configuration files are available whose
1667 version files claim compatibility with the version requested it
1668 is unspecified which one is chosen. No attempt is made to
1669 choose a highest or closest version number.
1670
1671
1672 Config mode provides an elaborate interface and search proce‐
1673 dure. Much of the interface is provided for completeness and
1674 for use internally by find-modules loaded by Module mode. Most
1675 user code should simply call
1676
1677
1678 find_package(<package> [major[.minor]] [EXACT] [REQUIRED|QUIET])
1679
1680 in order to find a package. Package maintainers providing CMake
1681 package configuration files are encouraged to name and install
1682 them such that the procedure outlined below will find them with‐
1683 out requiring use of additional options.
1684
1685
1686 CMake constructs a set of possible installation prefixes for the
1687 package. Under each prefix several directories are searched for
1688 a configuration file. The tables below show the directories
1689 searched. Each entry is meant for installation trees following
1690 Windows (W), UNIX (U), or Apple (A) conventions.
1691
1692
1693 <prefix>/ (W)
1694 <prefix>/(cmake|CMake)/ (W)
1695 <prefix>/<name>*/ (W)
1696 <prefix>/<name>*/(cmake|CMake)/ (W)
1697 <prefix>/(share|lib)/cmake/<name>*/ (U)
1698 <prefix>/(share|lib)/<name>*/ (U)
1699 <prefix>/(share|lib)/<name>*/(cmake|CMake)/ (U)
1700
1701 On systems supporting OS X Frameworks and Application Bundles
1702 the following directories are searched for frameworks or bundles
1703 containing a configuration file:
1704
1705
1706 <prefix>/<name>.framework/Resources/ (A)
1707 <prefix>/<name>.framework/Resources/CMake/ (A)
1708 <prefix>/<name>.framework/Versions/*/Resources/ (A)
1709 <prefix>/<name>.framework/Versions/*/Resources/CMake/ (A)
1710 <prefix>/<name>.app/Contents/Resources/ (A)
1711 <prefix>/<name>.app/Contents/Resources/CMake/ (A)
1712
1713 In all cases the <name> is treated as case-insensitive and cor‐
1714 responds to any of the names specified (<package> or names given
1715 by NAMES). If PATH_SUFFIXES is specified the suffixes are
1716 appended to each (W) or (U) directory entry one-by-one.
1717
1718
1719 This set of directories is intended to work in cooperation with
1720 projects that provide configuration files in their installation
1721 trees. Directories above marked with (W) are intended for
1722 installations on Windows where the prefix may point at the top
1723 of an application's installation directory. Those marked with
1724 (U) are intended for installations on UNIX platforms where the
1725 prefix is shared by multiple packages. This is merely a conven‐
1726 tion, so all (W) and (U) directories are still searched on all
1727 platforms. Directories marked with (A) are intended for instal‐
1728 lations on Apple platforms. The cmake variables
1729 CMAKE_FIND_FRAMEWORK and CMAKE_FIND_APPBUNDLE determine the
1730 order of preference as specified below.
1731
1732
1733 The set of installation prefixes is constructed using the fol‐
1734 lowing steps. If NO_DEFAULT_PATH is specified all NO_* options
1735 are enabled.
1736
1737
1738 1. Search paths specified in cmake-specific cache variables.
1739 These are intended to be used on the command line with a
1740 -DVAR=value. This can be skipped if NO_CMAKE_PATH is passed.
1741
1742
1743 CMAKE_PREFIX_PATH
1744 CMAKE_FRAMEWORK_PATH
1745 CMAKE_APPBUNDLE_PATH
1746
1747 2. Search paths specified in cmake-specific environment vari‐
1748 ables. These are intended to be set in the user's shell config‐
1749 uration. This can be skipped if NO_CMAKE_ENVIRONMENT_PATH is
1750 passed.
1751
1752
1753 <package>_DIR
1754 CMAKE_PREFIX_PATH
1755 CMAKE_FRAMEWORK_PATH
1756 CMAKE_APPBUNDLE_PATH
1757
1758 3. Search paths specified by the HINTS option. These should be
1759 paths computed by system introspection, such as a hint provided
1760 by the location of another item already found. Hard-coded
1761 guesses should be specified with the PATHS option.
1762
1763
1764 4. Search the standard system environment variables. This can be
1765 skipped if NO_SYSTEM_ENVIRONMENT_PATH is passed. Path entries
1766 ending in "/bin" or "/sbin" are automatically converted to their
1767 parent directories.
1768
1769
1770 PATH
1771
1772 5. Search project build trees recently configured in a CMake
1773 GUI. This can be skipped if NO_CMAKE_BUILDS_PATH is passed. It
1774 is intended for the case when a user is building multiple depen‐
1775 dent projects one after another.
1776
1777
1778 6. Search paths stored in the CMake user package registry. This
1779 can be skipped if NO_CMAKE_PACKAGE_REGISTRY is passed. Paths
1780 are stored in the registry when CMake configures a project that
1781 invokes export(PACKAGE <name>). See the export(PACKAGE) command
1782 documentation for more details.
1783
1784
1785 7. Search cmake variables defined in the Platform files for the
1786 current system. This can be skipped if NO_CMAKE_SYSTEM_PATH is
1787 passed.
1788
1789
1790 CMAKE_SYSTEM_PREFIX_PATH
1791 CMAKE_SYSTEM_FRAMEWORK_PATH
1792 CMAKE_SYSTEM_APPBUNDLE_PATH
1793
1794 8. Search paths specified by the PATHS option. These are typi‐
1795 cally hard-coded guesses.
1796
1797
1798 On Darwin or systems supporting OS X Frameworks, the cmake vari‐
1799 able CMAKE_FIND_FRAMEWORK can be set to empty or one of the
1800 following:
1801
1802
1803 "FIRST" - Try to find frameworks before standard
1804 libraries or headers. This is the default on Darwin.
1805 "LAST" - Try to find frameworks after standard
1806 libraries or headers.
1807 "ONLY" - Only try to find frameworks.
1808 "NEVER" - Never try to find frameworks.
1809
1810 On Darwin or systems supporting OS X Application Bundles, the
1811 cmake variable CMAKE_FIND_APPBUNDLE can be set to empty or one
1812 of the following:
1813
1814
1815 "FIRST" - Try to find application bundles before standard
1816 programs. This is the default on Darwin.
1817 "LAST" - Try to find application bundles after standard
1818 programs.
1819 "ONLY" - Only try to find application bundles.
1820 "NEVER" - Never try to find application bundles.
1821
1822 The CMake variable CMAKE_FIND_ROOT_PATH specifies one or more
1823 directories to be prepended to all other search directories.
1824 This effectively "re-roots" the entire search under given loca‐
1825 tions. By default it is empty. It is especially useful when
1826 cross-compiling to point to the root directory of the target
1827 environment and CMake will search there too. By default at first
1828 the directories listed in CMAKE_FIND_ROOT_PATH and then the
1829 non-rooted directories will be searched. The default behavior
1830 can be adjusted by setting CMAKE_FIND_ROOT_PATH_MODE_PACKAGE.
1831 This behavior can be manually overridden on a per-call basis. By
1832 using CMAKE_FIND_ROOT_PATH_BOTH the search order will be as
1833 described above. If NO_CMAKE_FIND_ROOT_PATH is used then
1834 CMAKE_FIND_ROOT_PATH will not be used. If
1835 ONLY_CMAKE_FIND_ROOT_PATH is used then only the re-rooted direc‐
1836 tories will be searched.
1837
1838
1839 The default search order is designed to be most-specific to
1840 least-specific for common use cases. Projects may override the
1841 order by simply calling the command multiple times and using the
1842 NO_* options:
1843
1844
1845 find_package(<package> PATHS paths... NO_DEFAULT_PATH)
1846 find_package(<package>)
1847
1848 Once one of the calls succeeds the result variable will be set
1849 and stored in the cache so that no call will search again.
1850
1851
1852 See the cmake_policy() command documentation for discussion of
1853 the NO_POLICY_SCOPE option.
1854
1855
1856 find_path
1857 Find the directory containing a file.
1858
1859 find_path(<VAR> name1 [path1 path2 ...])
1860
1861 This is the short-hand signature for the command that is suffi‐
1862 cient in many cases. It is the same as find_path(<VAR> name1
1863 [PATHS path1 path2 ...])
1864
1865
1866 find_path(
1867 <VAR>
1868 name | NAMES name1 [name2 ...]
1869 [HINTS path1 [path2 ... ENV var]]
1870 [PATHS path1 [path2 ... ENV var]]
1871 [PATH_SUFFIXES suffix1 [suffix2 ...]]
1872 [DOC "cache documentation string"]
1873 [NO_DEFAULT_PATH]
1874 [NO_CMAKE_ENVIRONMENT_PATH]
1875 [NO_CMAKE_PATH]
1876 [NO_SYSTEM_ENVIRONMENT_PATH]
1877 [NO_CMAKE_SYSTEM_PATH]
1878 [CMAKE_FIND_ROOT_PATH_BOTH |
1879 ONLY_CMAKE_FIND_ROOT_PATH |
1880 NO_CMAKE_FIND_ROOT_PATH]
1881 )
1882
1883 This command is used to find a directory containing the named
1884 file. A cache entry named by <VAR> is created to store the
1885 result of this command. If the file in a directory is found the
1886 result is stored in the variable and the search will not be
1887 repeated unless the variable is cleared. If nothing is found,
1888 the result will be <VAR>-NOTFOUND, and the search will be
1889 attempted again the next time find_path is invoked with the same
1890 variable. The name of the file in a directory that is searched
1891 for is specified by the names listed after the NAMES argument.
1892 Additional search locations can be specified after the PATHS
1893 argument. If ENV var is found in the HINTS or PATHS section the
1894 environment variable var will be read and converted from a sys‐
1895 tem environment variable to a cmake style list of paths. For
1896 example ENV PATH would be a way to list the system path vari‐
1897 able. The argument after DOC will be used for the documentation
1898 string in the cache. PATH_SUFFIXES specifies additional subdi‐
1899 rectories to check below each search path.
1900
1901
1902 If NO_DEFAULT_PATH is specified, then no additional paths are
1903 added to the search. If NO_DEFAULT_PATH is not specified, the
1904 search process is as follows:
1905
1906
1907 1. Search paths specified in cmake-specific cache variables.
1908 These are intended to be used on the command line with a
1909 -DVAR=value. This can be skipped if NO_CMAKE_PATH is passed.
1910
1911
1912 <prefix>/include for each <prefix> in CMAKE_PREFIX_PATH
1913 CMAKE_INCLUDE_PATH
1914 CMAKE_FRAMEWORK_PATH
1915
1916 2. Search paths specified in cmake-specific environment vari‐
1917 ables. These are intended to be set in the user's shell config‐
1918 uration. This can be skipped if NO_CMAKE_ENVIRONMENT_PATH is
1919 passed.
1920
1921
1922 <prefix>/include for each <prefix> in CMAKE_PREFIX_PATH
1923 CMAKE_INCLUDE_PATH
1924 CMAKE_FRAMEWORK_PATH
1925
1926 3. Search the paths specified by the HINTS option. These should
1927 be paths computed by system introspection, such as a hint pro‐
1928 vided by the location of another item already found. Hard-coded
1929 guesses should be specified with the PATHS option.
1930
1931
1932 4. Search the standard system environment variables. This can be
1933 skipped if NO_SYSTEM_ENVIRONMENT_PATH is an argument.
1934
1935
1936 PATH
1937 INCLUDE
1938
1939 5. Search cmake variables defined in the Platform files for the
1940 current system. This can be skipped if NO_CMAKE_SYSTEM_PATH is
1941 passed.
1942
1943
1944 <prefix>/include for each <prefix> in CMAKE_SYSTEM_PREFIX_PATH
1945 CMAKE_SYSTEM_INCLUDE_PATH
1946 CMAKE_SYSTEM_FRAMEWORK_PATH
1947
1948 6. Search the paths specified by the PATHS option or in the
1949 short-hand version of the command. These are typically
1950 hard-coded guesses.
1951
1952
1953 On Darwin or systems supporting OS X Frameworks, the cmake vari‐
1954 able CMAKE_FIND_FRAMEWORK can be set to empty or one of the
1955 following:
1956
1957
1958 "FIRST" - Try to find frameworks before standard
1959 libraries or headers. This is the default on Darwin.
1960 "LAST" - Try to find frameworks after standard
1961 libraries or headers.
1962 "ONLY" - Only try to find frameworks.
1963 "NEVER" - Never try to find frameworks.
1964
1965 On Darwin or systems supporting OS X Application Bundles, the
1966 cmake variable CMAKE_FIND_APPBUNDLE can be set to empty or one
1967 of the following:
1968
1969
1970 "FIRST" - Try to find application bundles before standard
1971 programs. This is the default on Darwin.
1972 "LAST" - Try to find application bundles after standard
1973 programs.
1974 "ONLY" - Only try to find application bundles.
1975 "NEVER" - Never try to find application bundles.
1976
1977 The CMake variable CMAKE_FIND_ROOT_PATH specifies one or more
1978 directories to be prepended to all other search directories.
1979 This effectively "re-roots" the entire search under given loca‐
1980 tions. By default it is empty. It is especially useful when
1981 cross-compiling to point to the root directory of the target
1982 environment and CMake will search there too. By default at first
1983 the directories listed in CMAKE_FIND_ROOT_PATH and then the
1984 non-rooted directories will be searched. The default behavior
1985 can be adjusted by setting CMAKE_FIND_ROOT_PATH_MODE_INCLUDE.
1986 This behavior can be manually overridden on a per-call basis. By
1987 using CMAKE_FIND_ROOT_PATH_BOTH the search order will be as
1988 described above. If NO_CMAKE_FIND_ROOT_PATH is used then
1989 CMAKE_FIND_ROOT_PATH will not be used. If
1990 ONLY_CMAKE_FIND_ROOT_PATH is used then only the re-rooted direc‐
1991 tories will be searched.
1992
1993
1994 The default search order is designed to be most-specific to
1995 least-specific for common use cases. Projects may override the
1996 order by simply calling the command multiple times and using the
1997 NO_* options:
1998
1999
2000 find_path(<VAR> NAMES name PATHS paths... NO_DEFAULT_PATH)
2001 find_path(<VAR> NAMES name)
2002
2003 Once one of the calls succeeds the result variable will be set
2004 and stored in the cache so that no call will search again.
2005
2006
2007 When searching for frameworks, if the file is specified as
2008 A/b.h, then the framework search will look for A.framework/Head‐
2009 ers/b.h. If that is found the path will be set to the path to
2010 the framework. CMake will convert this to the correct -F option
2011 to include the file.
2012
2013
2014 find_program
2015 Find an executable program.
2016
2017 find_program(<VAR> name1 [path1 path2 ...])
2018
2019 This is the short-hand signature for the command that is suffi‐
2020 cient in many cases. It is the same as find_program(<VAR> name1
2021 [PATHS path1 path2 ...])
2022
2023
2024 find_program(
2025 <VAR>
2026 name | NAMES name1 [name2 ...]
2027 [HINTS path1 [path2 ... ENV var]]
2028 [PATHS path1 [path2 ... ENV var]]
2029 [PATH_SUFFIXES suffix1 [suffix2 ...]]
2030 [DOC "cache documentation string"]
2031 [NO_DEFAULT_PATH]
2032 [NO_CMAKE_ENVIRONMENT_PATH]
2033 [NO_CMAKE_PATH]
2034 [NO_SYSTEM_ENVIRONMENT_PATH]
2035 [NO_CMAKE_SYSTEM_PATH]
2036 [CMAKE_FIND_ROOT_PATH_BOTH |
2037 ONLY_CMAKE_FIND_ROOT_PATH |
2038 NO_CMAKE_FIND_ROOT_PATH]
2039 )
2040
2041 This command is used to find a program. A cache entry named by
2042 <VAR> is created to store the result of this command. If the
2043 program is found the result is stored in the variable and the
2044 search will not be repeated unless the variable is cleared. If
2045 nothing is found, the result will be <VAR>-NOTFOUND, and the
2046 search will be attempted again the next time find_program is
2047 invoked with the same variable. The name of the program that is
2048 searched for is specified by the names listed after the NAMES
2049 argument. Additional search locations can be specified after
2050 the PATHS argument. If ENV var is found in the HINTS or PATHS
2051 section the environment variable var will be read and converted
2052 from a system environment variable to a cmake style list of
2053 paths. For example ENV PATH would be a way to list the system
2054 path variable. The argument after DOC will be used for the docu‐
2055 mentation string in the cache. PATH_SUFFIXES specifies addi‐
2056 tional subdirectories to check below each search path.
2057
2058
2059 If NO_DEFAULT_PATH is specified, then no additional paths are
2060 added to the search. If NO_DEFAULT_PATH is not specified, the
2061 search process is as follows:
2062
2063
2064 1. Search paths specified in cmake-specific cache variables.
2065 These are intended to be used on the command line with a
2066 -DVAR=value. This can be skipped if NO_CMAKE_PATH is passed.
2067
2068
2069 <prefix>/[s]bin for each <prefix> in CMAKE_PREFIX_PATH
2070 CMAKE_PROGRAM_PATH
2071 CMAKE_APPBUNDLE_PATH
2072
2073 2. Search paths specified in cmake-specific environment vari‐
2074 ables. These are intended to be set in the user's shell config‐
2075 uration. This can be skipped if NO_CMAKE_ENVIRONMENT_PATH is
2076 passed.
2077
2078
2079 <prefix>/[s]bin for each <prefix> in CMAKE_PREFIX_PATH
2080 CMAKE_PROGRAM_PATH
2081 CMAKE_APPBUNDLE_PATH
2082
2083 3. Search the paths specified by the HINTS option. These should
2084 be paths computed by system introspection, such as a hint pro‐
2085 vided by the location of another item already found. Hard-coded
2086 guesses should be specified with the PATHS option.
2087
2088
2089 4. Search the standard system environment variables. This can be
2090 skipped if NO_SYSTEM_ENVIRONMENT_PATH is an argument.
2091
2092
2093 PATH
2094
2095
2096 5. Search cmake variables defined in the Platform files for the
2097 current system. This can be skipped if NO_CMAKE_SYSTEM_PATH is
2098 passed.
2099
2100
2101 <prefix>/[s]bin for each <prefix> in CMAKE_SYSTEM_PREFIX_PATH
2102 CMAKE_SYSTEM_PROGRAM_PATH
2103 CMAKE_SYSTEM_APPBUNDLE_PATH
2104
2105 6. Search the paths specified by the PATHS option or in the
2106 short-hand version of the command. These are typically
2107 hard-coded guesses.
2108
2109
2110 On Darwin or systems supporting OS X Frameworks, the cmake vari‐
2111 able CMAKE_FIND_FRAMEWORK can be set to empty or one of the
2112 following:
2113
2114
2115 "FIRST" - Try to find frameworks before standard
2116 libraries or headers. This is the default on Darwin.
2117 "LAST" - Try to find frameworks after standard
2118 libraries or headers.
2119 "ONLY" - Only try to find frameworks.
2120 "NEVER" - Never try to find frameworks.
2121
2122 On Darwin or systems supporting OS X Application Bundles, the
2123 cmake variable CMAKE_FIND_APPBUNDLE can be set to empty or one
2124 of the following:
2125
2126
2127 "FIRST" - Try to find application bundles before standard
2128 programs. This is the default on Darwin.
2129 "LAST" - Try to find application bundles after standard
2130 programs.
2131 "ONLY" - Only try to find application bundles.
2132 "NEVER" - Never try to find application bundles.
2133
2134 The CMake variable CMAKE_FIND_ROOT_PATH specifies one or more
2135 directories to be prepended to all other search directories.
2136 This effectively "re-roots" the entire search under given loca‐
2137 tions. By default it is empty. It is especially useful when
2138 cross-compiling to point to the root directory of the target
2139 environment and CMake will search there too. By default at first
2140 the directories listed in CMAKE_FIND_ROOT_PATH and then the
2141 non-rooted directories will be searched. The default behavior
2142 can be adjusted by setting CMAKE_FIND_ROOT_PATH_MODE_PROGRAM.
2143 This behavior can be manually overridden on a per-call basis. By
2144 using CMAKE_FIND_ROOT_PATH_BOTH the search order will be as
2145 described above. If NO_CMAKE_FIND_ROOT_PATH is used then
2146 CMAKE_FIND_ROOT_PATH will not be used. If
2147 ONLY_CMAKE_FIND_ROOT_PATH is used then only the re-rooted direc‐
2148 tories will be searched.
2149
2150
2151 The default search order is designed to be most-specific to
2152 least-specific for common use cases. Projects may override the
2153 order by simply calling the command multiple times and using the
2154 NO_* options:
2155
2156
2157 find_program(<VAR> NAMES name PATHS paths... NO_DEFAULT_PATH)
2158 find_program(<VAR> NAMES name)
2159
2160 Once one of the calls succeeds the result variable will be set
2161 and stored in the cache so that no call will search again.
2162
2163
2164 fltk_wrap_ui
2165 Create FLTK user interfaces Wrappers.
2166
2167 fltk_wrap_ui(resultingLibraryName source1
2168 source2 ... sourceN )
2169
2170 Produce .h and .cxx files for all the .fl and .fld files listed.
2171 The resulting .h and .cxx files will be added to a variable
2172 named resultingLibraryName_FLTK_UI_SRCS which should be added to
2173 your library.
2174
2175
2176 foreach
2177 Evaluate a group of commands for each value in a list.
2178
2179 foreach(loop_var arg1 arg2 ...)
2180 COMMAND1(ARGS ...)
2181 COMMAND2(ARGS ...)
2182 ...
2183 endforeach(loop_var)
2184
2185 All commands between foreach and the matching endforeach are
2186 recorded without being invoked. Once the endforeach is evalu‐
2187 ated, the recorded list of commands is invoked once for each
2188 argument listed in the original foreach command. Before each
2189 iteration of the loop "${loop_var}" will be set as a variable
2190 with the current value in the list.
2191
2192
2193 foreach(loop_var RANGE total)
2194 foreach(loop_var RANGE start stop [step])
2195
2196 Foreach can also iterate over a generated range of numbers.
2197 There are three types of this iteration:
2198
2199
2200 * When specifying single number, the range will have elements 0
2201 to "total".
2202
2203
2204 * When specifying two numbers, the range will have elements from
2205 the first number to the second number.
2206
2207
2208 * The third optional number is the increment used to iterate
2209 from the first number to the second number.
2210
2211
2212 foreach(loop_var IN [LISTS [list1 [...]]]
2213 [ITEMS [item1 [...]]])
2214
2215 Iterates over a precise list of items. The LISTS option names
2216 list-valued variables to be traversed, including empty elements
2217 (an empty string is a zero-length list). The ITEMS option ends
2218 argument parsing and includes all arguments following it in the
2219 iteration.
2220
2221
2222 function
2223 Start recording a function for later invocation as a command.
2224
2225 function(<name> [arg1 [arg2 [arg3 ...]]])
2226 COMMAND1(ARGS ...)
2227 COMMAND2(ARGS ...)
2228 ...
2229 endfunction(<name>)
2230
2231 Define a function named <name> that takes arguments named arg1
2232 arg2 arg3 (...). Commands listed after function, but before the
2233 matching endfunction, are not invoked until the function is
2234 invoked. When it is invoked, the commands recorded in the func‐
2235 tion are first modified by replacing formal parameters (${arg1})
2236 with the arguments passed, and then invoked as normal commands.
2237 In addition to referencing the formal parameters you can refer‐
2238 ence the variable ARGC which will be set to the number of argu‐
2239 ments passed into the function as well as ARGV0 ARGV1 ARGV2 ...
2240 which will have the actual values of the arguments passed in.
2241 This facilitates creating functions with optional arguments.
2242 Additionally ARGV holds the list of all arguments given to the
2243 function and ARGN holds the list of argument past the last
2244 expected argument.
2245
2246
2247 See the cmake_policy() command documentation for the behavior of
2248 policies inside functions.
2249
2250
2251 get_cmake_property
2252 Get a property of the CMake instance.
2253
2254 get_cmake_property(VAR property)
2255
2256 Get a property from the CMake instance. The value of the prop‐
2257 erty is stored in the variable VAR. If the property is not
2258 found, VAR will be set to "NOTFOUND". Some supported properties
2259 include: VARIABLES, CACHE_VARIABLES, COMMANDS, MACROS, and COM‐
2260 PONENTS.
2261
2262
2263 See also the more general get_property() command.
2264
2265
2266 get_directory_property
2267 Get a property of DIRECTORY scope.
2268
2269 get_directory_property(<variable> [DIRECTORY <dir>] <prop-name>)
2270
2271 Store a property of directory scope in the named variable. If
2272 the property is not defined the empty-string is returned. The
2273 DIRECTORY argument specifies another directory from which to
2274 retrieve the property value. The specified directory must have
2275 already been traversed by CMake.
2276
2277
2278 get_directory_property(<variable> [DIRECTORY <dir>]
2279 DEFINITION <var-name>)
2280
2281 Get a variable definition from a directory. This form is useful
2282 to get a variable definition from another directory.
2283
2284
2285 See also the more general get_property() command.
2286
2287
2288 get_filename_component
2289 Get a specific component of a full filename.
2290
2291 get_filename_component(<VAR> FileName
2292 PATH|ABSOLUTE|NAME|EXT|NAME_WE|REALPATH
2293 [CACHE])
2294
2295 Set <VAR> to be the path (PATH), file name (NAME), file exten‐
2296 sion (EXT), file name without extension (NAME_WE) of FileName,
2297 the full path (ABSOLUTE), or the full path with all symlinks
2298 resolved (REALPATH). Note that the path is converted to Unix
2299 slashes format and has no trailing slashes. The longest file
2300 extension is always considered. If the optional CACHE argument
2301 is specified, the result variable is added to the cache.
2302
2303
2304 get_filename_component(<VAR> FileName
2305 PROGRAM [PROGRAM_ARGS <ARG_VAR>]
2306 [CACHE])
2307
2308 The program in FileName will be found in the system search path
2309 or left as a full path. If PROGRAM_ARGS is present with PRO‐
2310 GRAM, then any command-line arguments present in the FileName
2311 string are split from the program name and stored in <ARG_VAR>.
2312 This is used to separate a program name from its arguments in a
2313 command line string.
2314
2315
2316 get_property
2317 Get a property.
2318
2319 get_property(<variable>
2320 <GLOBAL |
2321 DIRECTORY [dir] |
2322 TARGET <target> |
2323 SOURCE <source> |
2324 TEST <test> |
2325 CACHE <entry> |
2326 VARIABLE>
2327 PROPERTY <name>
2328 [SET | DEFINED | BRIEF_DOCS | FULL_DOCS])
2329
2330 Get one property from one object in a scope. The first argument
2331 specifies the variable in which to store the result. The second
2332 argument determines the scope from which to get the property.
2333 It must be one of the following:
2334
2335
2336 GLOBAL scope is unique and does not accept a name.
2337
2338
2339 DIRECTORY scope defaults to the current directory but another
2340 directory (already processed by CMake) may be named by full or
2341 relative path.
2342
2343
2344 TARGET scope must name one existing target.
2345
2346
2347 SOURCE scope must name one source file.
2348
2349
2350 TEST scope must name one existing test.
2351
2352
2353 CACHE scope must name one cache entry.
2354
2355
2356 VARIABLE scope is unique and does not accept a name.
2357
2358
2359 The required PROPERTY option is immediately followed by the name
2360 of the property to get. If the property is not set an empty
2361 value is returned. If the SET option is given the variable is
2362 set to a boolean value indicating whether the property has been
2363 set. If the DEFINED option is given the variable is set to a
2364 boolean value indicating whether the property has been defined
2365 such as with define_property. If BRIEF_DOCS or FULL_DOCS is
2366 given then the variable is set to a string containing documenta‐
2367 tion for the requested property. If documentation is requested
2368 for a property that has not been defined NOTFOUND is returned.
2369
2370
2371 get_source_file_property
2372 Get a property for a source file.
2373
2374 get_source_file_property(VAR file property)
2375
2376 Get a property from a source file. The value of the property is
2377 stored in the variable VAR. If the property is not found, VAR
2378 will be set to "NOTFOUND". Use set_source_files_properties to
2379 set property values. Source file properties usually control how
2380 the file is built. One property that is always there is LOCATION
2381
2382
2383 See also the more general get_property() command.
2384
2385
2386 get_target_property
2387 Get a property from a target.
2388
2389 get_target_property(VAR target property)
2390
2391 Get a property from a target. The value of the property is
2392 stored in the variable VAR. If the property is not found, VAR
2393 will be set to "NOTFOUND". Use set_target_properties to set
2394 property values. Properties are usually used to control how a
2395 target is built, but some query the target instead. This com‐
2396 mand can get properties for any target so far created. The tar‐
2397 gets do not need to be in the current CMakeLists.txt file.
2398
2399
2400 See also the more general get_property() command.
2401
2402
2403 get_test_property
2404 Get a property of the test.
2405
2406 get_test_property(test property VAR)
2407
2408 Get a property from the Test. The value of the property is
2409 stored in the variable VAR. If the property is not found, VAR
2410 will be set to "NOTFOUND". For a list of standard properties you
2411 can type cmake --help-property-list
2412
2413
2414 See also the more general get_property() command.
2415
2416
2417 if Conditionally execute a group of commands.
2418
2419 if(expression)
2420 # then section.
2421 COMMAND1(ARGS ...)
2422 COMMAND2(ARGS ...)
2423 ...
2424 elseif(expression2)
2425 # elseif section.
2426 COMMAND1(ARGS ...)
2427 COMMAND2(ARGS ...)
2428 ...
2429 else(expression)
2430 # else section.
2431 COMMAND1(ARGS ...)
2432 COMMAND2(ARGS ...)
2433 ...
2434 endif(expression)
2435
2436 Evaluates the given expression. If the result is true, the com‐
2437 mands in the THEN section are invoked. Otherwise, the commands
2438 in the else section are invoked. The elseif and else sections
2439 are optional. You may have multiple elseif clauses. Note that
2440 the expression in the else and endif clause is optional. Long
2441 expressions can be used and there is a traditional order of
2442 precedence. Parenthetical expressions are evaluated first fol‐
2443 lowed by unary operators such as EXISTS, COMMAND, and DEFINED.
2444 Then any EQUAL, LESS, GREATER, STRLESS, STRGREATER, STREQUAL,
2445 MATCHES will be evaluated. Then NOT operators and finally AND,
2446 OR operators will be evaluated. Possible expressions are:
2447
2448
2449 if(<constant>)
2450
2451 True if the constant is 1, ON, YES, TRUE, Y, or a non-zero num‐
2452 ber. False if the constant is 0, OFF, NO, FALSE, N, IGNORE, "",
2453 or ends in the suffix '-NOTFOUND'. Named boolean constants are
2454 case-insensitive. If the argument is not one of these con‐
2455 stants, it is treated as a variable:
2456
2457
2458 if(<variable>)
2459
2460 True if the variable is defined to a value that is not a false
2461 constant. False otherwise.
2462
2463
2464 if(NOT <expression>)
2465
2466 True if the expression is not true.
2467
2468
2469 if(<expr1> AND <expr2>)
2470
2471 True if both expressions would be considered true individually.
2472
2473
2474 if(<expr1> OR <expr2>)
2475
2476 True if either expression would be considered true individually.
2477
2478
2479 if(COMMAND command-name)
2480
2481 True if the given name is a command, macro or function that can
2482 be invoked.
2483
2484
2485 if(POLICY policy-id)
2486
2487 True if the given name is an existing policy (of the form
2488 CMP<NNNN>).
2489
2490
2491 if(TARGET target-name)
2492
2493 True if the given name is an existing target, built or imported.
2494
2495
2496 if(EXISTS file-name)
2497 if(EXISTS directory-name)
2498
2499 True if the named file or directory exists. Behavior is
2500 well-defined only for full paths.
2501
2502
2503 if(file1 IS_NEWER_THAN file2)
2504
2505 True if file1 is newer than file2 or if one of the two files
2506 doesn't exist. Behavior is well-defined only for full paths.
2507
2508
2509 if(IS_DIRECTORY directory-name)
2510
2511 True if the given name is a directory. Behavior is well-defined
2512 only for full paths.
2513
2514
2515 if(IS_SYMLINK file-name)
2516
2517 True if the given name is a symbolic link. Behavior is
2518 well-defined only for full paths.
2519
2520
2521 if(IS_ABSOLUTE path)
2522
2523 True if the given path is an absolute path.
2524
2525
2526 if(<variable|string> MATCHES regex)
2527
2528 True if the given string or variable's value matches the given
2529 regular expression.
2530
2531
2532 if(<variable|string> LESS <variable|string>)
2533 if(<variable|string> GREATER <variable|string>)
2534 if(<variable|string> EQUAL <variable|string>)
2535
2536 True if the given string or variable's value is a valid number
2537 and the inequality or equality is true.
2538
2539
2540 if(<variable|string> STRLESS <variable|string>)
2541 if(<variable|string> STRGREATER <variable|string>)
2542 if(<variable|string> STREQUAL <variable|string>)
2543
2544 True if the given string or variable's value is lexicographi‐
2545 cally less (or greater, or equal) than the string or variable on
2546 the right.
2547
2548
2549 if(<variable|string> VERSION_LESS <variable|string>)
2550 if(<variable|string> VERSION_EQUAL <variable|string>)
2551 if(<variable|string> VERSION_GREATER <variable|string>)
2552
2553 Component-wise integer version number comparison (version format
2554 is major[.minor[.patch[.tweak]]]).
2555
2556
2557 if(DEFINED <variable>)
2558
2559 True if the given variable is defined. It does not matter if the
2560 variable is true or false just if it has been set.
2561
2562
2563 if((expression) AND (expression OR (expression)))
2564
2565 The expressions inside the parenthesis are evaluated first and
2566 then the remaining expression is evaluated as in the previous
2567 examples. Where there are nested parenthesis the innermost are
2568 evaluated as part of evaluating the expression that contains
2569 them.
2570
2571
2572 The if command was written very early in CMake's history, pre‐
2573 dating the ${} variable evaluation syntax, and for convenience
2574 evaluates variables named by its arguments as shown in the above
2575 signatures. Note that normal variable evaluation with ${}
2576 applies before the if command even receives the arguments.
2577 Therefore code like
2578
2579
2580 set(var1 OFF)
2581 set(var2 "var1")
2582 if(${var2})
2583
2584 appears to the if command as
2585
2586
2587 if(var1)
2588
2589 and is evaluated according to the if(<variable>) case documented
2590 above. The result is OFF which is false. However, if we remove
2591 the ${} from the example then the command sees
2592
2593
2594 if(var2)
2595
2596 which is true because var2 is defined to "var1" which is not a
2597 false constant.
2598
2599
2600 Automatic evaluation applies in the other cases whenever the
2601 above-documented signature accepts <variable|string>:
2602
2603
2604 1) The left hand argument to MATCHES is first checked to see if
2605 it is a defined variable, if so the variable's value is used,
2606 otherwise the original value is used.
2607
2608
2609 2) If the left hand argument to MATCHES is missing it returns
2610 false without error
2611
2612
2613 3) Both left and right hand arguments to LESS GREATER EQUAL are
2614 independently tested to see if they are defined variables, if so
2615 their defined values are used otherwise the original value is
2616 used.
2617
2618
2619 4) Both left and right hand arguments to STRLESS STREQUAL STR‐
2620 GREATER are independently tested to see if they are defined
2621 variables, if so their defined values are used otherwise the
2622 original value is used.
2623
2624
2625 5) Both left and right hand argumemnts to VERSION_LESS VER‐
2626 SION_EQUAL VERSION_GREATER are independently tested to see if
2627 they are defined variables, if so their defined values are used
2628 otherwise the original value is used.
2629
2630
2631 6) The right hand argument to NOT is tested to see if it is a
2632 boolean constant, if so the value is used, otherwise it is
2633 assumed to be a variable and it is dereferenced.
2634
2635
2636 7) The left and right hand arguments to AND OR are independently
2637 tested to see if they are boolean constants, if so they are used
2638 as such, otherwise they are assumed to be variables and are
2639 dereferenced.
2640
2641
2642
2643 include
2644 Read CMake listfile code from the given file.
2645
2646 include(<file|module> [OPTIONAL] [RESULT_VARIABLE <VAR>]
2647 [NO_POLICY_SCOPE])
2648
2649 Reads CMake listfile code from the given file. Commands in the
2650 file are processed immediately as if they were written in place
2651 of the include command. If OPTIONAL is present, then no error
2652 is raised if the file does not exist. If RESULT_VARIABLE is
2653 given the variable will be set to the full filename which has
2654 been included or NOTFOUND if it failed.
2655
2656
2657 If a module is specified instead of a file, the file with name
2658 <modulename>.cmake is searched first in CMAKE_MODULE_PATH, then
2659 in the CMake module directory. There is one exception to this:
2660 if the file which calls include() is located itself in the CMake
2661 module directory, then first the CMake module directory is
2662 searched and CMAKE_MODULE_PATH afterwards. See also policy
2663 CMP0017.
2664
2665
2666 See the cmake_policy() command documentation for discussion of
2667 the NO_POLICY_SCOPE option.
2668
2669
2670 include_directories
2671 Add include directories to the build.
2672
2673 include_directories([AFTER|BEFORE] [SYSTEM] dir1 dir2 ...)
2674
2675 Add the given directories to those searched by the compiler for
2676 include files. By default the directories are appended onto the
2677 current list of directories. This default behavior can be
2678 changed by setting CMAKE_include_directories_BEFORE to ON. By
2679 using BEFORE or AFTER you can select between appending and
2680 prepending, independent from the default. If the SYSTEM option
2681 is given the compiler will be told that the directories are
2682 meant as system include directories on some platforms.
2683
2684
2685 include_external_msproject
2686 Include an external Microsoft project file in a workspace.
2687
2688 include_external_msproject(projectname location
2689 dep1 dep2 ...)
2690
2691 Includes an external Microsoft project in the generated
2692 workspace file. Currently does nothing on UNIX. This will cre‐
2693 ate a target named [projectname]. This can be used in the
2694 add_dependencies command to make things depend on the external
2695 project.
2696
2697
2698 include_regular_expression
2699 Set the regular expression used for dependency checking.
2700
2701 include_regular_expression(regex_match [regex_complain])
2702
2703 Set the regular expressions used in dependency checking. Only
2704 files matching regex_match will be traced as dependencies. Only
2705 files matching regex_complain will generate warnings if they
2706 cannot be found (standard header paths are not searched). The
2707 defaults are:
2708
2709
2710 regex_match = "^.*$" (match everything)
2711 regex_complain = "^$" (match empty string only)
2712
2713
2714 install
2715 Specify rules to run at install time.
2716
2717 This command generates installation rules for a project. Rules
2718 specified by calls to this command within a source directory are
2719 executed in order during installation. The order across direc‐
2720 tories is not defined.
2721
2722
2723 There are multiple signatures for this command. Some of them
2724 define installation properties for files and targets. Proper‐
2725 ties common to multiple signatures are covered here but they are
2726 valid only for signatures that specify them.
2727
2728
2729 DESTINATION arguments specify the directory on disk to which a
2730 file will be installed. If a full path (with a leading slash or
2731 drive letter) is given it is used directly. If a relative path
2732 is given it is interpreted relative to the value of
2733 CMAKE_INSTALL_PREFIX.
2734
2735
2736 PERMISSIONS arguments specify permissions for installed files.
2737 Valid permissions are OWNER_READ, OWNER_WRITE, OWNER_EXECUTE,
2738 GROUP_READ, GROUP_WRITE, GROUP_EXECUTE, WORLD_READ, WORLD_WRITE,
2739 WORLD_EXECUTE, SETUID, and SETGID. Permissions that do not make
2740 sense on certain platforms are ignored on those platforms.
2741
2742
2743 The CONFIGURATIONS argument specifies a list of build configura‐
2744 tions for which the install rule applies (Debug, Release, etc.).
2745
2746
2747 The COMPONENT argument specifies an installation component name
2748 with which the install rule is associated, such as "runtime" or
2749 "development". During component-specific installation only
2750 install rules associated with the given component name will be
2751 executed. During a full installation all components are
2752 installed.
2753
2754
2755 The RENAME argument specifies a name for an installed file that
2756 may be different from the original file. Renaming is allowed
2757 only when a single file is installed by the command.
2758
2759
2760 The OPTIONAL argument specifies that it is not an error if the
2761 file to be installed does not exist.
2762
2763
2764 The TARGETS signature:
2765
2766
2767 install(TARGETS targets... [EXPORT <export-name>]
2768 [[ARCHIVE|LIBRARY|RUNTIME|FRAMEWORK|BUNDLE|
2769 PRIVATE_HEADER|PUBLIC_HEADER|RESOURCE]
2770 [DESTINATION <dir>]
2771 [PERMISSIONS permissions...]
2772 [CONFIGURATIONS [Debug|Release|...]]
2773 [COMPONENT <component>]
2774 [OPTIONAL] [NAMELINK_ONLY|NAMELINK_SKIP]
2775 ] [...])
2776
2777 The TARGETS form specifies rules for installing targets from a
2778 project. There are five kinds of target files that may be
2779 installed: ARCHIVE, LIBRARY, RUNTIME, FRAMEWORK, and BUNDLE.
2780 Executables are treated as RUNTIME targets, except that those
2781 marked with the MACOSX_BUNDLE property are treated as BUNDLE
2782 targets on OS X. Static libraries are always treated as ARCHIVE
2783 targets. Module libraries are always treated as LIBRARY targets.
2784 For non-DLL platforms shared libraries are treated as LIBRARY
2785 targets, except that those marked with the FRAMEWORK property
2786 are treated as FRAMEWORK targets on OS X. For DLL platforms the
2787 DLL part of a shared library is treated as a RUNTIME target and
2788 the corresponding import library is treated as an ARCHIVE tar‐
2789 get. All Windows-based systems including Cygwin are DLL plat‐
2790 forms. The ARCHIVE, LIBRARY, RUNTIME, and FRAMEWORK arguments
2791 change the type of target to which the subsequent properties
2792 apply. If none is given the installation properties apply to
2793 all target types. If only one is given then only targets of
2794 that type will be installed (which can be used to install just a
2795 DLL or just an import library).
2796
2797
2798 The PRIVATE_HEADER, PUBLIC_HEADER, and RESOURCE arguments cause
2799 subsequent properties to be applied to installing a FRAMEWORK
2800 shared library target's associated files on non-Apple platforms.
2801 Rules defined by these arguments are ignored on Apple platforms
2802 because the associated files are installed into the appropriate
2803 locations inside the framework folder. See documentation of the
2804 PRIVATE_HEADER, PUBLIC_HEADER, and RESOURCE target properties
2805 for details.
2806
2807
2808 Either NAMELINK_ONLY or NAMELINK_SKIP may be specified as a
2809 LIBRARY option. On some platforms a versioned shared library
2810 has a symbolic link such as
2811
2812
2813 lib<name>.so -> lib<name>.so.1
2814
2815 where "lib<name>.so.1" is the soname of the library and
2816 "lib<name>.so" is a "namelink" allowing linkers to find the
2817 library when given "-l<name>". The NAMELINK_ONLY option causes
2818 installation of only the namelink when a library target is
2819 installed. The NAMELINK_SKIP option causes installation of
2820 library files other than the namelink when a library target is
2821 installed. When neither option is given both portions are
2822 installed. On platforms where versioned shared libraries do not
2823 have namelinks or when a library is not versioned the
2824 NAMELINK_SKIP option installs the library and the NAMELINK_ONLY
2825 option installs nothing. See the VERSION and SOVERSION target
2826 properties for details on creating versioned shared libraries.
2827
2828
2829 One or more groups of properties may be specified in a single
2830 call to the TARGETS form of this command. A target may be
2831 installed more than once to different locations. Consider hypo‐
2832 thetical targets "myExe", "mySharedLib", and "myStaticLib". The
2833 code
2834
2835
2836 install(TARGETS myExe mySharedLib myStaticLib
2837 RUNTIME DESTINATION bin
2838 LIBRARY DESTINATION lib
2839 ARCHIVE DESTINATION lib/static)
2840 install(TARGETS mySharedLib DESTINATION /some/full/path)
2841
2842 will install myExe to <prefix>/bin and myStaticLib to <pre‐
2843 fix>/lib/static. On non-DLL platforms mySharedLib will be
2844 installed to <prefix>/lib and /some/full/path. On DLL platforms
2845 the mySharedLib DLL will be installed to <prefix>/bin and
2846 /some/full/path and its import library will be installed to
2847 <prefix>/lib/static and /some/full/path. On non-DLL platforms
2848 mySharedLib will be installed to <prefix>/lib and
2849 /some/full/path.
2850
2851
2852 The EXPORT option associates the installed target files with an
2853 export called <export-name>. It must appear before any RUNTIME,
2854 LIBRARY, or ARCHIVE options. To actually install the export
2855 file itself, call install(EXPORT). See documentation of the
2856 install(EXPORT ...) signature below for details.
2857
2858
2859 Installing a target with EXCLUDE_FROM_ALL set to true has unde‐
2860 fined behavior.
2861
2862
2863 The FILES signature:
2864
2865
2866 install(FILES files... DESTINATION <dir>
2867 [PERMISSIONS permissions...]
2868 [CONFIGURATIONS [Debug|Release|...]]
2869 [COMPONENT <component>]
2870 [RENAME <name>] [OPTIONAL])
2871
2872 The FILES form specifies rules for installing files for a
2873 project. File names given as relative paths are interpreted
2874 with respect to the current source directory. Files installed
2875 by this form are by default given permissions OWNER_WRITE,
2876 OWNER_READ, GROUP_READ, and WORLD_READ if no PERMISSIONS argu‐
2877 ment is given.
2878
2879
2880 The PROGRAMS signature:
2881
2882
2883 install(PROGRAMS files... DESTINATION <dir>
2884 [PERMISSIONS permissions...]
2885 [CONFIGURATIONS [Debug|Release|...]]
2886 [COMPONENT <component>]
2887 [RENAME <name>] [OPTIONAL])
2888
2889 The PROGRAMS form is identical to the FILES form except that the
2890 default permissions for the installed file also include
2891 OWNER_EXECUTE, GROUP_EXECUTE, and WORLD_EXECUTE. This form is
2892 intended to install programs that are not targets, such as shell
2893 scripts. Use the TARGETS form to install targets built within
2894 the project.
2895
2896
2897 The DIRECTORY signature:
2898
2899
2900 install(DIRECTORY dirs... DESTINATION <dir>
2901 [FILE_PERMISSIONS permissions...]
2902 [DIRECTORY_PERMISSIONS permissions...]
2903 [USE_SOURCE_PERMISSIONS] [OPTIONAL]
2904 [CONFIGURATIONS [Debug|Release|...]]
2905 [COMPONENT <component>] [FILES_MATCHING]
2906 [[PATTERN <pattern> | REGEX <regex>]
2907 [EXCLUDE] [PERMISSIONS permissions...]] [...])
2908
2909 The DIRECTORY form installs contents of one or more directories
2910 to a given destination. The directory structure is copied ver‐
2911 batim to the destination. The last component of each directory
2912 name is appended to the destination directory but a trailing
2913 slash may be used to avoid this because it leaves the last com‐
2914 ponent empty. Directory names given as relative paths are
2915 interpreted with respect to the current source directory. If no
2916 input directory names are given the destination directory will
2917 be created but nothing will be installed into it. The FILE_PER‐
2918 MISSIONS and DIRECTORY_PERMISSIONS options specify permissions
2919 given to files and directories in the destination. If
2920 USE_SOURCE_PERMISSIONS is specified and FILE_PERMISSIONS is not,
2921 file permissions will be copied from the source directory struc‐
2922 ture. If no permissions are specified files will be given the
2923 default permissions specified in the FILES form of the command,
2924 and the directories will be given the default permissions speci‐
2925 fied in the PROGRAMS form of the command.
2926
2927
2928 Installation of directories may be controlled with fine granu‐
2929 larity using the PATTERN or REGEX options. These "match"
2930 options specify a globbing pattern or regular expression to
2931 match directories or files encountered within input directories.
2932 They may be used to apply certain options (see below) to a sub‐
2933 set of the files and directories encountered. The full path to
2934 each input file or directory (with forward slashes) is matched
2935 against the expression. A PATTERN will match only complete file
2936 names: the portion of the full path matching the pattern must
2937 occur at the end of the file name and be preceded by a slash. A
2938 REGEX will match any portion of the full path but it may use '/'
2939 and '$' to simulate the PATTERN behavior. By default all files
2940 and directories are installed whether or not they are matched.
2941 The FILES_MATCHING option may be given before the first match
2942 option to disable installation of files (but not directories)
2943 not matched by any expression. For example, the code
2944
2945
2946 install(DIRECTORY src/ DESTINATION include/myproj
2947 FILES_MATCHING PATTERN "*.h")
2948
2949 will extract and install header files from a source tree.
2950
2951
2952 Some options may follow a PATTERN or REGEX expression and are
2953 applied only to files or directories matching them. The EXCLUDE
2954 option will skip the matched file or directory. The PERMISSIONS
2955 option overrides the permissions setting for the matched file or
2956 directory. For example the code
2957
2958
2959 install(DIRECTORY icons scripts/ DESTINATION share/myproj
2960 PATTERN "CVS" EXCLUDE
2961 PATTERN "scripts/*"
2962 PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
2963 GROUP_EXECUTE GROUP_READ)
2964
2965 will install the icons directory to share/myproj/icons and the
2966 scripts directory to share/myproj. The icons will get default
2967 file permissions, the scripts will be given specific permis‐
2968 sions, and any CVS directories will be excluded.
2969
2970
2971 The SCRIPT and CODE signature:
2972
2973
2974 install([[SCRIPT <file>] [CODE <code>]] [...])
2975
2976 The SCRIPT form will invoke the given CMake script files during
2977 installation. If the script file name is a relative path it
2978 will be interpreted with respect to the current source direc‐
2979 tory. The CODE form will invoke the given CMake code during
2980 installation. Code is specified as a single argument inside a
2981 double-quoted string. For example, the code
2982
2983
2984 install(CODE "MESSAGE(\"Sample install message.\")")
2985
2986 will print a message during installation.
2987
2988
2989 The EXPORT signature:
2990
2991
2992 install(EXPORT <export-name> DESTINATION <dir>
2993 [NAMESPACE <namespace>] [FILE <name>.cmake]
2994 [PERMISSIONS permissions...]
2995 [CONFIGURATIONS [Debug|Release|...]]
2996 [COMPONENT <component>])
2997
2998 The EXPORT form generates and installs a CMake file containing
2999 code to import targets from the installation tree into another
3000 project. Target installations are associated with the export
3001 <export-name> using the EXPORT option of the install(TARGETS
3002 ...) signature documented above. The NAMESPACE option will
3003 prepend <namespace> to the target names as they are written to
3004 the import file. By default the generated file will be called
3005 <export-name>.cmake but the FILE option may be used to specify a
3006 different name. The value given to the FILE option must be a
3007 file name with the ".cmake" extension. If a CONFIGURATIONS
3008 option is given then the file will only be installed when one of
3009 the named configurations is installed. Additionally, the gener‐
3010 ated import file will reference only the matching target config‐
3011 urations. If a COMPONENT option is specified that does not
3012 match that given to the targets associated with <export-name>
3013 the behavior is undefined. If a library target is included in
3014 the export but a target to which it links is not included the
3015 behavior is unspecified.
3016
3017
3018 The EXPORT form is useful to help outside projects use targets
3019 built and installed by the current project. For example, the
3020 code
3021
3022
3023 install(TARGETS myexe EXPORT myproj DESTINATION bin)
3024 install(EXPORT myproj NAMESPACE mp_ DESTINATION lib/myproj)
3025
3026 will install the executable myexe to <prefix>/bin and code to
3027 import it in the file "<prefix>/lib/myproj/myproj.cmake". An
3028 outside project may load this file with the include command and
3029 reference the myexe executable from the installation tree using
3030 the imported target name mp_myexe as if the target were built in
3031 its own tree.
3032
3033
3034 NOTE: This command supercedes the INSTALL_TARGETS command and
3035 the target properties PRE_INSTALL_SCRIPT and
3036 POST_INSTALL_SCRIPT. It also replaces the FILES forms of the
3037 INSTALL_FILES and INSTALL_PROGRAMS commands. The processing
3038 order of these install rules relative to those generated by
3039 INSTALL_TARGETS, INSTALL_FILES, and INSTALL_PROGRAMS commands is
3040 not defined.
3041
3042
3043
3044 link_directories
3045 Specify directories in which the linker will look for libraries.
3046
3047 link_directories(directory1 directory2 ...)
3048
3049 Specify the paths in which the linker should search for
3050 libraries. The command will apply only to targets created after
3051 it is called. For historical reasons, relative paths given to
3052 this command are passed to the linker unchanged (unlike many
3053 CMake commands which interpret them relative to the current
3054 source directory).
3055
3056
3057 list List operations.
3058
3059 list(LENGTH <list> <output variable>)
3060 list(GET <list> <element index> [<element index> ...]
3061 <output variable>)
3062 list(APPEND <list> <element> [<element> ...])
3063 list(FIND <list> <value> <output variable>)
3064 list(INSERT <list> <element_index> <element> [<element> ...])
3065 list(REMOVE_ITEM <list> <value> [<value> ...])
3066 list(REMOVE_AT <list> <index> [<index> ...])
3067 list(REMOVE_DUPLICATES <list>)
3068 list(REVERSE <list>)
3069 list(SORT <list>)
3070
3071 LENGTH will return a given list's length.
3072
3073
3074 GET will return list of elements specified by indices from the
3075 list.
3076
3077
3078 APPEND will append elements to the list.
3079
3080
3081 FIND will return the index of the element specified in the list
3082 or -1 if it wasn't found.
3083
3084
3085 INSERT will insert elements to the list to the specified loca‐
3086 tion.
3087
3088
3089 REMOVE_AT and REMOVE_ITEM will remove items from the list. The
3090 difference is that REMOVE_ITEM will remove the given items,
3091 while REMOVE_AT will remove the items at the given indices.
3092
3093
3094 REMOVE_DUPLICATES will remove duplicated items in the list.
3095
3096
3097 REVERSE reverses the contents of the list in-place.
3098
3099
3100 SORT sorts the list in-place alphabetically.
3101
3102
3103 NOTES: A list in cmake is a ; separated group of strings. To
3104 create a list the set command can be used. For example, set(var
3105 a b c d e) creates a list with a;b;c;d;e, and set(var "a b c d
3106 e") creates a string or a list with one item in it.
3107
3108
3109 When specifying index values, if <element index> is 0 or
3110 greater, it is indexed from the beginning of the list, with 0
3111 representing the first list element. If <element index> is -1 or
3112 lesser, it is indexed from the end of the list, with -1 repre‐
3113 senting the last list element. Be careful when counting with
3114 negative indices: they do not start from 0. -0 is equivalent to
3115 0, the first list element.
3116
3117
3118
3119 load_cache
3120 Load in the values from another project's CMake cache.
3121
3122 load_cache(pathToCacheFile READ_WITH_PREFIX
3123 prefix entry1...)
3124
3125 Read the cache and store the requested entries in variables with
3126 their name prefixed with the given prefix. This only reads the
3127 values, and does not create entries in the local project's
3128 cache.
3129
3130
3131 load_cache(pathToCacheFile [EXCLUDE entry1...]
3132 [INCLUDE_INTERNALS entry1...])
3133
3134 Load in the values from another cache and store them in the
3135 local project's cache as internal entries. This is useful for a
3136 project that depends on another project built in a different
3137 tree. EXCLUDE option can be used to provide a list of entries
3138 to be excluded. INCLUDE_INTERNALS can be used to provide a list
3139 of internal entries to be included. Normally, no internal
3140 entries are brought in. Use of this form of the command is
3141 strongly discouraged, but it is provided for backward compati‐
3142 bility.
3143
3144
3145 load_command
3146 Load a command into a running CMake.
3147
3148 load_command(COMMAND_NAME <loc1> [loc2 ...])
3149
3150 The given locations are searched for a library whose name is
3151 cmCOMMAND_NAME. If found, it is loaded as a module and the com‐
3152 mand is added to the set of available CMake commands. Usually,
3153 TRY_COMPILE is used before this command to compile the module.
3154 If the command is successfully loaded a variable named
3155
3156
3157 CMAKE_LOADED_COMMAND_<COMMAND_NAME>
3158
3159 will be set to the full path of the module that was loaded.
3160 Otherwise the variable will not be set.
3161
3162
3163 macro Start recording a macro for later invocation as a command.
3164
3165 macro(<name> [arg1 [arg2 [arg3 ...]]])
3166 COMMAND1(ARGS ...)
3167 COMMAND2(ARGS ...)
3168 ...
3169 endmacro(<name>)
3170
3171 Define a macro named <name> that takes arguments named arg1 arg2
3172 arg3 (...). Commands listed after macro, but before the match‐
3173 ing endmacro, are not invoked until the macro is invoked. When
3174 it is invoked, the commands recorded in the macro are first mod‐
3175 ified by replacing formal parameters (${arg1}) with the argu‐
3176 ments passed, and then invoked as normal commands. In addition
3177 to referencing the formal parameters you can reference the val‐
3178 ues ${ARGC} which will be set to the number of arguments passed
3179 into the function as well as ${ARGV0} ${ARGV1} ${ARGV2} ...
3180 which will have the actual values of the arguments passed in.
3181 This facilitates creating macros with optional arguments. Addi‐
3182 tionally ${ARGV} holds the list of all arguments given to the
3183 macro and ${ARGN} holds the list of argument past the last
3184 expected argument. Note that the parameters to a macro and val‐
3185 ues such as ARGN are not variables in the usual CMake sense.
3186 They are string replacements much like the c preprocessor would
3187 do with a macro. If you want true CMake variables you should
3188 look at the function command.
3189
3190
3191 See the cmake_policy() command documentation for the behavior of
3192 policies inside macros.
3193
3194
3195 mark_as_advanced
3196 Mark cmake cached variables as advanced.
3197
3198 mark_as_advanced([CLEAR|FORCE] VAR VAR2 VAR...)
3199
3200 Mark the named cached variables as advanced. An advanced vari‐
3201 able will not be displayed in any of the cmake GUIs unless the
3202 show advanced option is on. If CLEAR is the first argument
3203 advanced variables are changed back to unadvanced. If FORCE is
3204 the first argument, then the variable is made advanced. If nei‐
3205 ther FORCE nor CLEAR is specified, new values will be marked as
3206 advanced, but if the variable already has an
3207 advanced/non-advanced state, it will not be changed.
3208
3209
3210 It does nothing in script mode.
3211
3212
3213 math Mathematical expressions.
3214
3215 math(EXPR <output variable> <math expression>)
3216
3217 EXPR evaluates mathematical expression and return result in the
3218 output variable. Example mathematical expression is '5 * ( 10 +
3219 13 )'. Supported operators are + - * / % | & ^ ~ << >> * / %.
3220 They have the same meaning as they do in c code.
3221
3222
3223 message
3224 Display a message to the user.
3225
3226 message([STATUS|WARNING|AUTHOR_WARNING|FATAL_ERROR|SEND_ERROR]
3227 "message to display" ...)
3228
3229 The optional keyword determines the type of message:
3230
3231
3232 (none) = Important information
3233 STATUS = Incidental information
3234 WARNING = CMake Warning, continue processing
3235 AUTHOR_WARNING = CMake Warning (dev), continue processing
3236 SEND_ERROR = CMake Error, continue but skip generation
3237 FATAL_ERROR = CMake Error, stop all processing
3238
3239 The CMake command-line tool displays STATUS messages on stdout
3240 and all other message types on stderr. The CMake GUI displays
3241 all messages in its log area. The interactive dialogs (ccmake
3242 and CMakeSetup) show STATUS messages one at a time on a status
3243 line and other messages in interactive pop-up boxes.
3244
3245
3246 CMake Warning and Error message text displays using a simple
3247 markup language. Non-indented text is formatted in line-wrapped
3248 paragraphs delimited by newlines. Indented text is considered
3249 pre-formatted.
3250
3251
3252 option Provides an option that the user can optionally select.
3253
3254 option(<option_variable> "help string describing option"
3255 [initial value])
3256
3257 Provide an option for the user to select as ON or OFF. If no
3258 initial value is provided, OFF is used.
3259
3260
3261 If you have options that depend on the values of other options,
3262 see the module help for CMakeDependentOption.
3263
3264
3265 output_required_files
3266 Output a list of required source files for a specified source
3267 file.
3268
3269 output_required_files(srcfile outputfile)
3270
3271 Outputs a list of all the source files that are required by the
3272 specified srcfile. This list is written into outputfile. This is
3273 similar to writing out the dependencies for srcfile except that
3274 it jumps from .h files into .cxx, .c and .cpp files if possible.
3275
3276
3277 project
3278 Set a name for the entire project.
3279
3280 project(<projectname> [languageName1 languageName2 ... ] )
3281
3282 Sets the name of the project. Additionally this sets the vari‐
3283 ables <projectName>_BINARY_DIR and <projectName>_SOURCE_DIR to
3284 the respective values.
3285
3286
3287 Optionally you can specify which languages your project sup‐
3288 ports. Example languages are CXX (i.e. C++), C, Fortran, etc.
3289 By default C and CXX are enabled. E.g. if you do not have a C++
3290 compiler, you can disable the check for it by explicitly listing
3291 the languages you want to support, e.g. C. By using the special
3292 language "NONE" all checks for any language can be disabled.
3293
3294
3295 qt_wrap_cpp
3296 Create Qt Wrappers.
3297
3298 qt_wrap_cpp(resultingLibraryName DestName
3299 SourceLists ...)
3300
3301 Produce moc files for all the .h files listed in the
3302 SourceLists. The moc files will be added to the library using
3303 the DestName source list.
3304
3305
3306 qt_wrap_ui
3307 Create Qt user interfaces Wrappers.
3308
3309 qt_wrap_ui(resultingLibraryName HeadersDestName
3310 SourcesDestName SourceLists ...)
3311
3312 Produce .h and .cxx files for all the .ui files listed in the
3313 SourceLists. The .h files will be added to the library using
3314 the HeadersDestNamesource list. The .cxx files will be added to
3315 the library using the SourcesDestNamesource list.
3316
3317
3318 remove_definitions
3319 Removes -D define flags added by add_definitions.
3320
3321 remove_definitions(-DFOO -DBAR ...)
3322
3323 Removes flags (added by add_definitions) from the compiler com‐
3324 mand line for sources in the current directory and below.
3325
3326
3327 return Return from a file, directory or function.
3328
3329 return()
3330
3331 Returns from a file, directory or function. When this command is
3332 encountered in an included file (via include() or find_pack‐
3333 age()), it causes processing of the current file to stop and
3334 control is returned to the including file. If it is encountered
3335 in a file which is not included by another file, e.g. a CMake‐
3336 Lists.txt, control is returned to the parent directory if there
3337 is one. If return is called in a function, control is returned
3338 to the caller of the function. Note that a macro is not a func‐
3339 tion and does not handle return like a function does.
3340
3341
3342 separate_arguments
3343 Parse space-separated arguments into a semicolon-separated list.
3344
3345 separate_arguments(<var> <UNIX|WINDOWS>_COMMAND "<args>")
3346
3347 Parses a unix- or windows-style command-line string "<args>" and
3348 stores a semicolon-separated list of the arguments in <var>.
3349 The entire command line must be given in one "<args>" argument.
3350
3351
3352 The UNIX_COMMAND mode separates arguments by unquoted white‐
3353 space. It recognizes both single-quote and double-quote pairs.
3354 A backslash escapes the next literal character (\" is "); there
3355 are no special escapes (\n is just n).
3356
3357
3358 The WINDOWS_COMMAND mode parses a windows command-line using the
3359 same syntax the runtime library uses to construct argv at
3360 startup. It separates arguments by whitespace that is not dou‐
3361 ble-quoted. Backslashes are literal unless they precede dou‐
3362 ble-quotes. See the MSDN article "Parsing C Command-Line Argu‐
3363 ments" for details.
3364
3365
3366 separate_arguments(VARIABLE)
3367
3368 Convert the value of VARIABLE to a semi-colon separated list.
3369 All spaces are replaced with ';'. This helps with generating
3370 command lines.
3371
3372
3373 set Set a CMAKE variable to a given value.
3374
3375 set(<variable> <value>
3376 [[CACHE <type> <docstring> [FORCE]] | PARENT_SCOPE])
3377
3378 Within CMake sets <variable> to the value <value>. <value> is
3379 expanded before <variable> is set to it. If CACHE is present,
3380 then the <variable> is put in the cache. <type> and <docstring>
3381 are then required. <type> is used by the CMake GUI to choose a
3382 widget with which the user sets a value. The value for <type>
3383 may be one of
3384
3385
3386 FILEPATH = File chooser dialog.
3387 PATH = Directory chooser dialog.
3388 STRING = Arbitrary string.
3389 BOOL = Boolean ON/OFF checkbox.
3390 INTERNAL = No GUI entry (used for persistent variables).
3391
3392 If <type> is INTERNAL, then the <value> is always written into
3393 the cache, replacing any values existing in the cache. If it is
3394 not a cache variable, then this always writes into the current
3395 makefile. The FORCE option will overwrite the cache value remov‐
3396 ing any changes by the user.
3397
3398
3399 If PARENT_SCOPE is present, the variable will be set in the
3400 scope above the current scope. Each new directory or function
3401 creates a new scope. This command will set the value of a vari‐
3402 able into the parent directory or calling function (whichever is
3403 applicable to the case at hand).
3404
3405
3406 If <value> is not specified then the variable is removed instead
3407 of set. See also: the unset() command.
3408
3409
3410 set(<variable> <value1> ... <valueN>)
3411
3412 In this case <variable> is set to a semicolon separated list of
3413 values.
3414
3415
3416 <variable> can be an environment variable such as:
3417
3418
3419 set( ENV{PATH} /home/martink )
3420
3421 in which case the environment variable will be set.
3422
3423
3424 set_directory_properties
3425 Set a property of the directory.
3426
3427 set_directory_properties(PROPERTIES prop1 value1 prop2 value2)
3428
3429 Set a property for the current directory and subdirectories. If
3430 the property is not found, CMake will report an error. The prop‐
3431 erties include: INCLUDE_DIRECTORIES, LINK_DIRECTORIES,
3432 INCLUDE_REGULAR_EXPRESSION, and ADDITIONAL_MAKE_CLEAN_FILES.
3433 ADDITIONAL_MAKE_CLEAN_FILES is a list of files that will be
3434 cleaned as a part of "make clean" stage.
3435
3436
3437 set_property
3438 Set a named property in a given scope.
3439
3440 set_property(<GLOBAL |
3441 DIRECTORY [dir] |
3442 TARGET [target1 [target2 ...]] |
3443 SOURCE [src1 [src2 ...]] |
3444 TEST [test1 [test2 ...]] |
3445 CACHE [entry1 [entry2 ...]]>
3446 [APPEND]
3447 PROPERTY <name> [value1 [value2 ...]])
3448
3449 Set one property on zero or more objects of a scope. The first
3450 argument determines the scope in which the property is set. It
3451 must be one of the following:
3452
3453
3454 GLOBAL scope is unique and does not accept a name.
3455
3456
3457 DIRECTORY scope defaults to the current directory but another
3458 directory (already processed by CMake) may be named by full or
3459 relative path.
3460
3461
3462 TARGET scope may name zero or more existing targets.
3463
3464
3465 SOURCE scope may name zero or more source files. Note that
3466 source file properties are visible only to targets added in the
3467 same directory (CMakeLists.txt).
3468
3469
3470 TEST scope may name zero or more existing tests.
3471
3472
3473 CACHE scope must name zero or more cache existing entries.
3474
3475
3476 The required PROPERTY option is immediately followed by the name
3477 of the property to set. Remaining arguments are used to compose
3478 the property value in the form of a semicolon-separated list.
3479 If the APPEND option is given the list is appended to any exist‐
3480 ing property value.
3481
3482
3483 set_source_files_properties
3484 Source files can have properties that affect how they are built.
3485
3486 set_source_files_properties([file1 [file2 [...]]]
3487 PROPERTIES prop1 value1
3488 [prop2 value2 [...]])
3489
3490 Set properties associated with source files using a key/value
3491 paired list. See properties documentation for those known to
3492 CMake. Unrecognized properties are ignored. Source file prop‐
3493 erties are visible only to targets added in the same directory
3494 (CMakeLists.txt).
3495
3496
3497 set_target_properties
3498 Targets can have properties that affect how they are built.
3499
3500 set_target_properties(target1 target2 ...
3501 PROPERTIES prop1 value1
3502 prop2 value2 ...)
3503
3504 Set properties on a target. The syntax for the command is to
3505 list all the files you want to change, and then provide the val‐
3506 ues you want to set next. You can use any prop value pair you
3507 want and extract it later with the GET_TARGET_PROPERTY command.
3508
3509
3510 Properties that affect the name of a target's output file are as
3511 follows. The PREFIX and SUFFIX properties override the default
3512 target name prefix (such as "lib") and suffix (such as ".so").
3513 IMPORT_PREFIX and IMPORT_SUFFIX are the equivalent properties
3514 for the import library corresponding to a DLL (for SHARED
3515 library targets). OUTPUT_NAME sets the real name of a target
3516 when it is built and can be used to help create two targets of
3517 the same name even though CMake requires unique logical target
3518 names. There is also a <CONFIG>_OUTPUT_NAME that can set the
3519 output name on a per-configuration basis. <CONFIG>_POSTFIX sets
3520 a postfix for the real name of the target when it is built under
3521 the configuration named by <CONFIG> (in upper-case, such as
3522 "DEBUG_POSTFIX"). The value of this property is initialized
3523 when the target is created to the value of the variable
3524 CMAKE_<CONFIG>_POSTFIX (except for executable targets because
3525 earlier CMake versions which did not use this variable for exe‐
3526 cutables).
3527
3528
3529 The LINK_FLAGS property can be used to add extra flags to the
3530 link step of a target. LINK_FLAGS_<CONFIG> will add to the con‐
3531 figuration <CONFIG>, for example, DEBUG, RELEASE, MINSIZEREL,
3532 RELWITHDEBINFO. DEFINE_SYMBOL sets the name of the preprocessor
3533 symbol defined when compiling sources in a shared library. If
3534 not set here then it is set to target_EXPORTS by default (with
3535 some substitutions if the target is not a valid C identifier).
3536 This is useful for headers to know whether they are being
3537 included from inside their library our outside to properly setup
3538 dllexport/dllimport decorations. The COMPILE_FLAGS property sets
3539 additional compiler flags used to build sources within the tar‐
3540 get. It may also be used to pass additional preprocessor defi‐
3541 nitions.
3542
3543
3544 The LINKER_LANGUAGE property is used to change the tool used to
3545 link an executable or shared library. The default is set the
3546 language to match the files in the library. CXX and C are common
3547 values for this property.
3548
3549
3550 For shared libraries VERSION and SOVERSION can be used to spec‐
3551 ify the build version and api version respectively. When build‐
3552 ing or installing appropriate symlinks are created if the plat‐
3553 form supports symlinks and the linker supports so-names. If only
3554 one of both is specified the missing is assumed to have the same
3555 version number. For executables VERSION can be used to specify
3556 the build version. When building or installing appropriate sym‐
3557 links are created if the platform supports symlinks. For shared
3558 libraries and executables on Windows the VERSION attribute is
3559 parsed to extract a "major.minor" version number. These numbers
3560 are used as the image version of the binary.
3561
3562
3563 There are a few properties used to specify RPATH rules.
3564 INSTALL_RPATH is a semicolon-separated list specifying the rpath
3565 to use in installed targets (for platforms that support it).
3566 INSTALL_RPATH_USE_LINK_PATH is a boolean that if set to true
3567 will append directories in the linker search path and outside
3568 the project to the INSTALL_RPATH. SKIP_BUILD_RPATH is a boolean
3569 specifying whether to skip automatic generation of an rpath
3570 allowing the target to run from the build tree.
3571 BUILD_WITH_INSTALL_RPATH is a boolean specifying whether to link
3572 the target in the build tree with the INSTALL_RPATH. This takes
3573 precedence over SKIP_BUILD_RPATH and avoids the need for relink‐
3574 ing before installation. INSTALL_NAME_DIR is a string specify‐
3575 ing the directory portion of the "install_name" field of shared
3576 libraries on Mac OSX to use in the installed targets. When the
3577 target is created the values of the variables
3578 CMAKE_INSTALL_RPATH, CMAKE_INSTALL_RPATH_USE_LINK_PATH,
3579 CMAKE_SKIP_BUILD_RPATH, CMAKE_BUILD_WITH_INSTALL_RPATH, and
3580 CMAKE_INSTALL_NAME_DIR are used to initialize these properties.
3581
3582
3583 PROJECT_LABEL can be used to change the name of the target in an
3584 IDE like visual studio. VS_KEYWORD can be set to change the
3585 visual studio keyword, for example QT integration works better
3586 if this is set to Qt4VSv1.0.
3587
3588
3589 VS_SCC_PROJECTNAME, VS_SCC_LOCALPATH, VS_SCC_PROVIDER can be set
3590 to add support for source control bindings in a Visual Studio
3591 project file.
3592
3593
3594 The PRE_INSTALL_SCRIPT and POST_INSTALL_SCRIPT properties are
3595 the old way to specify CMake scripts to run before and after
3596 installing a target. They are used only when the old
3597 INSTALL_TARGETS command is used to install the target. Use the
3598 INSTALL command instead.
3599
3600
3601 The EXCLUDE_FROM_DEFAULT_BUILD property is used by the visual
3602 studio generators. If it is set to 1 the target will not be
3603 part of the default build when you select "Build Solution".
3604
3605
3606 set_tests_properties
3607 Set a property of the tests.
3608
3609 set_tests_properties(test1 [test2...] PROPERTIES prop1 value1 prop2 value2)
3610
3611 Set a property for the tests. If the property is not found,
3612 CMake will report an error. The properties include:
3613
3614
3615 WILL_FAIL: If set to true, this will invert the pass/fail flag
3616 of the test.
3617
3618
3619 PASS_REGULAR_EXPRESSION: If set, the test output will be checked
3620 against the specified regular expressions and at least one of
3621 the regular expressions has to match, otherwise the test will
3622 fail.
3623
3624
3625 Example: PASS_REGULAR_EXPRESSION "TestPassed;All ok"
3626
3627 FAIL_REGULAR_EXPRESSION: If set, if the output will match to one
3628 of specified regular expressions, the test will fail.
3629
3630
3631 Example: PASS_REGULAR_EXPRESSION "[^a-z]Error;ERROR;Failed"
3632
3633 Both PASS_REGULAR_EXPRESSION and FAIL_REGULAR_EXPRESSION expect
3634 a list of regular expressions.
3635
3636
3637 TIMEOUT: Setting this will limit the test runtime to the number
3638 of seconds specified.
3639
3640
3641
3642 site_name
3643 Set the given variable to the name of the computer.
3644
3645 site_name(variable)
3646
3647
3648 source_group
3649 Define a grouping for sources in the makefile.
3650
3651 source_group(name [REGULAR_EXPRESSION regex] [FILES src1 src2 ...])
3652
3653 Defines a group into which sources will be placed in project
3654 files. This is mainly used to setup file tabs in Visual Studio.
3655 Any file whose name is listed or matches the regular expression
3656 will be placed in this group. If a file matches multiple
3657 groups, the LAST group that explicitly lists the file will be
3658 favored, if any. If no group explicitly lists the file, the
3659 LAST group whose regular expression matches the file will be
3660 favored.
3661
3662
3663 The name of the group may contain backslashes to specify sub‐
3664 groups:
3665
3666
3667 source_group(outer\\inner ...)
3668
3669 For backwards compatibility, this command is also supports the
3670 format:
3671
3672
3673 source_group(name regex)
3674
3675
3676 string String operations.
3677
3678 string(REGEX MATCH <regular_expression>
3679 <output variable> <input> [<input>...])
3680 string(REGEX MATCHALL <regular_expression>
3681 <output variable> <input> [<input>...])
3682 string(REGEX REPLACE <regular_expression>
3683 <replace_expression> <output variable>
3684 <input> [<input>...])
3685 string(REPLACE <match_string>
3686 <replace_string> <output variable>
3687 <input> [<input>...])
3688 string(COMPARE EQUAL <string1> <string2> <output variable>)
3689 string(COMPARE NOTEQUAL <string1> <string2> <output variable>)
3690 string(COMPARE LESS <string1> <string2> <output variable>)
3691 string(COMPARE GREATER <string1> <string2> <output variable>)
3692 string(ASCII <number> [<number> ...] <output variable>)
3693 string(CONFIGURE <string1> <output variable>
3694 [@ONLY] [ESCAPE_QUOTES])
3695 string(TOUPPER <string1> <output variable>)
3696 string(TOLOWER <string1> <output variable>)
3697 string(LENGTH <string> <output variable>)
3698 string(SUBSTRING <string> <begin> <length> <output variable>)
3699 string(STRIP <string> <output variable>)
3700 string(RANDOM [LENGTH <length>] [ALPHABET <alphabet>]
3701 [RANDOM_SEED <seed>] <output variable>)
3702
3703 REGEX MATCH will match the regular expression once and store the
3704 match in the output variable.
3705
3706
3707 REGEX MATCHALL will match the regular expression as many times
3708 as possible and store the matches in the output variable as a
3709 list.
3710
3711
3712 REGEX REPLACE will match the regular expression as many times as
3713 possible and substitute the replacement expression for the match
3714 in the output. The replace expression may refer to paren-delim‐
3715 ited subexpressions of the match using \1, \2, ..., \9. Note
3716 that two backslashes (\\1) are required in CMake code to get a
3717 backslash through argument parsing.
3718
3719
3720 REPLACE will replace all occurrences of match_string in the
3721 input with replace_string and store the result in the output.
3722
3723
3724 COMPARE EQUAL/NOTEQUAL/LESS/GREATER will compare the strings and
3725 store true or false in the output variable.
3726
3727
3728 ASCII will convert all numbers into corresponding ASCII charac‐
3729 ters.
3730
3731
3732 CONFIGURE will transform a string like CONFIGURE_FILE transforms
3733 a file.
3734
3735
3736 TOUPPER/TOLOWER will convert string to upper/lower characters.
3737
3738
3739 LENGTH will return a given string's length.
3740
3741
3742 SUBSTRING will return a substring of a given string.
3743
3744
3745 STRIP will return a substring of a given string with leading and
3746 trailing spaces removed.
3747
3748
3749 RANDOM will return a random string of given length consisting of
3750 characters from the given alphabet. Default length is 5 charac‐
3751 ters and default alphabet is all numbers and upper and lower
3752 case letters. If an integer RANDOM_SEED is given, its value
3753 will be used to seed the random number generator.
3754
3755
3756 The following characters have special meaning in regular expres‐
3757 sions:
3758
3759
3760 ^ Matches at beginning of a line
3761 $ Matches at end of a line
3762 . Matches any single character
3763 [ ] Matches any character(s) inside the brackets
3764 [^ ] Matches any character(s) not inside the brackets
3765 - Matches any character in range on either side of a dash
3766 * Matches preceding pattern zero or more times
3767 + Matches preceding pattern one or more times
3768 ? Matches preceding pattern zero or once only
3769 | Matches a pattern on either side of the |
3770 () Saves a matched subexpression, which can be referenced
3771 in the REGEX REPLACE operation. Additionally it is saved
3772 by all regular expression-related commands, including
3773 e.g. if( MATCHES ), in the variables CMAKE_MATCH_(0..9).
3774
3775
3776 target_link_libraries
3777 Link a target to given libraries.
3778
3779 target_link_libraries(<target> [item1 [item2 [...]]]
3780 [[debug|optimized|general] <item>] ...)
3781
3782 Specify libraries or flags to use when linking a given target.
3783 The named <target> must have been created in the current direc‐
3784 tory by a command such as add_executable or add_library. The
3785 remaining arguments specify library names or flags.
3786
3787
3788 If a library name matches that of another target in the project
3789 a dependency will automatically be added in the build system to
3790 make sure the library being linked is up-to-date before the tar‐
3791 get links. Item names starting with '-', but not '-l' or
3792 '-framework', are treated as linker flags.
3793
3794
3795 A "debug", "optimized", or "general" keyword indicates that the
3796 library immediately following it is to be used only for the cor‐
3797 responding build configuration. The "debug" keyword corresponds
3798 to the Debug configuration (or to configurations named in the
3799 DEBUG_CONFIGURATIONS global property if it is set). The "opti‐
3800 mized" keyword corresponds to all other configurations. The
3801 "general" keyword corresponds to all configurations, and is
3802 purely optional (assumed if omitted). Higher granularity may be
3803 achieved for per-configuration rules by creating and linking to
3804 IMPORTED library targets. See the IMPORTED mode of the
3805 add_library command for more information.
3806
3807
3808 Library dependencies are transitive by default. When this tar‐
3809 get is linked into another target then the libraries linked to
3810 this target will appear on the link line for the other target
3811 too. See the LINK_INTERFACE_LIBRARIES target property to over‐
3812 ride the set of transitive link dependencies for a target.
3813
3814
3815 target_link_libraries(<target> LINK_INTERFACE_LIBRARIES
3816 [[debug|optimized|general] <lib>] ...)
3817
3818 The LINK_INTERFACE_LIBRARIES mode appends the libraries to the
3819 LINK_INTERFACE_LIBRARIES and its per-configuration equivalent
3820 target properties instead of using them for linking. Libraries
3821 specified as "debug" are appended to the the LINK_INTER‐
3822 FACE_LIBRARIES_DEBUG property (or to the properties correspond‐
3823 ing to configurations listed in the DEBUG_CONFIGURATIONS global
3824 property if it is set). Libraries specified as "optimized" are
3825 appended to the the LINK_INTERFACE_LIBRARIES property.
3826 Libraries specified as "general" (or without any keyword) are
3827 treated as if specified for both "debug" and "optimized".
3828
3829
3830 The library dependency graph is normally acyclic (a DAG), but in
3831 the case of mutually-dependent STATIC libraries CMake allows the
3832 graph to contain cycles (strongly connected components). When
3833 another target links to one of the libraries CMake repeats the
3834 entire connected component. For example, the code
3835
3836
3837 add_library(A STATIC a.c)
3838 add_library(B STATIC b.c)
3839 target_link_libraries(A B)
3840 target_link_libraries(B A)
3841 add_executable(main main.c)
3842 target_link_libraries(main A)
3843
3844 links 'main' to 'A B A B'. (While one repetition is usually
3845 sufficient, pathological object file and symbol arrangements can
3846 require more. One may handle such cases by manually repeating
3847 the component in the last target_link_libraries call. However,
3848 if two archives are really so interdependent they should proba‐
3849 bly be combined into a single archive.)
3850
3851
3852 try_compile
3853 Try building some code.
3854
3855 try_compile(RESULT_VAR <bindir> <srcdir>
3856 <projectName> [targetName] [CMAKE_FLAGS flags...]
3857 [OUTPUT_VARIABLE <var>])
3858
3859 Try building a project. In this form, srcdir should contain a
3860 complete CMake project with a CMakeLists.txt file and all
3861 sources. The bindir and srcdir will not be deleted after this
3862 command is run. Specify targetName to build a specific target
3863 instead of the 'all' or 'ALL_BUILD' target.
3864
3865
3866 try_compile(RESULT_VAR <bindir> <srcfile>
3867 [CMAKE_FLAGS flags...]
3868 [COMPILE_DEFINITIONS flags...]
3869 [OUTPUT_VARIABLE <var>]
3870 [COPY_FILE <fileName>])
3871
3872 Try building a source file into an executable. In this form the
3873 user need only supply a source file that defines a 'main'.
3874 CMake will create a CMakeLists.txt file to build the source as
3875 an executable. Specify COPY_FILE to get a copy of the linked
3876 executable at the given fileName.
3877
3878
3879 In this version all files in bindir/CMakeFiles/CMakeTmp, will be
3880 cleaned automatically, for debugging a --debug-trycompile can be
3881 passed to cmake to avoid the clean. Some extra flags that can
3882 be included are, INCLUDE_DIRECTORIES, LINK_DIRECTORIES, and
3883 LINK_LIBRARIES. COMPILE_DEFINITIONS are -Ddefinition that will
3884 be passed to the compile line. try_compile creates a CMake‐
3885 List.txt file on the fly that looks like this:
3886
3887
3888 add_definitions( <expanded COMPILE_DEFINITIONS from calling cmake>)
3889 include_directories(${INCLUDE_DIRECTORIES})
3890 link_directories(${LINK_DIRECTORIES})
3891 add_executable(cmTryCompileExec sources)
3892 target_link_libraries(cmTryCompileExec ${LINK_LIBRARIES})
3893
3894 In both versions of the command, if OUTPUT_VARIABLE is speci‐
3895 fied, then the output from the build process is stored in the
3896 given variable. Return the success or failure in RESULT_VAR.
3897 CMAKE_FLAGS can be used to pass -DVAR:TYPE=VALUE flags to the
3898 cmake that is run during the build. Set variable CMAKE_TRY_COM‐
3899 PILE_CONFIGURATION to choose a build configuration.
3900
3901
3902 try_run
3903 Try compiling and then running some code.
3904
3905 try_run(RUN_RESULT_VAR COMPILE_RESULT_VAR
3906 bindir srcfile [CMAKE_FLAGS <Flags>]
3907 [COMPILE_DEFINITIONS <flags>]
3908 [COMPILE_OUTPUT_VARIABLE comp]
3909 [RUN_OUTPUT_VARIABLE run]
3910 [OUTPUT_VARIABLE var]
3911 [ARGS <arg1> <arg2>...])
3912
3913 Try compiling a srcfile. Return TRUE or FALSE for success or
3914 failure in COMPILE_RESULT_VAR. Then if the compile succeeded,
3915 run the executable and return its exit code in RUN_RESULT_VAR.
3916 If the executable was built, but failed to run, then
3917 RUN_RESULT_VAR will be set to FAILED_TO_RUN. COMPILE_OUT‐
3918 PUT_VARIABLE specifies the variable where the output from the
3919 compile step goes. RUN_OUTPUT_VARIABLE specifies the variable
3920 where the output from the running executable goes.
3921
3922
3923 For compatibility reasons OUTPUT_VARIABLE is still supported,
3924 which gives you the output from the compile and run step com‐
3925 bined.
3926
3927
3928 Cross compiling issues
3929
3930
3931 When cross compiling, the executable compiled in the first step
3932 usually cannot be run on the build host. try_run() checks the
3933 CMAKE_CROSSCOMPILING variable to detect whether CMake is in
3934 crosscompiling mode. If that's the case, it will still try to
3935 compile the executable, but it will not try to run the exe‐
3936 cutable. Instead it will create cache variables which must be
3937 filled by the user or by presetting them in some CMake script
3938 file to the values the executable would have produced if it
3939 would have been run on its actual target platform. These vari‐
3940 ables are RUN_RESULT_VAR (explanation see above) and if RUN_OUT‐
3941 PUT_VARIABLE (or OUTPUT_VARIABLE) was used, an additional cache
3942 variable RUN_RESULT_VAR__COMPILE_RESULT_VAR__TRYRUN_OUTPUT.This
3943 is intended to hold stdout and stderr from the executable.
3944
3945
3946 In order to make cross compiling your project easier, use
3947 try_run only if really required. If you use try_run, use
3948 RUN_OUTPUT_VARIABLE (or OUTPUT_VARIABLE) only if really
3949 required. Using them will require that when crosscompiling, the
3950 cache variables will have to be set manually to the output of
3951 the executable. You can also "guard" the calls to try_run with
3952 if(CMAKE_CROSSCOMPILING) and provide an easy-to-preset alterna‐
3953 tive for this case.
3954
3955
3956 Set variable CMAKE_TRY_COMPILE_CONFIGURATION to choose a build
3957 configuration.
3958
3959
3960 unset Unset a variable, cache variable, or environment variable.
3961
3962 unset(<variable> [CACHE])
3963
3964 Removes the specified variable causing it to become undefined.
3965 If CACHE is present then the variable is removed from the cache
3966 instead of the current scope.
3967
3968
3969 <variable> can be an environment variable such as:
3970
3971
3972 unset(ENV{LD_LIBRARY_PATH})
3973
3974 in which case the variable will be removed from the current
3975 environment.
3976
3977
3978 variable_watch
3979 Watch the CMake variable for change.
3980
3981 variable_watch(<variable name> [<command to execute>])
3982
3983 If the specified variable changes, the message will be printed
3984 about the variable being changed. If the command is specified,
3985 the command will be executed. The command will receive the fol‐
3986 lowing arguments: COMMAND(<variable> <access> <value> <current
3987 list file> <stack>)
3988
3989
3990 while Evaluate a group of commands while a condition is true
3991
3992 while(condition)
3993 COMMAND1(ARGS ...)
3994 COMMAND2(ARGS ...)
3995 ...
3996 endwhile(condition)
3997
3998 All commands between while and the matching endwhile are
3999 recorded without being invoked. Once the endwhile is evaluated,
4000 the recorded list of commands is invoked as long as the condi‐
4001 tion is true. The condition is evaluated using the same logic as
4002 the if command.
4003
4004
4006 CMake Properties - Properties supported by CMake, the Cross-Platform Makefile Generator.
4007
4008
4009 This is the documentation for the properties supported by CMake. Prop‐
4010 erties can have different scopes. They can either be assigned to a
4011 source file, a directory, a target or globally to CMake. By modifying
4012 the values of properties the behaviour of the build system can be cus‐
4013 tomized.
4014
4015
4017 ALLOW_DUPLICATE_CUSTOM_TARGETS
4018 Allow duplicate custom targets to be created.
4019
4020 Normally CMake requires that all targets built in a project have
4021 globally unique logical names (see policy CMP0002). This is
4022 necessary to generate meaningful project file names in Xcode and
4023 VS IDE generators. It also allows the target names to be refer‐
4024 enced unambiguously.
4025
4026
4027 Makefile generators are capable of supporting duplicate custom
4028 target names. For projects that care only about Makefile gener‐
4029 ators and do not wish to support Xcode or VS IDE generators, one
4030 may set this property to true to allow duplicate custom targets.
4031 The property allows multiple add_custom_target command calls in
4032 different directories to specify the same target name. However,
4033 setting this property will cause non-Makefile generators to pro‐
4034 duce an error and refuse to generate the project.
4035
4036
4037 DEBUG_CONFIGURATIONS
4038 Specify which configurations are for debugging.
4039
4040 The value must be a semi-colon separated list of configuration
4041 names. Currently this property is used only by the tar‐
4042 get_link_libraries command (see its documentation for details).
4043 Additional uses may be defined in the future.
4044
4045
4046 This property must be set at the top level of the project and
4047 before the first target_link_libraries command invocation. If
4048 any entry in the list does not match a valid configuration for
4049 the project the behavior is undefined.
4050
4051
4052 DISABLED_FEATURES
4053 List of features which are disabled during the CMake run.
4054
4055 List of features which are disabled during the CMake run. Be
4056 default it contains the names of all packages which were not
4057 found. This is determined using the <NAME>_FOUND variables.
4058 Packages which are searched QUIET are not listed. A project can
4059 add its own features to this list.This property is used by the
4060 macros in FeatureSummary.cmake.
4061
4062
4063 ENABLED_FEATURES
4064 List of features which are enabled during the CMake run.
4065
4066 List of features which are enabled during the CMake run. Be
4067 default it contains the names of all packages which were found.
4068 This is determined using the <NAME>_FOUND variables. Packages
4069 which are searched QUIET are not listed. A project can add its
4070 own features to this list.This property is used by the macros in
4071 FeatureSummary.cmake.
4072
4073
4074 ENABLED_LANGUAGES
4075 Read-only property that contains the list of currently enabled
4076 languages
4077
4078 Set to list of currently enabled languages.
4079
4080
4081 FIND_LIBRARY_USE_LIB64_PATHS
4082 Whether FIND_LIBRARY should automatically search lib64 directo‐
4083 ries.
4084
4085 FIND_LIBRARY_USE_LIB64_PATHS is a boolean specifying whether the
4086 FIND_LIBRARY command should automatically search the lib64 vari‐
4087 ant of directories called lib in the search path when building
4088 64-bit binaries.
4089
4090
4091 FIND_LIBRARY_USE_OPENBSD_VERSIONING
4092 Whether FIND_LIBRARY should find OpenBSD-style shared libraries.
4093
4094 This property is a boolean specifying whether the FIND_LIBRARY
4095 command should find shared libraries with OpenBSD-style ver‐
4096 sioned extension: ".so.<major>.<minor>". The property is set to
4097 true on OpenBSD and false on other platforms.
4098
4099
4100 GLOBAL_DEPENDS_DEBUG_MODE
4101 Enable global target dependency graph debug mode.
4102
4103 CMake automatically analyzes the global inter-target dependency
4104 graph at the beginning of native build system generation. This
4105 property causes it to display details of its analysis to stderr.
4106
4107
4108 GLOBAL_DEPENDS_NO_CYCLES
4109 Disallow global target dependency graph cycles.
4110
4111 CMake automatically analyzes the global inter-target dependency
4112 graph at the beginning of native build system generation. It
4113 reports an error if the dependency graph contains a cycle that
4114 does not consist of all STATIC library targets. This property
4115 tells CMake to disallow all cycles completely, even among static
4116 libraries.
4117
4118
4119 IN_TRY_COMPILE
4120 Read-only property that is true during a try-compile configura‐
4121 tion.
4122
4123 True when building a project inside a TRY_COMPILE or TRY_RUN
4124 command.
4125
4126
4127 PACKAGES_FOUND
4128 List of packages which were found during the CMake run.
4129
4130 List of packages which were found during the CMake run. Whether
4131 a package has been found is determined using the <NAME>_FOUND
4132 variables.
4133
4134
4135 PACKAGES_NOT_FOUND
4136 List of packages which were not found during the CMake run.
4137
4138 List of packages which were not found during the CMake run.
4139 Whether a package has been found is determined using the
4140 <NAME>_FOUND variables.
4141
4142
4143 PREDEFINED_TARGETS_FOLDER
4144 Name of FOLDER for targets that are added automatically by
4145 CMake.
4146
4147 If not set, CMake uses "CMakePredefinedTargets" as a default
4148 value for this property. Targets such as INSTALL, PACKAGE and
4149 RUN_TESTS will be organized into this FOLDER. See also the docu‐
4150 mentation for the FOLDER target property.
4151
4152
4153 REPORT_UNDEFINED_PROPERTIES
4154 If set, report any undefined properties to this file.
4155
4156 If this property is set to a filename then when CMake runs it
4157 will report any properties or variables that were accessed but
4158 not defined into the filename specified in this property.
4159
4160
4161 RULE_LAUNCH_COMPILE
4162 Specify a launcher for compile rules.
4163
4164 Makefile generators prefix compiler commands with the given
4165 launcher command line. This is intended to allow launchers to
4166 intercept build problems with high granularity. Non-Makefile
4167 generators currently ignore this property.
4168
4169
4170 RULE_LAUNCH_CUSTOM
4171 Specify a launcher for custom rules.
4172
4173 Makefile generators prefix custom commands with the given
4174 launcher command line. This is intended to allow launchers to
4175 intercept build problems with high granularity. Non-Makefile
4176 generators currently ignore this property.
4177
4178
4179 RULE_LAUNCH_LINK
4180 Specify a launcher for link rules.
4181
4182 Makefile generators prefix link and archive commands with the
4183 given launcher command line. This is intended to allow launch‐
4184 ers to intercept build problems with high granularity.
4185 Non-Makefile generators currently ignore this property.
4186
4187
4188 RULE_MESSAGES
4189 Specify whether to report a message for each make rule.
4190
4191 This property specifies whether Makefile generators should add a
4192 progress message describing what each build rule does. If the
4193 property is not set the default is ON. Set the property to OFF
4194 to disable granular messages and report only as each target com‐
4195 pletes. This is intended to allow scripted builds to avoid the
4196 build time cost of detailed reports. If a CMAKE_RULE_MESSAGES
4197 cache entry exists its value initializes the value of this prop‐
4198 erty. Non-Makefile generators currently ignore this property.
4199
4200
4201 TARGET_ARCHIVES_MAY_BE_SHARED_LIBS
4202 Set if shared libraries may be named like archives.
4203
4204 On AIX shared libraries may be named "lib<name>.a". This prop‐
4205 erty is set to true on such platforms.
4206
4207
4208 TARGET_SUPPORTS_SHARED_LIBS
4209 Does the target platform support shared libraries.
4210
4211 TARGET_SUPPORTS_SHARED_LIBS is a boolean specifying whether the
4212 target platform supports shared libraries. Basically all current
4213 general general purpose OS do so, the exception are usually
4214 embedded systems with no or special OSs.
4215
4216
4217 USE_FOLDERS
4218 Use the FOLDER target property to organize targets into folders.
4219
4220 If not set, CMake treats this property as OFF by default. CMake
4221 generators that are capable of organizing into a hierarchy of
4222 folders use the values of the FOLDER target property to name
4223 those folders. See also the documentation for the FOLDER target
4224 property.
4225
4226
4227 __CMAKE_DELETE_CACHE_CHANGE_VARS_
4228 Internal property
4229
4230 Used to detect compiler changes, Do not set.
4231
4232
4234 ADDITIONAL_MAKE_CLEAN_FILES
4235 Additional files to clean during the make clean stage.
4236
4237 A list of files that will be cleaned as a part of the "make
4238 clean" stage.
4239
4240
4241 CACHE_VARIABLES
4242 List of cache variables available in the current directory.
4243
4244 This read-only property specifies the list of CMake cache vari‐
4245 ables currently defined. It is intended for debugging purposes.
4246
4247
4248 CLEAN_NO_CUSTOM
4249 Should the output of custom commands be left.
4250
4251 If this is true then the outputs of custom commands for this
4252 directory will not be removed during the "make clean" stage.
4253
4254
4255 COMPILE_DEFINITIONS
4256 Preprocessor definitions for compiling a directory's sources.
4257
4258 The COMPILE_DEFINITIONS property may be set to a semicolon-sepa‐
4259 rated list of preprocessor definitions using the syntax VAR or
4260 VAR=value. Function-style definitions are not supported. CMake
4261 will automatically escape the value correctly for the native
4262 build system (note that CMake language syntax may require
4263 escapes to specify some values). This property may be set on a
4264 per-configuration basis using the name COMPILE_DEFINITIONS_<CON‐
4265 FIG> where <CONFIG> is an upper-case name (ex. "COMPILE_DEFINI‐
4266 TIONS_DEBUG"). This property will be initialized in each direc‐
4267 tory by its value in the directory's parent.
4268
4269
4270 CMake will automatically drop some definitions that are not sup‐
4271 ported by the native build tool. The VS6 IDE does not support
4272 definition values with spaces (but NMake does).
4273
4274
4275 Disclaimer: Most native build tools have poor support for escap‐
4276 ing certain values. CMake has work-arounds for many cases but
4277 some values may just not be possible to pass correctly. If a
4278 value does not seem to be escaped correctly, do not attempt to
4279 work-around the problem by adding escape sequences to the value.
4280 Your work-around may break in a future version of CMake that has
4281 improved escape support. Instead consider defining the macro in
4282 a (configured) header file. Then report the limitation. Known
4283 limitations include:
4284
4285
4286 # - broken almost everywhere
4287 ; - broken in VS IDE and Borland Makefiles
4288 , - broken in VS IDE
4289 % - broken in some cases in NMake
4290 & | - broken in some cases on MinGW
4291 ^ < > \" - broken in most Make tools on Windows
4292
4293 CMake does not reject these values outright because they do work
4294 in some cases. Use with caution.
4295
4296
4297 COMPILE_DEFINITIONS_<CONFIG>
4298 Per-configuration preprocessor definitions in a directory.
4299
4300 This is the configuration-specific version of COMPILE_DEFINI‐
4301 TIONS. This property will be initialized in each directory by
4302 its value in the directory's parent.
4303
4304
4305
4306 DEFINITIONS
4307 For CMake 2.4 compatibility only. Use COMPILE_DEFINITIONS
4308 instead.
4309
4310 This read-only property specifies the list of flags given so far
4311 to the add_definitions command. It is intended for debugging
4312 purposes. Use the COMPILE_DEFINITIONS instead.
4313
4314
4315 EXCLUDE_FROM_ALL
4316 Exclude the directory from the all target of its parent.
4317
4318 A property on a directory that indicates if its targets are
4319 excluded from the default build target. If it is not, then with
4320 a Makefile for example typing make will cause the targets to be
4321 built. The same concept applies to the default build of other
4322 generators.
4323
4324
4325 IMPLICIT_DEPENDS_INCLUDE_TRANSFORM
4326 Specify #include line transforms for dependencies in a direc‐
4327 tory.
4328
4329 This property specifies rules to transform macro-like #include
4330 lines during implicit dependency scanning of C and C++ source
4331 files. The list of rules must be semicolon-separated with each
4332 entry of the form "A_MACRO(%)=value-with-%" (the % must be lit‐
4333 eral). During dependency scanning occurrences of A_MACRO(...)
4334 on #include lines will be replaced by the value given with the
4335 macro argument substituted for '%'. For example, the entry
4336
4337
4338 MYDIR(%)=<mydir/%>
4339
4340 will convert lines of the form
4341
4342
4343 #include MYDIR(myheader.h)
4344
4345 to
4346
4347
4348 #include <mydir/myheader.h>
4349
4350 allowing the dependency to be followed.
4351
4352
4353 This property applies to sources in all targets within a direc‐
4354 tory. The property value is initialized in each directory by
4355 its value in the directory's parent.
4356
4357
4358 INCLUDE_DIRECTORIES
4359 List of preprocessor include file search directories.
4360
4361 This read-only property specifies the list of directories given
4362 so far to the include_directories command. It is intended for
4363 debugging purposes.
4364
4365
4366 INCLUDE_REGULAR_EXPRESSION
4367 Include file scanning regular expression.
4368
4369 This read-only property specifies the regular expression used
4370 during dependency scanning to match include files that should be
4371 followed. See the include_regular_expression command.
4372
4373
4374 INTERPROCEDURAL_OPTIMIZATION
4375 Enable interprocedural optimization for targets in a directory.
4376
4377 If set to true, enables interprocedural optimizations if they
4378 are known to be supported by the compiler.
4379
4380
4381 INTERPROCEDURAL_OPTIMIZATION_<CONFIG>
4382 Per-configuration interprocedural optimization for a directory.
4383
4384 This is a per-configuration version of INTERPROCEDURAL_OPTIMIZA‐
4385 TION. If set, this property overrides the generic property for
4386 the named configuration.
4387
4388
4389 LINK_DIRECTORIES
4390 List of linker search directories.
4391
4392 This read-only property specifies the list of directories given
4393 so far to the link_directories command. It is intended for
4394 debugging purposes.
4395
4396
4397 LISTFILE_STACK
4398 The current stack of listfiles being processed.
4399
4400 This property is mainly useful when trying to debug errors in
4401 your CMake scripts. It returns a list of what list files are
4402 currently being processed, in order. So if one listfile does an
4403 INCLUDE command then that is effectively pushing the included
4404 listfile onto the stack.
4405
4406
4407 MACROS List of macro commands available in the current directory.
4408
4409 This read-only property specifies the list of CMake macros cur‐
4410 rently defined. It is intended for debugging purposes. See the
4411 macro command.
4412
4413
4414 PARENT_DIRECTORY
4415 Source directory that added current subdirectory.
4416
4417 This read-only property specifies the source directory that
4418 added the current source directory as a subdirectory of the
4419 build. In the top-level directory the value is the
4420 empty-string.
4421
4422
4423 RULE_LAUNCH_COMPILE
4424 Specify a launcher for compile rules.
4425
4426 See the global property of the same name for details. This
4427 overrides the global property for a directory.
4428
4429
4430 RULE_LAUNCH_CUSTOM
4431 Specify a launcher for custom rules.
4432
4433 See the global property of the same name for details. This
4434 overrides the global property for a directory.
4435
4436
4437 RULE_LAUNCH_LINK
4438 Specify a launcher for link rules.
4439
4440 See the global property of the same name for details. This
4441 overrides the global property for a directory.
4442
4443
4444 TEST_INCLUDE_FILE
4445 A cmake file that will be included when ctest is run.
4446
4447 If you specify TEST_INCLUDE_FILE, that file will be included and
4448 processed when ctest is run on the directory.
4449
4450
4451 VARIABLES
4452 List of variables defined in the current directory.
4453
4454 This read-only property specifies the list of CMake variables
4455 currently defined. It is intended for debugging purposes.
4456
4457
4459 <CONFIG>_OUTPUT_NAME
4460 Old per-configuration target file base name.
4461
4462 This is a configuration-specific version of OUTPUT_NAME. Use
4463 OUTPUT_NAME_<CONFIG> instead.
4464
4465
4466 <CONFIG>_POSTFIX
4467 Postfix to append to the target file name for configuration
4468 <CONFIG>.
4469
4470 When building with configuration <CONFIG> the value of this
4471 property is appended to the target file name built on disk. For
4472 non-executable targets, this property is initialized by the
4473 value of the variable CMAKE_<CONFIG>_POSTFIX if it is set when a
4474 target is created. This property is ignored on the Mac for
4475 Frameworks and App Bundles.
4476
4477
4478 ARCHIVE_OUTPUT_DIRECTORY
4479 Output directory in which to build ARCHIVE target files.
4480
4481 This property specifies the directory into which archive target
4482 files should be built. Multi-configuration generators (VS,
4483 Xcode) append a per-configuration subdirectory to the specified
4484 directory. There are three kinds of target files that may be
4485 built: archive, library, and runtime. Executables are always
4486 treated as runtime targets. Static libraries are always treated
4487 as archive targets. Module libraries are always treated as
4488 library targets. For non-DLL platforms shared libraries are
4489 treated as library targets. For DLL platforms the DLL part of a
4490 shared library is treated as a runtime target and the corre‐
4491 sponding import library is treated as an archive target. All
4492 Windows-based systems including Cygwin are DLL platforms. This
4493 property is initialized by the value of the variable CMAKE_AR‐
4494 CHIVE_OUTPUT_DIRECTORY if it is set when a target is created.
4495
4496
4497 ARCHIVE_OUTPUT_DIRECTORY_<CONFIG>
4498 Per-configuration output directory for ARCHIVE target files.
4499
4500 This is a per-configuration version of ARCHIVE_OUTPUT_DIRECTORY,
4501 but multi-configuration generators (VS, Xcode) do NOT append a
4502 per-configuration subdirectory to the specified directory. This
4503 property is initialized by the value of the variable CMAKE_AR‐
4504 CHIVE_OUTPUT_DIRECTORY_<CONFIG> if it is set when a target is
4505 created.
4506
4507
4508 ARCHIVE_OUTPUT_NAME
4509 Output name for ARCHIVE target files.
4510
4511 This property specifies the base name for archive target files.
4512 It overrides OUTPUT_NAME and OUTPUT_NAME_<CONFIG> properties.
4513 There are three kinds of target files that may be built: ar‐
4514 chive, library, and runtime. Executables are always treated as
4515 runtime targets. Static libraries are always treated as archive
4516 targets. Module libraries are always treated as library targets.
4517 For non-DLL platforms shared libraries are treated as library
4518 targets. For DLL platforms the DLL part of a shared library is
4519 treated as a runtime target and the corresponding import library
4520 is treated as an archive target. All Windows-based systems
4521 including Cygwin are DLL platforms.
4522
4523
4524 ARCHIVE_OUTPUT_NAME_<CONFIG>
4525 Per-configuration output name for ARCHIVE target files.
4526
4527 This is the configuration-specific version of ARCHIVE_OUT‐
4528 PUT_NAME.
4529
4530
4531 BUILD_WITH_INSTALL_RPATH
4532 Should build tree targets have install tree rpaths.
4533
4534 BUILD_WITH_INSTALL_RPATH is a boolean specifying whether to link
4535 the target in the build tree with the INSTALL_RPATH. This takes
4536 precedence over SKIP_BUILD_RPATH and avoids the need for relink‐
4537 ing before installation. This property is initialized by the
4538 value of the variable CMAKE_BUILD_WITH_INSTALL_RPATH if it is
4539 set when a target is created.
4540
4541
4542 COMPILE_DEFINITIONS
4543 Preprocessor definitions for compiling a target's sources.
4544
4545 The COMPILE_DEFINITIONS property may be set to a semicolon-sepa‐
4546 rated list of preprocessor definitions using the syntax VAR or
4547 VAR=value. Function-style definitions are not supported. CMake
4548 will automatically escape the value correctly for the native
4549 build system (note that CMake language syntax may require
4550 escapes to specify some values). This property may be set on a
4551 per-configuration basis using the name COMPILE_DEFINITIONS_<CON‐
4552 FIG> where <CONFIG> is an upper-case name (ex. "COMPILE_DEFINI‐
4553 TIONS_DEBUG").
4554
4555
4556 CMake will automatically drop some definitions that are not sup‐
4557 ported by the native build tool. The VS6 IDE does not support
4558 definition values with spaces (but NMake does).
4559
4560
4561 Disclaimer: Most native build tools have poor support for escap‐
4562 ing certain values. CMake has work-arounds for many cases but
4563 some values may just not be possible to pass correctly. If a
4564 value does not seem to be escaped correctly, do not attempt to
4565 work-around the problem by adding escape sequences to the value.
4566 Your work-around may break in a future version of CMake that has
4567 improved escape support. Instead consider defining the macro in
4568 a (configured) header file. Then report the limitation. Known
4569 limitations include:
4570
4571
4572 # - broken almost everywhere
4573 ; - broken in VS IDE and Borland Makefiles
4574 , - broken in VS IDE
4575 % - broken in some cases in NMake
4576 & | - broken in some cases on MinGW
4577 ^ < > \" - broken in most Make tools on Windows
4578
4579 CMake does not reject these values outright because they do work
4580 in some cases. Use with caution.
4581
4582
4583 COMPILE_DEFINITIONS_<CONFIG>
4584 Per-configuration preprocessor definitions on a target.
4585
4586 This is the configuration-specific version of COMPILE_DEFINI‐
4587 TIONS.
4588
4589
4590 COMPILE_FLAGS
4591 Additional flags to use when compiling this target's sources.
4592
4593 The COMPILE_FLAGS property sets additional compiler flags used
4594 to build sources within the target. Use COMPILE_DEFINITIONS to
4595 pass additional preprocessor definitions.
4596
4597
4598 DEBUG_POSTFIX
4599 See target property <CONFIG>_POSTFIX.
4600
4601 This property is a special case of the more-general <CON‐
4602 FIG>_POSTFIX property for the DEBUG configuration.
4603
4604
4605 DEFINE_SYMBOL
4606 Define a symbol when compiling this target's sources.
4607
4608 DEFINE_SYMBOL sets the name of the preprocessor symbol defined
4609 when compiling sources in a shared library. If not set here then
4610 it is set to target_EXPORTS by default (with some substitutions
4611 if the target is not a valid C identifier). This is useful for
4612 headers to know whether they are being included from inside
4613 their library our outside to properly setup dllexport/dllimport
4614 decorations.
4615
4616
4617 ENABLE_EXPORTS
4618 Specify whether an executable exports symbols for loadable mod‐
4619 ules.
4620
4621 Normally an executable does not export any symbols because it is
4622 the final program. It is possible for an executable to export
4623 symbols to be used by loadable modules. When this property is
4624 set to true CMake will allow other targets to "link" to the exe‐
4625 cutable with the TARGET_LINK_LIBRARIES command. On all plat‐
4626 forms a target-level dependency on the executable is created for
4627 targets that link to it. For DLL platforms an import library
4628 will be created for the exported symbols and then used for link‐
4629 ing. All Windows-based systems including Cygwin are DLL plat‐
4630 forms. For non-DLL platforms that require all symbols to be
4631 resolved at link time, such as Mac OS X, the module will "link"
4632 to the executable using a flag like "-bundle_loader". For other
4633 non-DLL platforms the link rule is simply ignored since the
4634 dynamic loader will automatically bind symbols when the module
4635 is loaded.
4636
4637
4638 EXCLUDE_FROM_ALL
4639 Exclude the target from the all target.
4640
4641 A property on a target that indicates if the target is excluded
4642 from the default build target. If it is not, then with a Make‐
4643 file for example typing make will cause this target to be built.
4644 The same concept applies to the default build of other genera‐
4645 tors. Installing a target with EXCLUDE_FROM_ALL set to true has
4646 undefined behavior.
4647
4648
4649 EchoString
4650 A message to be displayed when the target is built.
4651
4652 A message to display on some generators (such as makefiles) when
4653 the target is built.
4654
4655
4656 FOLDER Set the folder name. Use to organize targets in an IDE.
4657
4658 Targets with no FOLDER property will appear as top level enti‐
4659 ties in IDEs like Visual Studio. Targets with the same FOLDER
4660 property value will appear next to each other in a folder of
4661 that name. To nest folders, use FOLDER values such as
4662 'GUI/Dialogs' with '/' characters separating folder levels.
4663
4664
4665 FRAMEWORK
4666 This target is a framework on the Mac.
4667
4668 If a shared library target has this property set to true it will
4669 be built as a framework when built on the mac. It will have the
4670 directory structure required for a framework and will be suit‐
4671 able to be used with the -framework option
4672
4673
4674 Fortran_MODULE_DIRECTORY
4675 Specify output directory for Fortran modules provided by the
4676 target.
4677
4678 If the target contains Fortran source files that provide modules
4679 and the compiler supports a module output directory this speci‐
4680 fies the directory in which the modules will be placed. When
4681 this property is not set the modules will be placed in the build
4682 directory corresponding to the target's source directory. If
4683 the variable CMAKE_Fortran_MODULE_DIRECTORY is set when a target
4684 is created its value is used to initialize this property.
4685
4686
4687 GENERATOR_FILE_NAME
4688 Generator's file for this target.
4689
4690 An internal property used by some generators to record the name
4691 of project or dsp file associated with this target.
4692
4693
4694 HAS_CXX
4695 Link the target using the C++ linker tool (obsolete).
4696
4697 This is equivalent to setting the LINKER_LANGUAGE property to
4698 CXX. See that property's documentation for details.
4699
4700
4701 IMPLICIT_DEPENDS_INCLUDE_TRANSFORM
4702 Specify #include line transforms for dependencies in a target.
4703
4704 This property specifies rules to transform macro-like #include
4705 lines during implicit dependency scanning of C and C++ source
4706 files. The list of rules must be semicolon-separated with each
4707 entry of the form "A_MACRO(%)=value-with-%" (the % must be lit‐
4708 eral). During dependency scanning occurrences of A_MACRO(...)
4709 on #include lines will be replaced by the value given with the
4710 macro argument substituted for '%'. For example, the entry
4711
4712
4713 MYDIR(%)=<mydir/%>
4714
4715 will convert lines of the form
4716
4717
4718 #include MYDIR(myheader.h)
4719
4720 to
4721
4722
4723 #include <mydir/myheader.h>
4724
4725 allowing the dependency to be followed.
4726
4727
4728 This property applies to sources in the target on which it is
4729 set.
4730
4731
4732 IMPORTED
4733 Read-only indication of whether a target is IMPORTED.
4734
4735 The boolean value of this property is true for targets created
4736 with the IMPORTED option to add_executable or add_library. It
4737 is false for targets built within the project.
4738
4739
4740 IMPORTED_CONFIGURATIONS
4741 Configurations provided for an IMPORTED target.
4742
4743 Lists configuration names available for an IMPORTED target. The
4744 names correspond to configurations defined in the project from
4745 which the target is imported. If the importing project uses a
4746 different set of configurations the names may be mapped using
4747 the MAP_IMPORTED_CONFIG_<CONFIG> property. Ignored for
4748 non-imported targets.
4749
4750
4751 IMPORTED_IMPLIB
4752 Full path to the import library for an IMPORTED target.
4753
4754 Specifies the location of the ".lib" part of a windows DLL.
4755 Ignored for non-imported targets.
4756
4757
4758 IMPORTED_IMPLIB_<CONFIG>
4759 Per-configuration version of IMPORTED_IMPLIB property.
4760
4761 This property is used when loading settings for the <CONFIG>
4762 configuration of an imported target. Configuration names corre‐
4763 spond to those provided by the project from which the target is
4764 imported.
4765
4766
4767 IMPORTED_LINK_DEPENDENT_LIBRARIES
4768 Dependent shared libraries of an imported shared library.
4769
4770 Shared libraries may be linked to other shared libraries as part
4771 of their implementation. On some platforms the linker searches
4772 for the dependent libraries of shared libraries they are includ‐
4773 ing in the link. This property lists the dependent shared
4774 libraries of an imported library. The list should be disjoint
4775 from the list of interface libraries in the IMPORTED_LINK_INTER‐
4776 FACE_LIBRARIES property. On platforms requiring dependent
4777 shared libraries to be found at link time CMake uses this list
4778 to add appropriate files or paths to the link command line.
4779 Ignored for non-imported targets.
4780
4781
4782 IMPORTED_LINK_DEPENDENT_LIBRARIES_<CONFIG>
4783 Per-configuration version of IMPORTED_LINK_DEPENDENT_LIBRARIES.
4784
4785 This property is used when loading settings for the <CONFIG>
4786 configuration of an imported target. Configuration names corre‐
4787 spond to those provided by the project from which the target is
4788 imported. If set, this property completely overrides the
4789 generic property for the named configuration.
4790
4791
4792 IMPORTED_LINK_INTERFACE_LANGUAGES
4793 Languages compiled into an IMPORTED static library.
4794
4795 Lists languages of soure files compiled to produce a STATIC
4796 IMPORTED library (such as "C" or "CXX"). CMake accounts for
4797 these languages when computing how to link a target to the
4798 imported library. For example, when a C executable links to an
4799 imported C++ static library CMake chooses the C++ linker to sat‐
4800 isfy language runtime dependencies of the static library.
4801
4802
4803 This property is ignored for targets that are not STATIC
4804 libraries. This property is ignored for non-imported targets.
4805
4806
4807 IMPORTED_LINK_INTERFACE_LANGUAGES_<CONFIG>
4808 Per-configuration version of IMPORTED_LINK_INTERFACE_LANGUAGES.
4809
4810 This property is used when loading settings for the <CONFIG>
4811 configuration of an imported target. Configuration names corre‐
4812 spond to those provided by the project from which the target is
4813 imported. If set, this property completely overrides the
4814 generic property for the named configuration.
4815
4816
4817 IMPORTED_LINK_INTERFACE_LIBRARIES
4818 Transitive link interface of an IMPORTED target.
4819
4820 Lists libraries whose interface is included when an IMPORTED
4821 library target is linked to another target. The libraries will
4822 be included on the link line for the target. Unlike the
4823 LINK_INTERFACE_LIBRARIES property, this property applies to all
4824 imported target types, including STATIC libraries. This prop‐
4825 erty is ignored for non-imported targets.
4826
4827
4828 IMPORTED_LINK_INTERFACE_LIBRARIES_<CONFIG>
4829 Per-configuration version of IMPORTED_LINK_INTERFACE_LIBRARIES.
4830
4831 This property is used when loading settings for the <CONFIG>
4832 configuration of an imported target. Configuration names corre‐
4833 spond to those provided by the project from which the target is
4834 imported. If set, this property completely overrides the
4835 generic property for the named configuration.
4836
4837
4838 IMPORTED_LINK_INTERFACE_MULTIPLICITY
4839 Repetition count for cycles of IMPORTED static libraries.
4840
4841 This is LINK_INTERFACE_MULTIPLICITY for IMPORTED targets.
4842
4843
4844 IMPORTED_LINK_INTERFACE_MULTIPLICITY_<CONFIG>
4845 Per-configuration repetition count for cycles of IMPORTED ar‐
4846 chives.
4847
4848 This is the configuration-specific version of
4849 IMPORTED_LINK_INTERFACE_MULTIPLICITY. If set, this property
4850 completely overrides the generic property for the named configu‐
4851 ration.
4852
4853
4854 IMPORTED_LOCATION
4855 Full path to the main file on disk for an IMPORTED target.
4856
4857 Specifies the location of an IMPORTED target file on disk. For
4858 executables this is the location of the executable file. For
4859 bundles on OS X this is the location of the executable file
4860 inside Contents/MacOS under the application bundle folder. For
4861 static libraries and modules this is the location of the library
4862 or module. For shared libraries on non-DLL platforms this is
4863 the location of the shared library. For frameworks on OS X this
4864 is the location of the library file symlink just inside the
4865 framework folder. For DLLs this is the location of the ".dll"
4866 part of the library. For UNKNOWN libraries this is the location
4867 of the file to be linked. Ignored for non-imported targets.
4868
4869
4870 IMPORTED_LOCATION_<CONFIG>
4871 Per-configuration version of IMPORTED_LOCATION property.
4872
4873 This property is used when loading settings for the <CONFIG>
4874 configuration of an imported target. Configuration names corre‐
4875 spond to those provided by the project from which the target is
4876 imported.
4877
4878
4879 IMPORTED_NO_SONAME
4880 Specifies that an IMPORTED shared library target has no "son‐
4881 ame".
4882
4883 Set this property to true for an imported shared library file
4884 that has no "soname" field. CMake may adjust generated link
4885 commands for some platforms to prevent the linker from using the
4886 path to the library in place of its missing soname. Ignored for
4887 non-imported targets.
4888
4889
4890 IMPORTED_NO_SONAME_<CONFIG>
4891 Per-configuration version of IMPORTED_NO_SONAME property.
4892
4893 This property is used when loading settings for the <CONFIG>
4894 configuration of an imported target. Configuration names corre‐
4895 spond to those provided by the project from which the target is
4896 imported.
4897
4898
4899 IMPORTED_SONAME
4900 The "soname" of an IMPORTED target of shared library type.
4901
4902 Specifies the "soname" embedded in an imported shared library.
4903 This is meaningful only on platforms supporting the feature.
4904 Ignored for non-imported targets.
4905
4906
4907 IMPORTED_SONAME_<CONFIG>
4908 Per-configuration version of IMPORTED_SONAME property.
4909
4910 This property is used when loading settings for the <CONFIG>
4911 configuration of an imported target. Configuration names corre‐
4912 spond to those provided by the project from which the target is
4913 imported.
4914
4915
4916 IMPORT_PREFIX
4917 What comes before the import library name.
4918
4919 Similar to the target property PREFIX, but used for import
4920 libraries (typically corresponding to a DLL) instead of regular
4921 libraries. A target property that can be set to override the
4922 prefix (such as "lib") on an import library name.
4923
4924
4925 IMPORT_SUFFIX
4926 What comes after the import library name.
4927
4928 Similar to the target property SUFFIX, but used for import
4929 libraries (typically corresponding to a DLL) instead of regular
4930 libraries. A target property that can be set to override the
4931 suffix (such as ".lib") on an import library name.
4932
4933
4934 INSTALL_NAME_DIR
4935 Mac OSX directory name for installed targets.
4936
4937 INSTALL_NAME_DIR is a string specifying the directory portion of
4938 the "install_name" field of shared libraries on Mac OSX to use
4939 in the installed targets.
4940
4941
4942 INSTALL_RPATH
4943 The rpath to use for installed targets.
4944
4945 A semicolon-separated list specifying the rpath to use in
4946 installed targets (for platforms that support it). This prop‐
4947 erty is initialized by the value of the variable
4948 CMAKE_INSTALL_RPATH if it is set when a target is created.
4949
4950
4951 INSTALL_RPATH_USE_LINK_PATH
4952 Add paths to linker search and installed rpath.
4953
4954 INSTALL_RPATH_USE_LINK_PATH is a boolean that if set to true
4955 will append directories in the linker search path and outside
4956 the project to the INSTALL_RPATH. This property is initialized
4957 by the value of the variable CMAKE_INSTALL_RPATH_USE_LINK_PATH
4958 if it is set when a target is created.
4959
4960
4961 INTERPROCEDURAL_OPTIMIZATION
4962 Enable interprocedural optimization for a target.
4963
4964 If set to true, enables interprocedural optimizations if they
4965 are known to be supported by the compiler.
4966
4967
4968 INTERPROCEDURAL_OPTIMIZATION_<CONFIG>
4969 Per-configuration interprocedural optimization for a target.
4970
4971 This is a per-configuration version of INTERPROCEDURAL_OPTIMIZA‐
4972 TION. If set, this property overrides the generic property for
4973 the named configuration.
4974
4975
4976 LABELS Specify a list of text labels associated with a target.
4977
4978 Target label semantics are currently unspecified.
4979
4980
4981 LIBRARY_OUTPUT_DIRECTORY
4982 Output directory in which to build LIBRARY target files.
4983
4984 This property specifies the directory into which library target
4985 files should be built. Multi-configuration generators (VS,
4986 Xcode) append a per-configuration subdirectory to the specified
4987 directory. There are three kinds of target files that may be
4988 built: archive, library, and runtime. Executables are always
4989 treated as runtime targets. Static libraries are always treated
4990 as archive targets. Module libraries are always treated as
4991 library targets. For non-DLL platforms shared libraries are
4992 treated as library targets. For DLL platforms the DLL part of a
4993 shared library is treated as a runtime target and the corre‐
4994 sponding import library is treated as an archive target. All
4995 Windows-based systems including Cygwin are DLL platforms. This
4996 property is initialized by the value of the variable
4997 CMAKE_LIBRARY_OUTPUT_DIRECTORY if it is set when a target is
4998 created.
4999
5000
5001 LIBRARY_OUTPUT_DIRECTORY_<CONFIG>
5002 Per-configuration output directory for LIBRARY target files.
5003
5004 This is a per-configuration version of LIBRARY_OUTPUT_DIRECTORY,
5005 but multi-configuration generators (VS, Xcode) do NOT append a
5006 per-configuration subdirectory to the specified directory. This
5007 property is initialized by the value of the variable
5008 CMAKE_LIBRARY_OUTPUT_DIRECTORY_<CONFIG> if it is set when a tar‐
5009 get is created.
5010
5011
5012 LIBRARY_OUTPUT_NAME
5013 Output name for LIBRARY target files.
5014
5015 This property specifies the base name for library target files.
5016 It overrides OUTPUT_NAME and OUTPUT_NAME_<CONFIG> properties.
5017 There are three kinds of target files that may be built: ar‐
5018 chive, library, and runtime. Executables are always treated as
5019 runtime targets. Static libraries are always treated as archive
5020 targets. Module libraries are always treated as library targets.
5021 For non-DLL platforms shared libraries are treated as library
5022 targets. For DLL platforms the DLL part of a shared library is
5023 treated as a runtime target and the corresponding import library
5024 is treated as an archive target. All Windows-based systems
5025 including Cygwin are DLL platforms.
5026
5027
5028 LIBRARY_OUTPUT_NAME_<CONFIG>
5029 Per-configuration output name for LIBRARY target files.
5030
5031 This is the configuration-specific version of LIBRARY_OUT‐
5032 PUT_NAME.
5033
5034
5035 LINKER_LANGUAGE
5036 Specifies language whose compiler will invoke the linker.
5037
5038 For executables, shared libraries, and modules, this sets the
5039 language whose compiler is used to link the target (such as "C"
5040 or "CXX"). A typical value for an executable is the language of
5041 the source file providing the program entry point (main). If
5042 not set, the language with the highest linker preference value
5043 is the default. See documentation of CMAKE_<LANG>_LINKER_PREF‐
5044 ERENCE variables.
5045
5046
5047 LINK_DEPENDS
5048 Additional files on which a target binary depends for linking.
5049
5050 Specifies a semicolon-separated list of full-paths to files on
5051 which the link rule for this target depends. The target binary
5052 will be linked if any of the named files is newer than it.
5053
5054
5055 This property is ignored by non-Makefile generators. It is
5056 intended to specify dependencies on "linker scripts" for custom
5057 Makefile link rules.
5058
5059
5060 LINK_FLAGS
5061 Additional flags to use when linking this target.
5062
5063 The LINK_FLAGS property can be used to add extra flags to the
5064 link step of a target. LINK_FLAGS_<CONFIG> will add to the con‐
5065 figuration <CONFIG>, for example, DEBUG, RELEASE, MINSIZEREL,
5066 RELWITHDEBINFO.
5067
5068
5069 LINK_FLAGS_<CONFIG>
5070 Per-configuration linker flags for a target.
5071
5072 This is the configuration-specific version of LINK_FLAGS.
5073
5074
5075 LINK_INTERFACE_LIBRARIES
5076 List public interface libraries for a shared library or exe‐
5077 cutable.
5078
5079 By default linking to a shared library target transitively links
5080 to targets with which the library itself was linked. For an
5081 executable with exports (see the ENABLE_EXPORTS property) no
5082 default transitive link dependencies are used. This property
5083 replaces the default transitive link dependencies with an
5084 explict list. When the target is linked into another target the
5085 libraries listed (and recursively their link interface
5086 libraries) will be provided to the other target also. If the
5087 list is empty then no transitive link dependencies will be
5088 incorporated when this target is linked into another target even
5089 if the default set is non-empty. This property is ignored for
5090 STATIC libraries.
5091
5092
5093 LINK_INTERFACE_LIBRARIES_<CONFIG>
5094 Per-configuration list of public interface libraries for a tar‐
5095 get.
5096
5097 This is the configuration-specific version of LINK_INTER‐
5098 FACE_LIBRARIES. If set, this property completely overrides the
5099 generic property for the named configuration.
5100
5101
5102 LINK_INTERFACE_MULTIPLICITY
5103 Repetition count for STATIC libraries with cyclic dependencies.
5104
5105 When linking to a STATIC library target with cyclic dependencies
5106 the linker may need to scan more than once through the archives
5107 in the strongly connected component of the dependency graph.
5108 CMake by default constructs the link line so that the linker
5109 will scan through the component at least twice. This property
5110 specifies the minimum number of scans if it is larger than the
5111 default. CMake uses the largest value specified by any target
5112 in a component.
5113
5114
5115 LINK_INTERFACE_MULTIPLICITY_<CONFIG>
5116 Per-configuration repetition count for cycles of STATIC
5117 libraries.
5118
5119 This is the configuration-specific version of LINK_INTER‐
5120 FACE_MULTIPLICITY. If set, this property completely overrides
5121 the generic property for the named configuration.
5122
5123
5124 LINK_SEARCH_END_STATIC
5125 End a link line such that static system libraries are used.
5126
5127 Some linkers support switches such as -Bstatic and -Bdynamic to
5128 determine whether to use static or shared libraries for -lXXX
5129 options. CMake uses these options to set the link type for
5130 libraries whose full paths are not known or (in some cases) are
5131 in implicit link directories for the platform. By default the
5132 linker search type is left at -Bdynamic by the end of the
5133 library list. This property switches the final linker search
5134 type to -Bstatic.
5135
5136
5137 LOCATION
5138 Read-only location of a target on disk.
5139
5140 For an imported target, this read-only property returns the
5141 value of the LOCATION_<CONFIG> property for an unspecified con‐
5142 figuration <CONFIG> provided by the target.
5143
5144
5145 For a non-imported target, this property is provided for compat‐
5146 ibility with CMake 2.4 and below. It was meant to get the loca‐
5147 tion of an executable target's output file for use in add_cus‐
5148 tom_command. The path may contain a build-system-specific por‐
5149 tion that is replaced at build time with the configuration get‐
5150 ting built (such as "$(ConfigurationName)" in VS). In CMake 2.6
5151 and above add_custom_command automatically recognizes a target
5152 name in its COMMAND and DEPENDS options and computes the target
5153 location. In CMake 2.8.4 and above add_custom_command recog‐
5154 nizes generator expressions to refer to target locations any‐
5155 where in the command. Therefore this property is not needed for
5156 creating custom commands.
5157
5158
5159 Do not set properties that affect the location of the target
5160 after reading this property. These include properties whose
5161 names match "(RUNTIME|LIBRARY|ARCHIVE)_OUTPUT_(NAME|DIREC‐
5162 TORY)(_<CONFIG>)?" or "(IMPLIB_)?(PREFIX|SUFFIX)". Failure to
5163 follow this rule is not diagnosed and leaves the location of the
5164 target undefined.
5165
5166
5167 LOCATION_<CONFIG>
5168 Read-only property providing a target location on disk.
5169
5170 A read-only property that indicates where a target's main file
5171 is located on disk for the configuration <CONFIG>. The property
5172 is defined only for library and executable targets. An imported
5173 target may provide a set of configurations different from that
5174 of the importing project. By default CMake looks for an
5175 exact-match but otherwise uses an arbitrary available configura‐
5176 tion. Use the MAP_IMPORTED_CONFIG_<CONFIG> property to map
5177 imported configurations explicitly.
5178
5179
5180 Do not set properties that affect the location of the target
5181 after reading this property. These include properties whose
5182 names match "(RUNTIME|LIBRARY|ARCHIVE)_OUTPUT_(NAME|DIREC‐
5183 TORY)(_<CONFIG>)?" or "(IMPLIB_)?(PREFIX|SUFFIX)". Failure to
5184 follow this rule is not diagnosed and leaves the location of the
5185 target undefined.
5186
5187
5188 MACOSX_BUNDLE
5189 Build an executable as an application bundle on Mac OS X.
5190
5191 When this property is set to true the executable when built on
5192 Mac OS X will be created as an application bundle. This makes
5193 it a GUI executable that can be launched from the Finder. See
5194 the MACOSX_BUNDLE_INFO_PLIST target property for information
5195 about creation of the Info.plist file for the application bun‐
5196 dle.
5197
5198
5199 MACOSX_BUNDLE_INFO_PLIST
5200 Specify a custom Info.plist template for a Mac OS X App Bundle.
5201
5202 An executable target with MACOSX_BUNDLE enabled will be built as
5203 an application bundle on Mac OS X. By default its Info.plist
5204 file is created by configuring a template called MacOSXBundle‐
5205 Info.plist.in located in the CMAKE_MODULE_PATH. This property
5206 specifies an alternative template file name which may be a full
5207 path.
5208
5209
5210 The following target properties may be set to specify content to
5211 be configured into the file:
5212
5213
5214 MACOSX_BUNDLE_INFO_STRING
5215 MACOSX_BUNDLE_ICON_FILE
5216 MACOSX_BUNDLE_GUI_IDENTIFIER
5217 MACOSX_BUNDLE_LONG_VERSION_STRING
5218 MACOSX_BUNDLE_BUNDLE_NAME
5219 MACOSX_BUNDLE_SHORT_VERSION_STRING
5220 MACOSX_BUNDLE_BUNDLE_VERSION
5221 MACOSX_BUNDLE_COPYRIGHT
5222
5223 CMake variables of the same name may be set to affect all tar‐
5224 gets in a directory that do not have each specific property set.
5225 If a custom Info.plist is specified by this property it may of
5226 course hard-code all the settings instead of using the target
5227 properties.
5228
5229
5230 MACOSX_FRAMEWORK_INFO_PLIST
5231 Specify a custom Info.plist template for a Mac OS X Framework.
5232
5233 An library target with FRAMEWORK enabled will be built as a
5234 framework on Mac OS X. By default its Info.plist file is cre‐
5235 ated by configuring a template called MacOSXFramework‐
5236 Info.plist.in located in the CMAKE_MODULE_PATH. This property
5237 specifies an alternative template file name which may be a full
5238 path.
5239
5240
5241 The following target properties may be set to specify content to
5242 be configured into the file:
5243
5244
5245 MACOSX_FRAMEWORK_ICON_FILE
5246 MACOSX_FRAMEWORK_IDENTIFIER
5247 MACOSX_FRAMEWORK_SHORT_VERSION_STRING
5248 MACOSX_FRAMEWORK_BUNDLE_VERSION
5249
5250 CMake variables of the same name may be set to affect all tar‐
5251 gets in a directory that do not have each specific property set.
5252 If a custom Info.plist is specified by this property it may of
5253 course hard-code all the settings instead of using the target
5254 properties.
5255
5256
5257 MAP_IMPORTED_CONFIG_<CONFIG>
5258 Map from project configuration to IMPORTED target's configura‐
5259 tion.
5260
5261 List configurations of an imported target that may be used for
5262 the current project's <CONFIG> configuration. Targets imported
5263 from another project may not provide the same set of configura‐
5264 tion names available in the current project. Setting this prop‐
5265 erty tells CMake what imported configurations are suitable for
5266 use when building the <CONFIG> configuration. The first config‐
5267 uration in the list found to be provided by the imported target
5268 is selected. If no matching configurations are available the
5269 imported target is considered to be not found. This property is
5270 ignored for non-imported targets.
5271
5272
5273 OSX_ARCHITECTURES
5274 Target specific architectures for OS X.
5275
5276 The OSX_ARCHITECTURES property sets the target binary architec‐
5277 ture for targets on OS X. This property is initialized by the
5278 value of the variable CMAKE_OSX_ARCHITECTURES if it is set when
5279 a target is created. Use OSX_ARCHITECTURES_<CONFIG> to set the
5280 binary architectures on a per-configuration basis. <CONFIG> is
5281 an upper-case name (ex: "OSX_ARCHITECTURES_DEBUG").
5282
5283
5284 OSX_ARCHITECTURES_<CONFIG>
5285 Per-configuration OS X binary architectures for a target.
5286
5287 This property is the configuration-specific version of
5288 OSX_ARCHITECTURES.
5289
5290
5291 OUTPUT_NAME
5292 Output name for target files.
5293
5294 This sets the base name for output files created for an exe‐
5295 cutable or library target. If not set, the logical target name
5296 is used by default.
5297
5298
5299 OUTPUT_NAME_<CONFIG>
5300 Per-configuration target file base name.
5301
5302 This is the configuration-specific version of OUTPUT_NAME.
5303
5304
5305 POST_INSTALL_SCRIPT
5306 Deprecated install support.
5307
5308 The PRE_INSTALL_SCRIPT and POST_INSTALL_SCRIPT properties are
5309 the old way to specify CMake scripts to run before and after
5310 installing a target. They are used only when the old
5311 INSTALL_TARGETS command is used to install the target. Use the
5312 INSTALL command instead.
5313
5314
5315 PREFIX What comes before the library name.
5316
5317 A target property that can be set to override the prefix (such
5318 as "lib") on a library name.
5319
5320
5321 PRE_INSTALL_SCRIPT
5322 Deprecated install support.
5323
5324 The PRE_INSTALL_SCRIPT and POST_INSTALL_SCRIPT properties are
5325 the old way to specify CMake scripts to run before and after
5326 installing a target. They are used only when the old
5327 INSTALL_TARGETS command is used to install the target. Use the
5328 INSTALL command instead.
5329
5330
5331 PRIVATE_HEADER
5332 Specify private header files in a FRAMEWORK shared library tar‐
5333 get.
5334
5335 Shared library targets marked with the FRAMEWORK property gener‐
5336 ate frameworks on OS X and normal shared libraries on other
5337 platforms. This property may be set to a list of header files
5338 to be placed in the PrivateHeaders directory inside the frame‐
5339 work folder. On non-Apple platforms these headers may be
5340 installed using the PRIVATE_HEADER option to the install(TAR‐
5341 GETS) command.
5342
5343
5344 PROJECT_LABEL
5345 Change the name of a target in an IDE.
5346
5347 Can be used to change the name of the target in an IDE like Vis‐
5348 ual Studio.
5349
5350
5351 PUBLIC_HEADER
5352 Specify public header files in a FRAMEWORK shared library tar‐
5353 get.
5354
5355 Shared library targets marked with the FRAMEWORK property gener‐
5356 ate frameworks on OS X and normal shared libraries on other
5357 platforms. This property may be set to a list of header files
5358 to be placed in the Headers directory inside the framework
5359 folder. On non-Apple platforms these headers may be installed
5360 using the PUBLIC_HEADER option to the install(TARGETS) command.
5361
5362
5363 RESOURCE
5364 Specify resource files in a FRAMEWORK shared library target.
5365
5366 Shared library targets marked with the FRAMEWORK property gener‐
5367 ate frameworks on OS X and normal shared libraries on other
5368 platforms. This property may be set to a list of files to be
5369 placed in the Resources directory inside the framework folder.
5370 On non-Apple platforms these files may be installed using the
5371 RESOURCE option to the install(TARGETS) command.
5372
5373
5374 RULE_LAUNCH_COMPILE
5375 Specify a launcher for compile rules.
5376
5377 See the global property of the same name for details. This
5378 overrides the global and directory property for a target.
5379
5380
5381 RULE_LAUNCH_CUSTOM
5382 Specify a launcher for custom rules.
5383
5384 See the global property of the same name for details. This
5385 overrides the global and directory property for a target.
5386
5387
5388 RULE_LAUNCH_LINK
5389 Specify a launcher for link rules.
5390
5391 See the global property of the same name for details. This
5392 overrides the global and directory property for a target.
5393
5394
5395 RUNTIME_OUTPUT_DIRECTORY
5396 Output directory in which to build RUNTIME target files.
5397
5398 This property specifies the directory into which runtime target
5399 files should be built. Multi-configuration generators (VS,
5400 Xcode) append a per-configuration subdirectory to the specified
5401 directory. There are three kinds of target files that may be
5402 built: archive, library, and runtime. Executables are always
5403 treated as runtime targets. Static libraries are always treated
5404 as archive targets. Module libraries are always treated as
5405 library targets. For non-DLL platforms shared libraries are
5406 treated as library targets. For DLL platforms the DLL part of a
5407 shared library is treated as a runtime target and the corre‐
5408 sponding import library is treated as an archive target. All
5409 Windows-based systems including Cygwin are DLL platforms. This
5410 property is initialized by the value of the variable CMAKE_RUN‐
5411 TIME_OUTPUT_DIRECTORY if it is set when a target is created.
5412
5413
5414 RUNTIME_OUTPUT_DIRECTORY_<CONFIG>
5415 Per-configuration output directory for RUNTIME target files.
5416
5417 This is a per-configuration version of RUNTIME_OUTPUT_DIRECTORY,
5418 but multi-configuration generators (VS, Xcode) do NOT append a
5419 per-configuration subdirectory to the specified directory. This
5420 property is initialized by the value of the variable CMAKE_RUN‐
5421 TIME_OUTPUT_DIRECTORY_<CONFIG> if it is set when a target is
5422 created.
5423
5424
5425 RUNTIME_OUTPUT_NAME
5426 Output name for RUNTIME target files.
5427
5428 This property specifies the base name for runtime target files.
5429 It overrides OUTPUT_NAME and OUTPUT_NAME_<CONFIG> properties.
5430 There are three kinds of target files that may be built: ar‐
5431 chive, library, and runtime. Executables are always treated as
5432 runtime targets. Static libraries are always treated as archive
5433 targets. Module libraries are always treated as library targets.
5434 For non-DLL platforms shared libraries are treated as library
5435 targets. For DLL platforms the DLL part of a shared library is
5436 treated as a runtime target and the corresponding import library
5437 is treated as an archive target. All Windows-based systems
5438 including Cygwin are DLL platforms.
5439
5440
5441 RUNTIME_OUTPUT_NAME_<CONFIG>
5442 Per-configuration output name for RUNTIME target files.
5443
5444 This is the configuration-specific version of RUNTIME_OUT‐
5445 PUT_NAME.
5446
5447
5448 SKIP_BUILD_RPATH
5449 Should rpaths be used for the build tree.
5450
5451 SKIP_BUILD_RPATH is a boolean specifying whether to skip auto‐
5452 matic generation of an rpath allowing the target to run from the
5453 build tree. This property is initialized by the value of the
5454 variable CMAKE_SKIP_BUILD_RPATH if it is set when a target is
5455 created.
5456
5457
5458 SOURCES
5459 Source names specified for a target.
5460
5461 Read-only list of sources specified for a target. The names
5462 returned are suitable for passing to the set_source_files_prop‐
5463 erties command.
5464
5465
5466 SOVERSION
5467 What version number is this target.
5468
5469 For shared libraries VERSION and SOVERSION can be used to spec‐
5470 ify the build version and api version respectively. When build‐
5471 ing or installing appropriate symlinks are created if the plat‐
5472 form supports symlinks and the linker supports so-names. If only
5473 one of both is specified the missing is assumed to have the same
5474 version number. For shared libraries and executables on Windows
5475 the VERSION attribute is parsed to extract a "major.minor" ver‐
5476 sion number. These numbers are used as the image version of the
5477 binary.
5478
5479
5480 STATIC_LIBRARY_FLAGS
5481 Extra flags to use when linking static libraries.
5482
5483 Extra flags to use when linking a static library.
5484
5485
5486 STATIC_LIBRARY_FLAGS_<CONFIG>
5487 Per-configuration flags for creating a static library.
5488
5489 This is the configuration-specific version of
5490 STATIC_LIBRARY_FLAGS.
5491
5492
5493 SUFFIX What comes after the library name.
5494
5495 A target property that can be set to override the suffix (such
5496 as ".so") on a library name.
5497
5498
5499 TYPE The type of the target.
5500
5501 This read-only property can be used to test the type of the
5502 given target. It will be one of STATIC_LIBRARY, MODULE_LIBRARY,
5503 SHARED_LIBRARY, EXECUTABLE or one of the internal target types.
5504
5505
5506 VERSION
5507 What version number is this target.
5508
5509 For shared libraries VERSION and SOVERSION can be used to spec‐
5510 ify the build version and api version respectively. When build‐
5511 ing or installing appropriate symlinks are created if the plat‐
5512 form supports symlinks and the linker supports so-names. If only
5513 one of both is specified the missing is assumed to have the same
5514 version number. For executables VERSION can be used to specify
5515 the build version. When building or installing appropriate sym‐
5516 links are created if the platform supports symlinks. For shared
5517 libraries and executables on Windows the VERSION attribute is
5518 parsed to extract a "major.minor" version number. These numbers
5519 are used as the image version of the binary.
5520
5521
5522 VS_KEYWORD
5523 Visual Studio project keyword.
5524
5525 Can be set to change the visual studio keyword, for example QT
5526 integration works better if this is set to Qt4VSv1.0.
5527
5528
5529 VS_SCC_LOCALPATH
5530 Visual Studio Source Code Control Provider.
5531
5532 Can be set to change the visual studio source code control local
5533 path property.
5534
5535
5536 VS_SCC_PROJECTNAME
5537 Visual Studio Source Code Control Project.
5538
5539 Can be set to change the visual studio source code control
5540 project name property.
5541
5542
5543 VS_SCC_PROVIDER
5544 Visual Studio Source Code Control Provider.
5545
5546 Can be set to change the visual studio source code control
5547 provider property.
5548
5549
5550 WIN32_EXECUTABLE
5551 Build an executable with a WinMain entry point on windows.
5552
5553 When this property is set to true the executable when linked on
5554 Windows will be created with a WinMain() entry point instead of
5555 of just main().This makes it a GUI executable instead of a con‐
5556 sole application. See the CMAKE_MFC_FLAG variable documentation
5557 to configure use of MFC for WinMain executables.
5558
5559
5560 XCODE_ATTRIBUTE_<an-attribute>
5561 Set Xcode target attributes directly.
5562
5563 Tell the Xcode generator to set '<an-attribute>' to a given
5564 value in the generated Xcode project. Ignored on other genera‐
5565 tors.
5566
5567
5569 ATTACHED_FILES
5570 Attach a list of files to a dashboard submission.
5571
5572 Set this property to a list of files that will be encoded and
5573 submitted to the dashboard as an addition to the test result.
5574
5575
5576 ATTACHED_FILES_ON_FAIL
5577 Attach a list of files to a dashboard submission if the test
5578 fails.
5579
5580 Same as ATTACHED_FILES, but these files will only be included if
5581 the test does not pass.
5582
5583
5584 COST Set this to a floating point value. Tests in a test set will be
5585 run in descending order of cost.
5586
5587 This property describes the cost of a test. You can explicitly
5588 set this value; tests with higher COST values will run first.
5589
5590
5591 DEPENDS
5592 Specifies that this test should only be run after the specified
5593 list of tests.
5594
5595 Set this to a list of tests that must finish before this test is
5596 run.
5597
5598
5599 ENVIRONMENT
5600 Specify environment variables that should be defined for running
5601 a test.
5602
5603 If set to a list of environment variables and values of the form
5604 MYVAR=value those environment variables will be defined while
5605 running the test. The environment is restored to its previous
5606 state after the test is done.
5607
5608
5609 FAIL_REGULAR_EXPRESSION
5610 If the output matches this regular expression the test will
5611 fail.
5612
5613 If set, if the output matches one of specified regular expres‐
5614 sions, the test will fail.For example: PASS_REGULAR_EXPRESSION
5615 "[^a-z]Error;ERROR;Failed"
5616
5617
5618 LABELS Specify a list of text labels associated with a test.
5619
5620 The list is reported in dashboard submissions.
5621
5622
5623 MEASUREMENT
5624 Specify a CDASH measurement and value to be reported for a test.
5625
5626 If set to a name then that name will be reported to CDASH as a
5627 named measurement with a value of 1. You may also specify a
5628 value by setting MEASUREMENT to "measurement=value".
5629
5630
5631 PASS_REGULAR_EXPRESSION
5632 The output must match this regular expression for the test to
5633 pass.
5634
5635 If set, the test output will be checked against the specified
5636 regular expressions and at least one of the regular expressions
5637 has to match, otherwise the test will fail.
5638
5639
5640 PROCESSORS
5641 How many process slots this test requires
5642
5643 Denotes the number of processors that this test will require.
5644 This is typically used for MPI tests, and should be used in con‐
5645 junction with the ctest_test PARALLEL_LEVEL option.
5646
5647
5648 REQUIRED_FILES
5649 List of files required to run the test.
5650
5651 If set to a list of files, the test will not be run unless all
5652 of the files exist.
5653
5654
5655 RESOURCE_LOCK
5656 Specify a list of resources that are locked by this test.
5657
5658 If multiple tests specify the same resource lock, they are guar‐
5659 anteed not to run concurrently.
5660
5661
5662 RUN_SERIAL
5663 Do not run this test in parallel with any other test.
5664
5665 Use this option in conjunction with the ctest_test PARAL‐
5666 LEL_LEVEL option to specify that this test should not be run in
5667 parallel with any other tests.
5668
5669
5670 TIMEOUT
5671 How many seconds to allow for this test.
5672
5673 This property if set will limit a test to not take more than the
5674 specified number of seconds to run. If it exceeds that the test
5675 process will be killed and ctest will move to the next test.
5676 This setting takes precedence over CTEST_TESTING_TIMEOUT.
5677
5678
5679 WILL_FAIL
5680 If set to true, this will invert the pass/fail flag of the test.
5681
5682 This property can be used for tests that are expected to fail
5683 and return a non zero return code.
5684
5685
5686 WORKING_DIRECTORY
5687 The directory from which the test executable will be called.
5688
5689 If this is not set it is called from the directory the test exe‐
5690 cutable is located in.
5691
5692
5694 ABSTRACT
5695 Is this source file an abstract class.
5696
5697 A property on a source file that indicates if the source file
5698 represents a class that is abstract. This only makes sense for
5699 languages that have a notion of an abstract class and it is only
5700 used by some tools that wrap classes into other languages.
5701
5702
5703 COMPILE_DEFINITIONS
5704 Preprocessor definitions for compiling a source file.
5705
5706 The COMPILE_DEFINITIONS property may be set to a semicolon-sepa‐
5707 rated list of preprocessor definitions using the syntax VAR or
5708 VAR=value. Function-style definitions are not supported. CMake
5709 will automatically escape the value correctly for the native
5710 build system (note that CMake language syntax may require
5711 escapes to specify some values). This property may be set on a
5712 per-configuration basis using the name COMPILE_DEFINITIONS_<CON‐
5713 FIG> where <CONFIG> is an upper-case name (ex. "COMPILE_DEFINI‐
5714 TIONS_DEBUG").
5715
5716
5717 CMake will automatically drop some definitions that are not sup‐
5718 ported by the native build tool. The VS6 IDE does not support
5719 definition values with spaces (but NMake does). Xcode does not
5720 support per-configuration definitions on source files.
5721
5722
5723 Disclaimer: Most native build tools have poor support for escap‐
5724 ing certain values. CMake has work-arounds for many cases but
5725 some values may just not be possible to pass correctly. If a
5726 value does not seem to be escaped correctly, do not attempt to
5727 work-around the problem by adding escape sequences to the value.
5728 Your work-around may break in a future version of CMake that has
5729 improved escape support. Instead consider defining the macro in
5730 a (configured) header file. Then report the limitation. Known
5731 limitations include:
5732
5733
5734 # - broken almost everywhere
5735 ; - broken in VS IDE and Borland Makefiles
5736 , - broken in VS IDE
5737 % - broken in some cases in NMake
5738 & | - broken in some cases on MinGW
5739 ^ < > \" - broken in most Make tools on Windows
5740
5741 CMake does not reject these values outright because they do work
5742 in some cases. Use with caution.
5743
5744
5745 COMPILE_DEFINITIONS_<CONFIG>
5746 Per-configuration preprocessor definitions on a source file.
5747
5748 This is the configuration-specific version of COMPILE_DEFINI‐
5749 TIONS. Note that Xcode does not support per-configuration
5750 source file flags so this property will be ignored by the Xcode
5751 generator.
5752
5753
5754 COMPILE_FLAGS
5755 Additional flags to be added when compiling this source file.
5756
5757 These flags will be added to the list of compile flags when this
5758 source file builds. Use COMPILE_DEFINITIONS to pass additional
5759 preprocessor definitions.
5760
5761
5762 EXTERNAL_OBJECT
5763 If set to true then this is an object file.
5764
5765 If this property is set to true then the source file is really
5766 an object file and should not be compiled. It will still be
5767 linked into the target though.
5768
5769
5770 GENERATED
5771 Is this source file generated as part of the build process.
5772
5773 If a source file is generated by the build process CMake will
5774 handle it differently in terms of dependency checking etc. Oth‐
5775 erwise having a non-existent source file could create problems.
5776
5777
5778 HEADER_FILE_ONLY
5779 Is this source file only a header file.
5780
5781 A property on a source file that indicates if the source file is
5782 a header file with no associated implementation. This is set
5783 automatically based on the file extension and is used by CMake
5784 to determine is certain dependency information should be com‐
5785 puted.
5786
5787
5788 KEEP_EXTENSION
5789 Make the output file have the same extension as the source file.
5790
5791 If this property is set then the file extension of the output
5792 file will be the same as that of the source file. Normally the
5793 output file extension is computed based on the language of the
5794 source file, for example .cxx will go to a .o extension.
5795
5796
5797 LABELS Specify a list of text labels associated with a source file.
5798
5799 This property has meaning only when the source file is listed in
5800 a target whose LABELS property is also set. No other semantics
5801 are currently specified.
5802
5803
5804 LANGUAGE
5805 What programming language is the file.
5806
5807 A property that can be set to indicate what programming language
5808 the source file is. If it is not set the language is determined
5809 based on the file extension. Typical values are CXX C etc. Set‐
5810 ting this property for a file means this file will be compiled.
5811 Do not set this for header or files that should not be compiled.
5812
5813
5814 LOCATION
5815 The full path to a source file.
5816
5817 A read only property on a SOURCE FILE that contains the full
5818 path to the source file.
5819
5820
5821 MACOSX_PACKAGE_LOCATION
5822 Place a source file inside a Mac OS X bundle or framework.
5823
5824 Executable targets with the MACOSX_BUNDLE property set are built
5825 as Mac OS X application bundles on Apple platforms. Shared
5826 library targets with the FRAMEWORK property set are built as Mac
5827 OS X frameworks on Apple platforms. Source files listed in the
5828 target with this property set will be copied to a directory
5829 inside the bundle or framework content folder specified by the
5830 property value. For bundles the content folder is
5831 "<name>.app/Contents". For frameworks the content folder is
5832 "<name>.framework/Versions/<version>". See the PUBLIC_HEADER,
5833 PRIVATE_HEADER, and RESOURCE target properties for specifying
5834 files meant for Headers, PrivateHeaders, or Resources directo‐
5835 ries.
5836
5837
5838 OBJECT_DEPENDS
5839 Additional files on which a compiled object file depends.
5840
5841 Specifies a semicolon-separated list of full-paths to files on
5842 which any object files compiled from this source file depend.
5843 An object file will be recompiled if any of the named files is
5844 newer than it.
5845
5846
5847 This property need not be used to specify the dependency of a
5848 source file on a generated header file that it includes.
5849 Although the property was originally introduced for this pur‐
5850 pose, it is no longer necessary. If the generated header file
5851 is created by a custom command in the same target as the source
5852 file, the automatic dependency scanning process will recognize
5853 the dependency. If the generated header file is created by
5854 another target, an inter-target dependency should be created
5855 with the add_dependencies command (if one does not already exist
5856 due to linking relationships).
5857
5858
5859 OBJECT_OUTPUTS
5860 Additional outputs for a Makefile rule.
5861
5862 Additional outputs created by compilation of this source file.
5863 If any of these outputs is missing the object will be recom‐
5864 piled. This is supported only on Makefile generators and will be
5865 ignored on other generators.
5866
5867
5868 SYMBOLIC
5869 Is this just a name for a rule.
5870
5871 If SYMBOLIC (boolean) is set to true the build system will be
5872 informed that the source file is not actually created on disk
5873 but instead used as a symbolic name for a build rule.
5874
5875
5876 WRAP_EXCLUDE
5877 Exclude this source file from any code wrapping techniques.
5878
5879 Some packages can wrap source files into alternate languages to
5880 provide additional functionality. For example, C++ code can be
5881 wrapped into Java or Python etc using SWIG etc. If WRAP_EXCLUDE
5882 is set to true (1 etc) that indicates then this source file
5883 should not be wrapped.
5884
5885
5887 ADVANCED
5888 True if entry should be hidden by default in GUIs.
5889
5890 This is a boolean value indicating whether the entry is consid‐
5891 ered interesting only for advanced configuration. The
5892 mark_as_advanced() command modifies this property.
5893
5894
5895 HELPSTRING
5896 Help associated with entry in GUIs.
5897
5898 This string summarizes the purpose of an entry to help users set
5899 it through a CMake GUI.
5900
5901
5902 MODIFIED
5903 Internal management property. Do not set or get.
5904
5905 This is an internal cache entry property managed by CMake to
5906 track interactive user modification of entries. Ignore it.
5907
5908
5909 STRINGS
5910 Enumerate possible STRING entry values for GUI selection.
5911
5912 For cache entries with type STRING, this enumerates a set of
5913 values. CMake GUIs may use this to provide a selection widget
5914 instead of a generic string entry field. This is for conve‐
5915 nience only. CMake does not enforce that the value matches one
5916 of those listed.
5917
5918
5919 TYPE Widget type for entry in GUIs.
5920
5921 Cache entry values are always strings, but CMake GUIs present
5922 widgets to help users set values. The GUIs use this property as
5923 a hint to determine the widget type. Valid TYPE values are:
5924
5925
5926 BOOL = Boolean ON/OFF value.
5927 PATH = Path to a directory.
5928 FILEPATH = Path to a file.
5929 STRING = Generic string value.
5930 INTERNAL = Do not present in GUI at all.
5931 STATIC = Value managed by CMake, do not change.
5932 UNINITIALIZED = Type not yet specified.
5933
5934 Generally the TYPE of a cache entry should be set by the command
5935 which creates it (set, option, find_library, etc.).
5936
5937
5938 VALUE Value of a cache entry.
5939
5940 This property maps to the actual value of a cache entry. Set‐
5941 ting this property always sets the value without checking, so
5942 use with care.
5943
5944
5946 CMake Compatibility Listfile Commands - Obsolete commands supported by CMake for compatibility.
5947
5948
5949 This is the documentation for now obsolete listfile commands from pre‐
5950 vious CMake versions, which are still supported for compatibility rea‐
5951 sons. You should instead use the newer, faster and shinier new com‐
5952 mands. ;-)
5953
5954
5956 build_name
5957 Deprecated. Use ${CMAKE_SYSTEM} and ${CMAKE_CXX_COMPILER}
5958 instead.
5959
5960 build_name(variable)
5961
5962 Sets the specified variable to a string representing the plat‐
5963 form and compiler settings. These values are now available
5964 through the CMAKE_SYSTEM and CMAKE_CXX_COMPILER variables.
5965
5966
5967 exec_program
5968 Deprecated. Use the execute_process() command instead.
5969
5970 Run an executable program during the processing of the CMake‐
5971 List.txt file.
5972
5973
5974 exec_program(Executable [directory in which to run]
5975 [ARGS <arguments to executable>]
5976 [OUTPUT_VARIABLE <var>]
5977 [RETURN_VALUE <var>])
5978
5979 The executable is run in the optionally specified directory.
5980 The executable can include arguments if it is double quoted, but
5981 it is better to use the optional ARGS argument to specify argu‐
5982 ments to the program. This is because cmake will then be able
5983 to escape spaces in the executable path. An optional argument
5984 OUTPUT_VARIABLE specifies a variable in which to store the out‐
5985 put. To capture the return value of the execution, provide a
5986 RETURN_VALUE. If OUTPUT_VARIABLE is specified, then no output
5987 will go to the stdout/stderr of the console running cmake.
5988
5989
5990
5991 export_library_dependencies
5992 Deprecated. Use INSTALL(EXPORT) or EXPORT command.
5993
5994 This command generates an old-style library dependencies file.
5995 Projects requiring CMake 2.6 or later should not use the com‐
5996 mand. Use instead the install(EXPORT) command to help export
5997 targets from an installation tree and the export() command to
5998 export targets from a build tree.
5999
6000
6001 The old-style library dependencies file does not take into
6002 account per-configuration names of libraries or the LINK_INTER‐
6003 FACE_LIBRARIES target property.
6004
6005
6006 export_library_dependencies(<file> [APPEND])
6007
6008 Create a file named <file> that can be included into a CMake
6009 listfile with the INCLUDE command. The file will contain a num‐
6010 ber of SET commands that will set all the variables needed for
6011 library dependency information. This should be the last command
6012 in the top level CMakeLists.txt file of the project. If the
6013 APPEND option is specified, the SET commands will be appended to
6014 the given file instead of replacing it.
6015
6016
6017 install_files
6018 Deprecated. Use the install(FILES ) command instead.
6019
6020 This command has been superceded by the install command. It is
6021 provided for compatibility with older CMake code. The FILES
6022 form is directly replaced by the FILES form of the install com‐
6023 mand. The regexp form can be expressed more clearly using the
6024 GLOB form of the file command.
6025
6026
6027 install_files(<dir> extension file file ...)
6028
6029 Create rules to install the listed files with the given exten‐
6030 sion into the given directory. Only files existing in the cur‐
6031 rent source tree or its corresponding location in the binary
6032 tree may be listed. If a file specified already has an exten‐
6033 sion, that extension will be removed first. This is useful for
6034 providing lists of source files such as foo.cxx when you want
6035 the corresponding foo.h to be installed. A typical extension is
6036 '.h'.
6037
6038
6039 install_files(<dir> regexp)
6040
6041 Any files in the current source directory that match the regular
6042 expression will be installed.
6043
6044
6045 install_files(<dir> FILES file file ...)
6046
6047 Any files listed after the FILES keyword will be installed
6048 explicitly from the names given. Full paths are allowed in this
6049 form.
6050
6051
6052 The directory <dir> is relative to the installation prefix,
6053 which is stored in the variable CMAKE_INSTALL_PREFIX.
6054
6055
6056 install_programs
6057 Deprecated. Use the install(PROGRAMS ) command instead.
6058
6059 This command has been superceded by the install command. It is
6060 provided for compatibility with older CMake code. The FILES
6061 form is directly replaced by the PROGRAMS form of the INSTALL
6062 command. The regexp form can be expressed more clearly using
6063 the GLOB form of the FILE command.
6064
6065
6066 install_programs(<dir> file1 file2 [file3 ...])
6067 install_programs(<dir> FILES file1 [file2 ...])
6068
6069 Create rules to install the listed programs into the given
6070 directory. Use the FILES argument to guarantee that the file
6071 list version of the command will be used even when there is only
6072 one argument.
6073
6074
6075 install_programs(<dir> regexp)
6076
6077 In the second form any program in the current source directory
6078 that matches the regular expression will be installed.
6079
6080
6081 This command is intended to install programs that are not built
6082 by cmake, such as shell scripts. See the TARGETS form of the
6083 INSTALL command to create installation rules for targets built
6084 by cmake.
6085
6086
6087 The directory <dir> is relative to the installation prefix,
6088 which is stored in the variable CMAKE_INSTALL_PREFIX.
6089
6090
6091 install_targets
6092 Deprecated. Use the install(TARGETS ) command instead.
6093
6094 This command has been superceded by the install command. It is
6095 provided for compatibility with older CMake code.
6096
6097
6098 install_targets(<dir> [RUNTIME_DIRECTORY dir] target target)
6099
6100 Create rules to install the listed targets into the given direc‐
6101 tory. The directory <dir> is relative to the installation pre‐
6102 fix, which is stored in the variable CMAKE_INSTALL_PREFIX. If
6103 RUNTIME_DIRECTORY is specified, then on systems with special
6104 runtime files (Windows DLL), the files will be copied to that
6105 directory.
6106
6107
6108 link_libraries
6109 Deprecated. Use the target_link_libraries() command instead.
6110
6111 Link libraries to all targets added later.
6112
6113
6114 link_libraries(library1 <debug | optimized> library2 ...)
6115
6116 Specify a list of libraries to be linked into any following tar‐
6117 gets (typically added with the add_executable or add_library
6118 calls). This command is passed down to all subdirectories. The
6119 debug and optimized strings may be used to indicate that the
6120 next library listed is to be used only for that specific type of
6121 build.
6122
6123
6124 make_directory
6125 Deprecated. Use the file(MAKE_DIRECTORY ) command instead.
6126
6127 make_directory(directory)
6128
6129 Creates the specified directory. Full paths should be given.
6130 Any parent directories that do not exist will also be created.
6131 Use with care.
6132
6133
6134 remove Deprecated. Use the list(REMOVE_ITEM ) command instead.
6135
6136 remove(VAR VALUE VALUE ...)
6137
6138 Removes VALUE from the variable VAR. This is typically used to
6139 remove entries from a vector (e.g. semicolon separated list).
6140 VALUE is expanded.
6141
6142
6143 subdir_depends
6144 Deprecated. Does nothing.
6145
6146 subdir_depends(subdir dep1 dep2 ...)
6147
6148 Does not do anything. This command used to help projects order
6149 parallel builds correctly. This functionality is now automatic.
6150
6151
6152 subdirs
6153 Deprecated. Use the add_subdirectory() command instead.
6154
6155 Add a list of subdirectories to the build.
6156
6157
6158 subdirs(dir1 dir2 ...[EXCLUDE_FROM_ALL exclude_dir1 exclude_dir2 ...]
6159 [PREORDER] )
6160
6161 Add a list of subdirectories to the build. The add_subdirectory
6162 command should be used instead of subdirs although subdirs will
6163 still work. This will cause any CMakeLists.txt files in the sub
6164 directories to be processed by CMake. Any directories after the
6165 PREORDER flag are traversed first by makefile builds, the PRE‐
6166 ORDER flag has no effect on IDE projects. Any directories after
6167 the EXCLUDE_FROM_ALL marker will not be included in the top
6168 level makefile or project file. This is useful for having CMake
6169 create makefiles or projects for a set of examples in a project.
6170 You would want CMake to generate makefiles or project files for
6171 all the examples at the same time, but you would not want them
6172 to show up in the top level project or be built each time make
6173 is run from the top.
6174
6175
6176 use_mangled_mesa
6177 Copy mesa headers for use in combination with system GL.
6178
6179 use_mangled_mesa(PATH_TO_MESA OUTPUT_DIRECTORY)
6180
6181 The path to mesa includes, should contain gl_mangle.h. The mesa
6182 headers are copied to the specified output directory. This
6183 allows mangled mesa headers to override other GL headers by
6184 being added to the include directory path earlier.
6185
6186
6187 utility_source
6188 Specify the source tree of a third-party utility.
6189
6190 utility_source(cache_entry executable_name
6191 path_to_source [file1 file2 ...])
6192
6193 When a third-party utility's source is included in the distribu‐
6194 tion, this command specifies its location and name. The cache
6195 entry will not be set unless the path_to_source and all listed
6196 files exist. It is assumed that the source tree of the utility
6197 will have been built before it is needed.
6198
6199
6200 When cross compiling CMake will print a warning if a util‐
6201 ity_source() command is executed, because in many cases it is
6202 used to build an executable which is executed later on. This
6203 doesn't work when cross compiling, since the executable can run
6204 only on their target platform. So in this case the cache entry
6205 has to be adjusted manually so it points to an executable which
6206 is runnable on the build host.
6207
6208
6209 variable_requires
6210 Deprecated. Use the if() command instead.
6211
6212 Assert satisfaction of an option's required variables.
6213
6214
6215 variable_requires(TEST_VARIABLE RESULT_VARIABLE
6216 REQUIRED_VARIABLE1
6217 REQUIRED_VARIABLE2 ...)
6218
6219 The first argument (TEST_VARIABLE) is the name of the variable
6220 to be tested, if that variable is false nothing else is done. If
6221 TEST_VARIABLE is true, then the next argument (RESULT_VARIABLE)
6222 is a variable that is set to true if all the required variables
6223 are set. The rest of the arguments are variables that must be
6224 true or not set to NOTFOUND to avoid an error. If any are not
6225 true, an error is reported.
6226
6227
6228 write_file
6229 Deprecated. Use the file(WRITE ) command instead.
6230
6231 write_file(filename "message to write"... [APPEND])
6232
6233 The first argument is the file name, the rest of the arguments
6234 are messages to write. If the argument APPEND is specified, then
6235 the message will be appended.
6236
6237
6238 NOTE 1: file(WRITE ... and file(APPEND ... do exactly the same
6239 as this one but add some more functionality.
6240
6241
6242 NOTE 2: When using write_file the produced file cannot be used
6243 as an input to CMake (CONFIGURE_FILE, source file ...) because
6244 it will lead to an infinite loop. Use configure_file if you want
6245 to generate input files to CMake.
6246
6247
6249 The following modules are provided with CMake. They can be used with
6250 INCLUDE(ModuleName).
6251
6252
6253 CMake Modules - Modules coming with CMake, the Cross-Platform Makefile Generator.
6254
6255
6256 This is the documentation for the modules and scripts coming with
6257 CMake. Using these modules you can check the computer system for
6258 installed software packages, features of the compiler and the existance
6259 of headers to name just a few.
6260
6261
6262 AddFileDependencies
6263 ADD_FILE_DEPENDENCIES(source_file depend_files...)
6264
6265 Adds the given files as dependencies to source_file
6266
6267
6268
6269 BundleUtilities
6270 Functions to help assemble a standalone bundle application.
6271
6272 A collection of CMake utility functions useful for dealing with
6273 .app bundles on the Mac and bundle-like directories on any OS.
6274
6275
6276 The following functions are provided by this module:
6277
6278
6279 fixup_bundle
6280 copy_and_fixup_bundle
6281 verify_app
6282 get_bundle_main_executable
6283 get_dotapp_dir
6284 get_bundle_and_executable
6285 get_bundle_all_executables
6286 get_item_key
6287 clear_bundle_keys
6288 set_bundle_key_values
6289 get_bundle_keys
6290 copy_resolved_item_into_bundle
6291 copy_resolved_framework_into_bundle
6292 fixup_bundle_item
6293 verify_bundle_prerequisites
6294 verify_bundle_symlinks
6295
6296 Requires CMake 2.6 or greater because it uses function, break
6297 and PARENT_SCOPE. Also depends on GetPrerequisites.cmake.
6298
6299
6300 FIXUP_BUNDLE(<app> <libs> <dirs>)
6301
6302 Fix up a bundle in-place and make it standalone, such that it
6303 can be drag-n-drop copied to another machine and run on that
6304 machine as long as all of the system libraries are compatible.
6305
6306
6307 If you pass plugins to fixup_bundle as the libs parameter, you
6308 should install them or copy them into the bundle before calling
6309 fixup_bundle. The "libs" parameter is a list of libraries that
6310 must be fixed up, but that cannot be determined by otool output
6311 analysis. (i.e., plugins)
6312
6313
6314 Gather all the keys for all the executables and libraries in a
6315 bundle, and then, for each key, copy each prerequisite into the
6316 bundle. Then fix each one up according to its own list of pre‐
6317 requisites.
6318
6319
6320 Then clear all the keys and call verify_app on the final bundle
6321 to ensure that it is truly standalone.
6322
6323
6324 COPY_AND_FIXUP_BUNDLE(<src> <dst> <libs> <dirs>)
6325
6326 Makes a copy of the bundle <src> at location <dst> and then
6327 fixes up the new copied bundle in-place at <dst>...
6328
6329
6330 VERIFY_APP(<app>)
6331
6332 Verifies that an application <app> appears valid based on run‐
6333 ning analysis tools on it. Calls "message(FATAL_ERROR" if the
6334 application is not verified.
6335
6336
6337 GET_BUNDLE_MAIN_EXECUTABLE(<bundle> <result_var>)
6338
6339 The result will be the full path name of the bundle's main exe‐
6340 cutable file or an "error:" prefixed string if it could not be
6341 determined.
6342
6343
6344 GET_DOTAPP_DIR(<exe> <dotapp_dir_var>)
6345
6346 Returns the nearest parent dir whose name ends with ".app" given
6347 the full path to an executable. If there is no such parent dir,
6348 then return a dir at the same level as the executable, named
6349 with the executable's base name and ending with ".app"
6350
6351
6352 The returned directory may or may not exist.
6353
6354
6355 GET_BUNDLE_AND_EXECUTABLE(<app> <bundle_var> <executable_var> <valid_var>)
6356
6357 Takes either a ".app" directory name or the name of an exe‐
6358 cutable nested inside a ".app" directory and returns the path to
6359 the ".app" directory in <bundle_var> and the path to its main
6360 executable in <executable_var>
6361
6362
6363 GET_BUNDLE_ALL_EXECUTABLES(<bundle> <exes_var>)
6364
6365 Scans the given bundle recursively for all executable files and
6366 accumulates them into a variable.
6367
6368
6369 GET_ITEM_KEY(<item> <key_var>)
6370
6371 Given a file (item) name, generate a key that should be unique
6372 considering the set of libraries that need copying or fixing up
6373 to make a bundle standalone. This is essentially the file name
6374 including extension with "." replaced by "_"
6375
6376
6377 This key is used as a prefix for CMake variables so that we can
6378 associate a set of variables with a given item based on its key.
6379
6380
6381 CLEAR_BUNDLE_KEYS(<keys_var>)
6382
6383 Loop over the list of keys, clearing all the variables associ‐
6384 ated with each key. After the loop, clear the list of keys
6385 itself.
6386
6387
6388 Caller of get_bundle_keys should call clear_bundle_keys when
6389 done with list of keys.
6390
6391
6392 SET_BUNDLE_KEY_VALUES(<keys_var> <context> <item> <exepath> <dirs>
6393 <copyflag>)
6394
6395 Add a key to the list (if necessary) for the given item. If
6396 added, also set all the variables associated with that key.
6397
6398
6399 GET_BUNDLE_KEYS(<app> <libs> <dirs> <keys_var>)
6400
6401 Loop over all the executable and library files within the bundle
6402 (and given as extra <libs>) and accumulate a list of keys repre‐
6403 senting them. Set values associated with each key such that we
6404 can loop over all of them and copy prerequisite libs into the
6405 bundle and then do appropriate install_name_tool fixups.
6406
6407
6408 COPY_RESOLVED_ITEM_INTO_BUNDLE(<resolved_item> <resolved_embedded_item>)
6409
6410 Copy a resolved item into the bundle if necessary. Copy is not
6411 necessary if the resolved_item is "the same as" the
6412 resolved_embedded_item.
6413
6414
6415 COPY_RESOLVED_FRAMEWORK_INTO_BUNDLE(<resolved_item> <resolved_embedded_item>)
6416
6417 Copy a resolved framework into the bundle if necessary. Copy is
6418 not necessary if the resolved_item is "the same as" the
6419 resolved_embedded_item.
6420
6421
6422 By default, BU_COPY_FULL_FRAMEWORK_CONTENTS is not set. If you
6423 want full frameworks embedded in your bundles, set
6424 BU_COPY_FULL_FRAMEWORK_CONTENTS to ON before calling fixup_bun‐
6425 dle. By default, COPY_RESOLVED_FRAMEWORK_INTO_BUNDLE copies the
6426 framework dylib itself plus the framework Resources directory.
6427
6428
6429 FIXUP_BUNDLE_ITEM(<resolved_embedded_item> <exepath> <dirs>)
6430
6431 Get the direct/non-system prerequisites of the resolved embedded
6432 item. For each prerequisite, change the way it is referenced to
6433 the value of the _EMBEDDED_ITEM keyed variable for that prereq‐
6434 uisite. (Most likely changing to an "@executable_path" style
6435 reference.)
6436
6437
6438 This function requires that the resolved_embedded_item be
6439 "inside" the bundle already. In other words, if you pass plugins
6440 to fixup_bundle as the libs parameter, you should install them
6441 or copy them into the bundle before calling fixup_bundle. The
6442 "libs" parameter is a list of libraries that must be fixed up,
6443 but that cannot be determined by otool output analysis. (i.e.,
6444 plugins)
6445
6446
6447 Also, change the id of the item being fixed up to its own
6448 _EMBEDDED_ITEM value.
6449
6450
6451 Accumulate changes in a local variable and make *one* call to
6452 install_name_tool at the end of the function with all the
6453 changes at once.
6454
6455
6456 If the BU_CHMOD_BUNDLE_ITEMS variable is set then bundle items
6457 will be marked writable before install_name_tool tries to change
6458 them.
6459
6460
6461 VERIFY_BUNDLE_PREREQUISITES(<bundle> <result_var> <info_var>)
6462
6463 Verifies that the sum of all prerequisites of all files inside
6464 the bundle are contained within the bundle or are "system"
6465 libraries, presumed to exist everywhere.
6466
6467
6468 VERIFY_BUNDLE_SYMLINKS(<bundle> <result_var> <info_var>)
6469
6470 Verifies that any symlinks found in the bundle point to other
6471 files that are already also in the bundle... Anything that
6472 points to an external file causes this function to fail the ver‐
6473 ification.
6474
6475
6476 CMakeBackwardCompatibilityCXX
6477 define a bunch of backwards compatibility variables
6478
6479 CMAKE_ANSI_CXXFLAGS - flag for ansi c++
6480 CMAKE_HAS_ANSI_STRING_STREAM - has <strstream>
6481 INCLUDE(TestForANSIStreamHeaders)
6482 INCLUDE(CheckIncludeFileCXX)
6483 INCLUDE(TestForSTDNamespace)
6484 INCLUDE(TestForANSIForScope)
6485
6486
6487 CMakeDependentOption
6488 Macro to provide an option dependent on other options.
6489
6490 This macro presents an option to the user only if a set of other
6491 conditions are true. When the option is not presented a default
6492 value is used, but any value set by the user is preserved for
6493 when the option is presented again. Example invocation:
6494
6495
6496 CMAKE_DEPENDENT_OPTION(USE_FOO "Use Foo" ON
6497 "USE_BAR;NOT USE_ZOT" OFF)
6498
6499 If USE_BAR is true and USE_ZOT is false, this provides an option
6500 called USE_FOO that defaults to ON. Otherwise, it sets USE_FOO
6501 to OFF. If the status of USE_BAR or USE_ZOT ever changes, any
6502 value for the USE_FOO option is saved so that when the option is
6503 re-enabled it retains its old value.
6504
6505
6506 CMakeDetermineVSServicePack
6507 Includes a public function for assisting users in trying to
6508 determine the
6509
6510 Visual Studio service pack in use.
6511
6512
6513 Sets the passed in variable to one of the following values or an
6514 empty string if unknown.
6515
6516
6517 vc80
6518 vc80sp1
6519 vc90
6520 vc90sp1
6521
6522
6523
6524
6525 Usage: ===========================
6526
6527
6528 if(MSVC)
6529 include(CMakeDetermineVSServicePack)
6530 DetermineVSServicePack( my_service_pack )
6531
6532
6533
6534
6535 if( my_service_pack )
6536 message(STATUS "Detected: ${my_service_pack}")
6537 endif()
6538 endif()
6539
6540
6541
6542
6543 ===========================
6544
6545
6546 CMakeFindFrameworks
6547 helper module to find OSX frameworks
6548
6549
6550 CMakeForceCompiler
6551
6552
6553 This module defines macros intended for use by cross-compiling
6554 toolchain files when CMake is not able to automatically detect
6555 the compiler identification.
6556
6557
6558 Macro CMAKE_FORCE_C_COMPILER has the following signature:
6559
6560
6561 CMAKE_FORCE_C_COMPILER(<compiler> <compiler-id>)
6562
6563 It sets CMAKE_C_COMPILER to the given compiler and the cmake
6564 internal variable CMAKE_C_COMPILER_ID to the given compiler-id.
6565 It also bypasses the check for working compiler and basic com‐
6566 piler information tests.
6567
6568
6569 Macro CMAKE_FORCE_CXX_COMPILER has the following signature:
6570
6571
6572 CMAKE_FORCE_CXX_COMPILER(<compiler> <compiler-id>)
6573
6574 It sets CMAKE_CXX_COMPILER to the given compiler and the cmake
6575 internal variable CMAKE_CXX_COMPILER_ID to the given com‐
6576 piler-id. It also bypasses the check for working compiler and
6577 basic compiler information tests.
6578
6579
6580 Macro CMAKE_FORCE_Fortran_COMPILER has the following signature:
6581
6582
6583 CMAKE_FORCE_Fortran_COMPILER(<compiler> <compiler-id>)
6584
6585 It sets CMAKE_Fortran_COMPILER to the given compiler and the
6586 cmake internal variable CMAKE_Fortran_COMPILER_ID to the given
6587 compiler-id. It also bypasses the check for working compiler and
6588 basic compiler information tests.
6589
6590
6591 So a simple toolchain file could look like this:
6592
6593
6594 INCLUDE (CMakeForceCompiler)
6595 SET(CMAKE_SYSTEM_NAME Generic)
6596 CMAKE_FORCE_C_COMPILER (chc12 MetrowerksHicross)
6597 CMAKE_FORCE_CXX_COMPILER (chc12 MetrowerksHicross)
6598
6599
6600 CMakeParseArguments
6601
6602
6603 CMAKE_PARSE_ARGUMENTS(<prefix> <options> <one_value_keywords>
6604 <multi_value_keywords> args...)
6605
6606
6607 CMAKE_PARSE_ARGUMENTS() is intended to be used in macros or
6608 functions for parsing the arguments given to that macro or func‐
6609 tion. It processes the arguments and defines a set of variables
6610 which hold the values of the respective options.
6611
6612
6613 The <options> argument contains all options for the respective
6614 macro, i.e. keywords which can be used when calling the macro
6615 without any value following, like e.g. the OPTIONAL keyword of
6616 the install() command.
6617
6618
6619 The <one_value_keywords> argument contains all keywords for this
6620 macro which are followed by one value, like e.g. DESTINATION
6621 keyword of the install() command.
6622
6623
6624 The <multi_value_keywords> argument contains all keywords for
6625 this macro which can be followed by more than one value, like
6626 e.g. the TARGETS or FILES keywords of the install() command.
6627
6628
6629 When done, CMAKE_PARSE_ARGUMENTS() will have defined for each of
6630 the keywords listed in <options>, <one_value_keywords> and
6631 <multi_value_keywords> a variable composed of the given <prefix>
6632 followed by "_" and the name of the respective keyword. These
6633 variables will then hold the respective value from the argument
6634 list. For the <options> keywords this will be TRUE or FALSE.
6635
6636
6637 All remaining arguments are collected in a variable <pre‐
6638 fix>_UNPARSED_ARGUMENTS, this can be checked afterwards to see
6639 whether your macro was called with unrecognized parameters.
6640
6641
6642 As an example here a my_install() macro, which takes similar
6643 arguments as the real install() command:
6644
6645
6646 function(MY_INSTALL)
6647 set(options OPTIONAL FAST)
6648 set(oneValueArgs DESTINATION RENAME)
6649 set(multiValueArgs TARGETS CONFIGURATIONS)
6650 cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
6651 ...
6652
6653
6654
6655
6656 Assume my_install() has been called like this:
6657
6658
6659 my_install(TARGETS foo bar DESTINATION bin OPTIONAL blub)
6660
6661
6662
6663
6664 After the cmake_parse_arguments() call the macro will have set
6665 the following variables:
6666
6667
6668 MY_INSTALL_OPTIONAL = TRUE
6669 MY_INSTALL_FAST = FALSE (this option was not used when calling my_install()
6670 MY_INSTALL_DESTINATION = "bin"
6671 MY_INSTALL_RENAME = "" (was not used)
6672 MY_INSTALL_TARGETS = "foo;bar"
6673 MY_INSTALL_CONFIGURATIONS = "" (was not used)
6674 MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (no value expected after "OPTIONAL"
6675
6676
6677
6678
6679 You can the continue and process these variables.
6680
6681
6682 Keywords terminate lists of values, e.g. if directly after a
6683 one_value_keyword another recognized keyword follows, this is
6684 interpreted as the beginning of the new option. E.g.
6685 my_install(TARGETS foo DESTINATION OPTIONAL) would result in
6686 MY_INSTALL_DESTINATION set to "OPTIONAL", but MY_INSTALL_DESTI‐
6687 NATION would be empty and MY_INSTALL_OPTIONAL would be set to
6688 TRUE therefor.
6689
6690
6691 CMakePrintSystemInformation
6692 print system information
6693
6694 This file can be used for diagnostic purposes just include it in
6695 a project to see various internal CMake variables.
6696
6697
6698 CMakeVerifyManifest
6699
6700
6701 CMakeVerifyManifest.cmake
6702
6703
6704 This script is used to verify that embeded manifests and side by
6705 side manifests for a project match. To run this script, cd to a
6706 directory and run the script with cmake -P. On the command line
6707 you can pass in versions that are OK even if not found in the
6708 .manifest files. For example, cmake -Dallow_ver‐
6709 sions=8.0.50608.0 -PCmakeVerifyManifest.cmake could be used to
6710 allow an embeded manifest of 8.0.50608.0 to be used in a project
6711 even if that version was not found in the .manifest file.
6712
6713
6714 CPack foreach generator, it then
6715
6716
6717
6718
6719 The CPack module generates binary and source installers in a
6720 variety of formats using the cpack program. Inclusion of the
6721 CPack module adds two new targets to the resulting makefiles,
6722 package and package_source, which build the binary and source
6723 installers, respectively. The generated binary installers con‐
6724 tain everything installed via CMake's INSTALL command (and the
6725 deprecated INSTALL_FILES, INSTALL_PROGRAMS, and INSTALL_TARGETS
6726 commands).
6727
6728
6729 For certain kinds of binary installers (including the graphical
6730 installers on Mac OS X and Windows), CPack generates installers
6731 that allow users to select individual application components to
6732 install. The contents of each of the components are identified
6733 by the COMPONENT argument of CMake's INSTALL command. These com‐
6734 ponents can be annotated with user-friendly names and descrip‐
6735 tions, inter-component dependencies, etc., and grouped in vari‐
6736 ous ways to customize the resulting installer. See the
6737 cpack_add_* commands, described below, for more information
6738 about component-specific installations.
6739
6740
6741 The CPACK_GENERATOR variable has different meanings in different
6742 contexts. In your CMakeLists.txt file, CPACK_GENERATOR is a
6743 *list of generators*: when run with no other arguments, CPack
6744 will iterate over that list and produce one package for each
6745 generator. In a CPACK_PROJECT_CONFIG_FILE, though, CPACK_GENERA‐
6746 TOR is a *string naming a single generator*. If you need
6747 per-cpack- generator logic to control *other* cpack settings,
6748 then you need a CPACK_PROJECT_CONFIG_FILE.
6749
6750
6751 The CMake source tree itself contains a CPACK_PROJECT_CON‐
6752 FIG_FILE. See the top level file CMakeCPackOptions.cmake.in for
6753 an example.
6754
6755
6756 If set, the CPACK_PROJECT_CONFIG_FILE is included automatically
6757 on a per-generator basis. It only need contain overrides.
6758
6759
6760 Here's how it works:
6761
6762
6763 CPACK_GENERATOR list variable (unless told to use just a
6764 specific one via -G on the command line...)
6765
6766
6767
6768
6769 - sets CPACK_GENERATOR to the one currently being iterated
6770 - includes the CPACK_PROJECT_CONFIG_FILE
6771 - produces the package for that generator
6772
6773
6774
6775
6776 This is the key: For each generator listed in CPACK_GENERATOR in
6777 CPackConfig.cmake, cpack will *reset* CPACK_GENERATOR internally
6778 to *the one currently being used* and then include the
6779 CPACK_PROJECT_CONFIG_FILE.
6780
6781
6782 Before including this CPack module in your CMakeLists.txt file,
6783 there are a variety of variables that can be set to customize
6784 the resulting installers. The most commonly-used variables are:
6785
6786
6787 CPACK_PACKAGE_NAME - The name of the package (or application). If
6788 not specified, defaults to the project name.
6789
6790
6791
6792
6793 CPACK_PACKAGE_VENDOR - The name of the package vendor (e.g.,
6794 "Kitware").
6795
6796
6797
6798
6799 CPACK_PACKAGE_VERSION_MAJOR - Package major Version
6800
6801
6802
6803
6804 CPACK_PACKAGE_VERSION_MINOR - Package minor Version
6805
6806
6807
6808
6809 CPACK_PACKAGE_VERSION_PATCH - Package patch Version
6810
6811
6812
6813
6814 CPACK_PACKAGE_DESCRIPTION_FILE - A text file used to describe the
6815 project. Used, for example, the introduction screen of a
6816 CPack-generated Windows installer to describe the project.
6817
6818
6819
6820
6821 CPACK_PACKAGE_DESCRIPTION_SUMMARY - Short description of the
6822 project (only a few words).
6823
6824
6825
6826
6827 CPACK_PACKAGE_FILE_NAME - The name of the package file to generate,
6828 not including the extension. For example, cmake-2.6.1-Linux-i686.
6829
6830
6831
6832
6833 CPACK_PACKAGE_INSTALL_DIRECTORY - Installation directory on the
6834 target system, e.g., "CMake 2.5".
6835
6836
6837
6838
6839 CPACK_PROJECT_CONFIG_FILE - File included at cpack time, once per
6840 generator after setting CPACK_GENERATOR to the actual generator
6841 being used. Allows per-generator setting of CPACK_* variables at
6842 cpack time.
6843
6844
6845
6846
6847 CPACK_RESOURCE_FILE_LICENSE - License file for the project, which
6848 will typically be displayed to the user (often with an explicit
6849 "Accept" button, for graphical installers) prior to installation.
6850
6851
6852
6853
6854 CPACK_RESOURCE_FILE_README - ReadMe file for the project, which
6855 typically describes in some detail
6856
6857
6858
6859
6860 CPACK_RESOURCE_FILE_WELCOME - Welcome file for the project, which
6861 welcomes users to this installer. Typically used in the graphical
6862 installers on Windows and Mac OS X.
6863
6864
6865
6866
6867 CPACK_MONOLITHIC_INSTALL - Disables the component-based
6868 installation mechanism, so that all components are always installed.
6869
6870
6871
6872
6873 CPACK_GENERATOR - List of CPack generators to use. If not
6874 specified, CPack will create a set of options (e.g.,
6875 CPACK_BINARY_NSIS) allowing the user to enable/disable individual
6876 generators.
6877
6878
6879
6880
6881 CPACK_OUTPUT_CONFIG_FILE - The name of the CPack configuration file
6882 for binary installers that will be generated by the CPack
6883 module. Defaults to CPackConfig.cmake.
6884
6885
6886
6887
6888 CPACK_PACKAGE_EXECUTABLES - Lists each of the executables along
6889 with a text label, to be used to create Start Menu shortcuts on
6890 Windows. For example, setting this to the list ccmake;CMake will
6891 create a shortcut named "CMake" that will execute the installed
6892 executable ccmake.
6893
6894
6895
6896
6897 CPACK_STRIP_FILES - List of files to be stripped. Starting with
6898 CMake 2.6.0 CPACK_STRIP_FILES will be a boolean variable which
6899 enables stripping of all files (a list of files evaluates to TRUE
6900 in CMake, so this change is compatible).
6901
6902
6903
6904
6905 The following CPack variables are specific to source packages,
6906 and will not affect binary packages:
6907
6908
6909 CPACK_SOURCE_PACKAGE_FILE_NAME - The name of the source package,
6910 e.g., cmake-2.6.1
6911
6912
6913
6914
6915 CPACK_SOURCE_STRIP_FILES - List of files in the source tree that
6916 will be stripped. Starting with CMake 2.6.0
6917 CPACK_SOURCE_STRIP_FILES will be a boolean variable which enables
6918 stripping of all files (a list of files evaluates to TRUE in CMake,
6919 so this change is compatible).
6920
6921
6922
6923
6924 CPACK_SOURCE_GENERATOR - List of generators used for the source
6925 packages. As with CPACK_GENERATOR, if this is not specified then
6926 CPack will create a set of options (e.g., CPACK_SOURCE_ZIP)
6927 allowing users to select which packages will be generated.
6928
6929
6930
6931
6932 CPACK_SOURCE_OUTPUT_CONFIG_FILE - The name of the CPack
6933 configuration file for source installers that will be generated by
6934 the CPack module. Defaults to CPackSourceConfig.cmake.
6935
6936
6937
6938
6939 CPACK_SOURCE_IGNORE_FILES - Pattern of files in the source tree
6940 that won't be packaged when building a source package. This is a
6941 list of patterns, e.g., /CVS/;/\\.svn/;\\.swp$;\\.#;/#;.*~;cscope.*
6942
6943
6944
6945
6946 The following variables are specific to the DragNDrop installers
6947 built on Mac OS X:
6948
6949
6950 CPACK_DMG_VOLUME_NAME - The volume name of the generated disk
6951 image. Defaults to CPACK_PACKAGE_FILE_NAME.
6952
6953
6954
6955
6956 CPACK_DMG_FORMAT - The disk image format. Common values are UDRO
6957 (UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF
6958 bzip2-compressed). Refer to hdiutil(1) for more information on
6959 other available formats.
6960
6961
6962
6963
6964 CPACK_DMG_DS_STORE - Path to a custom .DS_Store file which e.g.
6965 can be used to specify the Finder window position/geometry and
6966 layout (such as hidden toolbars, placement of the icons etc.).
6967 This file has to be generated by the Finder (either manually or
6968 through OSA-script) using a normal folder from which the .DS_Store
6969 file can then be extracted.
6970
6971
6972
6973
6974 CPACK_DMG_BACKGROUND_IMAGE - Path to an image file which is to be
6975 used as the background for the Finder Window when the disk image
6976 is opened. By default no background image is set. The background
6977 image is applied after applying the custom .DS_Store file.
6978
6979
6980
6981
6982 CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to
6983 operate on disk image files on Mac OS X. This variable can be used
6984 to override the automatically detected command (or specify its
6985 location if the auto-detection fails to find it.)
6986
6987
6988
6989
6990 CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set
6991 extended attributes on files and directories on Mac OS X. This
6992 variable can be used to override the automatically detected
6993 command (or specify its location if the auto-detection fails to
6994 find it.)
6995
6996
6997
6998
6999 CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile
7000 resources on Mac OS X. This variable can be used to override the
7001 automatically detected command (or specify its location if the
7002 auto-detection fails to find it.)
7003
7004
7005
7006
7007 Installers built on Mac OS X using the Bundle generator use the
7008 aforementioned DragNDrop variables, plus the following Bun‐
7009 dle-specific parameters:
7010
7011
7012 CPACK_BUNDLE_NAME - The name of the generated bundle. This
7013 appears in the OSX finder as the bundle name. Required.
7014
7015
7016
7017
7018 CPACK_BUNDLE_PLIST - Path to an OSX plist file that will be used
7019 as the Info.plist for the generated bundle. This assumes that
7020 the caller has generated or specified their own Info.plist file.
7021 Required.
7022
7023
7024
7025
7026 CPACK_BUNDLE_ICON - Path to an OSX icns file that will be used as
7027 the icon for the generated bundle. This is the icon that appears
7028 in the OSX finder for the bundle, and in the OSX dock when the
7029 bundle is opened. Required.
7030
7031
7032
7033
7034 CPACK_BUNDLE_STARTUP_SCRIPT - Path to an executable or script that
7035 will be run whenever an end-user double-clicks the generated bundle
7036 in the OSX Finder. Optional.
7037
7038
7039
7040
7041 The following variables are specific to the graphical installers
7042 built on Windows using the Nullsoft Installation System.
7043
7044
7045 CPACK_PACKAGE_INSTALL_REGISTRY_KEY - Registry key used when
7046 installing this project.
7047
7048
7049
7050
7051 CPACK_NSIS_INSTALL_ROOT - The default installation directory presented
7052 to the end user by the NSIS installer is under this root dir. The full
7053 directory presented to the end user is:
7054 ${CPACK_NSIS_INSTALL_ROOT}/${CPACK_PACKAGE_INSTALL_DIRECTORY}
7055
7056
7057
7058
7059 CPACK_NSIS_MUI_ICON - The icon file (.ico) for the generated
7060 install program.
7061
7062
7063
7064
7065 CPACK_NSIS_MUI_UNIICON - The icon file (.ico) for the generated
7066 uninstall program.
7067
7068
7069
7070
7071 CPACK_PACKAGE_ICON - A branding image that will be displayed inside
7072 the installer.
7073
7074
7075
7076
7077 CPACK_NSIS_EXTRA_INSTALL_COMMANDS - Extra NSIS commands that will
7078 be added to the install Section.
7079
7080
7081
7082
7083 CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS - Extra NSIS commands that will
7084 be added to the uninstall Section.
7085
7086
7087
7088
7089 CPACK_NSIS_COMPRESSOR - The arguments that will be passed to the
7090 NSIS SetCompressor command.
7091
7092
7093
7094
7095 CPACK_NSIS_MODIFY_PATH - If this is set to "ON", then an extra page
7096 will appear in the installer that will allow the user to choose
7097 whether the program directory should be added to the system PATH
7098 variable.
7099
7100
7101
7102
7103 CPACK_NSIS_DISPLAY_NAME - The display name string that appears in
7104 the Windows Add/Remove Program control panel
7105
7106
7107
7108
7109 CPACK_NSIS_PACKAGE_NAME - The title displayed at the top of the
7110 installer.
7111
7112
7113
7114
7115 CPACK_NSIS_INSTALLED_ICON_NAME - A path to the executable that
7116 contains the installer icon.
7117
7118
7119
7120
7121 CPACK_NSIS_HELP_LINK - URL to a web site providing assistance in
7122 installing your application.
7123
7124
7125
7126
7127 CPACK_NSIS_URL_INFO_ABOUT - URL to a web site providing more
7128 information about your application.
7129
7130
7131
7132
7133 CPACK_NSIS_CONTACT - Contact information for questions and comments
7134 about the installation process.
7135
7136
7137
7138
7139 CPACK_NSIS_CREATE_ICONS_EXTRA - Additional NSIS commands for
7140 creating start menu shortcuts.
7141
7142
7143
7144
7145 CPACK_NSIS_DELETE_ICONS_EXTRA -Additional NSIS commands to
7146 uninstall start menu shortcuts.
7147
7148
7149
7150
7151 CPACK_NSIS_EXECUTABLES_DIRECTORY - Creating NSIS start menu links
7152 assumes that they are in 'bin' unless this variable is set.
7153 For example, you would set this to 'exec' if your executables are
7154 in an exec directory.
7155
7156
7157
7158
7159 CPACK_NSIS_MUI_FINISHPAGE_RUN - Specify an executable to add an option
7160 to run on the finish page of the NSIS installer.
7161
7162
7163
7164
7165 The following variable is specific to installers build on Mac OS
7166 X using PackageMaker:
7167
7168
7169 CPACK_OSX_PACKAGE_VERSION - The version of Mac OS X that the
7170 resulting PackageMaker archive should be compatible
7171 with. Different versions of Mac OS X support different
7172 features. For example, CPack can only build component-based
7173 installers for Mac OS X 10.4 or newer, and can only build
7174 installers that download component son-the-fly for Mac OS X 10.5
7175 or newer. If left blank, this value will be set to the minimum
7176 version of Mac OS X that supports the requested features. Set this
7177 variable to some value (e.g., 10.4) only if you want to guarantee
7178 that your installer will work on that version of Mac OS X, and
7179 don't mind missing extra features available in the installer
7180 shipping with later versions of Mac OS X.
7181
7182
7183
7184
7185 The following variables are for advanced uses of CPack:
7186
7187
7188 CPACK_CMAKE_GENERATOR - What CMake generator should be used if the
7189 project is CMake project. Defaults to the value of CMAKE_GENERATOR;
7190 few users will want to change this setting.
7191
7192
7193
7194
7195 CPACK_INSTALL_CMAKE_PROJECTS - List of four values that specify
7196 what project to install. The four values are: Build directory,
7197 Project Name, Project Component, Directory. If omitted, CPack will
7198 build an installer that installers everything.
7199
7200
7201
7202
7203 CPACK_SYSTEM_NAME - System name, defaults to the value of
7204 ${CMAKE_SYSTEM_NAME}.
7205
7206
7207
7208
7209 CPACK_PACKAGE_VERSION - Package full version, used internally. By
7210 default, this is built from CPACK_PACKAGE_VERSION_MAJOR,
7211 CPACK_PACKAGE_VERSION_MINOR, and CPACK_PACKAGE_VERSION_PATCH.
7212
7213
7214
7215
7216 CPACK_TOPLEVEL_TAG - Directory for the installed files.
7217
7218
7219
7220
7221 CPACK_INSTALL_COMMANDS - Extra commands to install components.
7222
7223
7224
7225
7226 CPACK_INSTALL_DIRECTORIES - Extra directories to install.
7227
7228
7229
7230
7231 Component-specific installation allows users to select specific
7232 sets of components to install during the install process.
7233 Installation components are identified by the COMPONENT argument
7234 of CMake's INSTALL commands, and should be further described by
7235 the following CPack commands:
7236
7237
7238 cpack_add_component - Describes a CPack installation component
7239 named by the COMPONENT argument to a CMake INSTALL command.
7240
7241
7242
7243
7244 cpack_add_component(compname
7245 [DISPLAY_NAME name]
7246 [DESCRIPTION description]
7247 [HIDDEN | REQUIRED | DISABLED ]
7248 [GROUP group]
7249 [DEPENDS comp1 comp2 ... ]
7250 [INSTALL_TYPES type1 type2 ... ]
7251 [DOWNLOADED]
7252 [ARCHIVE_FILE filename])
7253
7254
7255
7256
7257 The cmake_add_component command describes an installation
7258 component, which the user can opt to install or remove as part of
7259 the graphical installation process. compname is the name of the
7260 component, as provided to the COMPONENT argument of one or more
7261 CMake INSTALL commands.
7262
7263
7264
7265
7266 DISPLAY_NAME is the displayed name of the component, used in
7267 graphical installers to display the component name. This value can
7268 be any string.
7269
7270
7271
7272
7273 DESCRIPTION is an extended description of the component, used in
7274 graphical installers to give the user additional information about
7275 the component. Descriptions can span multiple lines using "\n" as
7276 the line separator. Typically, these descriptions should be no
7277 more than a few lines long.
7278
7279
7280
7281
7282 HIDDEN indicates that this component will be hidden in the
7283 graphical installer, so that the user cannot directly change
7284 whether it is installed or not.
7285
7286
7287
7288
7289 REQUIRED indicates that this component is required, and therefore
7290 will always be installed. It will be visible in the graphical
7291 installer, but it cannot be unselected. (Typically, required
7292 components are shown greyed out).
7293
7294
7295
7296
7297 DISABLED indicates that this component should be disabled
7298 (unselected) by default. The user is free to select this component
7299 for installation, unless it is also HIDDEN.
7300
7301
7302
7303
7304 DEPENDS lists the components on which this component depends. If
7305 this component is selected, then each of the components listed
7306 must also be selected. The dependency information is encoded
7307 within the installer itself, so that users cannot install
7308 inconsitent sets of components.
7309
7310
7311
7312
7313 GROUP names the component group of which this component is a
7314 part. If not provided, the component will be a standalone
7315 component, not part of any component group. Component groups are
7316 described with the cpack_add_component_group command, detailed
7317 below.
7318
7319
7320
7321
7322 INSTALL_TYPES lists the installation types of which this component
7323 is a part. When one of these installations types is selected, this
7324 component will automatically be selected. Installation types are
7325 described with the cpack_add_install_type command, detailed below.
7326
7327
7328
7329
7330 DOWNLOADED indicates that this component should be downloaded
7331 on-the-fly by the installer, rather than packaged in with the
7332 installer itself. For more information, see the cpack_configure_downloads
7333 command.
7334
7335
7336
7337
7338 ARCHIVE_FILE provides a name for the archive file created by CPack
7339 to be used for downloaded components. If not supplied, CPack will
7340 create a file with some name based on CPACK_PACKAGE_FILE_NAME and
7341 the name of the component. See cpack_configure_downloads for more
7342 information.
7343
7344
7345
7346
7347 cpack_add_component_group - Describes a group of related CPack
7348 installation components.
7349
7350
7351
7352
7353 cpack_add_component_group(groupname
7354 [DISPLAY_NAME name]
7355 [DESCRIPTION description]
7356 [PARENT_GROUP parent]
7357 [EXPANDED]
7358 [BOLD_TITLE])
7359
7360
7361
7362
7363 The cpack_add_component_group describes a group of installation
7364 components, which will be placed together within the listing of
7365 options. Typically, component groups allow the user to
7366 select/deselect all of the components within a single group via a
7367 single group-level option. Use component groups to reduce the
7368 complexity of installers with many options. groupname is an
7369 arbitrary name used to identify the group in the GROUP argument of
7370 the cpack_add_component command, which is used to place a
7371 component in a group. The name of the group must not conflict with
7372 the name of any component.
7373
7374
7375
7376
7377 DISPLAY_NAME is the displayed name of the component group, used in
7378 graphical installers to display the component group name. This
7379 value can be any string.
7380
7381
7382
7383
7384 DESCRIPTION is an extended description of the component group,
7385 used in graphical installers to give the user additional
7386 information about the components within that group. Descriptions
7387 can span multiple lines using "\n" as the line
7388 separator. Typically, these descriptions should be no more than a
7389 few lines long.
7390
7391
7392
7393
7394 PARENT_GROUP, if supplied, names the parent group of this group.
7395 Parent groups are used to establish a hierarchy of groups,
7396 providing an arbitrary hierarchy of groups.
7397
7398
7399
7400
7401 EXPANDED indicates that, by default, the group should show up as
7402 "expanded", so that the user immediately sees all of the
7403 components within the group. Otherwise, the group will initially
7404 show up as a single entry.
7405
7406
7407
7408
7409 BOLD_TITLE indicates that the group title should appear in bold,
7410 to call the user's attention to the group.
7411
7412
7413
7414
7415 cpack_add_install_type - Add a new installation type containing a
7416 set of predefined component selections to the graphical installer.
7417
7418 cpack_add_install_type(typename
7419 [DISPLAY_NAME name])
7420
7421
7422
7423
7424 The cpack_add_install_type command identifies a set of preselected
7425 components that represents a common use case for an
7426 application. For example, a "Developer" install type might include
7427 an application along with its header and library files, while an
7428 "End user" install type might just include the application's
7429 executable. Each component identifies itself with one or more
7430 install types via the INSTALL_TYPES argument to
7431 cpack_add_component.
7432
7433
7434
7435
7436 DISPLAY_NAME is the displayed name of the install type, which will
7437 typically show up in a drop-down box within a graphical
7438 installer. This value can be any string.
7439
7440
7441
7442
7443 cpack_configure_downloads - Configure CPack to download selected
7444 components on-the-fly as part of the installation process.
7445
7446
7447
7448
7449 cpack_configure_downloads(site
7450 [UPLOAD_DIRECTORY dirname]
7451 [ALL]
7452 [ADD_REMOVE|NO_ADD_REMOVE])
7453
7454
7455
7456
7457 The cpack_configure_downloads command configures installation-time
7458 downloads of selected components. For each downloadable component,
7459 CPack will create an archive containing the contents of that
7460 component, which should be uploaded to the given site. When the
7461 user selects that component for installation, the installer will
7462 download and extract the component in place. This feature is
7463 useful for creating small installers that only download the
7464 requested components, saving bandwidth. Additionally, the
7465 installers are small enough that they will be installed as part of
7466 the normal installation process, and the "Change" button in
7467 Windows Add/Remove Programs control panel will allow one to add or
7468 remove parts of the application after the original
7469 installation. On Windows, the downloaded-components functionality
7470 requires the ZipDLL plug-in for NSIS, available at:
7471
7472
7473
7474
7475 http://nsis.sourceforge.net/ZipDLL_plug-in
7476
7477
7478
7479
7480 On Mac OS X, installers that download components on-the-fly can
7481 only be built and installed on system using Mac OS X 10.5 or
7482 later.
7483
7484
7485
7486
7487 The site argument is a URL where the archives for downloadable
7488 components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
7489 All of the archives produced by CPack should be uploaded to that location.
7490
7491
7492
7493
7494 UPLOAD_DIRECTORY is the local directory where CPack will create the
7495 various archives for each of the components. The contents of this
7496 directory should be uploaded to a location accessible by the URL given
7497 in the site argument. If omitted, CPack will use the directory
7498 CPackUploads inside the CMake binary directory to store the generated
7499 archives.
7500
7501
7502
7503
7504 The ALL flag indicates that all components be downloaded. Otherwise, only
7505 those components explicitly marked as DOWNLOADED or that have a specified
7506 ARCHIVE_FILE will be downloaded. Additionally, the ALL option implies
7507 ADD_REMOVE (unless NO_ADD_REMOVE is specified).
7508
7509
7510
7511
7512 ADD_REMOVE indicates that CPack should install a copy of the installer
7513 that can be called from Windows' Add/Remove Programs dialog (via the
7514 "Modify" button) to change the set of installed components. NO_ADD_REMOVE
7515 turns off this behavior. This option is ignored on Mac OS X.
7516
7517
7518 CPackDeb
7519 The builtin (binary) CPack Deb generator (Unix only)
7520
7521 CPackDeb may be used to create Deb package using CPack. CPackDeb
7522 is a CPack generator thus it uses the CPACK_XXX variables used
7523 by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration.
7524 CPackDeb generator should work on any linux host but it will
7525 produce better deb package when Debian specific tools 'dpkg-xxx'
7526 are usable on the build system.
7527
7528
7529 CPackDeb has specific features which are controlled by the
7530 specifics CPACK_DEBIAN_XXX variables.You'll find a detailed
7531 usage on the wiki:
7532
7533
7534 http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#DEB_.28UNIX_only.29
7535
7536 However as a handy reminder here comes the list of specific
7537 variables:
7538
7539
7540 CPACK_DEBIAN_PACKAGE_NAME
7541
7542
7543 Mandatory : YES
7544 Default : CPACK_PACKAGE_NAME (lower case)
7545 The debian package summary
7546
7547 CPACK_DEBIAN_PACKAGE_VERSION
7548
7549
7550 Mandatory : YES
7551 Default : CPACK_PACKAGE_VERSION
7552 The debian package version
7553
7554 CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
7555
7556
7557 Mandatory : YES
7558 Default : Output of dpkg --print-architecture (or i386 if dpkg is not found)
7559 The debian package architecture
7560
7561 CPACK_DEBIAN_PACKAGE_DEPENDS
7562
7563
7564 Mandatory : NO
7565 Default : -
7566 May be used to set deb dependencies.
7567
7568 CPACK_DEBIAN_PACKAGE_MAINTAINER
7569
7570
7571 Mandatory : YES
7572 Default : CPACK_PACKAGE_CONTACT
7573 The debian package maintainer
7574
7575 CPACK_DEBIAN_PACKAGE_DESCRIPTION
7576
7577
7578 Mandatory : YES
7579 Default : CPACK_PACKAGE_DESCRIPTION_SUMMARY
7580 The debian package description
7581
7582 CPACK_DEBIAN_PACKAGE_SECTION
7583
7584
7585 Mandatory : YES
7586 Default : 'devel'
7587 The debian package section
7588
7589 CPACK_DEBIAN_PACKAGE_PRIORITY
7590
7591
7592 Mandatory : YES
7593 Default : 'optional'
7594 The debian package priority
7595
7596 CPACK_DEBIAN_PACKAGE_HOMEPAGE
7597
7598
7599 Mandatory : NO
7600 Default : -
7601 The URL of the web site for this package
7602
7603 CPACK_DEBIAN_PACKAGE_SHLIBDEPS
7604
7605
7606 Mandatory : NO
7607 Default : OFF
7608 May be set to ON in order to use dpkg-shlibdeps to generate
7609 better package dependency list.
7610 You may need set CMAKE_INSTALL_RPATH toi appropriate value
7611 if you use this feature, because if you don't dpkg-shlibdeps
7612 may fail to find your own shared libs.
7613 See http://www.cmake.org/Wiki/CMake_RPATH_handling.
7614
7615 CPACK_DEBIAN_PACKAGE_DEBUG
7616
7617
7618 Mandatory : NO
7619 Default : -
7620 May be set when invoking cpack in order to trace debug informations
7621 during CPackDeb run.
7622
7623 CPACK_DEBIAN_PACKAGE_PREDEPENDS
7624
7625
7626 Mandatory : NO
7627 Default : -
7628 see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
7629 This field is like Depends, except that it also forces dpkg to complete installation of
7630 the packages named before even starting the installation of the package which declares
7631 the pre-dependency.
7632
7633 CPACK_DEBIAN_PACKAGE_ENHANCES
7634
7635
7636 Mandatory : NO
7637 Default : -
7638 see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
7639 This field is similar to Suggests but works in the opposite direction.
7640 It is used to declare that a package can enhance the functionality of another package.
7641
7642 CPACK_DEBIAN_PACKAGE_BREAKS
7643
7644
7645 Mandatory : NO
7646 Default : -
7647 see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
7648 When one binary package declares that it breaks another, dpkg will refuse to allow the
7649 package which declares Breaks be installed unless the broken package is deconfigured first,
7650 and it will refuse to allow the broken package to be reconfigured.
7651
7652 CPACK_DEBIAN_PACKAGE_CONFLICTS
7653
7654
7655 Mandatory : NO
7656 Default : -
7657 see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
7658 When one binary package declares a conflict with another using a Conflicts field,
7659 dpkg will refuse to allow them to be installed on the system at the same time.
7660
7661 CPACK_DEBIAN_PACKAGE_PROVIDES
7662
7663
7664 Mandatory : NO
7665 Default : -
7666 see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
7667 A virtual package is one which appears in the Provides control field of another package.
7668
7669 CPACK_DEBIAN_PACKAGE_REPLACES
7670
7671
7672 Mandatory : NO
7673 Default : -
7674 see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
7675 Packages can declare in their control file that they should overwrite
7676 files in certain other packages, or completely replace other packages.
7677
7678
7679 CPackRPM
7680 The builtin (binary) CPack RPM generator (Unix only)
7681
7682 CPackRPM may be used to create RPM package using CPack. CPackRPM
7683 is a CPack generator thus it uses the CPACK_XXX variables used
7684 by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration
7685
7686
7687 However CPackRPM has specific features which are controlled by
7688 the specifics CPACK_RPM_XXX variables. You'll find a detailed
7689 usage on the wiki:
7690
7691
7692 http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#RPM_.28Unix_Only.29
7693
7694 However as a handy reminder here comes the list of specific
7695 variables:
7696
7697
7698 CPACK_RPM_PACKAGE_SUMMARY
7699 Mandatory : YES
7700 Default : CPACK_PACKAGE_DESCRIPTION_SUMMARY
7701 The RPM package summary
7702 CPACK_RPM_PACKAGE_NAME
7703 Mandatory : YES
7704 Default : CPACK_PACKAGE_NAME
7705 The RPM package name
7706 CPACK_RPM_PACKAGE_VERSION
7707 Mandatory : YES
7708 Default : CPACK_PACKAGE_VERSION
7709 The RPM package version
7710 CPACK_RPM_PACKAGE_ARCHITECTURE
7711 Mandatory : NO
7712 Default : -
7713 The RPM package architecture. This may be set to "noarch" if you
7714 know you are building a noarch package.
7715 CPACK_RPM_PACKAGE_RELEASE
7716 Mandatory : YES
7717 Default : 1
7718 The RPM package release. This is the numbering of the RPM package
7719 itself, i.e. the version of the packaging and not the version of the
7720 content (see CPACK_RPM_PACKAGE_VERSION). One may change the default
7721 value if the previous packaging was buggy and/or you want to put here
7722 a fancy Linux distro specific numbering.
7723 CPACK_RPM_PACKAGE_LICENSE
7724 Mandatory : YES
7725 Default : "unknown"
7726 The RPM package license policy.
7727 CPACK_RPM_PACKAGE_GROUP
7728 Mandatory : YES
7729 Default : "unknown"
7730 The RPM package group.
7731 CPACK_RPM_PACKAGE_VENDOR
7732 Mandatory : YES
7733 Default : CPACK_PACKAGE_VENDOR if set or "unknown"
7734 The RPM package vendor.
7735 CPACK_RPM_PACKAGE_URL
7736 Mandatory : NO
7737 Default : -
7738 The projects URL.
7739 CPACK_RPM_PACKAGE_DESCRIPTION
7740 Mandatory : YES
7741 Default : CPACK_PACKAGE_DESCRIPTION_FILE if set or "no package description available"
7742 CPACK_RPM_COMPRESSION_TYPE
7743 Mandatory : NO
7744 Default : -
7745 May be used to override RPM compression type to be used
7746 to build the RPM. For example some Linux distribution now default
7747 to lzma or xz compression whereas older cannot use such RPM.
7748 Using this one can enforce compression type to be used.
7749 Possible value are: lzma, xz, bzip2 and gzip.
7750 CPACK_RPM_PACKAGE_REQUIRES
7751 Mandatory : NO
7752 Default : -
7753 May be used to set RPM dependencies (requires).
7754 Note that you must enclose the complete requires string between quotes,
7755 for example:
7756 set(CPACK_RPM_PACKAGE_REQUIRES "python >= 2.5.0, cmake >= 2.8")
7757 CPACK_RPM_PACKAGE_SUGGESTS
7758 Mandatory : NO
7759 Default : -
7760 May be used to set weak RPM dependencies (suggests).
7761 Note that you must enclose the complete requires string between quotes.
7762 CPACK_RPM_PACKAGE_PROVIDES
7763 Mandatory : NO
7764 Default : -
7765 May be used to set RPM dependencies (provides).
7766 CPACK_RPM_PACKAGE_OBSOLETES
7767 Mandatory : NO
7768 Default : -
7769 May be used to set RPM packages that are obsoleted by this one.
7770 CPACK_RPM_PACKAGE_RELOCATABLE
7771 Mandatory : NO
7772 Default : CPACK_PACKAGE_RELOCATABLE
7773 If this variable is set to TRUE or ON CPackRPM will try
7774 to build a relocatable RPM package. A relocatable RPM may
7775 be installed using rpm --prefix or --relocate in order to
7776 install it at an alternate place see rpm(8).
7777 Note that currently this may fail if CPACK_SET_DESTDIR is set to ON.
7778 If CPACK_SET_DESTDIR is set then you will get a warning message
7779 but if there is file installed with absolute path you'll get
7780 unexpected behavior.
7781 CPACK_RPM_SPEC_INSTALL_POST
7782 Mandatory : NO
7783 Default : -
7784 May be used to set an RPM post-install command inside the spec file.
7785 For example setting it to "/bin/true" may be used to prevent
7786 rpmbuild to strip binaries.
7787 CPACK_RPM_SPEC_MORE_DEFINE
7788 Mandatory : NO
7789 Default : -
7790 May be used to add any %define lines to the generated spec file.
7791 CPACK_RPM_PACKAGE_DEBUG
7792 Mandatory : NO
7793 Default : -
7794 May be set when invoking cpack in order to trace debug information
7795 during CPack RPM run. For example you may launch CPack like this
7796 cpack -D CPACK_RPM_PACKAGE_DEBUG=1 -G RPM
7797 CPACK_RPM_USER_BINARY_SPECFILE
7798 Mandatory : NO
7799 Default : -
7800 May be set by the user in order to specify a USER binary spec file
7801 to be used by CPackRPM instead of generating the file.
7802 The specified file will be processed by CONFIGURE_FILE( @ONLY).
7803 CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE
7804 Mandatory : NO
7805 Default : -
7806 If set CPack will generate a template for USER specified binary
7807 spec file and stop with an error. For example launch CPack like this
7808 cpack -D CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE=1 -G RPM
7809 The user may then use this file in order to hand-craft is own
7810 binary spec file which may be used with CPACK_RPM_USER_BINARY_SPECFILE.
7811 CPACK_RPM_PRE_INSTALL_SCRIPT_FILE
7812 CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE
7813 Mandatory : NO
7814 Default : -
7815 May be used to embbed a pre (un)installation script in the spec file.
7816 The refered script file(s) will be read and directly
7817 put after the %pre or %preun section
7818 One may verify which scriptlet has been included with
7819 rpm -qp --scripts package.rpm
7820 CPACK_RPM_POST_INSTALL_SCRIPT_FILE
7821 CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE
7822 Mandatory : NO
7823 Default : -
7824 May be used to embbed a post (un)installation script in the spec file.
7825 The refered script file(s) will be read and directly
7826 put after the %post or %postun section
7827 One may verify which scriptlet has been included with
7828 rpm -qp --scripts package.rpm
7829 CPACK_RPM_CHANGELOG_FILE
7830 Mandatory : NO
7831 Default : -
7832 May be used to embbed a changelog in the spec file.
7833 The refered file will be read and directly put after the %changelog
7834 section.
7835
7836
7837 CTest Configure a project for testing with CTest/CDash
7838
7839 Include this module in the top CMakeLists.txt file of a project
7840 to enable testing with CTest and dashboard submissions to CDash:
7841
7842
7843 project(MyProject)
7844 ...
7845 include(CTest)
7846
7847 The module automatically creates a BUILD_TESTING option that
7848 selects whether to enable testing support (ON by default).
7849 After including the module, use code like
7850
7851
7852 if(BUILD_TESTING)
7853 # ... CMake code to create tests ...
7854 endif()
7855
7856 to creating tests when testing is enabled.
7857
7858
7859 To enable submissions to a CDash server, create a CTestCon‐
7860 fig.cmake file at the top of the project with content such as
7861
7862
7863 set(CTEST_PROJECT_NAME "MyProject")
7864 set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
7865 set(CTEST_DROP_METHOD "http")
7866 set(CTEST_DROP_SITE "my.cdash.org")
7867 set(CTEST_DROP_LOCATION "/submit.php?project=MyProject")
7868 set(CTEST_DROP_SITE_CDASH TRUE)
7869
7870 (the CDash server can provide the file to a project administra‐
7871 tor who configures 'MyProject'). Settings in the config file are
7872 shared by both this CTest module and the CTest command-line
7873 tool's dashboard script mode (ctest -S).
7874
7875
7876 While building a project for submission to CDash, CTest scans
7877 the build output for errors and warnings and reports them with
7878 surrounding context from the build log. This generic approach
7879 works for all build tools, but does not give details about the
7880 command invocation that produced a given problem. One may get
7881 more detailed reports by adding
7882
7883
7884 set(CTEST_USE_LAUNCHERS 1)
7885
7886 to the CTestConfig.cmake file. When this option is enabled, the
7887 CTest module tells CMake's Makefile generators to invoke every
7888 command in the generated build system through a CTest launcher
7889 program. (Currently the CTEST_USE_LAUNCHERS option is ignored
7890 on non-Makefile generators.) During a manual build each
7891 launcher transparently runs the command it wraps. During a
7892 CTest-driven build for submission to CDash each launcher reports
7893 detailed information when its command fails or warns. (Setting
7894 CTEST_USE_LAUNCHERS in CTestConfig.cmake is convenient, but also
7895 adds the launcher overhead even for manual builds. One may
7896 instead set it in a CTest dashboard script and add it to the
7897 CMake cache for the build tree.)
7898
7899
7900 CTestScriptMode
7901
7902
7903 This file is read by ctest in script mode (-S)
7904
7905
7906 CheckCCompilerFlag
7907 Check whether the C compiler supports a given flag.
7908
7909 CHECK_C_COMPILER_FLAG(<flag> <var>)
7910
7911
7912 <flag> - the compiler flag
7913 <var> - variable to store the result
7914
7915 This internally calls the check_c_source_compiles macro. See
7916 help for CheckCSourceCompiles for a listing of variables that
7917 can modify the build.
7918
7919
7920 CheckCSourceCompiles
7921 Check if given C source compiles and links into an executable
7922
7923 CHECK_C_SOURCE_COMPILES(<code> <var> [FAIL_REGEX <fail-regex>])
7924
7925
7926 <code> - source code to try to compile, must define 'main'
7927 <var> - variable to store whether the source code compiled
7928 <fail-regex> - fail if test output matches this regex
7929
7930 The following variables may be set before calling this macro to
7931 modify the way the check is run:
7932
7933
7934 CMAKE_REQUIRED_FLAGS = string of compile command line flags
7935 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
7936 CMAKE_REQUIRED_INCLUDES = list of include directories
7937 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
7938
7939
7940 CheckCSourceRuns
7941 Check if the given C source code compiles and runs.
7942
7943 CHECK_C_SOURCE_RUNS(<code> <var>)
7944
7945
7946 <code> - source code to try to compile
7947 <var> - variable to store the result
7948 (1 for success, empty for failure)
7949
7950 The following variables may be set before calling this macro to
7951 modify the way the check is run:
7952
7953
7954 CMAKE_REQUIRED_FLAGS = string of compile command line flags
7955 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
7956 CMAKE_REQUIRED_INCLUDES = list of include directories
7957 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
7958
7959
7960 CheckCXXCompilerFlag
7961 Check whether the CXX compiler supports a given flag.
7962
7963 CHECK_CXX_COMPILER_FLAG(<flag> <var>)
7964
7965
7966 <flag> - the compiler flag
7967 <var> - variable to store the result
7968
7969 This internally calls the check_cxx_source_compiles macro. See
7970 help for CheckCXXSourceCompiles for a listing of variables that
7971 can modify the build.
7972
7973
7974 CheckCXXSourceCompiles
7975 Check if given C++ source compiles and links into an executable
7976
7977 CHECK_CXX_SOURCE_COMPILES(<code> <var> [FAIL_REGEX
7978 <fail-regex>])
7979
7980
7981 <code> - source code to try to compile, must define 'main'
7982 <var> - variable to store whether the source code compiled
7983 <fail-regex> - fail if test output matches this regex
7984
7985 The following variables may be set before calling this macro to
7986 modify the way the check is run:
7987
7988
7989 CMAKE_REQUIRED_FLAGS = string of compile command line flags
7990 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
7991 CMAKE_REQUIRED_INCLUDES = list of include directories
7992 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
7993
7994
7995 CheckCXXSourceRuns
7996 Check if the given C++ source code compiles and runs.
7997
7998 CHECK_CXX_SOURCE_RUNS(<code> <var>)
7999
8000
8001 <code> - source code to try to compile
8002 <var> - variable to store the result
8003 (1 for success, empty for failure)
8004
8005 The following variables may be set before calling this macro to
8006 modify the way the check is run:
8007
8008
8009 CMAKE_REQUIRED_FLAGS = string of compile command line flags
8010 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
8011 CMAKE_REQUIRED_INCLUDES = list of include directories
8012 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
8013
8014
8015 CheckFortranFunctionExists
8016 macro which checks if the Fortran function exists
8017
8018 CHECK_FORTRAN_FUNCTION_EXISTS(FUNCTION VARIABLE)
8019
8020
8021 FUNCTION - the name of the Fortran function
8022 VARIABLE - variable to store the result
8023
8024
8025
8026
8027 The following variables may be set before calling this macro to
8028 modify the way the check is run:
8029
8030
8031 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
8032
8033
8034 CheckFunctionExists
8035 Check if a C function can be linked
8036
8037 CHECK_FUNCTION_EXISTS(<function> <variable>)
8038
8039
8040 Check that the <function> is provided by libraries on the system
8041 and store the result in a <variable>. This does not verify that
8042 any system header file declares the function, only that it can
8043 be found at link time (considure using CheckSymbolExists).
8044
8045
8046 The following variables may be set before calling this macro to
8047 modify the way the check is run:
8048
8049
8050 CMAKE_REQUIRED_FLAGS = string of compile command line flags
8051 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
8052 CMAKE_REQUIRED_INCLUDES = list of include directories
8053 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
8054
8055
8056 CheckIncludeFile
8057 macro which checks the include file exists.
8058
8059 CHECK_INCLUDE_FILE(INCLUDE VARIABLE)
8060
8061
8062 INCLUDE - name of include file
8063 VARIABLE - variable to return result
8064
8065
8066 an optional third argument is the CFlags to add to the compile
8067 line or you can use CMAKE_REQUIRED_FLAGS
8068
8069
8070 The following variables may be set before calling this macro to
8071 modify the way the check is run:
8072
8073
8074 CMAKE_REQUIRED_FLAGS = string of compile command line flags
8075 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
8076 CMAKE_REQUIRED_INCLUDES = list of include directories
8077
8078
8079
8080
8081
8082 CheckIncludeFileCXX
8083 Check if the include file exists.
8084
8085 CHECK_INCLUDE_FILE_CXX(INCLUDE VARIABLE)
8086
8087
8088
8089
8090 INCLUDE - name of include file
8091 VARIABLE - variable to return result
8092
8093
8094 An optional third argument is the CFlags to add to the compile
8095 line or you can use CMAKE_REQUIRED_FLAGS.
8096
8097
8098 The following variables may be set before calling this macro to
8099 modify the way the check is run:
8100
8101
8102 CMAKE_REQUIRED_FLAGS = string of compile command line flags
8103 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
8104 CMAKE_REQUIRED_INCLUDES = list of include directories
8105
8106
8107
8108
8109
8110 CheckIncludeFiles
8111 Check if the files can be included
8112
8113
8114
8115
8116 CHECK_INCLUDE_FILES(INCLUDE VARIABLE)
8117
8118
8119 INCLUDE - list of files to include
8120 VARIABLE - variable to return result
8121
8122
8123
8124
8125 The following variables may be set before calling this macro to
8126 modify the way the check is run:
8127
8128
8129 CMAKE_REQUIRED_FLAGS = string of compile command line flags
8130 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
8131 CMAKE_REQUIRED_INCLUDES = list of include directories
8132
8133
8134 CheckLibraryExists
8135 Check if the function exists.
8136
8137 CHECK_LIBRARY_EXISTS (LIBRARY FUNCTION LOCATION VARIABLE)
8138
8139
8140 LIBRARY - the name of the library you are looking for
8141 FUNCTION - the name of the function
8142 LOCATION - location where the library should be found
8143 VARIABLE - variable to store the result
8144
8145
8146
8147
8148 The following variables may be set before calling this macro to
8149 modify the way the check is run:
8150
8151
8152 CMAKE_REQUIRED_FLAGS = string of compile command line flags
8153 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
8154 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
8155
8156
8157 CheckStructHasMember
8158 Check if the given struct or class has the specified member
8159 variable
8160
8161 CHECK_STRUCT_HAS_MEMBER (STRUCT MEMBER HEADER VARIABLE)
8162
8163
8164 STRUCT - the name of the struct or class you are interested in
8165 MEMBER - the member which existence you want to check
8166 HEADER - the header(s) where the prototype should be declared
8167 VARIABLE - variable to store the result
8168
8169
8170
8171
8172 The following variables may be set before calling this macro to
8173 modify the way the check is run:
8174
8175
8176 CMAKE_REQUIRED_FLAGS = string of compile command line flags
8177 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
8178 CMAKE_REQUIRED_INCLUDES = list of include directories
8179
8180
8181
8182
8183 Example: CHECK_STRUCT_HAS_MEMBER("struct timeval" tv_sec
8184 sys/select.h HAVE_TIMEVAL_TV_SEC)
8185
8186
8187 CheckSymbolExists
8188 Check if a symbol exists as a function, variable, or macro
8189
8190 CHECK_SYMBOL_EXISTS(<symbol> <files> <variable>)
8191
8192
8193 Check that the <symbol> is available after including given
8194 header <files> and store the result in a <variable>. Specify
8195 the list of files in one argument as a semicolon-separated list.
8196
8197
8198 If the header files define the symbol as a macro it is consid‐
8199 ered available and assumed to work. If the header files declare
8200 the symbol as a function or variable then the symbol must also
8201 be available for linking. If the symbol is a type or enum value
8202 it will not be recognized (consider using CheckTypeSize or
8203 CheckCSourceCompiles).
8204
8205
8206 The following variables may be set before calling this macro to
8207 modify the way the check is run:
8208
8209
8210 CMAKE_REQUIRED_FLAGS = string of compile command line flags
8211 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
8212 CMAKE_REQUIRED_INCLUDES = list of include directories
8213 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
8214
8215
8216 CheckTypeSize
8217 Check sizeof a type
8218
8219 CHECK_TYPE_SIZE(TYPE VARIABLE [BUILTIN_TYPES_ONLY])
8220
8221 Check if the type exists and determine its size. On return,
8222 "HAVE_${VARIABLE}" holds the existence of the type, and "${VARI‐
8223 ABLE}" holds one of the following:
8224
8225
8226 <size> = type has non-zero size <size>
8227 "0" = type has arch-dependent size (see below)
8228 "" = type does not exist
8229
8230 Furthermore, the variable "${VARIABLE}_CODE" holds C preproces‐
8231 sor code to define the macro "${VARIABLE}" to the size of the
8232 type, or leave the macro undefined if the type does not exist.
8233
8234
8235 The variable "${VARIABLE}" may be "0" when CMAKE_OSX_ARCHITEC‐
8236 TURES has multiple architectures for building OS X universal
8237 binaries. This indicates that the type size varies across archi‐
8238 tectures. In this case "${VARIABLE}_CODE" contains C preproces‐
8239 sor tests mapping from each architecture macro to the corre‐
8240 sponding type size. The list of architecture macros is stored in
8241 "${VARIABLE}_KEYS", and the value for each key is stored in
8242 "${VARIABLE}-${KEY}".
8243
8244
8245 If the BUILTIN_TYPES_ONLY option is not given, the macro checks
8246 for headers <sys/types.h>, <stdint.h>, and <stddef.h>, and saves
8247 results in HAVE_SYS_TYPES_H, HAVE_STDINT_H, and HAVE_STDDEF_H.
8248 The type size check automatically includes the available head‐
8249 ers, thus supporting checks of types defined in the headers.
8250
8251
8252 The following variables may be set before calling this macro to
8253 modify the way the check is run:
8254
8255
8256 CMAKE_REQUIRED_FLAGS = string of compile command line flags
8257 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
8258 CMAKE_REQUIRED_INCLUDES = list of include directories
8259 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
8260 CMAKE_EXTRA_INCLUDE_FILES = list of extra headers to include
8261
8262
8263 CheckVariableExists
8264 Check if the variable exists.
8265
8266 CHECK_VARIABLE_EXISTS(VAR VARIABLE)
8267
8268 VAR - the name of the variable
8269 VARIABLE - variable to store the result
8270
8271
8272
8273
8274 This macro is only for C variables.
8275
8276
8277 The following variables may be set before calling this macro to
8278 modify the way the check is run:
8279
8280
8281 CMAKE_REQUIRED_FLAGS = string of compile command line flags
8282 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
8283 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
8284
8285
8286 Dart Configure a project for testing with CTest or old Dart Tcl
8287 Client
8288
8289 This file is the backwards-compatibility version of the CTest
8290 module. It supports using the old Dart 1 Tcl client for driving
8291 dashboard submissions as well as testing with CTest. This mod‐
8292 ule should be included in the CMakeLists.txt file at the top of
8293 a project. Typical usage:
8294
8295
8296 INCLUDE(Dart)
8297 IF(BUILD_TESTING)
8298 # ... testing related CMake code ...
8299 ENDIF(BUILD_TESTING)
8300
8301 The BUILD_TESTING option is created by the Dart module to deter‐
8302 mine whether testing support should be enabled. The default is
8303 ON.
8304
8305
8306 Documentation
8307 DocumentationVTK.cmake
8308
8309 This file provides support for the VTK documentation framework.
8310 It relies on several tools (Doxygen, Perl, etc).
8311
8312
8313 ExternalProject
8314 Create custom targets to build projects in external trees
8315
8316 The 'ExternalProject_Add' function creates a custom target to
8317 drive download, update/patch, configure, build, install and test
8318 steps of an external project:
8319
8320
8321 ExternalProject_Add(<name> # Name for custom target
8322 [DEPENDS projects...] # Targets on which the project depends
8323 [PREFIX dir] # Root dir for entire project
8324 [LIST_SEPARATOR sep] # Sep to be replaced by ; in cmd lines
8325 [TMP_DIR dir] # Directory to store temporary files
8326 [STAMP_DIR dir] # Directory to store step timestamps
8327 #--Download step--------------
8328 [DOWNLOAD_DIR dir] # Directory to store downloaded files
8329 [DOWNLOAD_COMMAND cmd...] # Command to download source tree
8330 [CVS_REPOSITORY cvsroot] # CVSROOT of CVS repository
8331 [CVS_MODULE mod] # Module to checkout from CVS repo
8332 [CVS_TAG tag] # Tag to checkout from CVS repo
8333 [SVN_REPOSITORY url] # URL of Subversion repo
8334 [SVN_REVISION rev] # Revision to checkout from Subversion repo
8335 [SVN_USERNAME john ] # Username for Subversion checkout and update
8336 [SVN_PASSWORD doe ] # Password for Subversion checkout and update
8337 [GIT_REPOSITORY url] # URL of git repo
8338 [GIT_TAG tag] # Git branch name, commit id or tag
8339 [URL /.../src.tgz] # Full path or URL of source
8340 [URL_MD5 md5] # MD5 checksum of file at URL
8341 [TIMEOUT seconds] # Time allowed for file download operations
8342 #--Update/Patch step----------
8343 [UPDATE_COMMAND cmd...] # Source work-tree update command
8344 [PATCH_COMMAND cmd...] # Command to patch downloaded source
8345 #--Configure step-------------
8346 [SOURCE_DIR dir] # Source dir to be used for build
8347 [CONFIGURE_COMMAND cmd...] # Build tree configuration command
8348 [CMAKE_COMMAND /.../cmake] # Specify alternative cmake executable
8349 [CMAKE_GENERATOR gen] # Specify generator for native build
8350 [CMAKE_ARGS args...] # Arguments to CMake command line
8351 [CMAKE_CACHE_ARGS args...] # Initial cache arguments, of the form -Dvar:string=on
8352 #--Build step-----------------
8353 [BINARY_DIR dir] # Specify build dir location
8354 [BUILD_COMMAND cmd...] # Command to drive the native build
8355 [BUILD_IN_SOURCE 1] # Use source dir for build dir
8356 #--Install step---------------
8357 [INSTALL_DIR dir] # Installation prefix
8358 [INSTALL_COMMAND cmd...] # Command to drive install after build
8359 #--Test step------------------
8360 [TEST_BEFORE_INSTALL 1] # Add test step executed before install step
8361 [TEST_AFTER_INSTALL 1] # Add test step executed after install step
8362 [TEST_COMMAND cmd...] # Command to drive test
8363 #--Output logging-------------
8364 [LOG_DOWNLOAD 1] # Wrap download in script to log output
8365 [LOG_UPDATE 1] # Wrap update in script to log output
8366 [LOG_CONFIGURE 1] # Wrap configure in script to log output
8367 [LOG_BUILD 1] # Wrap build in script to log output
8368 [LOG_TEST 1] # Wrap test in script to log output
8369 [LOG_INSTALL 1] # Wrap install in script to log output
8370 #--Custom targets-------------
8371 [STEP_TARGETS st1 st2 ...] # Generate custom targets for these steps
8372 )
8373
8374 The *_DIR options specify directories for the project, with
8375 default directories computed as follows. If the PREFIX option is
8376 given to ExternalProject_Add() or the EP_PREFIX directory prop‐
8377 erty is set, then an external project is built and installed
8378 under the specified prefix:
8379
8380
8381 TMP_DIR = <prefix>/tmp
8382 STAMP_DIR = <prefix>/src/<name>-stamp
8383 DOWNLOAD_DIR = <prefix>/src
8384 SOURCE_DIR = <prefix>/src/<name>
8385 BINARY_DIR = <prefix>/src/<name>-build
8386 INSTALL_DIR = <prefix>
8387
8388 Otherwise, if the EP_BASE directory property is set then compo‐
8389 nents of an external project are stored under the specified
8390 base:
8391
8392
8393 TMP_DIR = <base>/tmp/<name>
8394 STAMP_DIR = <base>/Stamp/<name>
8395 DOWNLOAD_DIR = <base>/Download/<name>
8396 SOURCE_DIR = <base>/Source/<name>
8397 BINARY_DIR = <base>/Build/<name>
8398 INSTALL_DIR = <base>/Install/<name>
8399
8400 If no PREFIX, EP_PREFIX, or EP_BASE is specified then the
8401 default is to set PREFIX to "<name>-prefix". Relative paths are
8402 interpreted with respect to the build directory corresponding to
8403 the source directory in which ExternalProject_Add is invoked.
8404
8405
8406 If SOURCE_DIR is explicitly set to an existing directory the
8407 project will be built from it. Otherwise a download step must be
8408 specified using one of the DOWNLOAD_COMMAND, CVS_*, SVN_*, or
8409 URL options. The URL option may refer locally to a directory or
8410 source tarball, or refer to a remote tarball (e.g.
8411 http://.../src.tgz).
8412
8413
8414 The 'ExternalProject_Add_Step' function adds a custom step to an
8415 external project:
8416
8417
8418 ExternalProject_Add_Step(<name> <step> # Names of project and custom step
8419 [COMMAND cmd...] # Command line invoked by this step
8420 [COMMENT "text..."] # Text printed when step executes
8421 [DEPENDEES steps...] # Steps on which this step depends
8422 [DEPENDERS steps...] # Steps that depend on this step
8423 [DEPENDS files...] # Files on which this step depends
8424 [ALWAYS 1] # No stamp file, step always runs
8425 [WORKING_DIRECTORY dir] # Working directory for command
8426 [LOG 1] # Wrap step in script to log output
8427 )
8428
8429 The command line, comment, and working directory of every stan‐
8430 dard and custom step is processed to replace tokens
8431 <SOURCE_DIR>, <BINARY_DIR>, <INSTALL_DIR>, and <TMP_DIR> with
8432 corresponding property values.
8433
8434
8435 The 'ExternalProject_Get_Property' function retrieves external
8436 project target properties:
8437
8438
8439 ExternalProject_Get_Property(<name> [prop1 [prop2 [...]]])
8440
8441 It stores property values in variables of the same name. Prop‐
8442 erty names correspond to the keyword argument names of 'Exter‐
8443 nalProject_Add'.
8444
8445
8446 The 'ExternalProject_Add_StepTargets' function generates custom
8447 targets for the steps listed:
8448
8449
8450 ExternalProject_Add_StepTargets(<name> [step1 [step2 [...]]])
8451
8452
8453
8454
8455 If STEP_TARGETS is set then ExternalProject_Add_StepTargets is
8456 automatically called at the end of matching calls to External‐
8457 Project_Add_Step. Pass STEP_TARGETS explicitly to individual
8458 ExternalProject_Add calls, or implicitly to all ExternalPro‐
8459 ject_Add calls by setting the directory property EP_STEP_TAR‐
8460 GETS.
8461
8462
8463 If STEP_TARGETS is not set, clients may still manually call
8464 ExternalProject_Add_StepTargets after calling ExternalPro‐
8465 ject_Add or ExternalProject_Add_Step.
8466
8467
8468 This functionality is provided to make it easy to drive the
8469 steps independently of each other by specifying targets on build
8470 command lines. For example, you may be submitting to a
8471 sub-project based dashboard, where you want to drive the config‐
8472 ure portion of the build, then submit to the dashboard, followed
8473 by the build portion, followed by tests. If you invoke a custom
8474 target that depends on a step halfway through the step depen‐
8475 dency chain, then all the previous steps will also run to ensure
8476 everything is up to date.
8477
8478
8479 For example, to drive configure, build and test steps indepen‐
8480 dently for each ExternalProject_Add call in your project, write
8481 the following line prior to any ExternalProject_Add calls in
8482 your CMakeLists file:
8483
8484
8485 set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure build test)
8486
8487
8488 FeatureSummary
8489 Macros for generating a summary of enabled/disabled features
8490
8491
8492
8493
8494 This module provides the macros feature_summary(), set_pack‐
8495 age_info() and add_feature_info(). For compatiblity it also
8496 still provides set_feature_info(), print_enabled_features() and
8497 print_disabled_features.
8498
8499
8500 These macros can be used to generate a summary of enabled and
8501 disabled packages and/or feature for a build tree:
8502
8503
8504 -- Enabled features:
8505 LibXml2 (required version >= 2.4) , XML processing library. , <http://xmlsoft.org>
8506 PNG , A PNG image library. , <http://www.libpng.org/pub/png/>
8507 -- Disabled features:
8508 Lua51 , The Lua scripting language. , <http://www.lua.org>
8509 Foo , Foo provides cool stuff.
8510
8511
8512
8513
8514
8515
8516
8517 FEATURE_SUMMARY( [FILENAME <file>]
8518 [APPEND]
8519 [VAR <variable_name>]
8520 [DESCRIPTION "Found packages:"]
8521 WHAT (ALL | PACKAGES_FOUND | PACKAGES_NOT_FOUND
8522 | ENABLED_FEATURES | DISABLED_FEATURES]
8523 )
8524
8525
8526
8527
8528 The FEATURE_SUMMARY() macro can be used to print information
8529 about enabled or disabled features or packages of a project. By
8530 default, only the names of the features/packages will be printed
8531 and their required version when one was specified. Use SET_FEA‐
8532 TURE_INFO() to add more useful information, like e.g. a download
8533 URL for the respective package.
8534
8535
8536 The WHAT option is the only mandatory option. Here you specify
8537 what information will be printed:
8538
8539
8540 ENABLED_FEATURES: the list of all features and packages which are enabled,
8541 excluding the QUIET packages
8542 DISABLED_FEATURES: the list of all features and packages which are disabled,
8543 excluding the QUIET packages
8544 PACKAGES_FOUND: the list of all packages which have been found
8545 PACKAGES_NOT_FOUND: the list of all packages which have not been found
8546 ALL: this will give all packages which have or have not been found
8547
8548
8549
8550
8551 If a FILENAME is given, the information is printed into this
8552 file. If APPEND is used, it is appended to this file, otherwise
8553 the file is overwritten if it already existed. If the VAR option
8554 is used, the information is "printed" into the specified vari‐
8555 able. If FILENAME is not used, the information is printed to the
8556 terminal. Using the DESCRIPTION option a description or headline
8557 can be set which will be printed above the actual content.
8558
8559
8560 Example 1, append everything to a file:
8561
8562
8563 feature_summary(WHAT ALL
8564 FILENAME ${CMAKE_BINARY_DIR}/all.log APPEND)
8565
8566
8567
8568
8569 Example 2, print the enabled features into the variable enabled‐
8570 FeaturesText:
8571
8572
8573 feature_summary(WHAT ENABLED_FEATURES
8574 DESCRIPTION "Enabled Features:"
8575 VAR enabledFeaturesText)
8576 message(STATUS "${enabledFeaturesText}")
8577
8578
8579
8580
8581
8582
8583
8584 SET_PACKAGE_INFO(<name> <description> [<url> [<comment>] ] )
8585
8586 Use this macro to set up information about the named package,
8587 which can then be displayed via FEATURE_SUMMARY(). This can be
8588 done either directly in the Find-module or in the project which
8589 uses the module after the FIND_PACKAGE() call. The features for
8590 which information can be set are added automatically by the
8591 find_package() command.
8592
8593
8594 Example for setting the info for a package:
8595
8596
8597 find_package(LibXml2)
8598 set_package_info(LibXml2 "XML processing library." "http://xmlsoft.org/")
8599
8600
8601
8602
8603
8604
8605
8606 ADD_FEATURE_INFO(<name> <enabled> <description>)
8607
8608 Use this macro to add information about a feature with the given
8609 <name>. <enabled> contains whether this feature is enabled or
8610 not, <description> is a text descibing the feature. The informa‐
8611 tion can be displayed using feature_summary() for ENABLED_FEA‐
8612 TURES and DISABLED_FEATURES respectively.
8613
8614
8615 Example for setting the info for a feature:
8616
8617
8618 option(WITH_FOO "Help for foo" ON)
8619 add_feature_info(Foo WITH_FOO "The Foo feature provides very cool stuff.")
8620
8621
8622
8623
8624
8625
8626
8627 The following macros are provided for compatibility with previ‐
8628 ous CMake versions:
8629
8630
8631 PRINT_ENABLED_FEATURES()
8632
8633 Does the same as FEATURE_SUMMARY(WHAT ENABLED_FEATURES DESCRIP‐
8634 TION "Enabled features:")
8635
8636
8637 PRINT_DISABLED_FEATURES()
8638
8639 Does the same as FEATURE_SUMMARY(WHAT DISABLED_FEATURES
8640 DESCRIPTION "Disabled features:")
8641
8642
8643 SET_FEATURE_INFO(<name> <description> [<url> [<comment>] ] )
8644
8645 Does the same as SET_PACKAGE_INFO(<name> <description> <url>
8646 <comment> )
8647
8648
8649 FindALSA
8650 Find alsa
8651
8652 Find the alsa libraries (asound)
8653
8654
8655 This module defines the following variables:
8656 ALSA_FOUND - True if ALSA_INCLUDE_DIR & ALSA_LIBRARY are found
8657 ALSA_LIBRARIES - Set when ALSA_LIBRARY is found
8658 ALSA_INCLUDE_DIRS - Set when ALSA_INCLUDE_DIR is found
8659
8660
8661
8662
8663 ALSA_INCLUDE_DIR - where to find asoundlib.h, etc.
8664 ALSA_LIBRARY - the asound library
8665
8666
8667
8668
8669
8670 FindASPELL
8671 Try to find ASPELL
8672
8673 Once done this will define
8674
8675
8676 ASPELL_FOUND - system has ASPELL
8677 ASPELL_INCLUDE_DIR - the ASPELL include directory
8678 ASPELL_LIBRARIES - The libraries needed to use ASPELL
8679 ASPELL_DEFINITIONS - Compiler switches required for using ASPELL
8680
8681
8682 FindAVIFile
8683 Locate AVIFILE library and include paths
8684
8685 AVIFILE (http://avifile.sourceforge.net/)is a set of libraries
8686 for i386 machines to use various AVI codecs. Support is limited
8687 beyond Linux. Windows provides native AVI support, and so
8688 doesn't need this library. This module defines
8689
8690
8691 AVIFILE_INCLUDE_DIR, where to find avifile.h , etc.
8692 AVIFILE_LIBRARIES, the libraries to link against
8693 AVIFILE_DEFINITIONS, definitions to use when compiling
8694 AVIFILE_FOUND, If false, don't try to use AVIFILE
8695
8696
8697 FindBISON
8698 Find bison executable and provides macros to generate custom
8699 build rules
8700
8701 The module defines the following variables:
8702
8703
8704 BISON_EXECUTABLE - path to the bison program
8705 BISON_VERSION - version of bison
8706 BISON_FOUND - true if the program was found
8707
8708
8709
8710
8711 The minimum required version of bison can be specified using the
8712 standard CMake syntax, e.g. find_package(BISON 2.1.3)
8713
8714
8715 If bison is found, the module defines the macros:
8716
8717
8718 BISON_TARGET(<Name> <YaccInput> <CodeOutput> [VERBOSE <file>]
8719 [COMPILE_FLAGS <string>])
8720
8721 which will create a custom rule to generate a parser. <YaccIn‐
8722 put> is the path to a yacc file. <CodeOutput> is the name of
8723 the source file generated by bison. A header file is also be
8724 generated, and contains the token list. If COMPILE_FLAGS
8725 option is specified, the next parameter is added in the
8726 bison command line. if VERBOSE option is specified, <file> is
8727 created and contains verbose descriptions of the grammar and
8728 parser. The macro defines a set of variables:
8729
8730
8731 BISON_${Name}_DEFINED - true is the macro ran successfully
8732 BISON_${Name}_INPUT - The input source file, an alias for <YaccInput>
8733 BISON_${Name}_OUTPUT_SOURCE - The source file generated by bison
8734 BISON_${Name}_OUTPUT_HEADER - The header file generated by bison
8735 BISON_${Name}_OUTPUTS - The sources files generated by bison
8736 BISON_${Name}_COMPILE_FLAGS - Options used in the bison command line
8737
8738
8739
8740
8741 ====================================================================
8742 Example:
8743
8744
8745
8746
8747 find_package(BISON)
8748 BISON_TARGET(MyParser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp)
8749 add_executable(Foo main.cpp ${BISON_MyParser_OUTPUTS})
8750 ====================================================================
8751
8752
8753 FindBLAS
8754 Find BLAS library
8755
8756 This module finds an installed fortran library that implements
8757 the BLAS linear-algebra interface (see
8758 http://www.netlib.org/blas/). The list of libraries searched for
8759 is taken from the autoconf macro file, acx_blas.m4 (distributed
8760 at http://ac-archive.sourceforge.net/ac-archive/acx_blas.html).
8761
8762
8763 This module sets the following variables:
8764
8765
8766 BLAS_FOUND - set to true if a library implementing the BLAS interface
8767 is found
8768 BLAS_LINKER_FLAGS - uncached list of required linker flags (excluding -l
8769 and -L).
8770 BLAS_LIBRARIES - uncached list of libraries (using full path name) to
8771 link against to use BLAS
8772 BLAS95_LIBRARIES - uncached list of libraries (using full path name)
8773 to link against to use BLAS95 interface
8774 BLAS95_FOUND - set to true if a library implementing the BLAS f95 interface
8775 is found
8776 BLA_STATIC if set on this determines what kind of linkage we do (static)
8777 BLA_VENDOR if set checks only the specified vendor, if not set checks
8778 all the possibilities
8779 BLA_F95 if set on tries to find the f95 interfaces for BLAS/LAPACK
8780
8781 ######### ## List of vendors (BLA_VENDOR) valid in this module #
8782 ATLAS, PhiPACK,CXML,DXML,SunPerf,SCSL,SGIMATH,IBMESSL,Intel10_32
8783 (intel mkl v10 32 bit),Intel10_64lp (intel mkl v10 64 bit,lp
8784 thread model, lp64 model), # Intel( older versions of mkl 32
8785 and 64 bit), ACML,Apple, NAS, Generic C/CXX should be enabled to
8786 use Intel mkl
8787
8788
8789 FindBZip2
8790 Try to find BZip2
8791
8792 Once done this will define
8793
8794
8795 BZIP2_FOUND - system has BZip2
8796 BZIP2_INCLUDE_DIR - the BZip2 include directory
8797 BZIP2_LIBRARIES - Link these to use BZip2
8798 BZIP2_NEED_PREFIX - this is set if the functions are prefixed with BZ2_
8799
8800
8801 FindBoost
8802 Try to find Boost include dirs and libraries
8803
8804 Usage of this module as follows:
8805
8806
8807 NOTE: Take note of the Boost_ADDITIONAL_VERSIONS variable below.
8808 Due to Boost naming conventions and limitations in CMake this
8809 find module is NOT future safe with respect to Boost version
8810 numbers, and may break.
8811
8812
8813 == Using Header-Only libraries from within Boost: ==
8814
8815
8816 find_package( Boost 1.36.0 )
8817 if(Boost_FOUND)
8818 include_directories(${Boost_INCLUDE_DIRS})
8819 add_executable(foo foo.cc)
8820 endif()
8821
8822
8823
8824
8825
8826
8827
8828 == Using actual libraries from within Boost: ==
8829
8830
8831 set(Boost_USE_STATIC_LIBS ON)
8832 set(Boost_USE_MULTITHREADED ON)
8833 set(Boost_USE_STATIC_RUNTIME OFF)
8834 find_package( Boost 1.36.0 COMPONENTS date_time filesystem system ... )
8835
8836
8837
8838
8839 if(Boost_FOUND)
8840 include_directories(${Boost_INCLUDE_DIRS})
8841 add_executable(foo foo.cc)
8842 target_link_libraries(foo ${Boost_LIBRARIES})
8843 endif()
8844
8845
8846
8847
8848
8849
8850
8851 The components list needs to contain actual names of boost
8852 libraries only, such as "date_time" for "libboost_date_time".
8853 If you're using parts of Boost that contain header files only
8854 (e.g. foreach) you do not need to specify COMPONENTS.
8855
8856
8857 You should provide a minimum version number that should be used.
8858 If you provide this version number and specify the REQUIRED
8859 attribute, this module will fail if it can't find the specified
8860 or a later version. If you specify a version number this is
8861 automatically put into the considered list of version numbers
8862 and thus doesn't need to be specified in the Boost_ADDI‐
8863 TIONAL_VERSIONS variable (see below).
8864
8865
8866 NOTE for Visual Studio Users:
8867
8868
8869 Automatic linking is used on MSVC & Borland compilers by default when
8870 #including things in Boost. It's important to note that setting
8871 Boost_USE_STATIC_LIBS to OFF is NOT enough to get you dynamic linking,
8872 should you need this feature. Automatic linking typically uses static
8873 libraries with a few exceptions (Boost.Python is one).
8874
8875
8876
8877
8878 Please see the section below near Boost_LIB_DIAGNOSTIC_DEFINITIONS for
8879 more details. Adding a TARGET_LINK_LIBRARIES() as shown in the example
8880 above appears to cause VS to link dynamically if Boost_USE_STATIC_LIBS
8881 gets set to OFF. It is suggested you avoid automatic linking since it
8882 will make your application less portable.
8883
8884
8885
8886
8887 =========== The mess that is Boost_ADDITIONAL_VERSIONS (sorry?)
8888 ============
8889
8890
8891 OK, so the Boost_ADDITIONAL_VERSIONS variable can be used to
8892 specify a list of boost version numbers that should be taken
8893 into account when searching for Boost. Unfortunately boost puts
8894 the version number into the actual filename for the libraries,
8895 so this variable will certainly be needed in the future when new
8896 Boost versions are released.
8897
8898
8899 Currently this module searches for the following version num‐
8900 bers: 1.33, 1.33.0, 1.33.1, 1.34, 1.34.0, 1.34.1, 1.35, 1.35.0,
8901 1.35.1, 1.36, 1.36.0, 1.36.1, 1.37, 1.37.0, 1.38, 1.38.0, 1.39,
8902 1.39.0, 1.40, 1.40.0, 1.41, 1.41.0, 1.42, 1.42.0, 1.43, 1.43.0,
8903 1.44, 1.44.0, 1.45, 1.45.0, 1.46, 1.46.0
8904
8905
8906 NOTE: If you add a new major 1.x version in Boost_ADDI‐
8907 TIONAL_VERSIONS you should add both 1.x and 1.x.0 as shown
8908 above. Official Boost include directories omit the 3rd version
8909 number from include paths if it is 0 although not all binary
8910 Boost releases do so.
8911
8912
8913 set(Boost_ADDITIONAL_VERSIONS "1.78" "1.78.0" "1.79" "1.79.0")
8914
8915
8916 ===================================== =============
8917 ========================
8918
8919
8920 Variables used by this module, they can change the default be‐
8921 haviour and need to be set before calling find_package:
8922
8923
8924 Boost_USE_MULTITHREADED Can be set to OFF to use the non-multithreaded
8925 boost libraries. If not specified, defaults
8926 to ON.
8927
8928
8929
8930
8931 Boost_USE_STATIC_LIBS Can be set to ON to force the use of the static
8932 boost libraries. Defaults to OFF.
8933
8934
8935
8936
8937 Boost_NO_SYSTEM_PATHS Set to TRUE to suppress searching in system
8938 paths (or other locations outside of BOOST_ROOT
8939 or BOOST_INCLUDEDIR). Useful when specifying
8940 BOOST_ROOT. Defaults to OFF.
8941 [Since CMake 2.8.3]
8942
8943
8944
8945
8946 Boost_USE_STATIC_RUNTIME If enabled, searches for boost libraries
8947 linked against a static C++ standard library
8948 ('s' ABI tag). This option should be set to
8949 ON or OFF because the default behavior
8950 if not specified is platform dependent
8951 for backwards compatibility.
8952 [Since CMake 2.8.3]
8953
8954
8955
8956
8957 Boost_USE_DEBUG_PYTHON If enabled, searches for boost libraries
8958 compiled against a special debug build of
8959 Python ('y' ABI tag). Defaults to OFF.
8960 [Since CMake 2.8.3]
8961
8962
8963
8964
8965 Boost_USE_STLPORT If enabled, searches for boost libraries
8966 compiled against the STLPort standard
8967 library ('p' ABI tag). Defaults to OFF.
8968 [Since CMake 2.8.3]
8969
8970
8971
8972
8973 Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS
8974 If enabled, searches for boost libraries
8975 compiled against the deprecated STLPort
8976 "native iostreams" feature ('n' ABI tag).
8977 Defaults to OFF.
8978 [Since CMake 2.8.3]
8979
8980
8981
8982
8983 Other Variables used by this module which you may want to set.
8984
8985
8986 Boost_ADDITIONAL_VERSIONS A list of version numbers to use for searching
8987 the boost include directory. Please see
8988 the documentation above regarding this
8989 annoying, but necessary variable :(
8990
8991
8992
8993
8994 Boost_DEBUG Set this to TRUE to enable debugging output
8995 of FindBoost.cmake if you are having problems.
8996 Please enable this before filing any bug
8997 reports.
8998
8999
9000
9001
9002 Boost_DETAILED_FAILURE_MSG FindBoost doesn't output detailed information
9003 about why it failed or how to fix the problem
9004 unless this is set to TRUE or the REQUIRED
9005 keyword is specified in find_package().
9006 [Since CMake 2.8.0]
9007
9008
9009
9010
9011 Boost_COMPILER Set this to the compiler suffix used by Boost
9012 (e.g. "-gcc43") if FindBoost has problems finding
9013 the proper Boost installation
9014
9015
9016
9017
9018 Boost_THREADAPI When building boost.thread, sometimes the name of the
9019 library contains an additional "pthread" or "win32"
9020 string known as the threadapi. This can happen when
9021 compiling against pthreads on Windows or win32 threads
9022 on Cygwin. You may specify this variable and if set
9023 when FindBoost searches for the Boost threading library
9024 it will first try to match the threadapi you specify.
9025 For Example: libboost_thread_win32-mgw45-mt-1_43.a
9026 might be found if you specified "win32" here before
9027 falling back on libboost_thread-mgw45-mt-1_43.a.
9028 [Since CMake 2.8.3]
9029
9030
9031
9032
9033 Boost_REALPATH Resolves symbolic links for discovered boost libraries
9034 to assist with packaging. For example, instead of
9035 Boost_SYSTEM_LIBRARY_RELEASE being resolved to
9036 "/usr/lib/libboost_system.so" it would be
9037 "/usr/lib/libboost_system.so.1.42.0" instead.
9038 This does not affect linking and should not be
9039 enabled unless the user needs this information.
9040 [Since CMake 2.8.3]
9041
9042
9043
9044
9045
9046 FindBullet
9047 Try to find the Bullet physics engine
9048
9049
9050
9051
9052 This module defines the following variables
9053
9054
9055
9056
9057 BULLET_FOUND - Was bullet found
9058 BULLET_INCLUDE_DIRS - the Bullet include directories
9059 BULLET_LIBRARIES - Link to this, by default it includes
9060 all bullet components (Dynamics,
9061 Collision, LinearMath, & SoftBody)
9062
9063
9064
9065
9066 This module accepts the following variables
9067
9068
9069
9070
9071 BULLET_ROOT - Can be set to bullet install path or Windows build path
9072
9073
9074
9075
9076
9077 FindCABLE
9078 Find CABLE
9079
9080 This module finds if CABLE is installed and determines where the
9081 include files and libraries are. This code sets the following
9082 variables:
9083
9084
9085 CABLE the path to the cable executable
9086 CABLE_TCL_LIBRARY the path to the Tcl wrapper library
9087 CABLE_INCLUDE_DIR the path to the include directory
9088
9089
9090
9091
9092 To build Tcl wrappers, you should add shared library and link it
9093 to ${CABLE_TCL_LIBRARY}. You should also add
9094 ${CABLE_INCLUDE_DIR} as an include directory.
9095
9096
9097 FindCUDA
9098 Tools for building CUDA C files: libraries and build dependen‐
9099 cies.
9100
9101 This script locates the NVIDIA CUDA C tools. It should work on
9102 linux, windows, and mac and should be reasonably up to date with
9103 CUDA C releases.
9104
9105
9106 This script makes use of the standard find_package arguments of
9107 <VERSION>, REQUIRED and QUIET. CUDA_FOUND will report if an
9108 acceptable version of CUDA was found.
9109
9110
9111 The script will prompt the user to specify CUDA_TOOLKIT_ROOT_DIR
9112 if the prefix cannot be determined by the location of nvcc in
9113 the system path and REQUIRED is specified to find_package(). To
9114 use a different installed version of the toolkit set the envi‐
9115 ronment variable CUDA_BIN_PATH before running cmake (e.g.
9116 CUDA_BIN_PATH=/usr/local/cuda1.0 instead of the default
9117 /usr/local/cuda) or set CUDA_TOOLKIT_ROOT_DIR after configuring.
9118 If you change the value of CUDA_TOOLKIT_ROOT_DIR, various compo‐
9119 nents that depend on the path will be relocated.
9120
9121
9122 It might be necessary to set CUDA_TOOLKIT_ROOT_DIR manually on
9123 certain platforms, or to use a cuda runtime not installed in the
9124 default location. In newer versions of the toolkit the cuda
9125 library is included with the graphics driver- be sure that the
9126 driver version matches what is needed by the cuda runtime ver‐
9127 sion.
9128
9129
9130 The following variables affect the behavior of the macros in the
9131 script (in alphebetical order). Note that any of these flags
9132 can be changed multiple times in the same directory before call‐
9133 ing CUDA_ADD_EXECUTABLE, CUDA_ADD_LIBRARY, CUDA_COMPILE,
9134 CUDA_COMPILE_PTX or CUDA_WRAP_SRCS.
9135
9136
9137 CUDA_64_BIT_DEVICE_CODE (Default matches host bit size)
9138 -- Set to ON to compile for 64 bit device code, OFF for 32 bit device code.
9139 Note that making this different from the host code when generating object
9140 or C files from CUDA code just won't work, because size_t gets defined by
9141 nvcc in the generated source. If you compile to PTX and then load the
9142 file yourself, you can mix bit sizes between device and host.
9143
9144
9145
9146
9147 CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE (Default ON)
9148 -- Set to ON if you want the custom build rule to be attached to the source
9149 file in Visual Studio. Turn OFF if you add the same cuda file to multiple
9150 targets.
9151
9152
9153
9154
9155 This allows the user to build the target from the CUDA file; however, bad
9156 things can happen if the CUDA source file is added to multiple targets.
9157 When performing parallel builds it is possible for the custom build
9158 command to be run more than once and in parallel causing cryptic build
9159 errors. VS runs the rules for every source file in the target, and a
9160 source can have only one rule no matter how many projects it is added to.
9161 When the rule is run from multiple targets race conditions can occur on
9162 the generated file. Eventually everything will get built, but if the user
9163 is unaware of this behavior, there may be confusion. It would be nice if
9164 this script could detect the reuse of source files across multiple targets
9165 and turn the option off for the user, but no good solution could be found.
9166
9167
9168
9169
9170 CUDA_BUILD_CUBIN (Default OFF)
9171 -- Set to ON to enable and extra compilation pass with the -cubin option in
9172 Device mode. The output is parsed and register, shared memory usage is
9173 printed during build.
9174
9175
9176
9177
9178 CUDA_BUILD_EMULATION (Default OFF for device mode)
9179 -- Set to ON for Emulation mode. -D_DEVICEEMU is defined for CUDA C files
9180 when CUDA_BUILD_EMULATION is TRUE.
9181
9182
9183
9184
9185 CUDA_GENERATED_OUTPUT_DIR (Default CMAKE_CURRENT_BINARY_DIR)
9186 -- Set to the path you wish to have the generated files placed. If it is
9187 blank output files will be placed in CMAKE_CURRENT_BINARY_DIR.
9188 Intermediate files will always be placed in
9189 CMAKE_CURRENT_BINARY_DIR/CMakeFiles.
9190
9191
9192
9193
9194 CUDA_HOST_COMPILATION_CPP (Default ON)
9195 -- Set to OFF for C compilation of host code.
9196
9197
9198
9199
9200 CUDA_NVCC_FLAGS
9201 CUDA_NVCC_FLAGS_<CONFIG>
9202 -- Additional NVCC command line arguments. NOTE: multiple arguments must be
9203 semi-colon delimited (e.g. --compiler-options;-Wall)
9204
9205
9206
9207
9208 CUDA_PROPAGATE_HOST_FLAGS (Default ON)
9209 -- Set to ON to propagate CMAKE_{C,CXX}_FLAGS and their configuration
9210 dependent counterparts (e.g. CMAKE_C_FLAGS_DEBUG) automatically to the
9211 host compiler through nvcc's -Xcompiler flag. This helps make the
9212 generated host code match the rest of the system better. Sometimes
9213 certain flags give nvcc problems, and this will help you turn the flag
9214 propagation off. This does not affect the flags supplied directly to nvcc
9215 via CUDA_NVCC_FLAGS or through the OPTION flags specified through
9216 CUDA_ADD_LIBRARY, CUDA_ADD_EXECUTABLE, or CUDA_WRAP_SRCS. Flags used for
9217 shared library compilation are not affected by this flag.
9218
9219
9220
9221
9222 CUDA_VERBOSE_BUILD (Default OFF)
9223 -- Set to ON to see all the commands used when building the CUDA file. When
9224 using a Makefile generator the value defaults to VERBOSE (run make
9225 VERBOSE=1 to see output), although setting CUDA_VERBOSE_BUILD to ON will
9226 always print the output.
9227
9228
9229
9230
9231 The script creates the following macros (in alphebetical order):
9232
9233
9234 CUDA_ADD_CUFFT_TO_TARGET( cuda_target )
9235 -- Adds the cufft library to the target (can be any target). Handles whether
9236 you are in emulation mode or not.
9237
9238
9239
9240
9241 CUDA_ADD_CUBLAS_TO_TARGET( cuda_target )
9242 -- Adds the cublas library to the target (can be any target). Handles
9243 whether you are in emulation mode or not.
9244
9245
9246
9247
9248 CUDA_ADD_EXECUTABLE( cuda_target file0 file1 ...
9249 [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL] [OPTIONS ...] )
9250 -- Creates an executable "cuda_target" which is made up of the files
9251 specified. All of the non CUDA C files are compiled using the standard
9252 build rules specified by CMAKE and the cuda files are compiled to object
9253 files using nvcc and the host compiler. In addition CUDA_INCLUDE_DIRS is
9254 added automatically to include_directories(). Some standard CMake target
9255 calls can be used on the target after calling this macro
9256 (e.g. set_target_properties and target_link_libraries), but setting
9257 properties that adjust compilation flags will not affect code compiled by
9258 nvcc. Such flags should be modified before calling CUDA_ADD_EXECUTABLE,
9259 CUDA_ADD_LIBRARY or CUDA_WRAP_SRCS.
9260
9261
9262
9263
9264 CUDA_ADD_LIBRARY( cuda_target file0 file1 ...
9265 [STATIC | SHARED | MODULE] [EXCLUDE_FROM_ALL] [OPTIONS ...] )
9266 -- Same as CUDA_ADD_EXECUTABLE except that a library is created.
9267
9268
9269
9270
9271 CUDA_BUILD_CLEAN_TARGET()
9272 -- Creates a convience target that deletes all the dependency files
9273 generated. You should make clean after running this target to ensure the
9274 dependency files get regenerated.
9275
9276
9277
9278
9279 CUDA_COMPILE( generated_files file0 file1 ... [STATIC | SHARED | MODULE]
9280 [OPTIONS ...] )
9281 -- Returns a list of generated files from the input source files to be used
9282 with ADD_LIBRARY or ADD_EXECUTABLE.
9283
9284
9285
9286
9287 CUDA_COMPILE_PTX( generated_files file0 file1 ... [OPTIONS ...] )
9288 -- Returns a list of PTX files generated from the input source files.
9289
9290
9291
9292
9293 CUDA_INCLUDE_DIRECTORIES( path0 path1 ... )
9294 -- Sets the directories that should be passed to nvcc
9295 (e.g. nvcc -Ipath0 -Ipath1 ... ). These paths usually contain other .cu
9296 files.
9297
9298
9299
9300
9301 CUDA_WRAP_SRCS ( cuda_target format generated_files file0 file1 ...
9302 [STATIC | SHARED | MODULE] [OPTIONS ...] )
9303 -- This is where all the magic happens. CUDA_ADD_EXECUTABLE,
9304 CUDA_ADD_LIBRARY, CUDA_COMPILE, and CUDA_COMPILE_PTX all call this
9305 function under the hood.
9306
9307
9308
9309
9310 Given the list of files (file0 file1 ... fileN) this macro generates
9311 custom commands that generate either PTX or linkable objects (use "PTX" or
9312 "OBJ" for the format argument to switch). Files that don't end with .cu
9313 or have the HEADER_FILE_ONLY property are ignored.
9314
9315
9316
9317
9318 The arguments passed in after OPTIONS are extra command line options to
9319 give to nvcc. You can also specify per configuration options by
9320 specifying the name of the configuration followed by the options. General
9321 options must preceed configuration specific options. Not all
9322 configurations need to be specified, only the ones provided will be used.
9323
9324
9325
9326
9327 OPTIONS -DFLAG=2 "-DFLAG_OTHER=space in flag"
9328 DEBUG -g
9329 RELEASE --use_fast_math
9330 RELWITHDEBINFO --use_fast_math;-g
9331 MINSIZEREL --use_fast_math
9332
9333
9334
9335
9336 For certain configurations (namely VS generating object files with
9337 CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE set to ON), no generated file will
9338 be produced for the given cuda file. This is because when you add the
9339 cuda file to Visual Studio it knows that this file produces an object file
9340 and will link in the resulting object file automatically.
9341
9342
9343
9344
9345 This script will also generate a separate cmake script that is used at
9346 build time to invoke nvcc. This is for several reasons.
9347
9348
9349
9350
9351 1. nvcc can return negative numbers as return values which confuses
9352 Visual Studio into thinking that the command succeeded. The script now
9353 checks the error codes and produces errors when there was a problem.
9354
9355
9356
9357
9358 2. nvcc has been known to not delete incomplete results when it
9359 encounters problems. This confuses build systems into thinking the
9360 target was generated when in fact an unusable file exists. The script
9361 now deletes the output files if there was an error.
9362
9363
9364
9365
9366 3. By putting all the options that affect the build into a file and then
9367 make the build rule dependent on the file, the output files will be
9368 regenerated when the options change.
9369
9370
9371
9372
9373 This script also looks at optional arguments STATIC, SHARED, or MODULE to
9374 determine when to target the object compilation for a shared library.
9375 BUILD_SHARED_LIBS is ignored in CUDA_WRAP_SRCS, but it is respected in
9376 CUDA_ADD_LIBRARY. On some systems special flags are added for building
9377 objects intended for shared libraries. A preprocessor macro,
9378 <target_name>_EXPORTS is defined when a shared library compilation is
9379 detected.
9380
9381
9382
9383
9384 Flags passed into add_definitions with -D or /D are passed along to nvcc.
9385
9386
9387
9388
9389 The script defines the following variables:
9390
9391
9392 CUDA_VERSION_MAJOR -- The major version of cuda as reported by nvcc.
9393 CUDA_VERSION_MINOR -- The minor version.
9394 CUDA_VERSION
9395 CUDA_VERSION_STRING -- CUDA_VERSION_MAJOR.CUDA_VERSION_MINOR
9396
9397
9398
9399
9400 CUDA_TOOLKIT_ROOT_DIR -- Path to the CUDA Toolkit (defined if not set).
9401 CUDA_SDK_ROOT_DIR -- Path to the CUDA SDK. Use this to find files in the
9402 SDK. This script will not directly support finding
9403 specific libraries or headers, as that isn't
9404 supported by NVIDIA. If you want to change
9405 libraries when the path changes see the
9406 FindCUDA.cmake script for an example of how to clear
9407 these variables. There are also examples of how to
9408 use the CUDA_SDK_ROOT_DIR to locate headers or
9409 libraries, if you so choose (at your own risk).
9410 CUDA_INCLUDE_DIRS -- Include directory for cuda headers. Added automatically
9411 for CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY.
9412 CUDA_LIBRARIES -- Cuda RT library.
9413 CUDA_CUFFT_LIBRARIES -- Device or emulation library for the Cuda FFT
9414 implementation (alternative to:
9415 CUDA_ADD_CUFFT_TO_TARGET macro)
9416 CUDA_CUBLAS_LIBRARIES -- Device or emulation library for the Cuda BLAS
9417 implementation (alterative to:
9418 CUDA_ADD_CUBLAS_TO_TARGET macro).
9419
9420
9421
9422
9423
9424
9425
9426 James Bigler, NVIDIA Corp (nvidia.com - jbigler)
9427 Abe Stephens, SCI Institute -- http://www.sci.utah.edu/~abe/FindCuda.html
9428
9429
9430
9431
9432 Copyright (c) 2008 - 2009 NVIDIA Corporation. All rights reserved.
9433
9434
9435
9436
9437 Copyright (c) 2007-2009
9438 Scientific Computing and Imaging Institute, University of Utah
9439
9440
9441
9442
9443 This code is licensed under the MIT License. See the FindCUDA.cmake script
9444 for the text of the license.
9445
9446
9447 FindCURL
9448 Find curl
9449
9450 Find the native CURL headers and libraries.
9451
9452
9453 CURL_INCLUDE_DIRS - where to find curl/curl.h, etc.
9454 CURL_LIBRARIES - List of libraries when using curl.
9455 CURL_FOUND - True if curl found.
9456
9457
9458 FindCVS
9459
9460
9461 The module defines the following variables:
9462
9463
9464 CVS_EXECUTABLE - path to cvs command line client
9465 CVS_FOUND - true if the command line client was found
9466
9467 Example usage:
9468
9469
9470 find_package(CVS)
9471 if(CVS_FOUND)
9472 message("CVS found: ${CVS_EXECUTABLE}")
9473 endif(CVS_FOUND)
9474
9475
9476 FindCoin3D
9477 Find Coin3D (Open Inventor)
9478
9479 Coin3D is an implementation of the Open Inventor API. It pro‐
9480 vides data structures and algorithms for 3D visualization
9481 http://www.coin3d.org/
9482
9483
9484 This module defines the following variables
9485
9486
9487 COIN3D_FOUND - system has Coin3D - Open Inventor
9488 COIN3D_INCLUDE_DIRS - where the Inventor include directory can be found
9489 COIN3D_LIBRARIES - Link to this to use Coin3D
9490
9491
9492
9493
9494
9495 FindCups
9496 Try to find the Cups printing system
9497
9498 Once done this will define
9499
9500
9501 CUPS_FOUND - system has Cups
9502 CUPS_INCLUDE_DIR - the Cups include directory
9503 CUPS_LIBRARIES - Libraries needed to use Cups
9504 Set CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE to TRUE if you need a version which
9505 features this function (i.e. at least 1.1.19)
9506
9507
9508 FindCurses
9509 Find the curses include file and library
9510
9511
9512
9513
9514 CURSES_FOUND - system has Curses
9515 CURSES_INCLUDE_DIR - the Curses include directory
9516 CURSES_LIBRARIES - The libraries needed to use Curses
9517 CURSES_HAVE_CURSES_H - true if curses.h is available
9518 CURSES_HAVE_NCURSES_H - true if ncurses.h is available
9519 CURSES_HAVE_NCURSES_NCURSES_H - true if ncurses/ncurses.h is available
9520 CURSES_HAVE_NCURSES_CURSES_H - true if ncurses/curses.h is available
9521 CURSES_LIBRARY - set for backwards compatibility with 2.4 CMake
9522
9523
9524
9525
9526 Set CURSES_NEED_NCURSES to TRUE before the FIND_PACKAGE() com‐
9527 mand if NCurses functionality is required.
9528
9529
9530 FindCxxTest
9531 Find CxxTest
9532
9533 Find the CxxTest suite and declare a helper macro for creating
9534 unit tests and integrating them with CTest. For more details on
9535 CxxTest see http://cxxtest.tigris.org
9536
9537
9538 INPUT Variables
9539
9540
9541 CXXTEST_USE_PYTHON [deprecated since 1.3]
9542 Only used in the case both Python & Perl
9543 are detected on the system to control
9544 which CxxTest code generator is used.
9545
9546
9547
9548
9549 NOTE: In older versions of this Find Module,
9550 this variable controlled if the Python test
9551 generator was used instead of the Perl one,
9552 regardless of which scripting language the
9553 user had installed.
9554
9555
9556
9557
9558 CXXTEST_TESTGEN_ARGS (since CMake 2.8.3)
9559 Specify a list of options to pass to the CxxTest code
9560 generator. If not defined, --error-printer is
9561 passed.
9562
9563
9564
9565
9566 OUTPUT Variables
9567
9568
9569 CXXTEST_FOUND
9570 True if the CxxTest framework was found
9571 CXXTEST_INCLUDE_DIRS
9572 Where to find the CxxTest include directory
9573 CXXTEST_PERL_TESTGEN_EXECUTABLE
9574 The perl-based test generator
9575 CXXTEST_PYTHON_TESTGEN_EXECUTABLE
9576 The python-based test generator
9577 CXXTEST_TESTGEN_EXECUTABLE (since CMake 2.8.3)
9578 The test generator that is actually used (chosen using user preferences
9579 and interpreters found in the system)
9580 CXXTEST_TESTGEN_INTERPRETER (since CMake 2.8.3)
9581 The full path to the Perl or Python executable on the system
9582
9583
9584
9585
9586 MACROS for optional use by CMake users:
9587
9588
9589 CXXTEST_ADD_TEST(<test_name> <gen_source_file> <input_files_to_testgen...>)
9590 Creates a CxxTest runner and adds it to the CTest testing suite
9591 Parameters:
9592 test_name The name of the test
9593 gen_source_file The generated source filename to be
9594 generated by CxxTest
9595 input_files_to_testgen The list of header files containing the
9596 CxxTest::TestSuite's to be included in
9597 this runner
9598
9599 #==============
9600 Example Usage:
9601
9602
9603
9604
9605 find_package(CxxTest)
9606 if(CXXTEST_FOUND)
9607 include_directories(${CXXTEST_INCLUDE_DIR})
9608 enable_testing()
9609
9610
9611
9612
9613 CXXTEST_ADD_TEST(unittest_foo foo_test.cc
9614 ${CMAKE_CURRENT_SOURCE_DIR}/foo_test.h)
9615 target_link_libraries(unittest_foo foo) # as needed
9616 endif()
9617
9618
9619
9620
9621 This will (if CxxTest is found):
9622 1. Invoke the testgen executable to autogenerate foo_test.cc in the
9623 binary tree from "foo_test.h" in the current source directory.
9624 2. Create an executable and test called unittest_foo.
9625
9626 #=============
9627 Example foo_test.h:
9628
9629
9630
9631
9632 #include <cxxtest/TestSuite.h>
9633
9634 class MyTestSuite : public CxxTest::TestSuite
9635 {
9636 public:
9637 void testAddition( void )
9638 {
9639 TS_ASSERT( 1 + 1 > 1 );
9640 TS_ASSERT_EQUALS( 1 + 1, 2 );
9641 }
9642 };
9643
9644
9645
9646
9647
9648 FindCygwin
9649 this module looks for Cygwin
9650
9651
9652
9653
9654
9655 FindDCMTK
9656 find DCMTK libraries and applications
9657
9658
9659
9660
9661
9662 FindDart
9663 Find DART
9664
9665 This module looks for the dart testing software and sets
9666 DART_ROOT to point to where it found it.
9667
9668
9669
9670 FindDevIL
9671
9672
9673 This module locates the developer's image library. http://ope‐
9674 nil.sourceforge.net/
9675
9676
9677 This module sets: IL_LIBRARIES the name of the IL library. These
9678 include the full path to the core DevIL library. This one has to
9679 be linked into the application. ILU_LIBRARIES the name of the
9680 ILU library. Again, the full path. This library is for filters
9681 and effects, not actual loading. It doesn't have to be linked if
9682 the functionality it provides is not used. ILUT_LIBRARIES the
9683 name of the ILUT library. Full path. This part of the library
9684 interfaces with OpenGL. It is not strictly needed in applica‐
9685 tions. IL_INCLUDE_DIR where to find the il.h, ilu.h and ilut.h
9686 files. IL_FOUND this is set to TRUE if all the above variables
9687 were set. This will be set to false if ILU or ILUT are not
9688 found, even if they are not needed. In most systems, if one
9689 library is found all the others are as well. That's the way the
9690 DevIL developers release it.
9691
9692
9693 FindDoxygen
9694 This module looks for Doxygen and the path to Graphviz's dot
9695
9696 Doxygen is a documentation generation tool. Please see
9697 http://www.doxygen.org
9698
9699
9700 This module accepts the following optional variables:
9701
9702
9703 DOXYGEN_SKIP_DOT = If true this module will skip trying to find Dot
9704 (an optional component often used by Doxygen)
9705
9706
9707
9708
9709 This modules defines the following variables:
9710
9711
9712 DOXYGEN_EXECUTABLE = The path to the doxygen command.
9713 DOXYGEN_FOUND = Was Doxygen found or not?
9714
9715
9716
9717
9718 DOXYGEN_DOT_EXECUTABLE = The path to the dot program used by doxygen.
9719 DOXYGEN_DOT_FOUND = Was Dot found or not?
9720 DOXYGEN_DOT_PATH = The path to dot not including the executable
9721
9722
9723
9724
9725
9726
9727
9728
9729 FindEXPAT
9730 Find expat
9731
9732 Find the native EXPAT headers and libraries.
9733
9734
9735 EXPAT_INCLUDE_DIRS - where to find expat.h, etc.
9736 EXPAT_LIBRARIES - List of libraries when using expat.
9737 EXPAT_FOUND - True if expat found.
9738
9739
9740 FindFLEX
9741 Find flex executable and provides a macro to generate custom
9742 build rules
9743
9744
9745
9746
9747 The module defines the following variables:
9748
9749
9750 FLEX_FOUND - true is flex executable is found
9751 FLEX_EXECUTABLE - the path to the flex executable
9752 FLEX_VERSION - the version of flex
9753 FLEX_LIBRARIES - The flex libraries
9754
9755
9756
9757
9758 The minimum required version of flex can be specified using the
9759 standard syntax, e.g. FIND_PACKAGE(FLEX 2.5.13)
9760
9761
9762
9763
9764
9765 If flex is found on the system, the module provides the macro:
9766
9767
9768 FLEX_TARGET(Name FlexInput FlexOutput [COMPILE_FLAGS <string>])
9769
9770 which creates a custom command to generate the <FlexOutput>
9771 file from the <FlexInput> file. If COMPILE_FLAGS option is
9772 specified, the next parameter is added to the flex command
9773 line. Name is an alias used to get details of this custom
9774 command. Indeed the macro defines the following variables:
9775
9776
9777 FLEX_${Name}_DEFINED - true is the macro ran successfully
9778 FLEX_${Name}_OUTPUTS - the source file generated by the custom rule, an
9779 alias for FlexOutput
9780 FLEX_${Name}_INPUT - the flex source file, an alias for ${FlexInput}
9781
9782
9783
9784
9785 Flex scanners oftenly use tokens defined by Bison: the code
9786 generated by Flex depends of the header generated by Bison.
9787 This module also defines a macro:
9788
9789
9790 ADD_FLEX_BISON_DEPENDENCY(FlexTarget BisonTarget)
9791
9792 which adds the required dependency between a scanner and a
9793 parser where <FlexTarget> and <BisonTarget> are the first
9794 parameters of respectively FLEX_TARGET and BISON_TARGET macros.
9795
9796
9797 ====================================================================
9798 Example:
9799
9800
9801
9802
9803 find_package(BISON)
9804 find_package(FLEX)
9805
9806
9807
9808
9809 BISON_TARGET(MyParser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp)
9810 FLEX_TARGET(MyScanner lexer.l ${CMAKE_CURRENT_BINARY_DIR}/lexer.cpp)
9811 ADD_FLEX_BISON_DEPENDENCY(MyScanner MyParser)
9812
9813
9814
9815
9816 include_directories(${CMAKE_CURRENT_BINARY_DIR})
9817 add_executable(Foo
9818 Foo.cc
9819 ${BISON_MyParser_OUTPUTS}
9820 ${FLEX_MyScanner_OUTPUTS}
9821 )
9822 ====================================================================
9823
9824
9825 FindFLTK
9826 Find the native FLTK includes and library
9827
9828
9829
9830
9831 By default FindFLTK.cmake will search for all of the FLTK compo‐
9832 nents and add them to the FLTK_LIBRARIES variable.
9833
9834
9835 You can limit the components which get placed in FLTK_LIBRARIES by
9836 defining one or more of the following three options:
9837
9838
9839
9840
9841 FLTK_SKIP_OPENGL, set to true to disable searching for opengl and
9842 the FLTK GL library
9843 FLTK_SKIP_FORMS, set to true to disable searching for fltk_forms
9844 FLTK_SKIP_IMAGES, set to true to disable searching for fltk_images
9845
9846
9847
9848
9849 FLTK_SKIP_FLUID, set to true if the fluid binary need not be present
9850 at build time
9851
9852
9853
9854
9855 The following variables will be defined:
9856
9857
9858 FLTK_FOUND, True if all components not skipped were found
9859 FLTK_INCLUDE_DIR, where to find include files
9860 FLTK_LIBRARIES, list of fltk libraries you should link against
9861 FLTK_FLUID_EXECUTABLE, where to find the Fluid tool
9862 FLTK_WRAP_UI, This enables the FLTK_WRAP_UI command
9863
9864
9865
9866
9867 The following cache variables are assigned but should not be
9868 used. See the FLTK_LIBRARIES variable instead.
9869
9870
9871 FLTK_BASE_LIBRARY = the full path to fltk.lib
9872 FLTK_GL_LIBRARY = the full path to fltk_gl.lib
9873 FLTK_FORMS_LIBRARY = the full path to fltk_forms.lib
9874 FLTK_IMAGES_LIBRARY = the full path to fltk_images.lib
9875
9876
9877 FindFLTK2
9878 Find the native FLTK2 includes and library
9879
9880 The following settings are defined
9881
9882
9883 FLTK2_FLUID_EXECUTABLE, where to find the Fluid tool
9884 FLTK2_WRAP_UI, This enables the FLTK2_WRAP_UI command
9885 FLTK2_INCLUDE_DIR, where to find include files
9886 FLTK2_LIBRARIES, list of fltk2 libraries
9887 FLTK2_FOUND, Don't use FLTK2 if false.
9888
9889 The following settings should not be used in general.
9890
9891
9892 FLTK2_BASE_LIBRARY = the full path to fltk2.lib
9893 FLTK2_GL_LIBRARY = the full path to fltk2_gl.lib
9894 FLTK2_IMAGES_LIBRARY = the full path to fltk2_images.lib
9895
9896
9897 FindFreetype
9898 Locate FreeType library
9899
9900 This module defines
9901
9902
9903 FREETYPE_LIBRARIES, the library to link against
9904 FREETYPE_FOUND, if false, do not try to link to FREETYPE
9905 FREETYPE_INCLUDE_DIRS, where to find headers.
9906 This is the concatenation of the paths:
9907 FREETYPE_INCLUDE_DIR_ft2build
9908 FREETYPE_INCLUDE_DIR_freetype2
9909
9910
9911
9912
9913 $FREETYPE_DIR is an environment variable that would correspond
9914 to the ./configure --prefix=$FREETYPE_DIR used in building
9915 FREETYPE.
9916
9917
9918 FindGCCXML
9919 Find the GCC-XML front-end executable.
9920
9921
9922
9923
9924 This module will define the following variables:
9925
9926
9927 GCCXML - the GCC-XML front-end executable.
9928
9929
9930 FindGDAL
9931
9932
9933 Locate gdal
9934
9935
9936 This module accepts the following environment variables:
9937
9938
9939 GDAL_DIR or GDAL_ROOT - Specify the location of GDAL
9940
9941
9942
9943
9944 This module defines the following CMake variables:
9945
9946
9947 GDAL_FOUND - True if libgdal is found
9948 GDAL_LIBRARY - A variable pointing to the GDAL library
9949 GDAL_INCLUDE_DIR - Where to find the headers
9950
9951
9952 FindGIF
9953
9954
9955 This module defines GIF_LIBRARIES - libraries to link to in
9956 order to use GIF GIF_FOUND, if false, do not try to link
9957 GIF_INCLUDE_DIR, where to find the headers
9958
9959
9960 $GIF_DIR is an environment variable that would correspond to the
9961 ./configure --prefix=$GIF_DIR
9962
9963
9964 FindGLUT
9965 try to find glut library and include files
9966
9967 GLUT_INCLUDE_DIR, where to find GL/glut.h, etc.
9968 GLUT_LIBRARIES, the libraries to link against
9969 GLUT_FOUND, If false, do not try to use GLUT.
9970
9971 Also defined, but not for general use are:
9972
9973
9974 GLUT_glut_LIBRARY = the full path to the glut library.
9975 GLUT_Xmu_LIBRARY = the full path to the Xmu library.
9976 GLUT_Xi_LIBRARY = the full path to the Xi Library.
9977
9978
9979 FindGTK
9980 try to find GTK (and glib) and GTKGLArea
9981
9982 GTK_INCLUDE_DIR - Directories to include to use GTK
9983 GTK_LIBRARIES - Files to link against to use GTK
9984 GTK_FOUND - GTK was found
9985 GTK_GL_FOUND - GTK's GL features were found
9986
9987
9988 FindGTK2
9989 FindGTK2.cmake
9990
9991 This module can find the GTK2 widget libraries and several of
9992 its other optional components like gtkmm, glade, and glademm.
9993
9994
9995 NOTE: If you intend to use version checking, CMake 2.6.2 or
9996 later is
9997
9998
9999 required.
10000
10001
10002
10003
10004 Specify one or more of the following components as you call this
10005 find module. See example below.
10006
10007
10008 gtk
10009 gtkmm
10010 glade
10011 glademm
10012
10013
10014
10015
10016 The following variables will be defined for your use
10017
10018
10019 GTK2_FOUND - Were all of your specified components found?
10020 GTK2_INCLUDE_DIRS - All include directories
10021 GTK2_LIBRARIES - All libraries
10022
10023
10024
10025
10026 GTK2_VERSION - The version of GTK2 found (x.y.z)
10027 GTK2_MAJOR_VERSION - The major version of GTK2
10028 GTK2_MINOR_VERSION - The minor version of GTK2
10029 GTK2_PATCH_VERSION - The patch version of GTK2
10030
10031
10032
10033
10034 Optional variables you can define prior to calling this module:
10035
10036
10037 GTK2_DEBUG - Enables verbose debugging of the module
10038 GTK2_SKIP_MARK_AS_ADVANCED - Disable marking cache variables as advanced
10039 GTK2_ADDITIONAL_SUFFIXES - Allows defining additional directories to
10040 search for include files
10041
10042
10043
10044
10045 ================= Example Usage:
10046
10047
10048 Call find_package() once, here are some examples to pick from:
10049
10050
10051
10052
10053 Require GTK 2.6 or later
10054 find_package(GTK2 2.6 REQUIRED gtk)
10055
10056
10057
10058
10059 Require GTK 2.10 or later and Glade
10060 find_package(GTK2 2.10 REQUIRED gtk glade)
10061
10062
10063
10064
10065 Search for GTK/GTKMM 2.8 or later
10066 find_package(GTK2 2.8 COMPONENTS gtk gtkmm)
10067
10068
10069
10070
10071 if(GTK2_FOUND)
10072 include_directories(${GTK2_INCLUDE_DIRS})
10073 add_executable(mygui mygui.cc)
10074 target_link_libraries(mygui ${GTK2_LIBRARIES})
10075 endif()
10076
10077
10078
10079
10080
10081 FindGTest
10082 --------------------
10083
10084 Locate the Google C++ Testing Framework.
10085
10086
10087 Defines the following variables:
10088
10089
10090 GTEST_FOUND - Found the Google Testing framework
10091 GTEST_INCLUDE_DIRS - Include directories
10092
10093
10094
10095
10096 Also defines the library variables below as normal variables.
10097 These contain debug/optimized keywords when a debugging library
10098 is found.
10099
10100
10101 GTEST_BOTH_LIBRARIES - Both libgtest & libgtest-main
10102 GTEST_LIBRARIES - libgtest
10103 GTEST_MAIN_LIBRARIES - libgtest-main
10104
10105
10106
10107
10108 Accepts the following variables as input:
10109
10110
10111 GTEST_ROOT - (as a CMake or environment variable)
10112 The root directory of the gtest install prefix
10113
10114
10115
10116
10117 GTEST_MSVC_SEARCH - If compiling with MSVC, this variable can be set to
10118 "MD" or "MT" to enable searching a GTest build tree
10119 (defaults: "MD")
10120
10121
10122
10123
10124 Example Usage:
10125
10126
10127 enable_testing()
10128 find_package(GTest REQUIRED)
10129 include_directories(${GTEST_INCLUDE_DIRS})
10130
10131
10132
10133
10134 add_executable(foo foo.cc)
10135 target_link_libraries(foo ${GTEST_BOTH_LIBRARIES})
10136
10137
10138
10139
10140 add_test(AllTestsInFoo foo)
10141
10142
10143
10144
10145
10146
10147
10148 If you would like each Google test to show up in CTest as a test
10149 you may use the following macro. NOTE: It will slow down your
10150 tests by running an executable for each test and test fixture.
10151 You will also have to rerun CMake after adding or removing tests
10152 or test fixtures.
10153
10154
10155 GTEST_ADD_TESTS(executable extra_args ARGN)
10156
10157
10158 executable = The path to the test executable
10159 extra_args = Pass a list of extra arguments to be passed to
10160 executable enclosed in quotes (or "" for none)
10161 ARGN = A list of source files to search for tests & test
10162 fixtures.
10163
10164
10165
10166
10167 Example:
10168 set(FooTestArgs --foo 1 --bar 2)
10169 add_executable(FooTest FooUnitTest.cc)
10170 GTEST_ADD_TESTS(FooTest "${FooTestArgs}" FooUnitTest.cc)
10171
10172
10173 FindGettext
10174 Find GNU gettext tools
10175
10176 This module looks for the GNU gettext tools. This module defines
10177 the following values:
10178
10179
10180 GETTEXT_MSGMERGE_EXECUTABLE: the full path to the msgmerge tool.
10181 GETTEXT_MSGFMT_EXECUTABLE: the full path to the msgfmt tool.
10182 GETTEXT_FOUND: True if gettext has been found.
10183
10184
10185
10186
10187 Additionally it provides the following macros: GETTEXT_CRE‐
10188 ATE_TRANSLATIONS ( outputFile [ALL] file1 ... fileN )
10189
10190
10191 This will create a target "translations" which will convert the
10192 given input po files into the binary output mo file. If the
10193 ALL option is used, the translations will also be created when
10194 building the default target.
10195
10196
10197 FindGit
10198
10199
10200 The module defines the following variables:
10201
10202
10203 GIT_EXECUTABLE - path to git command line client
10204 GIT_FOUND - true if the command line client was found
10205
10206 Example usage:
10207
10208
10209 find_package(Git)
10210 if(GIT_FOUND)
10211 message("git found: ${GIT_EXECUTABLE}")
10212 endif()
10213
10214
10215 FindGnuTLS
10216 Try to find the GNU Transport Layer Security library (gnutls)
10217
10218
10219
10220
10221 Once done this will define
10222
10223
10224 GNUTLS_FOUND - System has gnutls
10225 GNUTLS_INCLUDE_DIR - The gnutls include directory
10226 GNUTLS_LIBRARIES - The libraries needed to use gnutls
10227 GNUTLS_DEFINITIONS - Compiler switches required for using gnutls
10228
10229
10230 FindGnuplot
10231 this module looks for gnuplot
10232
10233
10234
10235
10236 Once done this will define
10237
10238
10239 GNUPLOT_FOUND - system has Gnuplot
10240 GNUPLOT_EXECUTABLE - the Gnuplot executable
10241
10242
10243 FindHDF5
10244 Find HDF5, a library for reading and writing self describing
10245 array data.
10246
10247
10248
10249
10250 This module invokes the HDF5 wrapper compiler that should be
10251 installed alongside HDF5. Depending upon the HDF5 Configura‐
10252 tion, the wrapper compiler is called either h5cc or h5pcc. If
10253 this succeeds, the module will then call the compiler with the
10254 -show argument to see what flags are used when compiling an HDF5
10255 client application.
10256
10257
10258 The module will optionally accept the COMPONENTS argument. If
10259 no COMPONENTS are specified, then the find module will default
10260 to finding only the HDF5 C library. If one or more COMPONENTS
10261 are specified, the module will attempt to find the language
10262 bindings for the specified components. Currently, the only
10263 valid components are C and CXX. The module does not yet support
10264 finding the Fortran bindings. If the COMPONENTS argument is not
10265 given, the module will attempt to find only the C bindings.
10266
10267
10268 On UNIX systems, this module will read the variable
10269 HDF5_USE_STATIC_LIBRARIES to determine whether or not to prefer
10270 a static link to a dynamic link for HDF5 and all of it's depen‐
10271 dencies. To use this feature, make sure that the
10272 HDF5_USE_STATIC_LIBRARIES variable is set before the call to
10273 find_package.
10274
10275
10276 To provide the module with a hint about where to find your HDF5
10277 installation, you can set the environment variable HDF5_ROOT.
10278 The Find module will then look in this path when searching for
10279 HDF5 executables, paths, and libraries.
10280
10281
10282 In addition to finding the includes and libraries required to
10283 compile an HDF5 client application, this module also makes an
10284 effort to find tools that come with the HDF5 distribution that
10285 may be useful for regression testing.
10286
10287
10288 This module will define the following variables:
10289
10290
10291 HDF5_INCLUDE_DIRS - Location of the hdf5 includes
10292 HDF5_INCLUDE_DIR - Location of the hdf5 includes (deprecated)
10293 HDF5_DEFINITIONS - Required compiler definitions for HDF5
10294 HDF5_C_LIBRARIES - Required libraries for the HDF5 C bindings.
10295 HDF5_CXX_LIBRARIES - Required libraries for the HDF5 C++ bindings
10296 HDF5_LIBRARIES - Required libraries for all requested bindings
10297 HDF5_FOUND - true if HDF5 was found on the system
10298 HDF5_LIBRARY_DIRS - the full set of library directories
10299 HDF5_IS_PARALLEL - Whether or not HDF5 was found with parallel IO support
10300 HDF5_C_COMPILER_EXECUTABLE - the path to the HDF5 C wrapper compiler
10301 HDF5_CXX_COMPILER_EXECUTABLE - the path to the HDF5 C++ wrapper compiler
10302 HDF5_DIFF_EXECUTABLE - the path to the HDF5 dataset comparison tool
10303
10304
10305 FindHSPELL
10306 Try to find Hspell
10307
10308 Once done this will define
10309
10310
10311 HSPELL_FOUND - system has Hspell
10312 HSPELL_INCLUDE_DIR - the Hspell include directory
10313 HSPELL_LIBRARIES - The libraries needed to use Hspell
10314 HSPELL_DEFINITIONS - Compiler switches required for using Hspell
10315
10316
10317
10318
10319 HSPELL_VERSION_STRING - The version of Hspell found (x.y)
10320 HSPELL_MAJOR_VERSION - the major version of Hspell
10321 HSPELL_MINOR_VERSION - The minor version of Hspell
10322
10323
10324 FindHTMLHelp
10325 This module looks for Microsoft HTML Help Compiler
10326
10327 It defines:
10328
10329
10330 HTML_HELP_COMPILER : full path to the Compiler (hhc.exe)
10331 HTML_HELP_INCLUDE_PATH : include path to the API (htmlhelp.h)
10332 HTML_HELP_LIBRARY : full path to the library (htmlhelp.lib)
10333
10334
10335
10336
10337
10338 FindITK
10339 Find an ITK installation or build tree.
10340
10341
10342 FindImageMagick
10343 Find the ImageMagick binary suite.
10344
10345 This module will search for a set of ImageMagick tools specified
10346 as components in the FIND_PACKAGE call. Typical components
10347 include, but are not limited to (future versions of ImageMagick
10348 might have additional components not listed here):
10349
10350
10351 animate
10352 compare
10353 composite
10354 conjure
10355 convert
10356 display
10357 identify
10358 import
10359 mogrify
10360 montage
10361 stream
10362
10363
10364
10365
10366 If no component is specified in the FIND_PACKAGE call, then it
10367 only searches for the ImageMagick executable directory. This
10368 code defines the following variables:
10369
10370
10371 ImageMagick_FOUND - TRUE if all components are found.
10372 ImageMagick_EXECUTABLE_DIR - Full path to executables directory.
10373 ImageMagick_<component>_FOUND - TRUE if <component> is found.
10374 ImageMagick_<component>_EXECUTABLE - Full path to <component> executable.
10375
10376
10377
10378
10379 There are also components for the following ImageMagick APIs:
10380
10381
10382 Magick++
10383 MagickWand
10384 MagickCore
10385
10386
10387
10388
10389 For these components the following variables are set:
10390
10391
10392 ImageMagick_FOUND - TRUE if all components are found.
10393 ImageMagick_INCLUDE_DIRS - Full paths to all include dirs.
10394 ImageMagick_LIBRARIES - Full paths to all libraries.
10395 ImageMagick_<component>_FOUND - TRUE if <component> is found.
10396 ImageMagick_<component>_INCLUDE_DIRS - Full path to <component> include dirs.
10397 ImageMagick_<component>_LIBRARIES - Full path to <component> libraries.
10398
10399
10400
10401
10402 Example Usages:
10403
10404
10405 FIND_PACKAGE(ImageMagick)
10406 FIND_PACKAGE(ImageMagick COMPONENTS convert)
10407 FIND_PACKAGE(ImageMagick COMPONENTS convert mogrify display)
10408 FIND_PACKAGE(ImageMagick COMPONENTS Magick++)
10409 FIND_PACKAGE(ImageMagick COMPONENTS Magick++ convert)
10410
10411
10412
10413
10414 Note that the standard FIND_PACKAGE features are supported
10415 (i.e., QUIET, REQUIRED, etc.).
10416
10417
10418 FindJNI
10419 Find JNI java libraries.
10420
10421 This module finds if Java is installed and determines where the
10422 include files and libraries are. It also determines what the
10423 name of the library is. This code sets the following variables:
10424
10425
10426
10427 JNI_INCLUDE_DIRS = the include dirs to use
10428 JNI_LIBRARIES = the libraries to use
10429 JNI_FOUND = TRUE if JNI headers and libraries were found.
10430 JAVA_AWT_LIBRARY = the path to the jawt library
10431 JAVA_JVM_LIBRARY = the path to the jvm library
10432 JAVA_INCLUDE_PATH = the include path to jni.h
10433 JAVA_INCLUDE_PATH2 = the include path to jni_md.h
10434 JAVA_AWT_INCLUDE_PATH = the include path to jawt.h
10435
10436
10437
10438
10439
10440 FindJPEG
10441 Find JPEG
10442
10443 Find the native JPEG includes and library This module defines
10444
10445
10446 JPEG_INCLUDE_DIR, where to find jpeglib.h, etc.
10447 JPEG_LIBRARIES, the libraries needed to use JPEG.
10448 JPEG_FOUND, If false, do not try to use JPEG.
10449
10450 also defined, but not for general use are
10451
10452
10453 JPEG_LIBRARY, where to find the JPEG library.
10454
10455
10456 FindJasper
10457 Try to find the Jasper JPEG2000 library
10458
10459 Once done this will define
10460
10461
10462 JASPER_FOUND - system has Jasper
10463 JASPER_INCLUDE_DIR - the Jasper include directory
10464 JASPER_LIBRARIES - The libraries needed to use Jasper
10465
10466
10467 FindJava
10468 Find Java
10469
10470 This module finds if Java is installed and determines where the
10471 include files and libraries are. This code sets the following
10472 variables:
10473
10474
10475 Java_JAVA_EXECUTABLE = the full path to the Java runtime
10476 Java_JAVAC_EXECUTABLE = the full path to the Java compiler
10477 Java_JAR_EXECUTABLE = the full path to the Java archiver
10478 Java_VERSION_STRING = Version of the package found (java version), eg. 1.6.0_12
10479 Java_VERSION_MAJOR = The major version of the package found.
10480 Java_VERSION_MINOR = The minor version of the package found.
10481 Java_VERSION_PATCH = The patch version of the package found.
10482 Java_VERSION_TWEAK = The tweak version of the package found (after '_')
10483 Java_VERSION = This is set to: $major.$minor.$patch(.$tweak)
10484
10485
10486
10487
10488 The minimum required version of Java can be specified using the
10489 standard CMake syntax, e.g. FIND_PACKAGE(Java 1.5)
10490
10491
10492 NOTE: ${Java_VERSION} and ${Java_VERSION_STRING} are not guaran‐
10493 teed to be identical. For example some java version may return:
10494 Java_VERSION_STRING = 1.5.0_17 and Java_VERSION =
10495 1.5.0.17
10496
10497
10498 another example is the Java OEM, with: Java_VERSION_STRING =
10499 1.6.0-oem and Java_VERSION = 1.6.0
10500
10501
10502 For these components the following variables are set:
10503
10504
10505 Java_FOUND - TRUE if all components are found.
10506 Java_INCLUDE_DIRS - Full paths to all include dirs.
10507 Java_LIBRARIES - Full paths to all libraries.
10508 Java_<component>_FOUND - TRUE if <component> is found.
10509
10510
10511
10512
10513 Example Usages:
10514
10515
10516 FIND_PACKAGE(Java)
10517 FIND_PACKAGE(Java COMPONENTS Runtime)
10518 FIND_PACKAGE(Java COMPONENTS Development)
10519
10520
10521
10522
10523
10524 FindKDE3
10525 Find the KDE3 include and library dirs, KDE preprocessors and
10526 define a some macros
10527
10528
10529
10530
10531 This module defines the following variables:
10532
10533
10534 KDE3_DEFINITIONS - compiler definitions required for compiling KDE software
10535 KDE3_INCLUDE_DIR - the KDE include directory
10536 KDE3_INCLUDE_DIRS - the KDE and the Qt include directory, for use with INCLUDE_DIRECTORIES()
10537 KDE3_LIB_DIR - the directory where the KDE libraries are installed, for use with LINK_DIRECTORIES()
10538 QT_AND_KDECORE_LIBS - this contains both the Qt and the kdecore library
10539 KDE3_DCOPIDL_EXECUTABLE - the dcopidl executable
10540 KDE3_DCOPIDL2CPP_EXECUTABLE - the dcopidl2cpp executable
10541 KDE3_KCFGC_EXECUTABLE - the kconfig_compiler executable
10542 KDE3_FOUND - set to TRUE if all of the above has been found
10543
10544
10545
10546
10547 The following user adjustable options are provided:
10548
10549
10550 KDE3_BUILD_TESTS - enable this to build KDE testcases
10551
10552
10553
10554
10555
10556
10557
10558 It also adds the following macros (from KDE3Macros.cmake)
10559 SRCS_VAR is always the variable which contains the list of
10560 source files for your application or library.
10561
10562
10563 KDE3_AUTOMOC(file1 ... fileN)
10564
10565
10566 Call this if you want to have automatic moc file handling.
10567 This means if you include "foo.moc" in the source file foo.cpp
10568 a moc file for the header foo.h will be created automatically.
10569 You can set the property SKIP_AUTOMAKE using SET_SOURCE_FILES_PROPERTIES()
10570 to exclude some files in the list from being processed.
10571
10572
10573
10574
10575 KDE3_ADD_MOC_FILES(SRCS_VAR file1 ... fileN )
10576
10577
10578 If you don't use the KDE3_AUTOMOC() macro, for the files
10579 listed here moc files will be created (named "foo.moc.cpp")
10580
10581
10582
10583
10584 KDE3_ADD_DCOP_SKELS(SRCS_VAR header1.h ... headerN.h )
10585
10586
10587 Use this to generate DCOP skeletions from the listed headers.
10588
10589
10590
10591
10592 KDE3_ADD_DCOP_STUBS(SRCS_VAR header1.h ... headerN.h )
10593
10594
10595 Use this to generate DCOP stubs from the listed headers.
10596
10597
10598
10599
10600 KDE3_ADD_UI_FILES(SRCS_VAR file1.ui ... fileN.ui )
10601
10602
10603 Use this to add the Qt designer ui files to your application/library.
10604
10605
10606
10607
10608 KDE3_ADD_KCFG_FILES(SRCS_VAR file1.kcfgc ... fileN.kcfgc )
10609
10610
10611 Use this to add KDE kconfig compiler files to your application/library.
10612
10613
10614
10615
10616 KDE3_INSTALL_LIBTOOL_FILE(target)
10617
10618
10619 This will create and install a simple libtool file for the given target.
10620
10621
10622
10623
10624 KDE3_ADD_EXECUTABLE(name file1 ... fileN )
10625
10626
10627 Currently identical to ADD_EXECUTABLE(), may provide some advanced features in the future.
10628
10629
10630
10631
10632 KDE3_ADD_KPART(name [WITH_PREFIX] file1 ... fileN )
10633
10634
10635 Create a KDE plugin (KPart, kioslave, etc.) from the given source files.
10636 If WITH_PREFIX is given, the resulting plugin will have the prefix "lib", otherwise it won't.
10637 It creates and installs an appropriate libtool la-file.
10638
10639
10640
10641
10642 KDE3_ADD_KDEINIT_EXECUTABLE(name file1 ... fileN )
10643
10644
10645 Create a KDE application in the form of a module loadable via kdeinit.
10646 A library named kdeinit_<name> will be created and a small executable which links to it.
10647
10648
10649
10650
10651 The option KDE3_ENABLE_FINAL to enable all-in-one compilation is
10652 no longer supported.
10653
10654
10655
10656
10657
10658 Author: Alexander Neundorf <neundorf@kde.org>
10659
10660
10661 FindKDE4
10662
10663
10664 Find KDE4 and provide all necessary variables and macros to com‐
10665 pile software for it. It looks for KDE 4 in the following direc‐
10666 tories in the given order:
10667
10668
10669 CMAKE_INSTALL_PREFIX
10670 KDEDIRS
10671 /opt/kde4
10672
10673
10674
10675
10676 Please look in FindKDE4Internal.cmake and KDE4Macros.cmake for
10677 more information. They are installed with the KDE 4 libraries in
10678 $KDEDIRS/share/apps/cmake/modules/.
10679
10680
10681 Author: Alexander Neundorf <neundorf@kde.org>
10682
10683
10684 FindLAPACK
10685 Find LAPACK library
10686
10687 This module finds an installed fortran library that implements
10688 the LAPACK linear-algebra interface (see
10689 http://www.netlib.org/lapack/).
10690
10691
10692 The approach follows that taken for the autoconf macro file,
10693 acx_lapack.m4 (distributed at http://ac-archive.source‐
10694 forge.net/ac-archive/acx_lapack.html).
10695
10696
10697 This module sets the following variables:
10698
10699
10700 LAPACK_FOUND - set to true if a library implementing the LAPACK interface
10701 is found
10702 LAPACK_LINKER_FLAGS - uncached list of required linker flags (excluding -l
10703 and -L).
10704 LAPACK_LIBRARIES - uncached list of libraries (using full path name) to
10705 link against to use LAPACK
10706 LAPACK95_LIBRARIES - uncached list of libraries (using full path name) to
10707 link against to use LAPACK95
10708 LAPACK95_FOUND - set to true if a library implementing the LAPACK f95
10709 interface is found
10710 BLA_STATIC if set on this determines what kind of linkage we do (static)
10711 BLA_VENDOR if set checks only the specified vendor, if not set checks
10712 all the possibilities
10713 BLA_F95 if set on tries to find the f95 interfaces for BLAS/LAPACK
10714
10715 ## List of vendors (BLA_VENDOR) valid in this module #
10716 Intel(mkl), ACML,Apple, NAS, Generic
10717
10718
10719 FindLATEX
10720 Find Latex
10721
10722 This module finds if Latex is installed and determines where the
10723 executables are. This code sets the following variables:
10724
10725
10726
10727 LATEX_COMPILER: path to the LaTeX compiler
10728 PDFLATEX_COMPILER: path to the PdfLaTeX compiler
10729 BIBTEX_COMPILER: path to the BibTeX compiler
10730 MAKEINDEX_COMPILER: path to the MakeIndex compiler
10731 DVIPS_CONVERTER: path to the DVIPS converter
10732 PS2PDF_CONVERTER: path to the PS2PDF converter
10733 LATEX2HTML_CONVERTER: path to the LaTeX2Html converter
10734
10735
10736
10737
10738
10739 FindLibArchive
10740 Find libarchive library and headers
10741
10742 The module defines the following variables:
10743
10744
10745 LibArchive_FOUND - true if libarchive was found
10746 LibArchive_INCLUDE_DIRS - include search path
10747 LibArchive_LIBRARIES - libraries to link
10748 LibArchive_VERSION - libarchive 3-component version number
10749
10750
10751 FindLibXml2
10752 Try to find the LibXml2 xml processing library
10753
10754 Once done this will define
10755
10756
10757 LIBXML2_FOUND - System has LibXml2
10758 LIBXML2_INCLUDE_DIR - The LibXml2 include directory
10759 LIBXML2_LIBRARIES - The libraries needed to use LibXml2
10760 LIBXML2_DEFINITIONS - Compiler switches required for using LibXml2
10761 LIBXML2_XMLLINT_EXECUTABLE - The XML checking tool xmllint coming with LibXml2
10762
10763
10764 FindLibXslt
10765 Try to find the LibXslt library
10766
10767 Once done this will define
10768
10769
10770 LIBXSLT_FOUND - system has LibXslt
10771 LIBXSLT_INCLUDE_DIR - the LibXslt include directory
10772 LIBXSLT_LIBRARIES - Link these to LibXslt
10773 LIBXSLT_DEFINITIONS - Compiler switches required for using LibXslt
10774
10775
10776 FindLua50
10777
10778
10779 Locate Lua library This module defines
10780
10781
10782 LUA50_FOUND, if false, do not try to link to Lua
10783 LUA_LIBRARIES, both lua and lualib
10784 LUA_INCLUDE_DIR, where to find lua.h and lualib.h (and probably lauxlib.h)
10785
10786
10787
10788
10789 Note that the expected include convention is
10790
10791
10792 #include "lua.h"
10793
10794 and not
10795
10796
10797 #include <lua/lua.h>
10798
10799 This is because, the lua location is not standardized and may
10800 exist in locations other than lua/
10801
10802
10803 FindLua51
10804
10805
10806 Locate Lua library This module defines
10807
10808
10809 LUA51_FOUND, if false, do not try to link to Lua
10810 LUA_LIBRARIES
10811 LUA_INCLUDE_DIR, where to find lua.h
10812
10813
10814
10815
10816 Note that the expected include convention is
10817
10818
10819 #include "lua.h"
10820
10821 and not
10822
10823
10824 #include <lua/lua.h>
10825
10826 This is because, the lua location is not standardized and may
10827 exist in locations other than lua/
10828
10829
10830 FindMFC
10831 Find MFC on Windows
10832
10833 Find the native MFC - i.e. decide if an application can link to
10834 the MFC libraries.
10835
10836
10837 MFC_FOUND - Was MFC support found
10838
10839 You don't need to include anything or link anything to use it.
10840
10841
10842 FindMPEG
10843 Find the native MPEG includes and library
10844
10845 This module defines
10846
10847
10848 MPEG_INCLUDE_DIR, where to find MPEG.h, etc.
10849 MPEG_LIBRARIES, the libraries required to use MPEG.
10850 MPEG_FOUND, If false, do not try to use MPEG.
10851
10852 also defined, but not for general use are
10853
10854
10855 MPEG_mpeg2_LIBRARY, where to find the MPEG library.
10856 MPEG_vo_LIBRARY, where to find the vo library.
10857
10858
10859 FindMPEG2
10860 Find the native MPEG2 includes and library
10861
10862 This module defines
10863
10864
10865 MPEG2_INCLUDE_DIR, path to mpeg2dec/mpeg2.h, etc.
10866 MPEG2_LIBRARIES, the libraries required to use MPEG2.
10867 MPEG2_FOUND, If false, do not try to use MPEG2.
10868
10869 also defined, but not for general use are
10870
10871
10872 MPEG2_mpeg2_LIBRARY, where to find the MPEG2 library.
10873 MPEG2_vo_LIBRARY, where to find the vo library.
10874
10875
10876 FindMPI
10877 Message Passing Interface (MPI) module.
10878
10879
10880
10881
10882 The Message Passing Interface (MPI) is a library used to write
10883 high-performance parallel applications that use message passing,
10884 and is typically deployed on a cluster. MPI is a standard inter‐
10885 face (defined by the MPI forum) for which many implementations
10886 are available. All of these implementations have somewhat dif‐
10887 ferent compilation approaches (different include paths,
10888 libraries to link against, etc.), and this module tries to
10889 smooth out those differences.
10890
10891
10892 This module will set the following variables:
10893
10894
10895 MPI_FOUND TRUE if we have found MPI
10896 MPI_COMPILE_FLAGS Compilation flags for MPI programs
10897 MPI_INCLUDE_PATH Include path(s) for MPI header
10898 MPI_LINK_FLAGS Linking flags for MPI programs
10899 MPI_LIBRARY First MPI library to link against (cached)
10900 MPI_EXTRA_LIBRARY Extra MPI libraries to link against (cached)
10901 MPI_LIBRARIES All libraries to link MPI programs against
10902 MPIEXEC Executable for running MPI programs
10903 MPIEXEC_NUMPROC_FLAG Flag to pass to MPIEXEC before giving it the
10904 number of processors to run on
10905 MPIEXEC_PREFLAGS Flags to pass to MPIEXEC directly before the
10906 executable to run.
10907 MPIEXEC_POSTFLAGS Flags to pass to MPIEXEC after all other flags.
10908
10909
10910
10911
10912 This module will attempt to auto-detect these settings, first by
10913 looking for a MPI compiler, which many MPI implementations pro‐
10914 vide as a pass-through to the native compiler to simplify the
10915 compilation of MPI programs. The MPI compiler is stored in the
10916 cache variable MPI_COMPILER, and will attempt to look for com‐
10917 monly-named drivers mpic++, mpicxx, mpiCC, or mpicc. If the com‐
10918 piler driver is found and recognized, it will be used to set all
10919 of the module variables. To skip this auto-detection, set
10920 MPI_LIBRARY and MPI_INCLUDE_PATH in the CMake cache.
10921
10922
10923 If no compiler driver is found or the compiler driver is not
10924 recognized, this module will then search for common include
10925 paths and library names to try to detect MPI.
10926
10927
10928 If CMake initially finds a different MPI than was intended, and
10929 you want to use the MPI compiler auto-detection for a different
10930 MPI implementation, set MPI_COMPILER to the MPI compiler driver
10931 you want to use (e.g., mpicxx) and then set MPI_LIBRARY to the
10932 string MPI_LIBRARY-NOTFOUND. When you re-configure, auto-detec‐
10933 tion of MPI will run again with the newly-specified MPI_COM‐
10934 PILER.
10935
10936
10937 When using MPIEXEC to execute MPI applications, you should typi‐
10938 cally use all of the MPIEXEC flags as follows:
10939
10940
10941 ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} PROCS ${MPIEXEC_PREFLAGS} EXECUTABLE
10942 ${MPIEXEC_POSTFLAGS} ARGS
10943
10944 where PROCS is the number of processors on which to execute the
10945 program, EXECUTABLE is the MPI program, and ARGS are the argu‐
10946 ments to pass to the MPI program.
10947
10948
10949 FindMatlab
10950 this module looks for Matlab
10951
10952 Defines:
10953
10954
10955 MATLAB_INCLUDE_DIR: include path for mex.h, engine.h
10956 MATLAB_LIBRARIES: required libraries: libmex, etc
10957 MATLAB_MEX_LIBRARY: path to libmex.lib
10958 MATLAB_MX_LIBRARY: path to libmx.lib
10959 MATLAB_ENG_LIBRARY: path to libeng.lib
10960
10961
10962 FindMotif
10963 Try to find Motif (or lesstif)
10964
10965 Once done this will define:
10966
10967
10968 MOTIF_FOUND - system has MOTIF
10969 MOTIF_INCLUDE_DIR - include paths to use Motif
10970 MOTIF_LIBRARIES - Link these to use Motif
10971
10972
10973 FindOpenAL
10974
10975
10976 Locate OpenAL This module defines OPENAL_LIBRARY OPENAL_FOUND,
10977 if false, do not try to link to OpenAL OPENAL_INCLUDE_DIR,
10978 where to find the headers
10979
10980
10981 $OPENALDIR is an environment variable that would correspond to
10982 the ./configure --prefix=$OPENALDIR used in building OpenAL.
10983
10984
10985 Created by Eric Wing. This was influenced by the FindSDL.cmake
10986 module.
10987
10988
10989 FindOpenGL
10990 Try to find OpenGL
10991
10992 Once done this will define
10993
10994
10995
10996 OPENGL_FOUND - system has OpenGL
10997 OPENGL_XMESA_FOUND - system has XMESA
10998 OPENGL_GLU_FOUND - system has GLU
10999 OPENGL_INCLUDE_DIR - the GL include directory
11000 OPENGL_LIBRARIES - Link these to use OpenGL and GLU
11001
11002
11003 If you want to use just GL you can use these values
11004
11005
11006 OPENGL_gl_LIBRARY - Path to OpenGL Library
11007 OPENGL_glu_LIBRARY - Path to GLU Library
11008
11009
11010 On OSX default to using the framework version of opengl People
11011 will have to change the cache values of OPENGL_glu_LIBRARY and
11012 OPENGL_gl_LIBRARY to use OpenGL with X11 on OSX
11013
11014
11015 FindOpenMP
11016 Finds OpenMP support
11017
11018 This module can be used to detect OpenMP support in a compiler.
11019 If the compiler supports OpenMP, the flags required to compile
11020 with openmp support are set.
11021
11022
11023 The following variables are set:
11024
11025
11026 OpenMP_C_FLAGS - flags to add to the C compiler for OpenMP support
11027 OpenMP_CXX_FLAGS - flags to add to the CXX compiler for OpenMP support
11028 OPENMP_FOUND - true if openmp is detected
11029
11030
11031
11032
11033 Supported compilers can be found at
11034 http://openmp.org/wp/openmp-compilers/
11035
11036
11037 FindOpenSSL
11038 Try to find the OpenSSL encryption library
11039
11040 Once done this will define
11041
11042
11043 OPENSSL_ROOT_DIR - Set this variable to the root installation of OpenSSL
11044
11045
11046
11047
11048 Read-Only variables:
11049
11050
11051 OPENSSL_FOUND - system has the OpenSSL library
11052 OPENSSL_INCLUDE_DIR - the OpenSSL include directory
11053 OPENSSL_LIBRARIES - The libraries needed to use OpenSSL
11054
11055
11056 FindOpenSceneGraph
11057 Find OpenSceneGraph
11058
11059 This module searches for the OpenSceneGraph core "osg" library
11060 as well as OpenThreads, and whatever additional COMPONENTS
11061 (nodekits) that you specify.
11062
11063
11064 See http://www.openscenegraph.org
11065
11066
11067
11068
11069 NOTE: To use this module effectively you must either require
11070 CMake >= 2.6.3 with cmake_minimum_required(VERSION 2.6.3) or
11071 download and place FindOpenThreads.cmake, Findosg_func‐
11072 tions.cmake, Findosg.cmake, and Find<etc>.cmake files into your
11073 CMAKE_MODULE_PATH.
11074
11075
11076 ==================================
11077
11078
11079 This module accepts the following variables (note mixed case)
11080
11081
11082 OpenSceneGraph_DEBUG - Enable debugging output
11083
11084
11085
11086
11087 OpenSceneGraph_MARK_AS_ADVANCED - Mark cache variables as advanced
11088 automatically
11089
11090
11091
11092
11093 The following environment variables are also respected for find‐
11094 ing the OSG and it's various components. CMAKE_PREFIX_PATH can
11095 also be used for this (see find_library() CMake documentation).
11096
11097
11098 <MODULE>_DIR (where MODULE is of the form "OSGVOLUME" and there is a FindosgVolume.cmake file)
11099 OSG_DIR
11100 OSGDIR
11101 OSG_ROOT
11102
11103
11104
11105
11106 This module defines the following output variables:
11107
11108
11109 OPENSCENEGRAPH_FOUND - Was the OSG and all of the specified components found?
11110
11111
11112
11113
11114 OPENSCENEGRAPH_VERSION - The version of the OSG which was found
11115
11116
11117
11118
11119 OPENSCENEGRAPH_INCLUDE_DIRS - Where to find the headers
11120
11121
11122
11123
11124 OPENSCENEGRAPH_LIBRARIES - The OSG libraries
11125
11126
11127
11128
11129 ================================== Example Usage:
11130
11131
11132 find_package(OpenSceneGraph 2.0.0 REQUIRED osgDB osgUtil)
11133 # libOpenThreads & libosg automatically searched
11134 include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS})
11135
11136
11137
11138
11139 add_executable(foo foo.cc)
11140 target_link_libraries(foo ${OPENSCENEGRAPH_LIBRARIES})
11141
11142
11143
11144
11145
11146 FindOpenThreads
11147
11148
11149 OpenThreads is a C++ based threading library. Its largest user‐
11150 base seems to OpenSceneGraph so you might notice I accept
11151 OSGDIR as an environment path. I consider this part of the Find‐
11152 osg* suite used to find OpenSceneGraph components. Each compo‐
11153 nent is separate and you must opt in to each module.
11154
11155
11156 Locate OpenThreads This module defines OPENTHREADS_LIBRARY
11157 OPENTHREADS_FOUND, if false, do not try to link to OpenThreads
11158 OPENTHREADS_INCLUDE_DIR, where to find the headers
11159
11160
11161 $OPENTHREADS_DIR is an environment variable that would corre‐
11162 spond to the ./configure --prefix=$OPENTHREADS_DIR used in
11163 building osg.
11164
11165
11166 Created by Eric Wing.
11167
11168
11169 FindPHP4
11170 Find PHP4
11171
11172 This module finds if PHP4 is installed and determines where the
11173 include files and libraries are. It also determines what the
11174 name of the library is. This code sets the following variables:
11175
11176
11177 PHP4_INCLUDE_PATH = path to where php.h can be found
11178 PHP4_EXECUTABLE = full path to the php4 binary
11179
11180
11181
11182
11183
11184 FindPNG
11185 Find the native PNG includes and library
11186
11187
11188
11189
11190 This module defines
11191
11192
11193 PNG_INCLUDE_DIR, where to find png.h, etc.
11194 PNG_LIBRARIES, the libraries to link against to use PNG.
11195 PNG_DEFINITIONS - You should add_definitons(${PNG_DEFINITIONS}) before compiling code that includes png library files.
11196 PNG_FOUND, If false, do not try to use PNG.
11197
11198 also defined, but not for general use are
11199
11200
11201 PNG_LIBRARY, where to find the PNG library.
11202
11203 None of the above will be defined unles zlib can be found. PNG
11204 depends on Zlib
11205
11206
11207 FindPackageHandleStandardArgs
11208
11209
11210 FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> ... )
11211
11212
11213 This function is intended to be used in FindXXX.cmake modules
11214 files. It handles the REQUIRED, QUIET and version-related argu‐
11215 ments to FIND_PACKAGE(). It also sets the <UPPER‐
11216 CASED_NAME>_FOUND variable. The package is considered found if
11217 all variables <var1>... listed contain valid results, e.g. valid
11218 filepaths.
11219
11220
11221 There are two modes of this function. The first argument in both
11222 modes is the name of the Find-module where it is called (in
11223 original casing).
11224
11225
11226 The first simple mode looks like this:
11227
11228
11229 FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> (DEFAULT_MSG|"Custom failure message") <var1>...<varN> )
11230
11231 If the variables <var1> to <varN> are all valid, then <UPPER‐
11232 CASED_NAME>_FOUND will be set to TRUE. If DEFAULT_MSG is given
11233 as second argument, then the function will generate itself use‐
11234 ful success and error messages. You can also supply a custom
11235 error message for the failure case. This is not recommended.
11236
11237
11238 The second mode is more powerful and also supports version
11239 checking:
11240
11241
11242 FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME [REQUIRED_VARS <var1>...<varN>]
11243 [VERSION_VAR <versionvar>
11244 [CONFIG_MODE]
11245 [FAIL_MESSAGE "Custom failure message"] )
11246
11247
11248
11249
11250 As above, if <var1> through <varN> are all valid, <UPPER‐
11251 CASED_NAME>_FOUND will be set to TRUE. After REQUIRED_VARS the
11252 variables which are required for this package are listed. Fol‐
11253 lowing VERSION_VAR the name of the variable can be specified
11254 which holds the version of the package which has been found. If
11255 this is done, this version will be checked against the (poten‐
11256 tially) specified required version used in the find_package()
11257 call. The EXACT keyword is also handled. The default messages
11258 include information about the required version and the version
11259 which has been actually found, both if the version is ok or not.
11260 Use the option CONFIG_MODE if your FindXXX.cmake module is a
11261 wrapper for a find_package(... NO_MODULE) call, in this case all
11262 the information provided by the config-mode of find_package()
11263 will be evaluated automatically. Via FAIL_MESSAGE a custom fail‐
11264 ure message can be specified, if this is not used, the default
11265 message will be displayed.
11266
11267
11268 Example for mode 1:
11269
11270
11271 FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
11272
11273
11274
11275
11276 LibXml2 is considered to be found, if both LIBXML2_LIBRARY and
11277 LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to
11278 TRUE. If it is not found and REQUIRED was used, it fails with
11279 FATAL_ERROR, independent whether QUIET was used or not. If it is
11280 found, success will be reported, including the content of
11281 <var1>. On repeated Cmake runs, the same message won't be
11282 printed again.
11283
11284
11285 Example for mode 2:
11286
11287
11288 FIND_PACKAGE_HANDLE_STANDARD_ARGS(BISON REQUIRED_VARS BISON_EXECUTABLE
11289 VERSION_VAR BISON_VERSION)
11290
11291 In this case, BISON is considered to be found if the variable(s)
11292 listed after REQUIRED_VAR are all valid, i.e. BISON_EXECUTABLE
11293 in this case. Also the version of BISON will be checked by using
11294 the version contained in BISON_VERSION. Since no FAIL_MESSAGE is
11295 given, the default messages will be printed.
11296
11297
11298 Another example for mode 2:
11299
11300
11301 FIND_PACKAGE(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4)
11302 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Automoc4 CONFIG_MODE)
11303
11304 In this case, FindAutmoc4.cmake wraps a call to FIND_PACK‐
11305 AGE(Automoc4 NO_MODULE) and adds an additional search directory
11306 for automoc4. The following FIND_PACKAGE_HANDLE_STANDARD_ARGS()
11307 call produces a proper success/error message.
11308
11309
11310 FindPackageMessage
11311
11312
11313 FIND_PACKAGE_MESSAGE(<name> "message for user" "find result
11314 details")
11315
11316
11317 This macro is intended to be used in FindXXX.cmake modules
11318 files. It will print a message once for each unique find result.
11319 This is useful for telling the user where a package was found.
11320 The first argument specifies the name (XXX) of the package. The
11321 second argument specifies the message to display. The third
11322 argument lists details about the find result so that if they
11323 change the message will be displayed again. The macro also obeys
11324 the QUIET argument to the find_package command.
11325
11326
11327 Example:
11328
11329
11330 IF(X11_FOUND)
11331 FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}"
11332 "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
11333 ELSE(X11_FOUND)
11334 ...
11335 ENDIF(X11_FOUND)
11336
11337
11338 FindPerl
11339 Find perl
11340
11341 this module looks for Perl
11342
11343
11344 PERL_EXECUTABLE - the full path to perl
11345 PERL_FOUND - If false, don't attempt to use perl.
11346
11347
11348 FindPerlLibs
11349 Find Perl libraries
11350
11351 This module finds if PERL is installed and determines where the
11352 include files and libraries are. It also determines what the
11353 name of the library is. This code sets the following variables:
11354
11355
11356 PERLLIBS_FOUND = True if perl.h & libperl were found
11357 PERL_INCLUDE_PATH = path to where perl.h is found
11358 PERL_LIBRARY = path to libperl
11359 PERL_EXECUTABLE = full path to the perl binary
11360
11361
11362
11363
11364 The minimum required version of Perl can be specified using the
11365 standard syntax, e.g. FIND_PACKAGE(PerlLibs 6.0)
11366
11367
11368 The following variables are also available if needed
11369 (introduced after CMake 2.6.4)
11370
11371
11372
11373
11374 PERL_SITESEARCH = path to the sitesearch install dir
11375 PERL_SITELIB = path to the sitelib install directory
11376 PERL_VENDORARCH = path to the vendor arch install directory
11377 PERL_VENDORLIB = path to the vendor lib install directory
11378 PERL_ARCHLIB = path to the arch lib install directory
11379 PERL_PRIVLIB = path to the priv lib install directory
11380 PERL_EXTRA_C_FLAGS = Compilation flags used to build perl
11381
11382
11383
11384
11385
11386 FindPhysFS
11387
11388
11389 Locate PhysFS library This module defines PHYSFS_LIBRARY, the
11390 name of the library to link against PHYSFS_FOUND, if false, do
11391 not try to link to PHYSFS PHYSFS_INCLUDE_DIR, where to find
11392 physfs.h
11393
11394
11395 $PHYSFSDIR is an environment variable that would correspond to
11396 the ./configure --prefix=$PHYSFSDIR used in building PHYSFS.
11397
11398
11399 Created by Eric Wing.
11400
11401
11402 FindPike
11403 Find Pike
11404
11405 This module finds if PIKE is installed and determines where the
11406 include files and libraries are. It also determines what the
11407 name of the library is. This code sets the following variables:
11408
11409
11410 PIKE_INCLUDE_PATH = path to where program.h is found
11411 PIKE_EXECUTABLE = full path to the pike binary
11412
11413
11414
11415
11416
11417 FindPkgConfig
11418 a pkg-config module for CMake
11419
11420
11421
11422
11423 Usage:
11424
11425
11426 pkg_check_modules(<PREFIX> [REQUIRED] [QUIET] <MODULE> [<MODULE>]*)
11427 checks for all the given modules
11428
11429
11430
11431
11432 pkg_search_module(<PREFIX> [REQUIRED] [QUIET] <MODULE> [<MODULE>]*)
11433 checks for given modules and uses the first working one
11434
11435
11436
11437
11438 When the 'REQUIRED' argument was set, macros will fail with an
11439 error when module(s) could not be found
11440
11441
11442 When the 'QUIET' argument is set, no status messages will be
11443 printed.
11444
11445
11446 It sets the following variables:
11447
11448
11449 PKG_CONFIG_FOUND ... true if pkg-config works on the system
11450 PKG_CONFIG_EXECUTABLE ... pathname of the pkg-config program
11451 <PREFIX>_FOUND ... set to 1 if module(s) exist
11452
11453
11454
11455
11456 For the following variables two sets of values exist; first one
11457 is the common one and has the given PREFIX. The second set con‐
11458 tains flags which are given out when pkgconfig was called with
11459 the '--static' option.
11460
11461
11462 <XPREFIX>_LIBRARIES ... only the libraries (w/o the '-l')
11463 <XPREFIX>_LIBRARY_DIRS ... the paths of the libraries (w/o the '-L')
11464 <XPREFIX>_LDFLAGS ... all required linker flags
11465 <XPREFIX>_LDFLAGS_OTHER ... all other linker flags
11466 <XPREFIX>_INCLUDE_DIRS ... the '-I' preprocessor flags (w/o the '-I')
11467 <XPREFIX>_CFLAGS ... all required cflags
11468 <XPREFIX>_CFLAGS_OTHER ... the other compiler flags
11469
11470
11471
11472
11473 <XPREFIX> = <PREFIX> for common case
11474 <XPREFIX> = <PREFIX>_STATIC for static linking
11475
11476
11477
11478
11479 There are some special variables whose prefix depends on the
11480 count of given modules. When there is only one module, <PREFIX>
11481 stays unchanged. When there are multiple modules, the prefix
11482 will be changed to <PREFIX>_<MODNAME>:
11483
11484
11485 <XPREFIX>_VERSION ... version of the module
11486 <XPREFIX>_PREFIX ... prefix-directory of the module
11487 <XPREFIX>_INCLUDEDIR ... include-dir of the module
11488 <XPREFIX>_LIBDIR ... lib-dir of the module
11489
11490
11491
11492
11493 <XPREFIX> = <PREFIX> when |MODULES| == 1, else
11494 <XPREFIX> = <PREFIX>_<MODNAME>
11495
11496
11497
11498
11499 A <MODULE> parameter can have the following formats:
11500
11501
11502 {MODNAME} ... matches any version
11503 {MODNAME}>={VERSION} ... at least version <VERSION> is required
11504 {MODNAME}={VERSION} ... exactly version <VERSION> is required
11505 {MODNAME}<={VERSION} ... modules must not be newer than <VERSION>
11506
11507
11508
11509
11510 Examples
11511
11512
11513 pkg_check_modules (GLIB2 glib-2.0)
11514
11515
11516
11517
11518 pkg_check_modules (GLIB2 glib-2.0>=2.10)
11519 requires at least version 2.10 of glib2 and defines e.g.
11520 GLIB2_VERSION=2.10.3
11521
11522
11523
11524
11525 pkg_check_modules (FOO glib-2.0>=2.10 gtk+-2.0)
11526 requires both glib2 and gtk2, and defines e.g.
11527 FOO_glib-2.0_VERSION=2.10.3
11528 FOO_gtk+-2.0_VERSION=2.8.20
11529
11530
11531
11532
11533 pkg_check_modules (XRENDER REQUIRED xrender)
11534 defines e.g.:
11535 XRENDER_LIBRARIES=Xrender;X11
11536 XRENDER_STATIC_LIBRARIES=Xrender;X11;pthread;Xau;Xdmcp
11537
11538
11539
11540
11541 pkg_search_module (BAR libxml-2.0 libxml2 libxml>=2)
11542
11543
11544 FindPostgreSQL
11545 --------------------------------------------------------------------------
11546
11547 Find the PostgreSQL installation.
11548
11549
11550 Usage: In your CMakeLists.txt file do something like this: ... #
11551 PostgreSQL FIND_PACKAGE(PostgreSQL) ... if( PostgreSQL_FOUND )
11552
11553
11554 include_directories(${PostgreSQL_INCLUDE_DIRS})
11555 link_directories(${PostgreSQL_LIBRARY_DIRS})
11556
11557 endif( PostgreSQL_FOUND ) ... Remember to include ${Post‐
11558 greSQL_LIBRARIES} in the target_link_libraries() statement.
11559
11560
11561
11562
11563
11564 In Windows, we make the assumption that, if the PostgreSQL files
11565 are installed, the default directory will be C:\Program
11566 Files\PostgreSQL.
11567
11568
11569
11570 FindProducer
11571
11572
11573 Though Producer isn't directly part of OpenSceneGraph, its pri‐
11574 mary user is OSG so I consider this part of the Findosg* suite
11575 used to find OpenSceneGraph components. You'll notice that I
11576 accept OSGDIR as an environment path.
11577
11578
11579 Each component is separate and you must opt in to each module.
11580 You must also opt into OpenGL (and OpenThreads?) as these mod‐
11581 ules won't do it for you. This is to allow you control over your
11582 own system piece by piece in case you need to opt out of cer‐
11583 tain components or change the Find behavior for a particular
11584 module (perhaps because the default FindOpenGL.cmake module
11585 doesn't work with your system as an example). If you want to use
11586 a more convenient module that includes everything, use the Find‐
11587 OpenSceneGraph.cmake instead of the Findosg*.cmake modules.
11588
11589
11590 Locate Producer This module defines PRODUCER_LIBRARY PRO‐
11591 DUCER_FOUND, if false, do not try to link to Producer PRO‐
11592 DUCER_INCLUDE_DIR, where to find the headers
11593
11594
11595 $PRODUCER_DIR is an environment variable that would correspond
11596 to the ./configure --prefix=$PRODUCER_DIR used in building osg.
11597
11598
11599 Created by Eric Wing.
11600
11601
11602 FindProtobuf
11603
11604
11605 Locate and configure the Google Protocol Buffers library.
11606 Defines the following variables:
11607
11608
11609 PROTOBUF_FOUND - Found the Google Protocol Buffers library
11610 PROTOBUF_INCLUDE_DIRS - Include directories for Google Protocol Buffers
11611 PROTOBUF_LIBRARIES - The protobuf library
11612
11613
11614
11615
11616 The following cache variables are also defined:
11617
11618
11619 PROTOBUF_LIBRARY - The protobuf library
11620 PROTOBUF_PROTOC_LIBRARY - The protoc library
11621 PROTOBUF_INCLUDE_DIR - The include directory for protocol buffers
11622 PROTOBUF_PROTOC_EXECUTABLE - The protoc compiler
11623
11624
11625
11626
11627 ====================================================================
11628 Example:
11629
11630
11631
11632
11633 find_package(Protobuf REQUIRED)
11634 include_directories(${PROTOBUF_INCLUDE_DIRS})
11635
11636
11637
11638
11639 include_directories(${CMAKE_CURRENT_BINARY_DIR})
11640 PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS foo.proto)
11641 add_executable(bar bar.cc ${PROTO_SRCS} ${PROTO_HDRS})
11642 target_link_libraries(bar ${PROTOBUF_LIBRARY})
11643
11644
11645
11646
11647 NOTE: You may need to link against pthreads, depending on the
11648 platform.
11649
11650
11651 ====================================================================
11652
11653
11654
11655
11656 PROTOBUF_GENERATE_CPP (public function)
11657
11658
11659 SRCS = Variable to define with autogenerated
11660 source files
11661 HDRS = Variable to define with autogenerated
11662 header files
11663 ARGN = proto files
11664
11665
11666
11667
11668 ====================================================================
11669
11670
11671 FindPythonInterp
11672 Find python interpreter
11673
11674 This module finds if Python interpreter is installed and deter‐
11675 mines where the executables are. This code sets the following
11676 variables:
11677
11678
11679 PYTHONINTERP_FOUND - Was the Python executable found
11680 PYTHON_EXECUTABLE - path to the Python interpreter
11681 Python_ADDITIONAL_VERSIONS - list of additional Python versions to search for
11682
11683
11684
11685
11686
11687 FindPythonLibs
11688 Find python libraries
11689
11690 This module finds if Python is installed and determines where
11691 the include files and libraries are. It also determines what the
11692 name of the library is. This code sets the following variables:
11693
11694
11695 PYTHONLIBS_FOUND - have the Python libs been found
11696 PYTHON_LIBRARIES - path to the python library
11697 PYTHON_INCLUDE_PATH - path to where Python.h is found (deprecated)
11698 PYTHON_INCLUDE_DIRS - path to where Python.h is found
11699 PYTHON_DEBUG_LIBRARIES - path to the debug library
11700 Python_ADDITIONAL_VERSIONS - list of additional Python versions to search for
11701
11702
11703 FindQt Searches for all installed versions of QT.
11704
11705 This should only be used if your project can work with multiple
11706 versions of QT. If not, you should just directly use FindQt4 or
11707 FindQt3. If multiple versions of QT are found on the machine,
11708 then The user must set the option DESIRED_QT_VERSION to the ver‐
11709 sion they want to use. If only one version of qt is found on
11710 the machine, then the DESIRED_QT_VERSION is set to that version
11711 and the matching FindQt3 or FindQt4 module is included. Once
11712 the user sets DESIRED_QT_VERSION, then the FindQt3 or FindQt4
11713 module is included.
11714
11715
11716 QT_REQUIRED if this is set to TRUE then if CMake can
11717 not find QT4 or QT3 an error is raised
11718 and a message is sent to the user.
11719
11720
11721
11722
11723 DESIRED_QT_VERSION OPTION is created
11724 QT4_INSTALLED is set to TRUE if qt4 is found.
11725 QT3_INSTALLED is set to TRUE if qt3 is found.
11726
11727
11728 FindQt3
11729 Locate Qt include paths and libraries
11730
11731 This module defines:
11732
11733
11734 QT_INCLUDE_DIR - where to find qt.h, etc.
11735 QT_LIBRARIES - the libraries to link against to use Qt.
11736 QT_DEFINITIONS - definitions to use when
11737 compiling code that uses Qt.
11738 QT_FOUND - If false, don't try to use Qt.
11739
11740
11741
11742
11743 If you need the multithreaded version of Qt, set QT_MT_REQUIRED
11744 to TRUE
11745
11746
11747 Also defined, but not for general use are:
11748
11749
11750 QT_MOC_EXECUTABLE, where to find the moc tool.
11751 QT_UIC_EXECUTABLE, where to find the uic tool.
11752 QT_QT_LIBRARY, where to find the Qt library.
11753 QT_QTMAIN_LIBRARY, where to find the qtmain
11754 library. This is only required by Qt3 on Windows.
11755
11756
11757 FindQt4
11758 Find QT 4
11759
11760 This module can be used to find Qt4. The most important issue is
11761 that the Qt4 qmake is available via the system path. This qmake
11762 is then used to detect basically everything else. This module
11763 defines a number of key variables and macros. The variable
11764 QT_USE_FILE is set which is the path to a CMake file that can be
11765 included to compile Qt 4 applications and libraries. It sets
11766 up the compilation environment for include directories, pre‐
11767 processor defines and populates a QT_LIBRARIES variable.
11768
11769
11770 Typical usage could be something like:
11771
11772
11773 find_package(Qt4 4.4.3 COMPONENTS QtCore QtGui QtXml REQUIRED )
11774 include(${QT_USE_FILE})
11775 add_executable(myexe main.cpp)
11776 target_link_libraries(myexe ${QT_LIBRARIES})
11777
11778
11779
11780
11781 The minimum required version can be specified using the standard
11782 find_package()-syntax (see example above). For compatibility
11783 with older versions of FindQt4.cmake it is also possible to set
11784 the variable QT_MIN_VERSION to the minimum required version of
11785 Qt4 before the find_package(Qt4) command. If both are used,
11786 the version used in the find_package() command overrides the one
11787 from QT_MIN_VERSION.
11788
11789
11790 When using the components argument, QT_USE_QT* variables are
11791 automatically set for the QT_USE_FILE to pick up. If one wishes
11792 to manually set them, the available ones to set include:
11793
11794
11795 QT_DONT_USE_QTCORE
11796 QT_DONT_USE_QTGUI
11797 QT_USE_QT3SUPPORT
11798 QT_USE_QTASSISTANT
11799 QT_USE_QAXCONTAINER
11800 QT_USE_QAXSERVER
11801 QT_USE_QTDESIGNER
11802 QT_USE_QTMOTIF
11803 QT_USE_QTMAIN
11804 QT_USE_QTMULTIMEDIA
11805 QT_USE_QTNETWORK
11806 QT_USE_QTNSPLUGIN
11807 QT_USE_QTOPENGL
11808 QT_USE_QTSQL
11809 QT_USE_QTXML
11810 QT_USE_QTSVG
11811 QT_USE_QTTEST
11812 QT_USE_QTUITOOLS
11813 QT_USE_QTDBUS
11814 QT_USE_QTSCRIPT
11815 QT_USE_QTASSISTANTCLIENT
11816 QT_USE_QTHELP
11817 QT_USE_QTWEBKIT
11818 QT_USE_QTXMLPATTERNS
11819 QT_USE_PHONON
11820 QT_USE_QTSCRIPTTOOLS
11821 QT_USE_QTDECLARATIVE
11822
11823
11824
11825
11826 QT_USE_IMPORTED_TARGETS
11827 If this variable is set to TRUE, FindQt4.cmake will create imported
11828 library targets for the various Qt libraries and set the
11829 library variables like QT_QTCORE_LIBRARY to point at these imported
11830 targets instead of the library file on disk. This provides much better
11831 handling of the release and debug versions of the Qt libraries and is
11832 also always backwards compatible, except for the case that dependencies
11833 of libraries are exported, these will then also list the names of the
11834 imported targets as dependency and not the file location on disk. This
11835 is much more flexible, but requires that FindQt4.cmake is executed before
11836 such an exported dependency file is processed.
11837
11838
11839
11840
11841 There are also some files that need processing by some Qt tools
11842 such as moc and uic. Listed below are macros that may be used
11843 to process those files.
11844
11845
11846
11847 macro QT4_WRAP_CPP(outfiles inputfile ... OPTIONS ...)
11848 create moc code from a list of files containing Qt class with
11849 the Q_OBJECT declaration. Per-direcotry preprocessor definitions
11850 are also added. Options may be given to moc, such as those found
11851 when executing "moc -help".
11852
11853
11854
11855
11856 macro QT4_WRAP_UI(outfiles inputfile ... OPTIONS ...)
11857 create code from a list of Qt designer ui files.
11858 Options may be given to uic, such as those found
11859 when executing "uic -help"
11860
11861
11862
11863
11864 macro QT4_ADD_RESOURCES(outfiles inputfile ... OPTIONS ...)
11865 create code from a list of Qt resource files.
11866 Options may be given to rcc, such as those found
11867 when executing "rcc -help"
11868
11869
11870
11871
11872 macro QT4_GENERATE_MOC(inputfile outputfile )
11873 creates a rule to run moc on infile and create outfile.
11874 Use this if for some reason QT4_WRAP_CPP() isn't appropriate, e.g.
11875 because you need a custom filename for the moc file or something similar.
11876
11877
11878
11879
11880 macro QT4_AUTOMOC(sourcefile1 sourcefile2 ... )
11881 This macro is still experimental.
11882 It can be used to have moc automatically handled.
11883 So if you have the files foo.h and foo.cpp, and in foo.h a
11884 a class uses the Q_OBJECT macro, moc has to run on it. If you don't
11885 want to use QT4_WRAP_CPP() (which is reliable and mature), you can insert
11886 #include "foo.moc"
11887 in foo.cpp and then give foo.cpp as argument to QT4_AUTOMOC(). This will the
11888 scan all listed files at cmake-time for such included moc files and if it finds
11889 them cause a rule to be generated to run moc at build time on the
11890 accompanying header file foo.h.
11891 If a source file has the SKIP_AUTOMOC property set it will be ignored by this macro.
11892
11893
11894
11895
11896 macro QT4_ADD_DBUS_INTERFACE(outfiles interface basename)
11897 create a the interface header and implementation files with the
11898 given basename from the given interface xml file and add it to
11899 the list of sources
11900
11901
11902
11903
11904 macro QT4_ADD_DBUS_INTERFACES(outfiles inputfile ... )
11905 create the interface header and implementation files
11906 for all listed interface xml files
11907 the name will be automatically determined from the name of the xml file
11908
11909
11910
11911
11912 macro QT4_ADD_DBUS_ADAPTOR(outfiles xmlfile parentheader parentclassname [basename] [classname])
11913 create a dbus adaptor (header and implementation file) from the xml file
11914 describing the interface, and add it to the list of sources. The adaptor
11915 forwards the calls to a parent class, defined in parentheader and named
11916 parentclassname. The name of the generated files will be
11917 <basename>adaptor.{cpp,h} where basename defaults to the basename of the xml file.
11918 If <classname> is provided, then it will be used as the classname of the
11919 adaptor itself.
11920
11921
11922
11923
11924 macro QT4_GENERATE_DBUS_INTERFACE( header [interfacename] OPTIONS ...)
11925 generate the xml interface file from the given header.
11926 If the optional argument interfacename is omitted, the name of the
11927 interface file is constructed from the basename of the header with
11928 the suffix .xml appended.
11929 Options may be given to qdbuscpp2xml, such as those found when executing "qdbuscpp2xml --help"
11930
11931
11932
11933
11934 macro QT4_CREATE_TRANSLATION( qm_files directories ... sources ...
11935 ts_files ... OPTIONS ...)
11936 out: qm_files
11937 in: directories sources ts_files
11938 options: flags to pass to lupdate, such as -extensions to specify
11939 extensions for a directory scan.
11940 generates commands to create .ts (vie lupdate) and .qm
11941 (via lrelease) - files from directories and/or sources. The ts files are
11942 created and/or updated in the source tree (unless given with full paths).
11943 The qm files are generated in the build tree.
11944 Updating the translations can be done by adding the qm_files
11945 to the source list of your library/executable, so they are
11946 always updated, or by adding a custom target to control when
11947 they get updated/generated.
11948
11949
11950
11951
11952 macro QT4_ADD_TRANSLATION( qm_files ts_files ... )
11953 out: qm_files
11954 in: ts_files
11955 generates commands to create .qm from .ts - files. The generated
11956 filenames can be found in qm_files. The ts_files
11957 must exists and are not updated in any way.
11958
11959
11960
11961
11962
11963
11964
11965 Below is a detailed list of variables that FindQt4.cmake sets.
11966 QT_FOUND If false, don't try to use Qt.
11967 QT4_FOUND If false, don't try to use Qt 4.
11968
11969
11970
11971
11972 QT_VERSION_MAJOR The major version of Qt found.
11973 QT_VERSION_MINOR The minor version of Qt found.
11974 QT_VERSION_PATCH The patch version of Qt found.
11975
11976
11977
11978
11979 QT_EDITION Set to the edition of Qt (i.e. DesktopLight)
11980 QT_EDITION_DESKTOPLIGHT True if QT_EDITION == DesktopLight
11981 QT_QTCORE_FOUND True if QtCore was found.
11982 QT_QTGUI_FOUND True if QtGui was found.
11983 QT_QT3SUPPORT_FOUND True if Qt3Support was found.
11984 QT_QTASSISTANT_FOUND True if QtAssistant was found.
11985 QT_QTASSISTANTCLIENT_FOUND True if QtAssistantClient was found.
11986 QT_QAXCONTAINER_FOUND True if QAxContainer was found (Windows only).
11987 QT_QAXSERVER_FOUND True if QAxServer was found (Windows only).
11988 QT_QTDBUS_FOUND True if QtDBus was found.
11989 QT_QTDESIGNER_FOUND True if QtDesigner was found.
11990 QT_QTDESIGNERCOMPONENTS True if QtDesignerComponents was found.
11991 QT_QTHELP_FOUND True if QtHelp was found.
11992 QT_QTMOTIF_FOUND True if QtMotif was found.
11993 QT_QTMULTIMEDIA_FOUND True if QtMultimedia was found (since Qt 4.6.0).
11994 QT_QTNETWORK_FOUND True if QtNetwork was found.
11995 QT_QTNSPLUGIN_FOUND True if QtNsPlugin was found.
11996 QT_QTOPENGL_FOUND True if QtOpenGL was found.
11997 QT_QTSQL_FOUND True if QtSql was found.
11998 QT_QTSVG_FOUND True if QtSvg was found.
11999 QT_QTSCRIPT_FOUND True if QtScript was found.
12000 QT_QTSCRIPTTOOLS_FOUND True if QtScriptTools was found.
12001 QT_QTTEST_FOUND True if QtTest was found.
12002 QT_QTUITOOLS_FOUND True if QtUiTools was found.
12003 QT_QTWEBKIT_FOUND True if QtWebKit was found.
12004 QT_QTXML_FOUND True if QtXml was found.
12005 QT_QTXMLPATTERNS_FOUND True if QtXmlPatterns was found.
12006 QT_PHONON_FOUND True if phonon was found.
12007 QT_QTDECLARATIVE_FOUND True if QtDeclarative was found.
12008
12009
12010
12011
12012 QT_MAC_USE_COCOA For Mac OS X, its whether Cocoa or Carbon is used.
12013 In general, this should not be used, but its useful
12014 when having platform specific code.
12015
12016
12017
12018
12019 QT_DEFINITIONS Definitions to use when compiling code that uses Qt.
12020 You do not need to use this if you include QT_USE_FILE.
12021 The QT_USE_FILE will also define QT_DEBUG and QT_NO_DEBUG
12022 to fit your current build type. Those are not contained
12023 in QT_DEFINITIONS.
12024
12025 QT_INCLUDES List of paths to all include directories of
12026 Qt4 QT_INCLUDE_DIR and QT_QTCORE_INCLUDE_DIR are
12027 always in this variable even if NOTFOUND,
12028 all other INCLUDE_DIRS are
12029 only added if they are found.
12030 You do not need to use this if you include QT_USE_FILE.
12031
12032
12033
12034
12035
12036 Include directories for the Qt modules are listed here.
12037 You do not need to use these variables if you include QT_USE_FILE.
12038
12039
12040
12041
12042 QT_INCLUDE_DIR Path to "include" of Qt4
12043 QT_QT3SUPPORT_INCLUDE_DIR Path to "include/Qt3Support"
12044 QT_QTASSISTANT_INCLUDE_DIR Path to "include/QtAssistant"
12045 QT_QTASSISTANTCLIENT_INCLUDE_DIR Path to "include/QtAssistant"
12046 QT_QAXCONTAINER_INCLUDE_DIR Path to "include/ActiveQt" (Windows only)
12047 QT_QAXSERVER_INCLUDE_DIR Path to "include/ActiveQt" (Windows only)
12048 QT_QTCORE_INCLUDE_DIR Path to "include/QtCore"
12049 QT_QTDBUS_INCLUDE_DIR Path to "include/QtDBus"
12050 QT_QTDESIGNER_INCLUDE_DIR Path to "include/QtDesigner"
12051 QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR Path to "include/QtDesigner"
12052 QT_QTGUI_INCLUDE_DIR Path to "include/QtGui"
12053 QT_QTHELP_INCLUDE_DIR Path to "include/QtHelp"
12054 QT_QTMOTIF_INCLUDE_DIR Path to "include/QtMotif"
12055 QT_QTMULTIMEDIA_INCLUDE_DIR Path to "include/QtMultimedia"
12056 QT_QTNETWORK_INCLUDE_DIR Path to "include/QtNetwork"
12057 QT_QTNSPLUGIN_INCLUDE_DIR Path to "include/QtNsPlugin"
12058 QT_QTOPENGL_INCLUDE_DIR Path to "include/QtOpenGL"
12059 QT_QTSCRIPT_INCLUDE_DIR Path to "include/QtScript"
12060 QT_QTSQL_INCLUDE_DIR Path to "include/QtSql"
12061 QT_QTSVG_INCLUDE_DIR Path to "include/QtSvg"
12062 QT_QTTEST_INCLUDE_DIR Path to "include/QtTest"
12063 QT_QTWEBKIT_INCLUDE_DIR Path to "include/QtWebKit"
12064 QT_QTXML_INCLUDE_DIR Path to "include/QtXml"
12065 QT_QTXMLPATTERNS_INCLUDE_DIR Path to "include/QtXmlPatterns"
12066 QT_PHONON_INCLUDE_DIR Path to "include/phonon"
12067 QT_QTSCRIPTTOOLS_INCLUDE_DIR Path to "include/QtScriptTools"
12068 QT_QTDECLARATIVE_INCLUDE_DIR Path to "include/QtDeclarative"
12069
12070
12071
12072
12073 QT_BINARY_DIR Path to "bin" of Qt4
12074 QT_LIBRARY_DIR Path to "lib" of Qt4
12075 QT_PLUGINS_DIR Path to "plugins" for Qt4
12076 QT_TRANSLATIONS_DIR Path to "translations" of Qt4
12077 QT_IMPORTS_DIR Path to "imports" of Qt4
12078 QT_DOC_DIR Path to "doc" of Qt4
12079 QT_MKSPECS_DIR Path to "mkspecs" of Qt4
12080
12081
12082
12083
12084
12085
12086
12087 The Qt toolkit may contain both debug and release libraries. In
12088 that case, the following library variables will contain both.
12089 You do not need to use these variables if you include
12090 QT_USE_FILE, and use QT_LIBRARIES.
12091
12092
12093 QT_QT3SUPPORT_LIBRARY The Qt3Support library
12094 QT_QTASSISTANT_LIBRARY The QtAssistant library
12095 QT_QTASSISTANTCLIENT_LIBRARY The QtAssistantClient library
12096 QT_QAXCONTAINER_LIBRARY The QAxContainer library (Windows only)
12097 QT_QAXSERVER_LIBRARY The QAxServer library (Windows only)
12098 QT_QTCORE_LIBRARY The QtCore library
12099 QT_QTDBUS_LIBRARY The QtDBus library
12100 QT_QTDESIGNER_LIBRARY The QtDesigner library
12101 QT_QTDESIGNERCOMPONENTS_LIBRARY The QtDesignerComponents library
12102 QT_QTGUI_LIBRARY The QtGui library
12103 QT_QTHELP_LIBRARY The QtHelp library
12104 QT_QTMOTIF_LIBRARY The QtMotif library
12105 QT_QTMULTIMEDIA_LIBRARY The QtMultimedia library
12106 QT_QTNETWORK_LIBRARY The QtNetwork library
12107 QT_QTNSPLUGIN_LIBRARY The QtNsPLugin library
12108 QT_QTOPENGL_LIBRARY The QtOpenGL library
12109 QT_QTSCRIPT_LIBRARY The QtScript library
12110 QT_QTSQL_LIBRARY The QtSql library
12111 QT_QTSVG_LIBRARY The QtSvg library
12112 QT_QTTEST_LIBRARY The QtTest library
12113 QT_QTUITOOLS_LIBRARY The QtUiTools library
12114 QT_QTWEBKIT_LIBRARY The QtWebKit library
12115 QT_QTXML_LIBRARY The QtXml library
12116 QT_QTXMLPATTERNS_LIBRARY The QtXmlPatterns library
12117 QT_QTMAIN_LIBRARY The qtmain library for Windows
12118 QT_PHONON_LIBRARY The phonon library
12119 QT_QTSCRIPTTOOLS_LIBRARY The QtScriptTools library
12120
12121
12122 The QtDeclarative library: QT_QTDECLARATIVE_LIBRARY
12123
12124
12125 also defined, but NOT for general use are
12126
12127
12128 QT_MOC_EXECUTABLE Where to find the moc tool.
12129 QT_UIC_EXECUTABLE Where to find the uic tool.
12130 QT_UIC3_EXECUTABLE Where to find the uic3 tool.
12131 QT_RCC_EXECUTABLE Where to find the rcc tool
12132 QT_DBUSCPP2XML_EXECUTABLE Where to find the qdbuscpp2xml tool.
12133 QT_DBUSXML2CPP_EXECUTABLE Where to find the qdbusxml2cpp tool.
12134 QT_LUPDATE_EXECUTABLE Where to find the lupdate tool.
12135 QT_LRELEASE_EXECUTABLE Where to find the lrelease tool.
12136 QT_QCOLLECTIONGENERATOR_EXECUTABLE Where to find the qcollectiongenerator tool.
12137 QT_DESIGNER_EXECUTABLE Where to find the Qt designer tool.
12138 QT_LINGUIST_EXECUTABLE Where to find the Qt linguist tool.
12139
12140
12141
12142
12143
12144 These are around for backwards compatibility they will be set
12145
12146
12147 QT_WRAP_CPP Set true if QT_MOC_EXECUTABLE is found
12148 QT_WRAP_UI Set true if QT_UIC_EXECUTABLE is found
12149
12150
12151 These variables do _NOT_ have any effect anymore (compared to
12152 FindQt.cmake)
12153
12154
12155 QT_MT_REQUIRED Qt4 is now always multithreaded
12156
12157
12158 These variables are set to "" Because Qt structure changed
12159 (They make no sense in Qt4)
12160
12161
12162 QT_QT_LIBRARY Qt-Library is now split
12163
12164
12165 FindQuickTime
12166
12167
12168 Locate QuickTime This module defines QUICKTIME_LIBRARY QUICK‐
12169 TIME_FOUND, if false, do not try to link to gdal QUICK‐
12170 TIME_INCLUDE_DIR, where to find the headers
12171
12172
12173 $QUICKTIME_DIR is an environment variable that would correspond
12174 to the ./configure --prefix=$QUICKTIME_DIR
12175
12176
12177 Created by Eric Wing.
12178
12179
12180 FindRTI
12181 Try to find M&S HLA RTI libraries
12182
12183 This module finds if any HLA RTI is installed and locates the
12184 standard RTI include files and libraries.
12185
12186
12187 RTI is a simulation infrastructure standardized by IEEE and
12188 SISO. It has a well defined C++ API that assures that simulation
12189 applications are independent on a particular RTI implementation.
12190
12191
12192 http://en.wikipedia.org/wiki/Run-Time_Infrastructure_(simulation)
12193
12194
12195
12196
12197 This code sets the following variables:
12198
12199
12200 RTI_INCLUDE_DIR = the directory where RTI includes file are found
12201 RTI_LIBRARIES = The libraries to link against to use RTI
12202 RTI_DEFINITIONS = -DRTI_USES_STD_FSTREAM
12203 RTI_FOUND = Set to FALSE if any HLA RTI was not found
12204
12205
12206
12207
12208 Report problems to <certi-devel@nongnu.org>
12209
12210
12211 FindRuby
12212 Find Ruby
12213
12214 This module finds if Ruby is installed and determines where the
12215 include files and libraries are. Ruby 1.8 and 1.9 are supported.
12216
12217
12218 The minimum required version of Ruby can be specified using the
12219 standard syntax, e.g. FIND_PACKAGE(Ruby 1.8)
12220
12221
12222 It also determines what the name of the library is. This code
12223 sets the following variables:
12224
12225
12226 RUBY_EXECUTABLE = full path to the ruby binary
12227 RUBY_INCLUDE_DIRS = include dirs to be used when using the ruby library
12228 RUBY_LIBRARY = full path to the ruby library
12229 RUBY_VERSION = the version of ruby which was found, e.g. "1.8.7"
12230 RUBY_FOUND = set to true if ruby ws found successfully
12231
12232
12233
12234
12235 RUBY_INCLUDE_PATH = same as RUBY_INCLUDE_DIRS, only provided for compatibility reasons, don't use it
12236
12237
12238 FindSDL
12239
12240
12241 Locate SDL library This module defines SDL_LIBRARY, the name of
12242 the library to link against SDL_FOUND, if false, do not try to
12243 link to SDL SDL_INCLUDE_DIR, where to find SDL.h
12244
12245
12246 This module responds to the the flag: SDL_BUILDING_LIBRARY If
12247 this is defined, then no SDL_main will be linked in because
12248 only applications need main(). Otherwise, it is assumed you are
12249 building an application and this module will attempt to locate
12250 and set the the proper link flags as part of the returned
12251 SDL_LIBRARY variable.
12252
12253
12254 Don't forget to include SDLmain.h and SDLmain.m your project for
12255 the OS X framework based version. (Other versions link to
12256 -lSDLmain which this module will try to find on your behalf.)
12257 Also for OS X, this module will automatically add the -frame‐
12258 work Cocoa on your behalf.
12259
12260
12261
12262
12263
12264 Additional Note: If you see an empty SDL_LIBRARY_TEMP in your
12265 configuration and no SDL_LIBRARY, it means CMake did not find
12266 your SDL library (SDL.dll, libsdl.so, SDL.framework, etc). Set
12267 SDL_LIBRARY_TEMP to point to your SDL library, and configure
12268 again. Similarly, if you see an empty SDLMAIN_LIBRARY, you
12269 should set this value as appropriate. These values are used to
12270 generate the final SDL_LIBRARY variable, but when these values
12271 are unset, SDL_LIBRARY does not get created.
12272
12273
12274
12275
12276
12277 $SDLDIR is an environment variable that would correspond to the
12278 ./configure --prefix=$SDLDIR used in building SDL. l.e.galup
12279 9-20-02
12280
12281
12282 Modified by Eric Wing. Added code to assist with automated
12283 building by using environmental variables and providing a more
12284 controlled/consistent search behavior. Added new modifications
12285 to recognize OS X frameworks and additional Unix paths (Free‐
12286 BSD, etc). Also corrected the header search path to follow
12287 "proper" SDL guidelines. Added a search for SDLmain which is
12288 needed by some platforms. Added a search for threads which is
12289 needed by some platforms. Added needed compile switches for
12290 MinGW.
12291
12292
12293 On OSX, this will prefer the Framework version (if found) over
12294 others. People will have to manually change the cache values of
12295 SDL_LIBRARY to override this selection or set the CMake environ‐
12296 ment CMAKE_INCLUDE_PATH to modify the search paths.
12297
12298
12299 Note that the header path has changed from SDL/SDL.h to just
12300 SDL.h This needed to change because "proper" SDL convention is
12301 #include "SDL.h", not <SDL/SDL.h>. This is done for portability
12302 reasons because not all systems place things in SDL/ (see Free‐
12303 BSD).
12304
12305
12306 FindSDL_image
12307
12308
12309 Locate SDL_image library This module defines SDLIMAGE_LIBRARY,
12310 the name of the library to link against SDLIMAGE_FOUND, if
12311 false, do not try to link to SDL SDLIMAGE_INCLUDE_DIR, where to
12312 find SDL/SDL.h
12313
12314
12315 $SDLDIR is an environment variable that would correspond to the
12316 ./configure --prefix=$SDLDIR used in building SDL.
12317
12318
12319 Created by Eric Wing. This was influenced by the FindSDL.cmake
12320 module, but with modifications to recognize OS X frameworks and
12321 additional Unix paths (FreeBSD, etc).
12322
12323
12324 FindSDL_mixer
12325
12326
12327 Locate SDL_mixer library This module defines SDLMIXER_LIBRARY,
12328 the name of the library to link against SDLMIXER_FOUND, if
12329 false, do not try to link to SDL SDLMIXER_INCLUDE_DIR, where to
12330 find SDL/SDL.h
12331
12332
12333 $SDLDIR is an environment variable that would correspond to the
12334 ./configure --prefix=$SDLDIR used in building SDL.
12335
12336
12337 Created by Eric Wing. This was influenced by the FindSDL.cmake
12338 module, but with modifications to recognize OS X frameworks and
12339 additional Unix paths (FreeBSD, etc).
12340
12341
12342 FindSDL_net
12343
12344
12345 Locate SDL_net library This module defines SDLNET_LIBRARY, the
12346 name of the library to link against SDLNET_FOUND, if false, do
12347 not try to link against SDLNET_INCLUDE_DIR, where to find the
12348 headers
12349
12350
12351 $SDLDIR is an environment variable that would correspond to the
12352 ./configure --prefix=$SDLDIR used in building SDL.
12353
12354
12355 Created by Eric Wing. This was influenced by the FindSDL.cmake
12356 module, but with modifications to recognize OS X frameworks and
12357 additional Unix paths (FreeBSD, etc).
12358
12359
12360 FindSDL_sound
12361
12362
12363 Locates the SDL_sound library
12364
12365
12366 FindSDL_ttf
12367
12368
12369 Locate SDL_ttf library This module defines SDLTTF_LIBRARY, the
12370 name of the library to link against SDLTTF_FOUND, if false, do
12371 not try to link to SDL SDLTTF_INCLUDE_DIR, where to find
12372 SDL/SDL.h
12373
12374
12375 $SDLDIR is an environment variable that would correspond to the
12376 ./configure --prefix=$SDLDIR used in building SDL.
12377
12378
12379 Created by Eric Wing. This was influenced by the FindSDL.cmake
12380 module, but with modifications to recognize OS X frameworks and
12381 additional Unix paths (FreeBSD, etc).
12382
12383
12384 FindSWIG
12385 Find SWIG
12386
12387 This module finds an installed SWIG. It sets the following
12388 variables:
12389
12390
12391 SWIG_FOUND - set to true if SWIG is found
12392 SWIG_DIR - the directory where swig is installed
12393 SWIG_EXECUTABLE - the path to the swig executable
12394 SWIG_VERSION - the version number of the swig executable
12395
12396
12397
12398
12399 The minimum required version of SWIG can be specified using the
12400 standard syntax, e.g. FIND_PACKAGE(SWIG 1.1)
12401
12402
12403 All information is collected from the SWIG_EXECUTABLE so the
12404 version to be found can be changed from the command line by
12405 means of setting SWIG_EXECUTABLE
12406
12407
12408
12409 FindSelfPackers
12410 Find upx
12411
12412 This module looks for some executable packers (i.e. softwares
12413 that compress executables or shared libs into on-the-fly
12414 self-extracting executables or shared libs. Examples:
12415
12416
12417 UPX: http://wildsau.idv.uni-linz.ac.at/mfx/upx.html
12418
12419
12420 FindSquish
12421 -- Typical Use
12422
12423
12424
12425
12426 This module can be used to find Squish (currently support is
12427 aimed at version 3).
12428
12429
12430 SQUISH_FOUND If false, don't try to use Squish
12431
12432
12433
12434
12435 SQUISH_INSTALL_DIR The Squish installation directory (containing bin, lib, etc)
12436 SQUISH_SERVER_EXECUTABLE The squishserver executable
12437 SQUISH_CLIENT_EXECUTABLE The squishrunner executable
12438
12439
12440
12441
12442 SQUISH_INSTALL_DIR_FOUND Was the install directory found?
12443 SQUISH_SERVER_EXECUTABLE_FOUND Was the server executable found?
12444 SQUISH_CLIENT_EXECUTABLE_FOUND Was the client executable found?
12445
12446
12447
12448
12449 macro SQUISH_ADD_TEST(testName applicationUnderTest testSuite
12450 testCase)
12451
12452
12453 ENABLE_TESTING()
12454 FIND_PACKAGE(Squish)
12455 IF (SQUISH_FOUND)
12456 SQUISH_ADD_TEST(myTestName myApplication testSuiteName testCaseName)
12457 ENDIF (SQUISH_FOUND)
12458
12459
12460
12461
12462
12463 FindSubversion
12464 Extract information from a subversion working copy
12465
12466 The module defines the following variables:
12467
12468
12469 Subversion_SVN_EXECUTABLE - path to svn command line client
12470 Subversion_VERSION_SVN - version of svn command line client
12471 Subversion_FOUND - true if the command line client was found
12472 SUBVERSION_FOUND - same as Subversion_FOUND, set for compatiblity reasons
12473
12474
12475
12476
12477 The minimum required version of Subversion can be specified
12478 using the standard syntax, e.g. FIND_PACKAGE(Subversion 1.4)
12479
12480
12481 If the command line client executable is found two macros are
12482 defined:
12483
12484
12485 Subversion_WC_INFO(<dir> <var-prefix>)
12486 Subversion_WC_LOG(<dir> <var-prefix>)
12487
12488 Subversion_WC_INFO extracts information of a subversion working
12489 copy at a given location. This macro defines the following vari‐
12490 ables:
12491
12492
12493 <var-prefix>_WC_URL - url of the repository (at <dir>)
12494 <var-prefix>_WC_ROOT - root url of the repository
12495 <var-prefix>_WC_REVISION - current revision
12496 <var-prefix>_WC_LAST_CHANGED_AUTHOR - author of last commit
12497 <var-prefix>_WC_LAST_CHANGED_DATE - date of last commit
12498 <var-prefix>_WC_LAST_CHANGED_REV - revision of last commit
12499 <var-prefix>_WC_INFO - output of command `svn info <dir>'
12500
12501 Subversion_WC_LOG retrieves the log message of the base revision
12502 of a subversion working copy at a given location. This macro
12503 defines the variable:
12504
12505
12506 <var-prefix>_LAST_CHANGED_LOG - last log of base revision
12507
12508 Example usage:
12509
12510
12511 FIND_PACKAGE(Subversion)
12512 IF(SUBVERSION_FOUND)
12513 Subversion_WC_INFO(${PROJECT_SOURCE_DIR} Project)
12514 MESSAGE("Current revision is ${Project_WC_REVISION}")
12515 Subversion_WC_LOG(${PROJECT_SOURCE_DIR} Project)
12516 MESSAGE("Last changed log is ${Project_LAST_CHANGED_LOG}")
12517 ENDIF(SUBVERSION_FOUND)
12518
12519
12520 FindTCL
12521 TK_INTERNAL_PATH was removed.
12522
12523 This module finds if Tcl is installed and determines where the
12524 include files and libraries are. It also determines what the
12525 name of the library is. This code sets the following variables:
12526
12527
12528 TCL_FOUND = Tcl was found
12529 TK_FOUND = Tk was found
12530 TCLTK_FOUND = Tcl and Tk were found
12531 TCL_LIBRARY = path to Tcl library (tcl tcl80)
12532 TCL_INCLUDE_PATH = path to where tcl.h can be found
12533 TCL_TCLSH = path to tclsh binary (tcl tcl80)
12534 TK_LIBRARY = path to Tk library (tk tk80 etc)
12535 TK_INCLUDE_PATH = path to where tk.h can be found
12536 TK_WISH = full path to the wish executable
12537
12538
12539
12540
12541 In an effort to remove some clutter and clear up some issues for
12542 people who are not necessarily Tcl/Tk gurus/developpers, some
12543 variables were moved or removed. Changes compared to CMake 2.4
12544 are:
12545
12546
12547 => they were only useful for people writing Tcl/Tk extensions.
12548 => these libs are not packaged by default with Tcl/Tk distributions.
12549 Even when Tcl/Tk is built from source, several flavors of debug libs
12550 are created and there is no real reason to pick a single one
12551 specifically (say, amongst tcl84g, tcl84gs, or tcl84sgx).
12552 Let's leave that choice to the user by allowing him to assign
12553 TCL_LIBRARY to any Tcl library, debug or not.
12554 => this ended up being only a Win32 variable, and there is a lot of
12555 confusion regarding the location of this file in an installed Tcl/Tk
12556 tree anyway (see 8.5 for example). If you need the internal path at
12557 this point it is safer you ask directly where the *source* tree is
12558 and dig from there.
12559
12560
12561 FindTIFF
12562 Find TIFF library
12563
12564 Find the native TIFF includes and library This module defines
12565
12566
12567 TIFF_INCLUDE_DIR, where to find tiff.h, etc.
12568 TIFF_LIBRARIES, libraries to link against to use TIFF.
12569 TIFF_FOUND, If false, do not try to use TIFF.
12570
12571 also defined, but not for general use are
12572
12573
12574 TIFF_LIBRARY, where to find the TIFF library.
12575
12576
12577 FindTclStub
12578 TCL_STUB_LIBRARY_DEBUG and TK_STUB_LIBRARY_DEBUG were removed.
12579
12580 This module finds Tcl stub libraries. It first finds Tcl include
12581 files and libraries by calling FindTCL.cmake. How to Use the Tcl
12582 Stubs Library:
12583
12584
12585 http://tcl.activestate.com/doc/howto/stubs.html
12586
12587 Using Stub Libraries:
12588
12589
12590 http://safari.oreilly.com/0130385603/ch48lev1sec3
12591
12592 This code sets the following variables:
12593
12594
12595 TCL_STUB_LIBRARY = path to Tcl stub library
12596 TK_STUB_LIBRARY = path to Tk stub library
12597 TTK_STUB_LIBRARY = path to ttk stub library
12598
12599
12600
12601
12602 In an effort to remove some clutter and clear up some issues for
12603 people who are not necessarily Tcl/Tk gurus/developpers, some
12604 variables were moved or removed. Changes compared to CMake 2.4
12605 are:
12606
12607
12608 => these libs are not packaged by default with Tcl/Tk distributions.
12609 Even when Tcl/Tk is built from source, several flavors of debug libs
12610 are created and there is no real reason to pick a single one
12611 specifically (say, amongst tclstub84g, tclstub84gs, or tclstub84sgx).
12612 Let's leave that choice to the user by allowing him to assign
12613 TCL_STUB_LIBRARY to any Tcl library, debug or not.
12614
12615
12616 FindTclsh
12617 Find tclsh
12618
12619 This module finds if TCL is installed and determines where the
12620 include files and libraries are. It also determines what the
12621 name of the library is. This code sets the following variables:
12622
12623
12624 TCLSH_FOUND = TRUE if tclsh has been found
12625 TCL_TCLSH = the path to the tclsh executable
12626
12627 In cygwin, look for the cygwin version first. Don't look for it
12628 later to avoid finding the cygwin version on a Win32 build.
12629
12630
12631 FindThreads
12632 This module determines the thread library of the system.
12633
12634 The following variables are set
12635
12636
12637 CMAKE_THREAD_LIBS_INIT - the thread library
12638 CMAKE_USE_SPROC_INIT - are we using sproc?
12639 CMAKE_USE_WIN32_THREADS_INIT - using WIN32 threads?
12640 CMAKE_USE_PTHREADS_INIT - are we using pthreads
12641 CMAKE_HP_PTHREADS_INIT - are we using hp pthreads
12642
12643 For systems with multiple thread libraries, caller can set
12644
12645
12646 CMAKE_THREAD_PREFER_PTHREAD
12647
12648
12649 FindUnixCommands
12650 Find unix commands from cygwin
12651
12652 This module looks for some usual Unix commands.
12653
12654
12655
12656 FindVTK
12657 Find a VTK installation or build tree.
12658
12659 The following variables are set if VTK is found. If VTK is not
12660 found, VTK_FOUND is set to false.
12661
12662
12663 VTK_FOUND - Set to true when VTK is found.
12664 VTK_USE_FILE - CMake file to use VTK.
12665 VTK_MAJOR_VERSION - The VTK major version number.
12666 VTK_MINOR_VERSION - The VTK minor version number
12667 (odd non-release).
12668 VTK_BUILD_VERSION - The VTK patch level
12669 (meaningless for odd minor).
12670 VTK_INCLUDE_DIRS - Include directories for VTK
12671 VTK_LIBRARY_DIRS - Link directories for VTK libraries
12672 VTK_KITS - List of VTK kits, in CAPS
12673 (COMMON,IO,) etc.
12674 VTK_LANGUAGES - List of wrapped languages, in CAPS
12675 (TCL, PYHTON,) etc.
12676
12677 The following cache entries must be set by the user to locate
12678 VTK:
12679
12680
12681 VTK_DIR - The directory containing VTKConfig.cmake.
12682 This is either the root of the build tree,
12683 or the lib/vtk directory. This is the
12684 only cache entry.
12685
12686 The following variables are set for backward compatibility and
12687 should not be used in new code:
12688
12689
12690 USE_VTK_FILE - The full path to the UseVTK.cmake file.
12691 This is provided for backward
12692 compatibility. Use VTK_USE_FILE
12693 instead.
12694
12695
12696
12697
12698
12699 FindWget
12700 Find wget
12701
12702 This module looks for wget. This module defines the following
12703 values:
12704
12705
12706 WGET_EXECUTABLE: the full path to the wget tool.
12707 WGET_FOUND: True if wget has been found.
12708
12709
12710 FindWish
12711 Find wish installation
12712
12713 This module finds if TCL is installed and determines where the
12714 include files and libraries are. It also determines what the
12715 name of the library is. This code sets the following variables:
12716
12717
12718 TK_WISH = the path to the wish executable
12719
12720
12721
12722
12723 if UNIX is defined, then it will look for the cygwin version
12724 first
12725
12726
12727 FindX11
12728 Find X11 installation
12729
12730 Try to find X11 on UNIX systems. The following values are
12731 defined
12732
12733
12734 X11_FOUND - True if X11 is available
12735 X11_INCLUDE_DIR - include directories to use X11
12736 X11_LIBRARIES - link against these to use X11
12737
12738
12739
12740
12741 and also the following more fine grained variables: Include
12742 paths: X11_ICE_INCLUDE_PATH, X11_ICE_LIB,
12743 X11_ICE_FOUND
12744
12745
12746 X11_X11_INCLUDE_PATH, X11_X11_LIB
12747 X11_Xaccessrules_INCLUDE_PATH, X11_Xaccess_FOUND
12748 X11_Xaccessstr_INCLUDE_PATH, X11_Xaccess_FOUND
12749 X11_Xau_INCLUDE_PATH, X11_Xau_LIB, X11_Xau_FOUND
12750 X11_Xcomposite_INCLUDE_PATH, X11_Xcomposite_LIB, X11_Xcomposite_FOUND
12751 X11_Xcursor_INCLUDE_PATH, X11_Xcursor_LIB, X11_Xcursor_FOUND
12752 X11_Xdamage_INCLUDE_PATH, X11_Xdamage_LIB, X11_Xdamage_FOUND
12753 X11_Xdmcp_INCLUDE_PATH, X11_Xdmcp_LIB, X11_Xdmcp_FOUND
12754 X11_Xext_LIB, X11_Xext_FOUND
12755 X11_dpms_INCLUDE_PATH, (in X11_Xext_LIB), X11_dpms_FOUND
12756 X11_XShm_INCLUDE_PATH, (in X11_Xext_LIB), X11_XShm_FOUND
12757 X11_Xshape_INCLUDE_PATH, (in X11_Xext_LIB), X11_Xshape_FOUND
12758 X11_xf86misc_INCLUDE_PATH, X11_Xxf86misc_LIB, X11_xf86misc_FOUND
12759 X11_xf86vmode_INCLUDE_PATH, X11_xf86vmode_FOUND
12760 X11_Xfixes_INCLUDE_PATH, X11_Xfixes_LIB, X11_Xfixes_FOUND
12761 X11_Xft_INCLUDE_PATH, X11_Xft_LIB, X11_Xft_FOUND
12762 X11_Xi_INCLUDE_PATH, X11_Xi_LIB, X11_Xi_FOUND
12763 X11_Xinerama_INCLUDE_PATH, X11_Xinerama_LIB, X11_Xinerama_FOUND
12764 X11_Xinput_INCLUDE_PATH, X11_Xinput_LIB, X11_Xinput_FOUND
12765 X11_Xkb_INCLUDE_PATH, X11_Xkb_FOUND
12766 X11_Xkblib_INCLUDE_PATH, X11_Xkb_FOUND
12767 X11_Xpm_INCLUDE_PATH, X11_Xpm_LIB, X11_Xpm_FOUND
12768 X11_XTest_INCLUDE_PATH, X11_XTest_LIB, X11_XTest_FOUND
12769 X11_Xrandr_INCLUDE_PATH, X11_Xrandr_LIB, X11_Xrandr_FOUND
12770 X11_Xrender_INCLUDE_PATH, X11_Xrender_LIB, X11_Xrender_FOUND
12771 X11_Xscreensaver_INCLUDE_PATH, X11_Xscreensaver_LIB, X11_Xscreensaver_FOUND
12772 X11_Xt_INCLUDE_PATH, X11_Xt_LIB, X11_Xt_FOUND
12773 X11_Xutil_INCLUDE_PATH, X11_Xutil_FOUND
12774 X11_Xv_INCLUDE_PATH, X11_Xv_LIB, X11_Xv_FOUND
12775
12776
12777 FindXMLRPC
12778 Find xmlrpc
12779
12780 Find the native XMLRPC headers and libraries.
12781
12782
12783 XMLRPC_INCLUDE_DIRS - where to find xmlrpc.h, etc.
12784 XMLRPC_LIBRARIES - List of libraries when using xmlrpc.
12785 XMLRPC_FOUND - True if xmlrpc found.
12786
12787 XMLRPC modules may be specified as components for this find mod‐
12788 ule. Modules may be listed by running "xmlrpc-c-config". Mod‐
12789 ules include:
12790
12791
12792 c++ C++ wrapper code
12793 libwww-client libwww-based client
12794 cgi-server CGI-based server
12795 abyss-server ABYSS-based server
12796
12797 Typical usage:
12798
12799
12800 FIND_PACKAGE(XMLRPC REQUIRED libwww-client)
12801
12802
12803 FindZLIB
12804 Find zlib
12805
12806 Find the native ZLIB includes and library. Once done this will
12807 define
12808
12809
12810 ZLIB_INCLUDE_DIRS - where to find zlib.h, etc.
12811 ZLIB_LIBRARIES - List of libraries when using zlib.
12812 ZLIB_FOUND - True if zlib found.
12813
12814
12815
12816
12817 ZLIB_VERSION_STRING - The version of zlib found (x.y.z)
12818 ZLIB_VERSION_MAJOR - The major version of zlib
12819 ZLIB_VERSION_MINOR - The minor version of zlib
12820 ZLIB_VERSION_PATCH - The patch version of zlib
12821 ZLIB_VERSION_TWEAK - The tweak version of zlib
12822
12823
12824
12825
12826 The following variable are provided for backward compatibility
12827
12828
12829 ZLIB_MAJOR_VERSION - The major version of zlib
12830 ZLIB_MINOR_VERSION - The minor version of zlib
12831 ZLIB_PATCH_VERSION - The patch version of zlib
12832
12833
12834 Findosg
12835
12836
12837
12838
12839
12840 NOTE: It is highly recommended that you use the new FindOpen‐
12841 SceneGraph.cmake introduced in CMake 2.6.3 and not use this Find
12842 module directly.
12843
12844
12845 This is part of the Findosg* suite used to find OpenSceneGraph
12846 components. Each component is separate and you must opt in to
12847 each module. You must also opt into OpenGL and OpenThreads (and
12848 Producer if needed) as these modules won't do it for you. This
12849 is to allow you control over your own system piece by piece in
12850 case you need to opt out of certain components or change the
12851 Find behavior for a particular module (perhaps because the
12852 default FindOpenGL.cmake module doesn't work with your system as
12853 an example). If you want to use a more convenient module that
12854 includes everything, use the FindOpenSceneGraph.cmake instead of
12855 the Findosg*.cmake modules.
12856
12857
12858 Locate osg This module defines
12859
12860
12861 OSG_FOUND - Was the Osg found? OSG_INCLUDE_DIR - Where to find
12862 the headers OSG_LIBRARIES - The libraries to link against for
12863 the OSG (use this)
12864
12865
12866 OSG_LIBRARY - The OSG library OSG_LIBRARY_DEBUG - The OSG debug
12867 library
12868
12869
12870 $OSGDIR is an environment variable that would correspond to the
12871 ./configure --prefix=$OSGDIR used in building osg.
12872
12873
12874 Created by Eric Wing.
12875
12876
12877 FindosgAnimation
12878
12879
12880 This is part of the Findosg* suite used to find OpenSceneGraph
12881 components. Each component is separate and you must opt in to
12882 each module. You must also opt into OpenGL and OpenThreads (and
12883 Producer if needed) as these modules won't do it for you. This
12884 is to allow you control over your own system piece by piece in
12885 case you need to opt out of certain components or change the
12886 Find behavior for a particular module (perhaps because the
12887 default FindOpenGL.cmake module doesn't work with your system as
12888 an example). If you want to use a more convenient module that
12889 includes everything, use the FindOpenSceneGraph.cmake instead of
12890 the Findosg*.cmake modules.
12891
12892
12893 Locate osgAnimation This module defines
12894
12895
12896 OSGANIMATION_FOUND - Was osgAnimation found? OSGANIMA‐
12897 TION_INCLUDE_DIR - Where to find the headers OSGANIMA‐
12898 TION_LIBRARIES - The libraries to link against for the OSG (use
12899 this)
12900
12901
12902 OSGANIMATION_LIBRARY - The OSG library OSGANIMA‐
12903 TION_LIBRARY_DEBUG - The OSG debug library
12904
12905
12906 $OSGDIR is an environment variable that would correspond to the
12907 ./configure --prefix=$OSGDIR used in building osg.
12908
12909
12910 Created by Eric Wing.
12911
12912
12913 FindosgDB
12914
12915
12916 This is part of the Findosg* suite used to find OpenSceneGraph
12917 components. Each component is separate and you must opt in to
12918 each module. You must also opt into OpenGL and OpenThreads (and
12919 Producer if needed) as these modules won't do it for you. This
12920 is to allow you control over your own system piece by piece in
12921 case you need to opt out of certain components or change the
12922 Find behavior for a particular module (perhaps because the
12923 default FindOpenGL.cmake module doesn't work with your system as
12924 an example). If you want to use a more convenient module that
12925 includes everything, use the FindOpenSceneGraph.cmake instead of
12926 the Findosg*.cmake modules.
12927
12928
12929 Locate osgDB This module defines
12930
12931
12932 OSGDB_FOUND - Was osgDB found? OSGDB_INCLUDE_DIR - Where to find
12933 the headers OSGDB_LIBRARIES - The libraries to link against for
12934 the osgDB (use this)
12935
12936
12937 OSGDB_LIBRARY - The osgDB library OSGDB_LIBRARY_DEBUG - The
12938 osgDB debug library
12939
12940
12941 $OSGDIR is an environment variable that would correspond to the
12942 ./configure --prefix=$OSGDIR used in building osg.
12943
12944
12945 Created by Eric Wing.
12946
12947
12948 FindosgFX
12949
12950
12951 This is part of the Findosg* suite used to find OpenSceneGraph
12952 components. Each component is separate and you must opt in to
12953 each module. You must also opt into OpenGL and OpenThreads (and
12954 Producer if needed) as these modules won't do it for you. This
12955 is to allow you control over your own system piece by piece in
12956 case you need to opt out of certain components or change the
12957 Find behavior for a particular module (perhaps because the
12958 default FindOpenGL.cmake module doesn't work with your system as
12959 an example). If you want to use a more convenient module that
12960 includes everything, use the FindOpenSceneGraph.cmake instead of
12961 the Findosg*.cmake modules.
12962
12963
12964 Locate osgFX This module defines
12965
12966
12967 OSGFX_FOUND - Was osgFX found? OSGFX_INCLUDE_DIR - Where to find
12968 the headers OSGFX_LIBRARIES - The libraries to link against for
12969 the osgFX (use this)
12970
12971
12972 OSGFX_LIBRARY - The osgFX library OSGFX_LIBRARY_DEBUG - The
12973 osgFX debug library
12974
12975
12976 $OSGDIR is an environment variable that would correspond to the
12977 ./configure --prefix=$OSGDIR used in building osg.
12978
12979
12980 Created by Eric Wing.
12981
12982
12983 FindosgGA
12984
12985
12986 This is part of the Findosg* suite used to find OpenSceneGraph
12987 components. Each component is separate and you must opt in to
12988 each module. You must also opt into OpenGL and OpenThreads (and
12989 Producer if needed) as these modules won't do it for you. This
12990 is to allow you control over your own system piece by piece in
12991 case you need to opt out of certain components or change the
12992 Find behavior for a particular module (perhaps because the
12993 default FindOpenGL.cmake module doesn't work with your system as
12994 an example). If you want to use a more convenient module that
12995 includes everything, use the FindOpenSceneGraph.cmake instead of
12996 the Findosg*.cmake modules.
12997
12998
12999 Locate osgGA This module defines
13000
13001
13002 OSGGA_FOUND - Was osgGA found? OSGGA_INCLUDE_DIR - Where to find
13003 the headers OSGGA_LIBRARIES - The libraries to link against for
13004 the osgGA (use this)
13005
13006
13007 OSGGA_LIBRARY - The osgGA library OSGGA_LIBRARY_DEBUG - The
13008 osgGA debug library
13009
13010
13011 $OSGDIR is an environment variable that would correspond to the
13012 ./configure --prefix=$OSGDIR used in building osg.
13013
13014
13015 Created by Eric Wing.
13016
13017
13018 FindosgIntrospection
13019
13020
13021 This is part of the Findosg* suite used to find OpenSceneGraph
13022 components. Each component is separate and you must opt in to
13023 each module. You must also opt into OpenGL and OpenThreads (and
13024 Producer if needed) as these modules won't do it for you. This
13025 is to allow you control over your own system piece by piece in
13026 case you need to opt out of certain components or change the
13027 Find behavior for a particular module (perhaps because the
13028 default FindOpenGL.cmake module doesn't work with your system as
13029 an example). If you want to use a more convenient module that
13030 includes everything, use the FindOpenSceneGraph.cmake instead of
13031 the Findosg*.cmake modules.
13032
13033
13034 Locate osgINTROSPECTION This module defines
13035
13036
13037 OSGINTROSPECTION_FOUND - Was osgIntrospection found? OSGINTRO‐
13038 SPECTION_INCLUDE_DIR - Where to find the headers OSGINTROSPEC‐
13039 TION_LIBRARIES - The libraries to link for osgIntrospection (use
13040 this)
13041
13042
13043 OSGINTROSPECTION_LIBRARY - The osgIntrospection library OSGIN‐
13044 TROSPECTION_LIBRARY_DEBUG - The osgIntrospection debug library
13045
13046
13047 $OSGDIR is an environment variable that would correspond to the
13048 ./configure --prefix=$OSGDIR used in building osg.
13049
13050
13051 Created by Eric Wing.
13052
13053
13054 FindosgManipulator
13055
13056
13057 This is part of the Findosg* suite used to find OpenSceneGraph
13058 components. Each component is separate and you must opt in to
13059 each module. You must also opt into OpenGL and OpenThreads (and
13060 Producer if needed) as these modules won't do it for you. This
13061 is to allow you control over your own system piece by piece in
13062 case you need to opt out of certain components or change the
13063 Find behavior for a particular module (perhaps because the
13064 default FindOpenGL.cmake module doesn't work with your system as
13065 an example). If you want to use a more convenient module that
13066 includes everything, use the FindOpenSceneGraph.cmake instead of
13067 the Findosg*.cmake modules.
13068
13069
13070 Locate osgManipulator This module defines
13071
13072
13073 OSGMANIPULATOR_FOUND - Was osgManipulator found? OSGMANIPULA‐
13074 TOR_INCLUDE_DIR - Where to find the headers OSGMANIPULA‐
13075 TOR_LIBRARIES - The libraries to link for osgManipulator (use
13076 this)
13077
13078
13079 OSGMANIPULATOR_LIBRARY - The osgManipulator library OSGMANIPULA‐
13080 TOR_LIBRARY_DEBUG - The osgManipulator debug library
13081
13082
13083 $OSGDIR is an environment variable that would correspond to the
13084 ./configure --prefix=$OSGDIR used in building osg.
13085
13086
13087 Created by Eric Wing.
13088
13089
13090 FindosgParticle
13091
13092
13093 This is part of the Findosg* suite used to find OpenSceneGraph
13094 components. Each component is separate and you must opt in to
13095 each module. You must also opt into OpenGL and OpenThreads (and
13096 Producer if needed) as these modules won't do it for you. This
13097 is to allow you control over your own system piece by piece in
13098 case you need to opt out of certain components or change the
13099 Find behavior for a particular module (perhaps because the
13100 default FindOpenGL.cmake module doesn't work with your system as
13101 an example). If you want to use a more convenient module that
13102 includes everything, use the FindOpenSceneGraph.cmake instead of
13103 the Findosg*.cmake modules.
13104
13105
13106 Locate osgParticle This module defines
13107
13108
13109 OSGPARTICLE_FOUND - Was osgParticle found? OSGPARTI‐
13110 CLE_INCLUDE_DIR - Where to find the headers OSGPARTI‐
13111 CLE_LIBRARIES - The libraries to link for osgParticle (use this)
13112
13113
13114 OSGPARTICLE_LIBRARY - The osgParticle library OSGPARTI‐
13115 CLE_LIBRARY_DEBUG - The osgParticle debug library
13116
13117
13118 $OSGDIR is an environment variable that would correspond to the
13119 ./configure --prefix=$OSGDIR used in building osg.
13120
13121
13122 Created by Eric Wing.
13123
13124
13125 FindosgProducer
13126
13127
13128 This is part of the Findosg* suite used to find OpenSceneGraph
13129 components. Each component is separate and you must opt in to
13130 each module. You must also opt into OpenGL and OpenThreads (and
13131 Producer if needed) as these modules won't do it for you. This
13132 is to allow you control over your own system piece by piece in
13133 case you need to opt out of certain components or change the
13134 Find behavior for a particular module (perhaps because the
13135 default FindOpenGL.cmake module doesn't work with your system as
13136 an example). If you want to use a more convenient module that
13137 includes everything, use the FindOpenSceneGraph.cmake instead of
13138 the Findosg*.cmake modules.
13139
13140
13141 Locate osgProducer This module defines
13142
13143
13144 OSGPRODUCER_FOUND - Was osgProducer found? OSGPRO‐
13145 DUCER_INCLUDE_DIR - Where to find the headers OSGPRO‐
13146 DUCER_LIBRARIES - The libraries to link for osgProducer (use
13147 this)
13148
13149
13150 OSGPRODUCER_LIBRARY - The osgProducer library OSGPRO‐
13151 DUCER_LIBRARY_DEBUG - The osgProducer debug library
13152
13153
13154 $OSGDIR is an environment variable that would correspond to the
13155 ./configure --prefix=$OSGDIR used in building osg.
13156
13157
13158 Created by Eric Wing.
13159
13160
13161 FindosgShadow
13162
13163
13164 This is part of the Findosg* suite used to find OpenSceneGraph
13165 components. Each component is separate and you must opt in to
13166 each module. You must also opt into OpenGL and OpenThreads (and
13167 Producer if needed) as these modules won't do it for you. This
13168 is to allow you control over your own system piece by piece in
13169 case you need to opt out of certain components or change the
13170 Find behavior for a particular module (perhaps because the
13171 default FindOpenGL.cmake module doesn't work with your system as
13172 an example). If you want to use a more convenient module that
13173 includes everything, use the FindOpenSceneGraph.cmake instead of
13174 the Findosg*.cmake modules.
13175
13176
13177 Locate osgShadow This module defines
13178
13179
13180 OSGSHADOW_FOUND - Was osgShadow found? OSGSHADOW_INCLUDE_DIR -
13181 Where to find the headers OSGSHADOW_LIBRARIES - The libraries to
13182 link for osgShadow (use this)
13183
13184
13185 OSGSHADOW_LIBRARY - The osgShadow library
13186 OSGSHADOW_LIBRARY_DEBUG - The osgShadow debug library
13187
13188
13189 $OSGDIR is an environment variable that would correspond to the
13190 ./configure --prefix=$OSGDIR used in building osg.
13191
13192
13193 Created by Eric Wing.
13194
13195
13196 FindosgSim
13197
13198
13199 This is part of the Findosg* suite used to find OpenSceneGraph
13200 components. Each component is separate and you must opt in to
13201 each module. You must also opt into OpenGL and OpenThreads (and
13202 Producer if needed) as these modules won't do it for you. This
13203 is to allow you control over your own system piece by piece in
13204 case you need to opt out of certain components or change the
13205 Find behavior for a particular module (perhaps because the
13206 default FindOpenGL.cmake module doesn't work with your system as
13207 an example). If you want to use a more convenient module that
13208 includes everything, use the FindOpenSceneGraph.cmake instead of
13209 the Findosg*.cmake modules.
13210
13211
13212 Locate osgSim This module defines
13213
13214
13215 OSGSIM_FOUND - Was osgSim found? OSGSIM_INCLUDE_DIR - Where to
13216 find the headers OSGSIM_LIBRARIES - The libraries to link for
13217 osgSim (use this)
13218
13219
13220 OSGSIM_LIBRARY - The osgSim library OSGSIM_LIBRARY_DEBUG - The
13221 osgSim debug library
13222
13223
13224 $OSGDIR is an environment variable that would correspond to the
13225 ./configure --prefix=$OSGDIR used in building osg.
13226
13227
13228 Created by Eric Wing.
13229
13230
13231 FindosgTerrain
13232
13233
13234 This is part of the Findosg* suite used to find OpenSceneGraph
13235 components. Each component is separate and you must opt in to
13236 each module. You must also opt into OpenGL and OpenThreads (and
13237 Producer if needed) as these modules won't do it for you. This
13238 is to allow you control over your own system piece by piece in
13239 case you need to opt out of certain components or change the
13240 Find behavior for a particular module (perhaps because the
13241 default FindOpenGL.cmake module doesn't work with your system as
13242 an example). If you want to use a more convenient module that
13243 includes everything, use the FindOpenSceneGraph.cmake instead of
13244 the Findosg*.cmake modules.
13245
13246
13247 Locate osgTerrain This module defines
13248
13249
13250 OSGTERRAIN_FOUND - Was osgTerrain found? OSGTERRAIN_INCLUDE_DIR
13251 - Where to find the headers OSGTERRAIN_LIBRARIES - The libraries
13252 to link for osgTerrain (use this)
13253
13254
13255 OSGTERRAIN_LIBRARY - The osgTerrain library OSGTER‐
13256 RAIN_LIBRARY_DEBUG - The osgTerrain debug library
13257
13258
13259 $OSGDIR is an environment variable that would correspond to the
13260 ./configure --prefix=$OSGDIR used in building osg.
13261
13262
13263 Created by Eric Wing.
13264
13265
13266 FindosgText
13267
13268
13269 This is part of the Findosg* suite used to find OpenSceneGraph
13270 components. Each component is separate and you must opt in to
13271 each module. You must also opt into OpenGL and OpenThreads (and
13272 Producer if needed) as these modules won't do it for you. This
13273 is to allow you control over your own system piece by piece in
13274 case you need to opt out of certain components or change the
13275 Find behavior for a particular module (perhaps because the
13276 default FindOpenGL.cmake module doesn't work with your system as
13277 an example). If you want to use a more convenient module that
13278 includes everything, use the FindOpenSceneGraph.cmake instead of
13279 the Findosg*.cmake modules.
13280
13281
13282 Locate osgText This module defines
13283
13284
13285 OSGTEXT_FOUND - Was osgText found? OSGTEXT_INCLUDE_DIR - Where
13286 to find the headers OSGTEXT_LIBRARIES - The libraries to link
13287 for osgText (use this)
13288
13289
13290 OSGTEXT_LIBRARY - The osgText library OSGTEXT_LIBRARY_DEBUG -
13291 The osgText debug library
13292
13293
13294 $OSGDIR is an environment variable that would correspond to the
13295 ./configure --prefix=$OSGDIR used in building osg.
13296
13297
13298 Created by Eric Wing.
13299
13300
13301 FindosgUtil
13302
13303
13304 This is part of the Findosg* suite used to find OpenSceneGraph
13305 components. Each component is separate and you must opt in to
13306 each module. You must also opt into OpenGL and OpenThreads (and
13307 Producer if needed) as these modules won't do it for you. This
13308 is to allow you control over your own system piece by piece in
13309 case you need to opt out of certain components or change the
13310 Find behavior for a particular module (perhaps because the
13311 default FindOpenGL.cmake module doesn't work with your system as
13312 an example). If you want to use a more convenient module that
13313 includes everything, use the FindOpenSceneGraph.cmake instead of
13314 the Findosg*.cmake modules.
13315
13316
13317 Locate osgUtil This module defines
13318
13319
13320 OSGUTIL_FOUND - Was osgUtil found? OSGUTIL_INCLUDE_DIR - Where
13321 to find the headers OSGUTIL_LIBRARIES - The libraries to link
13322 for osgUtil (use this)
13323
13324
13325 OSGUTIL_LIBRARY - The osgUtil library OSGUTIL_LIBRARY_DEBUG -
13326 The osgUtil debug library
13327
13328
13329 $OSGDIR is an environment variable that would correspond to the
13330 ./configure --prefix=$OSGDIR used in building osg.
13331
13332
13333 Created by Eric Wing.
13334
13335
13336 FindosgViewer
13337
13338
13339 This is part of the Findosg* suite used to find OpenSceneGraph
13340 components. Each component is separate and you must opt in to
13341 each module. You must also opt into OpenGL and OpenThreads (and
13342 Producer if needed) as these modules won't do it for you. This
13343 is to allow you control over your own system piece by piece in
13344 case you need to opt out of certain components or change the
13345 Find behavior for a particular module (perhaps because the
13346 default FindOpenGL.cmake module doesn't work with your system as
13347 an example). If you want to use a more convenient module that
13348 includes everything, use the FindOpenSceneGraph.cmake instead of
13349 the Findosg*.cmake modules.
13350
13351
13352 Locate osgViewer This module defines
13353
13354
13355 OSGVIEWER_FOUND - Was osgViewer found? OSGVIEWER_INCLUDE_DIR -
13356 Where to find the headers OSGVIEWER_LIBRARIES - The libraries to
13357 link for osgViewer (use this)
13358
13359
13360 OSGVIEWER_LIBRARY - The osgViewer library
13361 OSGVIEWER_LIBRARY_DEBUG - The osgViewer debug library
13362
13363
13364 $OSGDIR is an environment variable that would correspond to the
13365 ./configure --prefix=$OSGDIR used in building osg.
13366
13367
13368 Created by Eric Wing.
13369
13370
13371 FindosgVolume
13372
13373
13374 This is part of the Findosg* suite used to find OpenSceneGraph
13375 components. Each component is separate and you must opt in to
13376 each module. You must also opt into OpenGL and OpenThreads (and
13377 Producer if needed) as these modules won't do it for you. This
13378 is to allow you control over your own system piece by piece in
13379 case you need to opt out of certain components or change the
13380 Find behavior for a particular module (perhaps because the
13381 default FindOpenGL.cmake module doesn't work with your system as
13382 an example). If you want to use a more convenient module that
13383 includes everything, use the FindOpenSceneGraph.cmake instead of
13384 the Findosg*.cmake modules.
13385
13386
13387 Locate osgVolume This module defines
13388
13389
13390 OSGVOLUME_FOUND - Was osgVolume found? OSGVOLUME_INCLUDE_DIR -
13391 Where to find the headers OSGVOLUME_LIBRARIES - The libraries to
13392 link for osgVolume (use this)
13393
13394
13395 OSGVOLUME_LIBRARY - The osgVolume library OSGVOL‐
13396 UME_LIBRARY_DEBUG - The osgVolume debug library
13397
13398
13399 $OSGDIR is an environment variable that would correspond to the
13400 ./configure --prefix=$OSGDIR used in building osg.
13401
13402
13403 Created by Eric Wing.
13404
13405
13406 FindosgWidget
13407
13408
13409 This is part of the Findosg* suite used to find OpenSceneGraph
13410 components. Each component is separate and you must opt in to
13411 each module. You must also opt into OpenGL and OpenThreads (and
13412 Producer if needed) as these modules won't do it for you. This
13413 is to allow you control over your own system piece by piece in
13414 case you need to opt out of certain components or change the
13415 Find behavior for a particular module (perhaps because the
13416 default FindOpenGL.cmake module doesn't work with your system as
13417 an example). If you want to use a more convenient module that
13418 includes everything, use the FindOpenSceneGraph.cmake instead of
13419 the Findosg*.cmake modules.
13420
13421
13422 Locate osgWidget This module defines
13423
13424
13425 OSGWIDGET_FOUND - Was osgWidget found? OSGWIDGET_INCLUDE_DIR -
13426 Where to find the headers OSGWIDGET_LIBRARIES - The libraries to
13427 link for osgWidget (use this)
13428
13429
13430 OSGWIDGET_LIBRARY - The osgWidget library OSGWID‐
13431 GET_LIBRARY_DEBUG - The osgWidget debug library
13432
13433
13434 $OSGDIR is an environment variable that would correspond to the
13435 ./configure --prefix=$OSGDIR used in building osg.
13436
13437
13438 FindosgWidget.cmake tweaked from Findosg* suite as created by
13439 Eric Wing.
13440
13441
13442 Findosg_functions
13443
13444
13445
13446
13447
13448 This CMake file contains two macros to assist with searching for
13449 OSG libraries and nodekits.
13450
13451
13452
13453 FindwxWidgets
13454 Find a wxWidgets (a.k.a., wxWindows) installation.
13455
13456 This module finds if wxWidgets is installed and selects a
13457 default configuration to use. wxWidgets is a modular library. To
13458 specify the modules that you will use, you need to name them as
13459 components to the package:
13460
13461
13462 FIND_PACKAGE(wxWidgets COMPONENTS core base ...)
13463
13464
13465 There are two search branches: a windows style and a unix style.
13466 For windows, the following variables are searched for and set to
13467 defaults in case of multiple choices. Change them if the
13468 defaults are not desired (i.e., these are the only variables you
13469 should change to select a configuration):
13470
13471
13472 wxWidgets_ROOT_DIR - Base wxWidgets directory
13473 (e.g., C:/wxWidgets-2.6.3).
13474 wxWidgets_LIB_DIR - Path to wxWidgets libraries
13475 (e.g., C:/wxWidgets-2.6.3/lib/vc_lib).
13476 wxWidgets_CONFIGURATION - Configuration to use
13477 (e.g., msw, mswd, mswu, mswunivud, etc.)
13478 wxWidgets_EXCLUDE_COMMON_LIBRARIES
13479 - Set to TRUE to exclude linking of
13480 commonly required libs (e.g., png tiff
13481 jpeg zlib regex expat).
13482
13483
13484
13485
13486 For unix style it uses the wx-config utility. You can select
13487 between debug/release, unicode/ansi, universal/non-universal,
13488 and static/shared in the QtDialog or ccmake interfaces by turn‐
13489 ing ON/OFF the following variables:
13490
13491
13492 wxWidgets_USE_DEBUG
13493 wxWidgets_USE_UNICODE
13494 wxWidgets_USE_UNIVERSAL
13495 wxWidgets_USE_STATIC
13496
13497
13498
13499
13500 There is also a wxWidgets_CONFIG_OPTIONS variable for all other
13501 options that need to be passed to the wx-config utility. For
13502 example, to use the base toolkit found in the /usr/local path,
13503 set the variable (before calling the FIND_PACKAGE command) as
13504 such:
13505
13506
13507 SET(wxWidgets_CONFIG_OPTIONS --toolkit=base --prefix=/usr)
13508
13509
13510
13511
13512 The following are set after the configuration is done for both
13513 windows and unix style:
13514
13515
13516 wxWidgets_FOUND - Set to TRUE if wxWidgets was found.
13517 wxWidgets_INCLUDE_DIRS - Include directories for WIN32
13518 i.e., where to find "wx/wx.h" and
13519 "wx/setup.h"; possibly empty for unices.
13520 wxWidgets_LIBRARIES - Path to the wxWidgets libraries.
13521 wxWidgets_LIBRARY_DIRS - compile time link dirs, useful for
13522 rpath on UNIX. Typically an empty string
13523 in WIN32 environment.
13524 wxWidgets_DEFINITIONS - Contains defines required to compile/link
13525 against WX, e.g. WXUSINGDLL
13526 wxWidgets_DEFINITIONS_DEBUG- Contains defines required to compile/link
13527 against WX debug builds, e.g. __WXDEBUG__
13528 wxWidgets_CXX_FLAGS - Include dirs and compiler flags for
13529 unices, empty on WIN32. Essentially
13530 "`wx-config --cxxflags`".
13531 wxWidgets_USE_FILE - Convenience include file.
13532
13533
13534
13535
13536 Sample usage:
13537
13538
13539 # Note that for MinGW users the order of libs is important!
13540 FIND_PACKAGE(wxWidgets COMPONENTS net gl core base)
13541 IF(wxWidgets_FOUND)
13542 INCLUDE(${wxWidgets_USE_FILE})
13543 # and for each of your dependent executable/library targets:
13544 TARGET_LINK_LIBRARIES(<YourTarget> ${wxWidgets_LIBRARIES})
13545 ENDIF(wxWidgets_FOUND)
13546
13547
13548
13549
13550 If wxWidgets is required (i.e., not an optional part):
13551
13552
13553 FIND_PACKAGE(wxWidgets REQUIRED net gl core base)
13554 INCLUDE(${wxWidgets_USE_FILE})
13555 # and for each of your dependent executable/library targets:
13556 TARGET_LINK_LIBRARIES(<YourTarget> ${wxWidgets_LIBRARIES})
13557
13558
13559 FindwxWindows
13560 Find wxWindows (wxWidgets) installation
13561
13562 This module finds if wxWindows/wxWidgets is installed and deter‐
13563 mines where the include files and libraries are. It also deter‐
13564 mines what the name of the library is. Please note this file is
13565 DEPRECATED and replaced by FindwxWidgets.cmake. This code sets
13566 the following variables:
13567
13568
13569 WXWINDOWS_FOUND = system has WxWindows
13570 WXWINDOWS_LIBRARIES = path to the wxWindows libraries
13571 on Unix/Linux with additional
13572 linker flags from
13573 "wx-config --libs"
13574 CMAKE_WXWINDOWS_CXX_FLAGS = Compiler flags for wxWindows,
13575 essentially "`wx-config --cxxflags`"
13576 on Linux
13577 WXWINDOWS_INCLUDE_DIR = where to find "wx/wx.h" and "wx/setup.h"
13578 WXWINDOWS_LINK_DIRECTORIES = link directories, useful for rpath on
13579 Unix
13580 WXWINDOWS_DEFINITIONS = extra defines
13581
13582
13583
13584
13585 OPTIONS If you need OpenGL support please
13586
13587
13588 SET(WXWINDOWS_USE_GL 1)
13589
13590 in your CMakeLists.txt *before* you include this file.
13591
13592
13593 HAVE_ISYSTEM - true required to replace -I by -isystem on g++
13594
13595
13596
13597
13598 For convenience include Use_wxWindows.cmake in your project's
13599 CMakeLists.txt using INCLUDE(Use_wxWindows).
13600
13601
13602 USAGE
13603
13604
13605 SET(WXWINDOWS_USE_GL 1)
13606 FIND_PACKAGE(wxWindows)
13607
13608
13609
13610
13611 NOTES wxWidgets 2.6.x is supported for monolithic builds e.g.
13612 compiled in wx/build/msw dir as:
13613
13614
13615 nmake -f makefile.vc BUILD=debug SHARED=0 USE_OPENGL=1 MONOLITHIC=1
13616
13617
13618
13619
13620 DEPRECATED
13621
13622
13623 CMAKE_WX_CAN_COMPILE
13624 WXWINDOWS_LIBRARY
13625 CMAKE_WX_CXX_FLAGS
13626 WXWINDOWS_INCLUDE_PATH
13627
13628
13629
13630
13631 AUTHOR Jan Woetzel <http://www.mip.informatik.uni-kiel.de/~jw>
13632 (07/2003-01/2006)
13633
13634
13635 FortranCInterface
13636 Fortran/C Interface Detection
13637
13638 This module automatically detects the API by which C and Fortran
13639 languages interact. Variables indicate if the mangling is
13640 found:
13641
13642
13643 FortranCInterface_GLOBAL_FOUND = Global subroutines and functions
13644 FortranCInterface_MODULE_FOUND = Module subroutines and functions
13645 (declared by "MODULE PROCEDURE")
13646
13647 A function is provided to generate a C header file containing
13648 macros to mangle symbol names:
13649
13650
13651 FortranCInterface_HEADER(<file>
13652 [MACRO_NAMESPACE <macro-ns>]
13653 [SYMBOL_NAMESPACE <ns>]
13654 [SYMBOLS [<module>:]<function> ...])
13655
13656 It generates in <file> definitions of the following macros:
13657
13658
13659 #define FortranCInterface_GLOBAL (name,NAME) ...
13660 #define FortranCInterface_GLOBAL_(name,NAME) ...
13661 #define FortranCInterface_MODULE (mod,name, MOD,NAME) ...
13662 #define FortranCInterface_MODULE_(mod,name, MOD,NAME) ...
13663
13664 These macros mangle four categories of Fortran symbols, respec‐
13665 tively:
13666
13667
13668 - Global symbols without '_': call mysub()
13669 - Global symbols with '_' : call my_sub()
13670 - Module symbols without '_': use mymod; call mysub()
13671 - Module symbols with '_' : use mymod; call my_sub()
13672
13673 If mangling for a category is not known, its macro is left unde‐
13674 fined. All macros require raw names in both lower case and upper
13675 case. The MACRO_NAMESPACE option replaces the default "FortranC‐
13676 Interface_" prefix with a given namespace "<macro-ns>".
13677
13678
13679 The SYMBOLS option lists symbols to mangle automatically with C
13680 preprocessor definitions:
13681
13682
13683 <function> ==> #define <ns><function> ...
13684 <module>:<function> ==> #define <ns><module>_<function> ...
13685
13686 If the mangling for some symbol is not known then no preproces‐
13687 sor definition is created, and a warning is displayed. The SYM‐
13688 BOL_NAMESPACE option prefixes all preprocessor definitions gen‐
13689 erated by the SYMBOLS option with a given namespace "<ns>".
13690
13691
13692 Example usage:
13693
13694
13695 include(FortranCInterface)
13696 FortranCInterface_HEADER(FC.h MACRO_NAMESPACE "FC_")
13697
13698 This creates a "FC.h" header that defines mangling macros
13699 FC_GLOBAL(), FC_GLOBAL_(), FC_MODULE(), and FC_MODULE_().
13700
13701
13702 Example usage:
13703
13704
13705 include(FortranCInterface)
13706 FortranCInterface_HEADER(FCMangle.h
13707 MACRO_NAMESPACE "FC_"
13708 SYMBOL_NAMESPACE "FC_"
13709 SYMBOLS mysub mymod:my_sub)
13710
13711 This creates a "FCMangle.h" header that defines the same FC_*()
13712 mangling macros as the previous example plus preprocessor sym‐
13713 bols FC_mysub and FC_mymod_my_sub.
13714
13715
13716 Another function is provided to verify that the Fortran and
13717 C/C++ compilers work together:
13718
13719
13720 FortranCInterface_VERIFY([CXX] [QUIET])
13721
13722 It tests whether a simple test executable using Fortran and C
13723 (and C++ when the CXX option is given) compiles and links suc‐
13724 cessfully. The result is stored in the cache entry FortranCIn‐
13725 terface_VERIFIED_C (or FortranCInterface_VERIFIED_CXX if CXX is
13726 given) as a boolean. If the check fails and QUIET is not given
13727 the function terminates with a FATAL_ERROR message describing
13728 the problem. The purpose of this check is to stop a build early
13729 for incompatible compiler combinations.
13730
13731
13732 FortranCInterface is aware of possible GLOBAL and MODULE man‐
13733 glings for many Fortran compilers, but it also provides an
13734 interface to specify new possible manglings. Set the variables
13735
13736
13737 FortranCInterface_GLOBAL_SYMBOLS
13738 FortranCInterface_MODULE_SYMBOLS
13739
13740 before including FortranCInterface to specify manglings of the
13741 symbols "MySub", "My_Sub", "MyModule:MySub", and "My_Mod‐
13742 ule:My_Sub". For example, the code:
13743
13744
13745 set(FortranCInterface_GLOBAL_SYMBOLS mysub_ my_sub__ MYSUB_)
13746 # ^^^^^ ^^^^^^ ^^^^^
13747 set(FortranCInterface_MODULE_SYMBOLS
13748 __mymodule_MOD_mysub __my_module_MOD_my_sub)
13749 # ^^^^^^^^ ^^^^^ ^^^^^^^^^ ^^^^^^
13750 include(FortranCInterface)
13751
13752 tells FortranCInterface to try given GLOBAL and MODULE man‐
13753 glings. (The carets point at raw symbol names for clarity in
13754 this example but are not needed.)
13755
13756
13757 GetPrerequisites
13758 Functions to analyze and list executable file prerequisites.
13759
13760 This module provides functions to list the .dll, .dylib or .so
13761 files that an executable or shared library file depends on. (Its
13762 prerequisites.)
13763
13764
13765 It uses various tools to obtain the list of required shared
13766 library files:
13767
13768
13769 dumpbin (Windows)
13770 ldd (Linux/Unix)
13771 otool (Mac OSX)
13772
13773 The following functions are provided by this module:
13774
13775
13776 get_prerequisites
13777 list_prerequisites
13778 list_prerequisites_by_glob
13779 gp_append_unique
13780 is_file_executable
13781 gp_item_default_embedded_path
13782 (projects can override with gp_item_default_embedded_path_override)
13783 gp_resolve_item
13784 (projects can override with gp_resolve_item_override)
13785 gp_resolved_file_type
13786 (projects can override with gp_resolved_file_type_override)
13787 gp_file_type
13788
13789 Requires CMake 2.6 or greater because it uses function, break,
13790 return and PARENT_SCOPE.
13791
13792
13793 GET_PREREQUISITES(<target> <prerequisites_var> <exclude_system> <recurse>
13794 <dirs>)
13795
13796 Get the list of shared library files required by <target>. The
13797 list in the variable named <prerequisites_var> should be empty
13798 on first entry to this function. On exit, <prerequisites_var>
13799 will contain the list of required shared library files.
13800
13801
13802 <target> is the full path to an executable file. <prerequi‐
13803 sites_var> is the name of a CMake variable to contain the
13804 results. <exclude_system> must be 0 or 1 indicating whether to
13805 include or exclude "system" prerequisites. If <recurse> is set
13806 to 1 all prerequisites will be found recursively, if set to 0
13807 only direct prerequisites are listed. <exepath> is the path to
13808 the top level executable used for @executable_path replacment on
13809 the Mac. <dirs> is a list of paths where libraries might be
13810 found: these paths are searched first when a target without any
13811 path info is given. Then standard system locations are also
13812 searched: PATH, Framework locations, /usr/lib...
13813
13814
13815 LIST_PREREQUISITES(<target> [<recurse> [<exclude_system> [<verbose>]]])
13816
13817 Print a message listing the prerequisites of <target>.
13818
13819
13820 <target> is the name of a shared library or executable target or
13821 the full path to a shared library or executable file. If
13822 <recurse> is set to 1 all prerequisites will be found recur‐
13823 sively, if set to 0 only direct prerequisites are listed.
13824 <exclude_system> must be 0 or 1 indicating whether to include or
13825 exclude "system" prerequisites. With <verbose> set to 0 only the
13826 full path names of the prerequisites are printed, set to 1 extra
13827 informatin will be displayed.
13828
13829
13830 LIST_PREREQUISITES_BY_GLOB(<glob_arg> <glob_exp>)
13831
13832 Print the prerequisites of shared library and executable files
13833 matching a globbing pattern. <glob_arg> is GLOB or GLOB_RECURSE
13834 and <glob_exp> is a globbing expression used with "file(GLOB" or
13835 "file(GLOB_RECURSE" to retrieve a list of matching files. If a
13836 matching file is executable, its prerequisites are listed.
13837
13838
13839 Any additional (optional) arguments provided are passed along as
13840 the optional arguments to the list_prerequisites calls.
13841
13842
13843 GP_APPEND_UNIQUE(<list_var> <value>)
13844
13845 Append <value> to the list variable <list_var> only if the value
13846 is not already in the list.
13847
13848
13849 IS_FILE_EXECUTABLE(<file> <result_var>)
13850
13851 Return 1 in <result_var> if <file> is a binary executable, 0
13852 otherwise.
13853
13854
13855 GP_ITEM_DEFAULT_EMBEDDED_PATH(<item> <default_embedded_path_var>)
13856
13857 Return the path that others should refer to the item by when the
13858 item is embedded inside a bundle.
13859
13860
13861 Override on a per-project basis by providing a project-specific
13862 gp_item_default_embedded_path_override function.
13863
13864
13865 GP_RESOLVE_ITEM(<context> <item> <exepath> <dirs> <resolved_item_var>)
13866
13867 Resolve an item into an existing full path file.
13868
13869
13870 Override on a per-project basis by providing a project-specific
13871 gp_resolve_item_override function.
13872
13873
13874 GP_RESOLVED_FILE_TYPE(<original_file> <file> <exepath> <dirs> <type_var>)
13875
13876 Return the type of <file> with respect to <original_file>.
13877 String describing type of prerequisite is returned in variable
13878 named <type_var>.
13879
13880
13881 Use <exepath> and <dirs> if necessary to resolve non-absolute
13882 <file> values -- but only for non-embedded items.
13883
13884
13885 Possible types are:
13886
13887
13888 system
13889 local
13890 embedded
13891 other
13892
13893 Override on a per-project basis by providing a project-specific
13894 gp_resolved_file_type_override function.
13895
13896
13897 GP_FILE_TYPE(<original_file> <file> <type_var>)
13898
13899 Return the type of <file> with respect to <original_file>.
13900 String describing type of prerequisite is returned in variable
13901 named <type_var>.
13902
13903
13904 Possible types are:
13905
13906
13907 system
13908 local
13909 embedded
13910 other
13911
13912
13913 InstallRequiredSystemLibraries
13914
13915
13916 By including this file, all library files listed in the variable
13917 CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS will be installed with
13918 INSTALL(PROGRAMS ...) into bin for WIN32 and lib for non-WIN32.
13919 If CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP is set to TRUE before
13920 including this file, then the INSTALL command is not called. The
13921 user can use the variable CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS to
13922 use a custom install command and install them however they want.
13923 If it is the MSVC compiler, then the microsoft run time
13924 libraries will be found and automatically added to the
13925 CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS, and installed. If
13926 CMAKE_INSTALL_DEBUG_LIBRARIES is set and it is the MSVC com‐
13927 piler, then the debug libraries are installed when available. If
13928 CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY is set then only the debug
13929 libraries are installed when both debug and release are avail‐
13930 able. If CMAKE_INSTALL_MFC_LIBRARIES is set then the MFC run
13931 time libraries are installed as well as the CRT run time
13932 libraries. If CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION is set
13933 then the libraries are installed to that directory rather than
13934 the default. If CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS is
13935 NOT set, then this file warns about required files that do not
13936 exist. You can set this variable to ON before including this
13937 file to avoid the warning. For example, the Visual Studio
13938 Express editions do not include the redistributable files, so if
13939 you include this file on a machine with only VS Express
13940 installed, you'll get the warning.
13941
13942
13943 MacroAddFileDependencies
13944 MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...)
13945
13946 Using the macro MACRO_ADD_FILE_DEPENDENCIES() is discouraged.
13947 There are usually better ways to specify the correct dependen‐
13948 cies.
13949
13950
13951 MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...) is just a
13952 convenience wrapper around the OBJECT_DEPENDS source file prop‐
13953 erty. You can just use SET_PROPERTY(SOURCE <file> APPEND PROP‐
13954 ERTY OBJECT_DEPENDS depend_files) instead.
13955
13956
13957 Qt4ConfigDependentSettings
13958
13959
13960 This file is included by FindQt4.cmake, don't include it
13961 directly.
13962
13963
13964 Qt4Macros
13965
13966
13967 This file is included by FindQt4.cmake, don't include it
13968 directly.
13969
13970
13971 SelectLibraryConfigurations
13972
13973
13974 select_library_configurations( basename )
13975
13976
13977 This macro takes a library base name as an argument, and will
13978 choose good values for basename_LIBRARY, basename_LIBRARIES,
13979 basename_LIBRARY_DEBUG, and basename_LIBRARY_RELEASE depending
13980 on what has been found and set. If only base‐
13981 name_LIBRARY_RELEASE is defined, basename_LIBRARY, base‐
13982 name_LIBRARY_DEBUG, and basename_LIBRARY_RELEASE will be set to
13983 the release value. If only basename_LIBRARY_DEBUG is defined,
13984 then basename_LIBRARY, basename_LIBRARY_DEBUG and base‐
13985 name_LIBRARY_RELEASE will take the debug value.
13986
13987
13988 If the generator supports configuration types, then base‐
13989 name_LIBRARY and basename_LIBRARIES will be set with debug and
13990 optimized flags specifying the library to be used for the given
13991 configuration. If no build type has been set or the generator
13992 in use does not support configuration types, then base‐
13993 name_LIBRARY and basename_LIBRARIES will take only the release
13994 values.
13995
13996
13997 SquishTestScript
13998
13999
14000
14001
14002
14003 This script launches a GUI test using Squish. You should not
14004 call the script directly; instead, you should access it via the
14005 SQUISH_ADD_TEST macro that is defined in FindSquish.cmake.
14006
14007
14008 This script starts the Squish server, launches the test on the
14009 client, and finally stops the squish server. If any of these
14010 steps fail (including if the tests do not pass) then a fatal
14011 error is raised.
14012
14013
14014
14015 TestBigEndian
14016 Define macro to determine endian type
14017
14018 Check if the system is big endian or little endian
14019
14020
14021 TEST_BIG_ENDIAN(VARIABLE)
14022 VARIABLE - variable to store the result to
14023
14024
14025
14026
14027
14028 TestCXXAcceptsFlag
14029 Test CXX compiler for a flag
14030
14031 Check if the CXX compiler accepts a flag
14032
14033
14034 Macro CHECK_CXX_ACCEPTS_FLAG(FLAGS VARIABLE) -
14035 checks if the function exists
14036 FLAGS - the flags to try
14037 VARIABLE - variable to store the result
14038
14039
14040
14041
14042
14043 TestForANSIForScope
14044 Check for ANSI for scope support
14045
14046 Check if the compiler restricts the scope of variables declared
14047 in a for-init-statement to the loop body.
14048
14049
14050 CMAKE_NO_ANSI_FOR_SCOPE - holds result
14051
14052
14053
14054
14055
14056 TestForANSIStreamHeaders
14057 Test for compiler support of ANSI stream headers iostream, etc.
14058
14059 check if the compiler supports the standard ANSI iostream header
14060 (without the .h)
14061
14062
14063 CMAKE_NO_ANSI_STREAM_HEADERS - defined by the results
14064
14065
14066
14067
14068
14069 TestForSSTREAM
14070 Test for compiler support of ANSI sstream header
14071
14072 check if the compiler supports the standard ANSI sstream header
14073
14074
14075 CMAKE_NO_ANSI_STRING_STREAM - defined by the results
14076
14077
14078
14079
14080
14081 TestForSTDNamespace
14082 Test for std:: namespace support
14083
14084 check if the compiler supports std:: on stl classes
14085
14086
14087 CMAKE_NO_STD_NAMESPACE - defined by the results
14088
14089
14090
14091
14092
14093 UseEcos
14094 This module defines variables and macros required to build eCos
14095 application.
14096
14097 This file contains the following macros: ECOS_ADD_INCLUDE_DIREC‐
14098 TORIES() - add the eCos include dirs ECOS_ADD_EXECUTABLE(name
14099 source1 ... sourceN ) - create an eCos executable
14100 ECOS_ADJUST_DIRECTORY(VAR source1 ... sourceN ) - adjusts the
14101 path of the source files and puts the result into VAR
14102
14103
14104 Macros for selecting the toolchain: ECOS_USE_ARM_ELF_TOOLS()
14105 - enable the ARM ELF toolchain for the directory where it is
14106 called ECOS_USE_I386_ELF_TOOLS() - enable the i386 ELF
14107 toolchain for the directory where it is called
14108 ECOS_USE_PPC_EABI_TOOLS() - enable the PowerPC toolchain
14109 for the directory where it is called
14110
14111
14112 It contains the following variables: ECOS_DEFINITIONS ECOSCON‐
14113 FIG_EXECUTABLE ECOS_CONFIG_FILE - defaults to
14114 ecos.ecc, if your eCos configuration file has a different name,
14115 adjust this variable for internal use only:
14116
14117
14118 ECOS_ADD_TARGET_LIB
14119
14120
14121 UsePkgConfig
14122 obsolete pkg-config module for CMake
14123
14124
14125
14126
14127 Defines the following macros:
14128
14129
14130 PKGCONFIG(package includedir libdir linkflags cflags)
14131
14132
14133 Calling PKGCONFIG will fill the desired information into the 4
14134 given arguments, e.g. PKGCONFIG(libart-2.0 LIBART_INCLUDE_DIR
14135 LIBART_LINK_DIR LIBART_LINK_FLAGS LIBART_CFLAGS) if pkg-config
14136 was NOT found or the specified software package doesn't exist,
14137 the variable will be empty when the function returns, otherwise
14138 they will contain the respective information
14139
14140
14141
14142 UseQt4 Use Module for QT4
14143
14144 Sets up C and C++ to use Qt 4. It is assumed that FindQt.cmake
14145 has already been loaded. See FindQt.cmake for information on
14146 how to load Qt 4 into your CMake project.
14147
14148
14149 UseSWIG
14150 SWIG module for CMake
14151
14152 Defines the following macros:
14153
14154
14155 SWIG_ADD_MODULE(name language [ files ])
14156 - Define swig module with given name and specified language
14157 SWIG_LINK_LIBRARIES(name [ libraries ])
14158 - Link libraries to swig module
14159
14160 All other macros are for internal use only. To get the actual
14161 name of the swig module, use: ${SWIG_MODULE_${name}_REAL_NAME}.
14162 Set Source files properties such as CPLUSPLUS and SWIG_FLAGS to
14163 specify special behavior of SWIG. Also global CMAKE_SWIG_FLAGS
14164 can be used to add special flags to all swig calls. Another spe‐
14165 cial variable is CMAKE_SWIG_OUTDIR, it allows one to specify
14166 where to write all the swig generated module (swig -outdir
14167 option) The name-specific variable SWIG_MODULE_<name>_EXTRA_DEPS
14168 may be used to specify extra dependencies for the generated mod‐
14169 ules. If the source file generated by swig need some special
14170 flag you can use SET_SOURCE_FILES_PROPERTIES( ${swig_gener‐
14171 ated_file_fullname}
14172
14173
14174 PROPERTIES COMPILE_FLAGS "-bla")
14175
14176
14177 Use_wxWindows
14178 ---------------------------------------------------
14179
14180
14181
14182
14183 This convenience include finds if wxWindows is installed and set
14184 the appropriate libs, incdirs, flags etc. author Jan Woetzel <jw
14185 -at- mip.informatik.uni-kiel.de> (07/2003)
14186
14187
14188 USAGE:
14189
14190
14191 just include Use_wxWindows.cmake
14192 in your projects CMakeLists.txt
14193
14194 INCLUDE( ${CMAKE_MODULE_PATH}/Use_wxWindows.cmake)
14195
14196
14197 if you are sure you need GL then
14198
14199 SET(WXWINDOWS_USE_GL 1)
14200
14201
14202 *before* you include this file.
14203
14204
14205 UsewxWidgets
14206 Convenience include for using wxWidgets library.
14207
14208 Determines if wxWidgets was FOUND and sets the appropriate libs,
14209 incdirs, flags, etc. INCLUDE_DIRECTORIES and LINK_DIRECTORIES
14210 are called.
14211
14212
14213 USAGE
14214
14215
14216 # Note that for MinGW users the order of libs is important!
14217 FIND_PACKAGE(wxWidgets REQUIRED net gl core base)
14218 INCLUDE(${wxWidgets_USE_FILE})
14219 # and for each of your dependant executable/library targets:
14220 TARGET_LINK_LIBRARIES(<YourTarget> ${wxWidgets_LIBRARIES})
14221
14222
14223
14224
14225 DEPRECATED
14226
14227
14228 LINK_LIBRARIES is not called in favor of adding dependencies per target.
14229
14230
14231
14232
14233 AUTHOR
14234
14235
14236 Jan Woetzel <jw -at- mip.informatik.uni-kiel.de>
14237
14238
14241 BUILD_SHARED_LIBS
14242 Global flag to cause add_library to create shared libraries if
14243 on.
14244
14245 If present and true, this will cause all libraries to be built
14246 shared unless the library was explicitly added as a static
14247 library. This variable is often added to projects as an OPTION
14248 so that each user of a project can decide if they want to build
14249 the project using shared or static libraries.
14250
14251
14252 CMAKE_BACKWARDS_COMPATIBILITY
14253 Version of cmake required to build project
14254
14255 From the point of view of backwards compatibility, this speci‐
14256 fies what version of CMake should be supported. By default this
14257 value is the version number of CMake that you are running. You
14258 can set this to an older version of CMake to support deprecated
14259 commands of CMake in projects that were written to use older
14260 versions of CMake. This can be set by the user or set at the
14261 beginning of a CMakeLists file.
14262
14263
14264 CMAKE_BUILD_TYPE
14265 Specifies the build type for make based generators.
14266
14267 This specifies what build type will be built in this tree. Pos‐
14268 sible values are empty, Debug, Release, RelWithDebInfo and Min‐
14269 SizeRel. This variable is only supported for make based genera‐
14270 tors. If this variable is supported, then CMake will also pro‐
14271 vide initial values for the variables with the name
14272 CMAKE_C_FLAGS_[Debug|Release|RelWithDebInfo|MinSizeRel]. For
14273 example, if CMAKE_BUILD_TYPE is Debug, then CMAKE_C_FLAGS_DEBUG
14274 will be added to the CMAKE_C_FLAGS.
14275
14276
14277 CMAKE_COLOR_MAKEFILE
14278 Enables color output when using the Makefile generator.
14279
14280 When enabled, the generated Makefiles will produce colored out‐
14281 put. Default is ON.
14282
14283
14284 CMAKE_CONFIGURATION_TYPES
14285 Specifies the available build types.
14286
14287 This specifies what build types will be available such as Debug,
14288 Release, RelWithDebInfo etc. This has reasonable defaults on
14289 most platforms. But can be extended to provide other build
14290 types. See also CMAKE_BUILD_TYPE.
14291
14292
14293 CMAKE_FIND_LIBRARY_PREFIXES
14294 Prefixes to prepend when looking for libraries.
14295
14296 This specifies what prefixes to add to library names when the
14297 find_library command looks for libraries. On UNIX systems this
14298 is typically lib, meaning that when trying to find the foo
14299 library it will look for libfoo.
14300
14301
14302 CMAKE_FIND_LIBRARY_SUFFIXES
14303 Suffixes to append when looking for libraries.
14304
14305 This specifies what suffixes to add to library names when the
14306 find_library command looks for libraries. On Windows systems
14307 this is typically .lib and .dll, meaning that when trying to
14308 find the foo library it will look for foo.dll etc.
14309
14310
14311 CMAKE_IGNORE_PATH
14312 Path to be ignored by FIND_XXX() commands.
14313
14314 Specifies directories to be ignored by searches in FIND_XXX()
14315 commands This is useful in cross-compiled environments where
14316 some system directories contain incompatible but possibly link‐
14317 able libraries. For example, on cross-compiled cluster environ‐
14318 ments, this allows a user to ignore directories containing
14319 libraries meant for the front-end machine that modules like
14320 FindX11 (and others) would normally search. By default this is
14321 empty; it is intended to be set by the project. Note that
14322 CMAKE_IGNORE_PATH takes a list of directory names, NOT a list of
14323 prefixes. If you want to ignore paths under prefixes (bin,
14324 include, lib, etc.), you'll need to specify them explicitly. See
14325 also CMAKE_PREFIX_PATH, CMAKE_LIBRARY_PATH, CMAKE_INCLUDE_PATH,
14326 CMAKE_PROGRAM_PATH.
14327
14328
14329 CMAKE_INCLUDE_PATH
14330 Path used for searching by FIND_FILE() and FIND_PATH().
14331
14332 Specifies a path which will be used both by FIND_FILE() and
14333 FIND_PATH(). Both commands will check each of the contained
14334 directories for the existence of the file which is currently
14335 searched. By default it is empty, it is intended to be set by
14336 the project. See also CMAKE_SYSTEM_INCLUDE_PATH, CMAKE_PRE‐
14337 FIX_PATH.
14338
14339
14340 CMAKE_INSTALL_PREFIX
14341 Install directory used by install.
14342
14343 If "make install" is invoked or INSTALL is built, this directory
14344 is pre-pended onto all install directories. This variable
14345 defaults to /usr/local on UNIX and c:/Program Files on Windows.
14346
14347
14348 CMAKE_LIBRARY_PATH
14349 Path used for searching by FIND_LIBRARY().
14350
14351 Specifies a path which will be used by FIND_LIBRARY().
14352 FIND_LIBRARY() will check each of the contained directories for
14353 the existence of the library which is currently searched. By
14354 default it is empty, it is intended to be set by the project.
14355 See also CMAKE_SYSTEM_LIBRARY_PATH, CMAKE_PREFIX_PATH.
14356
14357
14358 CMAKE_MFC_FLAG
14359 Tell cmake to use MFC for an executable or dll.
14360
14361 This can be set in a CMakeLists.txt file and will enable MFC in
14362 the application. It should be set to 1 for static the static
14363 MFC library, and 2 for the shared MFC library. This is used in
14364 visual studio 6 and 7 project files. The CMakeSetup dialog
14365 used MFC and the CMakeLists.txt looks like this:
14366
14367
14368 add_definitions(-D_AFXDLL)
14369
14370
14371 set(CMAKE_MFC_FLAG 2)
14372
14373
14374 add_executable(CMakeSetup WIN32 ${SRCS})
14375
14376
14377
14378 CMAKE_MODULE_PATH
14379 List of directories to search for CMake modules.
14380
14381 Commands like include() and find_package() search for files in
14382 directories listed by this variable before checking the default
14383 modules that come with CMake.
14384
14385
14386 CMAKE_NOT_USING_CONFIG_FLAGS
14387 Skip _BUILD_TYPE flags if true.
14388
14389 This is an internal flag used by the generators in CMake to tell
14390 CMake to skip the _BUILD_TYPE flags.
14391
14392
14393 CMAKE_POLICY_DEFAULT_CMP<NNNN>
14394 Default for CMake Policy CMP<NNNN> when it is otherwise left
14395 unset.
14396
14397 Commands cmake_minimum_required(VERSION) and cmake_policy(VER‐
14398 SION) by default leave policies introduced after the given ver‐
14399 sion unset. Set CMAKE_POLICY_DEFAULT_CMP<NNNN> to OLD or NEW to
14400 specify the default for policy CMP<NNNN>, where <NNNN> is the
14401 policy number.
14402
14403
14404 This variable should not be set by a project in CMake code; use
14405 cmake_policy(SET) instead. Users running CMake may set this
14406 variable in the cache (e.g. -DCMAKE_POL‐
14407 ICY_DEFAULT_CMP<NNNN>=<OLD|NEW>) to set a policy not otherwise
14408 set by the project. Set to OLD to quiet a policy warning while
14409 using old behavior or to NEW to try building the project with
14410 new behavior.
14411
14412
14413 CMAKE_PREFIX_PATH
14414 Path used for searching by FIND_XXX(), with appropriate suffixes
14415 added.
14416
14417 Specifies a path which will be used by the FIND_XXX() commands.
14418 It contains the "base" directories, the FIND_XXX() commands
14419 append appropriate subdirectories to the base directories. So
14420 FIND_PROGRAM() adds /bin to each of the directories in the path,
14421 FIND_LIBRARY() appends /lib to each of the directories, and
14422 FIND_PATH() and FIND_FILE() append /include . By default it is
14423 empty, it is intended to be set by the project. See also
14424 CMAKE_SYSTEM_PREFIX_PATH, CMAKE_INCLUDE_PATH,
14425 CMAKE_LIBRARY_PATH, CMAKE_PROGRAM_PATH.
14426
14427
14428 CMAKE_PROGRAM_PATH
14429 Path used for searching by FIND_PROGRAM().
14430
14431 Specifies a path which will be used by FIND_PROGRAM(). FIND_PRO‐
14432 GRAM() will check each of the contained directories for the
14433 existence of the program which is currently searched. By default
14434 it is empty, it is intended to be set by the project. See also
14435 CMAKE_SYSTEM_PROGRAM_PATH, CMAKE_PREFIX_PATH.
14436
14437
14438 CMAKE_SKIP_INSTALL_ALL_DEPENDENCY
14439 Don't make the install target depend on the all target.
14440
14441 By default, the "install" target depends on the "all" target.
14442 This has the effect, that when "make install" is invoked or
14443 INSTALL is built, first the "all" target is built, then the
14444 installation starts. If CMAKE_SKIP_INSTALL_ALL_DEPENDENCY is set
14445 to TRUE, this dependency is not created, so the installation
14446 process will start immediately, independent from whether the
14447 project has been completely built or not.
14448
14449
14450 CMAKE_SYSTEM_IGNORE_PATH
14451 Path to be ignored by FIND_XXX() commands.
14452
14453 Specifies directories to be ignored by searches in FIND_XXX()
14454 commands This is useful in cross-compiled environments where
14455 some system directories contain incompatible but possibly link‐
14456 able libraries. For example, on cross-compiled cluster environ‐
14457 ments, this allows a user to ignore directories containing
14458 libraries meant for the front-end machine that modules like
14459 FindX11 (and others) would normally search. By default this con‐
14460 tains a list of directories containing incompatible binaries for
14461 the host system. See also CMAKE_SYSTEM_PREFIX_PATH, CMAKE_SYS‐
14462 TEM_LIBRARY_PATH, CMAKE_SYSTEM_INCLUDE_PATH, and CMAKE_SYS‐
14463 TEM_PROGRAM_PATH.
14464
14465
14466 CMAKE_SYSTEM_INCLUDE_PATH
14467 Path used for searching by FIND_FILE() and FIND_PATH().
14468
14469 Specifies a path which will be used both by FIND_FILE() and
14470 FIND_PATH(). Both commands will check each of the contained
14471 directories for the existence of the file which is currently
14472 searched. By default it contains the standard directories for
14473 the current system. It is NOT intended to be modified by the
14474 project, use CMAKE_INCLUDE_PATH for this. See also CMAKE_SYS‐
14475 TEM_PREFIX_PATH.
14476
14477
14478 CMAKE_SYSTEM_LIBRARY_PATH
14479 Path used for searching by FIND_LIBRARY().
14480
14481 Specifies a path which will be used by FIND_LIBRARY().
14482 FIND_LIBRARY() will check each of the contained directories for
14483 the existence of the library which is currently searched. By
14484 default it contains the standard directories for the current
14485 system. It is NOT intended to be modified by the project, use
14486 CMAKE_LIBRARY_PATH for this. See also CMAKE_SYSTEM_PREFIX_PATH.
14487
14488
14489 CMAKE_SYSTEM_PREFIX_PATH
14490 Path used for searching by FIND_XXX(), with appropriate suffixes
14491 added.
14492
14493 Specifies a path which will be used by the FIND_XXX() commands.
14494 It contains the "base" directories, the FIND_XXX() commands
14495 append appropriate subdirectories to the base directories. So
14496 FIND_PROGRAM() adds /bin to each of the directories in the path,
14497 FIND_LIBRARY() appends /lib to each of the directories, and
14498 FIND_PATH() and FIND_FILE() append /include . By default this
14499 contains the standard directories for the current system. It is
14500 NOT intended to be modified by the project, use CMAKE_PRE‐
14501 FIX_PATH for this. See also CMAKE_SYSTEM_INCLUDE_PATH,
14502 CMAKE_SYSTEM_LIBRARY_PATH, CMAKE_SYSTEM_PROGRAM_PATH, and
14503 CMAKE_SYSTEM_IGNORE_PATH.
14504
14505
14506 CMAKE_SYSTEM_PROGRAM_PATH
14507 Path used for searching by FIND_PROGRAM().
14508
14509 Specifies a path which will be used by FIND_PROGRAM(). FIND_PRO‐
14510 GRAM() will check each of the contained directories for the
14511 existence of the program which is currently searched. By default
14512 it contains the standard directories for the current system. It
14513 is NOT intended to be modified by the project, use CMAKE_PRO‐
14514 GRAM_PATH for this. See also CMAKE_SYSTEM_PREFIX_PATH.
14515
14516
14517 CMAKE_USER_MAKE_RULES_OVERRIDE
14518 Specify a CMake file that overrides platform information.
14519
14520 CMake loads the specified file while enabling support for each
14521 language from either the project() or enable_language() com‐
14522 mands. It is loaded after CMake's builtin compiler and platform
14523 information modules have been loaded but before the information
14524 is used. The file may set platform information variables to
14525 override CMake's defaults.
14526
14527
14528 This feature is intended for use only in overriding information
14529 variables that must be set before CMake builds its first test
14530 project to check that the compiler for a language works. It
14531 should not be used to load a file in cases that a normal
14532 include() will work. Use it only as a last resort for behavior
14533 that cannot be achieved any other way. For example, one may set
14534 CMAKE_C_FLAGS_INIT to change the default value used to initial‐
14535 ize CMAKE_C_FLAGS before it is cached. The override file should
14536 NOT be used to set anything that could be set after languages
14537 are enabled, such as variables like CMAKE_RUNTIME_OUTPUT_DIREC‐
14538 TORY that affect the placement of binaries. Information set in
14539 the file will be used for try_compile and try_run builds too.
14540
14541
14543 APPLE True if running on Mac OSX.
14544
14545 Set to true on Mac OSX.
14546
14547
14548 BORLAND
14549 True of the borland compiler is being used.
14550
14551 This is set to true if the Borland compiler is being used.
14552
14553
14554 CMAKE_CL_64
14555 Using the 64 bit compiler from Microsoft
14556
14557 Set to true when using the 64 bit cl compiler from Microsoft.
14558
14559
14560 CMAKE_COMPILER_2005
14561 Using the Visual Studio 2005 compiler from Microsoft
14562
14563 Set to true when using the Visual Studio 2005 compiler from Mi‐
14564 crosoft.
14565
14566
14567 CMAKE_HOST_APPLE
14568 True for Apple OSXoperating systems.
14569
14570 Set to true when the host system is Apple OSX.
14571
14572
14573 CMAKE_HOST_SYSTEM
14574 Name of system cmake is being run on.
14575
14576 The same as CMAKE_SYSTEM but for the host system instead of the
14577 target system when cross compiling.
14578
14579
14580 CMAKE_HOST_SYSTEM_NAME
14581 Name of the OS CMake is running on.
14582
14583 The same as CMAKE_SYSTEM_NAME but for the host system instead of
14584 the target system when cross compiling.
14585
14586
14587 CMAKE_HOST_SYSTEM_PROCESSOR
14588 The name of the CPU CMake is running on.
14589
14590 The same as CMAKE_SYSTEM_PROCESSOR but for the host system
14591 instead of the target system when cross compiling.
14592
14593
14594 CMAKE_HOST_SYSTEM_VERSION
14595 OS version CMake is running on.
14596
14597 The same as CMAKE_SYSTEM_VERSION but for the host system instead
14598 of the target system when cross compiling.
14599
14600
14601 CMAKE_HOST_UNIX
14602 True for UNIX and UNIX like operating systems.
14603
14604 Set to true when the host system is UNIX or UNIX like (i.e.
14605 APPLE and CYGWIN).
14606
14607
14608 CMAKE_HOST_WIN32
14609 True on windows systems, including win64.
14610
14611 Set to true when the host system is Windows and on cygwin.
14612
14613
14614 CMAKE_OBJECT_PATH_MAX
14615 Maximum object file full-path length allowed by native build
14616 tools.
14617
14618 CMake computes for every source file an object file name that is
14619 unique to the source file and deterministic with respect to the
14620 full path to the source file. This allows multiple source files
14621 in a target to share the same name if they lie in different
14622 directories without rebuilding when one is added or removed.
14623 However, it can produce long full paths in a few cases, so CMake
14624 shortens the path using a hashing scheme when the full path to
14625 an object file exceeds a limit. CMake has a built-in limit for
14626 each platform that is sufficient for common tools, but some
14627 native tools may have a lower limit. This variable may be set
14628 to specify the limit explicitly. The value must be an integer
14629 no less than 128.
14630
14631
14632 CMAKE_SYSTEM
14633 Name of system cmake is compiling for.
14634
14635 This variable is the composite of CMAKE_SYSTEM_NAME and
14636 CMAKE_SYSTEM_VERSION, like this ${CMAKE_SYS‐
14637 TEM_NAME}-${CMAKE_SYSTEM_VERSION}. If CMAKE_SYSTEM_VERSION is
14638 not set, then CMAKE_SYSTEM is the same as CMAKE_SYSTEM_NAME.
14639
14640
14641 CMAKE_SYSTEM_NAME
14642 Name of the OS CMake is building for.
14643
14644 This is the name of the operating system on which CMake is tar‐
14645 geting. On systems that have the uname command, this variable
14646 is set to the output of uname -s. Linux, Windows, and Darwin
14647 for Mac OSX are the values found on the big three operating
14648 systems.
14649
14650
14651 CMAKE_SYSTEM_PROCESSOR
14652 The name of the CPU CMake is building for.
14653
14654 On systems that support uname, this variable is set to the out‐
14655 put of uname -p, on windows it is set to the value of the envi‐
14656 ronment variable PROCESSOR_ARCHITECTURE
14657
14658
14659 CMAKE_SYSTEM_VERSION
14660 OS version CMake is building for.
14661
14662 A numeric version string for the system, on systems that support
14663 uname, this variable is set to the output of uname -r. On other
14664 systems this is set to major-minor version numbers.
14665
14666
14667 CYGWIN True for cygwin.
14668
14669 Set to true when using CYGWIN.
14670
14671
14672 MSVC True when using Microsoft Visual C
14673
14674 Set to true when the compiler is some version of Microsoft Vis‐
14675 ual C.
14676
14677
14678 MSVC80 True when using Microsoft Visual C 8.0
14679
14680 Set to true when the compiler is version 8.0 of Microsoft Visual
14681 C.
14682
14683
14684 MSVC_IDE
14685 True when using the Microsoft Visual C IDE
14686
14687 Set to true when the target platform is the Microsoft Visual C
14688 IDE, as opposed to the command line compiler.
14689
14690
14691 MSVC_VERSION
14692 The version of Microsoft Visual C/C++ being used if any.
14693
14694 Known version numbers are:
14695
14696
14697 1200 = VS 6.0
14698 1300 = VS 7.0
14699 1310 = VS 7.1
14700 1400 = VS 8.0
14701 1500 = VS 9.0
14702 1600 = VS 10.0
14703
14704
14705 UNIX True for UNIX and UNIX like operating systems.
14706
14707 Set to true when the target system is UNIX or UNIX like (i.e.
14708 APPLE and CYGWIN).
14709
14710
14711 WIN32 True on windows systems, including win64.
14712
14713 Set to true when the target system is Windows and on cygwin.
14714
14715
14716 XCODE_VERSION
14717 Version of Xcode (Xcode generator only).
14718
14719 Under the Xcode generator, this is the version of Xcode as spec‐
14720 ified in "Xcode.app/Contents/version.plist" (such as "3.1.2").
14721
14722
14724 CMAKE_<LANG>_ARCHIVE_APPEND
14725 Rule variable to append to a static archive.
14726
14727 This is a rule variable that tells CMake how to append to a
14728 static archive. It is used in place of CMAKE_<LANG>_CRE‐
14729 ATE_STATIC_LIBRARY on some platforms in order to support large
14730 object counts. See also CMAKE_<LANG>_ARCHIVE_CREATE and
14731 CMAKE_<LANG>_ARCHIVE_FINISH.
14732
14733
14734 CMAKE_<LANG>_ARCHIVE_CREATE
14735 Rule variable to create a new static archive.
14736
14737 This is a rule variable that tells CMake how to create a static
14738 archive. It is used in place of CMAKE_<LANG>_CRE‐
14739 ATE_STATIC_LIBRARY on some platforms in order to support large
14740 object counts. See also CMAKE_<LANG>_ARCHIVE_APPEND and
14741 CMAKE_<LANG>_ARCHIVE_FINISH.
14742
14743
14744 CMAKE_<LANG>_ARCHIVE_FINISH
14745 Rule variable to finish an existing static archive.
14746
14747 This is a rule variable that tells CMake how to finish a static
14748 archive. It is used in place of CMAKE_<LANG>_CRE‐
14749 ATE_STATIC_LIBRARY on some platforms in order to support large
14750 object counts. See also CMAKE_<LANG>_ARCHIVE_CREATE and
14751 CMAKE_<LANG>_ARCHIVE_APPEND.
14752
14753
14754 CMAKE_<LANG>_COMPILER
14755 The full path to the compiler for LANG.
14756
14757 This is the command that will be used as the <LANG> compiler.
14758 Once set, you can not change this variable.
14759
14760
14761 CMAKE_<LANG>_COMPILER_ABI
14762 An internal variable subject to change.
14763
14764 This is used in determining the compiler ABI and is subject to
14765 change.
14766
14767
14768 CMAKE_<LANG>_COMPILER_ID
14769 An internal variable subject to change.
14770
14771 This is used in determining the compiler and is subject to
14772 change.
14773
14774
14775 CMAKE_<LANG>_COMPILER_LOADED
14776 Defined to true if the language is enabled.
14777
14778 When language <LANG> is enabled by project() or enable_lan‐
14779 guage() this variable is defined to 1.
14780
14781
14782 CMAKE_<LANG>_COMPILE_OBJECT
14783 Rule variable to compile a single object file.
14784
14785 This is a rule variable that tells CMake how to compile a single
14786 object file for for the language <LANG>.
14787
14788
14789 CMAKE_<LANG>_CREATE_SHARED_LIBRARY
14790 Rule variable to create a shared library.
14791
14792 This is a rule variable that tells CMake how to create a shared
14793 library for the language <LANG>.
14794
14795
14796 CMAKE_<LANG>_CREATE_SHARED_MODULE
14797 Rule variable to create a shared module.
14798
14799 This is a rule variable that tells CMake how to create a shared
14800 library for the language <LANG>.
14801
14802
14803 CMAKE_<LANG>_CREATE_STATIC_LIBRARY
14804 Rule variable to create a static library.
14805
14806 This is a rule variable that tells CMake how to create a static
14807 library for the language <LANG>.
14808
14809
14810 CMAKE_<LANG>_FLAGS_DEBUG
14811 Flags for Debug build type or configuration.
14812
14813 <LANG> flags used when CMAKE_BUILD_TYPE is Debug.
14814
14815
14816 CMAKE_<LANG>_FLAGS_MINSIZEREL
14817 Flags for MinSizeRel build type or configuration.
14818
14819 <LANG> flags used when CMAKE_BUILD_TYPE is MinSizeRel.Short for
14820 minimum size release.
14821
14822
14823 CMAKE_<LANG>_FLAGS_RELEASE
14824 Flags for Release build type or configuration.
14825
14826 <LANG> flags used when CMAKE_BUILD_TYPE is Release
14827
14828
14829 CMAKE_<LANG>_FLAGS_RELWITHDEBINFO
14830 Flags for RelWithDebInfo type or configuration.
14831
14832 <LANG> flags used when CMAKE_BUILD_TYPE is RelWithDebInfo. Short
14833 for Release With Debug Information.
14834
14835
14836 CMAKE_<LANG>_IGNORE_EXTENSIONS
14837 File extensions that should be ignored by the build.
14838
14839 This is a list of file extensions that may be part of a project
14840 for a given language but are not compiled.
14841
14842
14843 CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES
14844 Directories implicitly searched by the compiler for header
14845 files.
14846
14847 CMake does not explicitly specify these directories on compiler
14848 command lines for language <LANG>. This prevents system include
14849 directories from being treated as user include directories on
14850 some compilers.
14851
14852
14853 CMAKE_<LANG>_IMPLICIT_LINK_DIRECTORIES
14854 Implicit linker search path detected for language <LANG>.
14855
14856 Compilers typically pass directories containing language runtime
14857 libraries and default library search paths when they invoke a
14858 linker. These paths are implicit linker search directories for
14859 the compiler's language. CMake automatically detects these
14860 directories for each language and reports the results in this
14861 variable.
14862
14863
14864 CMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES
14865 Implicit link libraries and flags detected for language <LANG>.
14866
14867 Compilers typically pass language runtime library names and
14868 other flags when they invoke a linker. These flags are implicit
14869 link options for the compiler's language. CMake automatically
14870 detects these libraries and flags for each language and reports
14871 the results in this variable.
14872
14873
14874 CMAKE_<LANG>_LINKER_PREFERENCE
14875 Preference value for linker language selection.
14876
14877 The "linker language" for executable, shared library, and module
14878 targets is the language whose compiler will invoke the linker.
14879 The LINKER_LANGUAGE target property sets the language explic‐
14880 itly. Otherwise, the linker language is that whose linker pref‐
14881 erence value is highest among languages compiled and linked into
14882 the target. See also the CMAKE_<LANG>_LINKER_PREFERENCE_PROPA‐
14883 GATES variable.
14884
14885
14886 CMAKE_<LANG>_LINKER_PREFERENCE_PROPAGATES
14887 True if CMAKE_<LANG>_LINKER_PREFERENCE propagates across tar‐
14888 gets.
14889
14890 This is used when CMake selects a linker language for a target.
14891 Languages compiled directly into the target are always consid‐
14892 ered. A language compiled into static libraries linked by the
14893 target is considered if this variable is true.
14894
14895
14896 CMAKE_<LANG>_LINK_EXECUTABLE
14897 Rule variable to link and executable.
14898
14899 Rule variable to link and executable for the given language.
14900
14901
14902 CMAKE_<LANG>_OUTPUT_EXTENSION
14903 Extension for the output of a compile for a single file.
14904
14905 This is the extension for an object file for the given <LANG>.
14906 For example .obj for C on Windows.
14907
14908
14909 CMAKE_<LANG>_PLATFORM_ID
14910 An internal variable subject to change.
14911
14912 This is used in determining the platform and is subject to
14913 change.
14914
14915
14916 CMAKE_<LANG>_SIZEOF_DATA_PTR
14917 Size of pointer-to-data types for language <LANG>.
14918
14919 This holds the size (in bytes) of pointer-to-data types in the
14920 target platform ABI. It is defined for languages C and CXX
14921 (C++).
14922
14923
14924 CMAKE_<LANG>_SOURCE_FILE_EXTENSIONS
14925 Extensions of source files for the given language.
14926
14927 This is the list of extensions for a given languages source
14928 files.
14929
14930
14931 CMAKE_COMPILER_IS_GNU<LANG>
14932 True if the compiler is GNU.
14933
14934 If the selected <LANG> compiler is the GNU compiler then this is
14935 TRUE, if not it is FALSE.
14936
14937
14938 CMAKE_Fortran_MODDIR_DEFAULT
14939 Fortran default module output directory.
14940
14941 Most Fortran compilers write .mod files to the current working
14942 directory. For those that do not, this is set to "." and used
14943 when the Fortran_MODULE_DIRECTORY target property is not set.
14944
14945
14946 CMAKE_Fortran_MODDIR_FLAG
14947 Fortran flag for module output directory.
14948
14949 This stores the flag needed to pass the value of the For‐
14950 tran_MODULE_DIRECTORY target property to the compiler.
14951
14952
14953 CMAKE_Fortran_MODOUT_FLAG
14954 Fortran flag to enable module output.
14955
14956 Most Fortran compilers write .mod files out by default. For
14957 others, this stores the flag needed to enable module output.
14958
14959
14960 CMAKE_INTERNAL_PLATFORM_ABI
14961 An internal variable subject to change.
14962
14963 This is used in determining the compiler ABI and is subject to
14964 change.
14965
14966
14967 CMAKE_USER_MAKE_RULES_OVERRIDE_<LANG>
14968 Specify a CMake file that overrides platform information for
14969 <LANG>.
14970
14971 This is a language-specific version of
14972 CMAKE_USER_MAKE_RULES_OVERRIDE loaded only when enabling lan‐
14973 guage <LANG>.
14974
14975
14977 CMAKE_<CONFIG>_POSTFIX
14978 Default filename postfix for libraries under configuration <CON‐
14979 FIG>.
14980
14981 When a non-executable target is created its <CONFIG>_POSTFIX
14982 target property is initialized with the value of this variable
14983 if it is set.
14984
14985
14986 CMAKE_ARCHIVE_OUTPUT_DIRECTORY
14987 Where to put all the ARCHIVE targets when built.
14988
14989 This variable is used to initialize the ARCHIVE_OUTPUT_DIRECTORY
14990 property on all the targets. See that target property for addi‐
14991 tional information.
14992
14993
14994 CMAKE_BUILD_WITH_INSTALL_RPATH
14995 Use the install path for the RPATH
14996
14997 Normally CMake uses the build tree for the RPATH when building
14998 executables etc on systems that use RPATH. When the software is
14999 installed the executables etc are relinked by CMake to have the
15000 install RPATH. If this variable is set to true then the software
15001 is always built with the install path for the RPATH and does not
15002 need to be relinked when installed.
15003
15004
15005 CMAKE_DEBUG_POSTFIX
15006 See variable CMAKE_<CONFIG>_POSTFIX.
15007
15008 This variable is a special case of the more-general CMAKE_<CON‐
15009 FIG>_POSTFIX variable for the DEBUG configuration.
15010
15011
15012 CMAKE_EXE_LINKER_FLAGS
15013 Linker flags used to create executables.
15014
15015 Flags used by the linker when creating an executable.
15016
15017
15018 CMAKE_EXE_LINKER_FLAGS_[CMAKE_BUILD_TYPE]
15019 Flag used when linking an executable.
15020
15021 Same as CMAKE_C_FLAGS_* but used by the linker when creating
15022 executables.
15023
15024
15025 CMAKE_Fortran_MODULE_DIRECTORY
15026 Fortran module output directory.
15027
15028 This variable is used to initialize the Fortran_MODULE_DIRECTORY
15029 property on all the targets. See that target property for addi‐
15030 tional information.
15031
15032
15033 CMAKE_INCLUDE_CURRENT_DIR
15034 Automatically add the current source- and build directories to
15035 the include path.
15036
15037 If this variable is enabled, CMake automatically adds in each
15038 directory ${CMAKE_CURRENT_SOURCE_DIR} and ${CMAKE_CUR‐
15039 RENT_BINARY_DIR} to the include path for this directory. These
15040 additional include directories do not propagate down to subdi‐
15041 rectories. This is useful mainly for out-of-source builds, where
15042 files generated into the build tree are included by files
15043 located in the source tree.
15044
15045
15046 By default CMAKE_INCLUDE_CURRENT_DIR is OFF.
15047
15048
15049 CMAKE_INSTALL_NAME_DIR
15050 Mac OSX directory name for installed targets.
15051
15052 CMAKE_INSTALL_NAME_DIR is used to initialize the
15053 INSTALL_NAME_DIR property on all targets. See that target prop‐
15054 erty for more information.
15055
15056
15057 CMAKE_INSTALL_RPATH
15058 The rpath to use for installed targets.
15059
15060 A semicolon-separated list specifying the rpath to use in
15061 installed targets (for platforms that support it). This is used
15062 to initialize the target property INSTALL_RPATH for all targets.
15063
15064
15065 CMAKE_INSTALL_RPATH_USE_LINK_PATH
15066 Add paths to linker search and installed rpath.
15067
15068 CMAKE_INSTALL_RPATH_USE_LINK_PATH is a boolean that if set to
15069 true will append directories in the linker search path and out‐
15070 side the project to the INSTALL_RPATH. This is used to initial‐
15071 ize the target property INSTALL_RPATH_USE_LINK_PATH for all tar‐
15072 gets.
15073
15074
15075 CMAKE_LIBRARY_OUTPUT_DIRECTORY
15076 Where to put all the LIBRARY targets when built.
15077
15078 This variable is used to initialize the LIBRARY_OUTPUT_DIRECTORY
15079 property on all the targets. See that target property for addi‐
15080 tional information.
15081
15082
15083 CMAKE_LIBRARY_PATH_FLAG
15084 The flag used to add a library search path to a compiler.
15085
15086 The flag used to specify a library directory to the compiler. On
15087 most compilers this is "-L".
15088
15089
15090 CMAKE_LINK_DEF_FILE_FLAG
15091 Linker flag used to specify a .def file for dll creation.
15092
15093 The flag used to add a .def file when creating a dll on Windows,
15094 this is only defined on Windows.
15095
15096
15097 CMAKE_LINK_LIBRARY_FILE_FLAG
15098 Flag used to link a library specified by a path to its file.
15099
15100 The flag used before a library file path is given to the linker.
15101 This is needed only on very few platforms.
15102
15103
15104 CMAKE_LINK_LIBRARY_FLAG
15105 Flag used to link a library into an executable.
15106
15107 The flag used to specify a library to link to an executable. On
15108 most compilers this is "-l".
15109
15110
15111 CMAKE_NO_BUILTIN_CHRPATH
15112 Do not use the builtin ELF editor to fix RPATHs on installation.
15113
15114 When an ELF binary needs to have a different RPATH after instal‐
15115 lation than it does in the build tree, CMake uses a builtin edi‐
15116 tor to change the RPATH in the installed copy. If this variable
15117 is set to true then CMake will relink the binary before instal‐
15118 lation instead of using its builtin editor.
15119
15120
15121 CMAKE_RUNTIME_OUTPUT_DIRECTORY
15122 Where to put all the RUNTIME targets when built.
15123
15124 This variable is used to initialize the RUNTIME_OUTPUT_DIRECTORY
15125 property on all the targets. See that target property for addi‐
15126 tional information.
15127
15128
15129 CMAKE_SKIP_BUILD_RPATH
15130 Do not include RPATHs in the build tree.
15131
15132 Normally CMake uses the build tree for the RPATH when building
15133 executables etc on systems that use RPATH. When the software is
15134 installed the executables etc are relinked by CMake to have the
15135 install RPATH. If this variable is set to true then the software
15136 is always built with no RPATH.
15137
15138
15139 CMAKE_TRY_COMPILE_CONFIGURATION
15140 Build configuration used for try_compile and try_run projects.
15141
15142 Projects built by try_compile and try_run are built syn‐
15143 chronously during the CMake configuration step. Therefore a
15144 specific build configuration must be chosen even if the gener‐
15145 ated build system supports multiple configurations.
15146
15147
15148 CMAKE_USE_RELATIVE_PATHS
15149 Use relative paths (May not work!).
15150
15151 If this is set to TRUE, then the CMake will use relative paths
15152 between the source and binary tree. This option does not work
15153 for more complicated projects, and relative paths are used when
15154 possible. In general, it is not possible to move CMake gener‐
15155 ated makefiles to a different location regardless of the value
15156 of this variable.
15157
15158
15159 EXECUTABLE_OUTPUT_PATH
15160 Old executable location variable.
15161
15162 The target property RUNTIME_OUTPUT_DIRECTORY supercedes this
15163 variable for a target if it is set. Executable targets are oth‐
15164 erwise placed in this directory.
15165
15166
15167 LIBRARY_OUTPUT_PATH
15168 Old library location variable.
15169
15170 The target properties ARCHIVE_OUTPUT_DIRECTORY, LIBRARY_OUT‐
15171 PUT_DIRECTORY, and RUNTIME_OUTPUT_DIRECTORY supercede this vari‐
15172 able for a target if they are set. Library targets are other‐
15173 wise placed in this directory.
15174
15175
15177 CMAKE_AR
15178 Name of archiving tool for static libraries.
15179
15180 This specifies name of the program that creates archive or
15181 static libraries.
15182
15183
15184 CMAKE_BINARY_DIR
15185 The path to the top level of the build tree.
15186
15187 This is the full path to the top level of the current CMake
15188 build tree. For an in-source build, this would be the same as
15189 CMAKE_SOURCE_DIR.
15190
15191
15192 CMAKE_BUILD_TOOL
15193 Tool used for the actual build process.
15194
15195 This variable is set to the program that will be needed to build
15196 the output of CMake. If the generator selected was Visual Stu‐
15197 dio 6, the CMAKE_MAKE_PROGRAM will be set to msdev, for Unix
15198 makefiles it will be set to make or gmake, and for Visual Studio
15199 7 it set to devenv. For Nmake Makefiles the value is nmake.
15200 This can be useful for adding special flags and commands based
15201 on the final build environment.
15202
15203
15204 CMAKE_CACHEFILE_DIR
15205 The directory with the CMakeCache.txt file.
15206
15207 This is the full path to the directory that has the CMake‐
15208 Cache.txt file in it. This is the same as CMAKE_BINARY_DIR.
15209
15210
15211 CMAKE_CACHE_MAJOR_VERSION
15212 Major version of CMake used to create the CMakeCache.txt file
15213
15214 This is stores the major version of CMake used to write a CMake
15215 cache file. It is only different when a different version of
15216 CMake is run on a previously created cache file.
15217
15218
15219 CMAKE_CACHE_MINOR_VERSION
15220 Minor version of CMake used to create the CMakeCache.txt file
15221
15222 This is stores the minor version of CMake used to write a CMake
15223 cache file. It is only different when a different version of
15224 CMake is run on a previously created cache file.
15225
15226
15227 CMAKE_CACHE_PATCH_VERSION
15228 Patch version of CMake used to create the CMakeCache.txt file
15229
15230 This is stores the patch version of CMake used to write a CMake
15231 cache file. It is only different when a different version of
15232 CMake is run on a previously created cache file.
15233
15234
15235 CMAKE_CFG_INTDIR
15236 Build-time reference to per-configuration output subdirectory.
15237
15238 For native build systems supporting multiple configurations in
15239 the build tree (such as Visual Studio and Xcode), the value is a
15240 reference to a build-time variable specifying the name of the
15241 per-configuration output subdirectory. On Makefile generators
15242 this evaluates to "." because there is only one configuration in
15243 a build tree. Example values:
15244
15245
15246 $(IntDir) = Visual Studio 6
15247 $(OutDir) = Visual Studio 7, 8, 9
15248 $(Configuration) = Visual Studio 10
15249 $(CONFIGURATION) = Xcode
15250 . = Make-based tools
15251
15252 Since these values are evaluated by the native build system,
15253 this variable is suitable only for use in command lines that
15254 will be evaluated at build time. Example of intended usage:
15255
15256
15257 add_executable(mytool mytool.c)
15258 add_custom_command(
15259 OUTPUT out.txt
15260 COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/mytool
15261 ${CMAKE_CURRENT_SOURCE_DIR}/in.txt out.txt
15262 DEPENDS mytool in.txt
15263 )
15264 add_custom_target(drive ALL DEPENDS out.txt)
15265
15266 Note that CMAKE_CFG_INTDIR is no longer necessary for this pur‐
15267 pose but has been left for compatibility with existing projects.
15268 Instead add_custom_command() recognizes executable target names
15269 in its COMMAND option, so "${CMAKE_CUR‐
15270 RENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/mytool" can be replaced by
15271 just "mytool".
15272
15273
15274 This variable is read-only. Setting it is undefined behavior.
15275 In multi-configuration build systems the value of this variable
15276 is passed as the value of preprocessor symbol "CMAKE_INTDIR" to
15277 the compilation of all source files.
15278
15279
15280 CMAKE_COMMAND
15281 The full path to the cmake executable.
15282
15283 This is the full path to the CMake executable cmake which is
15284 useful from custom commands that want to use the cmake -E option
15285 for portable system commands. (e.g. /usr/local/bin/cmake
15286
15287
15288 CMAKE_CROSSCOMPILING
15289 Is CMake currently cross compiling.
15290
15291 This variable will be set to true by CMake if CMake is cross
15292 compiling. Specifically if the build platform is different from
15293 the target platform.
15294
15295
15296 CMAKE_CTEST_COMMAND
15297 Full path to ctest command installed with cmake.
15298
15299 This is the full path to the CTest executable ctest which is
15300 useful from custom commands that want to use the cmake -E
15301 option for portable system commands.
15302
15303
15304 CMAKE_CURRENT_BINARY_DIR
15305 The path to the binary directory currently being processed.
15306
15307 This the full path to the build directory that is currently
15308 being processed by cmake. Each directory added by add_subdirec‐
15309 tory will create a binary directory in the build tree, and as it
15310 is being processed this variable will be set. For in-source
15311 builds this is the current source directory being processed.
15312
15313
15314 CMAKE_CURRENT_LIST_DIR
15315 Full directory of the listfile currently being processed.
15316
15317 As CMake processes the listfiles in your project this variable
15318 will always be set to the directory where the listfile which is
15319 currently being processed (CMAKE_CURRENT_LIST_FILE) is located.
15320 The value has dynamic scope. When CMake starts processing com‐
15321 mands in a source file it sets this variable to the directory
15322 where this file is located. When CMake finishes processing com‐
15323 mands from the file it restores the previous value. Therefore
15324 the value of the variable inside a macro or function is the
15325 directory of the file invoking the bottom-most entry on the call
15326 stack, not the directory of the file containing the macro or
15327 function definition.
15328
15329
15330 See also CMAKE_CURRENT_LIST_FILE.
15331
15332
15333 CMAKE_CURRENT_LIST_FILE
15334 Full path to the listfile currently being processed.
15335
15336 As CMake processes the listfiles in your project this variable
15337 will always be set to the one currently being processed. The
15338 value has dynamic scope. When CMake starts processing commands
15339 in a source file it sets this variable to the location of the
15340 file. When CMake finishes processing commands from the file it
15341 restores the previous value. Therefore the value of the vari‐
15342 able inside a macro or function is the file invoking the bot‐
15343 tom-most entry on the call stack, not the file containing the
15344 macro or function definition.
15345
15346
15347 See also CMAKE_PARENT_LIST_FILE.
15348
15349
15350 CMAKE_CURRENT_LIST_LINE
15351 The line number of the current file being processed.
15352
15353 This is the line number of the file currently being processed by
15354 cmake.
15355
15356
15357 CMAKE_CURRENT_SOURCE_DIR
15358 The path to the source directory currently being processed.
15359
15360 This the full path to the source directory that is currently
15361 being processed by cmake.
15362
15363
15364 CMAKE_DL_LIBS
15365 Name of library containing dlopen and dlcose.
15366
15367 The name of the library that has dlopen and dlclose in it, usu‐
15368 ally -ldl on most UNIX machines.
15369
15370
15371 CMAKE_EDIT_COMMAND
15372 Full path to cmake-gui or ccmake.
15373
15374 This is the full path to the CMake executable that can graphi‐
15375 cally edit the cache. For example, cmake-gui, ccmake, or cmake
15376 -i.
15377
15378
15379 CMAKE_EXECUTABLE_SUFFIX
15380 The suffix for executables on this platform.
15381
15382 The suffix to use for the end of an executable if any, .exe on
15383 Windows.
15384
15385
15386 CMAKE_EXECUTABLE_SUFFIX_<LANG> overrides this for language
15387 <LANG>.
15388
15389
15390 CMAKE_EXTRA_GENERATOR
15391 The extra generator used to build the project.
15392
15393 When using the Eclipse, CodeBlocks or KDevelop generators, CMake
15394 generates Makefiles (CMAKE_GENERATOR) and additionally project
15395 files for the respective IDE. This IDE project file generator is
15396 stored in CMAKE_EXTRA_GENERATOR (e.g. "Eclipse CDT4").
15397
15398
15399 CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES
15400 Additional suffixes for shared libraries.
15401
15402 Extensions for shared libraries other than that specified by
15403 CMAKE_SHARED_LIBRARY_SUFFIX, if any. CMake uses this to recog‐
15404 nize external shared library files during analysis of libraries
15405 linked by a target.
15406
15407
15408 CMAKE_GENERATOR
15409 The generator used to build the project.
15410
15411 The name of the generator that is being used to generate the
15412 build files. (e.g. "Unix Makefiles", "Visual Studio 6", etc.)
15413
15414
15415 CMAKE_HOME_DIRECTORY
15416 Path to top of source tree.
15417
15418 This is the path to the top level of the source tree.
15419
15420
15421 CMAKE_IMPORT_LIBRARY_PREFIX
15422 The prefix for import libraries that you link to.
15423
15424 The prefix to use for the name of an import library if used on
15425 this platform.
15426
15427
15428 CMAKE_IMPORT_LIBRARY_PREFIX_<LANG> overrides this for language
15429 <LANG>.
15430
15431
15432 CMAKE_IMPORT_LIBRARY_SUFFIX
15433 The suffix for import libraries that you link to.
15434
15435 The suffix to use for the end of an import library if used on
15436 this platform.
15437
15438
15439 CMAKE_IMPORT_LIBRARY_SUFFIX_<LANG> overrides this for language
15440 <LANG>.
15441
15442
15443 CMAKE_LINK_LIBRARY_SUFFIX
15444 The suffix for libraries that you link to.
15445
15446 The suffix to use for the end of a library, .lib on Windows.
15447
15448
15449 CMAKE_MAJOR_VERSION
15450 The Major version of cmake (i.e. the 2 in 2.X.X)
15451
15452 This specifies the major version of the CMake executable being
15453 run.
15454
15455
15456 CMAKE_MAKE_PROGRAM
15457 See CMAKE_BUILD_TOOL.
15458
15459 This variable is around for backwards compatibility, see
15460 CMAKE_BUILD_TOOL.
15461
15462
15463 CMAKE_MINOR_VERSION
15464 The Minor version of cmake (i.e. the 4 in X.4.X).
15465
15466 This specifies the minor version of the CMake executable being
15467 run.
15468
15469
15470 CMAKE_PARENT_LIST_FILE
15471 Full path to the parent listfile of the one currently being pro‐
15472 cessed.
15473
15474 As CMake processes the listfiles in your project this variable
15475 will always be set to the listfile that included or somehow
15476 invoked the one currently being processed. See also CMAKE_CUR‐
15477 RENT_LIST_FILE.
15478
15479
15480 CMAKE_PATCH_VERSION
15481 The patch version of cmake (i.e. the 3 in X.X.3).
15482
15483 This specifies the patch version of the CMake executable being
15484 run.
15485
15486
15487 CMAKE_PROJECT_NAME
15488 The name of the current project.
15489
15490 This specifies name of the current project from the closest
15491 inherited PROJECT command.
15492
15493
15494 CMAKE_RANLIB
15495 Name of randomizing tool for static libraries.
15496
15497 This specifies name of the program that randomizes libraries on
15498 UNIX, not used on Windows, but may be present.
15499
15500
15501 CMAKE_ROOT
15502 Install directory for running cmake.
15503
15504 This is the install root for the running CMake and the Modules
15505 directory can be found here. This is commonly used in this for‐
15506 mat: ${CMAKE_ROOT}/Modules
15507
15508
15509 CMAKE_SHARED_LIBRARY_PREFIX
15510 The prefix for shared libraries that you link to.
15511
15512 The prefix to use for the name of a shared library, lib on UNIX.
15513
15514
15515 CMAKE_SHARED_LIBRARY_PREFIX_<LANG> overrides this for language
15516 <LANG>.
15517
15518
15519 CMAKE_SHARED_LIBRARY_SUFFIX
15520 The suffix for shared libraries that you link to.
15521
15522 The suffix to use for the end of a shared library, .dll on Win‐
15523 dows.
15524
15525
15526 CMAKE_SHARED_LIBRARY_SUFFIX_<LANG> overrides this for language
15527 <LANG>.
15528
15529
15530 CMAKE_SHARED_MODULE_PREFIX
15531 The prefix for loadable modules that you link to.
15532
15533 The prefix to use for the name of a loadable module on this
15534 platform.
15535
15536
15537 CMAKE_SHARED_MODULE_PREFIX_<LANG> overrides this for language
15538 <LANG>.
15539
15540
15541 CMAKE_SHARED_MODULE_SUFFIX
15542 The suffix for shared libraries that you link to.
15543
15544 The suffix to use for the end of a loadable module on this plat‐
15545 form
15546
15547
15548 CMAKE_SHARED_MODULE_SUFFIX_<LANG> overrides this for language
15549 <LANG>.
15550
15551
15552 CMAKE_SIZEOF_VOID_P
15553 Size of a void pointer.
15554
15555 This is set to the size of a pointer on the machine, and is
15556 determined by a try compile. If a 64 bit size is found, then the
15557 library search path is modified to look for 64 bit libraries
15558 first.
15559
15560
15561 CMAKE_SKIP_RPATH
15562 If true, do not add run time path information.
15563
15564 If this is set to TRUE, then the rpath information is not added
15565 to compiled executables. The default is to add rpath informa‐
15566 tion if the platform supports it.This allows for easy running
15567 from the build tree.
15568
15569
15570 CMAKE_SOURCE_DIR
15571 The path to the top level of the source tree.
15572
15573 This is the full path to the top level of the current CMake
15574 source tree. For an in-source build, this would be the same as
15575 CMAKE_BINARY_DIR.
15576
15577
15578 CMAKE_STANDARD_LIBRARIES
15579 Libraries linked into every executable and shared library.
15580
15581 This is the list of libraries that are linked into all executa‐
15582 bles and libraries.
15583
15584
15585 CMAKE_STATIC_LIBRARY_PREFIX
15586 The prefix for static libraries that you link to.
15587
15588 The prefix to use for the name of a static library, lib on UNIX.
15589
15590
15591 CMAKE_STATIC_LIBRARY_PREFIX_<LANG> overrides this for language
15592 <LANG>.
15593
15594
15595 CMAKE_STATIC_LIBRARY_SUFFIX
15596 The suffix for static libraries that you link to.
15597
15598 The suffix to use for the end of a static library, .lib on Win‐
15599 dows.
15600
15601
15602 CMAKE_STATIC_LIBRARY_SUFFIX_<LANG> overrides this for language
15603 <LANG>.
15604
15605
15606 CMAKE_TWEAK_VERSION
15607 The tweak version of cmake (i.e. the 1 in X.X.X.1).
15608
15609 This specifies the tweak version of the CMake executable being
15610 run. Releases use tweak < 20000000 and development versions use
15611 the date format CCYYMMDD for the tweak level.
15612
15613
15614 CMAKE_USING_VC_FREE_TOOLS
15615 True if free visual studio tools being used.
15616
15617 This is set to true if the compiler is Visual Studio free tools.
15618
15619
15620 CMAKE_VERBOSE_MAKEFILE
15621 Create verbose makefiles if on.
15622
15623 This variable defaults to false. You can set this variable to
15624 true to make CMake produce verbose makefiles that show each com‐
15625 mand line as it is used.
15626
15627
15628 CMAKE_VERSION
15629 The full version of cmake in major.minor.patch[.tweak[-id]] for‐
15630 mat.
15631
15632 This specifies the full version of the CMake executable being
15633 run. This variable is defined by versions 2.6.3 and higher.
15634 See variables CMAKE_MAJOR_VERSION, CMAKE_MINOR_VERSION,
15635 CMAKE_PATCH_VERSION, and CMAKE_TWEAK_VERSION for individual ver‐
15636 sion components. The [-id] component appears in non-release
15637 versions and may be arbitrary text.
15638
15639
15640 PROJECT_BINARY_DIR
15641 Full path to build directory for project.
15642
15643 This is the binary directory of the most recent PROJECT command.
15644
15645
15646 PROJECT_NAME
15647 Name of the project given to the project command.
15648
15649 This is the name given to the most recent PROJECT command.
15650
15651
15652 PROJECT_SOURCE_DIR
15653 Top level source directory for the current project.
15654
15655 This is the source directory of the most recent PROJECT command.
15656
15657
15658 [Project name]_BINARY_DIR
15659 Top level binary directory for the named project.
15660
15661 A variable is created with the name used in the PROJECT command,
15662 and is the binary directory for the project. This can be use‐
15663 ful when SUBDIR is used to connect several projects.
15664
15665
15666 [Project name]_SOURCE_DIR
15667 Top level source directory for the named project.
15668
15669 A variable is created with the name used in the PROJECT command,
15670 and is the source directory for the project. This can be use‐
15671 ful when add_subdirectory is used to connect several projects.
15672
15673
15675 Copyright 2000-2009 Kitware, Inc., Insight Software Consortium. All
15676 rights reserved.
15677
15678
15679 Redistribution and use in source and binary forms, with or without mod‐
15680 ification, are permitted provided that the following conditions are
15681 met:
15682
15683
15684 Redistributions of source code must retain the above copyright notice,
15685 this list of conditions and the following disclaimer.
15686
15687
15688 Redistributions in binary form must reproduce the above copyright
15689 notice, this list of conditions and the following disclaimer in the
15690 documentation and/or other materials provided with the distribution.
15691
15692
15693 Neither the names of Kitware, Inc., the Insight Software Consortium,
15694 nor the names of their contributors may be used to endorse or promote
15695 products derived from this software without specific prior written per‐
15696 mission.
15697
15698
15699 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
15700 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
15701 TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTIC‐
15702 ULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
15703 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
15704 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
15705 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
15706 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
15707 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
15708 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
15709 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15710
15711
15713 This manual page was generated by the "--help-man" option.
15714
15715
15716
15717
15718cmake 2.8.4 March 31, 2011 cmake(1)