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,-help,-usage,-h,-H,/?
36 Print usage information and exit.
37
38 Usage describes the basic command line interface and its
39 options.
40
41
42 --help-full [file]
43 Print full help and exit.
44
45 Full help displays most of the documentation provided by the
46 UNIX man page. It is provided for use on non-UNIX platforms,
47 but is also convenient if the man page is not installed. If a
48 file is specified, the help is written into it.
49
50
51 --help-html [file]
52 Print full help in HTML format.
53
54 This option is used by CMake authors to help produce web pages.
55 If a file is specified, the help is written into it.
56
57
58 --help-man [file]
59 Print full help as a UNIX man page and exit.
60
61 This option is used by the cmake build to generate the UNIX man
62 page. If a file is specified, the help is written into it.
63
64
65 --version,-version,/V [file]
66 Show program name/version banner and exit.
67
68 If a file is specified, the version is written into it.
69
70
72 The following generators are available on this platform:
73
74
75 Unix Makefiles
76 Generates standard UNIX makefiles.
77
78 A hierarchy of UNIX makefiles is generated into the build tree.
79 Any standard UNIX-style make program can build the project
80 through the default make target. A "make install" target is
81 also provided.
82
83
84 Ninja Generates build.ninja files (experimental).
85
86 A build.ninja file is generated into the build tree. Recent ver‐
87 sions of the ninja program can build the project through the
88 "all" target. An "install" target is also provided.
89
90
91 CodeBlocks - Ninja
92 Generates CodeBlocks project files.
93
94 Project files for CodeBlocks will be created in the top direc‐
95 tory and in every subdirectory which features a CMakeLists.txt
96 file containing a PROJECT() call. Additionally a hierarchy of
97 makefiles is generated into the build tree. The appropriate
98 make program can build the project through the default make tar‐
99 get. A "make install" target is also provided.
100
101
102 CodeBlocks - Unix Makefiles
103 Generates CodeBlocks project files.
104
105 Project files for CodeBlocks will be created in the top direc‐
106 tory and in every subdirectory which features a CMakeLists.txt
107 file containing a PROJECT() call. Additionally a hierarchy of
108 makefiles is generated into the build tree. The appropriate
109 make program can build the project through the default make tar‐
110 get. A "make install" target is also provided.
111
112
113 Eclipse CDT4 - Ninja
114 Generates Eclipse CDT 4.0 project files.
115
116 Project files for Eclipse will be created in the top directory.
117 In out of source builds, a linked resource to the top level
118 source directory will be created. Additionally a hierarchy of
119 makefiles is generated into the build tree. The appropriate make
120 program can build the project through the default make target. A
121 "make install" target is also provided.
122
123
124 Eclipse CDT4 - Unix Makefiles
125 Generates Eclipse CDT 4.0 project files.
126
127 Project files for Eclipse will be created in the top directory.
128 In out of source builds, a linked resource to the top level
129 source directory will be created. Additionally a hierarchy of
130 makefiles is generated into the build tree. The appropriate make
131 program can build the project through the default make target. A
132 "make install" target is also provided.
133
134
135 KDevelop3
136 Generates KDevelop 3 project files.
137
138 Project files for KDevelop 3 will be created in the top direc‐
139 tory and in every subdirectory which features a CMakeLists.txt
140 file containing a PROJECT() call. If you change the settings
141 using KDevelop cmake will try its best to keep your changes when
142 regenerating the project files. Additionally a hierarchy of UNIX
143 makefiles is generated into the build tree. Any standard
144 UNIX-style make program can build the project through the
145 default make target. A "make install" target is also provided.
146
147
148 KDevelop3 - Unix Makefiles
149 Generates KDevelop 3 project files.
150
151 Project files for KDevelop 3 will be created in the top direc‐
152 tory and in every subdirectory which features a CMakeLists.txt
153 file containing a PROJECT() call. If you change the settings
154 using KDevelop cmake will try its best to keep your changes when
155 regenerating the project files. Additionally a hierarchy of UNIX
156 makefiles is generated into the build tree. Any standard
157 UNIX-style make program can build the project through the
158 default make target. A "make install" target is also provided.
159
160
161 Sublime Text 2 - Ninja
162 Generates Sublime Text 2 project files.
163
164 Project files for Sublime Text 2 will be created in the top
165 directory and in every subdirectory which features a CMake‐
166 Lists.txt file containing a PROJECT() call. Additionally Make‐
167 files (or build.ninja files) are generated into the build tree.
168 The appropriate make program can build the project through the
169 default make target. A "make install" target is also provided.
170
171
172 Sublime Text 2 - Unix Makefiles
173 Generates Sublime Text 2 project files.
174
175 Project files for Sublime Text 2 will be created in the top
176 directory and in every subdirectory which features a CMake‐
177 Lists.txt file containing a PROJECT() call. Additionally Make‐
178 files (or build.ninja files) are generated into the build tree.
179 The appropriate make program can build the project through the
180 default make target. A "make install" target is also provided.
181
182
184 add_compile_options
185 Adds options to the compilation of source files.
186
187 add_compile_options(<option> ...)
188
189 Adds options to the compiler command line for sources in the
190 current directory and below. This command can be used to add
191 any options, but alternative commands exist to add preprocessor
192 definitions or include directories. See documentation of the
193 directory and target COMPILE_OPTIONS properties for details.
194 Arguments to add_compile_options may use "generator expressions"
195 with the syntax "$<...>". Generator expressions are evaluated
196 during build system generation to produce information specific
197 to each build configuration. Valid expressions are:
198
199
200 $<0:...> = empty string (ignores "...")
201 $<1:...> = content of "..."
202 $<CONFIG:cfg> = '1' if config is "cfg", else '0'
203 $<CONFIGURATION> = configuration name
204 $<BOOL:...> = '1' if the '...' is true, else '0'
205 $<STREQUAL:a,b> = '1' if a is STREQUAL b, else '0'
206 $<ANGLE-R> = A literal '>'. Used to compare strings which contain a '>' for example.
207 $<COMMA> = A literal ','. Used to compare strings which contain a ',' for example.
208 $<SEMICOLON> = A literal ';'. Used to prevent list expansion on an argument with ';'.
209 $<JOIN:list,...> = joins the list with the content of "..."
210 $<TARGET_NAME:...> = Marks ... as being the name of a target. This is required if exporting targets to multiple dependent export sets. The '...' must be a literal name of a target- it may not contain generator expressions.
211 $<INSTALL_INTERFACE:...> = content of "..." when the property is exported using install(EXPORT), and empty otherwise.
212 $<BUILD_INTERFACE:...> = content of "..." when the property is exported using export(), or when the target is used by another target in the same buildsystem. Expands to the empty string otherwise.
213 $<C_COMPILER_ID> = The CMake-id of the C compiler used.
214 $<C_COMPILER_ID:comp> = '1' if the CMake-id of the C compiler matches comp, otherwise '0'.
215 $<CXX_COMPILER_ID> = The CMake-id of the CXX compiler used.
216 $<CXX_COMPILER_ID:comp> = '1' if the CMake-id of the CXX compiler matches comp, otherwise '0'.
217 $<VERSION_GREATER:v1,v2> = '1' if v1 is a version greater than v2, else '0'.
218 $<VERSION_LESS:v1,v2> = '1' if v1 is a version less than v2, else '0'.
219 $<VERSION_EQUAL:v1,v2> = '1' if v1 is the same version as v2, else '0'.
220 $<C_COMPILER_VERSION> = The version of the C compiler used.
221 $<C_COMPILER_VERSION:ver> = '1' if the version of the C compiler matches ver, otherwise '0'.
222 $<CXX_COMPILER_VERSION> = The version of the CXX compiler used.
223 $<CXX_COMPILER_VERSION:ver> = '1' if the version of the CXX compiler matches ver, otherwise '0'.
224 $<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)
225 $<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)
226 $<TARGET_SONAME_FILE:tgt> = file with soname (.so.3)
227
228 where "tgt" is the name of a target. Target file expressions
229 produce a full path, but _DIR and _NAME versions can produce the
230 directory and file name components:
231
232
233 $<TARGET_FILE_DIR:tgt>/$<TARGET_FILE_NAME:tgt>
234 $<TARGET_LINKER_FILE_DIR:tgt>/$<TARGET_LINKER_FILE_NAME:tgt>
235 $<TARGET_SONAME_FILE_DIR:tgt>/$<TARGET_SONAME_FILE_NAME:tgt>
236
237
238
239
240 $<TARGET_PROPERTY:tgt,prop> = The value of the property prop on the target tgt.
241
242 Note that tgt is not added as a dependency of the target this
243 expression is evaluated on.
244
245
246 $<TARGET_POLICY:pol> = '1' if the policy was NEW when the 'head' target was created, else '0'. If the policy was not set, the warning message for the policy will be emitted. This generator expression only works for a subset of policies.
247 $<INSTALL_PREFIX> = Content of the install prefix when the target is exported via INSTALL(EXPORT) and empty otherwise.
248
249 Boolean expressions:
250
251
252 $<AND:?[,?]...> = '1' if all '?' are '1', else '0'
253 $<OR:?[,?]...> = '0' if all '?' are '0', else '1'
254 $<NOT:?> = '0' if '?' is '1', else '1'
255
256 where '?' is always either '0' or '1'.
257
258
259 Expressions with an implicit 'this' target:
260
261
262 $<TARGET_PROPERTY:prop> = The value of the property prop on the target on which the generator expression is evaluated.
263
264
265 add_custom_command
266 Add a custom build rule to the generated build system.
267
268 There are two main signatures for add_custom_command The first
269 signature is for adding a custom command to produce an output.
270
271
272 add_custom_command(OUTPUT output1 [output2 ...]
273 COMMAND command1 [ARGS] [args1...]
274 [COMMAND command2 [ARGS] [args2...] ...]
275 [MAIN_DEPENDENCY depend]
276 [DEPENDS [depends...]]
277 [IMPLICIT_DEPENDS <lang1> depend1
278 [<lang2> depend2] ...]
279 [WORKING_DIRECTORY dir]
280 [COMMENT comment] [VERBATIM] [APPEND])
281
282 This defines a command to generate specified OUTPUT file(s). A
283 target created in the same directory (CMakeLists.txt file) that
284 specifies any output of the custom command as a source file is
285 given a rule to generate the file using the command at build
286 time. Do not list the output in more than one independent tar‐
287 get that may build in parallel or the two instances of the rule
288 may conflict (instead use add_custom_target to drive the command
289 and make the other targets depend on that one). If an output
290 name is a relative path it will be interpreted relative to the
291 build tree directory corresponding to the current source direc‐
292 tory. Note that MAIN_DEPENDENCY is completely optional and is
293 used as a suggestion to visual studio about where to hang the
294 custom command. In makefile terms this creates a new target in
295 the following form:
296
297
298 OUTPUT: MAIN_DEPENDENCY DEPENDS
299 COMMAND
300
301 If more than one command is specified they will be executed in
302 order. The optional ARGS argument is for backward compatibility
303 and will be ignored.
304
305
306 The second signature adds a custom command to a target such as a
307 library or executable. This is useful for performing an opera‐
308 tion before or after building the target. The command becomes
309 part of the target and will only execute when the target itself
310 is built. If the target is already built, the command will not
311 execute.
312
313
314 add_custom_command(TARGET target
315 PRE_BUILD | PRE_LINK | POST_BUILD
316 COMMAND command1 [ARGS] [args1...]
317 [COMMAND command2 [ARGS] [args2...] ...]
318 [WORKING_DIRECTORY dir]
319 [COMMENT comment] [VERBATIM])
320
321 This defines a new command that will be associated with building
322 the specified target. When the command will happen is determined
323 by which of the following is specified:
324
325
326 PRE_BUILD - run before all other dependencies
327 PRE_LINK - run after other dependencies
328 POST_BUILD - run after the target has been built
329
330 Note that the PRE_BUILD option is only supported on Visual Stu‐
331 dio 7 or later. For all other generators PRE_BUILD will be
332 treated as PRE_LINK.
333
334
335 If WORKING_DIRECTORY is specified the command will be executed
336 in the directory given. If it is a relative path it will be
337 interpreted relative to the build tree directory corresponding
338 to the current source directory. If COMMENT is set, the value
339 will be displayed as a message before the commands are executed
340 at build time. If APPEND is specified the COMMAND and DEPENDS
341 option values are appended to the custom command for the first
342 output specified. There must have already been a previous call
343 to this command with the same output. The COMMENT, WORK‐
344 ING_DIRECTORY, and MAIN_DEPENDENCY options are currently ignored
345 when APPEND is given, but may be used in the future.
346
347
348 If VERBATIM is given then all arguments to the commands will be
349 escaped properly for the build tool so that the invoked command
350 receives each argument unchanged. Note that one level of
351 escapes is still used by the CMake language processor before
352 add_custom_command even sees the arguments. Use of VERBATIM is
353 recommended as it enables correct behavior. When VERBATIM is not
354 given the behavior is platform specific because there is no pro‐
355 tection of tool-specific special characters.
356
357
358 If the output of the custom command is not actually created as a
359 file on disk it should be marked as SYMBOLIC with
360 SET_SOURCE_FILES_PROPERTIES.
361
362
363 The IMPLICIT_DEPENDS option requests scanning of implicit depen‐
364 dencies of an input file. The language given specifies the pro‐
365 gramming language whose corresponding dependency scanner should
366 be used. Currently only C and CXX language scanners are sup‐
367 ported. The language has to be specified for every file in the
368 IMPLICIT_DEPENDS list. Dependencies discovered from the scanning
369 are added to those of the custom command at build time. Note
370 that the IMPLICIT_DEPENDS option is currently supported only for
371 Makefile generators and will be ignored by other generators.
372
373
374 If COMMAND specifies an executable target (created by ADD_EXE‐
375 CUTABLE) it will automatically be replaced by the location of
376 the executable created at build time. Additionally a tar‐
377 get-level dependency will be added so that the executable target
378 will be built before any target using this custom command. How‐
379 ever this does NOT add a file-level dependency that would cause
380 the custom command to re-run whenever the executable is recom‐
381 piled.
382
383
384 Arguments to COMMAND may use "generator expressions" with the
385 syntax "$<...>". Generator expressions are evaluated during
386 build system generation to produce information specific to each
387 build configuration. Valid expressions are:
388
389
390 $<0:...> = empty string (ignores "...")
391 $<1:...> = content of "..."
392 $<CONFIG:cfg> = '1' if config is "cfg", else '0'
393 $<CONFIGURATION> = configuration name
394 $<BOOL:...> = '1' if the '...' is true, else '0'
395 $<STREQUAL:a,b> = '1' if a is STREQUAL b, else '0'
396 $<ANGLE-R> = A literal '>'. Used to compare strings which contain a '>' for example.
397 $<COMMA> = A literal ','. Used to compare strings which contain a ',' for example.
398 $<SEMICOLON> = A literal ';'. Used to prevent list expansion on an argument with ';'.
399 $<JOIN:list,...> = joins the list with the content of "..."
400 $<TARGET_NAME:...> = Marks ... as being the name of a target. This is required if exporting targets to multiple dependent export sets. The '...' must be a literal name of a target- it may not contain generator expressions.
401 $<INSTALL_INTERFACE:...> = content of "..." when the property is exported using install(EXPORT), and empty otherwise.
402 $<BUILD_INTERFACE:...> = content of "..." when the property is exported using export(), or when the target is used by another target in the same buildsystem. Expands to the empty string otherwise.
403 $<C_COMPILER_ID> = The CMake-id of the C compiler used.
404 $<C_COMPILER_ID:comp> = '1' if the CMake-id of the C compiler matches comp, otherwise '0'.
405 $<CXX_COMPILER_ID> = The CMake-id of the CXX compiler used.
406 $<CXX_COMPILER_ID:comp> = '1' if the CMake-id of the CXX compiler matches comp, otherwise '0'.
407 $<VERSION_GREATER:v1,v2> = '1' if v1 is a version greater than v2, else '0'.
408 $<VERSION_LESS:v1,v2> = '1' if v1 is a version less than v2, else '0'.
409 $<VERSION_EQUAL:v1,v2> = '1' if v1 is the same version as v2, else '0'.
410 $<C_COMPILER_VERSION> = The version of the C compiler used.
411 $<C_COMPILER_VERSION:ver> = '1' if the version of the C compiler matches ver, otherwise '0'.
412 $<CXX_COMPILER_VERSION> = The version of the CXX compiler used.
413 $<CXX_COMPILER_VERSION:ver> = '1' if the version of the CXX compiler matches ver, otherwise '0'.
414 $<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)
415 $<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)
416 $<TARGET_SONAME_FILE:tgt> = file with soname (.so.3)
417
418 where "tgt" is the name of a target. Target file expressions
419 produce a full path, but _DIR and _NAME versions can produce the
420 directory and file name components:
421
422
423 $<TARGET_FILE_DIR:tgt>/$<TARGET_FILE_NAME:tgt>
424 $<TARGET_LINKER_FILE_DIR:tgt>/$<TARGET_LINKER_FILE_NAME:tgt>
425 $<TARGET_SONAME_FILE_DIR:tgt>/$<TARGET_SONAME_FILE_NAME:tgt>
426
427
428
429
430 $<TARGET_PROPERTY:tgt,prop> = The value of the property prop on the target tgt.
431
432 Note that tgt is not added as a dependency of the target this
433 expression is evaluated on.
434
435
436 $<TARGET_POLICY:pol> = '1' if the policy was NEW when the 'head' target was created, else '0'. If the policy was not set, the warning message for the policy will be emitted. This generator expression only works for a subset of policies.
437 $<INSTALL_PREFIX> = Content of the install prefix when the target is exported via INSTALL(EXPORT) and empty otherwise.
438
439 Boolean expressions:
440
441
442 $<AND:?[,?]...> = '1' if all '?' are '1', else '0'
443 $<OR:?[,?]...> = '0' if all '?' are '0', else '1'
444 $<NOT:?> = '0' if '?' is '1', else '1'
445
446 where '?' is always either '0' or '1'.
447
448
449 Expressions with an implicit 'this' target:
450
451
452 $<TARGET_PROPERTY:prop> = The value of the property prop on the target on which the generator expression is evaluated.
453
454 References to target names in generator expressions imply tar‐
455 get-level dependencies, but NOT file-level dependencies. List
456 target names with the DEPENDS option to add file dependencies.
457
458
459 The DEPENDS option specifies files on which the command depends.
460 If any dependency is an OUTPUT of another custom command in the
461 same directory (CMakeLists.txt file) CMake automatically brings
462 the other custom command into the target in which this command
463 is built. If DEPENDS is not specified the command will run
464 whenever the OUTPUT is missing; if the command does not actually
465 create the OUTPUT then the rule will always run. If DEPENDS
466 specifies any target (created by an ADD_* command) a tar‐
467 get-level dependency is created to make sure the target is built
468 before any target using this custom command. Additionally, if
469 the target is an executable or library a file-level dependency
470 is created to cause the custom command to re-run whenever the
471 target is recompiled.
472
473
474
475 add_custom_target
476 Add a target with no output so it will always be built.
477
478 add_custom_target(Name [ALL] [command1 [args1...]]
479 [COMMAND command2 [args2...] ...]
480 [DEPENDS depend depend depend ... ]
481 [WORKING_DIRECTORY dir]
482 [COMMENT comment] [VERBATIM]
483 [SOURCES src1 [src2...]])
484
485 Adds a target with the given name that executes the given com‐
486 mands. The target has no output file and is ALWAYS CONSIDERED
487 OUT OF DATE even if the commands try to create a file with the
488 name of the target. Use ADD_CUSTOM_COMMAND to generate a file
489 with dependencies. By default nothing depends on the custom tar‐
490 get. Use ADD_DEPENDENCIES to add dependencies to or from other
491 targets. If the ALL option is specified it indicates that this
492 target should be added to the default build target so that it
493 will be run every time (the command cannot be called ALL). The
494 command and arguments are optional and if not specified an empty
495 target will be created. If WORKING_DIRECTORY is set, then the
496 command will be run in that directory. If it is a relative path
497 it will be interpreted relative to the build tree directory cor‐
498 responding to the current source directory. If COMMENT is set,
499 the value will be displayed as a message before the commands are
500 executed at build time. Dependencies listed with the DEPENDS
501 argument may reference files and outputs of custom commands cre‐
502 ated with add_custom_command() in the same directory (CMake‐
503 Lists.txt file).
504
505
506 If VERBATIM is given then all arguments to the commands will be
507 escaped properly for the build tool so that the invoked command
508 receives each argument unchanged. Note that one level of
509 escapes is still used by the CMake language processor before
510 add_custom_target even sees the arguments. Use of VERBATIM is
511 recommended as it enables correct behavior. When VERBATIM is not
512 given the behavior is platform specific because there is no pro‐
513 tection of tool-specific special characters.
514
515
516 The SOURCES option specifies additional source files to be
517 included in the custom target. Specified source files will be
518 added to IDE project files for convenience in editing even if
519 they have not build rules.
520
521
522 add_definitions
523 Adds -D define flags to the compilation of source files.
524
525 add_definitions(-DFOO -DBAR ...)
526
527 Adds flags to the compiler command line for sources in the cur‐
528 rent directory and below. This command can be used to add any
529 flags, but it was originally intended to add preprocessor defi‐
530 nitions. Flags beginning in -D or /D that look like preproces‐
531 sor definitions are automatically added to the COMPILE_DEFINI‐
532 TIONS property for the current directory. Definitions with
533 non-trivial values may be left in the set of flags instead of
534 being converted for reasons of backwards compatibility. See
535 documentation of the directory, target, and source file COM‐
536 PILE_DEFINITIONS properties for details on adding preprocessor
537 definitions to specific scopes and configurations.
538
539
540 add_dependencies
541 Add a dependency between top-level targets.
542
543 add_dependencies(target-name depend-target1
544 depend-target2 ...)
545
546 Make a top-level target depend on other top-level targets. A
547 top-level target is one created by ADD_EXECUTABLE, ADD_LIBRARY,
548 or ADD_CUSTOM_TARGET. Adding dependencies with this command can
549 be used to make sure one target is built before another target.
550 Dependencies added to an IMPORTED target are followed transi‐
551 tively in its place since the target itself does not build. See
552 the DEPENDS option of ADD_CUSTOM_TARGET and ADD_CUSTOM_COMMAND
553 for adding file-level dependencies in custom rules. See the
554 OBJECT_DEPENDS option in SET_SOURCE_FILES_PROPERTIES to add
555 file-level dependencies to object files.
556
557
558 add_executable
559 Add an executable to the project using the specified source
560 files.
561
562 add_executable(<name> [WIN32] [MACOSX_BUNDLE]
563 [EXCLUDE_FROM_ALL]
564 source1 source2 ... sourceN)
565
566 Adds an executable target called <name> to be built from the
567 source files listed in the command invocation. The <name> cor‐
568 responds to the logical target name and must be globally unique
569 within a project. The actual file name of the executable built
570 is constructed based on conventions of the native platform (such
571 as <name>.exe or just <name>).
572
573
574 By default the executable file will be created in the build tree
575 directory corresponding to the source tree directory in which
576 the command was invoked. See documentation of the RUNTIME_OUT‐
577 PUT_DIRECTORY target property to change this location. See doc‐
578 umentation of the OUTPUT_NAME target property to change the
579 <name> part of the final file name.
580
581
582 If WIN32 is given the property WIN32_EXECUTABLE will be set on
583 the target created. See documentation of that target property
584 for details.
585
586
587 If MACOSX_BUNDLE is given the corresponding property will be set
588 on the created target. See documentation of the MACOSX_BUNDLE
589 target property for details.
590
591
592 If EXCLUDE_FROM_ALL is given the corresponding property will be
593 set on the created target. See documentation of the
594 EXCLUDE_FROM_ALL target property for details.
595
596
597 The add_executable command can also create IMPORTED executable
598 targets using this signature:
599
600
601 add_executable(<name> IMPORTED [GLOBAL])
602
603 An IMPORTED executable target references an executable file
604 located outside the project. No rules are generated to build
605 it. The target name has scope in the directory in which it is
606 created and below, but the GLOBAL option extends visibility. It
607 may be referenced like any target built within the project.
608 IMPORTED executables are useful for convenient reference from
609 commands like add_custom_command. Details about the imported
610 executable are specified by setting properties whose names begin
611 in "IMPORTED_". The most important such property is
612 IMPORTED_LOCATION (and its per-configuration version
613 IMPORTED_LOCATION_<CONFIG>) which specifies the location of the
614 main executable file on disk. See documentation of the
615 IMPORTED_* properties for more information.
616
617
618 The signature
619
620
621 add_executable(<name> ALIAS <target>)
622
623 creates an alias, such that <name> can be used to refer to <tar‐
624 get> in subsequent commands. The <name> does not appear in the
625 generated buildsystem as a make target. The <target> may not be
626 an IMPORTED target or an ALIAS. Alias targets can be used as
627 linkable targets, targets to read properties from, executables
628 for custom commands and custom targets. They can also be tested
629 for existance with the regular if(TARGET) subcommand. The
630 <name> may not be used to modify properties of <target>, that
631 is, it may not be used as the operand of set_property, set_tar‐
632 get_properties, target_link_libraries etc. An ALIAS target may
633 not be installed of exported.
634
635
636 add_library
637 Add a library to the project using the specified source files.
638
639 add_library(<name> [STATIC | SHARED | MODULE]
640 [EXCLUDE_FROM_ALL]
641 source1 source2 ... sourceN)
642
643 Adds a library target called <name> to be built from the source
644 files listed in the command invocation. The <name> corresponds
645 to the logical target name and must be globally unique within a
646 project. The actual file name of the library built is con‐
647 structed based on conventions of the native platform (such as
648 lib<name>.a or <name>.lib).
649
650
651 STATIC, SHARED, or MODULE may be given to specify the type of
652 library to be created. STATIC libraries are archives of object
653 files for use when linking other targets. SHARED libraries are
654 linked dynamically and loaded at runtime. MODULE libraries are
655 plugins that are not linked into other targets but may be loaded
656 dynamically at runtime using dlopen-like functionality. If no
657 type is given explicitly the type is STATIC or SHARED based on
658 whether the current value of the variable BUILD_SHARED_LIBS is
659 true. For SHARED and MODULE libraries the POSITION_INDEPEN‐
660 DENT_CODE target property is set to TRUE automatically.
661
662
663 By default the library file will be created in the build tree
664 directory corresponding to the source tree directory in which
665 the command was invoked. See documentation of the ARCHIVE_OUT‐
666 PUT_DIRECTORY, LIBRARY_OUTPUT_DIRECTORY, and RUNTIME_OUT‐
667 PUT_DIRECTORY target properties to change this location. See
668 documentation of the OUTPUT_NAME target property to change the
669 <name> part of the final file name.
670
671
672 If EXCLUDE_FROM_ALL is given the corresponding property will be
673 set on the created target. See documentation of the
674 EXCLUDE_FROM_ALL target property for details.
675
676
677 The add_library command can also create IMPORTED library targets
678 using this signature:
679
680
681 add_library(<name> <SHARED|STATIC|MODULE|UNKNOWN> IMPORTED
682 [GLOBAL])
683
684 An IMPORTED library target references a library file located
685 outside the project. No rules are generated to build it. The
686 target name has scope in the directory in which it is created
687 and below, but the GLOBAL option extends visibility. It may be
688 referenced like any target built within the project. IMPORTED
689 libraries are useful for convenient reference from commands like
690 target_link_libraries. Details about the imported library are
691 specified by setting properties whose names begin in
692 "IMPORTED_". The most important such property is IMPORTED_LOCA‐
693 TION (and its per-configuration version IMPORTED_LOCATION_<CON‐
694 FIG>) which specifies the location of the main library file on
695 disk. See documentation of the IMPORTED_* properties for more
696 information.
697
698
699 The signature
700
701
702 add_library(<name> OBJECT <src>...)
703
704 creates a special "object library" target. An object library
705 compiles source files but does not archive or link their object
706 files into a library. Instead other targets created by
707 add_library or add_executable may reference the objects using an
708 expression of the form $<TARGET_OBJECTS:objlib> as a source,
709 where "objlib" is the object library name. For example:
710
711
712 add_library(... $<TARGET_OBJECTS:objlib> ...)
713 add_executable(... $<TARGET_OBJECTS:objlib> ...)
714
715 will include objlib's object files in a library and an exe‐
716 cutable along with those compiled from their own sources.
717 Object libraries may contain only sources (and headers) that
718 compile to object files. They may contain custom commands gen‐
719 erating such sources, but not PRE_BUILD, PRE_LINK, or POST_BUILD
720 commands. Object libraries cannot be imported, exported,
721 installed, or linked. Some native build systems may not like
722 targets that have only object files, so consider adding at least
723 one real source file to any target that references $<TAR‐
724 GET_OBJECTS:objlib>.
725
726
727 The signature
728
729
730 add_library(<name> ALIAS <target>)
731
732 creates an alias, such that <name> can be used to refer to <tar‐
733 get> in subsequent commands. The <name> does not appear in the
734 generated buildsystem as a make target. The <target> may not be
735 an IMPORTED target or an ALIAS. Alias targets can be used as
736 linkable targets, targets to read properties from. They can
737 also be tested for existance with the regular if(TARGET) subcom‐
738 mand. The <name> may not be used to modify properties of <tar‐
739 get>, that is, it may not be used as the operand of set_prop‐
740 erty, set_target_properties, target_link_libraries etc. An
741 ALIAS target may not be installed of exported.
742
743
744 add_subdirectory
745 Add a subdirectory to the build.
746
747 add_subdirectory(source_dir [binary_dir]
748 [EXCLUDE_FROM_ALL])
749
750 Add a subdirectory to the build. The source_dir specifies the
751 directory in which the source CMakeLists.txt and code files are
752 located. If it is a relative path it will be evaluated with
753 respect to the current directory (the typical usage), but it may
754 also be an absolute path. The binary_dir specifies the directory
755 in which to place the output files. If it is a relative path it
756 will be evaluated with respect to the current output directory,
757 but it may also be an absolute path. If binary_dir is not speci‐
758 fied, the value of source_dir, before expanding any relative
759 path, will be used (the typical usage). The CMakeLists.txt file
760 in the specified source directory will be processed immediately
761 by CMake before processing in the current input file continues
762 beyond this command.
763
764
765 If the EXCLUDE_FROM_ALL argument is provided then targets in the
766 subdirectory will not be included in the ALL target of the par‐
767 ent directory by default, and will be excluded from IDE project
768 files. Users must explicitly build targets in the subdirectory.
769 This is meant for use when the subdirectory contains a separate
770 part of the project that is useful but not necessary, such as a
771 set of examples. Typically the subdirectory should contain its
772 own project() command invocation so that a full build system
773 will be generated in the subdirectory (such as a VS IDE solution
774 file). Note that inter-target dependencies supercede this
775 exclusion. If a target built by the parent project depends on a
776 target in the subdirectory, the dependee target will be included
777 in the parent project build system to satisfy the dependency.
778
779
780 add_test
781 Add a test to the project with the specified arguments.
782
783 add_test(testname Exename arg1 arg2 ... )
784
785 If the ENABLE_TESTING command has been run, this command adds a
786 test target to the current directory. If ENABLE_TESTING has not
787 been run, this command does nothing. The tests are run by the
788 testing subsystem by executing Exename with the specified argu‐
789 ments. Exename can be either an executable built by this
790 project or an arbitrary executable on the system (like tclsh).
791 The test will be run with the current working directory set to
792 the CMakeList.txt files corresponding directory in the binary
793 tree.
794
795
796
797
798
799 add_test(NAME <name> [CONFIGURATIONS [Debug|Release|...]]
800 [WORKING_DIRECTORY dir]
801 COMMAND <command> [arg1 [arg2 ...]])
802
803 Add a test called <name>. The test name may not contain spaces,
804 quotes, or other characters special in CMake syntax. If COMMAND
805 specifies an executable target (created by add_executable) it
806 will automatically be replaced by the location of the executable
807 created at build time. If a CONFIGURATIONS option is given then
808 the test will be executed only when testing under one of the
809 named configurations. If a WORKING_DIRECTORY option is given
810 then the test will be executed in the given directory.
811
812
813 Arguments after COMMAND may use "generator expressions" with the
814 syntax "$<...>". Generator expressions are evaluated during
815 build system generation to produce information specific to each
816 build configuration. Valid expressions are:
817
818
819 $<0:...> = empty string (ignores "...")
820 $<1:...> = content of "..."
821 $<CONFIG:cfg> = '1' if config is "cfg", else '0'
822 $<CONFIGURATION> = configuration name
823 $<BOOL:...> = '1' if the '...' is true, else '0'
824 $<STREQUAL:a,b> = '1' if a is STREQUAL b, else '0'
825 $<ANGLE-R> = A literal '>'. Used to compare strings which contain a '>' for example.
826 $<COMMA> = A literal ','. Used to compare strings which contain a ',' for example.
827 $<SEMICOLON> = A literal ';'. Used to prevent list expansion on an argument with ';'.
828 $<JOIN:list,...> = joins the list with the content of "..."
829 $<TARGET_NAME:...> = Marks ... as being the name of a target. This is required if exporting targets to multiple dependent export sets. The '...' must be a literal name of a target- it may not contain generator expressions.
830 $<INSTALL_INTERFACE:...> = content of "..." when the property is exported using install(EXPORT), and empty otherwise.
831 $<BUILD_INTERFACE:...> = content of "..." when the property is exported using export(), or when the target is used by another target in the same buildsystem. Expands to the empty string otherwise.
832 $<C_COMPILER_ID> = The CMake-id of the C compiler used.
833 $<C_COMPILER_ID:comp> = '1' if the CMake-id of the C compiler matches comp, otherwise '0'.
834 $<CXX_COMPILER_ID> = The CMake-id of the CXX compiler used.
835 $<CXX_COMPILER_ID:comp> = '1' if the CMake-id of the CXX compiler matches comp, otherwise '0'.
836 $<VERSION_GREATER:v1,v2> = '1' if v1 is a version greater than v2, else '0'.
837 $<VERSION_LESS:v1,v2> = '1' if v1 is a version less than v2, else '0'.
838 $<VERSION_EQUAL:v1,v2> = '1' if v1 is the same version as v2, else '0'.
839 $<C_COMPILER_VERSION> = The version of the C compiler used.
840 $<C_COMPILER_VERSION:ver> = '1' if the version of the C compiler matches ver, otherwise '0'.
841 $<CXX_COMPILER_VERSION> = The version of the CXX compiler used.
842 $<CXX_COMPILER_VERSION:ver> = '1' if the version of the CXX compiler matches ver, otherwise '0'.
843 $<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)
844 $<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)
845 $<TARGET_SONAME_FILE:tgt> = file with soname (.so.3)
846
847 where "tgt" is the name of a target. Target file expressions
848 produce a full path, but _DIR and _NAME versions can produce the
849 directory and file name components:
850
851
852 $<TARGET_FILE_DIR:tgt>/$<TARGET_FILE_NAME:tgt>
853 $<TARGET_LINKER_FILE_DIR:tgt>/$<TARGET_LINKER_FILE_NAME:tgt>
854 $<TARGET_SONAME_FILE_DIR:tgt>/$<TARGET_SONAME_FILE_NAME:tgt>
855
856
857
858
859 $<TARGET_PROPERTY:tgt,prop> = The value of the property prop on the target tgt.
860
861 Note that tgt is not added as a dependency of the target this
862 expression is evaluated on.
863
864
865 $<TARGET_POLICY:pol> = '1' if the policy was NEW when the 'head' target was created, else '0'. If the policy was not set, the warning message for the policy will be emitted. This generator expression only works for a subset of policies.
866 $<INSTALL_PREFIX> = Content of the install prefix when the target is exported via INSTALL(EXPORT) and empty otherwise.
867
868 Boolean expressions:
869
870
871 $<AND:?[,?]...> = '1' if all '?' are '1', else '0'
872 $<OR:?[,?]...> = '0' if all '?' are '0', else '1'
873 $<NOT:?> = '0' if '?' is '1', else '1'
874
875 where '?' is always either '0' or '1'.
876
877
878 Example usage:
879
880
881 add_test(NAME mytest
882 COMMAND testDriver --config $<CONFIGURATION>
883 --exe $<TARGET_FILE:myexe>)
884
885 This creates a test "mytest" whose command runs a testDriver
886 tool passing the configuration name and the full path to the
887 executable file produced by target "myexe".
888
889
890 aux_source_directory
891 Find all source files in a directory.
892
893 aux_source_directory(<dir> <variable>)
894
895 Collects the names of all the source files in the specified
896 directory and stores the list in the <variable> provided. This
897 command is intended to be used by projects that use explicit
898 template instantiation. Template instantiation files can be
899 stored in a "Templates" subdirectory and collected automatically
900 using this command to avoid manually listing all instantiations.
901
902
903 It is tempting to use this command to avoid writing the list of
904 source files for a library or executable target. While this
905 seems to work, there is no way for CMake to generate a build
906 system that knows when a new source file has been added. Nor‐
907 mally the generated build system knows when it needs to rerun
908 CMake because the CMakeLists.txt file is modified to add a new
909 source. When the source is just added to the directory without
910 modifying this file, one would have to manually rerun CMake to
911 generate a build system incorporating the new file.
912
913
914 break Break from an enclosing foreach or while loop.
915
916 break()
917
918 Breaks from an enclosing foreach loop or while loop
919
920
921 build_command
922 Get the command line to build this project.
923
924 build_command(<variable>
925 [CONFIGURATION <config>]
926 [PROJECT_NAME <projname>]
927 [TARGET <target>])
928
929 Sets the given <variable> to a string containing the command
930 line for building one configuration of a target in a project
931 using the build tool appropriate for the current CMAKE_GENERA‐
932 TOR.
933
934
935 If CONFIGURATION is omitted, CMake chooses a reasonable default
936 value for multi-configuration generators. CONFIGURATION is
937 ignored for single-configuration generators.
938
939
940 If PROJECT_NAME is omitted, the resulting command line will
941 build the top level PROJECT in the current build tree.
942
943
944 If TARGET is omitted, the resulting command line will build
945 everything, effectively using build target 'all' or 'ALL_BUILD'.
946
947
948 build_command(<cachevariable> <makecommand>)
949
950 This second signature is deprecated, but still available for
951 backwards compatibility. Use the first signature instead.
952
953
954 Sets the given <cachevariable> to a string containing the com‐
955 mand to build this project from the root of the build tree using
956 the build tool given by <makecommand>. <makecommand> should be
957 the full path to msdev, devenv, nmake, make or one of the end
958 user build tools.
959
960
961 cmake_host_system_information
962 Query host system specific information.
963
964 cmake_host_system_information(RESULT <variable> QUERY <key> ...)
965
966 Queries system information of the host system on which cmake
967 runs. One or more <key> can be provided to select the informa‐
968 tion to be queried. The list of queried values is stored in
969 <variable>.
970
971
972 <key> can be one of the following values:
973
974
975 NUMBER_OF_LOGICAL_CORES = Number of logical cores.
976 NUMBER_OF_PHYSICAL_CORES = Number of physical cores.
977 HOSTNAME = Hostname.
978 FQDN = Fully qualified domain name.
979 TOTAL_VIRTUAL_MEMORY = Total virtual memory in megabytes.
980 AVAILABLE_VIRTUAL_MEMORY = Available virtual memory in megabytes.
981 TOTAL_PHYSICAL_MEMORY = Total physical memory in megabytes.
982 AVAILABLE_PHYSICAL_MEMORY = Available physical memory in megabytes.
983
984
985 cmake_minimum_required
986 Set the minimum required version of cmake for a project.
987
988 cmake_minimum_required(VERSION major[.minor[.patch[.tweak]]]
989 [FATAL_ERROR])
990
991 If the current version of CMake is lower than that required it
992 will stop processing the project and report an error. When a
993 version higher than 2.4 is specified the command implicitly
994 invokes
995
996
997 cmake_policy(VERSION major[.minor[.patch[.tweak]]])
998
999 which sets the cmake policy version level to the version speci‐
1000 fied. When version 2.4 or lower is given the command implicitly
1001 invokes
1002
1003
1004 cmake_policy(VERSION 2.4)
1005
1006 which enables compatibility features for CMake 2.4 and lower.
1007
1008
1009 The FATAL_ERROR option is accepted but ignored by CMake 2.6 and
1010 higher. It should be specified so CMake versions 2.4 and lower
1011 fail with an error instead of just a warning.
1012
1013
1014 cmake_policy
1015 Manage CMake Policy settings.
1016
1017 As CMake evolves it is sometimes necessary to change existing
1018 behavior in order to fix bugs or improve implementations of
1019 existing features. The CMake Policy mechanism is designed to
1020 help keep existing projects building as new versions of CMake
1021 introduce changes in behavior. Each new policy (behavioral
1022 change) is given an identifier of the form "CMP<NNNN>" where
1023 "<NNNN>" is an integer index. Documentation associated with
1024 each policy describes the OLD and NEW behavior and the reason
1025 the policy was introduced. Projects may set each policy to
1026 select the desired behavior. When CMake needs to know which
1027 behavior to use it checks for a setting specified by the
1028 project. If no setting is available the OLD behavior is assumed
1029 and a warning is produced requesting that the policy be set.
1030
1031
1032 The cmake_policy command is used to set policies to OLD or NEW
1033 behavior. While setting policies individually is supported, we
1034 encourage projects to set policies based on CMake versions.
1035
1036
1037 cmake_policy(VERSION major.minor[.patch[.tweak]])
1038
1039 Specify that the current CMake list file is written for the
1040 given version of CMake. All policies introduced in the speci‐
1041 fied version or earlier will be set to use NEW behavior. All
1042 policies introduced after the specified version will be unset
1043 (unless variable CMAKE_POLICY_DEFAULT_CMP<NNNN> sets a default).
1044 This effectively requests behavior preferred as of a given CMake
1045 version and tells newer CMake versions to warn about their new
1046 policies. The policy version specified must be at least 2.4 or
1047 the command will report an error. In order to get compatibility
1048 features supporting versions earlier than 2.4 see documentation
1049 of policy CMP0001.
1050
1051
1052 cmake_policy(SET CMP<NNNN> NEW)
1053 cmake_policy(SET CMP<NNNN> OLD)
1054
1055 Tell CMake to use the OLD or NEW behavior for a given policy.
1056 Projects depending on the old behavior of a given policy may
1057 silence a policy warning by setting the policy state to OLD.
1058 Alternatively one may fix the project to work with the new
1059 behavior and set the policy state to NEW.
1060
1061
1062 cmake_policy(GET CMP<NNNN> <variable>)
1063
1064 Check whether a given policy is set to OLD or NEW behavior. The
1065 output variable value will be "OLD" or "NEW" if the policy is
1066 set, and empty otherwise.
1067
1068
1069 CMake keeps policy settings on a stack, so changes made by the
1070 cmake_policy command affect only the top of the stack. A new
1071 entry on the policy stack is managed automatically for each sub‐
1072 directory to protect its parents and siblings. CMake also man‐
1073 ages a new entry for scripts loaded by include() and find_pack‐
1074 age() commands except when invoked with the NO_POLICY_SCOPE
1075 option (see also policy CMP0011). The cmake_policy command pro‐
1076 vides an interface to manage custom entries on the policy stack:
1077
1078
1079 cmake_policy(PUSH)
1080 cmake_policy(POP)
1081
1082 Each PUSH must have a matching POP to erase any changes. This
1083 is useful to make temporary changes to policy settings.
1084
1085
1086 Functions and macros record policy settings when they are cre‐
1087 ated and use the pre-record policies when they are invoked. If
1088 the function or macro implementation sets policies, the changes
1089 automatically propagate up through callers until they reach the
1090 closest nested policy stack entry.
1091
1092
1093 configure_file
1094 Copy a file to another location and modify its contents.
1095
1096 configure_file(<input> <output>
1097 [COPYONLY] [ESCAPE_QUOTES] [@ONLY]
1098 [NEWLINE_STYLE [UNIX|DOS|WIN32|LF|CRLF] ])
1099
1100 Copies a file <input> to file <output> and substitutes variable
1101 values referenced in the file content. If <input> is a relative
1102 path it is evaluated with respect to the current source direc‐
1103 tory. The <input> must be a file, not a directory. If <output>
1104 is a relative path it is evaluated with respect to the current
1105 binary directory. If <output> names an existing directory the
1106 input file is placed in that directory with its original name.
1107
1108
1109 If the <input> file is modified the build system will re-run
1110 CMake to re-configure the file and generate the build system
1111 again.
1112
1113
1114 This command replaces any variables in the input file referenced
1115 as ${VAR} or @VAR@ with their values as determined by CMake. If
1116 a variable is not defined, it will be replaced with nothing. If
1117 COPYONLY is specified, then no variable expansion will take
1118 place. If ESCAPE_QUOTES is specified then any substituted
1119 quotes will be C-style escaped. The file will be configured
1120 with the current values of CMake variables. If @ONLY is speci‐
1121 fied, only variables of the form @VAR@ will be replaced and
1122 ${VAR} will be ignored. This is useful for configuring scripts
1123 that use ${VAR}.
1124
1125
1126 Input file lines of the form "#cmakedefine VAR ..." will be
1127 replaced with either "#define VAR ..." or "/* #undef VAR */"
1128 depending on whether VAR is set in CMake to any value not con‐
1129 sidered a false constant by the if() command. (Content of "...",
1130 if any, is processed as above.) Input file lines of the form
1131 "#cmakedefine01 VAR" will be replaced with either "#define VAR
1132 1" or "#define VAR 0" similarly.
1133
1134
1135 With NEWLINE_STYLE the line ending could be adjusted:
1136
1137
1138 'UNIX' or 'LF' for \n, 'DOS', 'WIN32' or 'CRLF' for \r\n.
1139
1140 COPYONLY must not be used with NEWLINE_STYLE.
1141
1142
1143
1144 create_test_sourcelist
1145 Create a test driver and source list for building test programs.
1146
1147 create_test_sourcelist(sourceListName driverName
1148 test1 test2 test3
1149 EXTRA_INCLUDE include.h
1150 FUNCTION function)
1151
1152 A test driver is a program that links together many small tests
1153 into a single executable. This is useful when building static
1154 executables with large libraries to shrink the total required
1155 size. The list of source files needed to build the test driver
1156 will be in sourceListName. DriverName is the name of the test
1157 driver program. The rest of the arguments consist of a list of
1158 test source files, can be semicolon separated. Each test source
1159 file should have a function in it that is the same name as the
1160 file with no extension (foo.cxx should have int foo(int,
1161 char*[]);) DriverName will be able to call each of the tests by
1162 name on the command line. If EXTRA_INCLUDE is specified, then
1163 the next argument is included into the generated file. If FUNC‐
1164 TION is specified, then the next argument is taken as a function
1165 name that is passed a pointer to ac and av. This can be used to
1166 add extra command line processing to each test. The cmake vari‐
1167 able CMAKE_TESTDRIVER_BEFORE_TESTMAIN can be set to have code
1168 that will be placed directly before calling the test main func‐
1169 tion. CMAKE_TESTDRIVER_AFTER_TESTMAIN can be set to have code
1170 that will be placed directly after the call to the test main
1171 function.
1172
1173
1174 define_property
1175 Define and document custom properties.
1176
1177 define_property(<GLOBAL | DIRECTORY | TARGET | SOURCE |
1178 TEST | VARIABLE | CACHED_VARIABLE>
1179 PROPERTY <name> [INHERITED]
1180 BRIEF_DOCS <brief-doc> [docs...]
1181 FULL_DOCS <full-doc> [docs...])
1182
1183 Define one property in a scope for use with the set_property and
1184 get_property commands. This is primarily useful to associate
1185 documentation with property names that may be retrieved with the
1186 get_property command. The first argument determines the kind of
1187 scope in which the property should be used. It must be one of
1188 the following:
1189
1190
1191 GLOBAL = associated with the global namespace
1192 DIRECTORY = associated with one directory
1193 TARGET = associated with one target
1194 SOURCE = associated with one source file
1195 TEST = associated with a test named with add_test
1196 VARIABLE = documents a CMake language variable
1197 CACHED_VARIABLE = documents a CMake cache variable
1198
1199 Note that unlike set_property and get_property no actual scope
1200 needs to be given; only the kind of scope is important.
1201
1202
1203 The required PROPERTY option is immediately followed by the name
1204 of the property being defined.
1205
1206
1207 If the INHERITED option then the get_property command will chain
1208 up to the next higher scope when the requested property is not
1209 set in the scope given to the command. DIRECTORY scope chains
1210 to GLOBAL. TARGET, SOURCE, and TEST chain to DIRECTORY.
1211
1212
1213 The BRIEF_DOCS and FULL_DOCS options are followed by strings to
1214 be associated with the property as its brief and full documenta‐
1215 tion. Corresponding options to the get_property command will
1216 retrieve the documentation.
1217
1218
1219 else Starts the else portion of an if block.
1220
1221 else(expression)
1222
1223 See the if command.
1224
1225
1226 elseif Starts the elseif portion of an if block.
1227
1228 elseif(expression)
1229
1230 See the if command.
1231
1232
1233 enable_language
1234 Enable a language (CXX/C/Fortran/etc)
1235
1236 enable_language(<lang> [OPTIONAL] )
1237
1238 This command enables support for the named language in CMake.
1239 This is the same as the project command but does not create any
1240 of the extra variables that are created by the project command.
1241 Example languages are CXX, C, Fortran.
1242
1243
1244 This command must be called in file scope, not in a function
1245 call. Furthermore, it must be called in the highest directory
1246 common to all targets using the named language directly for com‐
1247 piling sources or indirectly through link dependencies. It is
1248 simplest to enable all needed languages in the top-level direc‐
1249 tory of a project.
1250
1251
1252 The OPTIONAL keyword is a placeholder for future implementation
1253 and does not currently work.
1254
1255
1256 enable_testing
1257 Enable testing for current directory and below.
1258
1259 enable_testing()
1260
1261 Enables testing for this directory and below. See also the
1262 add_test command. Note that ctest expects to find a test file
1263 in the build directory root. Therefore, this command should be
1264 in the source directory root.
1265
1266
1267 endforeach
1268 Ends a list of commands in a FOREACH block.
1269
1270 endforeach(expression)
1271
1272 See the FOREACH command.
1273
1274
1275 endfunction
1276 Ends a list of commands in a function block.
1277
1278 endfunction(expression)
1279
1280 See the function command.
1281
1282
1283 endif Ends a list of commands in an if block.
1284
1285 endif(expression)
1286
1287 See the if command.
1288
1289
1290 endmacro
1291 Ends a list of commands in a macro block.
1292
1293 endmacro(expression)
1294
1295 See the macro command.
1296
1297
1298 endwhile
1299 Ends a list of commands in a while block.
1300
1301 endwhile(expression)
1302
1303 See the while command.
1304
1305
1306 execute_process
1307 Execute one or more child processes.
1308
1309 execute_process(COMMAND <cmd1> [args1...]]
1310 [COMMAND <cmd2> [args2...] [...]]
1311 [WORKING_DIRECTORY <directory>]
1312 [TIMEOUT <seconds>]
1313 [RESULT_VARIABLE <variable>]
1314 [OUTPUT_VARIABLE <variable>]
1315 [ERROR_VARIABLE <variable>]
1316 [INPUT_FILE <file>]
1317 [OUTPUT_FILE <file>]
1318 [ERROR_FILE <file>]
1319 [OUTPUT_QUIET]
1320 [ERROR_QUIET]
1321 [OUTPUT_STRIP_TRAILING_WHITESPACE]
1322 [ERROR_STRIP_TRAILING_WHITESPACE])
1323
1324 Runs the given sequence of one or more commands with the stan‐
1325 dard output of each process piped to the standard input of the
1326 next. A single standard error pipe is used for all processes.
1327 If WORKING_DIRECTORY is given the named directory will be set as
1328 the current working directory of the child processes. If TIME‐
1329 OUT is given the child processes will be terminated if they do
1330 not finish in the specified number of seconds (fractions are
1331 allowed). If RESULT_VARIABLE is given the variable will be set
1332 to contain the result of running the processes. This will be an
1333 integer return code from the last child or a string describing
1334 an error condition. If OUTPUT_VARIABLE or ERROR_VARIABLE are
1335 given the variable named will be set with the contents of the
1336 standard output and standard error pipes respectively. If the
1337 same variable is named for both pipes their output will be
1338 merged in the order produced. If INPUT_FILE, OUTPUT_FILE, or
1339 ERROR_FILE is given the file named will be attached to the stan‐
1340 dard input of the first process, standard output of the last
1341 process, or standard error of all processes respectively. If
1342 OUTPUT_QUIET or ERROR_QUIET is given then the standard output or
1343 standard error results will be quietly ignored. If more than
1344 one OUTPUT_* or ERROR_* option is given for the same pipe the
1345 precedence is not specified. If no OUTPUT_* or ERROR_* options
1346 are given the output will be shared with the corresponding pipes
1347 of the CMake process itself.
1348
1349
1350 The execute_process command is a newer more powerful version of
1351 exec_program, but the old command has been kept for compatibil‐
1352 ity.
1353
1354
1355 export Export targets from the build tree for use by outside projects.
1356
1357 export(TARGETS [target1 [target2 [...]]] [NAMESPACE <namespace>]
1358 [APPEND] FILE <filename> [EXPORT_LINK_INTERFACE_LIBRARIES])
1359
1360 Create a file <filename> that may be included by outside
1361 projects to import targets from the current project's build
1362 tree. This is useful during cross-compiling to build utility
1363 executables that can run on the host platform in one project and
1364 then import them into another project being compiled for the
1365 target platform. If the NAMESPACE option is given the <names‐
1366 pace> string will be prepended to all target names written to
1367 the file. If the APPEND option is given the generated code will
1368 be appended to the file instead of overwriting it. The
1369 EXPORT_LINK_INTERFACE_LIBRARIES keyword, if present, causes the
1370 contents of the properties matching (IMPORTED_)?LINK_INTER‐
1371 FACE_LIBRARIES(_<CONFIG>)? to be exported, when policy CMP0022
1372 is NEW. If a library target is included in the export but a
1373 target to which it links is not included the behavior is unspec‐
1374 ified.
1375
1376
1377 The file created by this command is specific to the build tree
1378 and should never be installed. See the install(EXPORT) command
1379 to export targets from an installation tree.
1380
1381
1382 Do not set properties that affect the location of a target after
1383 passing it to this command. These include properties whose
1384 names match "(RUNTIME|LIBRARY|ARCHIVE)_OUTPUT_(NAME|DIREC‐
1385 TORY)(_<CONFIG>)?", "(IMPLIB_)?(PREFIX|SUFFIX)", or "LINKER_LAN‐
1386 GUAGE". Failure to follow this rule is not diagnosed and leaves
1387 the location of the target undefined.
1388
1389
1390 export(PACKAGE <name>)
1391
1392 Store the current build directory in the CMake user package reg‐
1393 istry for package <name>. The find_package command may consider
1394 the directory while searching for package <name>. This helps
1395 dependent projects find and use a package from the current
1396 project's build tree without help from the user. Note that the
1397 entry in the package registry that this command creates works
1398 only in conjunction with a package configuration file
1399 (<name>Config.cmake) that works with the build tree.
1400
1401
1402 file File manipulation command.
1403
1404 file(WRITE filename "message to write"... )
1405 file(APPEND filename "message to write"... )
1406 file(READ filename variable [LIMIT numBytes] [OFFSET offset] [HEX])
1407 file(<MD5|SHA1|SHA224|SHA256|SHA384|SHA512> filename variable)
1408 file(STRINGS filename variable [LIMIT_COUNT num]
1409 [LIMIT_INPUT numBytes] [LIMIT_OUTPUT numBytes]
1410 [LENGTH_MINIMUM numBytes] [LENGTH_MAXIMUM numBytes]
1411 [NEWLINE_CONSUME] [REGEX regex]
1412 [NO_HEX_CONVERSION])
1413 file(GLOB variable [RELATIVE path] [globbing expressions]...)
1414 file(GLOB_RECURSE variable [RELATIVE path]
1415 [FOLLOW_SYMLINKS] [globbing expressions]...)
1416 file(RENAME <oldname> <newname>)
1417 file(REMOVE [file1 ...])
1418 file(REMOVE_RECURSE [file1 ...])
1419 file(MAKE_DIRECTORY [directory1 directory2 ...])
1420 file(RELATIVE_PATH variable directory file)
1421 file(TO_CMAKE_PATH path result)
1422 file(TO_NATIVE_PATH path result)
1423 file(DOWNLOAD url file [INACTIVITY_TIMEOUT timeout]
1424 [TIMEOUT timeout] [STATUS status] [LOG log] [SHOW_PROGRESS]
1425 [EXPECTED_HASH ALGO=value] [EXPECTED_MD5 sum]
1426 [TLS_VERIFY on|off] [TLS_CAINFO file])
1427 file(UPLOAD filename url [INACTIVITY_TIMEOUT timeout]
1428 [TIMEOUT timeout] [STATUS status] [LOG log] [SHOW_PROGRESS])
1429 file(TIMESTAMP filename variable [<format string>] [UTC])
1430 file(GENERATE OUTPUT output_file
1431 <INPUT input_file|CONTENT input_content>
1432 [CONDITION expression])
1433
1434 WRITE will write a message into a file called 'filename'. It
1435 overwrites the file if it already exists, and creates the file
1436 if it does not exist. (If the file is a build input, use config‐
1437 ure_file to update the file only when its content changes.)
1438
1439
1440 APPEND will write a message into a file same as WRITE, except it
1441 will append it to the end of the file
1442
1443
1444 READ will read the content of a file and store it into the vari‐
1445 able. It will start at the given offset and read up to numBytes.
1446 If the argument HEX is given, the binary data will be converted
1447 to hexadecimal representation and this will be stored in the
1448 variable.
1449
1450
1451 MD5, SHA1, SHA224, SHA256, SHA384, and SHA512 will compute a
1452 cryptographic hash of the content of a file.
1453
1454
1455 STRINGS will parse a list of ASCII strings from a file and store
1456 it in a variable. Binary data in the file are ignored. Carriage
1457 return (CR) characters are ignored. It works also for Intel Hex
1458 and Motorola S-record files, which are automatically converted
1459 to binary format when reading them. Disable this using
1460 NO_HEX_CONVERSION.
1461
1462
1463 LIMIT_COUNT sets the maximum number of strings to return.
1464 LIMIT_INPUT sets the maximum number of bytes to read from the
1465 input file. LIMIT_OUTPUT sets the maximum number of bytes to
1466 store in the output variable. LENGTH_MINIMUM sets the minimum
1467 length of a string to return. Shorter strings are ignored.
1468 LENGTH_MAXIMUM sets the maximum length of a string to return.
1469 Longer strings are split into strings no longer than the maximum
1470 length. NEWLINE_CONSUME allows newlines to be included in
1471 strings instead of terminating them.
1472
1473
1474 REGEX specifies a regular expression that a string must match to
1475 be returned. Typical usage
1476
1477
1478 file(STRINGS myfile.txt myfile)
1479
1480 stores a list in the variable "myfile" in which each item is a
1481 line from the input file.
1482
1483
1484 GLOB will generate a list of all files that match the globbing
1485 expressions and store it into the variable. Globbing expressions
1486 are similar to regular expressions, but much simpler. If RELA‐
1487 TIVE flag is specified for an expression, the results will be
1488 returned as a relative path to the given path. (We do not rec‐
1489 ommend using GLOB to collect a list of source files from your
1490 source tree. If no CMakeLists.txt file changes when a source is
1491 added or removed then the generated build system cannot know
1492 when to ask CMake to regenerate.)
1493
1494
1495 Examples of globbing expressions include:
1496
1497
1498 *.cxx - match all files with extension cxx
1499 *.vt? - match all files with extension vta,...,vtz
1500 f[3-5].txt - match files f3.txt, f4.txt, f5.txt
1501
1502 GLOB_RECURSE will generate a list similar to the regular GLOB,
1503 except it will traverse all the subdirectories of the matched
1504 directory and match the files. Subdirectories that are symlinks
1505 are only traversed if FOLLOW_SYMLINKS is given or cmake policy
1506 CMP0009 is not set to NEW. See cmake --help-policy CMP0009 for
1507 more information.
1508
1509
1510 Examples of recursive globbing include:
1511
1512
1513 /dir/*.py - match all python files in /dir and subdirectories
1514
1515 MAKE_DIRECTORY will create the given directories, also if their
1516 parent directories don't exist yet
1517
1518
1519 RENAME moves a file or directory within a filesystem, replacing
1520 the destination atomically.
1521
1522
1523 REMOVE will remove the given files, also in subdirectories
1524
1525
1526 REMOVE_RECURSE will remove the given files and directories, also
1527 non-empty directories
1528
1529
1530 RELATIVE_PATH will determine relative path from directory to the
1531 given file.
1532
1533
1534 TO_CMAKE_PATH will convert path into a cmake style path with
1535 unix /. The input can be a single path or a system path like
1536 "$ENV{PATH}". Note the double quotes around the ENV call
1537 TO_CMAKE_PATH only takes one argument. This command will also
1538 convert the native list delimiters for a list of paths like the
1539 PATH environment variable.
1540
1541
1542 TO_NATIVE_PATH works just like TO_CMAKE_PATH, but will convert
1543 from a cmake style path into the native path style \ for win‐
1544 dows and / for UNIX.
1545
1546
1547 DOWNLOAD will download the given URL to the given file. If LOG
1548 var is specified a log of the download will be put in var. If
1549 STATUS var is specified the status of the operation will be put
1550 in var. The status is returned in a list of length 2. The first
1551 element is the numeric return value for the operation, and the
1552 second element is a string value for the error. A 0 numeric
1553 error means no error in the operation. If TIMEOUT time is speci‐
1554 fied, the operation will timeout after time seconds, time should
1555 be specified as an integer. The INACTIVITY_TIMEOUT specifies an
1556 integer number of seconds of inactivity after which the opera‐
1557 tion should terminate. If EXPECTED_HASH ALGO=value is specified,
1558 the operation will verify that the downloaded file's actual hash
1559 matches the expected value, where ALGO is one of MD5, SHA1,
1560 SHA224, SHA256, SHA384, or SHA512. If it does not match, the
1561 operation fails with an error. ("EXPECTED_MD5 sum" is short-hand
1562 for "EXPECTED_HASH MD5=sum".) If SHOW_PROGRESS is specified,
1563 progress information will be printed as status messages until
1564 the operation is complete. For https URLs CMake must be built
1565 with OpenSSL. TLS/SSL certificates are not checked by default.
1566 Set TLS_VERIFY to ON to check certificates and/or use
1567 EXPECTED_HASH to verify downloaded content. Set TLS_CAINFO to
1568 specify a custom Certificate Authority file. If either TLS
1569 option is not given CMake will check variables CMAKE_TLS_VERIFY
1570 and CMAKE_TLS_CAINFO, respectively.
1571
1572
1573 UPLOAD will upload the given file to the given URL. If LOG var
1574 is specified a log of the upload will be put in var. If STATUS
1575 var is specified the status of the operation will be put in var.
1576 The status is returned in a list of length 2. The first element
1577 is the numeric return value for the operation, and the second
1578 element is a string value for the error. A 0 numeric error means
1579 no error in the operation. If TIMEOUT time is specified, the
1580 operation will timeout after time seconds, time should be speci‐
1581 fied as an integer. The INACTIVITY_TIMEOUT specifies an integer
1582 number of seconds of inactivity after which the operation should
1583 terminate. If SHOW_PROGRESS is specified, progress information
1584 will be printed as status messages until the operation is com‐
1585 plete.
1586
1587
1588 TIMESTAMP will write a string representation of the modification
1589 time of filename to variable.
1590
1591
1592 Should the command be unable to obtain a timestamp variable will
1593 be set to the empty string "".
1594
1595
1596 See documentation of the string TIMESTAMP sub-command for more
1597 details.
1598
1599
1600 The file() command also provides COPY and INSTALL signatures:
1601
1602
1603 file(<COPY|INSTALL> files... DESTINATION <dir>
1604 [FILE_PERMISSIONS permissions...]
1605 [DIRECTORY_PERMISSIONS permissions...]
1606 [NO_SOURCE_PERMISSIONS] [USE_SOURCE_PERMISSIONS]
1607 [FILES_MATCHING]
1608 [[PATTERN <pattern> | REGEX <regex>]
1609 [EXCLUDE] [PERMISSIONS permissions...]] [...])
1610
1611 The COPY signature copies files, directories, and symlinks to a
1612 destination folder. Relative input paths are evaluated with
1613 respect to the current source directory, and a relative destina‐
1614 tion is evaluated with respect to the current build directory.
1615 Copying preserves input file timestamps, and optimizes out a
1616 file if it exists at the destination with the same timestamp.
1617 Copying preserves input permissions unless explicit permissions
1618 or NO_SOURCE_PERMISSIONS are given (default is USE_SOURCE_PER‐
1619 MISSIONS). See the install(DIRECTORY) command for documentation
1620 of permissions, PATTERN, REGEX, and EXCLUDE options.
1621
1622
1623 The INSTALL signature differs slightly from COPY: it prints sta‐
1624 tus messages, and NO_SOURCE_PERMISSIONS is default. Installa‐
1625 tion scripts generated by the install() command use this signa‐
1626 ture (with some undocumented options for internal use).
1627
1628
1629 GENERATE will write an <output_file> with content from an
1630 <input_file>, or from <input_content>. The output is generated
1631 conditionally based on the content of the <condition>. The file
1632 is written at CMake generate-time and the input may contain gen‐
1633 erator expressions. The <condition>, <output_file> and
1634 <input_file> may also contain generator expressions. The <con‐
1635 dition> must evaluate to either '0' or '1'. The <output_file>
1636 must evaluate to a unique name among all configurations and
1637 among all invocations of file(GENERATE).
1638
1639
1640 find_file
1641 Find the full path to a file.
1642
1643 find_file(<VAR> name1 [path1 path2 ...])
1644
1645 This is the short-hand signature for the command that is suffi‐
1646 cient in many cases. It is the same as find_file(<VAR> name1
1647 [PATHS path1 path2 ...])
1648
1649
1650 find_file(
1651 <VAR>
1652 name | NAMES name1 [name2 ...]
1653 [HINTS path1 [path2 ... ENV var]]
1654 [PATHS path1 [path2 ... ENV var]]
1655 [PATH_SUFFIXES suffix1 [suffix2 ...]]
1656 [DOC "cache documentation string"]
1657 [NO_DEFAULT_PATH]
1658 [NO_CMAKE_ENVIRONMENT_PATH]
1659 [NO_CMAKE_PATH]
1660 [NO_SYSTEM_ENVIRONMENT_PATH]
1661 [NO_CMAKE_SYSTEM_PATH]
1662 [CMAKE_FIND_ROOT_PATH_BOTH |
1663 ONLY_CMAKE_FIND_ROOT_PATH |
1664 NO_CMAKE_FIND_ROOT_PATH]
1665 )
1666
1667 This command is used to find a full path to named file. A cache
1668 entry named by <VAR> is created to store the result of this com‐
1669 mand. If the full path to a file is found the result is stored
1670 in the variable and the search will not be repeated unless the
1671 variable is cleared. If nothing is found, the result will be
1672 <VAR>-NOTFOUND, and the search will be attempted again the next
1673 time find_file is invoked with the same variable. The name of
1674 the full path to a file that is searched for is specified by the
1675 names listed after the NAMES argument. Additional search loca‐
1676 tions can be specified after the PATHS argument. If ENV var is
1677 found in the HINTS or PATHS section the environment variable var
1678 will be read and converted from a system environment variable to
1679 a cmake style list of paths. For example ENV PATH would be a
1680 way to list the system path variable. The argument after DOC
1681 will be used for the documentation string in the cache.
1682 PATH_SUFFIXES specifies additional subdirectories to check below
1683 each search path.
1684
1685
1686 If NO_DEFAULT_PATH is specified, then no additional paths are
1687 added to the search. If NO_DEFAULT_PATH is not specified, the
1688 search process is as follows:
1689
1690
1691 1. Search paths specified in cmake-specific cache variables.
1692 These are intended to be used on the command line with a
1693 -DVAR=value. This can be skipped if NO_CMAKE_PATH is passed.
1694
1695
1696 <prefix>/include/<arch> if CMAKE_LIBRARY_ARCHITECTURE is set, and
1697 <prefix>/include for each <prefix> in CMAKE_PREFIX_PATH
1698 CMAKE_INCLUDE_PATH
1699 CMAKE_FRAMEWORK_PATH
1700
1701 2. Search paths specified in cmake-specific environment vari‐
1702 ables. These are intended to be set in the user's shell config‐
1703 uration. This can be skipped if NO_CMAKE_ENVIRONMENT_PATH is
1704 passed.
1705
1706
1707 <prefix>/include/<arch> if CMAKE_LIBRARY_ARCHITECTURE is set, and
1708 <prefix>/include for each <prefix> in CMAKE_PREFIX_PATH
1709 CMAKE_INCLUDE_PATH
1710 CMAKE_FRAMEWORK_PATH
1711
1712 3. Search the paths specified by the HINTS option. These should
1713 be paths computed by system introspection, such as a hint pro‐
1714 vided by the location of another item already found. Hard-coded
1715 guesses should be specified with the PATHS option.
1716
1717
1718 4. Search the standard system environment variables. This can be
1719 skipped if NO_SYSTEM_ENVIRONMENT_PATH is an argument.
1720
1721
1722 PATH
1723 INCLUDE
1724
1725 5. Search cmake variables defined in the Platform files for the
1726 current system. This can be skipped if NO_CMAKE_SYSTEM_PATH is
1727 passed.
1728
1729
1730 <prefix>/include/<arch> if CMAKE_LIBRARY_ARCHITECTURE is set, and
1731 <prefix>/include for each <prefix> in CMAKE_SYSTEM_PREFIX_PATH
1732 CMAKE_SYSTEM_INCLUDE_PATH
1733 CMAKE_SYSTEM_FRAMEWORK_PATH
1734
1735 6. Search the paths specified by the PATHS option or in the
1736 short-hand version of the command. These are typically
1737 hard-coded guesses.
1738
1739
1740 On Darwin or systems supporting OS X Frameworks, the cmake vari‐
1741 able CMAKE_FIND_FRAMEWORK can be set to empty or one of the
1742 following:
1743
1744
1745 "FIRST" - Try to find frameworks before standard
1746 libraries or headers. This is the default on Darwin.
1747 "LAST" - Try to find frameworks after standard
1748 libraries or headers.
1749 "ONLY" - Only try to find frameworks.
1750 "NEVER" - Never try to find frameworks.
1751
1752 On Darwin or systems supporting OS X Application Bundles, the
1753 cmake variable CMAKE_FIND_APPBUNDLE can be set to empty or one
1754 of the following:
1755
1756
1757 "FIRST" - Try to find application bundles before standard
1758 programs. This is the default on Darwin.
1759 "LAST" - Try to find application bundles after standard
1760 programs.
1761 "ONLY" - Only try to find application bundles.
1762 "NEVER" - Never try to find application bundles.
1763
1764 The CMake variable CMAKE_FIND_ROOT_PATH specifies one or more
1765 directories to be prepended to all other search directories.
1766 This effectively "re-roots" the entire search under given loca‐
1767 tions. By default it is empty. It is especially useful when
1768 cross-compiling to point to the root directory of the target
1769 environment and CMake will search there too. By default at first
1770 the directories listed in CMAKE_FIND_ROOT_PATH and then the
1771 non-rooted directories will be searched. The default behavior
1772 can be adjusted by setting CMAKE_FIND_ROOT_PATH_MODE_INCLUDE.
1773 This behavior can be manually overridden on a per-call basis. By
1774 using CMAKE_FIND_ROOT_PATH_BOTH the search order will be as
1775 described above. If NO_CMAKE_FIND_ROOT_PATH is used then
1776 CMAKE_FIND_ROOT_PATH will not be used. If
1777 ONLY_CMAKE_FIND_ROOT_PATH is used then only the re-rooted direc‐
1778 tories will be searched.
1779
1780
1781 The default search order is designed to be most-specific to
1782 least-specific for common use cases. Projects may override the
1783 order by simply calling the command multiple times and using the
1784 NO_* options:
1785
1786
1787 find_file(<VAR> NAMES name PATHS paths... NO_DEFAULT_PATH)
1788 find_file(<VAR> NAMES name)
1789
1790 Once one of the calls succeeds the result variable will be set
1791 and stored in the cache so that no call will search again.
1792
1793
1794 find_library
1795 Find a library.
1796
1797 find_library(<VAR> name1 [path1 path2 ...])
1798
1799 This is the short-hand signature for the command that is suffi‐
1800 cient in many cases. It is the same as find_library(<VAR> name1
1801 [PATHS path1 path2 ...])
1802
1803
1804 find_library(
1805 <VAR>
1806 name | NAMES name1 [name2 ...] [NAMES_PER_DIR]
1807 [HINTS path1 [path2 ... ENV var]]
1808 [PATHS path1 [path2 ... ENV var]]
1809 [PATH_SUFFIXES suffix1 [suffix2 ...]]
1810 [DOC "cache documentation string"]
1811 [NO_DEFAULT_PATH]
1812 [NO_CMAKE_ENVIRONMENT_PATH]
1813 [NO_CMAKE_PATH]
1814 [NO_SYSTEM_ENVIRONMENT_PATH]
1815 [NO_CMAKE_SYSTEM_PATH]
1816 [CMAKE_FIND_ROOT_PATH_BOTH |
1817 ONLY_CMAKE_FIND_ROOT_PATH |
1818 NO_CMAKE_FIND_ROOT_PATH]
1819 )
1820
1821 This command is used to find a library. A cache entry named by
1822 <VAR> is created to store the result of this command. If the
1823 library is found the result is stored in the variable and the
1824 search will not be repeated unless the variable is cleared. If
1825 nothing is found, the result will be <VAR>-NOTFOUND, and the
1826 search will be attempted again the next time find_library is
1827 invoked with the same variable. The name of the library that is
1828 searched for is specified by the names listed after the NAMES
1829 argument. Additional search locations can be specified after
1830 the PATHS argument. If ENV var is found in the HINTS or PATHS
1831 section the environment variable var will be read and converted
1832 from a system environment variable to a cmake style list of
1833 paths. For example ENV PATH would be a way to list the system
1834 path variable. The argument after DOC will be used for the docu‐
1835 mentation string in the cache. PATH_SUFFIXES specifies addi‐
1836 tional subdirectories to check below each search path.
1837
1838
1839 If NO_DEFAULT_PATH is specified, then no additional paths are
1840 added to the search. If NO_DEFAULT_PATH is not specified, the
1841 search process is as follows:
1842
1843
1844 1. Search paths specified in cmake-specific cache variables.
1845 These are intended to be used on the command line with a
1846 -DVAR=value. This can be skipped if NO_CMAKE_PATH is passed.
1847
1848
1849 <prefix>/lib/<arch> if CMAKE_LIBRARY_ARCHITECTURE is set, and
1850 <prefix>/lib for each <prefix> in CMAKE_PREFIX_PATH
1851 CMAKE_LIBRARY_PATH
1852 CMAKE_FRAMEWORK_PATH
1853
1854 2. Search paths specified in cmake-specific environment vari‐
1855 ables. These are intended to be set in the user's shell config‐
1856 uration. This can be skipped if NO_CMAKE_ENVIRONMENT_PATH is
1857 passed.
1858
1859
1860 <prefix>/lib/<arch> if CMAKE_LIBRARY_ARCHITECTURE is set, and
1861 <prefix>/lib for each <prefix> in CMAKE_PREFIX_PATH
1862 CMAKE_LIBRARY_PATH
1863 CMAKE_FRAMEWORK_PATH
1864
1865 3. Search the paths specified by the HINTS option. These should
1866 be paths computed by system introspection, such as a hint pro‐
1867 vided by the location of another item already found. Hard-coded
1868 guesses should be specified with the PATHS option.
1869
1870
1871 4. Search the standard system environment variables. This can be
1872 skipped if NO_SYSTEM_ENVIRONMENT_PATH is an argument.
1873
1874
1875 PATH
1876 LIB
1877
1878 5. Search cmake variables defined in the Platform files for the
1879 current system. This can be skipped if NO_CMAKE_SYSTEM_PATH is
1880 passed.
1881
1882
1883 <prefix>/lib/<arch> if CMAKE_LIBRARY_ARCHITECTURE is set, and
1884 <prefix>/lib for each <prefix> in CMAKE_SYSTEM_PREFIX_PATH
1885 CMAKE_SYSTEM_LIBRARY_PATH
1886 CMAKE_SYSTEM_FRAMEWORK_PATH
1887
1888 6. Search the paths specified by the PATHS option or in the
1889 short-hand version of the command. These are typically
1890 hard-coded guesses.
1891
1892
1893 On Darwin or systems supporting OS X Frameworks, the cmake vari‐
1894 able CMAKE_FIND_FRAMEWORK can be set to empty or one of the
1895 following:
1896
1897
1898 "FIRST" - Try to find frameworks before standard
1899 libraries or headers. This is the default on Darwin.
1900 "LAST" - Try to find frameworks after standard
1901 libraries or headers.
1902 "ONLY" - Only try to find frameworks.
1903 "NEVER" - Never try to find frameworks.
1904
1905 On Darwin or systems supporting OS X Application Bundles, the
1906 cmake variable CMAKE_FIND_APPBUNDLE can be set to empty or one
1907 of the following:
1908
1909
1910 "FIRST" - Try to find application bundles before standard
1911 programs. This is the default on Darwin.
1912 "LAST" - Try to find application bundles after standard
1913 programs.
1914 "ONLY" - Only try to find application bundles.
1915 "NEVER" - Never try to find application bundles.
1916
1917 The CMake variable CMAKE_FIND_ROOT_PATH specifies one or more
1918 directories to be prepended to all other search directories.
1919 This effectively "re-roots" the entire search under given loca‐
1920 tions. By default it is empty. It is especially useful when
1921 cross-compiling to point to the root directory of the target
1922 environment and CMake will search there too. By default at first
1923 the directories listed in CMAKE_FIND_ROOT_PATH and then the
1924 non-rooted directories will be searched. The default behavior
1925 can be adjusted by setting CMAKE_FIND_ROOT_PATH_MODE_LIBRARY.
1926 This behavior can be manually overridden on a per-call basis. By
1927 using CMAKE_FIND_ROOT_PATH_BOTH the search order will be as
1928 described above. If NO_CMAKE_FIND_ROOT_PATH is used then
1929 CMAKE_FIND_ROOT_PATH will not be used. If
1930 ONLY_CMAKE_FIND_ROOT_PATH is used then only the re-rooted direc‐
1931 tories will be searched.
1932
1933
1934 The default search order is designed to be most-specific to
1935 least-specific for common use cases. Projects may override the
1936 order by simply calling the command multiple times and using the
1937 NO_* options:
1938
1939
1940 find_library(<VAR> NAMES name PATHS paths... NO_DEFAULT_PATH)
1941 find_library(<VAR> NAMES name)
1942
1943 Once one of the calls succeeds the result variable will be set
1944 and stored in the cache so that no call will search again.
1945
1946
1947 When more than one value is given to the NAMES option this com‐
1948 mand by default will consider one name at a time and search
1949 every directory for it. The NAMES_PER_DIR option tells this
1950 command to consider one directory at a time and search for all
1951 names in it.
1952
1953
1954 If the library found is a framework, then VAR will be set to the
1955 full path to the framework <fullPath>/A.framework. When a full
1956 path to a framework is used as a library, CMake will use a
1957 -framework A, and a -F<fullPath> to link the framework to the
1958 target.
1959
1960
1961 If the global property FIND_LIBRARY_USE_LIB64_PATHS is set all
1962 search paths will be tested as normal, with "64/" appended, and
1963 with all matches of "lib/" replaced with "lib64/". This property
1964 is automatically set for the platforms that are known to need it
1965 if at least one of the languages supported by the PROJECT com‐
1966 mand is enabled.
1967
1968
1969 find_package
1970 Load settings for an external project.
1971
1972 find_package(<package> [version] [EXACT] [QUIET] [MODULE]
1973 [REQUIRED] [[COMPONENTS] [components...]]
1974 [OPTIONAL_COMPONENTS components...]
1975 [NO_POLICY_SCOPE])
1976
1977 Finds and loads settings from an external project. <pack‐
1978 age>_FOUND will be set to indicate whether the package was
1979 found. When the package is found package-specific information
1980 is provided through variables and imported targets documented by
1981 the package itself. The QUIET option disables messages if the
1982 package cannot be found. The MODULE option disables the second
1983 signature documented below. The REQUIRED option stops process‐
1984 ing with an error message if the package cannot be found.
1985
1986
1987 A package-specific list of required components may be listed
1988 after the COMPONENTS option (or after the REQUIRED option if
1989 present). Additional optional components may be listed after
1990 OPTIONAL_COMPONENTS. Available components and their influence
1991 on whether a package is considered to be found are defined by
1992 the target package.
1993
1994
1995 The [version] argument requests a version with which the package
1996 found should be compatible (format is
1997 major[.minor[.patch[.tweak]]]). The EXACT option requests that
1998 the version be matched exactly. If no [version] and/or compo‐
1999 nent list is given to a recursive invocation inside a find-mod‐
2000 ule, the corresponding arguments are forwarded automatically
2001 from the outer call (including the EXACT flag for [version]).
2002 Version support is currently provided only on a package-by-pack‐
2003 age basis (details below).
2004
2005
2006 User code should generally look for packages using the above
2007 simple signature. The remainder of this command documentation
2008 specifies the full command signature and details of the search
2009 process. Project maintainers wishing to provide a package to be
2010 found by this command are encouraged to read on.
2011
2012
2013 The command has two modes by which it searches for packages:
2014 "Module" mode and "Config" mode. Module mode is available when
2015 the command is invoked with the above reduced signature. CMake
2016 searches for a file called "Find<package>.cmake" in the
2017 CMAKE_MODULE_PATH followed by the CMake installation. If the
2018 file is found, it is read and processed by CMake. It is respon‐
2019 sible for finding the package, checking the version, and produc‐
2020 ing any needed messages. Many find-modules provide limited or
2021 no support for versioning; check the module documentation. If
2022 no module is found and the MODULE option is not given the com‐
2023 mand proceeds to Config mode.
2024
2025
2026 The complete Config mode command signature is:
2027
2028
2029 find_package(<package> [version] [EXACT] [QUIET]
2030 [REQUIRED] [[COMPONENTS] [components...]]
2031 [CONFIG|NO_MODULE]
2032 [NO_POLICY_SCOPE]
2033 [NAMES name1 [name2 ...]]
2034 [CONFIGS config1 [config2 ...]]
2035 [HINTS path1 [path2 ... ]]
2036 [PATHS path1 [path2 ... ]]
2037 [PATH_SUFFIXES suffix1 [suffix2 ...]]
2038 [NO_DEFAULT_PATH]
2039 [NO_CMAKE_ENVIRONMENT_PATH]
2040 [NO_CMAKE_PATH]
2041 [NO_SYSTEM_ENVIRONMENT_PATH]
2042 [NO_CMAKE_PACKAGE_REGISTRY]
2043 [NO_CMAKE_BUILDS_PATH]
2044 [NO_CMAKE_SYSTEM_PATH]
2045 [NO_CMAKE_SYSTEM_PACKAGE_REGISTRY]
2046 [CMAKE_FIND_ROOT_PATH_BOTH |
2047 ONLY_CMAKE_FIND_ROOT_PATH |
2048 NO_CMAKE_FIND_ROOT_PATH])
2049
2050 The CONFIG option may be used to skip Module mode explicitly and
2051 switch to Config mode. It is synonymous to using NO_MODULE.
2052 Config mode is also implied by use of options not specified in
2053 the reduced signature.
2054
2055
2056 Config mode attempts to locate a configuration file provided by
2057 the package to be found. A cache entry called <package>_DIR is
2058 created to hold the directory containing the file. By default
2059 the command searches for a package with the name <package>. If
2060 the NAMES option is given the names following it are used
2061 instead of <package>. The command searches for a file called
2062 "<name>Config.cmake" or "<lower-case-name>-config.cmake" for
2063 each name specified. A replacement set of possible configura‐
2064 tion file names may be given using the CONFIGS option. The
2065 search procedure is specified below. Once found, the configura‐
2066 tion file is read and processed by CMake. Since the file is
2067 provided by the package it already knows the location of package
2068 contents. The full path to the configuration file is stored in
2069 the cmake variable <package>_CONFIG.
2070
2071
2072 All configuration files which have been considered by CMake
2073 while searching for an installation of the package with an
2074 appropriate version are stored in the cmake variable <pack‐
2075 age>_CONSIDERED_CONFIGS, the associated versions in <pack‐
2076 age>_CONSIDERED_VERSIONS.
2077
2078
2079 If the package configuration file cannot be found CMake will
2080 generate an error describing the problem unless the QUIET argu‐
2081 ment is specified. If REQUIRED is specified and the package is
2082 not found a fatal error is generated and the configure step
2083 stops executing. If <package>_DIR has been set to a directory
2084 not containing a configuration file CMake will ignore it and
2085 search from scratch.
2086
2087
2088 When the [version] argument is given Config mode will only find
2089 a version of the package that claims compatibility with the
2090 requested version (format is major[.minor[.patch[.tweak]]]). If
2091 the EXACT option is given only a version of the package claiming
2092 an exact match of the requested version may be found. CMake
2093 does not establish any convention for the meaning of version
2094 numbers. Package version numbers are checked by "version" files
2095 provided by the packages themselves. For a candidate package
2096 configuration file "<config-file>.cmake" the corresponding ver‐
2097 sion file is located next to it and named either "<con‐
2098 fig-file>-version.cmake" or "<config-file>Version.cmake". If no
2099 such version file is available then the configuration file is
2100 assumed to not be compatible with any requested version. A
2101 basic version file containing generic version matching code can
2102 be created using the macro write_basic_package_version_file(),
2103 see its documentation for more details. When a version file is
2104 found it is loaded to check the requested version number. The
2105 version file is loaded in a nested scope in which the following
2106 variables have been defined:
2107
2108
2109 PACKAGE_FIND_NAME = the <package> name
2110 PACKAGE_FIND_VERSION = full requested version string
2111 PACKAGE_FIND_VERSION_MAJOR = major version if requested, else 0
2112 PACKAGE_FIND_VERSION_MINOR = minor version if requested, else 0
2113 PACKAGE_FIND_VERSION_PATCH = patch version if requested, else 0
2114 PACKAGE_FIND_VERSION_TWEAK = tweak version if requested, else 0
2115 PACKAGE_FIND_VERSION_COUNT = number of version components, 0 to 4
2116
2117 The version file checks whether it satisfies the requested ver‐
2118 sion and sets these variables:
2119
2120
2121 PACKAGE_VERSION = full provided version string
2122 PACKAGE_VERSION_EXACT = true if version is exact match
2123 PACKAGE_VERSION_COMPATIBLE = true if version is compatible
2124 PACKAGE_VERSION_UNSUITABLE = true if unsuitable as any version
2125
2126 These variables are checked by the find_package command to
2127 determine whether the configuration file provides an acceptable
2128 version. They are not available after the find_package call
2129 returns. If the version is acceptable the following variables
2130 are set:
2131
2132
2133 <package>_VERSION = full provided version string
2134 <package>_VERSION_MAJOR = major version if provided, else 0
2135 <package>_VERSION_MINOR = minor version if provided, else 0
2136 <package>_VERSION_PATCH = patch version if provided, else 0
2137 <package>_VERSION_TWEAK = tweak version if provided, else 0
2138 <package>_VERSION_COUNT = number of version components, 0 to 4
2139
2140 and the corresponding package configuration file is loaded.
2141 When multiple package configuration files are available whose
2142 version files claim compatibility with the version requested it
2143 is unspecified which one is chosen. No attempt is made to
2144 choose a highest or closest version number.
2145
2146
2147 Config mode provides an elaborate interface and search proce‐
2148 dure. Much of the interface is provided for completeness and
2149 for use internally by find-modules loaded by Module mode. Most
2150 user code should simply call
2151
2152
2153 find_package(<package> [major[.minor]] [EXACT] [REQUIRED|QUIET])
2154
2155 in order to find a package. Package maintainers providing CMake
2156 package configuration files are encouraged to name and install
2157 them such that the procedure outlined below will find them with‐
2158 out requiring use of additional options.
2159
2160
2161 CMake constructs a set of possible installation prefixes for the
2162 package. Under each prefix several directories are searched for
2163 a configuration file. The tables below show the directories
2164 searched. Each entry is meant for installation trees following
2165 Windows (W), UNIX (U), or Apple (A) conventions.
2166
2167
2168 <prefix>/ (W)
2169 <prefix>/(cmake|CMake)/ (W)
2170 <prefix>/<name>*/ (W)
2171 <prefix>/<name>*/(cmake|CMake)/ (W)
2172 <prefix>/(lib/<arch>|lib|share)/cmake/<name>*/ (U)
2173 <prefix>/(lib/<arch>|lib|share)/<name>*/ (U)
2174 <prefix>/(lib/<arch>|lib|share)/<name>*/(cmake|CMake)/ (U)
2175
2176 On systems supporting OS X Frameworks and Application Bundles
2177 the following directories are searched for frameworks or bundles
2178 containing a configuration file:
2179
2180
2181 <prefix>/<name>.framework/Resources/ (A)
2182 <prefix>/<name>.framework/Resources/CMake/ (A)
2183 <prefix>/<name>.framework/Versions/*/Resources/ (A)
2184 <prefix>/<name>.framework/Versions/*/Resources/CMake/ (A)
2185 <prefix>/<name>.app/Contents/Resources/ (A)
2186 <prefix>/<name>.app/Contents/Resources/CMake/ (A)
2187
2188 In all cases the <name> is treated as case-insensitive and cor‐
2189 responds to any of the names specified (<package> or names given
2190 by NAMES). Paths with lib/<arch> are enabled if
2191 CMAKE_LIBRARY_ARCHITECTURE is set. If PATH_SUFFIXES is speci‐
2192 fied the suffixes are appended to each (W) or (U) directory
2193 entry one-by-one.
2194
2195
2196 This set of directories is intended to work in cooperation with
2197 projects that provide configuration files in their installation
2198 trees. Directories above marked with (W) are intended for
2199 installations on Windows where the prefix may point at the top
2200 of an application's installation directory. Those marked with
2201 (U) are intended for installations on UNIX platforms where the
2202 prefix is shared by multiple packages. This is merely a conven‐
2203 tion, so all (W) and (U) directories are still searched on all
2204 platforms. Directories marked with (A) are intended for instal‐
2205 lations on Apple platforms. The cmake variables
2206 CMAKE_FIND_FRAMEWORK and CMAKE_FIND_APPBUNDLE determine the
2207 order of preference as specified below.
2208
2209
2210 The set of installation prefixes is constructed using the fol‐
2211 lowing steps. If NO_DEFAULT_PATH is specified all NO_* options
2212 are enabled.
2213
2214
2215 1. Search paths specified in cmake-specific cache variables.
2216 These are intended to be used on the command line with a
2217 -DVAR=value. This can be skipped if NO_CMAKE_PATH is passed.
2218
2219
2220 CMAKE_PREFIX_PATH
2221 CMAKE_FRAMEWORK_PATH
2222 CMAKE_APPBUNDLE_PATH
2223
2224 2. Search paths specified in cmake-specific environment vari‐
2225 ables. These are intended to be set in the user's shell config‐
2226 uration. This can be skipped if NO_CMAKE_ENVIRONMENT_PATH is
2227 passed.
2228
2229
2230 <package>_DIR
2231 CMAKE_PREFIX_PATH
2232 CMAKE_FRAMEWORK_PATH
2233 CMAKE_APPBUNDLE_PATH
2234
2235 3. Search paths specified by the HINTS option. These should be
2236 paths computed by system introspection, such as a hint provided
2237 by the location of another item already found. Hard-coded
2238 guesses should be specified with the PATHS option.
2239
2240
2241 4. Search the standard system environment variables. This can be
2242 skipped if NO_SYSTEM_ENVIRONMENT_PATH is passed. Path entries
2243 ending in "/bin" or "/sbin" are automatically converted to their
2244 parent directories.
2245
2246
2247 PATH
2248
2249 5. Search project build trees recently configured in a CMake
2250 GUI. This can be skipped if NO_CMAKE_BUILDS_PATH is passed. It
2251 is intended for the case when a user is building multiple depen‐
2252 dent projects one after another.
2253
2254
2255 6. Search paths stored in the CMake user package registry. This
2256 can be skipped if NO_CMAKE_PACKAGE_REGISTRY is passed. On Win‐
2257 dows a <package> may appear under registry key
2258
2259
2260 HKEY_CURRENT_USER\Software\Kitware\CMake\Packages\<package>
2261
2262 as a REG_SZ value, with arbitrary name, that specifies the
2263 directory containing the package configuration file. On UNIX
2264 platforms a <package> may appear under the directory
2265
2266
2267 ~/.cmake/packages/<package>
2268
2269 as a file, with arbitrary name, whose content specifies the
2270 directory containing the package configuration file. See the
2271 export(PACKAGE) command to create user package registry entries
2272 for project build trees.
2273
2274
2275 7. Search cmake variables defined in the Platform files for the
2276 current system. This can be skipped if NO_CMAKE_SYSTEM_PATH is
2277 passed.
2278
2279
2280 CMAKE_SYSTEM_PREFIX_PATH
2281 CMAKE_SYSTEM_FRAMEWORK_PATH
2282 CMAKE_SYSTEM_APPBUNDLE_PATH
2283
2284 8. Search paths stored in the CMake system package registry.
2285 This can be skipped if NO_CMAKE_SYSTEM_PACKAGE_REGISTRY is
2286 passed. On Windows a <package> may appear under registry key
2287
2288
2289 HKEY_LOCAL_MACHINE\Software\Kitware\CMake\Packages\<package>
2290
2291 as a REG_SZ value, with arbitrary name, that specifies the
2292 directory containing the package configuration file. There is
2293 no system package registry on non-Windows platforms.
2294
2295
2296 9. Search paths specified by the PATHS option. These are typi‐
2297 cally hard-coded guesses.
2298
2299
2300 On Darwin or systems supporting OS X Frameworks, the cmake vari‐
2301 able CMAKE_FIND_FRAMEWORK can be set to empty or one of the
2302 following:
2303
2304
2305 "FIRST" - Try to find frameworks before standard
2306 libraries or headers. This is the default on Darwin.
2307 "LAST" - Try to find frameworks after standard
2308 libraries or headers.
2309 "ONLY" - Only try to find frameworks.
2310 "NEVER" - Never try to find frameworks.
2311
2312 On Darwin or systems supporting OS X Application Bundles, the
2313 cmake variable CMAKE_FIND_APPBUNDLE can be set to empty or one
2314 of the following:
2315
2316
2317 "FIRST" - Try to find application bundles before standard
2318 programs. This is the default on Darwin.
2319 "LAST" - Try to find application bundles after standard
2320 programs.
2321 "ONLY" - Only try to find application bundles.
2322 "NEVER" - Never try to find application bundles.
2323
2324 The CMake variable CMAKE_FIND_ROOT_PATH specifies one or more
2325 directories to be prepended to all other search directories.
2326 This effectively "re-roots" the entire search under given loca‐
2327 tions. By default it is empty. It is especially useful when
2328 cross-compiling to point to the root directory of the target
2329 environment and CMake will search there too. By default at first
2330 the directories listed in CMAKE_FIND_ROOT_PATH and then the
2331 non-rooted directories will be searched. The default behavior
2332 can be adjusted by setting CMAKE_FIND_ROOT_PATH_MODE_PACKAGE.
2333 This behavior can be manually overridden on a per-call basis. By
2334 using CMAKE_FIND_ROOT_PATH_BOTH the search order will be as
2335 described above. If NO_CMAKE_FIND_ROOT_PATH is used then
2336 CMAKE_FIND_ROOT_PATH will not be used. If
2337 ONLY_CMAKE_FIND_ROOT_PATH is used then only the re-rooted direc‐
2338 tories will be searched.
2339
2340
2341 The default search order is designed to be most-specific to
2342 least-specific for common use cases. Projects may override the
2343 order by simply calling the command multiple times and using the
2344 NO_* options:
2345
2346
2347 find_package(<package> PATHS paths... NO_DEFAULT_PATH)
2348 find_package(<package>)
2349
2350 Once one of the calls succeeds the result variable will be set
2351 and stored in the cache so that no call will search again.
2352
2353
2354 Every non-REQUIRED find_package() call can be disabled by set‐
2355 ting the variable CMAKE_DISABLE_FIND_PACKAGE_<package> to TRUE.
2356 See the documentation for the CMAKE_DISABLE_FIND_PACKAGE_<pack‐
2357 age> variable for more information.
2358
2359
2360 When loading a find module or package configuration file
2361 find_package defines variables to provide information about the
2362 call arguments (and restores their original state before return‐
2363 ing):
2364
2365
2366 <package>_FIND_REQUIRED = true if REQUIRED option was given
2367 <package>_FIND_QUIETLY = true if QUIET option was given
2368 <package>_FIND_VERSION = full requested version string
2369 <package>_FIND_VERSION_MAJOR = major version if requested, else 0
2370 <package>_FIND_VERSION_MINOR = minor version if requested, else 0
2371 <package>_FIND_VERSION_PATCH = patch version if requested, else 0
2372 <package>_FIND_VERSION_TWEAK = tweak version if requested, else 0
2373 <package>_FIND_VERSION_COUNT = number of version components, 0 to 4
2374 <package>_FIND_VERSION_EXACT = true if EXACT option was given
2375 <package>_FIND_COMPONENTS = list of requested components
2376 <package>_FIND_REQUIRED_<c> = true if component <c> is required
2377 false if component <c> is optional
2378
2379 In Module mode the loaded find module is responsible to honor
2380 the request detailed by these variables; see the find module for
2381 details. In Config mode find_package handles REQUIRED, QUIET,
2382 and version options automatically but leaves it to the package
2383 configuration file to handle components in a way that makes
2384 sense for the package. The package configuration file may set
2385 <package>_FOUND to false to tell find_package that component
2386 requirements are not satisfied.
2387
2388
2389 See the cmake_policy() command documentation for discussion of
2390 the NO_POLICY_SCOPE option.
2391
2392
2393 find_path
2394 Find the directory containing a file.
2395
2396 find_path(<VAR> name1 [path1 path2 ...])
2397
2398 This is the short-hand signature for the command that is suffi‐
2399 cient in many cases. It is the same as find_path(<VAR> name1
2400 [PATHS path1 path2 ...])
2401
2402
2403 find_path(
2404 <VAR>
2405 name | NAMES name1 [name2 ...]
2406 [HINTS path1 [path2 ... ENV var]]
2407 [PATHS path1 [path2 ... ENV var]]
2408 [PATH_SUFFIXES suffix1 [suffix2 ...]]
2409 [DOC "cache documentation string"]
2410 [NO_DEFAULT_PATH]
2411 [NO_CMAKE_ENVIRONMENT_PATH]
2412 [NO_CMAKE_PATH]
2413 [NO_SYSTEM_ENVIRONMENT_PATH]
2414 [NO_CMAKE_SYSTEM_PATH]
2415 [CMAKE_FIND_ROOT_PATH_BOTH |
2416 ONLY_CMAKE_FIND_ROOT_PATH |
2417 NO_CMAKE_FIND_ROOT_PATH]
2418 )
2419
2420 This command is used to find a directory containing the named
2421 file. A cache entry named by <VAR> is created to store the
2422 result of this command. If the file in a directory is found the
2423 result is stored in the variable and the search will not be
2424 repeated unless the variable is cleared. If nothing is found,
2425 the result will be <VAR>-NOTFOUND, and the search will be
2426 attempted again the next time find_path is invoked with the same
2427 variable. The name of the file in a directory that is searched
2428 for is specified by the names listed after the NAMES argument.
2429 Additional search locations can be specified after the PATHS
2430 argument. If ENV var is found in the HINTS or PATHS section the
2431 environment variable var will be read and converted from a sys‐
2432 tem environment variable to a cmake style list of paths. For
2433 example ENV PATH would be a way to list the system path vari‐
2434 able. The argument after DOC will be used for the documentation
2435 string in the cache. PATH_SUFFIXES specifies additional subdi‐
2436 rectories to check below each search path.
2437
2438
2439 If NO_DEFAULT_PATH is specified, then no additional paths are
2440 added to the search. If NO_DEFAULT_PATH is not specified, the
2441 search process is as follows:
2442
2443
2444 1. Search paths specified in cmake-specific cache variables.
2445 These are intended to be used on the command line with a
2446 -DVAR=value. This can be skipped if NO_CMAKE_PATH is passed.
2447
2448
2449 <prefix>/include/<arch> if CMAKE_LIBRARY_ARCHITECTURE is set, and
2450 <prefix>/include for each <prefix> in CMAKE_PREFIX_PATH
2451 CMAKE_INCLUDE_PATH
2452 CMAKE_FRAMEWORK_PATH
2453
2454 2. Search paths specified in cmake-specific environment vari‐
2455 ables. These are intended to be set in the user's shell config‐
2456 uration. This can be skipped if NO_CMAKE_ENVIRONMENT_PATH is
2457 passed.
2458
2459
2460 <prefix>/include/<arch> if CMAKE_LIBRARY_ARCHITECTURE is set, and
2461 <prefix>/include for each <prefix> in CMAKE_PREFIX_PATH
2462 CMAKE_INCLUDE_PATH
2463 CMAKE_FRAMEWORK_PATH
2464
2465 3. Search the paths specified by the HINTS option. These should
2466 be paths computed by system introspection, such as a hint pro‐
2467 vided by the location of another item already found. Hard-coded
2468 guesses should be specified with the PATHS option.
2469
2470
2471 4. Search the standard system environment variables. This can be
2472 skipped if NO_SYSTEM_ENVIRONMENT_PATH is an argument.
2473
2474
2475 PATH
2476 INCLUDE
2477
2478 5. Search cmake variables defined in the Platform files for the
2479 current system. This can be skipped if NO_CMAKE_SYSTEM_PATH is
2480 passed.
2481
2482
2483 <prefix>/include/<arch> if CMAKE_LIBRARY_ARCHITECTURE is set, and
2484 <prefix>/include for each <prefix> in CMAKE_SYSTEM_PREFIX_PATH
2485 CMAKE_SYSTEM_INCLUDE_PATH
2486 CMAKE_SYSTEM_FRAMEWORK_PATH
2487
2488 6. Search the paths specified by the PATHS option or in the
2489 short-hand version of the command. These are typically
2490 hard-coded guesses.
2491
2492
2493 On Darwin or systems supporting OS X Frameworks, the cmake vari‐
2494 able CMAKE_FIND_FRAMEWORK can be set to empty or one of the
2495 following:
2496
2497
2498 "FIRST" - Try to find frameworks before standard
2499 libraries or headers. This is the default on Darwin.
2500 "LAST" - Try to find frameworks after standard
2501 libraries or headers.
2502 "ONLY" - Only try to find frameworks.
2503 "NEVER" - Never try to find frameworks.
2504
2505 On Darwin or systems supporting OS X Application Bundles, the
2506 cmake variable CMAKE_FIND_APPBUNDLE can be set to empty or one
2507 of the following:
2508
2509
2510 "FIRST" - Try to find application bundles before standard
2511 programs. This is the default on Darwin.
2512 "LAST" - Try to find application bundles after standard
2513 programs.
2514 "ONLY" - Only try to find application bundles.
2515 "NEVER" - Never try to find application bundles.
2516
2517 The CMake variable CMAKE_FIND_ROOT_PATH specifies one or more
2518 directories to be prepended to all other search directories.
2519 This effectively "re-roots" the entire search under given loca‐
2520 tions. By default it is empty. It is especially useful when
2521 cross-compiling to point to the root directory of the target
2522 environment and CMake will search there too. By default at first
2523 the directories listed in CMAKE_FIND_ROOT_PATH and then the
2524 non-rooted directories will be searched. The default behavior
2525 can be adjusted by setting CMAKE_FIND_ROOT_PATH_MODE_INCLUDE.
2526 This behavior can be manually overridden on a per-call basis. By
2527 using CMAKE_FIND_ROOT_PATH_BOTH the search order will be as
2528 described above. If NO_CMAKE_FIND_ROOT_PATH is used then
2529 CMAKE_FIND_ROOT_PATH will not be used. If
2530 ONLY_CMAKE_FIND_ROOT_PATH is used then only the re-rooted direc‐
2531 tories will be searched.
2532
2533
2534 The default search order is designed to be most-specific to
2535 least-specific for common use cases. Projects may override the
2536 order by simply calling the command multiple times and using the
2537 NO_* options:
2538
2539
2540 find_path(<VAR> NAMES name PATHS paths... NO_DEFAULT_PATH)
2541 find_path(<VAR> NAMES name)
2542
2543 Once one of the calls succeeds the result variable will be set
2544 and stored in the cache so that no call will search again.
2545
2546
2547 When searching for frameworks, if the file is specified as
2548 A/b.h, then the framework search will look for A.framework/Head‐
2549 ers/b.h. If that is found the path will be set to the path to
2550 the framework. CMake will convert this to the correct -F option
2551 to include the file.
2552
2553
2554 find_program
2555 Find an executable program.
2556
2557 find_program(<VAR> name1 [path1 path2 ...])
2558
2559 This is the short-hand signature for the command that is suffi‐
2560 cient in many cases. It is the same as find_program(<VAR> name1
2561 [PATHS path1 path2 ...])
2562
2563
2564 find_program(
2565 <VAR>
2566 name | NAMES name1 [name2 ...]
2567 [HINTS path1 [path2 ... ENV var]]
2568 [PATHS path1 [path2 ... ENV var]]
2569 [PATH_SUFFIXES suffix1 [suffix2 ...]]
2570 [DOC "cache documentation string"]
2571 [NO_DEFAULT_PATH]
2572 [NO_CMAKE_ENVIRONMENT_PATH]
2573 [NO_CMAKE_PATH]
2574 [NO_SYSTEM_ENVIRONMENT_PATH]
2575 [NO_CMAKE_SYSTEM_PATH]
2576 [CMAKE_FIND_ROOT_PATH_BOTH |
2577 ONLY_CMAKE_FIND_ROOT_PATH |
2578 NO_CMAKE_FIND_ROOT_PATH]
2579 )
2580
2581 This command is used to find a program. A cache entry named by
2582 <VAR> is created to store the result of this command. If the
2583 program is found the result is stored in the variable and the
2584 search will not be repeated unless the variable is cleared. If
2585 nothing is found, the result will be <VAR>-NOTFOUND, and the
2586 search will be attempted again the next time find_program is
2587 invoked with the same variable. The name of the program that is
2588 searched for is specified by the names listed after the NAMES
2589 argument. Additional search locations can be specified after
2590 the PATHS argument. If ENV var is found in the HINTS or PATHS
2591 section the environment variable var will be read and converted
2592 from a system environment variable to a cmake style list of
2593 paths. For example ENV PATH would be a way to list the system
2594 path variable. The argument after DOC will be used for the docu‐
2595 mentation string in the cache. PATH_SUFFIXES specifies addi‐
2596 tional subdirectories to check below each search path.
2597
2598
2599 If NO_DEFAULT_PATH is specified, then no additional paths are
2600 added to the search. If NO_DEFAULT_PATH is not specified, the
2601 search process is as follows:
2602
2603
2604 1. Search paths specified in cmake-specific cache variables.
2605 These are intended to be used on the command line with a
2606 -DVAR=value. This can be skipped if NO_CMAKE_PATH is passed.
2607
2608
2609 <prefix>/[s]bin for each <prefix> in CMAKE_PREFIX_PATH
2610 CMAKE_PROGRAM_PATH
2611 CMAKE_APPBUNDLE_PATH
2612
2613 2. Search paths specified in cmake-specific environment vari‐
2614 ables. These are intended to be set in the user's shell config‐
2615 uration. This can be skipped if NO_CMAKE_ENVIRONMENT_PATH is
2616 passed.
2617
2618
2619 <prefix>/[s]bin for each <prefix> in CMAKE_PREFIX_PATH
2620 CMAKE_PROGRAM_PATH
2621 CMAKE_APPBUNDLE_PATH
2622
2623 3. Search the paths specified by the HINTS option. These should
2624 be paths computed by system introspection, such as a hint pro‐
2625 vided by the location of another item already found. Hard-coded
2626 guesses should be specified with the PATHS option.
2627
2628
2629 4. Search the standard system environment variables. This can be
2630 skipped if NO_SYSTEM_ENVIRONMENT_PATH is an argument.
2631
2632
2633 PATH
2634
2635
2636 5. Search cmake variables defined in the Platform files for the
2637 current system. This can be skipped if NO_CMAKE_SYSTEM_PATH is
2638 passed.
2639
2640
2641 <prefix>/[s]bin for each <prefix> in CMAKE_SYSTEM_PREFIX_PATH
2642 CMAKE_SYSTEM_PROGRAM_PATH
2643 CMAKE_SYSTEM_APPBUNDLE_PATH
2644
2645 6. Search the paths specified by the PATHS option or in the
2646 short-hand version of the command. These are typically
2647 hard-coded guesses.
2648
2649
2650 On Darwin or systems supporting OS X Frameworks, the cmake vari‐
2651 able CMAKE_FIND_FRAMEWORK can be set to empty or one of the
2652 following:
2653
2654
2655 "FIRST" - Try to find frameworks before standard
2656 libraries or headers. This is the default on Darwin.
2657 "LAST" - Try to find frameworks after standard
2658 libraries or headers.
2659 "ONLY" - Only try to find frameworks.
2660 "NEVER" - Never try to find frameworks.
2661
2662 On Darwin or systems supporting OS X Application Bundles, the
2663 cmake variable CMAKE_FIND_APPBUNDLE can be set to empty or one
2664 of the following:
2665
2666
2667 "FIRST" - Try to find application bundles before standard
2668 programs. This is the default on Darwin.
2669 "LAST" - Try to find application bundles after standard
2670 programs.
2671 "ONLY" - Only try to find application bundles.
2672 "NEVER" - Never try to find application bundles.
2673
2674 The CMake variable CMAKE_FIND_ROOT_PATH specifies one or more
2675 directories to be prepended to all other search directories.
2676 This effectively "re-roots" the entire search under given loca‐
2677 tions. By default it is empty. It is especially useful when
2678 cross-compiling to point to the root directory of the target
2679 environment and CMake will search there too. By default at first
2680 the directories listed in CMAKE_FIND_ROOT_PATH and then the
2681 non-rooted directories will be searched. The default behavior
2682 can be adjusted by setting CMAKE_FIND_ROOT_PATH_MODE_PROGRAM.
2683 This behavior can be manually overridden on a per-call basis. By
2684 using CMAKE_FIND_ROOT_PATH_BOTH the search order will be as
2685 described above. If NO_CMAKE_FIND_ROOT_PATH is used then
2686 CMAKE_FIND_ROOT_PATH will not be used. If
2687 ONLY_CMAKE_FIND_ROOT_PATH is used then only the re-rooted direc‐
2688 tories will be searched.
2689
2690
2691 The default search order is designed to be most-specific to
2692 least-specific for common use cases. Projects may override the
2693 order by simply calling the command multiple times and using the
2694 NO_* options:
2695
2696
2697 find_program(<VAR> NAMES name PATHS paths... NO_DEFAULT_PATH)
2698 find_program(<VAR> NAMES name)
2699
2700 Once one of the calls succeeds the result variable will be set
2701 and stored in the cache so that no call will search again.
2702
2703
2704 fltk_wrap_ui
2705 Create FLTK user interfaces Wrappers.
2706
2707 fltk_wrap_ui(resultingLibraryName source1
2708 source2 ... sourceN )
2709
2710 Produce .h and .cxx files for all the .fl and .fld files listed.
2711 The resulting .h and .cxx files will be added to a variable
2712 named resultingLibraryName_FLTK_UI_SRCS which should be added to
2713 your library.
2714
2715
2716 foreach
2717 Evaluate a group of commands for each value in a list.
2718
2719 foreach(loop_var arg1 arg2 ...)
2720 COMMAND1(ARGS ...)
2721 COMMAND2(ARGS ...)
2722 ...
2723 endforeach(loop_var)
2724
2725 All commands between foreach and the matching endforeach are
2726 recorded without being invoked. Once the endforeach is evalu‐
2727 ated, the recorded list of commands is invoked once for each
2728 argument listed in the original foreach command. Before each
2729 iteration of the loop "${loop_var}" will be set as a variable
2730 with the current value in the list.
2731
2732
2733 foreach(loop_var RANGE total)
2734 foreach(loop_var RANGE start stop [step])
2735
2736 Foreach can also iterate over a generated range of numbers.
2737 There are three types of this iteration:
2738
2739
2740 * When specifying single number, the range will have elements 0
2741 to "total".
2742
2743
2744 * When specifying two numbers, the range will have elements from
2745 the first number to the second number.
2746
2747
2748 * The third optional number is the increment used to iterate
2749 from the first number to the second number.
2750
2751
2752 foreach(loop_var IN [LISTS [list1 [...]]]
2753 [ITEMS [item1 [...]]])
2754
2755 Iterates over a precise list of items. The LISTS option names
2756 list-valued variables to be traversed, including empty elements
2757 (an empty string is a zero-length list). The ITEMS option ends
2758 argument parsing and includes all arguments following it in the
2759 iteration.
2760
2761
2762 function
2763 Start recording a function for later invocation as a command.
2764
2765 function(<name> [arg1 [arg2 [arg3 ...]]])
2766 COMMAND1(ARGS ...)
2767 COMMAND2(ARGS ...)
2768 ...
2769 endfunction(<name>)
2770
2771 Define a function named <name> that takes arguments named arg1
2772 arg2 arg3 (...). Commands listed after function, but before the
2773 matching endfunction, are not invoked until the function is
2774 invoked. When it is invoked, the commands recorded in the func‐
2775 tion are first modified by replacing formal parameters (${arg1})
2776 with the arguments passed, and then invoked as normal commands.
2777 In addition to referencing the formal parameters you can refer‐
2778 ence the variable ARGC which will be set to the number of argu‐
2779 ments passed into the function as well as ARGV0 ARGV1 ARGV2 ...
2780 which will have the actual values of the arguments passed in.
2781 This facilitates creating functions with optional arguments.
2782 Additionally ARGV holds the list of all arguments given to the
2783 function and ARGN holds the list of arguments past the last
2784 expected argument.
2785
2786
2787 A function opens a new scope: see set(var PARENT_SCOPE) for
2788 details.
2789
2790
2791 See the cmake_policy() command documentation for the behavior of
2792 policies inside functions.
2793
2794
2795 get_cmake_property
2796 Get a property of the CMake instance.
2797
2798 get_cmake_property(VAR property)
2799
2800 Get a property from the CMake instance. The value of the prop‐
2801 erty is stored in the variable VAR. If the property is not
2802 found, VAR will be set to "NOTFOUND". Some supported properties
2803 include: VARIABLES, CACHE_VARIABLES, COMMANDS, MACROS, and COM‐
2804 PONENTS.
2805
2806
2807 See also the more general get_property() command.
2808
2809
2810 get_directory_property
2811 Get a property of DIRECTORY scope.
2812
2813 get_directory_property(<variable> [DIRECTORY <dir>] <prop-name>)
2814
2815 Store a property of directory scope in the named variable. If
2816 the property is not defined the empty-string is returned. The
2817 DIRECTORY argument specifies another directory from which to
2818 retrieve the property value. The specified directory must have
2819 already been traversed by CMake.
2820
2821
2822 get_directory_property(<variable> [DIRECTORY <dir>]
2823 DEFINITION <var-name>)
2824
2825 Get a variable definition from a directory. This form is useful
2826 to get a variable definition from another directory.
2827
2828
2829 See also the more general get_property() command.
2830
2831
2832 get_filename_component
2833 Get a specific component of a full filename.
2834
2835 get_filename_component(<VAR> <FileName> <COMP> [CACHE])
2836
2837 Set <VAR> to a component of <FileName>, where <COMP> is one of:
2838
2839
2840 DIRECTORY = Directory without file name
2841 NAME = File name without directory
2842 EXT = File name longest extension (.b.c from d/a.b.c)
2843 NAME_WE = File name without directory or longest extension
2844 ABSOLUTE = Full path to file
2845 REALPATH = Full path to existing file with symlinks resolved
2846 PATH = Legacy alias for DIRECTORY (use for CMake <= 2.8.11)
2847
2848 Paths are returned with forward slashes and have no trailing
2849 slahes. The longest file extension is always considered. If the
2850 optional CACHE argument is specified, the result variable is
2851 added to the cache.
2852
2853
2854 get_filename_component(<VAR> FileName
2855 PROGRAM [PROGRAM_ARGS <ARG_VAR>]
2856 [CACHE])
2857
2858 The program in FileName will be found in the system search path
2859 or left as a full path. If PROGRAM_ARGS is present with PRO‐
2860 GRAM, then any command-line arguments present in the FileName
2861 string are split from the program name and stored in <ARG_VAR>.
2862 This is used to separate a program name from its arguments in a
2863 command line string.
2864
2865
2866 get_property
2867 Get a property.
2868
2869 get_property(<variable>
2870 <GLOBAL |
2871 DIRECTORY [dir] |
2872 TARGET <target> |
2873 SOURCE <source> |
2874 TEST <test> |
2875 CACHE <entry> |
2876 VARIABLE>
2877 PROPERTY <name>
2878 [SET | DEFINED | BRIEF_DOCS | FULL_DOCS])
2879
2880 Get one property from one object in a scope. The first argument
2881 specifies the variable in which to store the result. The second
2882 argument determines the scope from which to get the property.
2883 It must be one of the following:
2884
2885
2886 GLOBAL scope is unique and does not accept a name.
2887
2888
2889 DIRECTORY scope defaults to the current directory but another
2890 directory (already processed by CMake) may be named by full or
2891 relative path.
2892
2893
2894 TARGET scope must name one existing target.
2895
2896
2897 SOURCE scope must name one source file.
2898
2899
2900 TEST scope must name one existing test.
2901
2902
2903 CACHE scope must name one cache entry.
2904
2905
2906 VARIABLE scope is unique and does not accept a name.
2907
2908
2909 The required PROPERTY option is immediately followed by the name
2910 of the property to get. If the property is not set an empty
2911 value is returned. If the SET option is given the variable is
2912 set to a boolean value indicating whether the property has been
2913 set. If the DEFINED option is given the variable is set to a
2914 boolean value indicating whether the property has been defined
2915 such as with define_property. If BRIEF_DOCS or FULL_DOCS is
2916 given then the variable is set to a string containing documenta‐
2917 tion for the requested property. If documentation is requested
2918 for a property that has not been defined NOTFOUND is returned.
2919
2920
2921 get_source_file_property
2922 Get a property for a source file.
2923
2924 get_source_file_property(VAR file property)
2925
2926 Get a property from a source file. The value of the property is
2927 stored in the variable VAR. If the property is not found, VAR
2928 will be set to "NOTFOUND". Use set_source_files_properties to
2929 set property values. Source file properties usually control how
2930 the file is built. One property that is always there is LOCATION
2931
2932
2933 See also the more general get_property() command.
2934
2935
2936 get_target_property
2937 Get a property from a target.
2938
2939 get_target_property(VAR target property)
2940
2941 Get a property from a target. The value of the property is
2942 stored in the variable VAR. If the property is not found, VAR
2943 will be set to "NOTFOUND". Use set_target_properties to set
2944 property values. Properties are usually used to control how a
2945 target is built, but some query the target instead. This com‐
2946 mand can get properties for any target so far created. The tar‐
2947 gets do not need to be in the current CMakeLists.txt file.
2948
2949
2950 See also the more general get_property() command.
2951
2952
2953 get_test_property
2954 Get a property of the test.
2955
2956 get_test_property(test property VAR)
2957
2958 Get a property from the Test. The value of the property is
2959 stored in the variable VAR. If the property is not found, VAR
2960 will be set to "NOTFOUND". For a list of standard properties you
2961 can type cmake --help-property-list
2962
2963
2964 See also the more general get_property() command.
2965
2966
2967 if Conditionally execute a group of commands.
2968
2969 if(expression)
2970 # then section.
2971 COMMAND1(ARGS ...)
2972 COMMAND2(ARGS ...)
2973 ...
2974 elseif(expression2)
2975 # elseif section.
2976 COMMAND1(ARGS ...)
2977 COMMAND2(ARGS ...)
2978 ...
2979 else(expression)
2980 # else section.
2981 COMMAND1(ARGS ...)
2982 COMMAND2(ARGS ...)
2983 ...
2984 endif(expression)
2985
2986 Evaluates the given expression. If the result is true, the com‐
2987 mands in the THEN section are invoked. Otherwise, the commands
2988 in the else section are invoked. The elseif and else sections
2989 are optional. You may have multiple elseif clauses. Note that
2990 the expression in the else and endif clause is optional. Long
2991 expressions can be used and there is a traditional order of
2992 precedence. Parenthetical expressions are evaluated first fol‐
2993 lowed by unary operators such as EXISTS, COMMAND, and DEFINED.
2994 Then any EQUAL, LESS, GREATER, STRLESS, STRGREATER, STREQUAL,
2995 MATCHES will be evaluated. Then NOT operators and finally AND,
2996 OR operators will be evaluated. Possible expressions are:
2997
2998
2999 if(<constant>)
3000
3001 True if the constant is 1, ON, YES, TRUE, Y, or a non-zero num‐
3002 ber. False if the constant is 0, OFF, NO, FALSE, N, IGNORE,
3003 NOTFOUND, '', or ends in the suffix '-NOTFOUND'. Named boolean
3004 constants are case-insensitive. If the argument is not one of
3005 these constants, it is treated as a variable:
3006
3007
3008 if(<variable>)
3009
3010 True if the variable is defined to a value that is not a false
3011 constant. False otherwise. (Note macro arguments are not vari‐
3012 ables.)
3013
3014
3015 if(NOT <expression>)
3016
3017 True if the expression is not true.
3018
3019
3020 if(<expr1> AND <expr2>)
3021
3022 True if both expressions would be considered true individually.
3023
3024
3025 if(<expr1> OR <expr2>)
3026
3027 True if either expression would be considered true individually.
3028
3029
3030 if(COMMAND command-name)
3031
3032 True if the given name is a command, macro or function that can
3033 be invoked.
3034
3035
3036 if(POLICY policy-id)
3037
3038 True if the given name is an existing policy (of the form
3039 CMP<NNNN>).
3040
3041
3042 if(TARGET target-name)
3043
3044 True if the given name is an existing target, built or imported.
3045
3046
3047 if(EXISTS file-name)
3048 if(EXISTS directory-name)
3049
3050 True if the named file or directory exists. Behavior is
3051 well-defined only for full paths.
3052
3053
3054 if(file1 IS_NEWER_THAN file2)
3055
3056 True if file1 is newer than file2 or if one of the two files
3057 doesn't exist. Behavior is well-defined only for full paths. If
3058 the file time stamps are exactly the same, an IS_NEWER_THAN com‐
3059 parison returns true, so that any dependent build operations
3060 will occur in the event of a tie. This includes the case of
3061 passing the same file name for both file1 and file2.
3062
3063
3064 if(IS_DIRECTORY directory-name)
3065
3066 True if the given name is a directory. Behavior is well-defined
3067 only for full paths.
3068
3069
3070 if(IS_SYMLINK file-name)
3071
3072 True if the given name is a symbolic link. Behavior is
3073 well-defined only for full paths.
3074
3075
3076 if(IS_ABSOLUTE path)
3077
3078 True if the given path is an absolute path.
3079
3080
3081 if(<variable|string> MATCHES regex)
3082
3083 True if the given string or variable's value matches the given
3084 regular expression.
3085
3086
3087 if(<variable|string> LESS <variable|string>)
3088 if(<variable|string> GREATER <variable|string>)
3089 if(<variable|string> EQUAL <variable|string>)
3090
3091 True if the given string or variable's value is a valid number
3092 and the inequality or equality is true.
3093
3094
3095 if(<variable|string> STRLESS <variable|string>)
3096 if(<variable|string> STRGREATER <variable|string>)
3097 if(<variable|string> STREQUAL <variable|string>)
3098
3099 True if the given string or variable's value is lexicographi‐
3100 cally less (or greater, or equal) than the string or variable on
3101 the right.
3102
3103
3104 if(<variable|string> VERSION_LESS <variable|string>)
3105 if(<variable|string> VERSION_EQUAL <variable|string>)
3106 if(<variable|string> VERSION_GREATER <variable|string>)
3107
3108 Component-wise integer version number comparison (version format
3109 is major[.minor[.patch[.tweak]]]).
3110
3111
3112 if(DEFINED <variable>)
3113
3114 True if the given variable is defined. It does not matter if the
3115 variable is true or false just if it has been set.
3116
3117
3118 if((expression) AND (expression OR (expression)))
3119
3120 The expressions inside the parenthesis are evaluated first and
3121 then the remaining expression is evaluated as in the previous
3122 examples. Where there are nested parenthesis the innermost are
3123 evaluated as part of evaluating the expression that contains
3124 them.
3125
3126
3127 The if command was written very early in CMake's history, pre‐
3128 dating the ${} variable evaluation syntax, and for convenience
3129 evaluates variables named by its arguments as shown in the above
3130 signatures. Note that normal variable evaluation with ${}
3131 applies before the if command even receives the arguments.
3132 Therefore code like
3133
3134
3135 set(var1 OFF)
3136 set(var2 "var1")
3137 if(${var2})
3138
3139 appears to the if command as
3140
3141
3142 if(var1)
3143
3144 and is evaluated according to the if(<variable>) case documented
3145 above. The result is OFF which is false. However, if we remove
3146 the ${} from the example then the command sees
3147
3148
3149 if(var2)
3150
3151 which is true because var2 is defined to "var1" which is not a
3152 false constant.
3153
3154
3155 Automatic evaluation applies in the other cases whenever the
3156 above-documented signature accepts <variable|string>:
3157
3158
3159 1) The left hand argument to MATCHES is first checked to see if
3160 it is a defined variable, if so the variable's value is used,
3161 otherwise the original value is used.
3162
3163
3164 2) If the left hand argument to MATCHES is missing it returns
3165 false without error
3166
3167
3168 3) Both left and right hand arguments to LESS GREATER EQUAL are
3169 independently tested to see if they are defined variables, if so
3170 their defined values are used otherwise the original value is
3171 used.
3172
3173
3174 4) Both left and right hand arguments to STRLESS STREQUAL STR‐
3175 GREATER are independently tested to see if they are defined
3176 variables, if so their defined values are used otherwise the
3177 original value is used.
3178
3179
3180 5) Both left and right hand argumemnts to VERSION_LESS VER‐
3181 SION_EQUAL VERSION_GREATER are independently tested to see if
3182 they are defined variables, if so their defined values are used
3183 otherwise the original value is used.
3184
3185
3186 6) The right hand argument to NOT is tested to see if it is a
3187 boolean constant, if so the value is used, otherwise it is
3188 assumed to be a variable and it is dereferenced.
3189
3190
3191 7) The left and right hand arguments to AND OR are independently
3192 tested to see if they are boolean constants, if so they are used
3193 as such, otherwise they are assumed to be variables and are
3194 dereferenced.
3195
3196
3197
3198 include
3199 Load and run CMake code from a file or module.
3200
3201 include(<file|module> [OPTIONAL] [RESULT_VARIABLE <VAR>]
3202 [NO_POLICY_SCOPE])
3203
3204 Load and run CMake code from the file given. Variable reads and
3205 writes access the scope of the caller (dynamic scoping). If
3206 OPTIONAL is present, then no error is raised if the file does
3207 not exist. If RESULT_VARIABLE is given the variable will be set
3208 to the full filename which has been included or NOTFOUND if it
3209 failed.
3210
3211
3212 If a module is specified instead of a file, the file with name
3213 <modulename>.cmake is searched first in CMAKE_MODULE_PATH, then
3214 in the CMake module directory. There is one exception to this:
3215 if the file which calls include() is located itself in the CMake
3216 module directory, then first the CMake module directory is
3217 searched and CMAKE_MODULE_PATH afterwards. See also policy
3218 CMP0017.
3219
3220
3221 See the cmake_policy() command documentation for discussion of
3222 the NO_POLICY_SCOPE option.
3223
3224
3225 include_directories
3226 Add include directories to the build.
3227
3228 include_directories([AFTER|BEFORE] [SYSTEM] dir1 dir2 ...)
3229
3230 Add the given directories to those the compiler uses to search
3231 for include files. Relative paths are interpreted as relative
3232 to the current source directory.
3233
3234
3235 The include directories are added to the directory property
3236 INCLUDE_DIRECTORIES for the current CMakeLists file. They are
3237 also added to the target property INCLUDE_DIRECTORIES for each
3238 target in the current CMakeLists file. The target property val‐
3239 ues are the ones used by the generators.
3240
3241
3242 By default the directories are appended onto the current list of
3243 directories. This default behavior can be changed by setting
3244 CMAKE_INCLUDE_DIRECTORIES_BEFORE to ON. By using AFTER or BEFORE
3245 explicitly, you can select between appending and prepending,
3246 independent of the default.
3247
3248
3249 If the SYSTEM option is given, the compiler will be told the
3250 directories are meant as system include directories on some
3251 platforms (signalling this setting might achieve effects such as
3252 the compiler skipping warnings, or these fixed-install system
3253 files not being considered in dependency calculations - see com‐
3254 piler docs).
3255
3256
3257 include_external_msproject
3258 Include an external Microsoft project file in a workspace.
3259
3260 include_external_msproject(projectname location
3261 [TYPE projectTypeGUID]
3262 [GUID projectGUID]
3263 [PLATFORM platformName]
3264 dep1 dep2 ...)
3265
3266 Includes an external Microsoft project in the generated
3267 workspace file. Currently does nothing on UNIX. This will cre‐
3268 ate a target named [projectname]. This can be used in the
3269 add_dependencies command to make things depend on the external
3270 project.
3271
3272
3273 TYPE, GUID and PLATFORM are optional parameters that allow one
3274 to specify the type of project, id (GUID) of the project and the
3275 name of the target platform. This is useful for projects
3276 requiring values other than the default (e.g. WIX projects).
3277 These options are not supported by the Visual Studio 6 genera‐
3278 tor.
3279
3280
3281 include_regular_expression
3282 Set the regular expression used for dependency checking.
3283
3284 include_regular_expression(regex_match [regex_complain])
3285
3286 Set the regular expressions used in dependency checking. Only
3287 files matching regex_match will be traced as dependencies. Only
3288 files matching regex_complain will generate warnings if they
3289 cannot be found (standard header paths are not searched). The
3290 defaults are:
3291
3292
3293 regex_match = "^.*$" (match everything)
3294 regex_complain = "^$" (match empty string only)
3295
3296
3297 install
3298 Specify rules to run at install time.
3299
3300 This command generates installation rules for a project. Rules
3301 specified by calls to this command within a source directory are
3302 executed in order during installation. The order across direc‐
3303 tories is not defined.
3304
3305
3306 There are multiple signatures for this command. Some of them
3307 define installation properties for files and targets. Proper‐
3308 ties common to multiple signatures are covered here but they are
3309 valid only for signatures that specify them.
3310
3311
3312 DESTINATION arguments specify the directory on disk to which a
3313 file will be installed. If a full path (with a leading slash or
3314 drive letter) is given it is used directly. If a relative path
3315 is given it is interpreted relative to the value of
3316 CMAKE_INSTALL_PREFIX. The prefix can be relocated at install
3317 time using DESTDIR mechanism explained in the CMAKE_INSTALL_PRE‐
3318 FIX variable documentation.
3319
3320
3321 PERMISSIONS arguments specify permissions for installed files.
3322 Valid permissions are OWNER_READ, OWNER_WRITE, OWNER_EXECUTE,
3323 GROUP_READ, GROUP_WRITE, GROUP_EXECUTE, WORLD_READ, WORLD_WRITE,
3324 WORLD_EXECUTE, SETUID, and SETGID. Permissions that do not make
3325 sense on certain platforms are ignored on those platforms.
3326
3327
3328 The CONFIGURATIONS argument specifies a list of build configura‐
3329 tions for which the install rule applies (Debug, Release, etc.).
3330
3331
3332 The COMPONENT argument specifies an installation component name
3333 with which the install rule is associated, such as "runtime" or
3334 "development". During component-specific installation only
3335 install rules associated with the given component name will be
3336 executed. During a full installation all components are
3337 installed. If COMPONENT is not provided a default component
3338 "Unspecified" is created. The default component name may be con‐
3339 trolled with the CMAKE_INSTALL_DEFAULT_COMPONENT_NAME variable.
3340
3341
3342 The RENAME argument specifies a name for an installed file that
3343 may be different from the original file. Renaming is allowed
3344 only when a single file is installed by the command.
3345
3346
3347 The OPTIONAL argument specifies that it is not an error if the
3348 file to be installed does not exist.
3349
3350
3351 The TARGETS signature:
3352
3353
3354 install(TARGETS targets... [EXPORT <export-name>]
3355 [[ARCHIVE|LIBRARY|RUNTIME|FRAMEWORK|BUNDLE|
3356 PRIVATE_HEADER|PUBLIC_HEADER|RESOURCE]
3357 [DESTINATION <dir>]
3358 [INCLUDES DESTINATION [<dir> ...]]
3359 [PERMISSIONS permissions...]
3360 [CONFIGURATIONS [Debug|Release|...]]
3361 [COMPONENT <component>]
3362 [OPTIONAL] [NAMELINK_ONLY|NAMELINK_SKIP]
3363 ] [...])
3364
3365 The TARGETS form specifies rules for installing targets from a
3366 project. There are five kinds of target files that may be
3367 installed: ARCHIVE, LIBRARY, RUNTIME, FRAMEWORK, and BUNDLE.
3368 Executables are treated as RUNTIME targets, except that those
3369 marked with the MACOSX_BUNDLE property are treated as BUNDLE
3370 targets on OS X. Static libraries are always treated as ARCHIVE
3371 targets. Module libraries are always treated as LIBRARY targets.
3372 For non-DLL platforms shared libraries are treated as LIBRARY
3373 targets, except that those marked with the FRAMEWORK property
3374 are treated as FRAMEWORK targets on OS X. For DLL platforms the
3375 DLL part of a shared library is treated as a RUNTIME target and
3376 the corresponding import library is treated as an ARCHIVE tar‐
3377 get. All Windows-based systems including Cygwin are DLL plat‐
3378 forms. The ARCHIVE, LIBRARY, RUNTIME, and FRAMEWORK arguments
3379 change the type of target to which the subsequent properties
3380 apply. If none is given the installation properties apply to
3381 all target types. If only one is given then only targets of
3382 that type will be installed (which can be used to install just a
3383 DLL or just an import library).The INCLUDES DESTINATION speci‐
3384 fies a list of directories which will be added to the INTER‐
3385 FACE_INCLUDE_DIRECTORIES of the <targets> when exported by
3386 install(EXPORT). If a relative path is specified, it is treated
3387 as relative to the $<INSTALL_PREFIX>.
3388
3389
3390 The PRIVATE_HEADER, PUBLIC_HEADER, and RESOURCE arguments cause
3391 subsequent properties to be applied to installing a FRAMEWORK
3392 shared library target's associated files on non-Apple platforms.
3393 Rules defined by these arguments are ignored on Apple platforms
3394 because the associated files are installed into the appropriate
3395 locations inside the framework folder. See documentation of the
3396 PRIVATE_HEADER, PUBLIC_HEADER, and RESOURCE target properties
3397 for details.
3398
3399
3400 Either NAMELINK_ONLY or NAMELINK_SKIP may be specified as a
3401 LIBRARY option. On some platforms a versioned shared library
3402 has a symbolic link such as
3403
3404
3405 lib<name>.so -> lib<name>.so.1
3406
3407 where "lib<name>.so.1" is the soname of the library and
3408 "lib<name>.so" is a "namelink" allowing linkers to find the
3409 library when given "-l<name>". The NAMELINK_ONLY option causes
3410 installation of only the namelink when a library target is
3411 installed. The NAMELINK_SKIP option causes installation of
3412 library files other than the namelink when a library target is
3413 installed. When neither option is given both portions are
3414 installed. On platforms where versioned shared libraries do not
3415 have namelinks or when a library is not versioned the
3416 NAMELINK_SKIP option installs the library and the NAMELINK_ONLY
3417 option installs nothing. See the VERSION and SOVERSION target
3418 properties for details on creating versioned shared libraries.
3419
3420
3421 One or more groups of properties may be specified in a single
3422 call to the TARGETS form of this command. A target may be
3423 installed more than once to different locations. Consider hypo‐
3424 thetical targets "myExe", "mySharedLib", and "myStaticLib". The
3425 code
3426
3427
3428 install(TARGETS myExe mySharedLib myStaticLib
3429 RUNTIME DESTINATION bin
3430 LIBRARY DESTINATION lib
3431 ARCHIVE DESTINATION lib/static)
3432 install(TARGETS mySharedLib DESTINATION /some/full/path)
3433
3434 will install myExe to <prefix>/bin and myStaticLib to <pre‐
3435 fix>/lib/static. On non-DLL platforms mySharedLib will be
3436 installed to <prefix>/lib and /some/full/path. On DLL platforms
3437 the mySharedLib DLL will be installed to <prefix>/bin and
3438 /some/full/path and its import library will be installed to
3439 <prefix>/lib/static and /some/full/path.
3440
3441
3442 The EXPORT option associates the installed target files with an
3443 export called <export-name>. It must appear before any RUNTIME,
3444 LIBRARY, or ARCHIVE options. To actually install the export
3445 file itself, call install(EXPORT). See documentation of the
3446 install(EXPORT ...) signature below for details.
3447
3448
3449 Installing a target with EXCLUDE_FROM_ALL set to true has unde‐
3450 fined behavior.
3451
3452
3453 The FILES signature:
3454
3455
3456 install(FILES files... DESTINATION <dir>
3457 [PERMISSIONS permissions...]
3458 [CONFIGURATIONS [Debug|Release|...]]
3459 [COMPONENT <component>]
3460 [RENAME <name>] [OPTIONAL])
3461
3462 The FILES form specifies rules for installing files for a
3463 project. File names given as relative paths are interpreted
3464 with respect to the current source directory. Files installed
3465 by this form are by default given permissions OWNER_WRITE,
3466 OWNER_READ, GROUP_READ, and WORLD_READ if no PERMISSIONS argu‐
3467 ment is given.
3468
3469
3470 The PROGRAMS signature:
3471
3472
3473 install(PROGRAMS files... DESTINATION <dir>
3474 [PERMISSIONS permissions...]
3475 [CONFIGURATIONS [Debug|Release|...]]
3476 [COMPONENT <component>]
3477 [RENAME <name>] [OPTIONAL])
3478
3479 The PROGRAMS form is identical to the FILES form except that the
3480 default permissions for the installed file also include
3481 OWNER_EXECUTE, GROUP_EXECUTE, and WORLD_EXECUTE. This form is
3482 intended to install programs that are not targets, such as shell
3483 scripts. Use the TARGETS form to install targets built within
3484 the project.
3485
3486
3487 The DIRECTORY signature:
3488
3489
3490 install(DIRECTORY dirs... DESTINATION <dir>
3491 [FILE_PERMISSIONS permissions...]
3492 [DIRECTORY_PERMISSIONS permissions...]
3493 [USE_SOURCE_PERMISSIONS] [OPTIONAL]
3494 [CONFIGURATIONS [Debug|Release|...]]
3495 [COMPONENT <component>] [FILES_MATCHING]
3496 [[PATTERN <pattern> | REGEX <regex>]
3497 [EXCLUDE] [PERMISSIONS permissions...]] [...])
3498
3499 The DIRECTORY form installs contents of one or more directories
3500 to a given destination. The directory structure is copied ver‐
3501 batim to the destination. The last component of each directory
3502 name is appended to the destination directory but a trailing
3503 slash may be used to avoid this because it leaves the last com‐
3504 ponent empty. Directory names given as relative paths are
3505 interpreted with respect to the current source directory. If no
3506 input directory names are given the destination directory will
3507 be created but nothing will be installed into it. The FILE_PER‐
3508 MISSIONS and DIRECTORY_PERMISSIONS options specify permissions
3509 given to files and directories in the destination. If
3510 USE_SOURCE_PERMISSIONS is specified and FILE_PERMISSIONS is not,
3511 file permissions will be copied from the source directory struc‐
3512 ture. If no permissions are specified files will be given the
3513 default permissions specified in the FILES form of the command,
3514 and the directories will be given the default permissions speci‐
3515 fied in the PROGRAMS form of the command.
3516
3517
3518 Installation of directories may be controlled with fine granu‐
3519 larity using the PATTERN or REGEX options. These "match"
3520 options specify a globbing pattern or regular expression to
3521 match directories or files encountered within input directories.
3522 They may be used to apply certain options (see below) to a sub‐
3523 set of the files and directories encountered. The full path to
3524 each input file or directory (with forward slashes) is matched
3525 against the expression. A PATTERN will match only complete file
3526 names: the portion of the full path matching the pattern must
3527 occur at the end of the file name and be preceded by a slash. A
3528 REGEX will match any portion of the full path but it may use '/'
3529 and '$' to simulate the PATTERN behavior. By default all files
3530 and directories are installed whether or not they are matched.
3531 The FILES_MATCHING option may be given before the first match
3532 option to disable installation of files (but not directories)
3533 not matched by any expression. For example, the code
3534
3535
3536 install(DIRECTORY src/ DESTINATION include/myproj
3537 FILES_MATCHING PATTERN "*.h")
3538
3539 will extract and install header files from a source tree.
3540
3541
3542 Some options may follow a PATTERN or REGEX expression and are
3543 applied only to files or directories matching them. The EXCLUDE
3544 option will skip the matched file or directory. The PERMISSIONS
3545 option overrides the permissions setting for the matched file or
3546 directory. For example the code
3547
3548
3549 install(DIRECTORY icons scripts/ DESTINATION share/myproj
3550 PATTERN "CVS" EXCLUDE
3551 PATTERN "scripts/*"
3552 PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
3553 GROUP_EXECUTE GROUP_READ)
3554
3555 will install the icons directory to share/myproj/icons and the
3556 scripts directory to share/myproj. The icons will get default
3557 file permissions, the scripts will be given specific permis‐
3558 sions, and any CVS directories will be excluded.
3559
3560
3561 The SCRIPT and CODE signature:
3562
3563
3564 install([[SCRIPT <file>] [CODE <code>]] [...])
3565
3566 The SCRIPT form will invoke the given CMake script files during
3567 installation. If the script file name is a relative path it
3568 will be interpreted with respect to the current source direc‐
3569 tory. The CODE form will invoke the given CMake code during
3570 installation. Code is specified as a single argument inside a
3571 double-quoted string. For example, the code
3572
3573
3574 install(CODE "MESSAGE(\"Sample install message.\")")
3575
3576 will print a message during installation.
3577
3578
3579 The EXPORT signature:
3580
3581
3582 install(EXPORT <export-name> DESTINATION <dir>
3583 [NAMESPACE <namespace>] [FILE <name>.cmake]
3584 [PERMISSIONS permissions...]
3585 [CONFIGURATIONS [Debug|Release|...]]
3586 [EXPORT_LINK_INTERFACE_LIBRARIES]
3587 [COMPONENT <component>])
3588
3589 The EXPORT form generates and installs a CMake file containing
3590 code to import targets from the installation tree into another
3591 project. Target installations are associated with the export
3592 <export-name> using the EXPORT option of the install(TARGETS
3593 ...) signature documented above. The NAMESPACE option will
3594 prepend <namespace> to the target names as they are written to
3595 the import file. By default the generated file will be called
3596 <export-name>.cmake but the FILE option may be used to specify a
3597 different name. The value given to the FILE option must be a
3598 file name with the ".cmake" extension. If a CONFIGURATIONS
3599 option is given then the file will only be installed when one of
3600 the named configurations is installed. Additionally, the gener‐
3601 ated import file will reference only the matching target config‐
3602 urations. The EXPORT_LINK_INTERFACE_LIBRARIES keyword, if
3603 present, causes the contents of the properties matching
3604 (IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)? to be exported,
3605 when policy CMP0022 is NEW. If a COMPONENT option is specified
3606 that does not match that given to the targets associated with
3607 <export-name> the behavior is undefined. If a library target is
3608 included in the export but a target to which it links is not
3609 included the behavior is unspecified.
3610
3611
3612 The EXPORT form is useful to help outside projects use targets
3613 built and installed by the current project. For example, the
3614 code
3615
3616
3617 install(TARGETS myexe EXPORT myproj DESTINATION bin)
3618 install(EXPORT myproj NAMESPACE mp_ DESTINATION lib/myproj)
3619
3620 will install the executable myexe to <prefix>/bin and code to
3621 import it in the file "<prefix>/lib/myproj/myproj.cmake". An
3622 outside project may load this file with the include command and
3623 reference the myexe executable from the installation tree using
3624 the imported target name mp_myexe as if the target were built in
3625 its own tree.
3626
3627
3628 NOTE: This command supercedes the INSTALL_TARGETS command and
3629 the target properties PRE_INSTALL_SCRIPT and
3630 POST_INSTALL_SCRIPT. It also replaces the FILES forms of the
3631 INSTALL_FILES and INSTALL_PROGRAMS commands. The processing
3632 order of these install rules relative to those generated by
3633 INSTALL_TARGETS, INSTALL_FILES, and INSTALL_PROGRAMS commands is
3634 not defined.
3635
3636
3637
3638 link_directories
3639 Specify directories in which the linker will look for libraries.
3640
3641 link_directories(directory1 directory2 ...)
3642
3643 Specify the paths in which the linker should search for
3644 libraries. The command will apply only to targets created after
3645 it is called. Relative paths given to this command are inter‐
3646 preted as relative to the current source directory, see CMP0015.
3647
3648
3649 Note that this command is rarely necessary. Library locations
3650 returned by find_package() and find_library() are absolute
3651 paths. Pass these absolute library file paths directly to the
3652 target_link_libraries() command. CMake will ensure the linker
3653 finds them.
3654
3655
3656 list List operations.
3657
3658 list(LENGTH <list> <output variable>)
3659 list(GET <list> <element index> [<element index> ...]
3660 <output variable>)
3661 list(APPEND <list> <element> [<element> ...])
3662 list(FIND <list> <value> <output variable>)
3663 list(INSERT <list> <element_index> <element> [<element> ...])
3664 list(REMOVE_ITEM <list> <value> [<value> ...])
3665 list(REMOVE_AT <list> <index> [<index> ...])
3666 list(REMOVE_DUPLICATES <list>)
3667 list(REVERSE <list>)
3668 list(SORT <list>)
3669
3670 LENGTH will return a given list's length.
3671
3672
3673 GET will return list of elements specified by indices from the
3674 list.
3675
3676
3677 APPEND will append elements to the list.
3678
3679
3680 FIND will return the index of the element specified in the list
3681 or -1 if it wasn't found.
3682
3683
3684 INSERT will insert elements to the list to the specified loca‐
3685 tion.
3686
3687
3688 REMOVE_AT and REMOVE_ITEM will remove items from the list. The
3689 difference is that REMOVE_ITEM will remove the given items,
3690 while REMOVE_AT will remove the items at the given indices.
3691
3692
3693 REMOVE_DUPLICATES will remove duplicated items in the list.
3694
3695
3696 REVERSE reverses the contents of the list in-place.
3697
3698
3699 SORT sorts the list in-place alphabetically.
3700
3701
3702 The list subcommands APPEND, INSERT, REMOVE_AT, REMOVE_ITEM,
3703 REMOVE_DUPLICATES, REVERSE and SORT may create new values for
3704 the list within the current CMake variable scope. Similar to the
3705 SET command, the LIST command creates new variable values in the
3706 current scope, even if the list itself is actually defined in a
3707 parent scope. To propagate the results of these operations
3708 upwards, use SET with PARENT_SCOPE, SET with CACHE INTERNAL, or
3709 some other means of value propagation.
3710
3711
3712 NOTES: A list in cmake is a ; separated group of strings. To
3713 create a list the set command can be used. For example, set(var
3714 a b c d e) creates a list with a;b;c;d;e, and set(var "a b c d
3715 e") creates a string or a list with one item in it.
3716
3717
3718 When specifying index values, if <element index> is 0 or
3719 greater, it is indexed from the beginning of the list, with 0
3720 representing the first list element. If <element index> is -1 or
3721 lesser, it is indexed from the end of the list, with -1 repre‐
3722 senting the last list element. Be careful when counting with
3723 negative indices: they do not start from 0. -0 is equivalent to
3724 0, the first list element.
3725
3726
3727
3728 load_cache
3729 Load in the values from another project's CMake cache.
3730
3731 load_cache(pathToCacheFile READ_WITH_PREFIX
3732 prefix entry1...)
3733
3734 Read the cache and store the requested entries in variables with
3735 their name prefixed with the given prefix. This only reads the
3736 values, and does not create entries in the local project's
3737 cache.
3738
3739
3740 load_cache(pathToCacheFile [EXCLUDE entry1...]
3741 [INCLUDE_INTERNALS entry1...])
3742
3743 Load in the values from another cache and store them in the
3744 local project's cache as internal entries. This is useful for a
3745 project that depends on another project built in a different
3746 tree. EXCLUDE option can be used to provide a list of entries
3747 to be excluded. INCLUDE_INTERNALS can be used to provide a list
3748 of internal entries to be included. Normally, no internal
3749 entries are brought in. Use of this form of the command is
3750 strongly discouraged, but it is provided for backward compati‐
3751 bility.
3752
3753
3754 load_command
3755 Load a command into a running CMake.
3756
3757 load_command(COMMAND_NAME <loc1> [loc2 ...])
3758
3759 The given locations are searched for a library whose name is
3760 cmCOMMAND_NAME. If found, it is loaded as a module and the com‐
3761 mand is added to the set of available CMake commands. Usually,
3762 TRY_COMPILE is used before this command to compile the module.
3763 If the command is successfully loaded a variable named
3764
3765
3766 CMAKE_LOADED_COMMAND_<COMMAND_NAME>
3767
3768 will be set to the full path of the module that was loaded.
3769 Otherwise the variable will not be set.
3770
3771
3772 macro Start recording a macro for later invocation as a command.
3773
3774 macro(<name> [arg1 [arg2 [arg3 ...]]])
3775 COMMAND1(ARGS ...)
3776 COMMAND2(ARGS ...)
3777 ...
3778 endmacro(<name>)
3779
3780 Define a macro named <name> that takes arguments named arg1 arg2
3781 arg3 (...). Commands listed after macro, but before the match‐
3782 ing endmacro, are not invoked until the macro is invoked. When
3783 it is invoked, the commands recorded in the macro are first mod‐
3784 ified by replacing formal parameters (${arg1}) with the argu‐
3785 ments passed, and then invoked as normal commands. In addition
3786 to referencing the formal parameters you can reference the val‐
3787 ues ${ARGC} which will be set to the number of arguments passed
3788 into the function as well as ${ARGV0} ${ARGV1} ${ARGV2} ...
3789 which will have the actual values of the arguments passed in.
3790 This facilitates creating macros with optional arguments. Addi‐
3791 tionally ${ARGV} holds the list of all arguments given to the
3792 macro and ${ARGN} holds the list of arguments past the last
3793 expected argument. Note that the parameters to a macro and val‐
3794 ues such as ARGN are not variables in the usual CMake sense.
3795 They are string replacements much like the C preprocessor would
3796 do with a macro. If you want true CMake variables and/or better
3797 CMake scope control you should look at the function command.
3798
3799
3800 See the cmake_policy() command documentation for the behavior of
3801 policies inside macros.
3802
3803
3804 mark_as_advanced
3805 Mark cmake cached variables as advanced.
3806
3807 mark_as_advanced([CLEAR|FORCE] VAR VAR2 VAR...)
3808
3809 Mark the named cached variables as advanced. An advanced vari‐
3810 able will not be displayed in any of the cmake GUIs unless the
3811 show advanced option is on. If CLEAR is the first argument
3812 advanced variables are changed back to unadvanced. If FORCE is
3813 the first argument, then the variable is made advanced. If nei‐
3814 ther FORCE nor CLEAR is specified, new values will be marked as
3815 advanced, but if the variable already has an
3816 advanced/non-advanced state, it will not be changed.
3817
3818
3819 It does nothing in script mode.
3820
3821
3822 math Mathematical expressions.
3823
3824 math(EXPR <output variable> <math expression>)
3825
3826 EXPR evaluates mathematical expression and returns result in the
3827 output variable. Example mathematical expression is '5 * ( 10 +
3828 13 )'. Supported operators are + - * / % | & ^ ~ << >> * / %.
3829 They have the same meaning as they do in C code.
3830
3831
3832 message
3833 Display a message to the user.
3834
3835 message([STATUS|WARNING|AUTHOR_WARNING|FATAL_ERROR|SEND_ERROR]
3836 "message to display" ...)
3837
3838 The optional keyword determines the type of message:
3839
3840
3841 (none) = Important information
3842 STATUS = Incidental information
3843 WARNING = CMake Warning, continue processing
3844 AUTHOR_WARNING = CMake Warning (dev), continue processing
3845 SEND_ERROR = CMake Error, continue processing,
3846 but skip generation
3847 FATAL_ERROR = CMake Error, stop processing and generation
3848
3849 The CMake command-line tool displays STATUS messages on stdout
3850 and all other message types on stderr. The CMake GUI displays
3851 all messages in its log area. The interactive dialogs (ccmake
3852 and CMakeSetup) show STATUS messages one at a time on a status
3853 line and other messages in interactive pop-up boxes.
3854
3855
3856 CMake Warning and Error message text displays using a simple
3857 markup language. Non-indented text is formatted in line-wrapped
3858 paragraphs delimited by newlines. Indented text is considered
3859 pre-formatted.
3860
3861
3862 option Provides an option that the user can optionally select.
3863
3864 option(<option_variable> "help string describing option"
3865 [initial value])
3866
3867 Provide an option for the user to select as ON or OFF. If no
3868 initial value is provided, OFF is used.
3869
3870
3871 If you have options that depend on the values of other options,
3872 see the module help for CMakeDependentOption.
3873
3874
3875 project
3876 Set a name for the entire project.
3877
3878 project(<projectname> [languageName1 languageName2 ... ] )
3879
3880 Sets the name of the project. Additionally this sets the vari‐
3881 ables <projectName>_BINARY_DIR and <projectName>_SOURCE_DIR to
3882 the respective values.
3883
3884
3885 Optionally you can specify which languages your project sup‐
3886 ports. Example languages are CXX (i.e. C++), C, Fortran, etc.
3887 By default C and CXX are enabled. E.g. if you do not have a C++
3888 compiler, you can disable the check for it by explicitly listing
3889 the languages you want to support, e.g. C. By using the special
3890 language "NONE" all checks for any language can be disabled. If
3891 a variable exists called CMAKE_PROJECT_<projectName>_INCLUDE,
3892 the file pointed to by that variable will be included as the
3893 last step of the project command.
3894
3895
3896 The top-level CMakeLists.txt file for a project must contain a
3897 literal, direct call to the project() command; loading one
3898 through the include() command is not sufficient. If no such
3899 call exists CMake will implicitly add one to the top that
3900 enables the default languages (C and CXX).
3901
3902
3903 qt_wrap_cpp
3904 Create Qt Wrappers.
3905
3906 qt_wrap_cpp(resultingLibraryName DestName
3907 SourceLists ...)
3908
3909 Produce moc files for all the .h files listed in the
3910 SourceLists. The moc files will be added to the library using
3911 the DestName source list.
3912
3913
3914 qt_wrap_ui
3915 Create Qt user interfaces Wrappers.
3916
3917 qt_wrap_ui(resultingLibraryName HeadersDestName
3918 SourcesDestName SourceLists ...)
3919
3920 Produce .h and .cxx files for all the .ui files listed in the
3921 SourceLists. The .h files will be added to the library using
3922 the HeadersDestNamesource list. The .cxx files will be added to
3923 the library using the SourcesDestNamesource list.
3924
3925
3926 remove_definitions
3927 Removes -D define flags added by add_definitions.
3928
3929 remove_definitions(-DFOO -DBAR ...)
3930
3931 Removes flags (added by add_definitions) from the compiler com‐
3932 mand line for sources in the current directory and below.
3933
3934
3935 return Return from a file, directory or function.
3936
3937 return()
3938
3939 Returns from a file, directory or function. When this command is
3940 encountered in an included file (via include() or find_pack‐
3941 age()), it causes processing of the current file to stop and
3942 control is returned to the including file. If it is encountered
3943 in a file which is not included by another file, e.g. a CMake‐
3944 Lists.txt, control is returned to the parent directory if there
3945 is one. If return is called in a function, control is returned
3946 to the caller of the function. Note that a macro is not a func‐
3947 tion and does not handle return like a function does.
3948
3949
3950 separate_arguments
3951 Parse space-separated arguments into a semicolon-separated list.
3952
3953 separate_arguments(<var> <UNIX|WINDOWS>_COMMAND "<args>")
3954
3955 Parses a unix- or windows-style command-line string "<args>" and
3956 stores a semicolon-separated list of the arguments in <var>.
3957 The entire command line must be given in one "<args>" argument.
3958
3959
3960 The UNIX_COMMAND mode separates arguments by unquoted white‐
3961 space. It recognizes both single-quote and double-quote pairs.
3962 A backslash escapes the next literal character (\" is "); there
3963 are no special escapes (\n is just n).
3964
3965
3966 The WINDOWS_COMMAND mode parses a windows command-line using the
3967 same syntax the runtime library uses to construct argv at
3968 startup. It separates arguments by whitespace that is not dou‐
3969 ble-quoted. Backslashes are literal unless they precede dou‐
3970 ble-quotes. See the MSDN article "Parsing C Command-Line Argu‐
3971 ments" for details.
3972
3973
3974 separate_arguments(VARIABLE)
3975
3976 Convert the value of VARIABLE to a semi-colon separated list.
3977 All spaces are replaced with ';'. This helps with generating
3978 command lines.
3979
3980
3981 set Set a CMake, cache or environment variable to a given value.
3982
3983 set(<variable> <value>
3984 [[CACHE <type> <docstring> [FORCE]] | PARENT_SCOPE])
3985
3986 Within CMake sets <variable> to the value <value>. <value> is
3987 expanded before <variable> is set to it. Normally, set will set
3988 a regular CMake variable. If CACHE is present, then the <vari‐
3989 able> is put in the cache instead, unless it is already in the
3990 cache. See section 'Variable types in CMake' below for details
3991 of regular and cache variables and their interactions. If CACHE
3992 is used, <type> and <docstring> are required. <type> is used by
3993 the CMake GUI to choose a widget with which the user sets a
3994 value. The value for <type> may be one of
3995
3996
3997 FILEPATH = File chooser dialog.
3998 PATH = Directory chooser dialog.
3999 STRING = Arbitrary string.
4000 BOOL = Boolean ON/OFF checkbox.
4001 INTERNAL = No GUI entry (used for persistent variables).
4002
4003 If <type> is INTERNAL, the cache variable is marked as internal,
4004 and will not be shown to the user in tools like cmake-gui. This
4005 is intended for values that should be persisted in the cache,
4006 but which users should not normally change. INTERNAL implies
4007 FORCE.
4008
4009
4010 Normally, set(...CACHE...) creates cache variables, but does not
4011 modify them. If FORCE is specified, the value of the cache vari‐
4012 able is set, even if the variable is already in the cache. This
4013 should normally be avoided, as it will remove any changes to the
4014 cache variable's value by the user.
4015
4016
4017 If PARENT_SCOPE is present, the variable will be set in the
4018 scope above the current scope. Each new directory or function
4019 creates a new scope. This command will set the value of a vari‐
4020 able into the parent directory or calling function (whichever is
4021 applicable to the case at hand). PARENT_SCOPE cannot be combined
4022 with CACHE.
4023
4024
4025 If <value> is not specified then the variable is removed instead
4026 of set. See also: the unset() command.
4027
4028
4029 set(<variable> <value1> ... <valueN>)
4030
4031 In this case <variable> is set to a semicolon separated list of
4032 values.
4033
4034
4035 <variable> can be an environment variable such as:
4036
4037
4038 set( ENV{PATH} /home/martink )
4039
4040 in which case the environment variable will be set.
4041
4042
4043 *** Variable types in CMake ***
4044
4045
4046 In CMake there are two types of variables: normal variables and
4047 cache variables. Normal variables are meant for the internal use
4048 of the script (just like variables in most programming lan‐
4049 guages); they are not persisted across CMake runs. Cache vari‐
4050 ables (unless set with INTERNAL) are mostly intended for config‐
4051 uration settings where the first CMake run determines a suitable
4052 default value, which the user can then override, by editing the
4053 cache with tools such as ccmake or cmake-gui. Cache variables
4054 are stored in the CMake cache file, and are persisted across
4055 CMake runs.
4056
4057
4058 Both types can exist at the same time with the same name but
4059 different values. When ${FOO} is evaluated, CMake first looks
4060 for a normal variable 'FOO' in scope and uses it if set. If and
4061 only if no normal variable exists then it falls back to the
4062 cache variable 'FOO'.
4063
4064
4065 Some examples:
4066
4067
4068 The code 'set(FOO "x")' sets the normal variable 'FOO'. It does
4069 not touch the cache, but it will hide any existing cache value
4070 'FOO'.
4071
4072
4073 The code 'set(FOO "x" CACHE ...)' checks for 'FOO' in the cache,
4074 ignoring any normal variable of the same name. If 'FOO' is in
4075 the cache then nothing happens to either the normal variable or
4076 the cache variable. If 'FOO' is not in the cache, then it is
4077 added to the cache.
4078
4079
4080 Finally, whenever a cache variable is added or modified by a
4081 command, CMake also *removes* the normal variable of the same
4082 name from the current scope so that an immediately following
4083 evaluation of it will expose the newly cached value.
4084
4085
4086 Normally projects should avoid using normal and cache variables
4087 of the same name, as this interaction can be hard to follow.
4088 However, in some situations it can be useful. One example (used
4089 by some projects):
4090
4091
4092 A project has a subproject in its source tree. The child project
4093 has its own CMakeLists.txt, which is included from the parent
4094 CMakeLists.txt using add_subdirectory(). Now, if the parent and
4095 the child project provide the same option (for example a com‐
4096 piler option), the parent gets the first chance to add a
4097 user-editable option to the cache. Normally, the child would
4098 then use the same value that the parent uses. However, it may be
4099 necessary to hard-code the value for the child project's option
4100 while still allowing the user to edit the value used by the par‐
4101 ent project. The parent project can achieve this simply by set‐
4102 ting a normal variable with the same name as the option in a
4103 scope sufficient to hide the option's cache variable from the
4104 child completely. The parent has already set the cache variable,
4105 so the child's set(...CACHE...) will do nothing, and evaluating
4106 the option variable will use the value from the normal variable,
4107 which hides the cache variable.
4108
4109
4110 set_directory_properties
4111 Set a property of the directory.
4112
4113 set_directory_properties(PROPERTIES prop1 value1 prop2 value2)
4114
4115 Set a property for the current directory and subdirectories. If
4116 the property is not found, CMake will report an error. The prop‐
4117 erties include: INCLUDE_DIRECTORIES, LINK_DIRECTORIES,
4118 INCLUDE_REGULAR_EXPRESSION, and ADDITIONAL_MAKE_CLEAN_FILES.
4119 ADDITIONAL_MAKE_CLEAN_FILES is a list of files that will be
4120 cleaned as a part of "make clean" stage.
4121
4122
4123 set_property
4124 Set a named property in a given scope.
4125
4126 set_property(<GLOBAL |
4127 DIRECTORY [dir] |
4128 TARGET [target1 [target2 ...]] |
4129 SOURCE [src1 [src2 ...]] |
4130 TEST [test1 [test2 ...]] |
4131 CACHE [entry1 [entry2 ...]]>
4132 [APPEND] [APPEND_STRING]
4133 PROPERTY <name> [value1 [value2 ...]])
4134
4135 Set one property on zero or more objects of a scope. The first
4136 argument determines the scope in which the property is set. It
4137 must be one of the following:
4138
4139
4140 GLOBAL scope is unique and does not accept a name.
4141
4142
4143 DIRECTORY scope defaults to the current directory but another
4144 directory (already processed by CMake) may be named by full or
4145 relative path.
4146
4147
4148 TARGET scope may name zero or more existing targets.
4149
4150
4151 SOURCE scope may name zero or more source files. Note that
4152 source file properties are visible only to targets added in the
4153 same directory (CMakeLists.txt).
4154
4155
4156 TEST scope may name zero or more existing tests.
4157
4158
4159 CACHE scope must name zero or more cache existing entries.
4160
4161
4162 The required PROPERTY option is immediately followed by the name
4163 of the property to set. Remaining arguments are used to compose
4164 the property value in the form of a semicolon-separated list.
4165 If the APPEND option is given the list is appended to any exist‐
4166 ing property value.If the APPEND_STRING option is given the
4167 string is append to any existing property value as string, i.e.
4168 it results in a longer string and not a list of strings.
4169
4170
4171 set_source_files_properties
4172 Source files can have properties that affect how they are built.
4173
4174 set_source_files_properties([file1 [file2 [...]]]
4175 PROPERTIES prop1 value1
4176 [prop2 value2 [...]])
4177
4178 Set properties associated with source files using a key/value
4179 paired list. See properties documentation for those known to
4180 CMake. Unrecognized properties are ignored. Source file prop‐
4181 erties are visible only to targets added in the same directory
4182 (CMakeLists.txt).
4183
4184
4185 set_target_properties
4186 Targets can have properties that affect how they are built.
4187
4188 set_target_properties(target1 target2 ...
4189 PROPERTIES prop1 value1
4190 prop2 value2 ...)
4191
4192 Set properties on a target. The syntax for the command is to
4193 list all the files you want to change, and then provide the val‐
4194 ues you want to set next. You can use any prop value pair you
4195 want and extract it later with the GET_TARGET_PROPERTY command.
4196
4197
4198 Properties that affect the name of a target's output file are as
4199 follows. The PREFIX and SUFFIX properties override the default
4200 target name prefix (such as "lib") and suffix (such as ".so").
4201 IMPORT_PREFIX and IMPORT_SUFFIX are the equivalent properties
4202 for the import library corresponding to a DLL (for SHARED
4203 library targets). OUTPUT_NAME sets the real name of a target
4204 when it is built and can be used to help create two targets of
4205 the same name even though CMake requires unique logical target
4206 names. There is also a <CONFIG>_OUTPUT_NAME that can set the
4207 output name on a per-configuration basis. <CONFIG>_POSTFIX sets
4208 a postfix for the real name of the target when it is built under
4209 the configuration named by <CONFIG> (in upper-case, such as
4210 "DEBUG_POSTFIX"). The value of this property is initialized
4211 when the target is created to the value of the variable
4212 CMAKE_<CONFIG>_POSTFIX (except for executable targets because
4213 earlier CMake versions which did not use this variable for exe‐
4214 cutables).
4215
4216
4217 The LINK_FLAGS property can be used to add extra flags to the
4218 link step of a target. LINK_FLAGS_<CONFIG> will add to the con‐
4219 figuration <CONFIG>, for example, DEBUG, RELEASE, MINSIZEREL,
4220 RELWITHDEBINFO. DEFINE_SYMBOL sets the name of the preprocessor
4221 symbol defined when compiling sources in a shared library. If
4222 not set here then it is set to target_EXPORTS by default (with
4223 some substitutions if the target is not a valid C identifier).
4224 This is useful for headers to know whether they are being
4225 included from inside their library or outside to properly setup
4226 dllexport/dllimport decorations. The COMPILE_FLAGS property sets
4227 additional compiler flags used to build sources within the tar‐
4228 get. It may also be used to pass additional preprocessor defi‐
4229 nitions.
4230
4231
4232 The LINKER_LANGUAGE property is used to change the tool used to
4233 link an executable or shared library. The default is set the
4234 language to match the files in the library. CXX and C are common
4235 values for this property.
4236
4237
4238 For shared libraries VERSION and SOVERSION can be used to spec‐
4239 ify the build version and API version respectively. When build‐
4240 ing or installing appropriate symlinks are created if the plat‐
4241 form supports symlinks and the linker supports so-names. If only
4242 one of both is specified the missing is assumed to have the same
4243 version number. For executables VERSION can be used to specify
4244 the build version. When building or installing appropriate sym‐
4245 links are created if the platform supports symlinks. For shared
4246 libraries and executables on Windows the VERSION attribute is
4247 parsed to extract a "major.minor" version number. These numbers
4248 are used as the image version of the binary.
4249
4250
4251 There are a few properties used to specify RPATH rules.
4252 INSTALL_RPATH is a semicolon-separated list specifying the rpath
4253 to use in installed targets (for platforms that support it).
4254 INSTALL_RPATH_USE_LINK_PATH is a boolean that if set to true
4255 will append directories in the linker search path and outside
4256 the project to the INSTALL_RPATH. SKIP_BUILD_RPATH is a boolean
4257 specifying whether to skip automatic generation of an rpath
4258 allowing the target to run from the build tree.
4259 BUILD_WITH_INSTALL_RPATH is a boolean specifying whether to link
4260 the target in the build tree with the INSTALL_RPATH. This takes
4261 precedence over SKIP_BUILD_RPATH and avoids the need for relink‐
4262 ing before installation. INSTALL_NAME_DIR is a string specify‐
4263 ing the directory portion of the "install_name" field of shared
4264 libraries on Mac OSX to use in the installed targets. When the
4265 target is created the values of the variables
4266 CMAKE_INSTALL_RPATH, CMAKE_INSTALL_RPATH_USE_LINK_PATH,
4267 CMAKE_SKIP_BUILD_RPATH, CMAKE_BUILD_WITH_INSTALL_RPATH, and
4268 CMAKE_INSTALL_NAME_DIR are used to initialize these properties.
4269
4270
4271 PROJECT_LABEL can be used to change the name of the target in an
4272 IDE like visual studio. VS_KEYWORD can be set to change the
4273 visual studio keyword, for example Qt integration works better
4274 if this is set to Qt4VSv1.0.
4275
4276
4277 VS_SCC_PROJECTNAME, VS_SCC_LOCALPATH, VS_SCC_PROVIDER and
4278 VS_SCC_AUXPATH can be set to add support for source control
4279 bindings in a Visual Studio project file.
4280
4281
4282 VS_GLOBAL_<variable> can be set to add a Visual Studio
4283 project-specific global variable. Qt integration works better if
4284 VS_GLOBAL_QtVersion is set to the Qt version FindQt4.cmake
4285 found. For example, "4.7.3"
4286
4287
4288 The PRE_INSTALL_SCRIPT and POST_INSTALL_SCRIPT properties are
4289 the old way to specify CMake scripts to run before and after
4290 installing a target. They are used only when the old
4291 INSTALL_TARGETS command is used to install the target. Use the
4292 INSTALL command instead.
4293
4294
4295 The EXCLUDE_FROM_DEFAULT_BUILD property is used by the visual
4296 studio generators. If it is set to 1 the target will not be
4297 part of the default build when you select "Build Solution". This
4298 can also be set on a per-configuration basis using
4299 EXCLUDE_FROM_DEFAULT_BUILD_<CONFIG>.
4300
4301
4302 set_tests_properties
4303 Set a property of the tests.
4304
4305 set_tests_properties(test1 [test2...] PROPERTIES prop1 value1 prop2 value2)
4306
4307 Set a property for the tests. If the property is not found,
4308 CMake will report an error. The properties include:
4309
4310
4311 WILL_FAIL: If set to true, this will invert the pass/fail flag
4312 of the test.
4313
4314
4315 PASS_REGULAR_EXPRESSION: If set, the test output will be checked
4316 against the specified regular expressions and at least one of
4317 the regular expressions has to match, otherwise the test will
4318 fail.
4319
4320
4321 Example: PASS_REGULAR_EXPRESSION "TestPassed;All ok"
4322
4323 FAIL_REGULAR_EXPRESSION: If set, if the output will match to one
4324 of specified regular expressions, the test will fail.
4325
4326
4327 Example: PASS_REGULAR_EXPRESSION "[^a-z]Error;ERROR;Failed"
4328
4329 Both PASS_REGULAR_EXPRESSION and FAIL_REGULAR_EXPRESSION expect
4330 a list of regular expressions.
4331
4332
4333 TIMEOUT: Setting this will limit the test runtime to the number
4334 of seconds specified.
4335
4336
4337
4338 site_name
4339 Set the given variable to the name of the computer.
4340
4341 site_name(variable)
4342
4343
4344 source_group
4345 Define a grouping for sources in the makefile.
4346
4347 source_group(name [REGULAR_EXPRESSION regex] [FILES src1 src2 ...])
4348
4349 Defines a group into which sources will be placed in project
4350 files. This is mainly used to setup file tabs in Visual Studio.
4351 Any file whose name is listed or matches the regular expression
4352 will be placed in this group. If a file matches multiple
4353 groups, the LAST group that explicitly lists the file will be
4354 favored, if any. If no group explicitly lists the file, the
4355 LAST group whose regular expression matches the file will be
4356 favored.
4357
4358
4359 The name of the group may contain backslashes to specify sub‐
4360 groups:
4361
4362
4363 source_group(outer\\inner ...)
4364
4365 For backwards compatibility, this command also supports the for‐
4366 mat:
4367
4368
4369 source_group(name regex)
4370
4371
4372 string String operations.
4373
4374 string(REGEX MATCH <regular_expression>
4375 <output variable> <input> [<input>...])
4376 string(REGEX MATCHALL <regular_expression>
4377 <output variable> <input> [<input>...])
4378 string(REGEX REPLACE <regular_expression>
4379 <replace_expression> <output variable>
4380 <input> [<input>...])
4381 string(REPLACE <match_string>
4382 <replace_string> <output variable>
4383 <input> [<input>...])
4384 string(<MD5|SHA1|SHA224|SHA256|SHA384|SHA512>
4385 <output variable> <input>)
4386 string(COMPARE EQUAL <string1> <string2> <output variable>)
4387 string(COMPARE NOTEQUAL <string1> <string2> <output variable>)
4388 string(COMPARE LESS <string1> <string2> <output variable>)
4389 string(COMPARE GREATER <string1> <string2> <output variable>)
4390 string(ASCII <number> [<number> ...] <output variable>)
4391 string(CONFIGURE <string1> <output variable>
4392 [@ONLY] [ESCAPE_QUOTES])
4393 string(TOUPPER <string1> <output variable>)
4394 string(TOLOWER <string1> <output variable>)
4395 string(LENGTH <string> <output variable>)
4396 string(SUBSTRING <string> <begin> <length> <output variable>)
4397 string(STRIP <string> <output variable>)
4398 string(RANDOM [LENGTH <length>] [ALPHABET <alphabet>]
4399 [RANDOM_SEED <seed>] <output variable>)
4400 string(FIND <string> <substring> <output variable> [REVERSE])
4401 string(TIMESTAMP <output variable> [<format string>] [UTC])
4402 string(MAKE_C_IDENTIFIER <input string> <output variable>)
4403
4404 REGEX MATCH will match the regular expression once and store the
4405 match in the output variable.
4406
4407
4408 REGEX MATCHALL will match the regular expression as many times
4409 as possible and store the matches in the output variable as a
4410 list.
4411
4412
4413 REGEX REPLACE will match the regular expression as many times as
4414 possible and substitute the replacement expression for the match
4415 in the output. The replace expression may refer to paren-delim‐
4416 ited subexpressions of the match using \1, \2, ..., \9. Note
4417 that two backslashes (\\1) are required in CMake code to get a
4418 backslash through argument parsing.
4419
4420
4421 REPLACE will replace all occurrences of match_string in the
4422 input with replace_string and store the result in the output.
4423
4424
4425 MD5, SHA1, SHA224, SHA256, SHA384, and SHA512 will compute a
4426 cryptographic hash of the input string.
4427
4428
4429 COMPARE EQUAL/NOTEQUAL/LESS/GREATER will compare the strings and
4430 store true or false in the output variable.
4431
4432
4433 ASCII will convert all numbers into corresponding ASCII charac‐
4434 ters.
4435
4436
4437 CONFIGURE will transform a string like CONFIGURE_FILE transforms
4438 a file.
4439
4440
4441 TOUPPER/TOLOWER will convert string to upper/lower characters.
4442
4443
4444 LENGTH will return a given string's length.
4445
4446
4447 SUBSTRING will return a substring of a given string. If length
4448 is -1 the remainder of the string starting at begin will be
4449 returned.
4450
4451
4452 STRIP will return a substring of a given string with leading and
4453 trailing spaces removed.
4454
4455
4456 RANDOM will return a random string of given length consisting of
4457 characters from the given alphabet. Default length is 5 charac‐
4458 ters and default alphabet is all numbers and upper and lower
4459 case letters. If an integer RANDOM_SEED is given, its value
4460 will be used to seed the random number generator.
4461
4462
4463 FIND will return the position where the given substring was
4464 found in the supplied string. If the REVERSE flag was used, the
4465 command will search for the position of the last occurrence of
4466 the specified substring.
4467
4468
4469 The following characters have special meaning in regular expres‐
4470 sions:
4471
4472
4473 ^ Matches at beginning of input
4474 $ Matches at end of input
4475 . Matches any single character
4476 [ ] Matches any character(s) inside the brackets
4477 [^ ] Matches any character(s) not inside the brackets
4478 - Inside brackets, specifies an inclusive range between
4479 characters on either side e.g. [a-f] is [abcdef]
4480 To match a literal - using brackets, make it the first
4481 or the last character e.g. [+*/-] matches basic
4482 mathematical operators.
4483 * Matches preceding pattern zero or more times
4484 + Matches preceding pattern one or more times
4485 ? Matches preceding pattern zero or once only
4486 | Matches a pattern on either side of the |
4487 () Saves a matched subexpression, which can be referenced
4488 in the REGEX REPLACE operation. Additionally it is saved
4489 by all regular expression-related commands, including
4490 e.g. if( MATCHES ), in the variables CMAKE_MATCH_(0..9).
4491
4492 *, + and ? have higher precedence than concatenation. | has
4493 lower precedence than concatenation. This means that the regular
4494 expression "^ab+d$" matches "abbd" but not "ababd", and the reg‐
4495 ular expression "^(ab|cd)$" matches "ab" but not "abd".
4496
4497
4498 TIMESTAMP will write a string representation of the current date
4499 and/or time to the output variable.
4500
4501
4502 Should the command be unable to obtain a timestamp the output
4503 variable will be set to the empty string "".
4504
4505
4506 The optional UTC flag requests the current date/time representa‐
4507 tion to be in Coordinated Universal Time (UTC) rather than local
4508 time.
4509
4510
4511 The optional <format string> may contain the following format
4512 specifiers:
4513
4514
4515 %d The day of the current month (01-31).
4516 %H The hour on a 24-hour clock (00-23).
4517 %I The hour on a 12-hour clock (01-12).
4518 %j The day of the current year (001-366).
4519 %m The month of the current year (01-12).
4520 %M The minute of the current hour (00-59).
4521 %S The second of the current minute.
4522 60 represents a leap second. (00-60)
4523 %U The week number of the current year (00-53).
4524 %w The day of the current week. 0 is Sunday. (0-6)
4525 %y The last two digits of the current year (00-99)
4526 %Y The current year.
4527
4528 Unknown format specifiers will be ignored and copied to the out‐
4529 put as-is.
4530
4531
4532 If no explicit <format string> is given it will default to:
4533
4534
4535 %Y-%m-%dT%H:%M:%S for local time.
4536 %Y-%m-%dT%H:%M:%SZ for UTC.
4537
4538 MAKE_C_IDENTIFIER will write a string which can be used as an
4539 identifier in C.
4540
4541
4542 target_compile_definitions
4543 Add compile definitions to a target.
4544
4545 target_compile_definitions(<target> <INTERFACE|PUBLIC|PRIVATE> [items1...]
4546 [<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])
4547
4548 Specify compile definitions to use when compiling a given tar‐
4549 get. The named <target> must have been created by a command
4550 such as add_executable or add_library and must not be an
4551 IMPORTED target. The INTERFACE, PUBLIC and PRIVATE keywords are
4552 required to specify the scope of the following arguments. PRI‐
4553 VATE and PUBLIC items will populate the COMPILE_DEFINITIONS
4554 property of <target>. PUBLIC and INTERFACE items will populate
4555 the INTERFACE_COMPILE_DEFINITIONS property of <target>. The
4556 following arguments specify compile definitions. Repeated calls
4557 for the same <target> append items in the order called.
4558
4559
4560 Arguments to target_compile_definitions may use "generator
4561 expressions" with the syntax "$<...>". Generator expressions
4562 are evaluated during build system generation to produce informa‐
4563 tion specific to each build configuration. Valid expressions
4564 are:
4565
4566
4567 $<0:...> = empty string (ignores "...")
4568 $<1:...> = content of "..."
4569 $<CONFIG:cfg> = '1' if config is "cfg", else '0'
4570 $<CONFIGURATION> = configuration name
4571 $<BOOL:...> = '1' if the '...' is true, else '0'
4572 $<STREQUAL:a,b> = '1' if a is STREQUAL b, else '0'
4573 $<ANGLE-R> = A literal '>'. Used to compare strings which contain a '>' for example.
4574 $<COMMA> = A literal ','. Used to compare strings which contain a ',' for example.
4575 $<SEMICOLON> = A literal ';'. Used to prevent list expansion on an argument with ';'.
4576 $<JOIN:list,...> = joins the list with the content of "..."
4577 $<TARGET_NAME:...> = Marks ... as being the name of a target. This is required if exporting targets to multiple dependent export sets. The '...' must be a literal name of a target- it may not contain generator expressions.
4578 $<INSTALL_INTERFACE:...> = content of "..." when the property is exported using install(EXPORT), and empty otherwise.
4579 $<BUILD_INTERFACE:...> = content of "..." when the property is exported using export(), or when the target is used by another target in the same buildsystem. Expands to the empty string otherwise.
4580 $<C_COMPILER_ID> = The CMake-id of the C compiler used.
4581 $<C_COMPILER_ID:comp> = '1' if the CMake-id of the C compiler matches comp, otherwise '0'.
4582 $<CXX_COMPILER_ID> = The CMake-id of the CXX compiler used.
4583 $<CXX_COMPILER_ID:comp> = '1' if the CMake-id of the CXX compiler matches comp, otherwise '0'.
4584 $<VERSION_GREATER:v1,v2> = '1' if v1 is a version greater than v2, else '0'.
4585 $<VERSION_LESS:v1,v2> = '1' if v1 is a version less than v2, else '0'.
4586 $<VERSION_EQUAL:v1,v2> = '1' if v1 is the same version as v2, else '0'.
4587 $<C_COMPILER_VERSION> = The version of the C compiler used.
4588 $<C_COMPILER_VERSION:ver> = '1' if the version of the C compiler matches ver, otherwise '0'.
4589 $<CXX_COMPILER_VERSION> = The version of the CXX compiler used.
4590 $<CXX_COMPILER_VERSION:ver> = '1' if the version of the CXX compiler matches ver, otherwise '0'.
4591 $<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)
4592 $<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)
4593 $<TARGET_SONAME_FILE:tgt> = file with soname (.so.3)
4594
4595 where "tgt" is the name of a target. Target file expressions
4596 produce a full path, but _DIR and _NAME versions can produce the
4597 directory and file name components:
4598
4599
4600 $<TARGET_FILE_DIR:tgt>/$<TARGET_FILE_NAME:tgt>
4601 $<TARGET_LINKER_FILE_DIR:tgt>/$<TARGET_LINKER_FILE_NAME:tgt>
4602 $<TARGET_SONAME_FILE_DIR:tgt>/$<TARGET_SONAME_FILE_NAME:tgt>
4603
4604
4605
4606
4607 $<TARGET_PROPERTY:tgt,prop> = The value of the property prop on the target tgt.
4608
4609 Note that tgt is not added as a dependency of the target this
4610 expression is evaluated on.
4611
4612
4613 $<TARGET_POLICY:pol> = '1' if the policy was NEW when the 'head' target was created, else '0'. If the policy was not set, the warning message for the policy will be emitted. This generator expression only works for a subset of policies.
4614 $<INSTALL_PREFIX> = Content of the install prefix when the target is exported via INSTALL(EXPORT) and empty otherwise.
4615
4616 Boolean expressions:
4617
4618
4619 $<AND:?[,?]...> = '1' if all '?' are '1', else '0'
4620 $<OR:?[,?]...> = '0' if all '?' are '0', else '1'
4621 $<NOT:?> = '0' if '?' is '1', else '1'
4622
4623 where '?' is always either '0' or '1'.
4624
4625
4626 Expressions with an implicit 'this' target:
4627
4628
4629 $<TARGET_PROPERTY:prop> = The value of the property prop on the target on which the generator expression is evaluated.
4630
4631
4632 target_compile_options
4633 Add compile options to a target.
4634
4635 target_compile_options(<target> [BEFORE] <INTERFACE|PUBLIC|PRIVATE> [items1...]
4636 [<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])
4637
4638 Specify compile options to use when compiling a given target.
4639 The named <target> must have been created by a command such as
4640 add_executable or add_library and must not be an IMPORTED tar‐
4641 get. If BEFORE is specified, the content will be prepended to
4642 the property instead of being appended.
4643
4644
4645 The INTERFACE, PUBLIC and PRIVATE keywords are required to spec‐
4646 ify the scope of the following arguments. PRIVATE and PUBLIC
4647 items will populate the COMPILE_OPTIONS property of <target>.
4648 PUBLIC and INTERFACE items will populate the INTERFACE_COM‐
4649 PILE_OPTIONS property of <target>. The following arguments
4650 specify compile opitions. Repeated calls for the same <target>
4651 append items in the order called.
4652
4653
4654 Arguments to target_compile_options may use "generator expres‐
4655 sions" with the syntax "$<...>". Generator expressions are
4656 evaluated during build system generation to produce information
4657 specific to each build configuration. Valid expressions are:
4658
4659
4660 $<0:...> = empty string (ignores "...")
4661 $<1:...> = content of "..."
4662 $<CONFIG:cfg> = '1' if config is "cfg", else '0'
4663 $<CONFIGURATION> = configuration name
4664 $<BOOL:...> = '1' if the '...' is true, else '0'
4665 $<STREQUAL:a,b> = '1' if a is STREQUAL b, else '0'
4666 $<ANGLE-R> = A literal '>'. Used to compare strings which contain a '>' for example.
4667 $<COMMA> = A literal ','. Used to compare strings which contain a ',' for example.
4668 $<SEMICOLON> = A literal ';'. Used to prevent list expansion on an argument with ';'.
4669 $<JOIN:list,...> = joins the list with the content of "..."
4670 $<TARGET_NAME:...> = Marks ... as being the name of a target. This is required if exporting targets to multiple dependent export sets. The '...' must be a literal name of a target- it may not contain generator expressions.
4671 $<INSTALL_INTERFACE:...> = content of "..." when the property is exported using install(EXPORT), and empty otherwise.
4672 $<BUILD_INTERFACE:...> = content of "..." when the property is exported using export(), or when the target is used by another target in the same buildsystem. Expands to the empty string otherwise.
4673 $<C_COMPILER_ID> = The CMake-id of the C compiler used.
4674 $<C_COMPILER_ID:comp> = '1' if the CMake-id of the C compiler matches comp, otherwise '0'.
4675 $<CXX_COMPILER_ID> = The CMake-id of the CXX compiler used.
4676 $<CXX_COMPILER_ID:comp> = '1' if the CMake-id of the CXX compiler matches comp, otherwise '0'.
4677 $<VERSION_GREATER:v1,v2> = '1' if v1 is a version greater than v2, else '0'.
4678 $<VERSION_LESS:v1,v2> = '1' if v1 is a version less than v2, else '0'.
4679 $<VERSION_EQUAL:v1,v2> = '1' if v1 is the same version as v2, else '0'.
4680 $<C_COMPILER_VERSION> = The version of the C compiler used.
4681 $<C_COMPILER_VERSION:ver> = '1' if the version of the C compiler matches ver, otherwise '0'.
4682 $<CXX_COMPILER_VERSION> = The version of the CXX compiler used.
4683 $<CXX_COMPILER_VERSION:ver> = '1' if the version of the CXX compiler matches ver, otherwise '0'.
4684 $<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)
4685 $<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)
4686 $<TARGET_SONAME_FILE:tgt> = file with soname (.so.3)
4687
4688 where "tgt" is the name of a target. Target file expressions
4689 produce a full path, but _DIR and _NAME versions can produce the
4690 directory and file name components:
4691
4692
4693 $<TARGET_FILE_DIR:tgt>/$<TARGET_FILE_NAME:tgt>
4694 $<TARGET_LINKER_FILE_DIR:tgt>/$<TARGET_LINKER_FILE_NAME:tgt>
4695 $<TARGET_SONAME_FILE_DIR:tgt>/$<TARGET_SONAME_FILE_NAME:tgt>
4696
4697
4698
4699
4700 $<TARGET_PROPERTY:tgt,prop> = The value of the property prop on the target tgt.
4701
4702 Note that tgt is not added as a dependency of the target this
4703 expression is evaluated on.
4704
4705
4706 $<TARGET_POLICY:pol> = '1' if the policy was NEW when the 'head' target was created, else '0'. If the policy was not set, the warning message for the policy will be emitted. This generator expression only works for a subset of policies.
4707 $<INSTALL_PREFIX> = Content of the install prefix when the target is exported via INSTALL(EXPORT) and empty otherwise.
4708
4709 Boolean expressions:
4710
4711
4712 $<AND:?[,?]...> = '1' if all '?' are '1', else '0'
4713 $<OR:?[,?]...> = '0' if all '?' are '0', else '1'
4714 $<NOT:?> = '0' if '?' is '1', else '1'
4715
4716 where '?' is always either '0' or '1'.
4717
4718
4719 Expressions with an implicit 'this' target:
4720
4721
4722 $<TARGET_PROPERTY:prop> = The value of the property prop on the target on which the generator expression is evaluated.
4723
4724
4725 target_include_directories
4726 Add include directories to a target.
4727
4728 target_include_directories(<target> [SYSTEM] [BEFORE] <INTERFACE|PUBLIC|PRIVATE> [items1...]
4729 [<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])
4730
4731 Specify include directories or targets to use when compiling a
4732 given target. The named <target> must have been created by a
4733 command such as add_executable or add_library and must not be an
4734 IMPORTED target.
4735
4736
4737 If BEFORE is specified, the content will be prepended to the
4738 property instead of being appended.
4739
4740
4741 The INTERFACE, PUBLIC and PRIVATE keywords are required to spec‐
4742 ify the scope of the following arguments. PRIVATE and PUBLIC
4743 items will populate the INCLUDE_DIRECTORIES property of <tar‐
4744 get>. PUBLIC and INTERFACE items will populate the INTER‐
4745 FACE_INCLUDE_DIRECTORIES property of <target>. The following
4746 arguments specify include directories. Specified include direc‐
4747 tories may be absolute paths or relative paths. Repeated calls
4748 for the same <target> append items in the order called.If SYSTEM
4749 is specified, the compiler will be told the directories are
4750 meant as system include directories on some platforms (sig‐
4751 nalling this setting might achieve effects such as the compiler
4752 skipping warnings, or these fixed-install system files not being
4753 considered in dependency calculations - see compiler docs). If
4754 SYSTEM is used together with PUBLIC or INTERFACE, the INTER‐
4755 FACE_SYSTEM_INCLUDE_DIRECTORIES target property will be popu‐
4756 lated with the specified directories.
4757
4758
4759 Arguments to target_include_directories may use "generator
4760 expressions" with the syntax "$<...>". Generator expressions
4761 are evaluated during build system generation to produce informa‐
4762 tion specific to each build configuration. Valid expressions
4763 are:
4764
4765
4766 $<0:...> = empty string (ignores "...")
4767 $<1:...> = content of "..."
4768 $<CONFIG:cfg> = '1' if config is "cfg", else '0'
4769 $<CONFIGURATION> = configuration name
4770 $<BOOL:...> = '1' if the '...' is true, else '0'
4771 $<STREQUAL:a,b> = '1' if a is STREQUAL b, else '0'
4772 $<ANGLE-R> = A literal '>'. Used to compare strings which contain a '>' for example.
4773 $<COMMA> = A literal ','. Used to compare strings which contain a ',' for example.
4774 $<SEMICOLON> = A literal ';'. Used to prevent list expansion on an argument with ';'.
4775 $<JOIN:list,...> = joins the list with the content of "..."
4776 $<TARGET_NAME:...> = Marks ... as being the name of a target. This is required if exporting targets to multiple dependent export sets. The '...' must be a literal name of a target- it may not contain generator expressions.
4777 $<INSTALL_INTERFACE:...> = content of "..." when the property is exported using install(EXPORT), and empty otherwise.
4778 $<BUILD_INTERFACE:...> = content of "..." when the property is exported using export(), or when the target is used by another target in the same buildsystem. Expands to the empty string otherwise.
4779 $<C_COMPILER_ID> = The CMake-id of the C compiler used.
4780 $<C_COMPILER_ID:comp> = '1' if the CMake-id of the C compiler matches comp, otherwise '0'.
4781 $<CXX_COMPILER_ID> = The CMake-id of the CXX compiler used.
4782 $<CXX_COMPILER_ID:comp> = '1' if the CMake-id of the CXX compiler matches comp, otherwise '0'.
4783 $<VERSION_GREATER:v1,v2> = '1' if v1 is a version greater than v2, else '0'.
4784 $<VERSION_LESS:v1,v2> = '1' if v1 is a version less than v2, else '0'.
4785 $<VERSION_EQUAL:v1,v2> = '1' if v1 is the same version as v2, else '0'.
4786 $<C_COMPILER_VERSION> = The version of the C compiler used.
4787 $<C_COMPILER_VERSION:ver> = '1' if the version of the C compiler matches ver, otherwise '0'.
4788 $<CXX_COMPILER_VERSION> = The version of the CXX compiler used.
4789 $<CXX_COMPILER_VERSION:ver> = '1' if the version of the CXX compiler matches ver, otherwise '0'.
4790 $<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)
4791 $<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)
4792 $<TARGET_SONAME_FILE:tgt> = file with soname (.so.3)
4793
4794 where "tgt" is the name of a target. Target file expressions
4795 produce a full path, but _DIR and _NAME versions can produce the
4796 directory and file name components:
4797
4798
4799 $<TARGET_FILE_DIR:tgt>/$<TARGET_FILE_NAME:tgt>
4800 $<TARGET_LINKER_FILE_DIR:tgt>/$<TARGET_LINKER_FILE_NAME:tgt>
4801 $<TARGET_SONAME_FILE_DIR:tgt>/$<TARGET_SONAME_FILE_NAME:tgt>
4802
4803
4804
4805
4806 $<TARGET_PROPERTY:tgt,prop> = The value of the property prop on the target tgt.
4807
4808 Note that tgt is not added as a dependency of the target this
4809 expression is evaluated on.
4810
4811
4812 $<TARGET_POLICY:pol> = '1' if the policy was NEW when the 'head' target was created, else '0'. If the policy was not set, the warning message for the policy will be emitted. This generator expression only works for a subset of policies.
4813 $<INSTALL_PREFIX> = Content of the install prefix when the target is exported via INSTALL(EXPORT) and empty otherwise.
4814
4815 Boolean expressions:
4816
4817
4818 $<AND:?[,?]...> = '1' if all '?' are '1', else '0'
4819 $<OR:?[,?]...> = '0' if all '?' are '0', else '1'
4820 $<NOT:?> = '0' if '?' is '1', else '1'
4821
4822 where '?' is always either '0' or '1'.
4823
4824
4825 Expressions with an implicit 'this' target:
4826
4827
4828 $<TARGET_PROPERTY:prop> = The value of the property prop on the target on which the generator expression is evaluated.
4829
4830
4831 target_link_libraries
4832 Link a target to given libraries.
4833
4834 target_link_libraries(<target> [item1 [item2 [...]]]
4835 [[debug|optimized|general] <item>] ...)
4836
4837 Specify libraries or flags to use when linking a given target.
4838 The named <target> must have been created in the current direc‐
4839 tory by a command such as add_executable or add_library. The
4840 remaining arguments specify library names or flags. Repeated
4841 calls for the same <target> append items in the order called.
4842
4843
4844 If a library name matches that of another target in the project
4845 a dependency will automatically be added in the build system to
4846 make sure the library being linked is up-to-date before the tar‐
4847 get links. Item names starting with '-', but not '-l' or
4848 '-framework', are treated as linker flags.
4849
4850
4851 A "debug", "optimized", or "general" keyword indicates that the
4852 library immediately following it is to be used only for the cor‐
4853 responding build configuration. The "debug" keyword corresponds
4854 to the Debug configuration (or to configurations named in the
4855 DEBUG_CONFIGURATIONS global property if it is set). The "opti‐
4856 mized" keyword corresponds to all other configurations. The
4857 "general" keyword corresponds to all configurations, and is
4858 purely optional (assumed if omitted). Higher granularity may be
4859 achieved for per-configuration rules by creating and linking to
4860 IMPORTED library targets. See the IMPORTED mode of the
4861 add_library command for more information.
4862
4863
4864 Library dependencies are transitive by default with this signa‐
4865 ture. When this target is linked into another target then the
4866 libraries linked to this target will appear on the link line for
4867 the other target too. This transitive "link interface" is
4868 stored in the INTERFACE_LINK_LIBRARIES target property when pol‐
4869 icy CMP0022 is set to NEW and may be overridden by setting the
4870 property directly. (When CMP0022 is not set to NEW, transitive
4871 linking is builtin but may be overridden by the LINK_INTER‐
4872 FACE_LIBRARIES property. Calls to other signatures of this com‐
4873 mand may set the property making any libraries linked exclu‐
4874 sively by this signature private.)
4875
4876
4877 CMake will also propagate "usage requirements" from linked
4878 library targets. Usage requirements affect compilation of
4879 sources in the <target>. They are specified by properties
4880 defined on linked targets. During generation of the build sys‐
4881 tem, CMake integrates usage requirement property values with the
4882 corresponding build properties for <target>:
4883
4884
4885 INTERFACE_COMPILE_DEFINITONS: Appends to COMPILE_DEFINITONS
4886 INTERFACE_INCLUDE_DIRECTORIES: Appends to INCLUDE_DIRECTORIES
4887 INTERFACE_POSITION_INDEPENDENT_CODE: Sets POSITION_INDEPENDENT_CODE
4888 or checked for consistency with existing value
4889
4890
4891
4892
4893 If an <item> is a library in a Mac OX framework, the Headers
4894 directory of the framework will also be processed as a "usage
4895 requirement". This has the same effect as passing the framework
4896 directory as an include directory. target_link_libraries(<tar‐
4897 get>
4898
4899
4900 <PRIVATE|PUBLIC|INTERFACE> <lib> ...
4901 [<PRIVATE|PUBLIC|INTERFACE> <lib> ... ] ...])
4902
4903 The PUBLIC, PRIVATE and INTERFACE keywords can be used to spec‐
4904 ify both the link dependencies and the link interface in one
4905 command. Libraries and targets following PUBLIC are linked to,
4906 and are made part of the link interface. Libraries and targets
4907 following PRIVATE are linked to, but are not made part of the
4908 link interface. Libraries following INTERFACE are appended to
4909 the link interface and are not used for linking <target>.
4910
4911
4912 target_link_libraries(<target> LINK_INTERFACE_LIBRARIES
4913 [[debug|optimized|general] <lib>] ...)
4914
4915 The LINK_INTERFACE_LIBRARIES mode appends the libraries to the
4916 INTERFACE_LINK_LIBRARIES target property instead of using them
4917 for linking. If policy CMP0022 is not NEW, then this mode also
4918 appends libraries to the LINK_INTERFACE_LIBRARIES and its
4919 per-configuration equivalent. This signature is for compatibil‐
4920 ity only. Prefer the INTERFACE mode instead. Libraries speci‐
4921 fied as "debug" are wrapped in a generator expression to corre‐
4922 spond to debug builds. If policy CMP0022 is not NEW, the
4923 libraries are also appended to the LINK_INTER‐
4924 FACE_LIBRARIES_DEBUG property (or to the properties correspond‐
4925 ing to configurations listed in the DEBUG_CONFIGURATIONS global
4926 property if it is set). Libraries specified as "optimized" are
4927 appended to the INTERFACE_LINK_LIBRARIES property. If policy
4928 CMP0022 is not NEW, they are also appended to the LINK_INTER‐
4929 FACE_LIBRARIES property. Libraries specified as "general" (or
4930 without any keyword) are treated as if specified for both
4931 "debug" and "optimized".
4932
4933
4934 target_link_libraries(<target>
4935 <LINK_PRIVATE|LINK_PUBLIC>
4936 [[debug|optimized|general] <lib>] ...
4937 [<LINK_PRIVATE|LINK_PUBLIC>
4938 [[debug|optimized|general] <lib>] ...])
4939
4940 The LINK_PUBLIC and LINK_PRIVATE modes can be used to specify
4941 both the link dependencies and the link interface in one com‐
4942 mand. This signature is for compatibility only. Prefer the PUB‐
4943 LIC or PRIVATE keywords instead. Libraries and targets follow‐
4944 ing LINK_PUBLIC are linked to, and are made part of the INTER‐
4945 FACE_LINK_LIBRARIES. If policy CMP0022 is not NEW, they are
4946 also made part of the LINK_INTERFACE_LIBRARIES. Libraries and
4947 targets following LINK_PRIVATE are linked to, but are not made
4948 part of the INTERFACE_LINK_LIBRARIES (or LINK_INTER‐
4949 FACE_LIBRARIES).
4950
4951
4952 The library dependency graph is normally acyclic (a DAG), but in
4953 the case of mutually-dependent STATIC libraries CMake allows the
4954 graph to contain cycles (strongly connected components). When
4955 another target links to one of the libraries CMake repeats the
4956 entire connected component. For example, the code
4957
4958
4959 add_library(A STATIC a.c)
4960 add_library(B STATIC b.c)
4961 target_link_libraries(A B)
4962 target_link_libraries(B A)
4963 add_executable(main main.c)
4964 target_link_libraries(main A)
4965
4966 links 'main' to 'A B A B'. (While one repetition is usually
4967 sufficient, pathological object file and symbol arrangements can
4968 require more. One may handle such cases by manually repeating
4969 the component in the last target_link_libraries call. However,
4970 if two archives are really so interdependent they should proba‐
4971 bly be combined into a single archive.)
4972
4973
4974 Arguments to target_link_libraries may use "generator expres‐
4975 sions" with the syntax "$<...>". Note however, that generator
4976 expressions will not be used in OLD handling of CMP0003 or
4977 CMP0004.
4978
4979
4980 Generator expressions are evaluated during build system genera‐
4981 tion to produce information specific to each build configura‐
4982 tion. Valid expressions are:
4983
4984
4985 $<0:...> = empty string (ignores "...")
4986 $<1:...> = content of "..."
4987 $<CONFIG:cfg> = '1' if config is "cfg", else '0'
4988 $<CONFIGURATION> = configuration name
4989 $<BOOL:...> = '1' if the '...' is true, else '0'
4990 $<STREQUAL:a,b> = '1' if a is STREQUAL b, else '0'
4991 $<ANGLE-R> = A literal '>'. Used to compare strings which contain a '>' for example.
4992 $<COMMA> = A literal ','. Used to compare strings which contain a ',' for example.
4993 $<SEMICOLON> = A literal ';'. Used to prevent list expansion on an argument with ';'.
4994 $<JOIN:list,...> = joins the list with the content of "..."
4995 $<TARGET_NAME:...> = Marks ... as being the name of a target. This is required if exporting targets to multiple dependent export sets. The '...' must be a literal name of a target- it may not contain generator expressions.
4996 $<INSTALL_INTERFACE:...> = content of "..." when the property is exported using install(EXPORT), and empty otherwise.
4997 $<BUILD_INTERFACE:...> = content of "..." when the property is exported using export(), or when the target is used by another target in the same buildsystem. Expands to the empty string otherwise.
4998 $<C_COMPILER_ID> = The CMake-id of the C compiler used.
4999 $<C_COMPILER_ID:comp> = '1' if the CMake-id of the C compiler matches comp, otherwise '0'.
5000 $<CXX_COMPILER_ID> = The CMake-id of the CXX compiler used.
5001 $<CXX_COMPILER_ID:comp> = '1' if the CMake-id of the CXX compiler matches comp, otherwise '0'.
5002 $<VERSION_GREATER:v1,v2> = '1' if v1 is a version greater than v2, else '0'.
5003 $<VERSION_LESS:v1,v2> = '1' if v1 is a version less than v2, else '0'.
5004 $<VERSION_EQUAL:v1,v2> = '1' if v1 is the same version as v2, else '0'.
5005 $<C_COMPILER_VERSION> = The version of the C compiler used.
5006 $<C_COMPILER_VERSION:ver> = '1' if the version of the C compiler matches ver, otherwise '0'.
5007 $<CXX_COMPILER_VERSION> = The version of the CXX compiler used.
5008 $<CXX_COMPILER_VERSION:ver> = '1' if the version of the CXX compiler matches ver, otherwise '0'.
5009 $<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)
5010 $<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)
5011 $<TARGET_SONAME_FILE:tgt> = file with soname (.so.3)
5012
5013 where "tgt" is the name of a target. Target file expressions
5014 produce a full path, but _DIR and _NAME versions can produce the
5015 directory and file name components:
5016
5017
5018 $<TARGET_FILE_DIR:tgt>/$<TARGET_FILE_NAME:tgt>
5019 $<TARGET_LINKER_FILE_DIR:tgt>/$<TARGET_LINKER_FILE_NAME:tgt>
5020 $<TARGET_SONAME_FILE_DIR:tgt>/$<TARGET_SONAME_FILE_NAME:tgt>
5021
5022
5023
5024
5025 $<TARGET_PROPERTY:tgt,prop> = The value of the property prop on the target tgt.
5026
5027 Note that tgt is not added as a dependency of the target this
5028 expression is evaluated on.
5029
5030
5031 $<TARGET_POLICY:pol> = '1' if the policy was NEW when the 'head' target was created, else '0'. If the policy was not set, the warning message for the policy will be emitted. This generator expression only works for a subset of policies.
5032 $<INSTALL_PREFIX> = Content of the install prefix when the target is exported via INSTALL(EXPORT) and empty otherwise.
5033
5034 Boolean expressions:
5035
5036
5037 $<AND:?[,?]...> = '1' if all '?' are '1', else '0'
5038 $<OR:?[,?]...> = '0' if all '?' are '0', else '1'
5039 $<NOT:?> = '0' if '?' is '1', else '1'
5040
5041 where '?' is always either '0' or '1'.
5042
5043
5044 Expressions with an implicit 'this' target:
5045
5046
5047 $<TARGET_PROPERTY:prop> = The value of the property prop on the target on which the generator expression is evaluated.
5048
5049
5050 try_compile
5051 Try building some code.
5052
5053 try_compile(RESULT_VAR <bindir> <srcdir>
5054 <projectName> [targetName] [CMAKE_FLAGS flags...]
5055 [OUTPUT_VARIABLE <var>])
5056
5057 Try building a project. In this form, srcdir should contain a
5058 complete CMake project with a CMakeLists.txt file and all
5059 sources. The bindir and srcdir will not be deleted after this
5060 command is run. Specify targetName to build a specific target
5061 instead of the 'all' or 'ALL_BUILD' target.
5062
5063
5064 try_compile(RESULT_VAR <bindir> <srcfile|SOURCES srcfile...>
5065 [CMAKE_FLAGS flags...]
5066 [COMPILE_DEFINITIONS flags...]
5067 [LINK_LIBRARIES libs...]
5068 [OUTPUT_VARIABLE <var>]
5069 [COPY_FILE <fileName> [COPY_FILE_ERROR <var>]])
5070
5071 Try building an executable from one or more source files. In
5072 this form the user need only supply one or more source files
5073 that include a definition for 'main'. CMake will create a
5074 CMakeLists.txt file to build the source(s) as an executable.
5075 Specify COPY_FILE to get a copy of the linked executable at the
5076 given fileName and optionally COPY_FILE_ERROR to capture any
5077 error.
5078
5079
5080 In this version all files in bindir/CMakeFiles/CMakeTmp will be
5081 cleaned automatically. For debugging, --debug-trycompile can be
5082 passed to cmake to avoid this clean. However, multiple sequen‐
5083 tial try_compile operations reuse this single output directory.
5084 If you use --debug-trycompile, you can only debug one try_com‐
5085 pile call at a time. The recommended procedure is to configure
5086 with cmake all the way through once, then delete the cache entry
5087 associated with the try_compile call of interest, and then
5088 re-run cmake again with --debug-trycompile.
5089
5090
5091 Some extra flags that can be included are, INCLUDE_DIRECTORIES,
5092 LINK_DIRECTORIES, and LINK_LIBRARIES. COMPILE_DEFINITIONS are
5093 -Ddefinition that will be passed to the compile line.
5094
5095
5096 The srcfile signature also accepts a LINK_LIBRARIES argument
5097 which may contain a list of libraries or IMPORTED targets which
5098 will be linked to in the generated project. If LINK_LIBRARIES
5099 is specified as a parameter to try_compile, then any
5100 LINK_LIBRARIES passed as CMAKE_FLAGS will be ignored.
5101
5102
5103 try_compile creates a CMakeList.txt file on the fly that looks
5104 like this:
5105
5106
5107 add_definitions( <expanded COMPILE_DEFINITIONS from calling cmake>)
5108 include_directories(${INCLUDE_DIRECTORIES})
5109 link_directories(${LINK_DIRECTORIES})
5110 add_executable(cmTryCompileExec sources)
5111 target_link_libraries(cmTryCompileExec ${LINK_LIBRARIES})
5112
5113 In both versions of the command, if OUTPUT_VARIABLE is speci‐
5114 fied, then the output from the build process is stored in the
5115 given variable. The success or failure of the try_compile, i.e.
5116 TRUE or FALSE respectively, is returned in RESULT_VAR.
5117 CMAKE_FLAGS can be used to pass -DVAR:TYPE=VALUE flags to the
5118 cmake that is run during the build. Set variable CMAKE_TRY_COM‐
5119 PILE_CONFIGURATION to choose a build configuration.
5120
5121
5122 try_run
5123 Try compiling and then running some code.
5124
5125 try_run(RUN_RESULT_VAR COMPILE_RESULT_VAR
5126 bindir srcfile [CMAKE_FLAGS <Flags>]
5127 [COMPILE_DEFINITIONS <flags>]
5128 [COMPILE_OUTPUT_VARIABLE comp]
5129 [RUN_OUTPUT_VARIABLE run]
5130 [OUTPUT_VARIABLE var]
5131 [ARGS <arg1> <arg2>...])
5132
5133 Try compiling a srcfile. Return TRUE or FALSE for success or
5134 failure in COMPILE_RESULT_VAR. Then if the compile succeeded,
5135 run the executable and return its exit code in RUN_RESULT_VAR.
5136 If the executable was built, but failed to run, then
5137 RUN_RESULT_VAR will be set to FAILED_TO_RUN. COMPILE_OUT‐
5138 PUT_VARIABLE specifies the variable where the output from the
5139 compile step goes. RUN_OUTPUT_VARIABLE specifies the variable
5140 where the output from the running executable goes.
5141
5142
5143 For compatibility reasons OUTPUT_VARIABLE is still supported,
5144 which gives you the output from the compile and run step com‐
5145 bined.
5146
5147
5148 Cross compiling issues
5149
5150
5151 When cross compiling, the executable compiled in the first step
5152 usually cannot be run on the build host. try_run() checks the
5153 CMAKE_CROSSCOMPILING variable to detect whether CMake is in
5154 crosscompiling mode. If that's the case, it will still try to
5155 compile the executable, but it will not try to run the exe‐
5156 cutable. Instead it will create cache variables which must be
5157 filled by the user or by presetting them in some CMake script
5158 file to the values the executable would have produced if it had
5159 been run on its actual target platform. These variables are
5160 RUN_RESULT_VAR (explanation see above) and if RUN_OUTPUT_VARI‐
5161 ABLE (or OUTPUT_VARIABLE) was used, an additional cache variable
5162 RUN_RESULT_VAR__COMPILE_RESULT_VAR__TRYRUN_OUTPUT.This is
5163 intended to hold stdout and stderr from the executable.
5164
5165
5166 In order to make cross compiling your project easier, use
5167 try_run only if really required. If you use try_run, use
5168 RUN_OUTPUT_VARIABLE (or OUTPUT_VARIABLE) only if really
5169 required. Using them will require that when crosscompiling, the
5170 cache variables will have to be set manually to the output of
5171 the executable. You can also "guard" the calls to try_run with
5172 if(CMAKE_CROSSCOMPILING) and provide an easy-to-preset alterna‐
5173 tive for this case.
5174
5175
5176 Set variable CMAKE_TRY_COMPILE_CONFIGURATION to choose a build
5177 configuration.
5178
5179
5180 unset Unset a variable, cache variable, or environment variable.
5181
5182 unset(<variable> [CACHE])
5183
5184 Removes the specified variable causing it to become undefined.
5185 If CACHE is present then the variable is removed from the cache
5186 instead of the current scope.
5187
5188
5189 <variable> can be an environment variable such as:
5190
5191
5192 unset(ENV{LD_LIBRARY_PATH})
5193
5194 in which case the variable will be removed from the current
5195 environment.
5196
5197
5198 variable_watch
5199 Watch the CMake variable for change.
5200
5201 variable_watch(<variable name> [<command to execute>])
5202
5203 If the specified variable changes, the message will be printed
5204 about the variable being changed. If the command is specified,
5205 the command will be executed. The command will receive the fol‐
5206 lowing arguments: COMMAND(<variable> <access> <value> <current
5207 list file> <stack>)
5208
5209
5210 while Evaluate a group of commands while a condition is true
5211
5212 while(condition)
5213 COMMAND1(ARGS ...)
5214 COMMAND2(ARGS ...)
5215 ...
5216 endwhile(condition)
5217
5218 All commands between while and the matching endwhile are
5219 recorded without being invoked. Once the endwhile is evaluated,
5220 the recorded list of commands is invoked as long as the condi‐
5221 tion is true. The condition is evaluated using the same logic as
5222 the if command.
5223
5224
5226 CMake Properties - Properties supported by CMake, the Cross-Platform Makefile Generator.
5227
5228
5229 This is the documentation for the properties supported by CMake. Prop‐
5230 erties can have different scopes. They can either be assigned to a
5231 source file, a directory, a target or globally to CMake. By modifying
5232 the values of properties the behaviour of the build system can be cus‐
5233 tomized.
5234
5235
5237 ALLOW_DUPLICATE_CUSTOM_TARGETS
5238 Allow duplicate custom targets to be created.
5239
5240 Normally CMake requires that all targets built in a project have
5241 globally unique logical names (see policy CMP0002). This is
5242 necessary to generate meaningful project file names in Xcode and
5243 VS IDE generators. It also allows the target names to be refer‐
5244 enced unambiguously.
5245
5246
5247 Makefile generators are capable of supporting duplicate custom
5248 target names. For projects that care only about Makefile gener‐
5249 ators and do not wish to support Xcode or VS IDE generators, one
5250 may set this property to true to allow duplicate custom targets.
5251 The property allows multiple add_custom_target command calls in
5252 different directories to specify the same target name. However,
5253 setting this property will cause non-Makefile generators to pro‐
5254 duce an error and refuse to generate the project.
5255
5256
5257 AUTOMOC_TARGETS_FOLDER
5258 Name of FOLDER for *_automoc targets that are added automati‐
5259 cally by CMake for targets for which AUTOMOC is enabled.
5260
5261 If not set, CMake uses the FOLDER property of the parent target
5262 as a default value for this property. See also the documentation
5263 for the FOLDER target property and the AUTOMOC target property.
5264
5265
5266 DEBUG_CONFIGURATIONS
5267 Specify which configurations are for debugging.
5268
5269 The value must be a semi-colon separated list of configuration
5270 names. Currently this property is used only by the tar‐
5271 get_link_libraries command (see its documentation for details).
5272 Additional uses may be defined in the future.
5273
5274
5275 This property must be set at the top level of the project and
5276 before the first target_link_libraries command invocation. If
5277 any entry in the list does not match a valid configuration for
5278 the project the behavior is undefined.
5279
5280
5281 DISABLED_FEATURES
5282 List of features which are disabled during the CMake run.
5283
5284 List of features which are disabled during the CMake run. By
5285 default it contains the names of all packages which were not
5286 found. This is determined using the <NAME>_FOUND variables.
5287 Packages which are searched QUIET are not listed. A project can
5288 add its own features to this list. This property is used by the
5289 macros in FeatureSummary.cmake.
5290
5291
5292 ENABLED_FEATURES
5293 List of features which are enabled during the CMake run.
5294
5295 List of features which are enabled during the CMake run. By
5296 default it contains the names of all packages which were found.
5297 This is determined using the <NAME>_FOUND variables. Packages
5298 which are searched QUIET are not listed. A project can add its
5299 own features to this list. This property is used by the macros
5300 in FeatureSummary.cmake.
5301
5302
5303 ENABLED_LANGUAGES
5304 Read-only property that contains the list of currently enabled
5305 languages
5306
5307 Set to list of currently enabled languages.
5308
5309
5310 FIND_LIBRARY_USE_LIB64_PATHS
5311 Whether FIND_LIBRARY should automatically search lib64 directo‐
5312 ries.
5313
5314 FIND_LIBRARY_USE_LIB64_PATHS is a boolean specifying whether the
5315 FIND_LIBRARY command should automatically search the lib64 vari‐
5316 ant of directories called lib in the search path when building
5317 64-bit binaries.
5318
5319
5320 FIND_LIBRARY_USE_OPENBSD_VERSIONING
5321 Whether FIND_LIBRARY should find OpenBSD-style shared libraries.
5322
5323 This property is a boolean specifying whether the FIND_LIBRARY
5324 command should find shared libraries with OpenBSD-style ver‐
5325 sioned extension: ".so.<major>.<minor>". The property is set to
5326 true on OpenBSD and false on other platforms.
5327
5328
5329 GLOBAL_DEPENDS_DEBUG_MODE
5330 Enable global target dependency graph debug mode.
5331
5332 CMake automatically analyzes the global inter-target dependency
5333 graph at the beginning of native build system generation. This
5334 property causes it to display details of its analysis to stderr.
5335
5336
5337 GLOBAL_DEPENDS_NO_CYCLES
5338 Disallow global target dependency graph cycles.
5339
5340 CMake automatically analyzes the global inter-target dependency
5341 graph at the beginning of native build system generation. It
5342 reports an error if the dependency graph contains a cycle that
5343 does not consist of all STATIC library targets. This property
5344 tells CMake to disallow all cycles completely, even among static
5345 libraries.
5346
5347
5348 IN_TRY_COMPILE
5349 Read-only property that is true during a try-compile configura‐
5350 tion.
5351
5352 True when building a project inside a TRY_COMPILE or TRY_RUN
5353 command.
5354
5355
5356 PACKAGES_FOUND
5357 List of packages which were found during the CMake run.
5358
5359 List of packages which were found during the CMake run. Whether
5360 a package has been found is determined using the <NAME>_FOUND
5361 variables.
5362
5363
5364 PACKAGES_NOT_FOUND
5365 List of packages which were not found during the CMake run.
5366
5367 List of packages which were not found during the CMake run.
5368 Whether a package has been found is determined using the
5369 <NAME>_FOUND variables.
5370
5371
5372 PREDEFINED_TARGETS_FOLDER
5373 Name of FOLDER for targets that are added automatically by
5374 CMake.
5375
5376 If not set, CMake uses "CMakePredefinedTargets" as a default
5377 value for this property. Targets such as INSTALL, PACKAGE and
5378 RUN_TESTS will be organized into this FOLDER. See also the docu‐
5379 mentation for the FOLDER target property.
5380
5381
5382 REPORT_UNDEFINED_PROPERTIES
5383 If set, report any undefined properties to this file.
5384
5385 If this property is set to a filename then when CMake runs it
5386 will report any properties or variables that were accessed but
5387 not defined into the filename specified in this property.
5388
5389
5390 RULE_LAUNCH_COMPILE
5391 Specify a launcher for compile rules.
5392
5393 Makefile generators prefix compiler commands with the given
5394 launcher command line. This is intended to allow launchers to
5395 intercept build problems with high granularity. Non-Makefile
5396 generators currently ignore this property.
5397
5398
5399 RULE_LAUNCH_CUSTOM
5400 Specify a launcher for custom rules.
5401
5402 Makefile generators prefix custom commands with the given
5403 launcher command line. This is intended to allow launchers to
5404 intercept build problems with high granularity. Non-Makefile
5405 generators currently ignore this property.
5406
5407
5408 RULE_LAUNCH_LINK
5409 Specify a launcher for link rules.
5410
5411 Makefile generators prefix link and archive commands with the
5412 given launcher command line. This is intended to allow launch‐
5413 ers to intercept build problems with high granularity.
5414 Non-Makefile generators currently ignore this property.
5415
5416
5417 RULE_MESSAGES
5418 Specify whether to report a message for each make rule.
5419
5420 This property specifies whether Makefile generators should add a
5421 progress message describing what each build rule does. If the
5422 property is not set the default is ON. Set the property to OFF
5423 to disable granular messages and report only as each target com‐
5424 pletes. This is intended to allow scripted builds to avoid the
5425 build time cost of detailed reports. If a CMAKE_RULE_MESSAGES
5426 cache entry exists its value initializes the value of this prop‐
5427 erty. Non-Makefile generators currently ignore this property.
5428
5429
5430 TARGET_ARCHIVES_MAY_BE_SHARED_LIBS
5431 Set if shared libraries may be named like archives.
5432
5433 On AIX shared libraries may be named "lib<name>.a". This prop‐
5434 erty is set to true on such platforms.
5435
5436
5437 TARGET_SUPPORTS_SHARED_LIBS
5438 Does the target platform support shared libraries.
5439
5440 TARGET_SUPPORTS_SHARED_LIBS is a boolean specifying whether the
5441 target platform supports shared libraries. Basically all current
5442 general general purpose OS do so, the exception are usually
5443 embedded systems with no or special OSs.
5444
5445
5446 USE_FOLDERS
5447 Use the FOLDER target property to organize targets into folders.
5448
5449 If not set, CMake treats this property as OFF by default. CMake
5450 generators that are capable of organizing into a hierarchy of
5451 folders use the values of the FOLDER target property to name
5452 those folders. See also the documentation for the FOLDER target
5453 property.
5454
5455
5456 __CMAKE_DELETE_CACHE_CHANGE_VARS_
5457 Internal property
5458
5459 Used to detect compiler changes, Do not set.
5460
5461
5463 ADDITIONAL_MAKE_CLEAN_FILES
5464 Additional files to clean during the make clean stage.
5465
5466 A list of files that will be cleaned as a part of the "make
5467 clean" stage.
5468
5469
5470 CACHE_VARIABLES
5471 List of cache variables available in the current directory.
5472
5473 This read-only property specifies the list of CMake cache vari‐
5474 ables currently defined. It is intended for debugging purposes.
5475
5476
5477 CLEAN_NO_CUSTOM
5478 Should the output of custom commands be left.
5479
5480 If this is true then the outputs of custom commands for this
5481 directory will not be removed during the "make clean" stage.
5482
5483
5484 COMPILE_DEFINITIONS
5485 Preprocessor definitions for compiling a directory's sources.
5486
5487 The COMPILE_DEFINITIONS property may be set to a semicolon-sepa‐
5488 rated list of preprocessor definitions using the syntax VAR or
5489 VAR=value. Function-style definitions are not supported. CMake
5490 will automatically escape the value correctly for the native
5491 build system (note that CMake language syntax may require
5492 escapes to specify some values). This property may be set on a
5493 per-configuration basis using the name COMPILE_DEFINITIONS_<CON‐
5494 FIG> where <CONFIG> is an upper-case name (ex. "COMPILE_DEFINI‐
5495 TIONS_DEBUG"). This property will be initialized in each direc‐
5496 tory by its value in the directory's parent.
5497
5498
5499 CMake will automatically drop some definitions that are not sup‐
5500 ported by the native build tool. The VS6 IDE does not support
5501 definition values with spaces (but NMake does).
5502
5503
5504 Disclaimer: Most native build tools have poor support for escap‐
5505 ing certain values. CMake has work-arounds for many cases but
5506 some values may just not be possible to pass correctly. If a
5507 value does not seem to be escaped correctly, do not attempt to
5508 work-around the problem by adding escape sequences to the value.
5509 Your work-around may break in a future version of CMake that has
5510 improved escape support. Instead consider defining the macro in
5511 a (configured) header file. Then report the limitation. Known
5512 limitations include:
5513
5514
5515 # - broken almost everywhere
5516 ; - broken in VS IDE 7.0 and Borland Makefiles
5517 , - broken in VS IDE
5518 % - broken in some cases in NMake
5519 & | - broken in some cases on MinGW
5520 ^ < > \" - broken in most Make tools on Windows
5521
5522 CMake does not reject these values outright because they do work
5523 in some cases. Use with caution.
5524
5525
5526 COMPILE_DEFINITIONS_<CONFIG>
5527 Per-configuration preprocessor definitions in a directory.
5528
5529 This is the configuration-specific version of COMPILE_DEFINI‐
5530 TIONS. This property will be initialized in each directory by
5531 its value in the directory's parent.
5532
5533
5534
5535 COMPILE_OPTIONS
5536 List of options to pass to the compiler.
5537
5538 This property specifies the list of directories given so far for
5539 this property. This property exists on directories and targets.
5540
5541
5542 The target property values are used by the generators to set the
5543 options for the compiler.
5544
5545
5546 Contents of COMPILE_OPTIONS may use "generator expressions" with
5547 the syntax "$<...>". Generator expressions are evaluated during
5548 build system generation to produce information specific to each
5549 build configuration. Valid expressions are:
5550
5551
5552 $<0:...> = empty string (ignores "...")
5553 $<1:...> = content of "..."
5554 $<CONFIG:cfg> = '1' if config is "cfg", else '0'
5555 $<CONFIGURATION> = configuration name
5556 $<BOOL:...> = '1' if the '...' is true, else '0'
5557 $<STREQUAL:a,b> = '1' if a is STREQUAL b, else '0'
5558 $<ANGLE-R> = A literal '>'. Used to compare strings which contain a '>' for example.
5559 $<COMMA> = A literal ','. Used to compare strings which contain a ',' for example.
5560 $<SEMICOLON> = A literal ';'. Used to prevent list expansion on an argument with ';'.
5561 $<JOIN:list,...> = joins the list with the content of "..."
5562 $<TARGET_NAME:...> = Marks ... as being the name of a target. This is required if exporting targets to multiple dependent export sets. The '...' must be a literal name of a target- it may not contain generator expressions.
5563 $<INSTALL_INTERFACE:...> = content of "..." when the property is exported using install(EXPORT), and empty otherwise.
5564 $<BUILD_INTERFACE:...> = content of "..." when the property is exported using export(), or when the target is used by another target in the same buildsystem. Expands to the empty string otherwise.
5565 $<C_COMPILER_ID> = The CMake-id of the C compiler used.
5566 $<C_COMPILER_ID:comp> = '1' if the CMake-id of the C compiler matches comp, otherwise '0'.
5567 $<CXX_COMPILER_ID> = The CMake-id of the CXX compiler used.
5568 $<CXX_COMPILER_ID:comp> = '1' if the CMake-id of the CXX compiler matches comp, otherwise '0'.
5569 $<VERSION_GREATER:v1,v2> = '1' if v1 is a version greater than v2, else '0'.
5570 $<VERSION_LESS:v1,v2> = '1' if v1 is a version less than v2, else '0'.
5571 $<VERSION_EQUAL:v1,v2> = '1' if v1 is the same version as v2, else '0'.
5572 $<C_COMPILER_VERSION> = The version of the C compiler used.
5573 $<C_COMPILER_VERSION:ver> = '1' if the version of the C compiler matches ver, otherwise '0'.
5574 $<CXX_COMPILER_VERSION> = The version of the CXX compiler used.
5575 $<CXX_COMPILER_VERSION:ver> = '1' if the version of the CXX compiler matches ver, otherwise '0'.
5576 $<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)
5577 $<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)
5578 $<TARGET_SONAME_FILE:tgt> = file with soname (.so.3)
5579
5580 where "tgt" is the name of a target. Target file expressions
5581 produce a full path, but _DIR and _NAME versions can produce the
5582 directory and file name components:
5583
5584
5585 $<TARGET_FILE_DIR:tgt>/$<TARGET_FILE_NAME:tgt>
5586 $<TARGET_LINKER_FILE_DIR:tgt>/$<TARGET_LINKER_FILE_NAME:tgt>
5587 $<TARGET_SONAME_FILE_DIR:tgt>/$<TARGET_SONAME_FILE_NAME:tgt>
5588
5589
5590
5591
5592 $<TARGET_PROPERTY:tgt,prop> = The value of the property prop on the target tgt.
5593
5594 Note that tgt is not added as a dependency of the target this
5595 expression is evaluated on.
5596
5597
5598 $<TARGET_POLICY:pol> = '1' if the policy was NEW when the 'head' target was created, else '0'. If the policy was not set, the warning message for the policy will be emitted. This generator expression only works for a subset of policies.
5599 $<INSTALL_PREFIX> = Content of the install prefix when the target is exported via INSTALL(EXPORT) and empty otherwise.
5600
5601 Boolean expressions:
5602
5603
5604 $<AND:?[,?]...> = '1' if all '?' are '1', else '0'
5605 $<OR:?[,?]...> = '0' if all '?' are '0', else '1'
5606 $<NOT:?> = '0' if '?' is '1', else '1'
5607
5608 where '?' is always either '0' or '1'.
5609
5610
5611 Expressions with an implicit 'this' target:
5612
5613
5614 $<TARGET_PROPERTY:prop> = The value of the property prop on the target on which the generator expression is evaluated.
5615
5616
5617 DEFINITIONS
5618 For CMake 2.4 compatibility only. Use COMPILE_DEFINITIONS
5619 instead.
5620
5621 This read-only property specifies the list of flags given so far
5622 to the add_definitions command. It is intended for debugging
5623 purposes. Use the COMPILE_DEFINITIONS instead.
5624
5625
5626 EXCLUDE_FROM_ALL
5627 Exclude the directory from the all target of its parent.
5628
5629 A property on a directory that indicates if its targets are
5630 excluded from the default build target. If it is not, then with
5631 a Makefile for example typing make will cause the targets to be
5632 built. The same concept applies to the default build of other
5633 generators.
5634
5635
5636 IMPLICIT_DEPENDS_INCLUDE_TRANSFORM
5637 Specify #include line transforms for dependencies in a direc‐
5638 tory.
5639
5640 This property specifies rules to transform macro-like #include
5641 lines during implicit dependency scanning of C and C++ source
5642 files. The list of rules must be semicolon-separated with each
5643 entry of the form "A_MACRO(%)=value-with-%" (the % must be lit‐
5644 eral). During dependency scanning occurrences of A_MACRO(...)
5645 on #include lines will be replaced by the value given with the
5646 macro argument substituted for '%'. For example, the entry
5647
5648
5649 MYDIR(%)=<mydir/%>
5650
5651 will convert lines of the form
5652
5653
5654 #include MYDIR(myheader.h)
5655
5656 to
5657
5658
5659 #include <mydir/myheader.h>
5660
5661 allowing the dependency to be followed.
5662
5663
5664 This property applies to sources in all targets within a direc‐
5665 tory. The property value is initialized in each directory by
5666 its value in the directory's parent.
5667
5668
5669 INCLUDE_DIRECTORIES
5670 List of preprocessor include file search directories.
5671
5672 This property specifies the list of directories given so far to
5673 the include_directories command. This property exists on direc‐
5674 tories and targets. In addition to accepting values from the
5675 include_directories command, values may be set directly on any
5676 directory or any target using the set_property command. A tar‐
5677 get gets its initial value for this property from the value of
5678 the directory property. A directory gets its initial value from
5679 its parent directory if it has one. Both directory and target
5680 property values are adjusted by calls to the include_directories
5681 command.
5682
5683
5684 The target property values are used by the generators to set the
5685 include paths for the compiler. See also the include_directo‐
5686 ries command.
5687
5688
5689 INCLUDE_REGULAR_EXPRESSION
5690 Include file scanning regular expression.
5691
5692 This read-only property specifies the regular expression used
5693 during dependency scanning to match include files that should be
5694 followed. See the include_regular_expression command.
5695
5696
5697 INTERPROCEDURAL_OPTIMIZATION
5698 Enable interprocedural optimization for targets in a directory.
5699
5700 If set to true, enables interprocedural optimizations if they
5701 are known to be supported by the compiler.
5702
5703
5704 INTERPROCEDURAL_OPTIMIZATION_<CONFIG>
5705 Per-configuration interprocedural optimization for a directory.
5706
5707 This is a per-configuration version of INTERPROCEDURAL_OPTIMIZA‐
5708 TION. If set, this property overrides the generic property for
5709 the named configuration.
5710
5711
5712 LINK_DIRECTORIES
5713 List of linker search directories.
5714
5715 This read-only property specifies the list of directories given
5716 so far to the link_directories command. It is intended for
5717 debugging purposes.
5718
5719
5720 LISTFILE_STACK
5721 The current stack of listfiles being processed.
5722
5723 This property is mainly useful when trying to debug errors in
5724 your CMake scripts. It returns a list of what list files are
5725 currently being processed, in order. So if one listfile does an
5726 INCLUDE command then that is effectively pushing the included
5727 listfile onto the stack.
5728
5729
5730 MACROS List of macro commands available in the current directory.
5731
5732 This read-only property specifies the list of CMake macros cur‐
5733 rently defined. It is intended for debugging purposes. See the
5734 macro command.
5735
5736
5737 PARENT_DIRECTORY
5738 Source directory that added current subdirectory.
5739
5740 This read-only property specifies the source directory that
5741 added the current source directory as a subdirectory of the
5742 build. In the top-level directory the value is the
5743 empty-string.
5744
5745
5746 RULE_LAUNCH_COMPILE
5747 Specify a launcher for compile rules.
5748
5749 See the global property of the same name for details. This
5750 overrides the global property for a directory.
5751
5752
5753 RULE_LAUNCH_CUSTOM
5754 Specify a launcher for custom rules.
5755
5756 See the global property of the same name for details. This
5757 overrides the global property for a directory.
5758
5759
5760 RULE_LAUNCH_LINK
5761 Specify a launcher for link rules.
5762
5763 See the global property of the same name for details. This
5764 overrides the global property for a directory.
5765
5766
5767 TEST_INCLUDE_FILE
5768 A cmake file that will be included when ctest is run.
5769
5770 If you specify TEST_INCLUDE_FILE, that file will be included and
5771 processed when ctest is run on the directory.
5772
5773
5774 VARIABLES
5775 List of variables defined in the current directory.
5776
5777 This read-only property specifies the list of CMake variables
5778 currently defined. It is intended for debugging purposes.
5779
5780
5781 VS_GLOBAL_SECTION_POST_<section>
5782 Specify a postSolution global section in Visual Studio.
5783
5784 Setting a property like this generates an entry of the following
5785 form in the solution file:
5786
5787
5788 GlobalSection(<section>) = postSolution
5789 <contents based on property value>
5790 EndGlobalSection
5791
5792 The property must be set to a semicolon-separated list of
5793 key=value pairs. Each such pair will be transformed into an
5794 entry in the solution global section. Whitespace around key and
5795 value is ignored. List elements which do not contain an equal
5796 sign are skipped.
5797
5798
5799 This property only works for Visual Studio 7 and above; it is
5800 ignored on other generators. The property only applies when set
5801 on a directory whose CMakeLists.txt contains a project() com‐
5802 mand.
5803
5804
5805 Note that CMake generates postSolution sections Extensibility‐
5806 Globals and ExtensibilityAddIns by default. If you set the cor‐
5807 responding property, it will override the default section. For
5808 example, setting VS_GLOBAL_SECTION_POST_ExtensibilityGlobals
5809 will override the default contents of the ExtensibilityGlobals
5810 section, while keeping ExtensibilityAddIns on its default.
5811
5812
5813 VS_GLOBAL_SECTION_PRE_<section>
5814 Specify a preSolution global section in Visual Studio.
5815
5816 Setting a property like this generates an entry of the following
5817 form in the solution file:
5818
5819
5820 GlobalSection(<section>) = preSolution
5821 <contents based on property value>
5822 EndGlobalSection
5823
5824 The property must be set to a semicolon-separated list of
5825 key=value pairs. Each such pair will be transformed into an
5826 entry in the solution global section. Whitespace around key and
5827 value is ignored. List elements which do not contain an equal
5828 sign are skipped.
5829
5830
5831 This property only works for Visual Studio 7 and above; it is
5832 ignored on other generators. The property only applies when set
5833 on a directory whose CMakeLists.txt contains a project() com‐
5834 mand.
5835
5836
5838 <CONFIG>_OUTPUT_NAME
5839 Old per-configuration target file base name.
5840
5841 This is a configuration-specific version of OUTPUT_NAME. Use
5842 OUTPUT_NAME_<CONFIG> instead.
5843
5844
5845 <CONFIG>_POSTFIX
5846 Postfix to append to the target file name for configuration
5847 <CONFIG>.
5848
5849 When building with configuration <CONFIG> the value of this
5850 property is appended to the target file name built on disk. For
5851 non-executable targets, this property is initialized by the
5852 value of the variable CMAKE_<CONFIG>_POSTFIX if it is set when a
5853 target is created. This property is ignored on the Mac for
5854 Frameworks and App Bundles.
5855
5856
5857 <LANG>_VISIBILITY_PRESET
5858 Value for symbol visibility compile flags
5859
5860 The <LANG>_VISIBILITY_PRESET property determines the value
5861 passed in a visibility related compile option, such as -fvisi‐
5862 bility= for <LANG>. This property only has an affect for
5863 libraries and executables with exports. This property is ini‐
5864 tialized by the value of the variable CMAKE_<LANG>_VISIBIL‐
5865 ITY_PRESET if it is set when a target is created.
5866
5867
5868 ALIASED_TARGET
5869 Name of target aliased by this target.
5870
5871 If this is an ALIAS target, this property contains the name of
5872 the target aliased.
5873
5874
5875 ARCHIVE_OUTPUT_DIRECTORY
5876 Output directory in which to build ARCHIVE target files.
5877
5878 This property specifies the directory into which archive target
5879 files should be built. Multi-configuration generators (VS,
5880 Xcode) append a per-configuration subdirectory to the specified
5881 directory. There are three kinds of target files that may be
5882 built: archive, library, and runtime. Executables are always
5883 treated as runtime targets. Static libraries are always treated
5884 as archive targets. Module libraries are always treated as
5885 library targets. For non-DLL platforms shared libraries are
5886 treated as library targets. For DLL platforms the DLL part of a
5887 shared library is treated as a runtime target and the corre‐
5888 sponding import library is treated as an archive target. All
5889 Windows-based systems including Cygwin are DLL platforms. This
5890 property is initialized by the value of the variable CMAKE_AR‐
5891 CHIVE_OUTPUT_DIRECTORY if it is set when a target is created.
5892
5893
5894 ARCHIVE_OUTPUT_DIRECTORY_<CONFIG>
5895 Per-configuration output directory for ARCHIVE target files.
5896
5897 This is a per-configuration version of ARCHIVE_OUTPUT_DIRECTORY,
5898 but multi-configuration generators (VS, Xcode) do NOT append a
5899 per-configuration subdirectory to the specified directory. This
5900 property is initialized by the value of the variable CMAKE_AR‐
5901 CHIVE_OUTPUT_DIRECTORY_<CONFIG> if it is set when a target is
5902 created.
5903
5904
5905 ARCHIVE_OUTPUT_NAME
5906 Output name for ARCHIVE target files.
5907
5908 This property specifies the base name for archive target files.
5909 It overrides OUTPUT_NAME and OUTPUT_NAME_<CONFIG> properties.
5910 There are three kinds of target files that may be built: ar‐
5911 chive, library, and runtime. Executables are always treated as
5912 runtime targets. Static libraries are always treated as archive
5913 targets. Module libraries are always treated as library targets.
5914 For non-DLL platforms shared libraries are treated as library
5915 targets. For DLL platforms the DLL part of a shared library is
5916 treated as a runtime target and the corresponding import library
5917 is treated as an archive target. All Windows-based systems
5918 including Cygwin are DLL platforms.
5919
5920
5921 ARCHIVE_OUTPUT_NAME_<CONFIG>
5922 Per-configuration output name for ARCHIVE target files.
5923
5924 This is the configuration-specific version of ARCHIVE_OUT‐
5925 PUT_NAME.
5926
5927
5928 AUTOMOC
5929 Should the target be processed with automoc (for Qt projects).
5930
5931 AUTOMOC is a boolean specifying whether CMake will handle the Qt
5932 moc preprocessor automatically, i.e. without having to use the
5933 QT4_WRAP_CPP() or QT5_WRAP_CPP() macro. Currently Qt4 and Qt5
5934 are supported. When this property is set to TRUE, CMake will
5935 scan the source files at build time and invoke moc accordingly.
5936 If an #include statement like #include "moc_foo.cpp" is found,
5937 the Q_OBJECT class declaration is expected in the header, and
5938 moc is run on the header file. If an #include statement like
5939 #include "foo.moc" is found, then a Q_OBJECT is expected in the
5940 current source file and moc is run on the file itself. Addition‐
5941 ally, all header files are parsed for Q_OBJECT macros, and if
5942 found, moc is also executed on those files. The resulting moc
5943 files, which are not included as shown above in any of the
5944 source files are included in a generated <targetname>_auto‐
5945 moc.cpp file, which is compiled as part of the target.This prop‐
5946 erty is initialized by the value of the variable CMAKE_AUTOMOC
5947 if it is set when a target is created.
5948
5949
5950 Additional command line options for moc can be set via the AUTO‐
5951 MOC_MOC_OPTIONS property.
5952
5953
5954 By setting the CMAKE_AUTOMOC_RELAXED_MODE variable to TRUE the
5955 rules for searching the files which will be processed by moc can
5956 be relaxed. See the documentation for this variable for more
5957 details.
5958
5959
5960 The global property AUTOMOC_TARGETS_FOLDER can be used to group
5961 the automoc targets together in an IDE, e.g. in MSVS.
5962
5963
5964 AUTOMOC_MOC_OPTIONS
5965 Additional options for moc when using automoc (see the AUTOMOC
5966 property)
5967
5968 This property is only used if the AUTOMOC property is set to
5969 TRUE for this target. In this case, it holds additional command
5970 line options which will be used when moc is executed during the
5971 build, i.e. it is equivalent to the optional OPTIONS argument of
5972 the qt4_wrap_cpp() macro.
5973
5974
5975 By default it is empty.
5976
5977
5978 BUILD_WITH_INSTALL_RPATH
5979 Should build tree targets have install tree rpaths.
5980
5981 BUILD_WITH_INSTALL_RPATH is a boolean specifying whether to link
5982 the target in the build tree with the INSTALL_RPATH. This takes
5983 precedence over SKIP_BUILD_RPATH and avoids the need for relink‐
5984 ing before installation. This property is initialized by the
5985 value of the variable CMAKE_BUILD_WITH_INSTALL_RPATH if it is
5986 set when a target is created.
5987
5988
5989 BUNDLE This target is a CFBundle on the Mac.
5990
5991 If a module library target has this property set to true it will
5992 be built as a CFBundle when built on the mac. It will have the
5993 directory structure required for a CFBundle and will be suitable
5994 to be used for creating Browser Plugins or other application
5995 resources.
5996
5997
5998 BUNDLE_EXTENSION
5999 The file extension used to name a BUNDLE target on the Mac.
6000
6001 The default value is "bundle" - you can also use "plugin" or
6002 whatever file extension is required by the host app for your
6003 bundle.
6004
6005
6006 COMPATIBLE_INTERFACE_BOOL
6007 Properties which must be compatible with their link interface
6008
6009 The COMPATIBLE_INTERFACE_BOOL property may contain a list of
6010 propertiesfor this target which must be consistent when evalu‐
6011 ated as a boolean in the INTERFACE of all linked dependees. For
6012 example, if a property "FOO" appears in the list, then for each
6013 dependee, the "INTERFACE_FOO" property content in all of its
6014 dependencies must be consistent with each other, and with the
6015 "FOO" property in the dependee. Consistency in this sense has
6016 the meaning that if the property is set, then it must have the
6017 same boolean value as all others, and if the property is not
6018 set, then it is ignored. Note that for each dependee, the set
6019 of properties from this property must not intersect with the set
6020 of properties from the COMPATIBLE_INTERFACE_STRING property.
6021
6022
6023 COMPATIBLE_INTERFACE_STRING
6024 Properties which must be string-compatible with their link
6025 interface
6026
6027 The COMPATIBLE_INTERFACE_STRING property may contain a list of
6028 properties for this target which must be the same when evaluated
6029 as a string in the INTERFACE of all linked dependees. For exam‐
6030 ple, if a property "FOO" appears in the list, then for each
6031 dependee, the "INTERFACE_FOO" property content in all of its
6032 dependencies must be equal with each other, and with the "FOO"
6033 property in the dependee. If the property is not set, then it
6034 is ignored. Note that for each dependee, the set of properties
6035 from this property must not intersect with the set of properties
6036 from the COMPATIBLE_INTERFACE_BOOL property.
6037
6038
6039 COMPILE_DEFINITIONS
6040 Preprocessor definitions for compiling a target's sources.
6041
6042 The COMPILE_DEFINITIONS property may be set to a semicolon-sepa‐
6043 rated list of preprocessor definitions using the syntax VAR or
6044 VAR=value. Function-style definitions are not supported. CMake
6045 will automatically escape the value correctly for the native
6046 build system (note that CMake language syntax may require
6047 escapes to specify some values). This property may be set on a
6048 per-configuration basis using the name COMPILE_DEFINITIONS_<CON‐
6049 FIG> where <CONFIG> is an upper-case name (ex. "COMPILE_DEFINI‐
6050 TIONS_DEBUG").
6051
6052
6053 CMake will automatically drop some definitions that are not sup‐
6054 ported by the native build tool. The VS6 IDE does not support
6055 definition values with spaces (but NMake does).
6056
6057
6058 Contents of COMPILE_DEFINITIONS may use "generator expressions"
6059 with the syntax "$<...>". Generator expressions are evaluated
6060 during build system generation to produce information specific
6061 to each build configuration. Valid expressions are:
6062
6063
6064 $<0:...> = empty string (ignores "...")
6065 $<1:...> = content of "..."
6066 $<CONFIG:cfg> = '1' if config is "cfg", else '0'
6067 $<CONFIGURATION> = configuration name
6068 $<BOOL:...> = '1' if the '...' is true, else '0'
6069 $<STREQUAL:a,b> = '1' if a is STREQUAL b, else '0'
6070 $<ANGLE-R> = A literal '>'. Used to compare strings which contain a '>' for example.
6071 $<COMMA> = A literal ','. Used to compare strings which contain a ',' for example.
6072 $<SEMICOLON> = A literal ';'. Used to prevent list expansion on an argument with ';'.
6073 $<JOIN:list,...> = joins the list with the content of "..."
6074 $<TARGET_NAME:...> = Marks ... as being the name of a target. This is required if exporting targets to multiple dependent export sets. The '...' must be a literal name of a target- it may not contain generator expressions.
6075 $<INSTALL_INTERFACE:...> = content of "..." when the property is exported using install(EXPORT), and empty otherwise.
6076 $<BUILD_INTERFACE:...> = content of "..." when the property is exported using export(), or when the target is used by another target in the same buildsystem. Expands to the empty string otherwise.
6077 $<C_COMPILER_ID> = The CMake-id of the C compiler used.
6078 $<C_COMPILER_ID:comp> = '1' if the CMake-id of the C compiler matches comp, otherwise '0'.
6079 $<CXX_COMPILER_ID> = The CMake-id of the CXX compiler used.
6080 $<CXX_COMPILER_ID:comp> = '1' if the CMake-id of the CXX compiler matches comp, otherwise '0'.
6081 $<VERSION_GREATER:v1,v2> = '1' if v1 is a version greater than v2, else '0'.
6082 $<VERSION_LESS:v1,v2> = '1' if v1 is a version less than v2, else '0'.
6083 $<VERSION_EQUAL:v1,v2> = '1' if v1 is the same version as v2, else '0'.
6084 $<C_COMPILER_VERSION> = The version of the C compiler used.
6085 $<C_COMPILER_VERSION:ver> = '1' if the version of the C compiler matches ver, otherwise '0'.
6086 $<CXX_COMPILER_VERSION> = The version of the CXX compiler used.
6087 $<CXX_COMPILER_VERSION:ver> = '1' if the version of the CXX compiler matches ver, otherwise '0'.
6088 $<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)
6089 $<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)
6090 $<TARGET_SONAME_FILE:tgt> = file with soname (.so.3)
6091
6092 where "tgt" is the name of a target. Target file expressions
6093 produce a full path, but _DIR and _NAME versions can produce the
6094 directory and file name components:
6095
6096
6097 $<TARGET_FILE_DIR:tgt>/$<TARGET_FILE_NAME:tgt>
6098 $<TARGET_LINKER_FILE_DIR:tgt>/$<TARGET_LINKER_FILE_NAME:tgt>
6099 $<TARGET_SONAME_FILE_DIR:tgt>/$<TARGET_SONAME_FILE_NAME:tgt>
6100
6101
6102
6103
6104 $<TARGET_PROPERTY:tgt,prop> = The value of the property prop on the target tgt.
6105
6106 Note that tgt is not added as a dependency of the target this
6107 expression is evaluated on.
6108
6109
6110 $<TARGET_POLICY:pol> = '1' if the policy was NEW when the 'head' target was created, else '0'. If the policy was not set, the warning message for the policy will be emitted. This generator expression only works for a subset of policies.
6111 $<INSTALL_PREFIX> = Content of the install prefix when the target is exported via INSTALL(EXPORT) and empty otherwise.
6112
6113 Boolean expressions:
6114
6115
6116 $<AND:?[,?]...> = '1' if all '?' are '1', else '0'
6117 $<OR:?[,?]...> = '0' if all '?' are '0', else '1'
6118 $<NOT:?> = '0' if '?' is '1', else '1'
6119
6120 where '?' is always either '0' or '1'.
6121
6122
6123 Expressions with an implicit 'this' target:
6124
6125
6126 $<TARGET_PROPERTY:prop> = The value of the property prop on the target on which the generator expression is evaluated.
6127
6128 Disclaimer: Most native build tools have poor support for escap‐
6129 ing certain values. CMake has work-arounds for many cases but
6130 some values may just not be possible to pass correctly. If a
6131 value does not seem to be escaped correctly, do not attempt to
6132 work-around the problem by adding escape sequences to the value.
6133 Your work-around may break in a future version of CMake that has
6134 improved escape support. Instead consider defining the macro in
6135 a (configured) header file. Then report the limitation. Known
6136 limitations include:
6137
6138
6139 # - broken almost everywhere
6140 ; - broken in VS IDE 7.0 and Borland Makefiles
6141 , - broken in VS IDE
6142 % - broken in some cases in NMake
6143 & | - broken in some cases on MinGW
6144 ^ < > \" - broken in most Make tools on Windows
6145
6146 CMake does not reject these values outright because they do work
6147 in some cases. Use with caution.
6148
6149
6150 COMPILE_DEFINITIONS_<CONFIG>
6151 Per-configuration preprocessor definitions on a target.
6152
6153 This is the configuration-specific version of COMPILE_DEFINI‐
6154 TIONS.
6155
6156
6157 COMPILE_FLAGS
6158 Additional flags to use when compiling this target's sources.
6159
6160 The COMPILE_FLAGS property sets additional compiler flags used
6161 to build sources within the target. Use COMPILE_DEFINITIONS to
6162 pass additional preprocessor definitions.
6163
6164
6165 COMPILE_OPTIONS
6166 List of options to pass to the compiler.
6167
6168 This property specifies the list of options specified so far for
6169 this property. This property exists on directories and targets.
6170
6171
6172 The target property values are used by the generators to set the
6173 options for the compiler.
6174
6175
6176 Contents of COMPILE_OPTIONS may use "generator expressions" with
6177 the syntax "$<...>". Generator expressions are evaluated during
6178 build system generation to produce information specific to each
6179 build configuration. Valid expressions are:
6180
6181
6182 $<0:...> = empty string (ignores "...")
6183 $<1:...> = content of "..."
6184 $<CONFIG:cfg> = '1' if config is "cfg", else '0'
6185 $<CONFIGURATION> = configuration name
6186 $<BOOL:...> = '1' if the '...' is true, else '0'
6187 $<STREQUAL:a,b> = '1' if a is STREQUAL b, else '0'
6188 $<ANGLE-R> = A literal '>'. Used to compare strings which contain a '>' for example.
6189 $<COMMA> = A literal ','. Used to compare strings which contain a ',' for example.
6190 $<SEMICOLON> = A literal ';'. Used to prevent list expansion on an argument with ';'.
6191 $<JOIN:list,...> = joins the list with the content of "..."
6192 $<TARGET_NAME:...> = Marks ... as being the name of a target. This is required if exporting targets to multiple dependent export sets. The '...' must be a literal name of a target- it may not contain generator expressions.
6193 $<INSTALL_INTERFACE:...> = content of "..." when the property is exported using install(EXPORT), and empty otherwise.
6194 $<BUILD_INTERFACE:...> = content of "..." when the property is exported using export(), or when the target is used by another target in the same buildsystem. Expands to the empty string otherwise.
6195 $<C_COMPILER_ID> = The CMake-id of the C compiler used.
6196 $<C_COMPILER_ID:comp> = '1' if the CMake-id of the C compiler matches comp, otherwise '0'.
6197 $<CXX_COMPILER_ID> = The CMake-id of the CXX compiler used.
6198 $<CXX_COMPILER_ID:comp> = '1' if the CMake-id of the CXX compiler matches comp, otherwise '0'.
6199 $<VERSION_GREATER:v1,v2> = '1' if v1 is a version greater than v2, else '0'.
6200 $<VERSION_LESS:v1,v2> = '1' if v1 is a version less than v2, else '0'.
6201 $<VERSION_EQUAL:v1,v2> = '1' if v1 is the same version as v2, else '0'.
6202 $<C_COMPILER_VERSION> = The version of the C compiler used.
6203 $<C_COMPILER_VERSION:ver> = '1' if the version of the C compiler matches ver, otherwise '0'.
6204 $<CXX_COMPILER_VERSION> = The version of the CXX compiler used.
6205 $<CXX_COMPILER_VERSION:ver> = '1' if the version of the CXX compiler matches ver, otherwise '0'.
6206 $<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)
6207 $<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)
6208 $<TARGET_SONAME_FILE:tgt> = file with soname (.so.3)
6209
6210 where "tgt" is the name of a target. Target file expressions
6211 produce a full path, but _DIR and _NAME versions can produce the
6212 directory and file name components:
6213
6214
6215 $<TARGET_FILE_DIR:tgt>/$<TARGET_FILE_NAME:tgt>
6216 $<TARGET_LINKER_FILE_DIR:tgt>/$<TARGET_LINKER_FILE_NAME:tgt>
6217 $<TARGET_SONAME_FILE_DIR:tgt>/$<TARGET_SONAME_FILE_NAME:tgt>
6218
6219
6220
6221
6222 $<TARGET_PROPERTY:tgt,prop> = The value of the property prop on the target tgt.
6223
6224 Note that tgt is not added as a dependency of the target this
6225 expression is evaluated on.
6226
6227
6228 $<TARGET_POLICY:pol> = '1' if the policy was NEW when the 'head' target was created, else '0'. If the policy was not set, the warning message for the policy will be emitted. This generator expression only works for a subset of policies.
6229 $<INSTALL_PREFIX> = Content of the install prefix when the target is exported via INSTALL(EXPORT) and empty otherwise.
6230
6231 Boolean expressions:
6232
6233
6234 $<AND:?[,?]...> = '1' if all '?' are '1', else '0'
6235 $<OR:?[,?]...> = '0' if all '?' are '0', else '1'
6236 $<NOT:?> = '0' if '?' is '1', else '1'
6237
6238 where '?' is always either '0' or '1'.
6239
6240
6241 Expressions with an implicit 'this' target:
6242
6243
6244 $<TARGET_PROPERTY:prop> = The value of the property prop on the target on which the generator expression is evaluated.
6245
6246
6247 DEBUG_POSTFIX
6248 See target property <CONFIG>_POSTFIX.
6249
6250 This property is a special case of the more-general <CON‐
6251 FIG>_POSTFIX property for the DEBUG configuration.
6252
6253
6254 DEFINE_SYMBOL
6255 Define a symbol when compiling this target's sources.
6256
6257 DEFINE_SYMBOL sets the name of the preprocessor symbol defined
6258 when compiling sources in a shared library. If not set here then
6259 it is set to target_EXPORTS by default (with some substitutions
6260 if the target is not a valid C identifier). This is useful for
6261 headers to know whether they are being included from inside
6262 their library or outside to properly setup dllexport/dllimport
6263 decorations.
6264
6265
6266 ENABLE_EXPORTS
6267 Specify whether an executable exports symbols for loadable mod‐
6268 ules.
6269
6270 Normally an executable does not export any symbols because it is
6271 the final program. It is possible for an executable to export
6272 symbols to be used by loadable modules. When this property is
6273 set to true CMake will allow other targets to "link" to the exe‐
6274 cutable with the TARGET_LINK_LIBRARIES command. On all plat‐
6275 forms a target-level dependency on the executable is created for
6276 targets that link to it. For DLL platforms an import library
6277 will be created for the exported symbols and then used for link‐
6278 ing. All Windows-based systems including Cygwin are DLL plat‐
6279 forms. For non-DLL platforms that require all symbols to be
6280 resolved at link time, such as Mac OS X, the module will "link"
6281 to the executable using a flag like "-bundle_loader". For other
6282 non-DLL platforms the link rule is simply ignored since the
6283 dynamic loader will automatically bind symbols when the module
6284 is loaded.
6285
6286
6287 EXCLUDE_FROM_ALL
6288 Exclude the target from the all target.
6289
6290 A property on a target that indicates if the target is excluded
6291 from the default build target. If it is not, then with a Make‐
6292 file for example typing make will cause this target to be built.
6293 The same concept applies to the default build of other genera‐
6294 tors. Installing a target with EXCLUDE_FROM_ALL set to true has
6295 undefined behavior.
6296
6297
6298 EXCLUDE_FROM_DEFAULT_BUILD
6299 Exclude target from "Build Solution".
6300
6301 This property is only used by Visual Studio generators 7 and
6302 above. When set to TRUE, the target will not be built when you
6303 press "Build Solution".
6304
6305
6306 EXCLUDE_FROM_DEFAULT_BUILD_<CONFIG>
6307 Per-configuration version of target exclusion from "Build Solu‐
6308 tion".
6309
6310 This is the configuration-specific version of
6311 EXCLUDE_FROM_DEFAULT_BUILD. If the generic
6312 EXCLUDE_FROM_DEFAULT_BUILD is also set on a target,
6313 EXCLUDE_FROM_DEFAULT_BUILD_<CONFIG> takes precedence in configu‐
6314 rations for which it has a value.
6315
6316
6317 EXPORT_NAME
6318 Exported name for target files.
6319
6320 This sets the name for the IMPORTED target generated when it
6321 this target is is exported. If not set, the logical target name
6322 is used by default.
6323
6324
6325 EchoString
6326 A message to be displayed when the target is built.
6327
6328 A message to display on some generators (such as makefiles) when
6329 the target is built.
6330
6331
6332 FOLDER Set the folder name. Use to organize targets in an IDE.
6333
6334 Targets with no FOLDER property will appear as top level enti‐
6335 ties in IDEs like Visual Studio. Targets with the same FOLDER
6336 property value will appear next to each other in a folder of
6337 that name. To nest folders, use FOLDER values such as
6338 'GUI/Dialogs' with '/' characters separating folder levels.
6339
6340
6341 FRAMEWORK
6342 This target is a framework on the Mac.
6343
6344 If a shared library target has this property set to true it will
6345 be built as a framework when built on the mac. It will have the
6346 directory structure required for a framework and will be suit‐
6347 able to be used with the -framework option
6348
6349
6350 Fortran_FORMAT
6351 Set to FIXED or FREE to indicate the Fortran source layout.
6352
6353 This property tells CMake whether the Fortran source files in a
6354 target use fixed-format or free-format. CMake will pass the
6355 corresponding format flag to the compiler. Use the source-spe‐
6356 cific Fortran_FORMAT property to change the format of a specific
6357 source file. If the variable CMAKE_Fortran_FORMAT is set when a
6358 target is created its value is used to initialize this property.
6359
6360
6361 Fortran_MODULE_DIRECTORY
6362 Specify output directory for Fortran modules provided by the
6363 target.
6364
6365 If the target contains Fortran source files that provide modules
6366 and the compiler supports a module output directory this speci‐
6367 fies the directory in which the modules will be placed. When
6368 this property is not set the modules will be placed in the build
6369 directory corresponding to the target's source directory. If
6370 the variable CMAKE_Fortran_MODULE_DIRECTORY is set when a target
6371 is created its value is used to initialize this property.
6372
6373
6374 Note that some compilers will automatically search the module
6375 output directory for modules USEd during compilation but others
6376 will not. If your sources USE modules their location must be
6377 specified by INCLUDE_DIRECTORIES regardless of this property.
6378
6379
6380 GENERATOR_FILE_NAME
6381 Generator's file for this target.
6382
6383 An internal property used by some generators to record the name
6384 of the project or dsp file associated with this target. Note
6385 that at configure time, this property is only set for targets
6386 created by include_external_msproject().
6387
6388
6389 GNUtoMS
6390 Convert GNU import library (.dll.a) to MS format (.lib).
6391
6392 When linking a shared library or executable that exports symbols
6393 using GNU tools on Windows (MinGW/MSYS) with Visual Studio
6394 installed convert the import library (.dll.a) from GNU to MS
6395 format (.lib). Both import libraries will be installed by
6396 install(TARGETS) and exported by install(EXPORT) and export() to
6397 be linked by applications with either GNU- or MS-compatible
6398 tools.
6399
6400
6401 If the variable CMAKE_GNUtoMS is set when a target is created
6402 its value is used to initialize this property. The variable
6403 must be set prior to the first command that enables a language
6404 such as project() or enable_language(). CMake provides the
6405 variable as an option to the user automatically when configuring
6406 on Windows with GNU tools.
6407
6408
6409 HAS_CXX
6410 Link the target using the C++ linker tool (obsolete).
6411
6412 This is equivalent to setting the LINKER_LANGUAGE property to
6413 CXX. See that property's documentation for details.
6414
6415
6416 IMPLICIT_DEPENDS_INCLUDE_TRANSFORM
6417 Specify #include line transforms for dependencies in a target.
6418
6419 This property specifies rules to transform macro-like #include
6420 lines during implicit dependency scanning of C and C++ source
6421 files. The list of rules must be semicolon-separated with each
6422 entry of the form "A_MACRO(%)=value-with-%" (the % must be lit‐
6423 eral). During dependency scanning occurrences of A_MACRO(...)
6424 on #include lines will be replaced by the value given with the
6425 macro argument substituted for '%'. For example, the entry
6426
6427
6428 MYDIR(%)=<mydir/%>
6429
6430 will convert lines of the form
6431
6432
6433 #include MYDIR(myheader.h)
6434
6435 to
6436
6437
6438 #include <mydir/myheader.h>
6439
6440 allowing the dependency to be followed.
6441
6442
6443 This property applies to sources in the target on which it is
6444 set.
6445
6446
6447 IMPORTED
6448 Read-only indication of whether a target is IMPORTED.
6449
6450 The boolean value of this property is true for targets created
6451 with the IMPORTED option to add_executable or add_library. It
6452 is false for targets built within the project.
6453
6454
6455 IMPORTED_CONFIGURATIONS
6456 Configurations provided for an IMPORTED target.
6457
6458 Set this to the list of configuration names available for an
6459 IMPORTED target. The names correspond to configurations defined
6460 in the project from which the target is imported. If the
6461 importing project uses a different set of configurations the
6462 names may be mapped using the MAP_IMPORTED_CONFIG_<CONFIG> prop‐
6463 erty. Ignored for non-imported targets.
6464
6465
6466 IMPORTED_IMPLIB
6467 Full path to the import library for an IMPORTED target.
6468
6469 Set this to the location of the ".lib" part of a windows DLL.
6470 Ignored for non-imported targets.
6471
6472
6473 IMPORTED_IMPLIB_<CONFIG>
6474 <CONFIG>-specific version of IMPORTED_IMPLIB property.
6475
6476 Configuration names correspond to those provided by the project
6477 from which the target is imported.
6478
6479
6480 IMPORTED_LINK_DEPENDENT_LIBRARIES
6481 Dependent shared libraries of an imported shared library.
6482
6483 Shared libraries may be linked to other shared libraries as part
6484 of their implementation. On some platforms the linker searches
6485 for the dependent libraries of shared libraries they are includ‐
6486 ing in the link. Set this property to the list of dependent
6487 shared libraries of an imported library. The list should be
6488 disjoint from the list of interface libraries in the INTER‐
6489 FACE_LINK_LIBRARIES property. On platforms requiring dependent
6490 shared libraries to be found at link time CMake uses this list
6491 to add appropriate files or paths to the link command line.
6492 Ignored for non-imported targets.
6493
6494
6495 IMPORTED_LINK_DEPENDENT_LIBRARIES_<CONFIG>
6496 <CONFIG>-specific version of IMPORTED_LINK_DEPENDENT_LIBRARIES.
6497
6498 Configuration names correspond to those provided by the project
6499 from which the target is imported. If set, this property com‐
6500 pletely overrides the generic property for the named configura‐
6501 tion.
6502
6503
6504 IMPORTED_LINK_INTERFACE_LANGUAGES
6505 Languages compiled into an IMPORTED static library.
6506
6507 Set this to the list of languages of source files compiled to
6508 produce a STATIC IMPORTED library (such as "C" or "CXX"). CMake
6509 accounts for these languages when computing how to link a target
6510 to the imported library. For example, when a C executable links
6511 to an imported C++ static library CMake chooses the C++ linker
6512 to satisfy language runtime dependencies of the static library.
6513
6514
6515 This property is ignored for targets that are not STATIC
6516 libraries. This property is ignored for non-imported targets.
6517
6518
6519 IMPORTED_LINK_INTERFACE_LANGUAGES_<CONFIG>
6520 <CONFIG>-specific version of IMPORTED_LINK_INTERFACE_LANGUAGES.
6521
6522 Configuration names correspond to those provided by the project
6523 from which the target is imported. If set, this property com‐
6524 pletely overrides the generic property for the named configura‐
6525 tion.
6526
6527
6528 IMPORTED_LINK_INTERFACE_LIBRARIES
6529 Transitive link interface of an IMPORTED target.
6530
6531 Set this to the list of libraries whose interface is included
6532 when an IMPORTED library target is linked to another target.
6533 The libraries will be included on the link line for the target.
6534 Unlike the LINK_INTERFACE_LIBRARIES property, this property
6535 applies to all imported target types, including STATIC
6536 libraries. This property is ignored for non-imported targets.
6537
6538
6539 This property is ignored if the target also has a non-empty
6540 INTERFACE_LINK_LIBRARIES property.
6541
6542
6543 This property is deprecated. Use INTERFACE_LINK_LIBRARIES
6544 instead.
6545
6546
6547 IMPORTED_LINK_INTERFACE_LIBRARIES_<CONFIG>
6548 <CONFIG>-specific version of IMPORTED_LINK_INTERFACE_LIBRARIES.
6549
6550 Configuration names correspond to those provided by the project
6551 from which the target is imported. If set, this property com‐
6552 pletely overrides the generic property for the named configura‐
6553 tion.
6554
6555
6556 This property is ignored if the target also has a non-empty
6557 INTERFACE_LINK_LIBRARIES property.
6558
6559
6560 This property is deprecated. Use INTERFACE_LINK_LIBRARIES
6561 instead.
6562
6563
6564 IMPORTED_LINK_INTERFACE_MULTIPLICITY
6565 Repetition count for cycles of IMPORTED static libraries.
6566
6567 This is LINK_INTERFACE_MULTIPLICITY for IMPORTED targets.
6568
6569
6570 IMPORTED_LINK_INTERFACE_MULTIPLICITY_<CONFIG>
6571 <CONFIG>-specific version of IMPORTED_LINK_INTERFACE_MULTIPLIC‐
6572 ITY.
6573
6574 If set, this property completely overrides the generic property
6575 for the named configuration.
6576
6577
6578 IMPORTED_LOCATION
6579 Full path to the main file on disk for an IMPORTED target.
6580
6581 Set this to the location of an IMPORTED target file on disk.
6582 For executables this is the location of the executable file.
6583 For bundles on OS X this is the location of the executable file
6584 inside Contents/MacOS under the application bundle folder. For
6585 static libraries and modules this is the location of the library
6586 or module. For shared libraries on non-DLL platforms this is
6587 the location of the shared library. For frameworks on OS X this
6588 is the location of the library file symlink just inside the
6589 framework folder. For DLLs this is the location of the ".dll"
6590 part of the library. For UNKNOWN libraries this is the location
6591 of the file to be linked. Ignored for non-imported targets.
6592
6593
6594 Projects may skip IMPORTED_LOCATION if the configuration-spe‐
6595 cific property IMPORTED_LOCATION_<CONFIG> is set. To get the
6596 location of an imported target read one of the LOCATION or LOCA‐
6597 TION_<CONFIG> properties.
6598
6599
6600 IMPORTED_LOCATION_<CONFIG>
6601 <CONFIG>-specific version of IMPORTED_LOCATION property.
6602
6603 Configuration names correspond to those provided by the project
6604 from which the target is imported.
6605
6606
6607 IMPORTED_NO_SONAME
6608 Specifies that an IMPORTED shared library target has no "son‐
6609 ame".
6610
6611 Set this property to true for an imported shared library file
6612 that has no "soname" field. CMake may adjust generated link
6613 commands for some platforms to prevent the linker from using the
6614 path to the library in place of its missing soname. Ignored for
6615 non-imported targets.
6616
6617
6618 IMPORTED_NO_SONAME_<CONFIG>
6619 <CONFIG>-specific version of IMPORTED_NO_SONAME property.
6620
6621 Configuration names correspond to those provided by the project
6622 from which the target is imported.
6623
6624
6625 IMPORTED_SONAME
6626 The "soname" of an IMPORTED target of shared library type.
6627
6628 Set this to the "soname" embedded in an imported shared library.
6629 This is meaningful only on platforms supporting the feature.
6630 Ignored for non-imported targets.
6631
6632
6633 IMPORTED_SONAME_<CONFIG>
6634 <CONFIG>-specific version of IMPORTED_SONAME property.
6635
6636 Configuration names correspond to those provided by the project
6637 from which the target is imported.
6638
6639
6640 IMPORT_PREFIX
6641 What comes before the import library name.
6642
6643 Similar to the target property PREFIX, but used for import
6644 libraries (typically corresponding to a DLL) instead of regular
6645 libraries. A target property that can be set to override the
6646 prefix (such as "lib") on an import library name.
6647
6648
6649 IMPORT_SUFFIX
6650 What comes after the import library name.
6651
6652 Similar to the target property SUFFIX, but used for import
6653 libraries (typically corresponding to a DLL) instead of regular
6654 libraries. A target property that can be set to override the
6655 suffix (such as ".lib") on an import library name.
6656
6657
6658 INCLUDE_DIRECTORIES
6659 List of preprocessor include file search directories.
6660
6661 This property specifies the list of directories given so far to
6662 the include_directories command. This property exists on direc‐
6663 tories and targets. In addition to accepting values from the
6664 include_directories command, values may be set directly on any
6665 directory or any target using the set_property command. A target
6666 gets its initial value for this property from the value of the
6667 directory property. A directory gets its initial value from its
6668 parent directory if it has one. Both directory and target prop‐
6669 erty values are adjusted by calls to the include_directories
6670 command.
6671
6672
6673 The target property values are used by the generators to set the
6674 include paths for the compiler. See also the include_directo‐
6675 ries command.
6676
6677
6678 Contents of INCLUDE_DIRECTORIES may use "generator expressions"
6679 with the syntax "$<...>". Generator expressions are evaluated
6680 during build system generation to produce information specific
6681 to each build configuration. Valid expressions are:
6682
6683
6684 $<0:...> = empty string (ignores "...")
6685 $<1:...> = content of "..."
6686 $<CONFIG:cfg> = '1' if config is "cfg", else '0'
6687 $<CONFIGURATION> = configuration name
6688 $<BOOL:...> = '1' if the '...' is true, else '0'
6689 $<STREQUAL:a,b> = '1' if a is STREQUAL b, else '0'
6690 $<ANGLE-R> = A literal '>'. Used to compare strings which contain a '>' for example.
6691 $<COMMA> = A literal ','. Used to compare strings which contain a ',' for example.
6692 $<SEMICOLON> = A literal ';'. Used to prevent list expansion on an argument with ';'.
6693 $<JOIN:list,...> = joins the list with the content of "..."
6694 $<TARGET_NAME:...> = Marks ... as being the name of a target. This is required if exporting targets to multiple dependent export sets. The '...' must be a literal name of a target- it may not contain generator expressions.
6695 $<INSTALL_INTERFACE:...> = content of "..." when the property is exported using install(EXPORT), and empty otherwise.
6696 $<BUILD_INTERFACE:...> = content of "..." when the property is exported using export(), or when the target is used by another target in the same buildsystem. Expands to the empty string otherwise.
6697 $<C_COMPILER_ID> = The CMake-id of the C compiler used.
6698 $<C_COMPILER_ID:comp> = '1' if the CMake-id of the C compiler matches comp, otherwise '0'.
6699 $<CXX_COMPILER_ID> = The CMake-id of the CXX compiler used.
6700 $<CXX_COMPILER_ID:comp> = '1' if the CMake-id of the CXX compiler matches comp, otherwise '0'.
6701 $<VERSION_GREATER:v1,v2> = '1' if v1 is a version greater than v2, else '0'.
6702 $<VERSION_LESS:v1,v2> = '1' if v1 is a version less than v2, else '0'.
6703 $<VERSION_EQUAL:v1,v2> = '1' if v1 is the same version as v2, else '0'.
6704 $<C_COMPILER_VERSION> = The version of the C compiler used.
6705 $<C_COMPILER_VERSION:ver> = '1' if the version of the C compiler matches ver, otherwise '0'.
6706 $<CXX_COMPILER_VERSION> = The version of the CXX compiler used.
6707 $<CXX_COMPILER_VERSION:ver> = '1' if the version of the CXX compiler matches ver, otherwise '0'.
6708 $<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)
6709 $<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)
6710 $<TARGET_SONAME_FILE:tgt> = file with soname (.so.3)
6711
6712 where "tgt" is the name of a target. Target file expressions
6713 produce a full path, but _DIR and _NAME versions can produce the
6714 directory and file name components:
6715
6716
6717 $<TARGET_FILE_DIR:tgt>/$<TARGET_FILE_NAME:tgt>
6718 $<TARGET_LINKER_FILE_DIR:tgt>/$<TARGET_LINKER_FILE_NAME:tgt>
6719 $<TARGET_SONAME_FILE_DIR:tgt>/$<TARGET_SONAME_FILE_NAME:tgt>
6720
6721
6722
6723
6724 $<TARGET_PROPERTY:tgt,prop> = The value of the property prop on the target tgt.
6725
6726 Note that tgt is not added as a dependency of the target this
6727 expression is evaluated on.
6728
6729
6730 $<TARGET_POLICY:pol> = '1' if the policy was NEW when the 'head' target was created, else '0'. If the policy was not set, the warning message for the policy will be emitted. This generator expression only works for a subset of policies.
6731 $<INSTALL_PREFIX> = Content of the install prefix when the target is exported via INSTALL(EXPORT) and empty otherwise.
6732
6733 Boolean expressions:
6734
6735
6736 $<AND:?[,?]...> = '1' if all '?' are '1', else '0'
6737 $<OR:?[,?]...> = '0' if all '?' are '0', else '1'
6738 $<NOT:?> = '0' if '?' is '1', else '1'
6739
6740 where '?' is always either '0' or '1'.
6741
6742
6743 Expressions with an implicit 'this' target:
6744
6745
6746 $<TARGET_PROPERTY:prop> = The value of the property prop on the target on which the generator expression is evaluated.
6747
6748
6749 INSTALL_NAME_DIR
6750 Mac OSX directory name for installed targets.
6751
6752 INSTALL_NAME_DIR is a string specifying the directory portion of
6753 the "install_name" field of shared libraries on Mac OSX to use
6754 in the installed targets.
6755
6756
6757 INSTALL_RPATH
6758 The rpath to use for installed targets.
6759
6760 A semicolon-separated list specifying the rpath to use in
6761 installed targets (for platforms that support it). This prop‐
6762 erty is initialized by the value of the variable
6763 CMAKE_INSTALL_RPATH if it is set when a target is created.
6764
6765
6766 INSTALL_RPATH_USE_LINK_PATH
6767 Add paths to linker search and installed rpath.
6768
6769 INSTALL_RPATH_USE_LINK_PATH is a boolean that if set to true
6770 will append directories in the linker search path and outside
6771 the project to the INSTALL_RPATH. This property is initialized
6772 by the value of the variable CMAKE_INSTALL_RPATH_USE_LINK_PATH
6773 if it is set when a target is created.
6774
6775
6776 INTERFACE_COMPILE_DEFINITIONS
6777 List of public compile definitions for a library.
6778
6779 Targets may populate this property to publish the compile defi‐
6780 nitions required to compile against the headers for the target.
6781 Consuming targets can add entries to their own COMPILE_DEFINI‐
6782 TIONS property such as $<TARGET_PROPERTY:foo,INTERFACE_COM‐
6783 PILE_DEFINITIONS> to use the compile definitions specified in
6784 the interface of 'foo'.
6785
6786
6787 Generator expressions are evaluated during build system genera‐
6788 tion to produce information specific to each build configura‐
6789 tion. Valid expressions are:
6790
6791
6792 $<0:...> = empty string (ignores "...")
6793 $<1:...> = content of "..."
6794 $<CONFIG:cfg> = '1' if config is "cfg", else '0'
6795 $<CONFIGURATION> = configuration name
6796 $<BOOL:...> = '1' if the '...' is true, else '0'
6797 $<STREQUAL:a,b> = '1' if a is STREQUAL b, else '0'
6798 $<ANGLE-R> = A literal '>'. Used to compare strings which contain a '>' for example.
6799 $<COMMA> = A literal ','. Used to compare strings which contain a ',' for example.
6800 $<SEMICOLON> = A literal ';'. Used to prevent list expansion on an argument with ';'.
6801 $<JOIN:list,...> = joins the list with the content of "..."
6802 $<TARGET_NAME:...> = Marks ... as being the name of a target. This is required if exporting targets to multiple dependent export sets. The '...' must be a literal name of a target- it may not contain generator expressions.
6803 $<INSTALL_INTERFACE:...> = content of "..." when the property is exported using install(EXPORT), and empty otherwise.
6804 $<BUILD_INTERFACE:...> = content of "..." when the property is exported using export(), or when the target is used by another target in the same buildsystem. Expands to the empty string otherwise.
6805 $<C_COMPILER_ID> = The CMake-id of the C compiler used.
6806 $<C_COMPILER_ID:comp> = '1' if the CMake-id of the C compiler matches comp, otherwise '0'.
6807 $<CXX_COMPILER_ID> = The CMake-id of the CXX compiler used.
6808 $<CXX_COMPILER_ID:comp> = '1' if the CMake-id of the CXX compiler matches comp, otherwise '0'.
6809 $<VERSION_GREATER:v1,v2> = '1' if v1 is a version greater than v2, else '0'.
6810 $<VERSION_LESS:v1,v2> = '1' if v1 is a version less than v2, else '0'.
6811 $<VERSION_EQUAL:v1,v2> = '1' if v1 is the same version as v2, else '0'.
6812 $<C_COMPILER_VERSION> = The version of the C compiler used.
6813 $<C_COMPILER_VERSION:ver> = '1' if the version of the C compiler matches ver, otherwise '0'.
6814 $<CXX_COMPILER_VERSION> = The version of the CXX compiler used.
6815 $<CXX_COMPILER_VERSION:ver> = '1' if the version of the CXX compiler matches ver, otherwise '0'.
6816 $<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)
6817 $<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)
6818 $<TARGET_SONAME_FILE:tgt> = file with soname (.so.3)
6819
6820 where "tgt" is the name of a target. Target file expressions
6821 produce a full path, but _DIR and _NAME versions can produce the
6822 directory and file name components:
6823
6824
6825 $<TARGET_FILE_DIR:tgt>/$<TARGET_FILE_NAME:tgt>
6826 $<TARGET_LINKER_FILE_DIR:tgt>/$<TARGET_LINKER_FILE_NAME:tgt>
6827 $<TARGET_SONAME_FILE_DIR:tgt>/$<TARGET_SONAME_FILE_NAME:tgt>
6828
6829
6830
6831
6832 $<TARGET_PROPERTY:tgt,prop> = The value of the property prop on the target tgt.
6833
6834 Note that tgt is not added as a dependency of the target this
6835 expression is evaluated on.
6836
6837
6838 $<TARGET_POLICY:pol> = '1' if the policy was NEW when the 'head' target was created, else '0'. If the policy was not set, the warning message for the policy will be emitted. This generator expression only works for a subset of policies.
6839 $<INSTALL_PREFIX> = Content of the install prefix when the target is exported via INSTALL(EXPORT) and empty otherwise.
6840
6841 Boolean expressions:
6842
6843
6844 $<AND:?[,?]...> = '1' if all '?' are '1', else '0'
6845 $<OR:?[,?]...> = '0' if all '?' are '0', else '1'
6846 $<NOT:?> = '0' if '?' is '1', else '1'
6847
6848 where '?' is always either '0' or '1'.
6849
6850
6851 Expressions with an implicit 'this' target:
6852
6853
6854 $<TARGET_PROPERTY:prop> = The value of the property prop on the target on which the generator expression is evaluated.
6855
6856
6857 INTERFACE_COMPILE_OPTIONS
6858 List of interface options to pass to the compiler.
6859
6860 Targets may populate this property to publish the compile
6861 options required to compile against the headers for the target.
6862 Consuming targets can add entries to their own COMPILE_OPTIONS
6863 property such as $<TARGET_PROPERTY:foo,INTERFACE_COM‐
6864 PILE_OPTIONS> to use the compile options specified in the inter‐
6865 face of 'foo'.
6866
6867
6868 Generator expressions are evaluated during build system genera‐
6869 tion to produce information specific to each build configura‐
6870 tion. Valid expressions are:
6871
6872
6873 $<0:...> = empty string (ignores "...")
6874 $<1:...> = content of "..."
6875 $<CONFIG:cfg> = '1' if config is "cfg", else '0'
6876 $<CONFIGURATION> = configuration name
6877 $<BOOL:...> = '1' if the '...' is true, else '0'
6878 $<STREQUAL:a,b> = '1' if a is STREQUAL b, else '0'
6879 $<ANGLE-R> = A literal '>'. Used to compare strings which contain a '>' for example.
6880 $<COMMA> = A literal ','. Used to compare strings which contain a ',' for example.
6881 $<SEMICOLON> = A literal ';'. Used to prevent list expansion on an argument with ';'.
6882 $<JOIN:list,...> = joins the list with the content of "..."
6883 $<TARGET_NAME:...> = Marks ... as being the name of a target. This is required if exporting targets to multiple dependent export sets. The '...' must be a literal name of a target- it may not contain generator expressions.
6884 $<INSTALL_INTERFACE:...> = content of "..." when the property is exported using install(EXPORT), and empty otherwise.
6885 $<BUILD_INTERFACE:...> = content of "..." when the property is exported using export(), or when the target is used by another target in the same buildsystem. Expands to the empty string otherwise.
6886 $<C_COMPILER_ID> = The CMake-id of the C compiler used.
6887 $<C_COMPILER_ID:comp> = '1' if the CMake-id of the C compiler matches comp, otherwise '0'.
6888 $<CXX_COMPILER_ID> = The CMake-id of the CXX compiler used.
6889 $<CXX_COMPILER_ID:comp> = '1' if the CMake-id of the CXX compiler matches comp, otherwise '0'.
6890 $<VERSION_GREATER:v1,v2> = '1' if v1 is a version greater than v2, else '0'.
6891 $<VERSION_LESS:v1,v2> = '1' if v1 is a version less than v2, else '0'.
6892 $<VERSION_EQUAL:v1,v2> = '1' if v1 is the same version as v2, else '0'.
6893 $<C_COMPILER_VERSION> = The version of the C compiler used.
6894 $<C_COMPILER_VERSION:ver> = '1' if the version of the C compiler matches ver, otherwise '0'.
6895 $<CXX_COMPILER_VERSION> = The version of the CXX compiler used.
6896 $<CXX_COMPILER_VERSION:ver> = '1' if the version of the CXX compiler matches ver, otherwise '0'.
6897 $<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)
6898 $<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)
6899 $<TARGET_SONAME_FILE:tgt> = file with soname (.so.3)
6900
6901 where "tgt" is the name of a target. Target file expressions
6902 produce a full path, but _DIR and _NAME versions can produce the
6903 directory and file name components:
6904
6905
6906 $<TARGET_FILE_DIR:tgt>/$<TARGET_FILE_NAME:tgt>
6907 $<TARGET_LINKER_FILE_DIR:tgt>/$<TARGET_LINKER_FILE_NAME:tgt>
6908 $<TARGET_SONAME_FILE_DIR:tgt>/$<TARGET_SONAME_FILE_NAME:tgt>
6909
6910
6911
6912
6913 $<TARGET_PROPERTY:tgt,prop> = The value of the property prop on the target tgt.
6914
6915 Note that tgt is not added as a dependency of the target this
6916 expression is evaluated on.
6917
6918
6919 $<TARGET_POLICY:pol> = '1' if the policy was NEW when the 'head' target was created, else '0'. If the policy was not set, the warning message for the policy will be emitted. This generator expression only works for a subset of policies.
6920 $<INSTALL_PREFIX> = Content of the install prefix when the target is exported via INSTALL(EXPORT) and empty otherwise.
6921
6922 Boolean expressions:
6923
6924
6925 $<AND:?[,?]...> = '1' if all '?' are '1', else '0'
6926 $<OR:?[,?]...> = '0' if all '?' are '0', else '1'
6927 $<NOT:?> = '0' if '?' is '1', else '1'
6928
6929 where '?' is always either '0' or '1'.
6930
6931
6932 Expressions with an implicit 'this' target:
6933
6934
6935 $<TARGET_PROPERTY:prop> = The value of the property prop on the target on which the generator expression is evaluated.
6936
6937
6938 INTERFACE_INCLUDE_DIRECTORIES
6939 List of public include directories for a library.
6940
6941 Targets may populate this property to publish the include direc‐
6942 tories required to compile against the headers for the target.
6943 Consuming targets can add entries to their own INCLUDE_DIRECTO‐
6944 RIES property such as $<TARGET_PROPERTY:foo,INTER‐
6945 FACE_INCLUDE_DIRECTORIES> to use the include directories speci‐
6946 fied in the interface of 'foo'.
6947
6948
6949 Generator expressions are evaluated during build system genera‐
6950 tion to produce information specific to each build configura‐
6951 tion. Valid expressions are:
6952
6953
6954 $<0:...> = empty string (ignores "...")
6955 $<1:...> = content of "..."
6956 $<CONFIG:cfg> = '1' if config is "cfg", else '0'
6957 $<CONFIGURATION> = configuration name
6958 $<BOOL:...> = '1' if the '...' is true, else '0'
6959 $<STREQUAL:a,b> = '1' if a is STREQUAL b, else '0'
6960 $<ANGLE-R> = A literal '>'. Used to compare strings which contain a '>' for example.
6961 $<COMMA> = A literal ','. Used to compare strings which contain a ',' for example.
6962 $<SEMICOLON> = A literal ';'. Used to prevent list expansion on an argument with ';'.
6963 $<JOIN:list,...> = joins the list with the content of "..."
6964 $<TARGET_NAME:...> = Marks ... as being the name of a target. This is required if exporting targets to multiple dependent export sets. The '...' must be a literal name of a target- it may not contain generator expressions.
6965 $<INSTALL_INTERFACE:...> = content of "..." when the property is exported using install(EXPORT), and empty otherwise.
6966 $<BUILD_INTERFACE:...> = content of "..." when the property is exported using export(), or when the target is used by another target in the same buildsystem. Expands to the empty string otherwise.
6967 $<C_COMPILER_ID> = The CMake-id of the C compiler used.
6968 $<C_COMPILER_ID:comp> = '1' if the CMake-id of the C compiler matches comp, otherwise '0'.
6969 $<CXX_COMPILER_ID> = The CMake-id of the CXX compiler used.
6970 $<CXX_COMPILER_ID:comp> = '1' if the CMake-id of the CXX compiler matches comp, otherwise '0'.
6971 $<VERSION_GREATER:v1,v2> = '1' if v1 is a version greater than v2, else '0'.
6972 $<VERSION_LESS:v1,v2> = '1' if v1 is a version less than v2, else '0'.
6973 $<VERSION_EQUAL:v1,v2> = '1' if v1 is the same version as v2, else '0'.
6974 $<C_COMPILER_VERSION> = The version of the C compiler used.
6975 $<C_COMPILER_VERSION:ver> = '1' if the version of the C compiler matches ver, otherwise '0'.
6976 $<CXX_COMPILER_VERSION> = The version of the CXX compiler used.
6977 $<CXX_COMPILER_VERSION:ver> = '1' if the version of the CXX compiler matches ver, otherwise '0'.
6978 $<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)
6979 $<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)
6980 $<TARGET_SONAME_FILE:tgt> = file with soname (.so.3)
6981
6982 where "tgt" is the name of a target. Target file expressions
6983 produce a full path, but _DIR and _NAME versions can produce the
6984 directory and file name components:
6985
6986
6987 $<TARGET_FILE_DIR:tgt>/$<TARGET_FILE_NAME:tgt>
6988 $<TARGET_LINKER_FILE_DIR:tgt>/$<TARGET_LINKER_FILE_NAME:tgt>
6989 $<TARGET_SONAME_FILE_DIR:tgt>/$<TARGET_SONAME_FILE_NAME:tgt>
6990
6991
6992
6993
6994 $<TARGET_PROPERTY:tgt,prop> = The value of the property prop on the target tgt.
6995
6996 Note that tgt is not added as a dependency of the target this
6997 expression is evaluated on.
6998
6999
7000 $<TARGET_POLICY:pol> = '1' if the policy was NEW when the 'head' target was created, else '0'. If the policy was not set, the warning message for the policy will be emitted. This generator expression only works for a subset of policies.
7001 $<INSTALL_PREFIX> = Content of the install prefix when the target is exported via INSTALL(EXPORT) and empty otherwise.
7002
7003 Boolean expressions:
7004
7005
7006 $<AND:?[,?]...> = '1' if all '?' are '1', else '0'
7007 $<OR:?[,?]...> = '0' if all '?' are '0', else '1'
7008 $<NOT:?> = '0' if '?' is '1', else '1'
7009
7010 where '?' is always either '0' or '1'.
7011
7012
7013 Expressions with an implicit 'this' target:
7014
7015
7016 $<TARGET_PROPERTY:prop> = The value of the property prop on the target on which the generator expression is evaluated.
7017
7018
7019 INTERFACE_LINK_LIBRARIES
7020 List public interface libraries for a library.
7021
7022 This property contains the list of transitive link dependencies.
7023 When the target is linked into another target the libraries
7024 listed (and recursively their link interface libraries) will be
7025 provided to the other target also. This property is overridden
7026 by the LINK_INTERFACE_LIBRARIES or LINK_INTER‐
7027 FACE_LIBRARIES_<CONFIG> property if policy CMP0022 is OLD or
7028 unset.
7029
7030
7031
7032
7033
7034 Generator expressions are evaluated during build system genera‐
7035 tion to produce information specific to each build configura‐
7036 tion. Valid expressions are:
7037
7038
7039 $<0:...> = empty string (ignores "...")
7040 $<1:...> = content of "..."
7041 $<CONFIG:cfg> = '1' if config is "cfg", else '0'
7042 $<CONFIGURATION> = configuration name
7043 $<BOOL:...> = '1' if the '...' is true, else '0'
7044 $<STREQUAL:a,b> = '1' if a is STREQUAL b, else '0'
7045 $<ANGLE-R> = A literal '>'. Used to compare strings which contain a '>' for example.
7046 $<COMMA> = A literal ','. Used to compare strings which contain a ',' for example.
7047 $<SEMICOLON> = A literal ';'. Used to prevent list expansion on an argument with ';'.
7048 $<JOIN:list,...> = joins the list with the content of "..."
7049 $<TARGET_NAME:...> = Marks ... as being the name of a target. This is required if exporting targets to multiple dependent export sets. The '...' must be a literal name of a target- it may not contain generator expressions.
7050 $<INSTALL_INTERFACE:...> = content of "..." when the property is exported using install(EXPORT), and empty otherwise.
7051 $<BUILD_INTERFACE:...> = content of "..." when the property is exported using export(), or when the target is used by another target in the same buildsystem. Expands to the empty string otherwise.
7052 $<C_COMPILER_ID> = The CMake-id of the C compiler used.
7053 $<C_COMPILER_ID:comp> = '1' if the CMake-id of the C compiler matches comp, otherwise '0'.
7054 $<CXX_COMPILER_ID> = The CMake-id of the CXX compiler used.
7055 $<CXX_COMPILER_ID:comp> = '1' if the CMake-id of the CXX compiler matches comp, otherwise '0'.
7056 $<VERSION_GREATER:v1,v2> = '1' if v1 is a version greater than v2, else '0'.
7057 $<VERSION_LESS:v1,v2> = '1' if v1 is a version less than v2, else '0'.
7058 $<VERSION_EQUAL:v1,v2> = '1' if v1 is the same version as v2, else '0'.
7059 $<C_COMPILER_VERSION> = The version of the C compiler used.
7060 $<C_COMPILER_VERSION:ver> = '1' if the version of the C compiler matches ver, otherwise '0'.
7061 $<CXX_COMPILER_VERSION> = The version of the CXX compiler used.
7062 $<CXX_COMPILER_VERSION:ver> = '1' if the version of the CXX compiler matches ver, otherwise '0'.
7063 $<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)
7064 $<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)
7065 $<TARGET_SONAME_FILE:tgt> = file with soname (.so.3)
7066
7067 where "tgt" is the name of a target. Target file expressions
7068 produce a full path, but _DIR and _NAME versions can produce the
7069 directory and file name components:
7070
7071
7072 $<TARGET_FILE_DIR:tgt>/$<TARGET_FILE_NAME:tgt>
7073 $<TARGET_LINKER_FILE_DIR:tgt>/$<TARGET_LINKER_FILE_NAME:tgt>
7074 $<TARGET_SONAME_FILE_DIR:tgt>/$<TARGET_SONAME_FILE_NAME:tgt>
7075
7076
7077
7078
7079 $<TARGET_PROPERTY:tgt,prop> = The value of the property prop on the target tgt.
7080
7081 Note that tgt is not added as a dependency of the target this
7082 expression is evaluated on.
7083
7084
7085 $<TARGET_POLICY:pol> = '1' if the policy was NEW when the 'head' target was created, else '0'. If the policy was not set, the warning message for the policy will be emitted. This generator expression only works for a subset of policies.
7086 $<INSTALL_PREFIX> = Content of the install prefix when the target is exported via INSTALL(EXPORT) and empty otherwise.
7087
7088 Boolean expressions:
7089
7090
7091 $<AND:?[,?]...> = '1' if all '?' are '1', else '0'
7092 $<OR:?[,?]...> = '0' if all '?' are '0', else '1'
7093 $<NOT:?> = '0' if '?' is '1', else '1'
7094
7095 where '?' is always either '0' or '1'.
7096
7097
7098 Expressions with an implicit 'this' target:
7099
7100
7101 $<TARGET_PROPERTY:prop> = The value of the property prop on the target on which the generator expression is evaluated.
7102
7103
7104 INTERFACE_POSITION_INDEPENDENT_CODE
7105 Whether consumers need to create a position-independent target
7106
7107 The INTERFACE_POSITION_INDEPENDENT_CODE property informs con‐
7108 sumers of this target whether they must set their POSITION_INDE‐
7109 PENDENT_CODE property to ON. If this property is set to ON,
7110 then the POSITION_INDEPENDENT_CODE property on all consumers
7111 will be set to ON. Similarly, if this property is set to OFF,
7112 then the POSITION_INDEPENDENT_CODE property on all consumers
7113 will be set to OFF. If this property is undefined, then con‐
7114 sumers will determine their POSITION_INDEPENDENT_CODE property
7115 by other means. Consumers must ensure that the targets that
7116 they link to have a consistent requirement for their INTER‐
7117 FACE_POSITION_INDEPENDENT_CODE property.
7118
7119
7120 INTERFACE_SYSTEM_INCLUDE_DIRECTORIES
7121 List of public system include directories for a library.
7122
7123 Targets may populate this property to publish the include direc‐
7124 tories which contain system headers, and therefore should not
7125 result in compiler warnings. Consuming targets will then mark
7126 the same include directories as system headers.
7127
7128
7129 Generator expressions are evaluated during build system genera‐
7130 tion to produce information specific to each build configura‐
7131 tion. Valid expressions are:
7132
7133
7134 $<0:...> = empty string (ignores "...")
7135 $<1:...> = content of "..."
7136 $<CONFIG:cfg> = '1' if config is "cfg", else '0'
7137 $<CONFIGURATION> = configuration name
7138 $<BOOL:...> = '1' if the '...' is true, else '0'
7139 $<STREQUAL:a,b> = '1' if a is STREQUAL b, else '0'
7140 $<ANGLE-R> = A literal '>'. Used to compare strings which contain a '>' for example.
7141 $<COMMA> = A literal ','. Used to compare strings which contain a ',' for example.
7142 $<SEMICOLON> = A literal ';'. Used to prevent list expansion on an argument with ';'.
7143 $<JOIN:list,...> = joins the list with the content of "..."
7144 $<TARGET_NAME:...> = Marks ... as being the name of a target. This is required if exporting targets to multiple dependent export sets. The '...' must be a literal name of a target- it may not contain generator expressions.
7145 $<INSTALL_INTERFACE:...> = content of "..." when the property is exported using install(EXPORT), and empty otherwise.
7146 $<BUILD_INTERFACE:...> = content of "..." when the property is exported using export(), or when the target is used by another target in the same buildsystem. Expands to the empty string otherwise.
7147 $<C_COMPILER_ID> = The CMake-id of the C compiler used.
7148 $<C_COMPILER_ID:comp> = '1' if the CMake-id of the C compiler matches comp, otherwise '0'.
7149 $<CXX_COMPILER_ID> = The CMake-id of the CXX compiler used.
7150 $<CXX_COMPILER_ID:comp> = '1' if the CMake-id of the CXX compiler matches comp, otherwise '0'.
7151 $<VERSION_GREATER:v1,v2> = '1' if v1 is a version greater than v2, else '0'.
7152 $<VERSION_LESS:v1,v2> = '1' if v1 is a version less than v2, else '0'.
7153 $<VERSION_EQUAL:v1,v2> = '1' if v1 is the same version as v2, else '0'.
7154 $<C_COMPILER_VERSION> = The version of the C compiler used.
7155 $<C_COMPILER_VERSION:ver> = '1' if the version of the C compiler matches ver, otherwise '0'.
7156 $<CXX_COMPILER_VERSION> = The version of the CXX compiler used.
7157 $<CXX_COMPILER_VERSION:ver> = '1' if the version of the CXX compiler matches ver, otherwise '0'.
7158 $<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)
7159 $<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)
7160 $<TARGET_SONAME_FILE:tgt> = file with soname (.so.3)
7161
7162 where "tgt" is the name of a target. Target file expressions
7163 produce a full path, but _DIR and _NAME versions can produce the
7164 directory and file name components:
7165
7166
7167 $<TARGET_FILE_DIR:tgt>/$<TARGET_FILE_NAME:tgt>
7168 $<TARGET_LINKER_FILE_DIR:tgt>/$<TARGET_LINKER_FILE_NAME:tgt>
7169 $<TARGET_SONAME_FILE_DIR:tgt>/$<TARGET_SONAME_FILE_NAME:tgt>
7170
7171
7172
7173
7174 $<TARGET_PROPERTY:tgt,prop> = The value of the property prop on the target tgt.
7175
7176 Note that tgt is not added as a dependency of the target this
7177 expression is evaluated on.
7178
7179
7180 $<TARGET_POLICY:pol> = '1' if the policy was NEW when the 'head' target was created, else '0'. If the policy was not set, the warning message for the policy will be emitted. This generator expression only works for a subset of policies.
7181 $<INSTALL_PREFIX> = Content of the install prefix when the target is exported via INSTALL(EXPORT) and empty otherwise.
7182
7183 Boolean expressions:
7184
7185
7186 $<AND:?[,?]...> = '1' if all '?' are '1', else '0'
7187 $<OR:?[,?]...> = '0' if all '?' are '0', else '1'
7188 $<NOT:?> = '0' if '?' is '1', else '1'
7189
7190 where '?' is always either '0' or '1'.
7191
7192
7193 Expressions with an implicit 'this' target:
7194
7195
7196 $<TARGET_PROPERTY:prop> = The value of the property prop on the target on which the generator expression is evaluated.
7197
7198
7199 INTERPROCEDURAL_OPTIMIZATION
7200 Enable interprocedural optimization for a target.
7201
7202 If set to true, enables interprocedural optimizations if they
7203 are known to be supported by the compiler.
7204
7205
7206 INTERPROCEDURAL_OPTIMIZATION_<CONFIG>
7207 Per-configuration interprocedural optimization for a target.
7208
7209 This is a per-configuration version of INTERPROCEDURAL_OPTIMIZA‐
7210 TION. If set, this property overrides the generic property for
7211 the named configuration.
7212
7213
7214 LABELS Specify a list of text labels associated with a target.
7215
7216 Target label semantics are currently unspecified.
7217
7218
7219 LIBRARY_OUTPUT_DIRECTORY
7220 Output directory in which to build LIBRARY target files.
7221
7222 This property specifies the directory into which library target
7223 files should be built. Multi-configuration generators (VS,
7224 Xcode) append a per-configuration subdirectory to the specified
7225 directory. There are three kinds of target files that may be
7226 built: archive, library, and runtime. Executables are always
7227 treated as runtime targets. Static libraries are always treated
7228 as archive targets. Module libraries are always treated as
7229 library targets. For non-DLL platforms shared libraries are
7230 treated as library targets. For DLL platforms the DLL part of a
7231 shared library is treated as a runtime target and the corre‐
7232 sponding import library is treated as an archive target. All
7233 Windows-based systems including Cygwin are DLL platforms. This
7234 property is initialized by the value of the variable
7235 CMAKE_LIBRARY_OUTPUT_DIRECTORY if it is set when a target is
7236 created.
7237
7238
7239 LIBRARY_OUTPUT_DIRECTORY_<CONFIG>
7240 Per-configuration output directory for LIBRARY target files.
7241
7242 This is a per-configuration version of LIBRARY_OUTPUT_DIRECTORY,
7243 but multi-configuration generators (VS, Xcode) do NOT append a
7244 per-configuration subdirectory to the specified directory. This
7245 property is initialized by the value of the variable
7246 CMAKE_LIBRARY_OUTPUT_DIRECTORY_<CONFIG> if it is set when a tar‐
7247 get is created.
7248
7249
7250 LIBRARY_OUTPUT_NAME
7251 Output name for LIBRARY target files.
7252
7253 This property specifies the base name for library target files.
7254 It overrides OUTPUT_NAME and OUTPUT_NAME_<CONFIG> properties.
7255 There are three kinds of target files that may be built: ar‐
7256 chive, library, and runtime. Executables are always treated as
7257 runtime targets. Static libraries are always treated as archive
7258 targets. Module libraries are always treated as library targets.
7259 For non-DLL platforms shared libraries are treated as library
7260 targets. For DLL platforms the DLL part of a shared library is
7261 treated as a runtime target and the corresponding import library
7262 is treated as an archive target. All Windows-based systems
7263 including Cygwin are DLL platforms.
7264
7265
7266 LIBRARY_OUTPUT_NAME_<CONFIG>
7267 Per-configuration output name for LIBRARY target files.
7268
7269 This is the configuration-specific version of LIBRARY_OUT‐
7270 PUT_NAME.
7271
7272
7273 LINKER_LANGUAGE
7274 Specifies language whose compiler will invoke the linker.
7275
7276 For executables, shared libraries, and modules, this sets the
7277 language whose compiler is used to link the target (such as "C"
7278 or "CXX"). A typical value for an executable is the language of
7279 the source file providing the program entry point (main). If
7280 not set, the language with the highest linker preference value
7281 is the default. See documentation of CMAKE_<LANG>_LINKER_PREF‐
7282 ERENCE variables.
7283
7284
7285 If this property is not set by the user, it will be calculated
7286 at generate-time by CMake.
7287
7288
7289 LINK_DEPENDS
7290 Additional files on which a target binary depends for linking.
7291
7292 Specifies a semicolon-separated list of full-paths to files on
7293 which the link rule for this target depends. The target binary
7294 will be linked if any of the named files is newer than it.
7295
7296
7297 This property is ignored by non-Makefile generators. It is
7298 intended to specify dependencies on "linker scripts" for custom
7299 Makefile link rules.
7300
7301
7302 LINK_DEPENDS_NO_SHARED
7303 Do not depend on linked shared library files.
7304
7305 Set this property to true to tell CMake generators not to add
7306 file-level dependencies on the shared library files linked by
7307 this target. Modification to the shared libraries will not be
7308 sufficient to re-link this target. Logical target-level depen‐
7309 dencies will not be affected so the linked shared libraries will
7310 still be brought up to date before this target is built.
7311
7312
7313 This property is initialized by the value of the variable
7314 CMAKE_LINK_DEPENDS_NO_SHARED if it is set when a target is cre‐
7315 ated.
7316
7317
7318 LINK_FLAGS
7319 Additional flags to use when linking this target.
7320
7321 The LINK_FLAGS property can be used to add extra flags to the
7322 link step of a target. LINK_FLAGS_<CONFIG> will add to the con‐
7323 figuration <CONFIG>, for example, DEBUG, RELEASE, MINSIZEREL,
7324 RELWITHDEBINFO.
7325
7326
7327 LINK_FLAGS_<CONFIG>
7328 Per-configuration linker flags for a target.
7329
7330 This is the configuration-specific version of LINK_FLAGS.
7331
7332
7333 LINK_INTERFACE_LIBRARIES
7334 List public interface libraries for a shared library or exe‐
7335 cutable.
7336
7337 By default linking to a shared library target transitively links
7338 to targets with which the library itself was linked. For an
7339 executable with exports (see the ENABLE_EXPORTS property) no
7340 default transitive link dependencies are used. This property
7341 replaces the default transitive link dependencies with an
7342 explicit list. When the target is linked into another target
7343 the libraries listed (and recursively their link interface
7344 libraries) will be provided to the other target also. If the
7345 list is empty then no transitive link dependencies will be
7346 incorporated when this target is linked into another target even
7347 if the default set is non-empty. This property is initialized
7348 by the value of the variable CMAKE_LINK_INTERFACE_LIBRARIES if
7349 it is set when a target is created. This property is ignored
7350 for STATIC libraries.
7351
7352
7353 This property is overridden by the INTERFACE_LINK_LIBRARIES
7354 property if policy CMP0022 is NEW.
7355
7356
7357 This property is deprecated. Use INTERFACE_LINK_LIBRARIES
7358 instead.
7359
7360
7361 LINK_INTERFACE_LIBRARIES_<CONFIG>
7362 Per-configuration list of public interface libraries for a tar‐
7363 get.
7364
7365 This is the configuration-specific version of LINK_INTER‐
7366 FACE_LIBRARIES. If set, this property completely overrides the
7367 generic property for the named configuration.
7368
7369
7370 This property is overridden by the INTERFACE_LINK_LIBRARIES
7371 property if policy CMP0022 is NEW.
7372
7373
7374 This property is deprecated. Use INTERFACE_LINK_LIBRARIES
7375 instead.
7376
7377
7378 LINK_INTERFACE_MULTIPLICITY
7379 Repetition count for STATIC libraries with cyclic dependencies.
7380
7381 When linking to a STATIC library target with cyclic dependencies
7382 the linker may need to scan more than once through the archives
7383 in the strongly connected component of the dependency graph.
7384 CMake by default constructs the link line so that the linker
7385 will scan through the component at least twice. This property
7386 specifies the minimum number of scans if it is larger than the
7387 default. CMake uses the largest value specified by any target
7388 in a component.
7389
7390
7391 LINK_INTERFACE_MULTIPLICITY_<CONFIG>
7392 Per-configuration repetition count for cycles of STATIC
7393 libraries.
7394
7395 This is the configuration-specific version of LINK_INTER‐
7396 FACE_MULTIPLICITY. If set, this property completely overrides
7397 the generic property for the named configuration.
7398
7399
7400 LINK_LIBRARIES
7401 List of direct link dependencies.
7402
7403 This property specifies the list of libraries or targets which
7404 will be used for linking. In addition to accepting values from
7405 the target_link_libraries command, values may be set directly on
7406 any target using the set_property command.
7407
7408
7409 The target property values are used by the generators to set the
7410 link libraries for the compiler. See also the tar‐
7411 get_link_libraries command.
7412
7413
7414 Contents of LINK_LIBRARIES may use "generator expressions" with
7415 the syntax "$<...>". Generator expressions are evaluated during
7416 build system generation to produce information specific to each
7417 build configuration. Valid expressions are:
7418
7419
7420 $<0:...> = empty string (ignores "...")
7421 $<1:...> = content of "..."
7422 $<CONFIG:cfg> = '1' if config is "cfg", else '0'
7423 $<CONFIGURATION> = configuration name
7424 $<BOOL:...> = '1' if the '...' is true, else '0'
7425 $<STREQUAL:a,b> = '1' if a is STREQUAL b, else '0'
7426 $<ANGLE-R> = A literal '>'. Used to compare strings which contain a '>' for example.
7427 $<COMMA> = A literal ','. Used to compare strings which contain a ',' for example.
7428 $<SEMICOLON> = A literal ';'. Used to prevent list expansion on an argument with ';'.
7429 $<JOIN:list,...> = joins the list with the content of "..."
7430 $<TARGET_NAME:...> = Marks ... as being the name of a target. This is required if exporting targets to multiple dependent export sets. The '...' must be a literal name of a target- it may not contain generator expressions.
7431 $<INSTALL_INTERFACE:...> = content of "..." when the property is exported using install(EXPORT), and empty otherwise.
7432 $<BUILD_INTERFACE:...> = content of "..." when the property is exported using export(), or when the target is used by another target in the same buildsystem. Expands to the empty string otherwise.
7433 $<C_COMPILER_ID> = The CMake-id of the C compiler used.
7434 $<C_COMPILER_ID:comp> = '1' if the CMake-id of the C compiler matches comp, otherwise '0'.
7435 $<CXX_COMPILER_ID> = The CMake-id of the CXX compiler used.
7436 $<CXX_COMPILER_ID:comp> = '1' if the CMake-id of the CXX compiler matches comp, otherwise '0'.
7437 $<VERSION_GREATER:v1,v2> = '1' if v1 is a version greater than v2, else '0'.
7438 $<VERSION_LESS:v1,v2> = '1' if v1 is a version less than v2, else '0'.
7439 $<VERSION_EQUAL:v1,v2> = '1' if v1 is the same version as v2, else '0'.
7440 $<C_COMPILER_VERSION> = The version of the C compiler used.
7441 $<C_COMPILER_VERSION:ver> = '1' if the version of the C compiler matches ver, otherwise '0'.
7442 $<CXX_COMPILER_VERSION> = The version of the CXX compiler used.
7443 $<CXX_COMPILER_VERSION:ver> = '1' if the version of the CXX compiler matches ver, otherwise '0'.
7444 $<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)
7445 $<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)
7446 $<TARGET_SONAME_FILE:tgt> = file with soname (.so.3)
7447
7448 where "tgt" is the name of a target. Target file expressions
7449 produce a full path, but _DIR and _NAME versions can produce the
7450 directory and file name components:
7451
7452
7453 $<TARGET_FILE_DIR:tgt>/$<TARGET_FILE_NAME:tgt>
7454 $<TARGET_LINKER_FILE_DIR:tgt>/$<TARGET_LINKER_FILE_NAME:tgt>
7455 $<TARGET_SONAME_FILE_DIR:tgt>/$<TARGET_SONAME_FILE_NAME:tgt>
7456
7457
7458
7459
7460 $<TARGET_PROPERTY:tgt,prop> = The value of the property prop on the target tgt.
7461
7462 Note that tgt is not added as a dependency of the target this
7463 expression is evaluated on.
7464
7465
7466 $<TARGET_POLICY:pol> = '1' if the policy was NEW when the 'head' target was created, else '0'. If the policy was not set, the warning message for the policy will be emitted. This generator expression only works for a subset of policies.
7467 $<INSTALL_PREFIX> = Content of the install prefix when the target is exported via INSTALL(EXPORT) and empty otherwise.
7468
7469 Boolean expressions:
7470
7471
7472 $<AND:?[,?]...> = '1' if all '?' are '1', else '0'
7473 $<OR:?[,?]...> = '0' if all '?' are '0', else '1'
7474 $<NOT:?> = '0' if '?' is '1', else '1'
7475
7476 where '?' is always either '0' or '1'.
7477
7478
7479 Expressions with an implicit 'this' target:
7480
7481
7482 $<TARGET_PROPERTY:prop> = The value of the property prop on the target on which the generator expression is evaluated.
7483
7484
7485 LINK_SEARCH_END_STATIC
7486 End a link line such that static system libraries are used.
7487
7488 Some linkers support switches such as -Bstatic and -Bdynamic to
7489 determine whether to use static or shared libraries for -lXXX
7490 options. CMake uses these options to set the link type for
7491 libraries whose full paths are not known or (in some cases) are
7492 in implicit link directories for the platform. By default CMake
7493 adds an option at the end of the library list (if necessary) to
7494 set the linker search type back to its starting type. This
7495 property switches the final linker search type to -Bstatic
7496 regardless of how it started. See also
7497 LINK_SEARCH_START_STATIC.
7498
7499
7500 LINK_SEARCH_START_STATIC
7501 Assume the linker looks for static libraries by default.
7502
7503 Some linkers support switches such as -Bstatic and -Bdynamic to
7504 determine whether to use static or shared libraries for -lXXX
7505 options. CMake uses these options to set the link type for
7506 libraries whose full paths are not known or (in some cases) are
7507 in implicit link directories for the platform. By default the
7508 linker search type is assumed to be -Bdynamic at the beginning
7509 of the library list. This property switches the assumption to
7510 -Bstatic. It is intended for use when linking an executable
7511 statically (e.g. with the GNU -static option). See also
7512 LINK_SEARCH_END_STATIC.
7513
7514
7515 LOCATION
7516 Read-only location of a target on disk.
7517
7518 For an imported target, this read-only property returns the
7519 value of the LOCATION_<CONFIG> property for an unspecified con‐
7520 figuration <CONFIG> provided by the target.
7521
7522
7523 For a non-imported target, this property is provided for compat‐
7524 ibility with CMake 2.4 and below. It was meant to get the loca‐
7525 tion of an executable target's output file for use in add_cus‐
7526 tom_command. The path may contain a build-system-specific por‐
7527 tion that is replaced at build time with the configuration get‐
7528 ting built (such as "$(ConfigurationName)" in VS). In CMake 2.6
7529 and above add_custom_command automatically recognizes a target
7530 name in its COMMAND and DEPENDS options and computes the target
7531 location. In CMake 2.8.4 and above add_custom_command recog‐
7532 nizes generator expressions to refer to target locations any‐
7533 where in the command. Therefore this property is not needed for
7534 creating custom commands.
7535
7536
7537 Do not set properties that affect the location of a target after
7538 reading this property. These include properties whose names
7539 match "(RUNTIME|LIBRARY|ARCHIVE)_OUTPUT_(NAME|DIRECTORY)(_<CON‐
7540 FIG>)?", "(IMPLIB_)?(PREFIX|SUFFIX)", or "LINKER_LANGUAGE".
7541 Failure to follow this rule is not diagnosed and leaves the
7542 location of the target undefined.
7543
7544
7545 LOCATION_<CONFIG>
7546 Read-only property providing a target location on disk.
7547
7548 A read-only property that indicates where a target's main file
7549 is located on disk for the configuration <CONFIG>. The property
7550 is defined only for library and executable targets. An imported
7551 target may provide a set of configurations different from that
7552 of the importing project. By default CMake looks for an
7553 exact-match but otherwise uses an arbitrary available configura‐
7554 tion. Use the MAP_IMPORTED_CONFIG_<CONFIG> property to map
7555 imported configurations explicitly.
7556
7557
7558 Do not set properties that affect the location of a target after
7559 reading this property. These include properties whose names
7560 match "(RUNTIME|LIBRARY|ARCHIVE)_OUTPUT_(NAME|DIRECTORY)(_<CON‐
7561 FIG>)?", "(IMPLIB_)?(PREFIX|SUFFIX)", or "LINKER_LANGUAGE".
7562 Failure to follow this rule is not diagnosed and leaves the
7563 location of the target undefined.
7564
7565
7566 MACOSX_BUNDLE
7567 Build an executable as an application bundle on Mac OS X.
7568
7569 When this property is set to true the executable when built on
7570 Mac OS X will be created as an application bundle. This makes
7571 it a GUI executable that can be launched from the Finder. See
7572 the MACOSX_BUNDLE_INFO_PLIST target property for information
7573 about creation of the Info.plist file for the application bun‐
7574 dle. This property is initialized by the value of the variable
7575 CMAKE_MACOSX_BUNDLE if it is set when a target is created.
7576
7577
7578 MACOSX_BUNDLE_INFO_PLIST
7579 Specify a custom Info.plist template for a Mac OS X App Bundle.
7580
7581 An executable target with MACOSX_BUNDLE enabled will be built as
7582 an application bundle on Mac OS X. By default its Info.plist
7583 file is created by configuring a template called MacOSXBundle‐
7584 Info.plist.in located in the CMAKE_MODULE_PATH. This property
7585 specifies an alternative template file name which may be a full
7586 path.
7587
7588
7589 The following target properties may be set to specify content to
7590 be configured into the file:
7591
7592
7593 MACOSX_BUNDLE_INFO_STRING
7594 MACOSX_BUNDLE_ICON_FILE
7595 MACOSX_BUNDLE_GUI_IDENTIFIER
7596 MACOSX_BUNDLE_LONG_VERSION_STRING
7597 MACOSX_BUNDLE_BUNDLE_NAME
7598 MACOSX_BUNDLE_SHORT_VERSION_STRING
7599 MACOSX_BUNDLE_BUNDLE_VERSION
7600 MACOSX_BUNDLE_COPYRIGHT
7601
7602 CMake variables of the same name may be set to affect all tar‐
7603 gets in a directory that do not have each specific property set.
7604 If a custom Info.plist is specified by this property it may of
7605 course hard-code all the settings instead of using the target
7606 properties.
7607
7608
7609 MACOSX_FRAMEWORK_INFO_PLIST
7610 Specify a custom Info.plist template for a Mac OS X Framework.
7611
7612 A library target with FRAMEWORK enabled will be built as a
7613 framework on Mac OS X. By default its Info.plist file is cre‐
7614 ated by configuring a template called MacOSXFramework‐
7615 Info.plist.in located in the CMAKE_MODULE_PATH. This property
7616 specifies an alternative template file name which may be a full
7617 path.
7618
7619
7620 The following target properties may be set to specify content to
7621 be configured into the file:
7622
7623
7624 MACOSX_FRAMEWORK_ICON_FILE
7625 MACOSX_FRAMEWORK_IDENTIFIER
7626 MACOSX_FRAMEWORK_SHORT_VERSION_STRING
7627 MACOSX_FRAMEWORK_BUNDLE_VERSION
7628
7629 CMake variables of the same name may be set to affect all tar‐
7630 gets in a directory that do not have each specific property set.
7631 If a custom Info.plist is specified by this property it may of
7632 course hard-code all the settings instead of using the target
7633 properties.
7634
7635
7636 MACOSX_RPATH
7637 Whether to use rpaths on Mac OS X.
7638
7639 When this property is set to true, the directory portion of
7640 the"install_name" field of shared libraries will default to
7641 "@rpath".Runtime paths will also be embedded in binaries using
7642 this target.This property is initialized by the value of the
7643 variable CMAKE_MACOSX_RPATH if it is set when a target is cre‐
7644 ated.
7645
7646
7647 MAP_IMPORTED_CONFIG_<CONFIG>
7648 Map from project configuration to IMPORTED target's configura‐
7649 tion.
7650
7651 Set this to the list of configurations of an imported target
7652 that may be used for the current project's <CONFIG> configura‐
7653 tion. Targets imported from another project may not provide the
7654 same set of configuration names available in the current
7655 project. Setting this property tells CMake what imported con‐
7656 figurations are suitable for use when building the <CONFIG> con‐
7657 figuration. The first configuration in the list found to be
7658 provided by the imported target is selected. If this property
7659 is set and no matching configurations are available, then the
7660 imported target is considered to be not found. This property is
7661 ignored for non-imported targets.
7662
7663
7664 NAME Logical name for the target.
7665
7666 Read-only logical name for the target as used by CMake.
7667
7668
7669 NO_SONAME
7670 Whether to set "soname" when linking a shared library or module.
7671
7672 Enable this boolean property if a generated shared library or
7673 module should not have "soname" set. Default is to set "soname"
7674 on all shared libraries and modules as long as the platform sup‐
7675 ports it. Generally, use this property only for leaf private
7676 libraries or plugins. If you use it on normal shared libraries
7677 which other targets link against, on some platforms a linker
7678 will insert a full path to the library (as specified at link
7679 time) into the dynamic section of the dependent binary. There‐
7680 fore, once installed, dynamic loader may eventually fail to
7681 locate the library for the binary.
7682
7683
7684 OSX_ARCHITECTURES
7685 Target specific architectures for OS X.
7686
7687 The OSX_ARCHITECTURES property sets the target binary architec‐
7688 ture for targets on OS X. This property is initialized by the
7689 value of the variable CMAKE_OSX_ARCHITECTURES if it is set when
7690 a target is created. Use OSX_ARCHITECTURES_<CONFIG> to set the
7691 binary architectures on a per-configuration basis. <CONFIG> is
7692 an upper-case name (ex: "OSX_ARCHITECTURES_DEBUG").
7693
7694
7695 OSX_ARCHITECTURES_<CONFIG>
7696 Per-configuration OS X binary architectures for a target.
7697
7698 This property is the configuration-specific version of
7699 OSX_ARCHITECTURES.
7700
7701
7702 OUTPUT_NAME
7703 Output name for target files.
7704
7705 This sets the base name for output files created for an exe‐
7706 cutable or library target. If not set, the logical target name
7707 is used by default.
7708
7709
7710 OUTPUT_NAME_<CONFIG>
7711 Per-configuration target file base name.
7712
7713 This is the configuration-specific version of OUTPUT_NAME.
7714
7715
7716 PDB_NAME
7717 Output name for MS debug symbols .pdb file from linker.
7718
7719 Set the base name for debug symbols file created for an exe‐
7720 cutable or shared library target. If not set, the logical tar‐
7721 get name is used by default.
7722
7723
7724 This property is not implemented by the Visual Studio 6 genera‐
7725 tor.
7726
7727
7728 PDB_NAME_<CONFIG>
7729 Per-configuration name for MS debug symbols .pdb file.
7730
7731 This is the configuration-specific version of PDB_NAME.
7732
7733
7734 This property is not implemented by the Visual Studio 6 genera‐
7735 tor.
7736
7737
7738 PDB_OUTPUT_DIRECTORY
7739 Output directory for MS debug symbols .pdb file from linker.
7740
7741 This property specifies the directory into which the MS debug
7742 symbols will be placed by the linker. This property is initial‐
7743 ized by the value of the variable CMAKE_PDB_OUTPUT_DIRECTORY if
7744 it is set when a target is created.
7745
7746
7747 This property is not implemented by the Visual Studio 6 genera‐
7748 tor.
7749
7750
7751 PDB_OUTPUT_DIRECTORY_<CONFIG>
7752 Per-configuration output directory for MS debug symbols .pdb
7753 files.
7754
7755 This is a per-configuration version of PDB_OUTPUT_DIRECTORY, but
7756 multi-configuration generators (VS, Xcode) do NOT append a
7757 per-configuration subdirectory to the specified directory. This
7758 property is initialized by the value of the variable
7759 CMAKE_PDB_OUTPUT_DIRECTORY_<CONFIG> if it is set when a target
7760 is created.
7761
7762
7763 This property is not implemented by the Visual Studio 6 genera‐
7764 tor.
7765
7766
7767 POSITION_INDEPENDENT_CODE
7768 Whether to create a position-independent target
7769
7770 The POSITION_INDEPENDENT_CODE property determines whether posi‐
7771 tion independent executables or shared libraries will be cre‐
7772 ated. This property is true by default for SHARED and MODULE
7773 library targets and false otherwise. This property is initial‐
7774 ized by the value of the variable CMAKE_POSITION_INDEPEN‐
7775 DENT_CODE if it is set when a target is created.
7776
7777
7778 POST_INSTALL_SCRIPT
7779 Deprecated install support.
7780
7781 The PRE_INSTALL_SCRIPT and POST_INSTALL_SCRIPT properties are
7782 the old way to specify CMake scripts to run before and after
7783 installing a target. They are used only when the old
7784 INSTALL_TARGETS command is used to install the target. Use the
7785 INSTALL command instead.
7786
7787
7788 PREFIX What comes before the library name.
7789
7790 A target property that can be set to override the prefix (such
7791 as "lib") on a library name.
7792
7793
7794 PRE_INSTALL_SCRIPT
7795 Deprecated install support.
7796
7797 The PRE_INSTALL_SCRIPT and POST_INSTALL_SCRIPT properties are
7798 the old way to specify CMake scripts to run before and after
7799 installing a target. They are used only when the old
7800 INSTALL_TARGETS command is used to install the target. Use the
7801 INSTALL command instead.
7802
7803
7804 PRIVATE_HEADER
7805 Specify private header files in a FRAMEWORK shared library tar‐
7806 get.
7807
7808 Shared library targets marked with the FRAMEWORK property gener‐
7809 ate frameworks on OS X and normal shared libraries on other
7810 platforms. This property may be set to a list of header files
7811 to be placed in the PrivateHeaders directory inside the frame‐
7812 work folder. On non-Apple platforms these headers may be
7813 installed using the PRIVATE_HEADER option to the install(TAR‐
7814 GETS) command.
7815
7816
7817 PROJECT_LABEL
7818 Change the name of a target in an IDE.
7819
7820 Can be used to change the name of the target in an IDE like Vis‐
7821 ual Studio.
7822
7823
7824 PUBLIC_HEADER
7825 Specify public header files in a FRAMEWORK shared library tar‐
7826 get.
7827
7828 Shared library targets marked with the FRAMEWORK property gener‐
7829 ate frameworks on OS X and normal shared libraries on other
7830 platforms. This property may be set to a list of header files
7831 to be placed in the Headers directory inside the framework
7832 folder. On non-Apple platforms these headers may be installed
7833 using the PUBLIC_HEADER option to the install(TARGETS) command.
7834
7835
7836 RESOURCE
7837 Specify resource files in a FRAMEWORK shared library target.
7838
7839 Shared library targets marked with the FRAMEWORK property gener‐
7840 ate frameworks on OS X and normal shared libraries on other
7841 platforms. This property may be set to a list of files to be
7842 placed in the Resources directory inside the framework folder.
7843 On non-Apple platforms these files may be installed using the
7844 RESOURCE option to the install(TARGETS) command.
7845
7846
7847 RULE_LAUNCH_COMPILE
7848 Specify a launcher for compile rules.
7849
7850 See the global property of the same name for details. This
7851 overrides the global and directory property for a target.
7852
7853
7854 RULE_LAUNCH_CUSTOM
7855 Specify a launcher for custom rules.
7856
7857 See the global property of the same name for details. This
7858 overrides the global and directory property for a target.
7859
7860
7861 RULE_LAUNCH_LINK
7862 Specify a launcher for link rules.
7863
7864 See the global property of the same name for details. This
7865 overrides the global and directory property for a target.
7866
7867
7868 RUNTIME_OUTPUT_DIRECTORY
7869 Output directory in which to build RUNTIME target files.
7870
7871 This property specifies the directory into which runtime target
7872 files should be built. Multi-configuration generators (VS,
7873 Xcode) append a per-configuration subdirectory to the specified
7874 directory. There are three kinds of target files that may be
7875 built: archive, library, and runtime. Executables are always
7876 treated as runtime targets. Static libraries are always treated
7877 as archive targets. Module libraries are always treated as
7878 library targets. For non-DLL platforms shared libraries are
7879 treated as library targets. For DLL platforms the DLL part of a
7880 shared library is treated as a runtime target and the corre‐
7881 sponding import library is treated as an archive target. All
7882 Windows-based systems including Cygwin are DLL platforms. This
7883 property is initialized by the value of the variable CMAKE_RUN‐
7884 TIME_OUTPUT_DIRECTORY if it is set when a target is created.
7885
7886
7887 RUNTIME_OUTPUT_DIRECTORY_<CONFIG>
7888 Per-configuration output directory for RUNTIME target files.
7889
7890 This is a per-configuration version of RUNTIME_OUTPUT_DIRECTORY,
7891 but multi-configuration generators (VS, Xcode) do NOT append a
7892 per-configuration subdirectory to the specified directory. This
7893 property is initialized by the value of the variable CMAKE_RUN‐
7894 TIME_OUTPUT_DIRECTORY_<CONFIG> if it is set when a target is
7895 created.
7896
7897
7898 RUNTIME_OUTPUT_NAME
7899 Output name for RUNTIME target files.
7900
7901 This property specifies the base name for runtime target files.
7902 It overrides OUTPUT_NAME and OUTPUT_NAME_<CONFIG> properties.
7903 There are three kinds of target files that may be built: ar‐
7904 chive, library, and runtime. Executables are always treated as
7905 runtime targets. Static libraries are always treated as archive
7906 targets. Module libraries are always treated as library targets.
7907 For non-DLL platforms shared libraries are treated as library
7908 targets. For DLL platforms the DLL part of a shared library is
7909 treated as a runtime target and the corresponding import library
7910 is treated as an archive target. All Windows-based systems
7911 including Cygwin are DLL platforms.
7912
7913
7914 RUNTIME_OUTPUT_NAME_<CONFIG>
7915 Per-configuration output name for RUNTIME target files.
7916
7917 This is the configuration-specific version of RUNTIME_OUT‐
7918 PUT_NAME.
7919
7920
7921 SKIP_BUILD_RPATH
7922 Should rpaths be used for the build tree.
7923
7924 SKIP_BUILD_RPATH is a boolean specifying whether to skip auto‐
7925 matic generation of an rpath allowing the target to run from the
7926 build tree. This property is initialized by the value of the
7927 variable CMAKE_SKIP_BUILD_RPATH if it is set when a target is
7928 created.
7929
7930
7931 SOURCES
7932 Source names specified for a target.
7933
7934 Read-only list of sources specified for a target. The names
7935 returned are suitable for passing to the set_source_files_prop‐
7936 erties command.
7937
7938
7939 SOVERSION
7940 What version number is this target.
7941
7942 For shared libraries VERSION and SOVERSION can be used to spec‐
7943 ify the build version and API version respectively. When build‐
7944 ing or installing appropriate symlinks are created if the plat‐
7945 form supports symlinks and the linker supports so-names. If only
7946 one of both is specified the missing is assumed to have the same
7947 version number. SOVERSION is ignored if NO_SONAME property is
7948 set. For shared libraries and executables on Windows the VERSION
7949 attribute is parsed to extract a "major.minor" version number.
7950 These numbers are used as the image version of the binary.
7951
7952
7953 STATIC_LIBRARY_FLAGS
7954 Extra flags to use when linking static libraries.
7955
7956 Extra flags to use when linking a static library.
7957
7958
7959 STATIC_LIBRARY_FLAGS_<CONFIG>
7960 Per-configuration flags for creating a static library.
7961
7962 This is the configuration-specific version of
7963 STATIC_LIBRARY_FLAGS.
7964
7965
7966 SUFFIX What comes after the target name.
7967
7968 A target property that can be set to override the suffix (such
7969 as ".so" or ".exe") on the name of a library, module or exe‐
7970 cutable.
7971
7972
7973 TYPE The type of the target.
7974
7975 This read-only property can be used to test the type of the
7976 given target. It will be one of STATIC_LIBRARY, MODULE_LIBRARY,
7977 SHARED_LIBRARY, EXECUTABLE or one of the internal target types.
7978
7979
7980 VERSION
7981 What version number is this target.
7982
7983 For shared libraries VERSION and SOVERSION can be used to spec‐
7984 ify the build version and API version respectively. When build‐
7985 ing or installing appropriate symlinks are created if the plat‐
7986 form supports symlinks and the linker supports so-names. If only
7987 one of both is specified the missing is assumed to have the same
7988 version number. For executables VERSION can be used to specify
7989 the build version. When building or installing appropriate sym‐
7990 links are created if the platform supports symlinks. For shared
7991 libraries and executables on Windows the VERSION attribute is
7992 parsed to extract a "major.minor" version number. These numbers
7993 are used as the image version of the binary.
7994
7995
7996 VISIBILITY_INLINES_HIDDEN
7997 Whether to add a compile flag to hide symbols of inline func‐
7998 tions
7999
8000 The VISIBILITY_INLINES_HIDDEN property determines whether a flag
8001 for hiding symbols for inline functions. the value passed used
8002 in a visibility related compile option, such as -fvisibility=.
8003 This property only has an affect for libraries and executables
8004 with exports. This property is initialized by the value of the
8005 variable CMAKE_VISIBILITY_INLINES_HIDDEN if it is set when a
8006 target is created.
8007
8008
8009 VS_DOTNET_REFERENCES
8010 Visual Studio managed project .NET references
8011
8012 Adds one or more semicolon-delimited .NET references to a gener‐
8013 ated Visual Studio project. For example, "System;System.Win‐
8014 dows.Forms".
8015
8016
8017 VS_DOTNET_TARGET_FRAMEWORK_VERSION
8018 Specify the .NET target framework version.
8019
8020 Used to specify the .NET target framework version for C++/CLI.
8021 For example, "v4.5".
8022
8023
8024 VS_GLOBAL_<variable>
8025 Visual Studio project-specific global variable.
8026
8027 Tell the Visual Studio generator to set the global variable
8028 '<variable>' to a given value in the generated Visual Studio
8029 project. Ignored on other generators. Qt integration works bet‐
8030 ter if VS_GLOBAL_QtVersion is set to the version FindQt4.cmake
8031 found. For example, "4.7.3"
8032
8033
8034 VS_GLOBAL_KEYWORD
8035 Visual Studio project keyword.
8036
8037 Sets the "keyword" attribute for a generated Visual Studio
8038 project. Defaults to "Win32Proj". You may wish to override this
8039 value with "ManagedCProj", for example, in a Visual Studio man‐
8040 aged C++ unit test project.
8041
8042
8043 VS_GLOBAL_PROJECT_TYPES
8044 Visual Studio project type(s).
8045
8046 Can be set to one or more UUIDs recognized by Visual Studio to
8047 indicate the type of project. This value is copied verbatim into
8048 the generated project file. Example for a managed C++ unit test‐
8049 ing project:
8050
8051
8052 {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}
8053
8054 UUIDs are semicolon-delimited.
8055
8056
8057 VS_GLOBAL_ROOTNAMESPACE
8058 Visual Studio project root namespace.
8059
8060 Sets the "RootNamespace" attribute for a generated Visual Studio
8061 project. The attribute will be generated only if this is set.
8062
8063
8064 VS_KEYWORD
8065 Visual Studio project keyword.
8066
8067 Can be set to change the visual studio keyword, for example Qt
8068 integration works better if this is set to Qt4VSv1.0.
8069
8070
8071 VS_SCC_AUXPATH
8072 Visual Studio Source Code Control Aux Path.
8073
8074 Can be set to change the visual studio source code control aux‐
8075 path property.
8076
8077
8078 VS_SCC_LOCALPATH
8079 Visual Studio Source Code Control Local Path.
8080
8081 Can be set to change the visual studio source code control local
8082 path property.
8083
8084
8085 VS_SCC_PROJECTNAME
8086 Visual Studio Source Code Control Project.
8087
8088 Can be set to change the visual studio source code control
8089 project name property.
8090
8091
8092 VS_SCC_PROVIDER
8093 Visual Studio Source Code Control Provider.
8094
8095 Can be set to change the visual studio source code control
8096 provider property.
8097
8098
8099 VS_WINRT_EXTENSIONS
8100 Visual Studio project C++/CX language extensions for Windows
8101 Runtime
8102
8103 Can be set to enable C++/CX language extensions.
8104
8105
8106 VS_WINRT_REFERENCES
8107 Visual Studio project Windows Runtime Metadata references
8108
8109 Adds one or more semicolon-delimited WinRT references to a gen‐
8110 erated Visual Studio project. For example, "Windows;Win‐
8111 dows.UI.Core".
8112
8113
8114 WIN32_EXECUTABLE
8115 Build an executable with a WinMain entry point on windows.
8116
8117 When this property is set to true the executable when linked on
8118 Windows will be created with a WinMain() entry point instead of
8119 just main(). This makes it a GUI executable instead of a con‐
8120 sole application. See the CMAKE_MFC_FLAG variable documentation
8121 to configure use of MFC for WinMain executables. This property
8122 is initialized by the value of the variable CMAKE_WIN32_EXE‐
8123 CUTABLE if it is set when a target is created.
8124
8125
8126 XCODE_ATTRIBUTE_<an-attribute>
8127 Set Xcode target attributes directly.
8128
8129 Tell the Xcode generator to set '<an-attribute>' to a given
8130 value in the generated Xcode project. Ignored on other genera‐
8131 tors.
8132
8133
8135 ATTACHED_FILES
8136 Attach a list of files to a dashboard submission.
8137
8138 Set this property to a list of files that will be encoded and
8139 submitted to the dashboard as an addition to the test result.
8140
8141
8142 ATTACHED_FILES_ON_FAIL
8143 Attach a list of files to a dashboard submission if the test
8144 fails.
8145
8146 Same as ATTACHED_FILES, but these files will only be included if
8147 the test does not pass.
8148
8149
8150 COST Set this to a floating point value. Tests in a test set will be
8151 run in descending order of cost.
8152
8153 This property describes the cost of a test. You can explicitly
8154 set this value; tests with higher COST values will run first.
8155
8156
8157 DEPENDS
8158 Specifies that this test should only be run after the specified
8159 list of tests.
8160
8161 Set this to a list of tests that must finish before this test is
8162 run.
8163
8164
8165 ENVIRONMENT
8166 Specify environment variables that should be defined for running
8167 a test.
8168
8169 If set to a list of environment variables and values of the form
8170 MYVAR=value those environment variables will be defined while
8171 running the test. The environment is restored to its previous
8172 state after the test is done.
8173
8174
8175 FAIL_REGULAR_EXPRESSION
8176 If the output matches this regular expression the test will
8177 fail.
8178
8179 If set, if the output matches one of specified regular expres‐
8180 sions, the test will fail.For example: FAIL_REGULAR_EXPRESSION
8181 "[^a-z]Error;ERROR;Failed"
8182
8183
8184 LABELS Specify a list of text labels associated with a test.
8185
8186 The list is reported in dashboard submissions.
8187
8188
8189 MEASUREMENT
8190 Specify a CDASH measurement and value to be reported for a test.
8191
8192 If set to a name then that name will be reported to CDASH as a
8193 named measurement with a value of 1. You may also specify a
8194 value by setting MEASUREMENT to "measurement=value".
8195
8196
8197 PASS_REGULAR_EXPRESSION
8198 The output must match this regular expression for the test to
8199 pass.
8200
8201 If set, the test output will be checked against the specified
8202 regular expressions and at least one of the regular expressions
8203 has to match, otherwise the test will fail.
8204
8205
8206 PROCESSORS
8207 How many process slots this test requires
8208
8209 Denotes the number of processors that this test will require.
8210 This is typically used for MPI tests, and should be used in con‐
8211 junction with the ctest_test PARALLEL_LEVEL option.
8212
8213
8214 REQUIRED_FILES
8215 List of files required to run the test.
8216
8217 If set to a list of files, the test will not be run unless all
8218 of the files exist.
8219
8220
8221 RESOURCE_LOCK
8222 Specify a list of resources that are locked by this test.
8223
8224 If multiple tests specify the same resource lock, they are guar‐
8225 anteed not to run concurrently.
8226
8227
8228 RUN_SERIAL
8229 Do not run this test in parallel with any other test.
8230
8231 Use this option in conjunction with the ctest_test PARAL‐
8232 LEL_LEVEL option to specify that this test should not be run in
8233 parallel with any other tests.
8234
8235
8236 TIMEOUT
8237 How many seconds to allow for this test.
8238
8239 This property if set will limit a test to not take more than the
8240 specified number of seconds to run. If it exceeds that the test
8241 process will be killed and ctest will move to the next test.
8242 This setting takes precedence over CTEST_TESTING_TIMEOUT.
8243
8244
8245 WILL_FAIL
8246 If set to true, this will invert the pass/fail flag of the test.
8247
8248 This property can be used for tests that are expected to fail
8249 and return a non zero return code.
8250
8251
8252 WORKING_DIRECTORY
8253 The directory from which the test executable will be called.
8254
8255 If this is not set it is called from the directory the test exe‐
8256 cutable is located in.
8257
8258
8260 ABSTRACT
8261 Is this source file an abstract class.
8262
8263 A property on a source file that indicates if the source file
8264 represents a class that is abstract. This only makes sense for
8265 languages that have a notion of an abstract class and it is only
8266 used by some tools that wrap classes into other languages.
8267
8268
8269 COMPILE_DEFINITIONS
8270 Preprocessor definitions for compiling a source file.
8271
8272 The COMPILE_DEFINITIONS property may be set to a semicolon-sepa‐
8273 rated list of preprocessor definitions using the syntax VAR or
8274 VAR=value. Function-style definitions are not supported. CMake
8275 will automatically escape the value correctly for the native
8276 build system (note that CMake language syntax may require
8277 escapes to specify some values). This property may be set on a
8278 per-configuration basis using the name COMPILE_DEFINITIONS_<CON‐
8279 FIG> where <CONFIG> is an upper-case name (ex. "COMPILE_DEFINI‐
8280 TIONS_DEBUG").
8281
8282
8283 CMake will automatically drop some definitions that are not sup‐
8284 ported by the native build tool. The VS6 IDE does not support
8285 definition values with spaces (but NMake does). Xcode does not
8286 support per-configuration definitions on source files.
8287
8288
8289 Disclaimer: Most native build tools have poor support for escap‐
8290 ing certain values. CMake has work-arounds for many cases but
8291 some values may just not be possible to pass correctly. If a
8292 value does not seem to be escaped correctly, do not attempt to
8293 work-around the problem by adding escape sequences to the value.
8294 Your work-around may break in a future version of CMake that has
8295 improved escape support. Instead consider defining the macro in
8296 a (configured) header file. Then report the limitation. Known
8297 limitations include:
8298
8299
8300 # - broken almost everywhere
8301 ; - broken in VS IDE 7.0 and Borland Makefiles
8302 , - broken in VS IDE
8303 % - broken in some cases in NMake
8304 & | - broken in some cases on MinGW
8305 ^ < > \" - broken in most Make tools on Windows
8306
8307 CMake does not reject these values outright because they do work
8308 in some cases. Use with caution.
8309
8310
8311 COMPILE_DEFINITIONS_<CONFIG>
8312 Per-configuration preprocessor definitions on a source file.
8313
8314 This is the configuration-specific version of COMPILE_DEFINI‐
8315 TIONS. Note that Xcode does not support per-configuration
8316 source file flags so this property will be ignored by the Xcode
8317 generator.
8318
8319
8320 COMPILE_FLAGS
8321 Additional flags to be added when compiling this source file.
8322
8323 These flags will be added to the list of compile flags when this
8324 source file builds. Use COMPILE_DEFINITIONS to pass additional
8325 preprocessor definitions.
8326
8327
8328 EXTERNAL_OBJECT
8329 If set to true then this is an object file.
8330
8331 If this property is set to true then the source file is really
8332 an object file and should not be compiled. It will still be
8333 linked into the target though.
8334
8335
8336 Fortran_FORMAT
8337 Set to FIXED or FREE to indicate the Fortran source layout.
8338
8339 This property tells CMake whether a given Fortran source file
8340 uses fixed-format or free-format. CMake will pass the corre‐
8341 sponding format flag to the compiler. Consider using the tar‐
8342 get-wide Fortran_FORMAT property if all source files in a target
8343 share the same format.
8344
8345
8346 GENERATED
8347 Is this source file generated as part of the build process.
8348
8349 If a source file is generated by the build process CMake will
8350 handle it differently in terms of dependency checking etc. Oth‐
8351 erwise having a non-existent source file could create problems.
8352
8353
8354 HEADER_FILE_ONLY
8355 Is this source file only a header file.
8356
8357 A property on a source file that indicates if the source file is
8358 a header file with no associated implementation. This is set
8359 automatically based on the file extension and is used by CMake
8360 to determine if certain dependency information should be com‐
8361 puted.
8362
8363
8364 KEEP_EXTENSION
8365 Make the output file have the same extension as the source file.
8366
8367 If this property is set then the file extension of the output
8368 file will be the same as that of the source file. Normally the
8369 output file extension is computed based on the language of the
8370 source file, for example .cxx will go to a .o extension.
8371
8372
8373 LABELS Specify a list of text labels associated with a source file.
8374
8375 This property has meaning only when the source file is listed in
8376 a target whose LABELS property is also set. No other semantics
8377 are currently specified.
8378
8379
8380 LANGUAGE
8381 What programming language is the file.
8382
8383 A property that can be set to indicate what programming language
8384 the source file is. If it is not set the language is determined
8385 based on the file extension. Typical values are CXX C etc. Set‐
8386 ting this property for a file means this file will be compiled.
8387 Do not set this for headers or files that should not be com‐
8388 piled.
8389
8390
8391 LOCATION
8392 The full path to a source file.
8393
8394 A read only property on a SOURCE FILE that contains the full
8395 path to the source file.
8396
8397
8398 MACOSX_PACKAGE_LOCATION
8399 Place a source file inside a Mac OS X bundle, CFBundle, or
8400 framework.
8401
8402 Executable targets with the MACOSX_BUNDLE property set are built
8403 as Mac OS X application bundles on Apple platforms. Shared
8404 library targets with the FRAMEWORK property set are built as Mac
8405 OS X frameworks on Apple platforms. Module library targets with
8406 the BUNDLE property set are built as Mac OS X CFBundle bundles
8407 on Apple platforms. Source files listed in the target with this
8408 property set will be copied to a directory inside the bundle or
8409 framework content folder specified by the property value. For
8410 bundles the content folder is "<name>.app/Contents". For frame‐
8411 works the content folder is "<name>.framework/Versions/<ver‐
8412 sion>". For cfbundles the content folder is "<name>.bundle/Con‐
8413 tents" (unless the extension is changed). See the PUB‐
8414 LIC_HEADER, PRIVATE_HEADER, and RESOURCE target properties for
8415 specifying files meant for Headers, PrivateHeaders, or Resources
8416 directories.
8417
8418
8419 OBJECT_DEPENDS
8420 Additional files on which a compiled object file depends.
8421
8422 Specifies a semicolon-separated list of full-paths to files on
8423 which any object files compiled from this source file depend.
8424 An object file will be recompiled if any of the named files is
8425 newer than it.
8426
8427
8428 This property need not be used to specify the dependency of a
8429 source file on a generated header file that it includes.
8430 Although the property was originally introduced for this pur‐
8431 pose, it is no longer necessary. If the generated header file
8432 is created by a custom command in the same target as the source
8433 file, the automatic dependency scanning process will recognize
8434 the dependency. If the generated header file is created by
8435 another target, an inter-target dependency should be created
8436 with the add_dependencies command (if one does not already exist
8437 due to linking relationships).
8438
8439
8440 OBJECT_OUTPUTS
8441 Additional outputs for a Makefile rule.
8442
8443 Additional outputs created by compilation of this source file.
8444 If any of these outputs is missing the object will be recom‐
8445 piled. This is supported only on Makefile generators and will be
8446 ignored on other generators.
8447
8448
8449 SYMBOLIC
8450 Is this just a name for a rule.
8451
8452 If SYMBOLIC (boolean) is set to true the build system will be
8453 informed that the source file is not actually created on disk
8454 but instead used as a symbolic name for a build rule.
8455
8456
8457 WRAP_EXCLUDE
8458 Exclude this source file from any code wrapping techniques.
8459
8460 Some packages can wrap source files into alternate languages to
8461 provide additional functionality. For example, C++ code can be
8462 wrapped into Java or Python etc using SWIG etc. If WRAP_EXCLUDE
8463 is set to true (1 etc) that indicates that this source file
8464 should not be wrapped.
8465
8466
8468 ADVANCED
8469 True if entry should be hidden by default in GUIs.
8470
8471 This is a boolean value indicating whether the entry is consid‐
8472 ered interesting only for advanced configuration. The
8473 mark_as_advanced() command modifies this property.
8474
8475
8476 HELPSTRING
8477 Help associated with entry in GUIs.
8478
8479 This string summarizes the purpose of an entry to help users set
8480 it through a CMake GUI.
8481
8482
8483 MODIFIED
8484 Internal management property. Do not set or get.
8485
8486 This is an internal cache entry property managed by CMake to
8487 track interactive user modification of entries. Ignore it.
8488
8489
8490 STRINGS
8491 Enumerate possible STRING entry values for GUI selection.
8492
8493 For cache entries with type STRING, this enumerates a set of
8494 values. CMake GUIs may use this to provide a selection widget
8495 instead of a generic string entry field. This is for conve‐
8496 nience only. CMake does not enforce that the value matches one
8497 of those listed.
8498
8499
8500 TYPE Widget type for entry in GUIs.
8501
8502 Cache entry values are always strings, but CMake GUIs present
8503 widgets to help users set values. The GUIs use this property as
8504 a hint to determine the widget type. Valid TYPE values are:
8505
8506
8507 BOOL = Boolean ON/OFF value.
8508 PATH = Path to a directory.
8509 FILEPATH = Path to a file.
8510 STRING = Generic string value.
8511 INTERNAL = Do not present in GUI at all.
8512 STATIC = Value managed by CMake, do not change.
8513 UNINITIALIZED = Type not yet specified.
8514
8515 Generally the TYPE of a cache entry should be set by the command
8516 which creates it (set, option, find_library, etc.).
8517
8518
8519 VALUE Value of a cache entry.
8520
8521 This property maps to the actual value of a cache entry. Set‐
8522 ting this property always sets the value without checking, so
8523 use with care.
8524
8525
8527 CMake Compatibility Listfile Commands - Obsolete commands supported by CMake for compatibility.
8528
8529
8530 This is the documentation for now obsolete listfile commands from pre‐
8531 vious CMake versions, which are still supported for compatibility rea‐
8532 sons. You should instead use the newer, faster and shinier new com‐
8533 mands. ;-)
8534
8535
8537 build_name
8538 Deprecated. Use ${CMAKE_SYSTEM} and ${CMAKE_CXX_COMPILER}
8539 instead.
8540
8541 build_name(variable)
8542
8543 Sets the specified variable to a string representing the plat‐
8544 form and compiler settings. These values are now available
8545 through the CMAKE_SYSTEM and CMAKE_CXX_COMPILER variables.
8546
8547
8548 exec_program
8549 Deprecated. Use the execute_process() command instead.
8550
8551 Run an executable program during the processing of the CMake‐
8552 List.txt file.
8553
8554
8555 exec_program(Executable [directory in which to run]
8556 [ARGS <arguments to executable>]
8557 [OUTPUT_VARIABLE <var>]
8558 [RETURN_VALUE <var>])
8559
8560 The executable is run in the optionally specified directory.
8561 The executable can include arguments if it is double quoted, but
8562 it is better to use the optional ARGS argument to specify argu‐
8563 ments to the program. This is because cmake will then be able
8564 to escape spaces in the executable path. An optional argument
8565 OUTPUT_VARIABLE specifies a variable in which to store the out‐
8566 put. To capture the return value of the execution, provide a
8567 RETURN_VALUE. If OUTPUT_VARIABLE is specified, then no output
8568 will go to the stdout/stderr of the console running cmake.
8569
8570
8571
8572 export_library_dependencies
8573 Deprecated. Use INSTALL(EXPORT) or EXPORT command.
8574
8575 This command generates an old-style library dependencies file.
8576 Projects requiring CMake 2.6 or later should not use the com‐
8577 mand. Use instead the install(EXPORT) command to help export
8578 targets from an installation tree and the export() command to
8579 export targets from a build tree.
8580
8581
8582 The old-style library dependencies file does not take into
8583 account per-configuration names of libraries or the LINK_INTER‐
8584 FACE_LIBRARIES target property.
8585
8586
8587 export_library_dependencies(<file> [APPEND])
8588
8589 Create a file named <file> that can be included into a CMake
8590 listfile with the INCLUDE command. The file will contain a num‐
8591 ber of SET commands that will set all the variables needed for
8592 library dependency information. This should be the last command
8593 in the top level CMakeLists.txt file of the project. If the
8594 APPEND option is specified, the SET commands will be appended to
8595 the given file instead of replacing it.
8596
8597
8598 install_files
8599 Deprecated. Use the install(FILES ) command instead.
8600
8601 This command has been superceded by the install command. It is
8602 provided for compatibility with older CMake code. The FILES
8603 form is directly replaced by the FILES form of the install com‐
8604 mand. The regexp form can be expressed more clearly using the
8605 GLOB form of the file command.
8606
8607
8608 install_files(<dir> extension file file ...)
8609
8610 Create rules to install the listed files with the given exten‐
8611 sion into the given directory. Only files existing in the cur‐
8612 rent source tree or its corresponding location in the binary
8613 tree may be listed. If a file specified already has an exten‐
8614 sion, that extension will be removed first. This is useful for
8615 providing lists of source files such as foo.cxx when you want
8616 the corresponding foo.h to be installed. A typical extension is
8617 '.h'.
8618
8619
8620 install_files(<dir> regexp)
8621
8622 Any files in the current source directory that match the regular
8623 expression will be installed.
8624
8625
8626 install_files(<dir> FILES file file ...)
8627
8628 Any files listed after the FILES keyword will be installed
8629 explicitly from the names given. Full paths are allowed in this
8630 form.
8631
8632
8633 The directory <dir> is relative to the installation prefix,
8634 which is stored in the variable CMAKE_INSTALL_PREFIX.
8635
8636
8637 install_programs
8638 Deprecated. Use the install(PROGRAMS ) command instead.
8639
8640 This command has been superceded by the install command. It is
8641 provided for compatibility with older CMake code. The FILES
8642 form is directly replaced by the PROGRAMS form of the INSTALL
8643 command. The regexp form can be expressed more clearly using
8644 the GLOB form of the FILE command.
8645
8646
8647 install_programs(<dir> file1 file2 [file3 ...])
8648 install_programs(<dir> FILES file1 [file2 ...])
8649
8650 Create rules to install the listed programs into the given
8651 directory. Use the FILES argument to guarantee that the file
8652 list version of the command will be used even when there is only
8653 one argument.
8654
8655
8656 install_programs(<dir> regexp)
8657
8658 In the second form any program in the current source directory
8659 that matches the regular expression will be installed.
8660
8661
8662 This command is intended to install programs that are not built
8663 by cmake, such as shell scripts. See the TARGETS form of the
8664 INSTALL command to create installation rules for targets built
8665 by cmake.
8666
8667
8668 The directory <dir> is relative to the installation prefix,
8669 which is stored in the variable CMAKE_INSTALL_PREFIX.
8670
8671
8672 install_targets
8673 Deprecated. Use the install(TARGETS ) command instead.
8674
8675 This command has been superceded by the install command. It is
8676 provided for compatibility with older CMake code.
8677
8678
8679 install_targets(<dir> [RUNTIME_DIRECTORY dir] target target)
8680
8681 Create rules to install the listed targets into the given direc‐
8682 tory. The directory <dir> is relative to the installation pre‐
8683 fix, which is stored in the variable CMAKE_INSTALL_PREFIX. If
8684 RUNTIME_DIRECTORY is specified, then on systems with special
8685 runtime files (Windows DLL), the files will be copied to that
8686 directory.
8687
8688
8689 link_libraries
8690 Deprecated. Use the target_link_libraries() command instead.
8691
8692 Link libraries to all targets added later.
8693
8694
8695 link_libraries(library1 <debug | optimized> library2 ...)
8696
8697 Specify a list of libraries to be linked into any following tar‐
8698 gets (typically added with the add_executable or add_library
8699 calls). This command is passed down to all subdirectories. The
8700 debug and optimized strings may be used to indicate that the
8701 next library listed is to be used only for that specific type of
8702 build.
8703
8704
8705 make_directory
8706 Deprecated. Use the file(MAKE_DIRECTORY ) command instead.
8707
8708 make_directory(directory)
8709
8710 Creates the specified directory. Full paths should be given.
8711 Any parent directories that do not exist will also be created.
8712 Use with care.
8713
8714
8715 output_required_files
8716 Deprecated. Approximate C preprocessor dependency scanning.
8717
8718 This command exists only because ancient CMake versions provided
8719 it. CMake handles preprocessor dependency scanning automati‐
8720 cally using a more advanced scanner.
8721
8722
8723 output_required_files(srcfile outputfile)
8724
8725 Outputs a list of all the source files that are required by the
8726 specified srcfile. This list is written into outputfile. This is
8727 similar to writing out the dependencies for srcfile except that
8728 it jumps from .h files into .cxx, .c and .cpp files if possible.
8729
8730
8731 remove Deprecated. Use the list(REMOVE_ITEM ) command instead.
8732
8733 remove(VAR VALUE VALUE ...)
8734
8735 Removes VALUE from the variable VAR. This is typically used to
8736 remove entries from a vector (e.g. semicolon separated list).
8737 VALUE is expanded.
8738
8739
8740 subdir_depends
8741 Deprecated. Does nothing.
8742
8743 subdir_depends(subdir dep1 dep2 ...)
8744
8745 Does not do anything. This command used to help projects order
8746 parallel builds correctly. This functionality is now automatic.
8747
8748
8749 subdirs
8750 Deprecated. Use the add_subdirectory() command instead.
8751
8752 Add a list of subdirectories to the build.
8753
8754
8755 subdirs(dir1 dir2 ...[EXCLUDE_FROM_ALL exclude_dir1 exclude_dir2 ...]
8756 [PREORDER] )
8757
8758 Add a list of subdirectories to the build. The add_subdirectory
8759 command should be used instead of subdirs although subdirs will
8760 still work. This will cause any CMakeLists.txt files in the sub
8761 directories to be processed by CMake. Any directories after the
8762 PREORDER flag are traversed first by makefile builds, the PRE‐
8763 ORDER flag has no effect on IDE projects. Any directories after
8764 the EXCLUDE_FROM_ALL marker will not be included in the top
8765 level makefile or project file. This is useful for having CMake
8766 create makefiles or projects for a set of examples in a project.
8767 You would want CMake to generate makefiles or project files for
8768 all the examples at the same time, but you would not want them
8769 to show up in the top level project or be built each time make
8770 is run from the top.
8771
8772
8773 use_mangled_mesa
8774 Copy mesa headers for use in combination with system GL.
8775
8776 use_mangled_mesa(PATH_TO_MESA OUTPUT_DIRECTORY)
8777
8778 The path to mesa includes, should contain gl_mangle.h. The mesa
8779 headers are copied to the specified output directory. This
8780 allows mangled mesa headers to override other GL headers by
8781 being added to the include directory path earlier.
8782
8783
8784 utility_source
8785 Specify the source tree of a third-party utility.
8786
8787 utility_source(cache_entry executable_name
8788 path_to_source [file1 file2 ...])
8789
8790 When a third-party utility's source is included in the distribu‐
8791 tion, this command specifies its location and name. The cache
8792 entry will not be set unless the path_to_source and all listed
8793 files exist. It is assumed that the source tree of the utility
8794 will have been built before it is needed.
8795
8796
8797 When cross compiling CMake will print a warning if a util‐
8798 ity_source() command is executed, because in many cases it is
8799 used to build an executable which is executed later on. This
8800 doesn't work when cross compiling, since the executable can run
8801 only on their target platform. So in this case the cache entry
8802 has to be adjusted manually so it points to an executable which
8803 is runnable on the build host.
8804
8805
8806 variable_requires
8807 Deprecated. Use the if() command instead.
8808
8809 Assert satisfaction of an option's required variables.
8810
8811
8812 variable_requires(TEST_VARIABLE RESULT_VARIABLE
8813 REQUIRED_VARIABLE1
8814 REQUIRED_VARIABLE2 ...)
8815
8816 The first argument (TEST_VARIABLE) is the name of the variable
8817 to be tested, if that variable is false nothing else is done. If
8818 TEST_VARIABLE is true, then the next argument (RESULT_VARIABLE)
8819 is a variable that is set to true if all the required variables
8820 are set. The rest of the arguments are variables that must be
8821 true or not set to NOTFOUND to avoid an error. If any are not
8822 true, an error is reported.
8823
8824
8825 write_file
8826 Deprecated. Use the file(WRITE ) command instead.
8827
8828 write_file(filename "message to write"... [APPEND])
8829
8830 The first argument is the file name, the rest of the arguments
8831 are messages to write. If the argument APPEND is specified, then
8832 the message will be appended.
8833
8834
8835 NOTE 1: file(WRITE ... and file(APPEND ... do exactly the same
8836 as this one but add some more functionality.
8837
8838
8839 NOTE 2: When using write_file the produced file cannot be used
8840 as an input to CMake (CONFIGURE_FILE, source file ...) because
8841 it will lead to an infinite loop. Use configure_file if you want
8842 to generate input files to CMake.
8843
8844
8846 The following modules are provided with CMake. They can be used with
8847 INCLUDE(ModuleName).
8848
8849
8850 CMake Modules - Modules coming with CMake, the Cross-Platform Makefile Generator.
8851
8852
8853 This is the documentation for the modules and scripts coming with
8854 CMake. Using these modules you can check the computer system for
8855 installed software packages, features of the compiler and the existence
8856 of headers to name just a few.
8857
8858
8859 AddFileDependencies
8860 ADD_FILE_DEPENDENCIES(source_file depend_files...)
8861
8862 Adds the given files as dependencies to source_file
8863
8864
8865
8866 BundleUtilities
8867 Functions to help assemble a standalone bundle application.
8868
8869 A collection of CMake utility functions useful for dealing with
8870 .app bundles on the Mac and bundle-like directories on any OS.
8871
8872
8873 The following functions are provided by this module:
8874
8875
8876 fixup_bundle
8877 copy_and_fixup_bundle
8878 verify_app
8879 get_bundle_main_executable
8880 get_dotapp_dir
8881 get_bundle_and_executable
8882 get_bundle_all_executables
8883 get_item_key
8884 clear_bundle_keys
8885 set_bundle_key_values
8886 get_bundle_keys
8887 copy_resolved_item_into_bundle
8888 copy_resolved_framework_into_bundle
8889 fixup_bundle_item
8890 verify_bundle_prerequisites
8891 verify_bundle_symlinks
8892
8893 Requires CMake 2.6 or greater because it uses function, break
8894 and PARENT_SCOPE. Also depends on GetPrerequisites.cmake.
8895
8896
8897 FIXUP_BUNDLE(<app> <libs> <dirs>)
8898
8899 Fix up a bundle in-place and make it standalone, such that it
8900 can be drag-n-drop copied to another machine and run on that
8901 machine as long as all of the system libraries are compatible.
8902
8903
8904 If you pass plugins to fixup_bundle as the libs parameter, you
8905 should install them or copy them into the bundle before calling
8906 fixup_bundle. The "libs" parameter is a list of libraries that
8907 must be fixed up, but that cannot be determined by otool output
8908 analysis. (i.e., plugins)
8909
8910
8911 Gather all the keys for all the executables and libraries in a
8912 bundle, and then, for each key, copy each prerequisite into the
8913 bundle. Then fix each one up according to its own list of pre‐
8914 requisites.
8915
8916
8917 Then clear all the keys and call verify_app on the final bundle
8918 to ensure that it is truly standalone.
8919
8920
8921 COPY_AND_FIXUP_BUNDLE(<src> <dst> <libs> <dirs>)
8922
8923 Makes a copy of the bundle <src> at location <dst> and then
8924 fixes up the new copied bundle in-place at <dst>...
8925
8926
8927 VERIFY_APP(<app>)
8928
8929 Verifies that an application <app> appears valid based on run‐
8930 ning analysis tools on it. Calls "message(FATAL_ERROR" if the
8931 application is not verified.
8932
8933
8934 GET_BUNDLE_MAIN_EXECUTABLE(<bundle> <result_var>)
8935
8936 The result will be the full path name of the bundle's main exe‐
8937 cutable file or an "error:" prefixed string if it could not be
8938 determined.
8939
8940
8941 GET_DOTAPP_DIR(<exe> <dotapp_dir_var>)
8942
8943 Returns the nearest parent dir whose name ends with ".app" given
8944 the full path to an executable. If there is no such parent dir,
8945 then simply return the dir containing the executable.
8946
8947
8948 The returned directory may or may not exist.
8949
8950
8951 GET_BUNDLE_AND_EXECUTABLE(<app> <bundle_var> <executable_var> <valid_var>)
8952
8953 Takes either a ".app" directory name or the name of an exe‐
8954 cutable nested inside a ".app" directory and returns the path to
8955 the ".app" directory in <bundle_var> and the path to its main
8956 executable in <executable_var>
8957
8958
8959 GET_BUNDLE_ALL_EXECUTABLES(<bundle> <exes_var>)
8960
8961 Scans the given bundle recursively for all executable files and
8962 accumulates them into a variable.
8963
8964
8965 GET_ITEM_KEY(<item> <key_var>)
8966
8967 Given a file (item) name, generate a key that should be unique
8968 considering the set of libraries that need copying or fixing up
8969 to make a bundle standalone. This is essentially the file name
8970 including extension with "." replaced by "_"
8971
8972
8973 This key is used as a prefix for CMake variables so that we can
8974 associate a set of variables with a given item based on its key.
8975
8976
8977 CLEAR_BUNDLE_KEYS(<keys_var>)
8978
8979 Loop over the list of keys, clearing all the variables associ‐
8980 ated with each key. After the loop, clear the list of keys
8981 itself.
8982
8983
8984 Caller of get_bundle_keys should call clear_bundle_keys when
8985 done with list of keys.
8986
8987
8988 SET_BUNDLE_KEY_VALUES(<keys_var> <context> <item> <exepath> <dirs>
8989 <copyflag>)
8990
8991 Add a key to the list (if necessary) for the given item. If
8992 added, also set all the variables associated with that key.
8993
8994
8995 GET_BUNDLE_KEYS(<app> <libs> <dirs> <keys_var>)
8996
8997 Loop over all the executable and library files within the bundle
8998 (and given as extra <libs>) and accumulate a list of keys repre‐
8999 senting them. Set values associated with each key such that we
9000 can loop over all of them and copy prerequisite libs into the
9001 bundle and then do appropriate install_name_tool fixups.
9002
9003
9004 COPY_RESOLVED_ITEM_INTO_BUNDLE(<resolved_item> <resolved_embedded_item>)
9005
9006 Copy a resolved item into the bundle if necessary. Copy is not
9007 necessary if the resolved_item is "the same as" the
9008 resolved_embedded_item.
9009
9010
9011 COPY_RESOLVED_FRAMEWORK_INTO_BUNDLE(<resolved_item> <resolved_embedded_item>)
9012
9013 Copy a resolved framework into the bundle if necessary. Copy is
9014 not necessary if the resolved_item is "the same as" the
9015 resolved_embedded_item.
9016
9017
9018 By default, BU_COPY_FULL_FRAMEWORK_CONTENTS is not set. If you
9019 want full frameworks embedded in your bundles, set
9020 BU_COPY_FULL_FRAMEWORK_CONTENTS to ON before calling fixup_bun‐
9021 dle. By default, COPY_RESOLVED_FRAMEWORK_INTO_BUNDLE copies the
9022 framework dylib itself plus the framework Resources directory.
9023
9024
9025 FIXUP_BUNDLE_ITEM(<resolved_embedded_item> <exepath> <dirs>)
9026
9027 Get the direct/non-system prerequisites of the resolved embedded
9028 item. For each prerequisite, change the way it is referenced to
9029 the value of the _EMBEDDED_ITEM keyed variable for that prereq‐
9030 uisite. (Most likely changing to an "@executable_path" style
9031 reference.)
9032
9033
9034 This function requires that the resolved_embedded_item be
9035 "inside" the bundle already. In other words, if you pass plugins
9036 to fixup_bundle as the libs parameter, you should install them
9037 or copy them into the bundle before calling fixup_bundle. The
9038 "libs" parameter is a list of libraries that must be fixed up,
9039 but that cannot be determined by otool output analysis. (i.e.,
9040 plugins)
9041
9042
9043 Also, change the id of the item being fixed up to its own
9044 _EMBEDDED_ITEM value.
9045
9046
9047 Accumulate changes in a local variable and make *one* call to
9048 install_name_tool at the end of the function with all the
9049 changes at once.
9050
9051
9052 If the BU_CHMOD_BUNDLE_ITEMS variable is set then bundle items
9053 will be marked writable before install_name_tool tries to change
9054 them.
9055
9056
9057 VERIFY_BUNDLE_PREREQUISITES(<bundle> <result_var> <info_var>)
9058
9059 Verifies that the sum of all prerequisites of all files inside
9060 the bundle are contained within the bundle or are "system"
9061 libraries, presumed to exist everywhere.
9062
9063
9064 VERIFY_BUNDLE_SYMLINKS(<bundle> <result_var> <info_var>)
9065
9066 Verifies that any symlinks found in the bundle point to other
9067 files that are already also in the bundle... Anything that
9068 points to an external file causes this function to fail the ver‐
9069 ification.
9070
9071
9072 CMakeAddFortranSubdirectory
9073 Use MinGW gfortran from VS if a fortran compiler is not found.
9074
9075 The 'add_fortran_subdirectory' function adds a subdirectory to a
9076 project that contains a fortran only sub-project. The module
9077 will check the current compiler and see if it can support for‐
9078 tran. If no fortran compiler is found and the compiler is MSVC,
9079 then this module will find the MinGW gfortran. It will then use
9080 an external project to build with the MinGW tools. It will also
9081 create imported targets for the libraries created. This will
9082 only work if the fortran code is built into a dll, so
9083 BUILD_SHARED_LIBS is turned on in the project. In addition the
9084 CMAKE_GNUtoMS option is set to on, so that the MS .lib files are
9085 created. Usage is as follows:
9086
9087
9088 cmake_add_fortran_subdirectory(
9089 <subdir> # name of subdirectory
9090 PROJECT <project_name> # project name in subdir top CMakeLists.txt
9091 ARCHIVE_DIR <dir> # dir where project places .lib files
9092 RUNTIME_DIR <dir> # dir where project places .dll files
9093 LIBRARIES <lib>... # names of library targets to import
9094 LINK_LIBRARIES # link interface libraries for LIBRARIES
9095 [LINK_LIBS <lib> <dep>...]...
9096 CMAKE_COMMAND_LINE ... # extra command line flags to pass to cmake
9097 NO_EXTERNAL_INSTALL # skip installation of external project
9098 )
9099
9100 Relative paths in ARCHIVE_DIR and RUNTIME_DIR are interpreted
9101 with respect to the build directory corresponding to the source
9102 directory in which the function is invoked.
9103
9104
9105 Limitations:
9106
9107
9108 NO_EXTERNAL_INSTALL is required for forward compatibility with a
9109 future version that supports installation of the external
9110 project binaries during "make install".
9111
9112
9113 CMakeBackwardCompatibilityCXX
9114 define a bunch of backwards compatibility variables
9115
9116 CMAKE_ANSI_CXXFLAGS - flag for ansi c++
9117 CMAKE_HAS_ANSI_STRING_STREAM - has <strstream>
9118 include(TestForANSIStreamHeaders)
9119 include(CheckIncludeFileCXX)
9120 include(TestForSTDNamespace)
9121 include(TestForANSIForScope)
9122
9123
9124 CMakeDependentOption
9125 Macro to provide an option dependent on other options.
9126
9127 This macro presents an option to the user only if a set of other
9128 conditions are true. When the option is not presented a default
9129 value is used, but any value set by the user is preserved for
9130 when the option is presented again. Example invocation:
9131
9132
9133 CMAKE_DEPENDENT_OPTION(USE_FOO "Use Foo" ON
9134 "USE_BAR;NOT USE_ZOT" OFF)
9135
9136 If USE_BAR is true and USE_ZOT is false, this provides an option
9137 called USE_FOO that defaults to ON. Otherwise, it sets USE_FOO
9138 to OFF. If the status of USE_BAR or USE_ZOT ever changes, any
9139 value for the USE_FOO option is saved so that when the option is
9140 re-enabled it retains its old value.
9141
9142
9143 CMakeDetermineVSServicePack
9144 Determine the Visual Studio service pack of the 'cl' in use.
9145
9146 The functionality of this module has been superseded by the
9147 platform variable CMAKE_<LANG>_COMPILER_VERSION that contains
9148 the compiler version number.
9149
9150
9151 Usage:
9152
9153
9154 if(MSVC)
9155 include(CMakeDetermineVSServicePack)
9156 DetermineVSServicePack( my_service_pack )
9157 if( my_service_pack )
9158 message(STATUS "Detected: ${my_service_pack}")
9159 endif()
9160 endif()
9161
9162 Function DetermineVSServicePack sets the given variable to one
9163 of the following values or an empty string if unknown:
9164
9165
9166 vc80, vc80sp1
9167 vc90, vc90sp1
9168 vc100, vc100sp1
9169 vc110, vc110sp1, vc110sp2
9170
9171
9172 CMakeExpandImportedTargets
9173
9174
9175 CMAKE_EXPAND_IMPORTED_TARGETS(<var> LIBRARIES lib1 lib2...libN
9176
9177
9178 [CONFIGURATION <config>] )
9179
9180
9181
9182
9183 CMAKE_EXPAND_IMPORTED_TARGETS() takes a list of libraries and
9184 replaces all imported targets contained in this list with their
9185 actual file paths of the referenced libraries on disk, including
9186 the libraries from their link interfaces. If a CONFIGURATION is
9187 given, it uses the respective configuration of the imported tar‐
9188 gets if it exists. If no CONFIGURATION is given, it uses the
9189 first configuration from ${CMAKE_CONFIGURATION_TYPES} if set,
9190 otherwise ${CMAKE_BUILD_TYPE}. This macro is used by all
9191 Check*.cmake files which use try_compile() or try_run() and sup‐
9192 port CMAKE_REQUIRED_LIBRARIES , so that these checks support
9193 imported targets in CMAKE_REQUIRED_LIBRARIES:
9194
9195
9196 cmake_expand_imported_targets(expandedLibs LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
9197 CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}" )
9198
9199
9200 CMakeFindFrameworks
9201 helper module to find OSX frameworks
9202
9203
9204 CMakeFindPackageMode
9205
9206
9207 This file is executed by cmake when invoked with --find-package.
9208 It expects that the following variables are set using -D:
9209
9210
9211 NAME = name of the package
9212 COMPILER_ID = the CMake compiler ID for which the result is, i.e. GNU/Intel/Clang/MSVC, etc.
9213 LANGUAGE = language for which the result will be used, i.e. C/CXX/Fortan/ASM
9214 MODE = EXIST : only check for existence of the given package
9215 COMPILE : print the flags needed for compiling an object file which uses the given package
9216 LINK : print the flags needed for linking when using the given package
9217 QUIET = if TRUE, don't print anything
9218
9219
9220 CMakeForceCompiler
9221
9222
9223 This module defines macros intended for use by cross-compiling
9224 toolchain files when CMake is not able to automatically detect
9225 the compiler identification.
9226
9227
9228 Macro CMAKE_FORCE_C_COMPILER has the following signature:
9229
9230
9231 CMAKE_FORCE_C_COMPILER(<compiler> <compiler-id>)
9232
9233 It sets CMAKE_C_COMPILER to the given compiler and the cmake
9234 internal variable CMAKE_C_COMPILER_ID to the given compiler-id.
9235 It also bypasses the check for working compiler and basic com‐
9236 piler information tests.
9237
9238
9239 Macro CMAKE_FORCE_CXX_COMPILER has the following signature:
9240
9241
9242 CMAKE_FORCE_CXX_COMPILER(<compiler> <compiler-id>)
9243
9244 It sets CMAKE_CXX_COMPILER to the given compiler and the cmake
9245 internal variable CMAKE_CXX_COMPILER_ID to the given com‐
9246 piler-id. It also bypasses the check for working compiler and
9247 basic compiler information tests.
9248
9249
9250 Macro CMAKE_FORCE_Fortran_COMPILER has the following signature:
9251
9252
9253 CMAKE_FORCE_Fortran_COMPILER(<compiler> <compiler-id>)
9254
9255 It sets CMAKE_Fortran_COMPILER to the given compiler and the
9256 cmake internal variable CMAKE_Fortran_COMPILER_ID to the given
9257 compiler-id. It also bypasses the check for working compiler and
9258 basic compiler information tests.
9259
9260
9261 So a simple toolchain file could look like this:
9262
9263
9264 include (CMakeForceCompiler)
9265 set(CMAKE_SYSTEM_NAME Generic)
9266 CMAKE_FORCE_C_COMPILER (chc12 MetrowerksHicross)
9267 CMAKE_FORCE_CXX_COMPILER (chc12 MetrowerksHicross)
9268
9269
9270 CMakeGraphVizOptions
9271 The builtin graphviz support of CMake.
9272
9273 CMake can generate graphviz files, showing the dependencies
9274 between the targets in a project and also external libraries
9275 which are linked against. When CMake is run with the --gra‐
9276 phiz=foo option, it will produce
9277
9278
9279 * a foo.dot file showing all dependencies in the project
9280 * a foo.dot.<target> file for each target, file showing on which other targets the respective target depends
9281 * a foo.dot.<target>.dependers file, showing which other targets depend on the respective target
9282
9283
9284
9285
9286 This can result in huge graphs. Using the file CMakeGraphVizOp‐
9287 tions.cmake the look and content of the generated graphs can be
9288 influenced. This file is searched first in ${CMAKE_BINARY_DIR}
9289 and then in ${CMAKE_SOURCE_DIR}. If found, it is read and the
9290 variables set in it are used to adjust options for the generated
9291 graphviz files.
9292
9293
9294 GRAPHVIZ_GRAPH_TYPE - The graph type
9295 Mandatory : NO
9296 Default : "digraph"
9297 GRAPHVIZ_GRAPH_NAME - The graph name.
9298 Mandatory : NO
9299 Default : "GG"
9300 GRAPHVIZ_GRAPH_HEADER - The header written at the top of the graphviz file.
9301 Mandatory : NO
9302 Default : "node [n fontsize = "12"];"
9303 GRAPHVIZ_NODE_PREFIX - The prefix for each node in the graphviz file.
9304 Mandatory : NO
9305 Default : "node"
9306 GRAPHVIZ_EXECUTABLES - Set this to FALSE to exclude executables from the generated graphs.
9307 Mandatory : NO
9308 Default : TRUE
9309 GRAPHVIZ_STATIC_LIBS - Set this to FALSE to exclude static libraries from the generated graphs.
9310 Mandatory : NO
9311 Default : TRUE
9312 GRAPHVIZ_SHARED_LIBS - Set this to FALSE to exclude shared libraries from the generated graphs.
9313 Mandatory : NO
9314 Default : TRUE
9315 GRAPHVIZ_MODULE_LIBS - Set this to FALSE to exclude static libraries from the generated graphs.
9316 Mandatory : NO
9317 Default : TRUE
9318 GRAPHVIZ_EXTERNAL_LIBS - Set this to FALSE to exclude external libraries from the generated graphs.
9319 Mandatory : NO
9320 Default : TRUE
9321 GRAPHVIZ_IGNORE_TARGETS - A list of regular expressions for ignoring targets.
9322 Mandatory : NO
9323 Default : empty
9324
9325
9326 CMakePackageConfigHelpers
9327 CONFIGURE_PACKAGE_CONFIG_FILE(), WRITE_BASIC_PACKAGE_VER‐
9328 SION_FILE()
9329
9330
9331
9332
9333 CONFIGURE_PACKAGE_CONFIG_FILE(<input> <output> INSTALL_DESTINATION <path>
9334 [PATH_VARS <var1> <var2> ... <varN>]
9335 [NO_SET_AND_CHECK_MACRO]
9336 [NO_CHECK_REQUIRED_COMPONENTS_MACRO])
9337
9338
9339
9340
9341 CONFIGURE_PACKAGE_CONFIG_FILE() should be used instead of the
9342 plain configure_file() command when creating the <Name>Con‐
9343 fig.cmake or <Name>-config.cmake file for installing a project
9344 or library. It helps making the resulting package relocatable by
9345 avoiding hardcoded paths in the installed Config.cmake file.
9346
9347
9348 In a FooConfig.cmake file there may be code like this to make
9349 the install destinations know to the using project:
9350
9351
9352 set(FOO_INCLUDE_DIR "@CMAKE_INSTALL_FULL_INCLUDEDIR@" )
9353 set(FOO_DATA_DIR "@CMAKE_INSTALL_PREFIX@/@RELATIVE_DATA_INSTALL_DIR@" )
9354 set(FOO_ICONS_DIR "@CMAKE_INSTALL_PREFIX@/share/icons" )
9355 ...logic to determine installedPrefix from the own location...
9356 set(FOO_CONFIG_DIR "${installedPrefix}/@CONFIG_INSTALL_DIR@" )
9357
9358 All 4 options shown above are not sufficient, since the first 3
9359 hardcode the absolute directory locations, and the 4th case
9360 works only if the logic to determine the installedPrefix is cor‐
9361 rect, and if CONFIG_INSTALL_DIR contains a relative path, which
9362 in general cannot be guaranteed. This has the effect that the
9363 resulting FooConfig.cmake file would work poorly under Windows
9364 and OSX, where users are used to choose the install location of
9365 a binary package at install time, independent from how
9366 CMAKE_INSTALL_PREFIX was set at build/cmake time.
9367
9368
9369 Using CONFIGURE_PACKAGE_CONFIG_FILE() helps. If used correctly,
9370 it makes the resulting FooConfig.cmake file relocatable. Usage:
9371
9372
9373 1. write a FooConfig.cmake.in file as you are used to
9374 2. insert a line containing only the string "@PACKAGE_INIT@"
9375 3. instead of set(FOO_DIR "@SOME_INSTALL_DIR@"), use set(FOO_DIR "@PACKAGE_SOME_INSTALL_DIR@")
9376 (this must be after the @PACKAGE_INIT@ line)
9377 4. instead of using the normal configure_file(), use CONFIGURE_PACKAGE_CONFIG_FILE()
9378
9379
9380
9381
9382 The <input> and <output> arguments are the input and output
9383 file, the same way as in configure_file().
9384
9385
9386 The <path> given to INSTALL_DESTINATION must be the destination
9387 where the FooConfig.cmake file will be installed to. This can
9388 either be a relative or absolute path, both work.
9389
9390
9391 The variables <var1> to <varN> given as PATH_VARS are the vari‐
9392 ables which contain install destinations. For each of them the
9393 macro will create a helper variable PACKAGE_<var...>. These
9394 helper variables must be used in the FooConfig.cmake.in file for
9395 setting the installed location. They are calculated by CONFIG‐
9396 URE_PACKAGE_CONFIG_FILE() so that they are always relative to
9397 the installed location of the package. This works both for rela‐
9398 tive and also for absolute locations. For absolute locations it
9399 works only if the absolute location is a subdirectory of
9400 CMAKE_INSTALL_PREFIX.
9401
9402
9403 By default configure_package_config_file() also generates two
9404 helper macros, set_and_check() and check_required_components()
9405 into the FooConfig.cmake file.
9406
9407
9408 set_and_check() should be used instead of the normal set() com‐
9409 mand for setting directories and file locations. Additionally to
9410 setting the variable it also checks that the referenced file or
9411 directory actually exists and fails with a FATAL_ERROR other‐
9412 wise. This makes sure that the created FooConfig.cmake file does
9413 not contain wrong references. When using the
9414 NO_SET_AND_CHECK_MACRO, this macro is not generated into the
9415 FooConfig.cmake file.
9416
9417
9418 check_required_components(<package_name>) should be called at
9419 the end of the FooConfig.cmake file if the package supports com‐
9420 ponents. This macro checks whether all requested, non-optional
9421 components have been found, and if this is not the case, sets
9422 the Foo_FOUND variable to FALSE, so that the package is consid‐
9423 ered to be not found. It does that by testing the Foo_<Compo‐
9424 nent>_FOUND variables for all requested required components.
9425 When using the NO_CHECK_REQUIRED_COMPONENTS option, this macro
9426 is not generated into the FooConfig.cmake file.
9427
9428
9429 For an example see below the documentation for WRITE_BASIC_PACK‐
9430 AGE_VERSION_FILE().
9431
9432
9433
9434
9435
9436 WRITE_BASIC_PACKAGE_VERSION_FILE( filename VERSION major.minor.patch COMPATIBILITY (AnyNewerVersion|SameMajorVersion|ExactVersion) )
9437
9438
9439
9440
9441 Writes a file for use as <package>ConfigVersion.cmake file to
9442 <filename>. See the documentation of find_package() for details
9443 on this.
9444
9445
9446 filename is the output filename, it should be in the build tree.
9447 major.minor.patch is the version number of the project to be installed
9448
9449 The COMPATIBILITY mode AnyNewerVersion means that the installed
9450 package version will be considered compatible if it is newer or
9451 exactly the same as the requested version. This mode should be
9452 used for packages which are fully backward compatible, also
9453 across major versions. If SameMajorVersion is used instead, then
9454 the behaviour differs from AnyNewerVersion in that the major
9455 version number must be the same as requested, e.g. version 2.0
9456 will not be considered compatible if 1.0 is requested. This mode
9457 should be used for packages which guarantee backward compatibil‐
9458 ity within the same major version. If ExactVersion is used, then
9459 the package is only considered compatible if the requested ver‐
9460 sion matches exactly its own version number (not considering the
9461 tweak version). For example, version 1.2.3 of a package is only
9462 considered compatible to requested version 1.2.3. This mode is
9463 for packages without compatibility guarantees. If your project
9464 has more elaborated version matching rules, you will need to
9465 write your own custom ConfigVersion.cmake file instead of using
9466 this macro.
9467
9468
9469 Internally, this macro executes configure_file() to create the
9470 resulting version file. Depending on the COMPATIBLITY, either
9471 the file BasicConfigVersion-SameMajorVersion.cmake.in or Basic‐
9472 ConfigVersion-AnyNewerVersion.cmake.in is used. Please note that
9473 these two files are internal to CMake and you should not call
9474 configure_file() on them yourself, but they can be used as
9475 starting point to create more sophisticted custom ConfigVer‐
9476 sion.cmake files.
9477
9478
9479
9480
9481
9482 Example using both configure_package_config_file() and
9483 write_basic_package_version_file(): CMakeLists.txt:
9484
9485
9486 set(INCLUDE_INSTALL_DIR include/ ... CACHE )
9487 set(LIB_INSTALL_DIR lib/ ... CACHE )
9488 set(SYSCONFIG_INSTALL_DIR etc/foo/ ... CACHE )
9489 ...
9490 include(CMakePackageConfigHelpers)
9491 configure_package_config_file(FooConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake
9492 INSTALL_DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake
9493 PATH_VARS INCLUDE_INSTALL_DIR SYSCONFIG_INSTALL_DIR)
9494 write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
9495 VERSION 1.2.3
9496 COMPATIBILITY SameMajorVersion )
9497 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
9498 DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake )
9499
9500
9501
9502
9503 With a FooConfig.cmake.in:
9504
9505
9506 set(FOO_VERSION x.y.z)
9507 ...
9508 @PACKAGE_INIT@
9509 ...
9510 set_and_check(FOO_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
9511 set_and_check(FOO_SYSCONFIG_DIR "@PACKAGE_SYSCONFIG_INSTALL_DIR@")
9512
9513
9514
9515
9516 check_required_components(Foo)
9517
9518
9519 CMakeParseArguments
9520
9521
9522 CMAKE_PARSE_ARGUMENTS(<prefix> <options> <one_value_keywords>
9523 <multi_value_keywords> args...)
9524
9525
9526 CMAKE_PARSE_ARGUMENTS() is intended to be used in macros or
9527 functions for parsing the arguments given to that macro or func‐
9528 tion. It processes the arguments and defines a set of variables
9529 which hold the values of the respective options.
9530
9531
9532 The <options> argument contains all options for the respective
9533 macro, i.e. keywords which can be used when calling the macro
9534 without any value following, like e.g. the OPTIONAL keyword of
9535 the install() command.
9536
9537
9538 The <one_value_keywords> argument contains all keywords for this
9539 macro which are followed by one value, like e.g. DESTINATION
9540 keyword of the install() command.
9541
9542
9543 The <multi_value_keywords> argument contains all keywords for
9544 this macro which can be followed by more than one value, like
9545 e.g. the TARGETS or FILES keywords of the install() command.
9546
9547
9548 When done, CMAKE_PARSE_ARGUMENTS() will have defined for each of
9549 the keywords listed in <options>, <one_value_keywords> and
9550 <multi_value_keywords> a variable composed of the given <prefix>
9551 followed by "_" and the name of the respective keyword. These
9552 variables will then hold the respective value from the argument
9553 list. For the <options> keywords this will be TRUE or FALSE.
9554
9555
9556 All remaining arguments are collected in a variable <pre‐
9557 fix>_UNPARSED_ARGUMENTS, this can be checked afterwards to see
9558 whether your macro was called with unrecognized parameters.
9559
9560
9561 As an example here a my_install() macro, which takes similar
9562 arguments as the real install() command:
9563
9564
9565 function(MY_INSTALL)
9566 set(options OPTIONAL FAST)
9567 set(oneValueArgs DESTINATION RENAME)
9568 set(multiValueArgs TARGETS CONFIGURATIONS)
9569 cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
9570 ...
9571
9572
9573
9574
9575 Assume my_install() has been called like this:
9576
9577
9578 my_install(TARGETS foo bar DESTINATION bin OPTIONAL blub)
9579
9580
9581
9582
9583 After the cmake_parse_arguments() call the macro will have set
9584 the following variables:
9585
9586
9587 MY_INSTALL_OPTIONAL = TRUE
9588 MY_INSTALL_FAST = FALSE (this option was not used when calling my_install()
9589 MY_INSTALL_DESTINATION = "bin"
9590 MY_INSTALL_RENAME = "" (was not used)
9591 MY_INSTALL_TARGETS = "foo;bar"
9592 MY_INSTALL_CONFIGURATIONS = "" (was not used)
9593 MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (no value expected after "OPTIONAL"
9594
9595
9596
9597
9598 You can then continue and process these variables.
9599
9600
9601 Keywords terminate lists of values, e.g. if directly after a
9602 one_value_keyword another recognized keyword follows, this is
9603 interpreted as the beginning of the new option. E.g.
9604 my_install(TARGETS foo DESTINATION OPTIONAL) would result in
9605 MY_INSTALL_DESTINATION set to "OPTIONAL", but MY_INSTALL_DESTI‐
9606 NATION would be empty and MY_INSTALL_OPTIONAL would be set to
9607 TRUE therefor.
9608
9609
9610 CMakePrintHelpers
9611 Convenience macros for printing properties and variables, useful
9612 e.g. for debugging.
9613
9614
9615
9616
9617
9618
9619
9620 CMAKE_PRINT_PROPERTIES([TARGETS target1 .. targetN]
9621
9622
9623 [SOURCES source1 .. sourceN]
9624 [DIRECTORIES dir1 .. dirN]
9625 [TESTS test1 .. testN]
9626 [CACHE_ENTRIES entry1 .. entryN]
9627 PROPERTIES prop1 .. propN )
9628
9629
9630
9631
9632 This macro prints the values of the properties of the given tar‐
9633 gets, source files, directories, tests or cache entries. Exactly
9634 one of the scope keywords must be used. Example:
9635
9636
9637 cmake_print_properties(TARGETS foo bar PROPERTIES LOCATION INTERFACE_INCLUDE_DIRS)
9638
9639 This will print the LOCATION and INTERFACE_INCLUDE_DIRS proper‐
9640 ties for both targets foo and bar.
9641
9642
9643
9644
9645
9646 CMAKE_PRINT_VARIABLES(var1 var2 .. varN)
9647
9648
9649 This macro will print the name of each variable followed by its
9650 value. Example:
9651
9652
9653 cmake_print_variables(CMAKE_C_COMPILER CMAKE_MAJOR_VERSION THIS_ONE_DOES_NOT_EXIST)
9654
9655 Gives:
9656
9657
9658 -- CMAKE_C_COMPILER="/usr/bin/gcc" ; CMAKE_MAJOR_VERSION="2" ; THIS_ONE_DOES_NOT_EXIST=""
9659
9660
9661 CMakePrintSystemInformation
9662 print system information
9663
9664 This file can be used for diagnostic purposes just include it in
9665 a project to see various internal CMake variables.
9666
9667
9668 CMakePushCheckState
9669
9670
9671 This module defines three macros: CMAKE_PUSH_CHECK_STATE()
9672 CMAKE_POP_CHECK_STATE() and CMAKE_RESET_CHECK_STATE() These
9673 macros can be used to save, restore and reset (i.e., clear con‐
9674 tents) the state of the variables CMAKE_REQUIRED_FLAGS,
9675 CMAKE_REQUIRED_DEFINITIONS, CMAKE_REQUIRED_LIBRARIES and
9676 CMAKE_REQUIRED_INCLUDES used by the various Check-files coming
9677 with CMake, like e.g. check_function_exists() etc. The variable
9678 contents are pushed on a stack, pushing multiple times is sup‐
9679 ported. This is useful e.g. when executing such tests in a
9680 Find-module, where they have to be set, but after the Find-mod‐
9681 ule has been executed they should have the same value as they
9682 had before.
9683
9684
9685 CMAKE_PUSH_CHECK_STATE() macro receives optional argument RESET.
9686 Whether it's specified, CMAKE_PUSH_CHECK_STATE() will set all
9687 CMAKE_REQUIRED_* variables to empty values, same as
9688 CMAKE_RESET_CHECK_STATE() call will do.
9689
9690
9691 Usage:
9692
9693
9694 cmake_push_check_state(RESET)
9695 set(CMAKE_REQUIRED_DEFINITIONS -DSOME_MORE_DEF)
9696 check_function_exists(...)
9697 cmake_reset_check_state()
9698 set(CMAKE_REQUIRED_DEFINITIONS -DANOTHER_DEF)
9699 check_function_exists(...)
9700 cmake_pop_check_state()
9701
9702
9703 CMakeVerifyManifest
9704
9705
9706 CMakeVerifyManifest.cmake
9707
9708
9709 This script is used to verify that embeded manifests and side by
9710 side manifests for a project match. To run this script, cd to a
9711 directory and run the script with cmake -P. On the command line
9712 you can pass in versions that are OK even if not found in the
9713 .manifest files. For example, cmake -Dallow_versions=8.0.50608.0
9714 -PCmakeVerifyManifest.cmake could be used to allow an embeded
9715 manifest of 8.0.50608.0 to be used in a project even if that
9716 version was not found in the .manifest file.
9717
9718
9719 CPack Build binary and source package installers.
9720
9721 The CPack module generates binary and source installers in a
9722 variety of formats using the cpack program. Inclusion of the
9723 CPack module adds two new targets to the resulting makefiles,
9724 package and package_source, which build the binary and source
9725 installers, respectively. The generated binary installers con‐
9726 tain everything installed via CMake's INSTALL command (and the
9727 deprecated INSTALL_FILES, INSTALL_PROGRAMS, and INSTALL_TARGETS
9728 commands).
9729
9730
9731 For certain kinds of binary installers (including the graphical
9732 installers on Mac OS X and Windows), CPack generates installers
9733 that allow users to select individual application components to
9734 install. See CPackComponent module for that.
9735
9736
9737 The CPACK_GENERATOR variable has different meanings in different
9738 contexts. In your CMakeLists.txt file, CPACK_GENERATOR is a
9739 *list of generators*: when run with no other arguments, CPack
9740 will iterate over that list and produce one package for each
9741 generator. In a CPACK_PROJECT_CONFIG_FILE, though, CPACK_GENERA‐
9742 TOR is a *string naming a single generator*. If you need
9743 per-cpack- generator logic to control *other* cpack settings,
9744 then you need a CPACK_PROJECT_CONFIG_FILE.
9745
9746
9747 The CMake source tree itself contains a CPACK_PROJECT_CON‐
9748 FIG_FILE. See the top level file CMakeCPackOptions.cmake.in for
9749 an example.
9750
9751
9752 If set, the CPACK_PROJECT_CONFIG_FILE is included automatically
9753 on a per-generator basis. It only need contain overrides.
9754
9755
9756 Here's how it works:
9757
9758
9759 - cpack runs
9760 - it includes CPackConfig.cmake
9761 - it iterates over the generators listed in that file's
9762 CPACK_GENERATOR list variable (unless told to use just a
9763 specific one via -G on the command line...)
9764
9765
9766
9767
9768 - foreach generator, it then
9769 - sets CPACK_GENERATOR to the one currently being iterated
9770 - includes the CPACK_PROJECT_CONFIG_FILE
9771 - produces the package for that generator
9772
9773
9774
9775
9776 This is the key: For each generator listed in CPACK_GENERATOR in
9777 CPackConfig.cmake, cpack will *reset* CPACK_GENERATOR internally
9778 to *the one currently being used* and then include the
9779 CPACK_PROJECT_CONFIG_FILE.
9780
9781
9782 Before including this CPack module in your CMakeLists.txt file,
9783 there are a variety of variables that can be set to customize
9784 the resulting installers. The most commonly-used variables are:
9785
9786
9787 CPACK_PACKAGE_NAME - The name of the package (or application). If
9788 not specified, defaults to the project name.
9789
9790
9791
9792
9793 CPACK_PACKAGE_VENDOR - The name of the package vendor. (e.g.,
9794 "Kitware").
9795
9796
9797
9798
9799 CPACK_PACKAGE_DIRECTORY - The directory in which CPack is doing its
9800 packaging. If it is not set then this will default (internally) to the
9801 build dir. This variable may be defined in CPack config file or from
9802 the cpack command line option "-B". If set the command line option
9803 override the value found in the config file.
9804
9805
9806
9807
9808 CPACK_PACKAGE_VERSION_MAJOR - Package major Version
9809
9810
9811
9812
9813 CPACK_PACKAGE_VERSION_MINOR - Package minor Version
9814
9815
9816
9817
9818 CPACK_PACKAGE_VERSION_PATCH - Package patch Version
9819
9820
9821
9822
9823 CPACK_PACKAGE_DESCRIPTION_FILE - A text file used to describe the
9824 project. Used, for example, the introduction screen of a
9825 CPack-generated Windows installer to describe the project.
9826
9827
9828
9829
9830 CPACK_PACKAGE_DESCRIPTION_SUMMARY - Short description of the
9831 project (only a few words).
9832
9833
9834
9835
9836 CPACK_PACKAGE_FILE_NAME - The name of the package file to generate,
9837 not including the extension. For example, cmake-2.6.1-Linux-i686.
9838 The default value is
9839
9840
9841
9842
9843 ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}.
9844
9845
9846
9847
9848 CPACK_PACKAGE_INSTALL_DIRECTORY - Installation directory on the
9849 target system. This may be used by some CPack generators
9850 like NSIS to create an installation directory e.g., "CMake 2.5"
9851 below the installation prefix. All installed element will be
9852 put inside this directory.
9853
9854
9855
9856
9857 CPACK_PACKAGE_ICON - A branding image that will be displayed inside
9858 the installer (used by GUI installers).
9859
9860
9861
9862
9863 CPACK_PROJECT_CONFIG_FILE - CPack-time project CPack configuration
9864 file. This file included at cpack time, once per
9865 generator after CPack has set CPACK_GENERATOR to the actual generator
9866 being used. It allows per-generator setting of CPACK_* variables at
9867 cpack time.
9868
9869
9870
9871
9872 CPACK_RESOURCE_FILE_LICENSE - License to be embedded in the installer. It
9873 will typically be displayed to the user by the produced installer
9874 (often with an explicit "Accept" button, for graphical installers)
9875 prior to installation. This license file is NOT added to installed
9876 file but is used by some CPack generators like NSIS. If you want
9877 to install a license file (may be the same as this one)
9878 along with your project you must add an appropriate CMake INSTALL
9879 command in your CMakeLists.txt.
9880
9881
9882
9883
9884 CPACK_RESOURCE_FILE_README - ReadMe file to be embedded in the installer. It
9885 typically describes in some detail the purpose of the project
9886 during the installation. Not all CPack generators uses
9887 this file.
9888
9889
9890
9891
9892 CPACK_RESOURCE_FILE_WELCOME - Welcome file to be embedded in the
9893 installer. It welcomes users to this installer.
9894 Typically used in the graphical installers on Windows and Mac OS X.
9895
9896
9897
9898
9899 CPACK_MONOLITHIC_INSTALL - Disables the component-based
9900 installation mechanism. When set the component specification is ignored
9901 and all installed items are put in a single "MONOLITHIC" package.
9902 Some CPack generators do monolithic packaging by default and
9903 may be asked to do component packaging by setting
9904 CPACK_<GENNAME>_COMPONENT_INSTALL to 1/TRUE.
9905
9906
9907
9908
9909 CPACK_GENERATOR - List of CPack generators to use. If not
9910 specified, CPack will create a set of options CPACK_BINARY_<GENNAME> (e.g.,
9911 CPACK_BINARY_NSIS) allowing the user to enable/disable individual
9912 generators. This variable may be used on the command line
9913 as well as in:
9914
9915
9916
9917
9918 cpack -D CPACK_GENERATOR="ZIP;TGZ" /path/to/build/tree
9919
9920
9921
9922
9923 CPACK_OUTPUT_CONFIG_FILE - The name of the CPack binary configuration
9924 file. This file is the CPack configuration generated by the CPack module
9925 for binary installers. Defaults to CPackConfig.cmake.
9926
9927
9928
9929
9930 CPACK_PACKAGE_EXECUTABLES - Lists each of the executables and associated
9931 text label to be used to create Start Menu shortcuts. For example,
9932 setting this to the list ccmake;CMake will
9933 create a shortcut named "CMake" that will execute the installed
9934 executable ccmake. Not all CPack generators use it (at least NSIS and
9935 OSXX11 do).
9936
9937
9938
9939
9940 CPACK_STRIP_FILES - List of files to be stripped. Starting with
9941 CMake 2.6.0 CPACK_STRIP_FILES will be a boolean variable which
9942 enables stripping of all files (a list of files evaluates to TRUE
9943 in CMake, so this change is compatible).
9944
9945
9946
9947
9948 The following CPack variables are specific to source packages,
9949 and will not affect binary packages:
9950
9951
9952 CPACK_SOURCE_PACKAGE_FILE_NAME - The name of the source package. For
9953 example cmake-2.6.1.
9954
9955
9956
9957
9958 CPACK_SOURCE_STRIP_FILES - List of files in the source tree that
9959 will be stripped. Starting with CMake 2.6.0
9960 CPACK_SOURCE_STRIP_FILES will be a boolean variable which enables
9961 stripping of all files (a list of files evaluates to TRUE in CMake,
9962 so this change is compatible).
9963
9964
9965
9966
9967 CPACK_SOURCE_GENERATOR - List of generators used for the source
9968 packages. As with CPACK_GENERATOR, if this is not specified then
9969 CPack will create a set of options (e.g., CPACK_SOURCE_ZIP)
9970 allowing users to select which packages will be generated.
9971
9972
9973
9974
9975 CPACK_SOURCE_OUTPUT_CONFIG_FILE - The name of the CPack source
9976 configuration file. This file is the CPack configuration generated by the
9977 CPack module for source installers. Defaults to CPackSourceConfig.cmake.
9978
9979
9980
9981
9982 CPACK_SOURCE_IGNORE_FILES - Pattern of files in the source tree
9983 that won't be packaged when building a source package. This is a
9984 list of regular expression patterns (that must be properly escaped),
9985 e.g., /CVS/;/\\.svn/;\\.swp$;\\.#;/#;.*~;cscope.*
9986
9987
9988
9989
9990 The following variables are for advanced uses of CPack:
9991
9992
9993 CPACK_CMAKE_GENERATOR - What CMake generator should be used if the
9994 project is CMake project. Defaults to the value of CMAKE_GENERATOR
9995 few users will want to change this setting.
9996
9997
9998
9999
10000 CPACK_INSTALL_CMAKE_PROJECTS - List of four values that specify
10001 what project to install. The four values are: Build directory,
10002 Project Name, Project Component, Directory. If omitted, CPack will
10003 build an installer that installers everything.
10004
10005
10006
10007
10008 CPACK_SYSTEM_NAME - System name, defaults to the value of
10009 ${CMAKE_SYSTEM_NAME}.
10010
10011
10012
10013
10014 CPACK_PACKAGE_VERSION - Package full version, used internally. By
10015 default, this is built from CPACK_PACKAGE_VERSION_MAJOR,
10016 CPACK_PACKAGE_VERSION_MINOR, and CPACK_PACKAGE_VERSION_PATCH.
10017
10018
10019
10020
10021 CPACK_TOPLEVEL_TAG - Directory for the installed files.
10022
10023
10024
10025
10026 CPACK_INSTALL_COMMANDS - Extra commands to install components.
10027
10028
10029
10030
10031 CPACK_INSTALLED_DIRECTORIES - Extra directories to install.
10032
10033
10034
10035
10036 CPACK_PACKAGE_INSTALL_REGISTRY_KEY - Registry key used when
10037 installing this project. This is only used by installer for Windows.
10038 The default value is based on the installation directory.
10039 CPACK_CREATE_DESKTOP_LINKS - List of desktop links to create.
10040
10041
10042
10043
10044
10045 CPackBundle
10046 CPack Bundle generator (Mac OS X) specific options
10047
10048
10049
10050
10051 Installers built on Mac OS X using the Bundle generator use the
10052 aforementioned DragNDrop (CPACK_DMG_xxx) variables, plus the
10053 following Bundle-specific parameters (CPACK_BUNDLE_xxx).
10054
10055
10056 CPACK_BUNDLE_NAME - The name of the generated bundle. This
10057 appears in the OSX finder as the bundle name. Required.
10058
10059
10060
10061
10062 CPACK_BUNDLE_PLIST - Path to an OSX plist file that will be used
10063 for the generated bundle. This assumes that the caller has generated
10064 or specified their own Info.plist file. Required.
10065
10066
10067
10068
10069 CPACK_BUNDLE_ICON - Path to an OSX icon file that will be used as
10070 the icon for the generated bundle. This is the icon that appears in the
10071 OSX finder for the bundle, and in the OSX dock when the bundle is opened.
10072 Required.
10073
10074
10075
10076
10077 CPACK_BUNDLE_STARTUP_COMMAND - Path to a startup script. This is a path to
10078 an executable or script that will be run whenever an end-user double-clicks
10079 the generated bundle in the OSX Finder. Optional.
10080
10081
10082 CPackComponent
10083 Build binary and source package installers
10084
10085
10086
10087
10088 The CPackComponent module is the module which handles the compo‐
10089 nent part of CPack. See CPack module for general information
10090 about CPack.
10091
10092
10093 For certain kinds of binary installers (including the graphical
10094 installers on Mac OS X and Windows), CPack generates installers
10095 that allow users to select individual application components to
10096 install. The contents of each of the components are identified
10097 by the COMPONENT argument of CMake's INSTALL command. These com‐
10098 ponents can be annotated with user-friendly names and descrip‐
10099 tions, inter-component dependencies, etc., and grouped in vari‐
10100 ous ways to customize the resulting installer. See the
10101 cpack_add_* commands, described below, for more information
10102 about component-specific installations.
10103
10104
10105 Component-specific installation allows users to select specific
10106 sets of components to install during the install process.
10107 Installation components are identified by the COMPONENT argument
10108 of CMake's INSTALL commands, and should be further described by
10109 the following CPack commands:
10110
10111
10112 CPACK_COMPONENTS_ALL - The list of component to install.
10113
10114
10115
10116
10117 The default value of this variable is computed by CPack and con‐
10118 tains all components defined by the project. The user may set it
10119 to only include the specified components.
10120
10121
10122 CPACK_<GENNAME>_COMPONENT_INSTALL - Enable/Disable component install for
10123 CPack generator <GENNAME>.
10124
10125
10126
10127
10128 Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has
10129 a legacy default behavior. e.g. RPM builds monolithic whereas
10130 NSIS builds component. One can change the default behavior by
10131 setting this variable to 0/1 or OFF/ON.
10132
10133
10134 CPACK_COMPONENTS_GROUPING - Specify how components are grouped for multi-package
10135 component-aware CPack generators.
10136
10137
10138
10139
10140 Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) gen‐
10141 erates several packages files when asked for component packag‐
10142 ing. They group the component differently depending on the value
10143 of this variable:
10144
10145
10146 - ONE_PER_GROUP (default): creates one package file per component group
10147 - ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component
10148 - IGNORE : creates one package per component, i.e. IGNORE component group
10149
10150 One can specify different grouping for different CPack generator
10151 by using a CPACK_PROJECT_CONFIG_FILE.
10152
10153
10154 CPACK_COMPONENT_<compName>_DISPLAY_NAME - The name to be displayed for a component.
10155 CPACK_COMPONENT_<compName>_DESCRIPTION - The description of a component.
10156 CPACK_COMPONENT_<compName>_GROUP - The group of a component.
10157 CPACK_COMPONENT_<compName>_DEPENDS - The dependencies (list of components)
10158 on which this component depends.
10159 CPACK_COMPONENT_<compName>_REQUIRED - True is this component is required.
10160
10161 cpack_add_component - Describes a CPack installation component
10162 named by the COMPONENT argument to a CMake INSTALL command.
10163
10164
10165 cpack_add_component(compname
10166 [DISPLAY_NAME name]
10167 [DESCRIPTION description]
10168 [HIDDEN | REQUIRED | DISABLED ]
10169 [GROUP group]
10170 [DEPENDS comp1 comp2 ... ]
10171 [INSTALL_TYPES type1 type2 ... ]
10172 [DOWNLOADED]
10173 [ARCHIVE_FILE filename])
10174
10175
10176
10177
10178 The cmake_add_component command describes an installation compo‐
10179 nent, which the user can opt to install or remove as part of the
10180 graphical installation process. compname is the name of the com‐
10181 ponent, as provided to the COMPONENT argument of one or more
10182 CMake INSTALL commands.
10183
10184
10185 DISPLAY_NAME is the displayed name of the component, used in
10186 graphical installers to display the component name. This value
10187 can be any string.
10188
10189
10190 DESCRIPTION is an extended description of the component, used in
10191 graphical installers to give the user additional information
10192 about the component. Descriptions can span multiple lines using
10193 "\n" as the line separator. Typically, these descriptions should
10194 be no more than a few lines long.
10195
10196
10197 HIDDEN indicates that this component will be hidden in the
10198 graphical installer, so that the user cannot directly change
10199 whether it is installed or not.
10200
10201
10202 REQUIRED indicates that this component is required, and there‐
10203 fore will always be installed. It will be visible in the graphi‐
10204 cal installer, but it cannot be unselected. (Typically, required
10205 components are shown greyed out).
10206
10207
10208 DISABLED indicates that this component should be disabled (unse‐
10209 lected) by default. The user is free to select this component
10210 for installation, unless it is also HIDDEN.
10211
10212
10213 DEPENDS lists the components on which this component depends. If
10214 this component is selected, then each of the components listed
10215 must also be selected. The dependency information is encoded
10216 within the installer itself, so that users cannot install incon‐
10217 sistent sets of components.
10218
10219
10220 GROUP names the component group of which this component is a
10221 part. If not provided, the component will be a standalone compo‐
10222 nent, not part of any component group. Component groups are
10223 described with the cpack_add_component_group command, detailed
10224 below.
10225
10226
10227 INSTALL_TYPES lists the installation types of which this compo‐
10228 nent is a part. When one of these installations types is
10229 selected, this component will automatically be selected. Instal‐
10230 lation types are described with the cpack_add_install_type com‐
10231 mand, detailed below.
10232
10233
10234 DOWNLOADED indicates that this component should be downloaded
10235 on-the-fly by the installer, rather than packaged in with the
10236 installer itself. For more information, see the cpack_config‐
10237 ure_downloads command.
10238
10239
10240 ARCHIVE_FILE provides a name for the archive file created by
10241 CPack to be used for downloaded components. If not supplied,
10242 CPack will create a file with some name based on CPACK_PACK‐
10243 AGE_FILE_NAME and the name of the component. See cpack_config‐
10244 ure_downloads for more information.
10245
10246
10247 cpack_add_component_group - Describes a group of related CPack
10248 installation components.
10249
10250
10251 cpack_add_component_group(groupname
10252 [DISPLAY_NAME name]
10253 [DESCRIPTION description]
10254 [PARENT_GROUP parent]
10255 [EXPANDED]
10256 [BOLD_TITLE])
10257
10258
10259
10260
10261 The cpack_add_component_group describes a group of installation
10262 components, which will be placed together within the listing of
10263 options. Typically, component groups allow the user to
10264 select/deselect all of the components within a single group via
10265 a single group-level option. Use component groups to reduce the
10266 complexity of installers with many options. groupname is an
10267 arbitrary name used to identify the group in the GROUP argument
10268 of the cpack_add_component command, which is used to place a
10269 component in a group. The name of the group must not conflict
10270 with the name of any component.
10271
10272
10273 DISPLAY_NAME is the displayed name of the component group, used
10274 in graphical installers to display the component group name.
10275 This value can be any string.
10276
10277
10278 DESCRIPTION is an extended description of the component group,
10279 used in graphical installers to give the user additional infor‐
10280 mation about the components within that group. Descriptions can
10281 span multiple lines using "\n" as the line separator. Typically,
10282 these descriptions should be no more than a few lines long.
10283
10284
10285 PARENT_GROUP, if supplied, names the parent group of this group.
10286 Parent groups are used to establish a hierarchy of groups, pro‐
10287 viding an arbitrary hierarchy of groups.
10288
10289
10290 EXPANDED indicates that, by default, the group should show up as
10291 "expanded", so that the user immediately sees all of the compo‐
10292 nents within the group. Otherwise, the group will initially show
10293 up as a single entry.
10294
10295
10296 BOLD_TITLE indicates that the group title should appear in bold,
10297 to call the user's attention to the group.
10298
10299
10300 cpack_add_install_type - Add a new installation type containing
10301 a set of predefined component selections to the graphical in‐
10302 staller.
10303
10304
10305 cpack_add_install_type(typename
10306 [DISPLAY_NAME name])
10307
10308
10309
10310
10311 The cpack_add_install_type command identifies a set of prese‐
10312 lected components that represents a common use case for an
10313 application. For example, a "Developer" install type might
10314 include an application along with its header and library files,
10315 while an "End user" install type might just include the applica‐
10316 tion's executable. Each component identifies itself with one or
10317 more install types via the INSTALL_TYPES argument to
10318 cpack_add_component.
10319
10320
10321 DISPLAY_NAME is the displayed name of the install type, which
10322 will typically show up in a drop-down box within a graphical in‐
10323 staller. This value can be any string.
10324
10325
10326 cpack_configure_downloads - Configure CPack to download selected
10327 components on-the-fly as part of the installation process.
10328
10329
10330 cpack_configure_downloads(site
10331 [UPLOAD_DIRECTORY dirname]
10332 [ALL]
10333 [ADD_REMOVE|NO_ADD_REMOVE])
10334
10335
10336
10337
10338 The cpack_configure_downloads command configures installa‐
10339 tion-time downloads of selected components. For each download‐
10340 able component, CPack will create an archive containing the con‐
10341 tents of that component, which should be uploaded to the given
10342 site. When the user selects that component for installation, the
10343 installer will download and extract the component in place. This
10344 feature is useful for creating small installers that only down‐
10345 load the requested components, saving bandwidth. Additionally,
10346 the installers are small enough that they will be installed as
10347 part of the normal installation process, and the "Change" button
10348 in Windows Add/Remove Programs control panel will allow one to
10349 add or remove parts of the application after the original
10350 installation. On Windows, the downloaded-components functional‐
10351 ity requires the ZipDLL plug-in for NSIS, available at:
10352
10353
10354 http://nsis.sourceforge.net/ZipDLL_plug-in
10355
10356
10357
10358
10359 On Mac OS X, installers that download components on-the-fly can
10360 only be built and installed on system using Mac OS X 10.5 or
10361 later.
10362
10363
10364 The site argument is a URL where the archives for downloadable
10365 components will reside, e.g.,
10366 http://www.cmake.org/files/2.6.1/installer/ All of the archives
10367 produced by CPack should be uploaded to that location.
10368
10369
10370 UPLOAD_DIRECTORY is the local directory where CPack will create
10371 the various archives for each of the components. The contents of
10372 this directory should be uploaded to a location accessible by
10373 the URL given in the site argument. If omitted, CPack will use
10374 the directory CPackUploads inside the CMake binary directory to
10375 store the generated archives.
10376
10377
10378 The ALL flag indicates that all components be downloaded. Other‐
10379 wise, only those components explicitly marked as DOWNLOADED or
10380 that have a specified ARCHIVE_FILE will be downloaded. Addition‐
10381 ally, the ALL option implies ADD_REMOVE (unless NO_ADD_REMOVE is
10382 specified).
10383
10384
10385 ADD_REMOVE indicates that CPack should install a copy of the in‐
10386 staller that can be called from Windows' Add/Remove Programs
10387 dialog (via the "Modify" button) to change the set of installed
10388 components. NO_ADD_REMOVE turns off this behavior. This option
10389 is ignored on Mac OS X.
10390
10391
10392 CPackCygwin
10393 Cygwin CPack generator (Cygwin).
10394
10395 The following variable is specific to installers build on and/or
10396 for Cygwin:
10397
10398
10399 CPACK_CYGWIN_PATCH_NUMBER - The Cygwin patch number.
10400 FIXME: This documentation is incomplete.
10401 CPACK_CYGWIN_PATCH_FILE - The Cygwin patch file.
10402 FIXME: This documentation is incomplete.
10403 CPACK_CYGWIN_BUILD_SCRIPT - The Cygwin build script.
10404 FIXME: This documentation is incomplete.
10405
10406
10407 CPackDMG
10408 DragNDrop CPack generator (Mac OS X).
10409
10410 The following variables are specific to the DragNDrop installers
10411 built on Mac OS X:
10412
10413
10414 CPACK_DMG_VOLUME_NAME - The volume name of the generated disk
10415 image. Defaults to CPACK_PACKAGE_FILE_NAME.
10416
10417
10418
10419
10420 CPACK_DMG_FORMAT - The disk image format. Common values are UDRO
10421 (UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF
10422 bzip2-compressed). Refer to hdiutil(1) for more information on
10423 other available formats.
10424
10425
10426
10427
10428 CPACK_DMG_DS_STORE - Path to a custom DS_Store file. This .DS_Store
10429 file e.g. can be used to specify the Finder window
10430 position/geometry and layout (such as hidden toolbars, placement of the
10431 icons etc.). This file has to be generated by the Finder (either manually or
10432 through OSA-script) using a normal folder from which the .DS_Store
10433 file can then be extracted.
10434
10435
10436
10437
10438 CPACK_DMG_BACKGROUND_IMAGE - Path to a background image file. This
10439 file will be used as the background for the Finder Window when the disk
10440 image is opened. By default no background image is set. The background
10441 image is applied after applying the custom .DS_Store file.
10442
10443
10444
10445
10446 CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to
10447 operate on disk image files on Mac OS X. This variable can be used
10448 to override the automatically detected command (or specify its
10449 location if the auto-detection fails to find it.)
10450
10451
10452
10453
10454 CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set
10455 extended attributes on files and directories on Mac OS X. This
10456 variable can be used to override the automatically detected
10457 command (or specify its location if the auto-detection fails to
10458 find it.)
10459
10460
10461
10462
10463 CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile
10464 resources on Mac OS X. This variable can be used to override the
10465 automatically detected command (or specify its location if the
10466 auto-detection fails to find it.)
10467
10468
10469 CPackDeb
10470 The builtin (binary) CPack Deb generator (Unix only)
10471
10472 CPackDeb may be used to create Deb package using CPack. CPackDeb
10473 is a CPack generator thus it uses the CPACK_XXX variables used
10474 by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration.
10475 CPackDeb generator should work on any linux host but it will
10476 produce better deb package when Debian specific tools 'dpkg-xxx'
10477 are usable on the build system.
10478
10479
10480 CPackDeb has specific features which are controlled by the
10481 specifics CPACK_DEBIAN_XXX variables.You'll find a detailed
10482 usage on the wiki:
10483
10484
10485 http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#DEB_.28UNIX_only.29
10486
10487 However as a handy reminder here comes the list of specific
10488 variables:
10489
10490
10491 CPACK_DEBIAN_PACKAGE_NAME
10492
10493
10494 Mandatory : YES
10495 Default : CPACK_PACKAGE_NAME (lower case)
10496 The debian package summary
10497
10498 CPACK_DEBIAN_PACKAGE_VERSION
10499
10500
10501 Mandatory : YES
10502 Default : CPACK_PACKAGE_VERSION
10503 The debian package version
10504
10505 CPACK_DEBIAN_PACKAGE_ARCHITECTURE
10506
10507
10508 Mandatory : YES
10509 Default : Output of dpkg --print-architecture (or i386 if dpkg is not found)
10510 The debian package architecture
10511
10512 CPACK_DEBIAN_PACKAGE_DEPENDS
10513
10514
10515 Mandatory : NO
10516 Default : -
10517 May be used to set deb dependencies.
10518
10519 CPACK_DEBIAN_PACKAGE_MAINTAINER
10520
10521
10522 Mandatory : YES
10523 Default : CPACK_PACKAGE_CONTACT
10524 The debian package maintainer
10525
10526 CPACK_DEBIAN_PACKAGE_DESCRIPTION
10527
10528
10529 Mandatory : YES
10530 Default : CPACK_PACKAGE_DESCRIPTION_SUMMARY
10531 The debian package description
10532
10533 CPACK_DEBIAN_PACKAGE_SECTION
10534
10535
10536 Mandatory : YES
10537 Default : 'devel'
10538 The debian package section
10539
10540 CPACK_DEBIAN_PACKAGE_PRIORITY
10541
10542
10543 Mandatory : YES
10544 Default : 'optional'
10545 The debian package priority
10546
10547 CPACK_DEBIAN_PACKAGE_HOMEPAGE
10548
10549
10550 Mandatory : NO
10551 Default : -
10552 The URL of the web site for this package, preferably (when applicable) the
10553 site from which the original source can be obtained and any additional
10554 upstream documentation or information may be found.
10555 The content of this field is a simple URL without any surrounding
10556 characters such as <>.
10557
10558 CPACK_DEBIAN_PACKAGE_SHLIBDEPS
10559
10560
10561 Mandatory : NO
10562 Default : OFF
10563 May be set to ON in order to use dpkg-shlibdeps to generate
10564 better package dependency list.
10565 You may need set CMAKE_INSTALL_RPATH toi appropriate value
10566 if you use this feature, because if you don't dpkg-shlibdeps
10567 may fail to find your own shared libs.
10568 See http://www.cmake.org/Wiki/CMake_RPATH_handling.
10569
10570 CPACK_DEBIAN_PACKAGE_DEBUG
10571
10572
10573 Mandatory : NO
10574 Default : -
10575 May be set when invoking cpack in order to trace debug information
10576 during CPackDeb run.
10577
10578 CPACK_DEBIAN_PACKAGE_PREDEPENDS
10579
10580
10581 Mandatory : NO
10582 Default : -
10583 see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
10584 This field is like Depends, except that it also forces dpkg to complete installation of
10585 the packages named before even starting the installation of the package which declares
10586 the pre-dependency.
10587
10588 CPACK_DEBIAN_PACKAGE_ENHANCES
10589
10590
10591 Mandatory : NO
10592 Default : -
10593 see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
10594 This field is similar to Suggests but works in the opposite direction.
10595 It is used to declare that a package can enhance the functionality of another package.
10596
10597 CPACK_DEBIAN_PACKAGE_BREAKS
10598
10599
10600 Mandatory : NO
10601 Default : -
10602 see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
10603 When one binary package declares that it breaks another, dpkg will refuse to allow the
10604 package which declares Breaks be installed unless the broken package is deconfigured first,
10605 and it will refuse to allow the broken package to be reconfigured.
10606
10607 CPACK_DEBIAN_PACKAGE_CONFLICTS
10608
10609
10610 Mandatory : NO
10611 Default : -
10612 see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
10613 When one binary package declares a conflict with another using a Conflicts field,
10614 dpkg will refuse to allow them to be installed on the system at the same time.
10615
10616 CPACK_DEBIAN_PACKAGE_PROVIDES
10617
10618
10619 Mandatory : NO
10620 Default : -
10621 see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
10622 A virtual package is one which appears in the Provides control field of another package.
10623
10624 CPACK_DEBIAN_PACKAGE_REPLACES
10625
10626
10627 Mandatory : NO
10628 Default : -
10629 see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
10630 Packages can declare in their control file that they should overwrite
10631 files in certain other packages, or completely replace other packages.
10632
10633 CPACK_DEBIAN_PACKAGE_RECOMMENDS
10634
10635
10636 Mandatory : NO
10637 Default : -
10638 see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
10639 Allows packages to declare a strong, but not absolute, dependency on other packages.
10640
10641 CPACK_DEBIAN_PACKAGE_SUGGESTS
10642
10643
10644 Mandatory : NO
10645 Default : -
10646 see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
10647 Allows packages to declare a suggested package install grouping.
10648
10649 CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
10650
10651
10652 Mandatory : NO
10653 Default : -
10654 This variable allow advanced user to add custom script to the control.tar.gz
10655 Typical usage is for conffiles, postinst, postrm, prerm.
10656 Usage: set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
10657 "${CMAKE_CURRENT_SOURCE_DIR/prerm;${CMAKE_CURRENT_SOURCE_DIR}/postrm")
10658
10659
10660 CPackNSIS
10661 CPack NSIS generator specific options
10662
10663
10664
10665
10666 The following variables are specific to the graphical installers
10667 built on Windows using the Nullsoft Installation System.
10668
10669
10670 CPACK_NSIS_INSTALL_ROOT - The default installation directory presented
10671 to the end user by the NSIS installer is under this root dir. The full
10672 directory presented to the end user is:
10673 ${CPACK_NSIS_INSTALL_ROOT}/${CPACK_PACKAGE_INSTALL_DIRECTORY}
10674
10675
10676
10677
10678 CPACK_NSIS_MUI_ICON - An icon filename.
10679 The name of a *.ico file used as the main icon for the generated
10680 install program.
10681
10682
10683
10684
10685 CPACK_NSIS_MUI_UNIICON - An icon filename.
10686 The name of a *.ico file used as the main icon for the generated
10687 uninstall program.
10688
10689
10690
10691
10692 CPACK_NSIS_INSTALLER_MUI_ICON_CODE - undocumented.
10693
10694
10695
10696
10697 CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS - Extra NSIS commands that
10698 will be added to the beginning of the install Section, before your
10699 install tree is available on the target system.
10700
10701
10702
10703
10704 CPACK_NSIS_EXTRA_INSTALL_COMMANDS - Extra NSIS commands that
10705 will be added to the end of the install Section, after your
10706 install tree is available on the target system.
10707
10708
10709
10710
10711 CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS - Extra NSIS commands that will
10712 be added to the uninstall Section, before your install tree is
10713 removed from the target system.
10714
10715
10716
10717
10718 CPACK_NSIS_COMPRESSOR - The arguments that will be passed to the
10719 NSIS SetCompressor command.
10720
10721
10722
10723
10724 CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL - Ask about uninstalling
10725 previous versions first.
10726 If this is set to "ON", then an installer will look for previous
10727 installed versions and if one is found, ask the user whether to
10728 uninstall it before proceeding with the install.
10729
10730
10731
10732
10733 CPACK_NSIS_MODIFY_PATH - Modify PATH toggle.
10734 If this is set to "ON", then an extra page
10735 will appear in the installer that will allow the user to choose
10736 whether the program directory should be added to the system PATH
10737 variable.
10738
10739
10740
10741
10742 CPACK_NSIS_DISPLAY_NAME - The display name string that appears in
10743 the Windows Add/Remove Program control panel
10744
10745
10746
10747
10748 CPACK_NSIS_PACKAGE_NAME - The title displayed at the top of the
10749 installer.
10750
10751
10752
10753
10754 CPACK_NSIS_INSTALLED_ICON_NAME - A path to the executable that
10755 contains the installer icon.
10756
10757
10758
10759
10760 CPACK_NSIS_HELP_LINK - URL to a web site providing assistance in
10761 installing your application.
10762
10763
10764
10765
10766 CPACK_NSIS_URL_INFO_ABOUT - URL to a web site providing more
10767 information about your application.
10768
10769
10770
10771
10772 CPACK_NSIS_CONTACT - Contact information for questions and comments
10773 about the installation process.
10774
10775
10776
10777
10778 CPACK_NSIS_CREATE_ICONS_EXTRA - Additional NSIS commands for
10779 creating start menu shortcuts.
10780
10781
10782
10783
10784 CPACK_NSIS_DELETE_ICONS_EXTRA -Additional NSIS commands to
10785 uninstall start menu shortcuts.
10786
10787
10788
10789
10790 CPACK_NSIS_EXECUTABLES_DIRECTORY - Creating NSIS start menu links
10791 assumes that they are in 'bin' unless this variable is set.
10792 For example, you would set this to 'exec' if your executables are
10793 in an exec directory.
10794
10795
10796
10797
10798 CPACK_NSIS_MUI_FINISHPAGE_RUN - Specify an executable to add an option
10799 to run on the finish page of the NSIS installer.
10800 CPACK_NSIS_MENU_LINKS - Specify links in [application] menu.
10801 This should contain a list of pair "link" "link name". The link
10802 may be an URL or a path relative to installation prefix.
10803 Like:
10804 set(CPACK_NSIS_MENU_LINKS
10805 "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake.html" "CMake Help"
10806 "http://www.cmake.org" "CMake Web Site")
10807
10808
10809 CPackPackageMaker
10810 PackageMaker CPack generator (Mac OS X).
10811
10812 The following variable is specific to installers built on Mac OS
10813 X using PackageMaker:
10814
10815
10816 CPACK_OSX_PACKAGE_VERSION - The version of Mac OS X that the
10817 resulting PackageMaker archive should be compatible with. Different
10818 versions of Mac OS X support different
10819 features. For example, CPack can only build component-based
10820 installers for Mac OS X 10.4 or newer, and can only build
10821 installers that download component son-the-fly for Mac OS X 10.5
10822 or newer. If left blank, this value will be set to the minimum
10823 version of Mac OS X that supports the requested features. Set this
10824 variable to some value (e.g., 10.4) only if you want to guarantee
10825 that your installer will work on that version of Mac OS X, and
10826 don't mind missing extra features available in the installer
10827 shipping with later versions of Mac OS X.
10828
10829
10830 CPackRPM
10831 The builtin (binary) CPack RPM generator (Unix only)
10832
10833 CPackRPM may be used to create RPM package using CPack. CPackRPM
10834 is a CPack generator thus it uses the CPACK_XXX variables used
10835 by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration
10836
10837
10838 However CPackRPM has specific features which are controlled by
10839 the specifics CPACK_RPM_XXX variables. CPackRPM is a component
10840 aware generator so when CPACK_RPM_COMPONENT_INSTALL is ON some
10841 more CPACK_RPM_<ComponentName>_XXXX variables may be used in
10842 order to have component specific values. Note however that <com‐
10843 ponentName> refers to the **grouping name**. This may be either
10844 a component name or a component GROUP name. Usually those vars
10845 correspond to RPM spec file entities, one may find information
10846 about spec files here http://www.rpm.org/wiki/Docs. You'll find
10847 a detailed usage of CPackRPM on the wiki:
10848
10849
10850 http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#RPM_.28Unix_Only.29
10851
10852 However as a handy reminder here comes the list of specific
10853 variables:
10854
10855
10856 CPACK_RPM_PACKAGE_SUMMARY - The RPM package summary.
10857 Mandatory : YES
10858 Default : CPACK_PACKAGE_DESCRIPTION_SUMMARY
10859 CPACK_RPM_PACKAGE_NAME - The RPM package name.
10860 Mandatory : YES
10861 Default : CPACK_PACKAGE_NAME
10862 CPACK_RPM_PACKAGE_VERSION - The RPM package version.
10863 Mandatory : YES
10864 Default : CPACK_PACKAGE_VERSION
10865 CPACK_RPM_PACKAGE_ARCHITECTURE - The RPM package architecture.
10866 Mandatory : NO
10867 Default : -
10868 This may be set to "noarch" if you
10869 know you are building a noarch package.
10870 CPACK_RPM_PACKAGE_RELEASE - The RPM package release.
10871 Mandatory : YES
10872 Default : 1
10873 This is the numbering of the RPM package
10874 itself, i.e. the version of the packaging and not the version of the
10875 content (see CPACK_RPM_PACKAGE_VERSION). One may change the default
10876 value if the previous packaging was buggy and/or you want to put here
10877 a fancy Linux distro specific numbering.
10878 CPACK_RPM_PACKAGE_LICENSE - The RPM package license policy.
10879 Mandatory : YES
10880 Default : "unknown"
10881 CPACK_RPM_PACKAGE_GROUP - The RPM package group.
10882 Mandatory : YES
10883 Default : "unknown"
10884 CPACK_RPM_PACKAGE_VENDOR - The RPM package vendor.
10885 Mandatory : YES
10886 Default : CPACK_PACKAGE_VENDOR if set or "unknown"
10887 CPACK_RPM_PACKAGE_URL - The projects URL.
10888 Mandatory : NO
10889 Default : -
10890 CPACK_RPM_PACKAGE_DESCRIPTION - RPM package description.
10891 Mandatory : YES
10892 Default : CPACK_PACKAGE_DESCRIPTION_FILE if set or "no package description available"
10893 CPACK_RPM_COMPRESSION_TYPE - RPM compression type.
10894 Mandatory : NO
10895 Default : -
10896 May be used to override RPM compression type to be used
10897 to build the RPM. For example some Linux distribution now default
10898 to lzma or xz compression whereas older cannot use such RPM.
10899 Using this one can enforce compression type to be used.
10900 Possible value are: lzma, xz, bzip2 and gzip.
10901 CPACK_RPM_PACKAGE_REQUIRES - RPM spec requires field.
10902 Mandatory : NO
10903 Default : -
10904 May be used to set RPM dependencies (requires).
10905 Note that you must enclose the complete requires string between quotes,
10906 for example:
10907 set(CPACK_RPM_PACKAGE_REQUIRES "python >= 2.5.0, cmake >= 2.8")
10908 The required package list of an RPM file could be printed with
10909 rpm -qp --requires file.rpm
10910 CPACK_RPM_PACKAGE_SUGGESTS - RPM spec suggest field.
10911 Mandatory : NO
10912 Default : -
10913 May be used to set weak RPM dependencies (suggests).
10914 Note that you must enclose the complete requires string between quotes.
10915 CPACK_RPM_PACKAGE_PROVIDES - RPM spec provides field.
10916 Mandatory : NO
10917 Default : -
10918 May be used to set RPM dependencies (provides).
10919 The provided package list of an RPM file could be printed with
10920 rpm -qp --provides file.rpm
10921 CPACK_RPM_PACKAGE_OBSOLETES - RPM spec obsoletes field.
10922 Mandatory : NO
10923 Default : -
10924 May be used to set RPM packages that are obsoleted by this one.
10925 CPACK_RPM_PACKAGE_RELOCATABLE - build a relocatable RPM.
10926 Mandatory : NO
10927 Default : CPACK_PACKAGE_RELOCATABLE
10928 If this variable is set to TRUE or ON CPackRPM will try
10929 to build a relocatable RPM package. A relocatable RPM may
10930 be installed using rpm --prefix or --relocate in order to
10931 install it at an alternate place see rpm(8).
10932 Note that currently this may fail if CPACK_SET_DESTDIR is set to ON.
10933 If CPACK_SET_DESTDIR is set then you will get a warning message
10934 but if there is file installed with absolute path you'll get
10935 unexpected behavior.
10936 CPACK_RPM_SPEC_INSTALL_POST - [deprecated].
10937 Mandatory : NO
10938 Default : -
10939 This way of specifying post-install script is deprecated use
10940 CPACK_RPM_POST_INSTALL_SCRIPT_FILE
10941 May be used to set an RPM post-install command inside the spec file.
10942 For example setting it to "/bin/true" may be used to prevent
10943 rpmbuild to strip binaries.
10944 CPACK_RPM_SPEC_MORE_DEFINE - RPM extended spec definitions lines.
10945 Mandatory : NO
10946 Default : -
10947 May be used to add any %define lines to the generated spec file.
10948 CPACK_RPM_PACKAGE_DEBUG - Toggle CPackRPM debug output.
10949 Mandatory : NO
10950 Default : -
10951 May be set when invoking cpack in order to trace debug information
10952 during CPack RPM run. For example you may launch CPack like this
10953 cpack -D CPACK_RPM_PACKAGE_DEBUG=1 -G RPM
10954 CPACK_RPM_USER_BINARY_SPECFILE - A user provided spec file.
10955 Mandatory : NO
10956 Default : -
10957 May be set by the user in order to specify a USER binary spec file
10958 to be used by CPackRPM instead of generating the file.
10959 The specified file will be processed by configure_file( @ONLY).
10960 One can provide a component specific file by setting
10961 CPACK_RPM_<componentName>_USER_BINARY_SPECFILE.
10962 CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE - Spec file template.
10963 Mandatory : NO
10964 Default : -
10965 If set CPack will generate a template for USER specified binary
10966 spec file and stop with an error. For example launch CPack like this
10967 cpack -D CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE=1 -G RPM
10968 The user may then use this file in order to hand-craft is own
10969 binary spec file which may be used with CPACK_RPM_USER_BINARY_SPECFILE.
10970 CPACK_RPM_PRE_INSTALL_SCRIPT_FILE
10971 CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE
10972 Mandatory : NO
10973 Default : -
10974 May be used to embed a pre (un)installation script in the spec file.
10975 The refered script file(s) will be read and directly
10976 put after the %pre or %preun section
10977 If CPACK_RPM_COMPONENT_INSTALL is set to ON the (un)install script for
10978 each component can be overridden with
10979 CPACK_RPM_<COMPONENT>_PRE_INSTALL_SCRIPT_FILE and
10980 CPACK_RPM_<COMPONENT>_PRE_UNINSTALL_SCRIPT_FILE
10981 One may verify which scriptlet has been included with
10982 rpm -qp --scripts package.rpm
10983 CPACK_RPM_POST_INSTALL_SCRIPT_FILE
10984 CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE
10985 Mandatory : NO
10986 Default : -
10987 May be used to embed a post (un)installation script in the spec file.
10988 The refered script file(s) will be read and directly
10989 put after the %post or %postun section
10990 If CPACK_RPM_COMPONENT_INSTALL is set to ON the (un)install script for
10991 each component can be overridden with
10992 CPACK_RPM_<COMPONENT>_POST_INSTALL_SCRIPT_FILE and
10993 CPACK_RPM_<COMPONENT>_POST_UNINSTALL_SCRIPT_FILE
10994 One may verify which scriptlet has been included with
10995 rpm -qp --scripts package.rpm
10996 CPACK_RPM_USER_FILELIST
10997 CPACK_RPM_<COMPONENT>_USER_FILELIST
10998 Mandatory : NO
10999 Default : -
11000 May be used to explicitly specify %(<directive>) file line
11001 in the spec file. Like %config(noreplace) or any other directive
11002 that be found in the %files section. Since CPackRPM is generating
11003 the list of files (and directories) the user specified files of
11004 the CPACK_RPM_<COMPONENT>_USER_FILELIST list will be removed from the generated list.
11005 CPACK_RPM_CHANGELOG_FILE - RPM changelog file.
11006 Mandatory : NO
11007 Default : -
11008 May be used to embed a changelog in the spec file.
11009 The refered file will be read and directly put after the %changelog
11010 section.
11011 CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST - list of path to be excluded.
11012 Mandatory : NO
11013 Default : /etc /etc/init.d /usr /usr/share /usr/share/doc /usr/bin /usr/lib /usr/lib64 /usr/include
11014 May be used to exclude path (directories or files) from the auto-generated
11015 list of paths discovered by CPack RPM. The defaut value contains a reasonable
11016 set of values if the variable is not defined by the user. If the variable
11017 is defined by the user then CPackRPM will NOT any of the default path.
11018 If you want to add some path to the default list then you can use
11019 CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION variable.
11020 CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION - additional list of path to be excluded.
11021 Mandatory : NO
11022 Default : -
11023 May be used to add more exclude path (directories or files) from the initial
11024 default list of excluded paths. See CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST.
11025
11026
11027 CPackWIX
11028 CPack WiX generator specific options
11029
11030
11031
11032
11033 The following variables are specific to the installers built on
11034 Windows using WiX.
11035
11036
11037 CPACK_WIX_UPGRADE_GUID - Upgrade GUID (Product/@UpgradeCode)
11038
11039
11040
11041
11042 Will be automatically generated unless explicitly provided.
11043
11044
11045 It should be explicitly set to a constant generated gloabally
11046 unique identifier (GUID) to allow your installers to replace
11047 existing installations that use the same GUID.
11048
11049
11050 You may for example explicitly set this variable in your CMake‐
11051 Lists.txt to the value that has been generated per default. You
11052 should not use GUIDs that you did not generate yourself or which
11053 may belong to other projects.
11054
11055
11056 A GUID shall have the following fixed length syntax:
11057 XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
11058
11059
11060 (each X represents an uppercase hexadecimal digit)
11061 CPACK_WIX_PRODUCT_GUID - Product GUID (Product/@Id)
11062
11063
11064
11065
11066 Will be automatically generated unless explicitly provided.
11067
11068
11069 If explicitly provided this will set the Product Id of your in‐
11070 staller.
11071
11072
11073 The installer will abort if it detects a pre-existing installa‐
11074 tion that uses the same GUID.
11075
11076
11077 The GUID shall use the syntax described for
11078 CPACK_WIX_UPGRADE_GUID.
11079
11080
11081 CPACK_WIX_LICENSE_RTF - RTF License File
11082
11083
11084
11085
11086 If CPACK_RESOURCE_FILE_LICENSE has an .rtf extension it is used
11087 as-is.
11088
11089
11090 If CPACK_RESOURCE_FILE_LICENSE has an .txt extension it is
11091 implicitly converted to RTF by the WiX Generator.
11092
11093
11094 With CPACK_WIX_LICENSE_RTF you can override the license file
11095 used by the WiX Generator in case CPACK_RESOURCE_FILE_LICENSE is
11096 in an unsupported format or the .txt -> .rtf conversion does not
11097 work as expected.
11098
11099
11100
11101
11102
11103 CPACK_WIX_PRODUCT_ICON - The Icon shown next to the program name
11104 in Add/Remove programs.
11105
11106
11107 If set, this icon is used in place of the default icon.
11108
11109
11110
11111
11112
11113 CPACK_WIX_UI_BANNER - The bitmap will appear at the top of all
11114 installer pages other than the welcome and completion dialogs.
11115
11116
11117 If set, this image will replace the default banner image.
11118
11119
11120 This image must be 493 by 58 pixels.
11121
11122
11123
11124
11125
11126 CPACK_WIX_UI_DIALOG - Background bitmap used on the welcome and
11127 completion dialogs.
11128
11129
11130 If this variable is set, the installer will replace the default
11131 dialog image.
11132
11133
11134 This image must be 493 by 312 pixels.
11135
11136
11137
11138
11139
11140 CPACK_WIX_PROGRAM_MENU_FOLDER - Start menu folder name for
11141 launcher.
11142
11143
11144 If this variable is not set, it will be initialized with
11145 CPACK_PACKAGE_NAME
11146
11147
11148 CPACK_WIX_CULTURES - Language(s) of the installer
11149
11150
11151 Languages are compiled into the WixUI extension library. To use
11152 them, simply provide the name of the culture. If you specify
11153 more than one culture identifier in a comma or semicolon delim‐
11154 ited list, the first one that is found will be used. You can
11155 find a list of supported languages at: http://wix.source‐
11156 forge.net/manual-wix3/WixUI_localization.htm
11157
11158
11159 CPACK_WIX_TEMPLATE - Template file for WiX generation
11160
11161
11162 If this variable is set, the specified template will be used to
11163 generate the WiX wxs file. This should be used if further cus‐
11164 tomization of the output is required.
11165
11166
11167 If this variable is not set, the default MSI template included
11168 with CMake will be used.
11169
11170
11171
11172 CTest Configure a project for testing with CTest/CDash
11173
11174 Include this module in the top CMakeLists.txt file of a project
11175 to enable testing with CTest and dashboard submissions to CDash:
11176
11177
11178 project(MyProject)
11179 ...
11180 include(CTest)
11181
11182 The module automatically creates a BUILD_TESTING option that
11183 selects whether to enable testing support (ON by default).
11184 After including the module, use code like
11185
11186
11187 if(BUILD_TESTING)
11188 # ... CMake code to create tests ...
11189 endif()
11190
11191 to creating tests when testing is enabled.
11192
11193
11194 To enable submissions to a CDash server, create a CTestCon‐
11195 fig.cmake file at the top of the project with content such as
11196
11197
11198 set(CTEST_PROJECT_NAME "MyProject")
11199 set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
11200 set(CTEST_DROP_METHOD "http")
11201 set(CTEST_DROP_SITE "my.cdash.org")
11202 set(CTEST_DROP_LOCATION "/submit.php?project=MyProject")
11203 set(CTEST_DROP_SITE_CDASH TRUE)
11204
11205 (the CDash server can provide the file to a project administra‐
11206 tor who configures 'MyProject'). Settings in the config file are
11207 shared by both this CTest module and the CTest command-line
11208 tool's dashboard script mode (ctest -S).
11209
11210
11211 While building a project for submission to CDash, CTest scans
11212 the build output for errors and warnings and reports them with
11213 surrounding context from the build log. This generic approach
11214 works for all build tools, but does not give details about the
11215 command invocation that produced a given problem. One may get
11216 more detailed reports by adding
11217
11218
11219 set(CTEST_USE_LAUNCHERS 1)
11220
11221 to the CTestConfig.cmake file. When this option is enabled, the
11222 CTest module tells CMake's Makefile generators to invoke every
11223 command in the generated build system through a CTest launcher
11224 program. (Currently the CTEST_USE_LAUNCHERS option is ignored
11225 on non-Makefile generators.) During a manual build each
11226 launcher transparently runs the command it wraps. During a
11227 CTest-driven build for submission to CDash each launcher reports
11228 detailed information when its command fails or warns. (Setting
11229 CTEST_USE_LAUNCHERS in CTestConfig.cmake is convenient, but also
11230 adds the launcher overhead even for manual builds. One may
11231 instead set it in a CTest dashboard script and add it to the
11232 CMake cache for the build tree.)
11233
11234
11235 CTestScriptMode
11236
11237
11238 This file is read by ctest in script mode (-S)
11239
11240
11241 CTestUseLaunchers
11242 Set the RULE_LAUNCH_* global properties when CTEST_USE_LAUNCHERS
11243 is on.
11244
11245 CTestUseLaunchers is automatically included when you
11246 include(CTest). However, it is split out into its own module
11247 file so projects can use the CTEST_USE_LAUNCHERS functionality
11248 independently.
11249
11250
11251 To use launchers, set CTEST_USE_LAUNCHERS to ON in a ctest -S
11252 dashboard script, and then also set it in the cache of the con‐
11253 figured project. Both cmake and ctest need to know the value of
11254 it for the launchers to work properly. CMake needs to know in
11255 order to generate proper build rules, and ctest, in order to
11256 produce the proper error and warning analysis.
11257
11258
11259 For convenience, you may set the ENV variable CTEST_USE_LAUNCH‐
11260 ERS_DEFAULT in your ctest -S script, too. Then, as long as your
11261 CMakeLists uses include(CTest) or include(CTestUseLaunchers), it
11262 will use the value of the ENV variable to initialize a
11263 CTEST_USE_LAUNCHERS cache variable. This cache variable initial‐
11264 ization only occurs if CTEST_USE_LAUNCHERS is not already
11265 defined.
11266
11267
11268 CheckCCompilerFlag
11269 Check whether the C compiler supports a given flag.
11270
11271 CHECK_C_COMPILER_FLAG(<flag> <var>)
11272
11273
11274 <flag> - the compiler flag
11275 <var> - variable to store the result
11276
11277 This internally calls the check_c_source_compiles macro and sets
11278 CMAKE_REQUIRED_DEFINITIONS to <flag>. See help for CheckCSource‐
11279 Compiles for a listing of variables that can otherwise modify
11280 the build. The result only tells that the compiler does not give
11281 an error message when it encounters the flag. If the flag has
11282 any effect or even a specific one is beyond the scope of this
11283 module.
11284
11285
11286 CheckCSourceCompiles
11287 Check if given C source compiles and links into an executable
11288
11289 CHECK_C_SOURCE_COMPILES(<code> <var> [FAIL_REGEX <fail-regex>])
11290
11291
11292 <code> - source code to try to compile, must define 'main'
11293 <var> - variable to store whether the source code compiled
11294 <fail-regex> - fail if test output matches this regex
11295
11296 The following variables may be set before calling this macro to
11297 modify the way the check is run:
11298
11299
11300 CMAKE_REQUIRED_FLAGS = string of compile command line flags
11301 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
11302 CMAKE_REQUIRED_INCLUDES = list of include directories
11303 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
11304
11305
11306 CheckCSourceRuns
11307 Check if the given C source code compiles and runs.
11308
11309 CHECK_C_SOURCE_RUNS(<code> <var>)
11310
11311
11312 <code> - source code to try to compile
11313 <var> - variable to store the result
11314 (1 for success, empty for failure)
11315
11316 The following variables may be set before calling this macro to
11317 modify the way the check is run:
11318
11319
11320 CMAKE_REQUIRED_FLAGS = string of compile command line flags
11321 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
11322 CMAKE_REQUIRED_INCLUDES = list of include directories
11323 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
11324
11325
11326 CheckCXXCompilerFlag
11327 Check whether the CXX compiler supports a given flag.
11328
11329 CHECK_CXX_COMPILER_FLAG(<flag> <var>)
11330
11331
11332 <flag> - the compiler flag
11333 <var> - variable to store the result
11334
11335 This internally calls the check_cxx_source_compiles macro and
11336 sets CMAKE_REQUIRED_DEFINITIONS to <flag>. See help for Check‐
11337 CXXSourceCompiles for a listing of variables that can otherwise
11338 modify the build. The result only tells that the compiler does
11339 not give an error message when it encounters the flag. If the
11340 flag has any effect or even a specific one is beyond the scope
11341 of this module.
11342
11343
11344 CheckCXXSourceCompiles
11345 Check if given C++ source compiles and links into an executable
11346
11347 CHECK_CXX_SOURCE_COMPILES(<code> <var> [FAIL_REGEX
11348 <fail-regex>])
11349
11350
11351 <code> - source code to try to compile, must define 'main'
11352 <var> - variable to store whether the source code compiled
11353 <fail-regex> - fail if test output matches this regex
11354
11355 The following variables may be set before calling this macro to
11356 modify the way the check is run:
11357
11358
11359 CMAKE_REQUIRED_FLAGS = string of compile command line flags
11360 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
11361 CMAKE_REQUIRED_INCLUDES = list of include directories
11362 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
11363
11364
11365 CheckCXXSourceRuns
11366 Check if the given C++ source code compiles and runs.
11367
11368 CHECK_CXX_SOURCE_RUNS(<code> <var>)
11369
11370
11371 <code> - source code to try to compile
11372 <var> - variable to store the result
11373 (1 for success, empty for failure)
11374
11375 The following variables may be set before calling this macro to
11376 modify the way the check is run:
11377
11378
11379 CMAKE_REQUIRED_FLAGS = string of compile command line flags
11380 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
11381 CMAKE_REQUIRED_INCLUDES = list of include directories
11382 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
11383
11384
11385 CheckCXXSymbolExists
11386 Check if a symbol exists as a function, variable, or macro in
11387 C++
11388
11389 CHECK_CXX_SYMBOL_EXISTS(<symbol> <files> <variable>)
11390
11391
11392 Check that the <symbol> is available after including given
11393 header <files> and store the result in a <variable>. Specify
11394 the list of files in one argument as a semicolon-separated list.
11395 CHECK_CXX_SYMBOL_EXISTS() can be used to check in C++ files, as
11396 opposed to CHECK_SYMBOL_EXISTS(), which works only for C.
11397
11398
11399 If the header files define the symbol as a macro it is consid‐
11400 ered available and assumed to work. If the header files declare
11401 the symbol as a function or variable then the symbol must also
11402 be available for linking. If the symbol is a type or enum value
11403 it will not be recognized (consider using CheckTypeSize or
11404 CheckCSourceCompiles).
11405
11406
11407 The following variables may be set before calling this macro to
11408 modify the way the check is run:
11409
11410
11411 CMAKE_REQUIRED_FLAGS = string of compile command line flags
11412 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
11413 CMAKE_REQUIRED_INCLUDES = list of include directories
11414 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
11415
11416
11417 CheckFortranFunctionExists
11418 macro which checks if the Fortran function exists
11419
11420 CHECK_FORTRAN_FUNCTION_EXISTS(FUNCTION VARIABLE)
11421
11422
11423 FUNCTION - the name of the Fortran function
11424 VARIABLE - variable to store the result
11425
11426
11427
11428
11429 The following variables may be set before calling this macro to
11430 modify the way the check is run:
11431
11432
11433 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
11434
11435
11436 CheckFunctionExists
11437 Check if a C function can be linked
11438
11439 CHECK_FUNCTION_EXISTS(<function> <variable>)
11440
11441
11442 Check that the <function> is provided by libraries on the system
11443 and store the result in a <variable>. This does not verify that
11444 any system header file declares the function, only that it can
11445 be found at link time (consider using CheckSymbolExists).
11446
11447
11448 The following variables may be set before calling this macro to
11449 modify the way the check is run:
11450
11451
11452 CMAKE_REQUIRED_FLAGS = string of compile command line flags
11453 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
11454 CMAKE_REQUIRED_INCLUDES = list of include directories
11455 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
11456
11457
11458 CheckIncludeFile
11459 macro which checks the include file exists.
11460
11461 CHECK_INCLUDE_FILE(INCLUDE VARIABLE)
11462
11463
11464 INCLUDE - name of include file
11465 VARIABLE - variable to return result
11466
11467
11468
11469
11470 an optional third argument is the CFlags to add to the compile
11471 line or you can use CMAKE_REQUIRED_FLAGS
11472
11473
11474 The following variables may be set before calling this macro to
11475 modify the way the check is run:
11476
11477
11478 CMAKE_REQUIRED_FLAGS = string of compile command line flags
11479 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
11480 CMAKE_REQUIRED_INCLUDES = list of include directories
11481
11482
11483
11484
11485
11486 CheckIncludeFileCXX
11487 Check if the include file exists.
11488
11489 CHECK_INCLUDE_FILE_CXX(INCLUDE VARIABLE)
11490
11491
11492
11493
11494 INCLUDE - name of include file
11495 VARIABLE - variable to return result
11496
11497
11498
11499
11500 An optional third argument is the CFlags to add to the compile
11501 line or you can use CMAKE_REQUIRED_FLAGS.
11502
11503
11504 The following variables may be set before calling this macro to
11505 modify the way the check is run:
11506
11507
11508 CMAKE_REQUIRED_FLAGS = string of compile command line flags
11509 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
11510 CMAKE_REQUIRED_INCLUDES = list of include directories
11511
11512
11513
11514
11515
11516 CheckIncludeFiles
11517 Check if the files can be included
11518
11519
11520
11521
11522 CHECK_INCLUDE_FILES(INCLUDE VARIABLE)
11523
11524
11525 INCLUDE - list of files to include
11526 VARIABLE - variable to return result
11527
11528
11529
11530
11531 The following variables may be set before calling this macro to
11532 modify the way the check is run:
11533
11534
11535 CMAKE_REQUIRED_FLAGS = string of compile command line flags
11536 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
11537 CMAKE_REQUIRED_INCLUDES = list of include directories
11538
11539
11540 CheckLanguage
11541 Check if a language can be enabled
11542
11543 Usage:
11544
11545
11546 check_language(<lang>)
11547
11548 where <lang> is a language that may be passed to enable_lan‐
11549 guage() such as "Fortran". If CMAKE_<lang>_COMPILER is already
11550 defined the check does nothing. Otherwise it tries enabling the
11551 language in a test project. The result is cached in
11552 CMAKE_<lang>_COMPILER as the compiler that was found, or NOT‐
11553 FOUND if the language cannot be enabled.
11554
11555
11556 Example:
11557
11558
11559 check_language(Fortran)
11560 if(CMAKE_Fortran_COMPILER)
11561 enable_language(Fortran)
11562 else()
11563 message(STATUS "No Fortran support")
11564 endif()
11565
11566
11567 CheckLibraryExists
11568 Check if the function exists.
11569
11570 CHECK_LIBRARY_EXISTS (LIBRARY FUNCTION LOCATION VARIABLE)
11571
11572
11573 LIBRARY - the name of the library you are looking for
11574 FUNCTION - the name of the function
11575 LOCATION - location where the library should be found
11576 VARIABLE - variable to store the result
11577
11578
11579
11580
11581 The following variables may be set before calling this macro to
11582 modify the way the check is run:
11583
11584
11585 CMAKE_REQUIRED_FLAGS = string of compile command line flags
11586 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
11587 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
11588
11589
11590 CheckPrototypeDefinition
11591 Check if the protoype we expect is correct.
11592
11593 check_prototype_definition(FUNCTION PROTOTYPE RETURN HEADER
11594 VARIABLE)
11595
11596
11597 FUNCTION - The name of the function (used to check if prototype exists)
11598 PROTOTYPE- The prototype to check.
11599 RETURN - The return value of the function.
11600 HEADER - The header files required.
11601 VARIABLE - The variable to store the result.
11602
11603 Example:
11604
11605
11606 check_prototype_definition(getpwent_r
11607 "struct passwd *getpwent_r(struct passwd *src, char *buf, int buflen)"
11608 "NULL"
11609 "unistd.h;pwd.h"
11610 SOLARIS_GETPWENT_R)
11611
11612 The following variables may be set before calling this macro to
11613 modify the way the check is run:
11614
11615
11616 CMAKE_REQUIRED_FLAGS = string of compile command line flags
11617 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
11618 CMAKE_REQUIRED_INCLUDES = list of include directories
11619 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
11620
11621
11622 CheckStructHasMember
11623 Check if the given struct or class has the specified member
11624 variable
11625
11626 CHECK_STRUCT_HAS_MEMBER (STRUCT MEMBER HEADER VARIABLE)
11627
11628
11629 STRUCT - the name of the struct or class you are interested in
11630 MEMBER - the member which existence you want to check
11631 HEADER - the header(s) where the prototype should be declared
11632 VARIABLE - variable to store the result
11633
11634
11635
11636
11637 The following variables may be set before calling this macro to
11638 modify the way the check is run:
11639
11640
11641 CMAKE_REQUIRED_FLAGS = string of compile command line flags
11642 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
11643 CMAKE_REQUIRED_INCLUDES = list of include directories
11644
11645
11646
11647
11648 Example: CHECK_STRUCT_HAS_MEMBER("struct timeval" tv_sec
11649 sys/select.h HAVE_TIMEVAL_TV_SEC)
11650
11651
11652 CheckSymbolExists
11653 Check if a symbol exists as a function, variable, or macro
11654
11655 CHECK_SYMBOL_EXISTS(<symbol> <files> <variable>)
11656
11657
11658 Check that the <symbol> is available after including given
11659 header <files> and store the result in a <variable>. Specify
11660 the list of files in one argument as a semicolon-separated list.
11661
11662
11663 If the header files define the symbol as a macro it is consid‐
11664 ered available and assumed to work. If the header files declare
11665 the symbol as a function or variable then the symbol must also
11666 be available for linking. If the symbol is a type or enum value
11667 it will not be recognized (consider using CheckTypeSize or
11668 CheckCSourceCompiles). If the check needs to be done in C++,
11669 consider using CHECK_CXX_SYMBOL_EXISTS(), which does the same as
11670 CHECK_SYMBOL_EXISTS(), but in C++.
11671
11672
11673 The following variables may be set before calling this macro to
11674 modify the way the check is run:
11675
11676
11677 CMAKE_REQUIRED_FLAGS = string of compile command line flags
11678 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
11679 CMAKE_REQUIRED_INCLUDES = list of include directories
11680 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
11681
11682
11683 CheckTypeSize
11684 Check sizeof a type
11685
11686 CHECK_TYPE_SIZE(TYPE VARIABLE [BUILTIN_TYPES_ONLY])
11687
11688 Check if the type exists and determine its size. On return,
11689 "HAVE_${VARIABLE}" holds the existence of the type, and "${VARI‐
11690 ABLE}" holds one of the following:
11691
11692
11693 <size> = type has non-zero size <size>
11694 "0" = type has arch-dependent size (see below)
11695 "" = type does not exist
11696
11697 Furthermore, the variable "${VARIABLE}_CODE" holds C preproces‐
11698 sor code to define the macro "${VARIABLE}" to the size of the
11699 type, or leave the macro undefined if the type does not exist.
11700
11701
11702 The variable "${VARIABLE}" may be "0" when CMAKE_OSX_ARCHITEC‐
11703 TURES has multiple architectures for building OS X universal
11704 binaries. This indicates that the type size varies across archi‐
11705 tectures. In this case "${VARIABLE}_CODE" contains C preproces‐
11706 sor tests mapping from each architecture macro to the corre‐
11707 sponding type size. The list of architecture macros is stored in
11708 "${VARIABLE}_KEYS", and the value for each key is stored in
11709 "${VARIABLE}-${KEY}".
11710
11711
11712 If the BUILTIN_TYPES_ONLY option is not given, the macro checks
11713 for headers <sys/types.h>, <stdint.h>, and <stddef.h>, and saves
11714 results in HAVE_SYS_TYPES_H, HAVE_STDINT_H, and HAVE_STDDEF_H.
11715 The type size check automatically includes the available head‐
11716 ers, thus supporting checks of types defined in the headers.
11717
11718
11719 Despite the name of the macro you may use it to check the size
11720 of more complex expressions, too. To check e.g. for the size of
11721 a struct member you can do something like this:
11722
11723
11724 check_type_size("((struct something*)0)->member" SIZEOF_MEMBER)
11725
11726
11727
11728
11729 The following variables may be set before calling this macro to
11730 modify the way the check is run:
11731
11732
11733 CMAKE_REQUIRED_FLAGS = string of compile command line flags
11734 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
11735 CMAKE_REQUIRED_INCLUDES = list of include directories
11736 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
11737 CMAKE_EXTRA_INCLUDE_FILES = list of extra headers to include
11738
11739
11740 CheckVariableExists
11741 Check if the variable exists.
11742
11743 CHECK_VARIABLE_EXISTS(VAR VARIABLE)
11744
11745
11746
11747
11748 VAR - the name of the variable
11749 VARIABLE - variable to store the result
11750
11751
11752
11753
11754 This macro is only for C variables.
11755
11756
11757 The following variables may be set before calling this macro to
11758 modify the way the check is run:
11759
11760
11761 CMAKE_REQUIRED_FLAGS = string of compile command line flags
11762 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
11763 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
11764
11765
11766 Dart Configure a project for testing with CTest or old Dart Tcl
11767 Client
11768
11769 This file is the backwards-compatibility version of the CTest
11770 module. It supports using the old Dart 1 Tcl client for driving
11771 dashboard submissions as well as testing with CTest. This mod‐
11772 ule should be included in the CMakeLists.txt file at the top of
11773 a project. Typical usage:
11774
11775
11776 include(Dart)
11777 if(BUILD_TESTING)
11778 # ... testing related CMake code ...
11779 endif()
11780
11781 The BUILD_TESTING option is created by the Dart module to deter‐
11782 mine whether testing support should be enabled. The default is
11783 ON.
11784
11785
11786 DeployQt4
11787 Functions to help assemble a standalone Qt4 executable.
11788
11789 A collection of CMake utility functions useful for deploying Qt4
11790 executables.
11791
11792
11793 The following functions are provided by this module:
11794
11795
11796 write_qt4_conf
11797 resolve_qt4_paths
11798 fixup_qt4_executable
11799 install_qt4_plugin_path
11800 install_qt4_plugin
11801 install_qt4_executable
11802
11803 Requires CMake 2.6 or greater because it uses function and PAR‐
11804 ENT_SCOPE. Also depends on BundleUtilities.cmake.
11805
11806
11807 WRITE_QT4_CONF(<qt_conf_dir> <qt_conf_contents>)
11808
11809 Writes a qt.conf file with the <qt_conf_contents> into
11810 <qt_conf_dir>.
11811
11812
11813 RESOLVE_QT4_PATHS(<paths_var> [<executable_path>])
11814
11815 Loop through <paths_var> list and if any don't exist resolve
11816 them relative to the <executable_path> (if supplied) or the
11817 CMAKE_INSTALL_PREFIX.
11818
11819
11820 FIXUP_QT4_EXECUTABLE(<executable> [<qtplugins> <libs> <dirs> <plugins_dir> <request_qt_conf>])
11821
11822 Copies Qt plugins, writes a Qt configuration file (if needed)
11823 and fixes up a Qt4 executable using BundleUtilities so it is
11824 standalone and can be drag-and-drop copied to another machine as
11825 long as all of the system libraries are compatible.
11826
11827
11828 <executable> should point to the executable to be fixed-up.
11829
11830
11831 <qtplugins> should contain a list of the names or paths of any
11832 Qt plugins to be installed.
11833
11834
11835 <libs> will be passed to BundleUtilities and should be a list of
11836 any already installed plugins, libraries or executables to also
11837 be fixed-up.
11838
11839
11840 <dirs> will be passed to BundleUtilities and should contain and
11841 directories to be searched to find library dependencies.
11842
11843
11844 <plugins_dir> allows an custom plugins directory to be used.
11845
11846
11847 <request_qt_conf> will force a qt.conf file to be written even
11848 if not needed.
11849
11850
11851 INSTALL_QT4_PLUGIN_PATH(plugin executable copy installed_plugin_path_var <plugins_dir> <component> <configurations>)
11852
11853 Install (or copy) a resolved <plugin> to the default plugins
11854 directory (or <plugins_dir>) relative to <executable> and store
11855 the result in <installed_plugin_path_var>.
11856
11857
11858 If <copy> is set to TRUE then the plugins will be copied rather
11859 than installed. This is to allow this module to be used at CMake
11860 time rather than install time.
11861
11862
11863 If <component> is set then anything installed will use this COM‐
11864 PONENT.
11865
11866
11867 INSTALL_QT4_PLUGIN(plugin executable copy installed_plugin_path_var <plugins_dir> <component>)
11868
11869 Install (or copy) an unresolved <plugin> to the default plugins
11870 directory (or <plugins_dir>) relative to <executable> and store
11871 the result in <installed_plugin_path_var>. See documentation of
11872 INSTALL_QT4_PLUGIN_PATH.
11873
11874
11875 INSTALL_QT4_EXECUTABLE(<executable> [<qtplugins> <libs> <dirs> <plugins_dir> <request_qt_conf> <component>])
11876
11877 Installs Qt plugins, writes a Qt configuration file (if needed)
11878 and fixes up a Qt4 executable using BundleUtilities so it is
11879 standalone and can be drag-and-drop copied to another machine as
11880 long as all of the system libraries are compatible. The exe‐
11881 cutable will be fixed-up at install time. <component> is the
11882 COMPONENT used for bundle fixup and plugin installation. See
11883 documentation of FIXUP_QT4_BUNDLE.
11884
11885
11886 Documentation
11887 DocumentationVTK.cmake
11888
11889 This file provides support for the VTK documentation framework.
11890 It relies on several tools (Doxygen, Perl, etc).
11891
11892
11893 ExternalData
11894 Manage data files stored outside source tree
11895
11896 Use this module to unambiguously reference data files stored
11897 outside the source tree and fetch them at build time from arbi‐
11898 trary local and remote content-addressed locations. Functions
11899 provided by this module recognize arguments with the syntax
11900 "DATA{<name>}" as references to external data, replace them with
11901 full paths to local copies of those data, and create build rules
11902 to fetch and update the local copies.
11903
11904
11905 The DATA{} syntax is literal and the <name> is a full or rela‐
11906 tive path within the source tree. The source tree must contain
11907 either a real data file at <name> or a "content link" at
11908 <name><ext> containing a hash of the real file using a hash
11909 algorithm corresponding to <ext>. For example, the argument
11910 "DATA{img.png}" may be satisfied by either a real "img.png" file
11911 in the current source directory or a "img.png.md5" file contain‐
11912 ing its MD5 sum.
11913
11914
11915 The 'ExternalData_Expand_Arguments' function evaluates DATA{}
11916 references in its arguments and constructs a new list of argu‐
11917 ments:
11918
11919
11920 ExternalData_Expand_Arguments(
11921 <target> # Name of data management target
11922 <outVar> # Output variable
11923 [args...] # Input arguments, DATA{} allowed
11924 )
11925
11926 It replaces each DATA{} reference in an argument with the full
11927 path of a real data file on disk that will exist after the <tar‐
11928 get> builds.
11929
11930
11931 The 'ExternalData_Add_Test' function wraps around the CMake
11932 add_test() command but supports DATA{} references in its argu‐
11933 ments:
11934
11935
11936 ExternalData_Add_Test(
11937 <target> # Name of data management target
11938 ... # Arguments of add_test(), DATA{} allowed
11939 )
11940
11941 It passes its arguments through ExternalData_Expand_Arguments
11942 and then invokes add_test() using the results.
11943
11944
11945 The 'ExternalData_Add_Target' function creates a custom target
11946 to manage local instances of data files stored externally:
11947
11948
11949 ExternalData_Add_Target(
11950 <target> # Name of data management target
11951 )
11952
11953 It creates custom commands in the target as necessary to make
11954 data files available for each DATA{} reference previously evalu‐
11955 ated by other functions provided by this module. A list of URL
11956 templates must be provided in the variable ExternalData_URL_TEM‐
11957 PLATES using the placeholders "%(algo)" and "%(hash)" in each
11958 template. Data fetch rules try each URL template in order by
11959 substituting the hash algorithm name for "%(algo)" and the hash
11960 value for "%(hash)".
11961
11962
11963 The following hash algorithms are supported:
11964
11965
11966 %(algo) <ext> Description
11967 ------- ----- -----------
11968 MD5 .md5 Message-Digest Algorithm 5, RFC 1321
11969 SHA1 .sha1 US Secure Hash Algorithm 1, RFC 3174
11970 SHA224 .sha224 US Secure Hash Algorithms, RFC 4634
11971 SHA256 .sha256 US Secure Hash Algorithms, RFC 4634
11972 SHA384 .sha384 US Secure Hash Algorithms, RFC 4634
11973 SHA512 .sha512 US Secure Hash Algorithms, RFC 4634
11974
11975 Note that the hashes are used only for unique data identifica‐
11976 tion and download verification. This is not security software.
11977
11978
11979 Example usage:
11980
11981
11982 include(ExternalData)
11983 set(ExternalData_URL_TEMPLATES "file:///local/%(algo)/%(hash)"
11984 "http://data.org/%(algo)/%(hash)")
11985 ExternalData_Add_Test(MyData
11986 NAME MyTest
11987 COMMAND MyExe DATA{MyInput.png}
11988 )
11989 ExternalData_Add_Target(MyData)
11990
11991 When test "MyTest" runs the "DATA{MyInput.png}" argument will be
11992 replaced by the full path to a real instance of the data file
11993 "MyInput.png" on disk. If the source tree contains a content
11994 link such as "MyInput.png.md5" then the "MyData" target creates
11995 a real "MyInput.png" in the build tree.
11996
11997
11998 The DATA{} syntax can be told to fetch a file series using the
11999 form "DATA{<name>,:}", where the ":" is literal. If the source
12000 tree contains a group of files or content links named like a
12001 series then a reference to one member adds rules to fetch all of
12002 them. Although all members of a series are fetched, only the
12003 file originally named by the DATA{} argument is substituted for
12004 it. The default configuration recognizes file series names end‐
12005 ing with "#.ext", "_#.ext", ".#.ext", or "-#.ext" where "#" is a
12006 sequence of decimal digits and ".ext" is any single extension.
12007 Configure it with a regex that parses <number> and <suffix>
12008 parts from the end of <name>:
12009
12010
12011 ExternalData_SERIES_PARSE = regex of the form (<number>)(<suffix>)$
12012
12013 For more complicated cases set:
12014
12015
12016 ExternalData_SERIES_PARSE = regex with at least two () groups
12017 ExternalData_SERIES_PARSE_PREFIX = <prefix> regex group number, if any
12018 ExternalData_SERIES_PARSE_NUMBER = <number> regex group number
12019 ExternalData_SERIES_PARSE_SUFFIX = <suffix> regex group number
12020
12021 Configure series number matching with a regex that matches the
12022 <number> part of series members named <prefix><number><suffix>:
12023
12024
12025 ExternalData_SERIES_MATCH = regex matching <number> in all series members
12026
12027 Note that the <suffix> of a series does not include a hash-algo‐
12028 rithm extension.
12029
12030
12031 The DATA{} syntax can alternatively match files associated with
12032 the named file and contained in the same directory. Associated
12033 files may be specified by options using the syntax
12034 DATA{<name>,<opt1>,<opt2>,...}. Each option may specify one
12035 file by name or specify a regular expression to match file names
12036 using the syntax REGEX:<regex>. For example, the arguments
12037
12038
12039 DATA{MyData/MyInput.mhd,MyInput.img} # File pair
12040 DATA{MyData/MyFrames00.png,REGEX:MyFrames[0-9]+\\.png} # Series
12041
12042 will pass MyInput.mha and MyFrames00.png on the command line but
12043 ensure that the associated files are present next to them.
12044
12045
12046 The DATA{} syntax may reference a directory using a trailing
12047 slash and a list of associated files. The form
12048 DATA{<name>/,<opt1>,<opt2>,...} adds rules to fetch any files in
12049 the directory that match one of the associated file options.
12050 For example, the argument DATA{MyDataDir/,REGEX:.*} will pass
12051 the full path to a MyDataDir directory on the command line and
12052 ensure that the directory contains files corresponding to every
12053 file or content link in the MyDataDir source directory.
12054
12055
12056 The variable ExternalData_LINK_CONTENT may be set to the name of
12057 a supported hash algorithm to enable automatic conversion of
12058 real data files referenced by the DATA{} syntax into content
12059 links. For each such <file> a content link named "<file><ext>"
12060 is created. The original file is renamed to the form ".Exter‐
12061 nalData_<algo>_<hash>" to stage it for future transmission to
12062 one of the locations in the list of URL templates (by means out‐
12063 side the scope of this module). The data fetch rule created for
12064 the content link will use the staged object if it cannot be
12065 found using any URL template.
12066
12067
12068 The variable ExternalData_OBJECT_STORES may be set to a list of
12069 local directories that store objects using the layout
12070 <dir>/%(algo)/%(hash). These directories will be searched first
12071 for a needed object. If the object is not available in any
12072 store then it will be fetched remotely using the URL templates
12073 and added to the first local store listed. If no stores are
12074 specified the default is a location inside the build tree.
12075
12076
12077 The variable ExternalData_SOURCE_ROOT may be set to the highest
12078 source directory containing any path named by a DATA{} refer‐
12079 ence. The default is CMAKE_SOURCE_DIR. External‐
12080 Data_SOURCE_ROOT and CMAKE_SOURCE_DIR must refer to directories
12081 within a single source distribution (e.g. they come together in
12082 one tarball).
12083
12084
12085 The variable ExternalData_BINARY_ROOT may be set to the direc‐
12086 tory to hold the real data files named by expanded DATA{} refer‐
12087 ences. The default is CMAKE_BINARY_DIR. The directory layout
12088 will mirror that of content links under External‐
12089 Data_SOURCE_ROOT.
12090
12091
12092 Variables ExternalData_TIMEOUT_INACTIVITY and ExternalData_TIME‐
12093 OUT_ABSOLUTE set the download inactivity and absolute timeouts,
12094 in seconds. The defaults are 60 seconds and 300 seconds,
12095 respectively. Set either timeout to 0 seconds to disable
12096 enforcement.
12097
12098
12099 ExternalProject
12100 Create custom targets to build projects in external trees
12101
12102 The 'ExternalProject_Add' function creates a custom target to
12103 drive download, update/patch, configure, build, install and test
12104 steps of an external project:
12105
12106
12107 ExternalProject_Add(<name> # Name for custom target
12108 [DEPENDS projects...] # Targets on which the project depends
12109 [PREFIX dir] # Root dir for entire project
12110 [LIST_SEPARATOR sep] # Sep to be replaced by ; in cmd lines
12111 [TMP_DIR dir] # Directory to store temporary files
12112 [STAMP_DIR dir] # Directory to store step timestamps
12113 #--Download step--------------
12114 [DOWNLOAD_NAME fname] # File name to store (if not end of URL)
12115 [DOWNLOAD_DIR dir] # Directory to store downloaded files
12116 [DOWNLOAD_COMMAND cmd...] # Command to download source tree
12117 [CVS_REPOSITORY cvsroot] # CVSROOT of CVS repository
12118 [CVS_MODULE mod] # Module to checkout from CVS repo
12119 [CVS_TAG tag] # Tag to checkout from CVS repo
12120 [SVN_REPOSITORY url] # URL of Subversion repo
12121 [SVN_REVISION rev] # Revision to checkout from Subversion repo
12122 [SVN_USERNAME john ] # Username for Subversion checkout and update
12123 [SVN_PASSWORD doe ] # Password for Subversion checkout and update
12124 [SVN_TRUST_CERT 1 ] # Trust the Subversion server site certificate
12125 [GIT_REPOSITORY url] # URL of git repo
12126 [GIT_TAG tag] # Git branch name, commit id or tag
12127 [HG_REPOSITORY url] # URL of mercurial repo
12128 [HG_TAG tag] # Mercurial branch name, commit id or tag
12129 [URL /.../src.tgz] # Full path or URL of source
12130 [URL_HASH ALGO=value] # Hash of file at URL
12131 [URL_MD5 md5] # Equivalent to URL_HASH MD5=md5
12132 [TLS_VERIFY bool] # Should certificate for https be checked
12133 [TLS_CAINFO file] # Path to a certificate authority file
12134 [TIMEOUT seconds] # Time allowed for file download operations
12135 #--Update/Patch step----------
12136 [UPDATE_COMMAND cmd...] # Source work-tree update command
12137 [PATCH_COMMAND cmd...] # Command to patch downloaded source
12138 #--Configure step-------------
12139 [SOURCE_DIR dir] # Source dir to be used for build
12140 [CONFIGURE_COMMAND cmd...] # Build tree configuration command
12141 [CMAKE_COMMAND /.../cmake] # Specify alternative cmake executable
12142 [CMAKE_GENERATOR gen] # Specify generator for native build
12143 [CMAKE_GENERATOR_TOOLSET t] # Generator-specific toolset name
12144 [CMAKE_ARGS args...] # Arguments to CMake command line
12145 [CMAKE_CACHE_ARGS args...] # Initial cache arguments, of the form -Dvar:string=on
12146 #--Build step-----------------
12147 [BINARY_DIR dir] # Specify build dir location
12148 [BUILD_COMMAND cmd...] # Command to drive the native build
12149 [BUILD_IN_SOURCE 1] # Use source dir for build dir
12150 #--Install step---------------
12151 [INSTALL_DIR dir] # Installation prefix
12152 [INSTALL_COMMAND cmd...] # Command to drive install after build
12153 #--Test step------------------
12154 [TEST_BEFORE_INSTALL 1] # Add test step executed before install step
12155 [TEST_AFTER_INSTALL 1] # Add test step executed after install step
12156 [TEST_COMMAND cmd...] # Command to drive test
12157 #--Output logging-------------
12158 [LOG_DOWNLOAD 1] # Wrap download in script to log output
12159 [LOG_UPDATE 1] # Wrap update in script to log output
12160 [LOG_CONFIGURE 1] # Wrap configure in script to log output
12161 [LOG_BUILD 1] # Wrap build in script to log output
12162 [LOG_TEST 1] # Wrap test in script to log output
12163 [LOG_INSTALL 1] # Wrap install in script to log output
12164 #--Custom targets-------------
12165 [STEP_TARGETS st1 st2 ...] # Generate custom targets for these steps
12166 )
12167
12168 The *_DIR options specify directories for the project, with
12169 default directories computed as follows. If the PREFIX option is
12170 given to ExternalProject_Add() or the EP_PREFIX directory prop‐
12171 erty is set, then an external project is built and installed
12172 under the specified prefix:
12173
12174
12175 TMP_DIR = <prefix>/tmp
12176 STAMP_DIR = <prefix>/src/<name>-stamp
12177 DOWNLOAD_DIR = <prefix>/src
12178 SOURCE_DIR = <prefix>/src/<name>
12179 BINARY_DIR = <prefix>/src/<name>-build
12180 INSTALL_DIR = <prefix>
12181
12182 Otherwise, if the EP_BASE directory property is set then compo‐
12183 nents of an external project are stored under the specified
12184 base:
12185
12186
12187 TMP_DIR = <base>/tmp/<name>
12188 STAMP_DIR = <base>/Stamp/<name>
12189 DOWNLOAD_DIR = <base>/Download/<name>
12190 SOURCE_DIR = <base>/Source/<name>
12191 BINARY_DIR = <base>/Build/<name>
12192 INSTALL_DIR = <base>/Install/<name>
12193
12194 If no PREFIX, EP_PREFIX, or EP_BASE is specified then the
12195 default is to set PREFIX to "<name>-prefix". Relative paths are
12196 interpreted with respect to the build directory corresponding to
12197 the source directory in which ExternalProject_Add is invoked.
12198
12199
12200 If SOURCE_DIR is explicitly set to an existing directory the
12201 project will be built from it. Otherwise a download step must be
12202 specified using one of the DOWNLOAD_COMMAND, CVS_*, SVN_*, or
12203 URL options. The URL option may refer locally to a directory or
12204 source tarball, or refer to a remote tarball (e.g.
12205 http://.../src.tgz).
12206
12207
12208 The 'ExternalProject_Add_Step' function adds a custom step to an
12209 external project:
12210
12211
12212 ExternalProject_Add_Step(<name> <step> # Names of project and custom step
12213 [COMMAND cmd...] # Command line invoked by this step
12214 [COMMENT "text..."] # Text printed when step executes
12215 [DEPENDEES steps...] # Steps on which this step depends
12216 [DEPENDERS steps...] # Steps that depend on this step
12217 [DEPENDS files...] # Files on which this step depends
12218 [ALWAYS 1] # No stamp file, step always runs
12219 [WORKING_DIRECTORY dir] # Working directory for command
12220 [LOG 1] # Wrap step in script to log output
12221 )
12222
12223 The command line, comment, and working directory of every stan‐
12224 dard and custom step is processed to replace tokens
12225 <SOURCE_DIR>, <BINARY_DIR>, <INSTALL_DIR>, and <TMP_DIR> with
12226 corresponding property values.
12227
12228
12229 Any builtin step that specifies a "<step>_COMMAND cmd..." or
12230 custom step that specifies a "COMMAND cmd..." may specify addi‐
12231 tional command lines using the form "COMMAND cmd...". At build
12232 time the commands will be executed in order and aborted if any
12233 one fails. For example:
12234
12235
12236 ... BUILD_COMMAND make COMMAND echo done ...
12237
12238 specifies to run "make" and then "echo done" during the build
12239 step. Whether the current working directory is preserved between
12240 commands is not defined. Behavior of shell operators like "&&"
12241 is not defined.
12242
12243
12244 The 'ExternalProject_Get_Property' function retrieves external
12245 project target properties:
12246
12247
12248 ExternalProject_Get_Property(<name> [prop1 [prop2 [...]]])
12249
12250 It stores property values in variables of the same name. Prop‐
12251 erty names correspond to the keyword argument names of 'Exter‐
12252 nalProject_Add'.
12253
12254
12255 The 'ExternalProject_Add_StepTargets' function generates custom
12256 targets for the steps listed:
12257
12258
12259 ExternalProject_Add_StepTargets(<name> [step1 [step2 [...]]])
12260
12261
12262
12263
12264 If STEP_TARGETS is set then ExternalProject_Add_StepTargets is
12265 automatically called at the end of matching calls to External‐
12266 Project_Add_Step. Pass STEP_TARGETS explicitly to individual
12267 ExternalProject_Add calls, or implicitly to all ExternalPro‐
12268 ject_Add calls by setting the directory property EP_STEP_TAR‐
12269 GETS.
12270
12271
12272 If STEP_TARGETS is not set, clients may still manually call
12273 ExternalProject_Add_StepTargets after calling ExternalPro‐
12274 ject_Add or ExternalProject_Add_Step.
12275
12276
12277 This functionality is provided to make it easy to drive the
12278 steps independently of each other by specifying targets on build
12279 command lines. For example, you may be submitting to a
12280 sub-project based dashboard, where you want to drive the config‐
12281 ure portion of the build, then submit to the dashboard, followed
12282 by the build portion, followed by tests. If you invoke a custom
12283 target that depends on a step halfway through the step depen‐
12284 dency chain, then all the previous steps will also run to ensure
12285 everything is up to date.
12286
12287
12288 For example, to drive configure, build and test steps indepen‐
12289 dently for each ExternalProject_Add call in your project, write
12290 the following line prior to any ExternalProject_Add calls in
12291 your CMakeLists file:
12292
12293
12294 set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure build test)
12295
12296
12297 FeatureSummary
12298 Macros for generating a summary of enabled/disabled features
12299
12300
12301
12302
12303 This module provides the macros feature_summary(), set_pack‐
12304 age_properties() and add_feature_info(). For compatibility it
12305 also still provides set_package_info(), set_feature_info(),
12306 print_enabled_features() and print_disabled_features().
12307
12308
12309 These macros can be used to generate a summary of enabled and
12310 disabled packages and/or feature for a build tree:
12311
12312
12313 -- The following OPTIONAL packages have been found:
12314 LibXml2 (required version >= 2.4) , XML processing library. , <http://xmlsoft.org>
12315 * Enables HTML-import in MyWordProcessor
12316 * Enables odt-export in MyWordProcessor
12317 PNG , A PNG image library. , <http://www.libpng.org/pub/png/>
12318 * Enables saving screenshots
12319 -- The following OPTIONAL packages have not been found:
12320 Lua51 , The Lua scripting language. , <http://www.lua.org>
12321 * Enables macros in MyWordProcessor
12322 Foo , Foo provides cool stuff.
12323
12324
12325
12326
12327
12328
12329
12330 FEATURE_SUMMARY( [FILENAME <file>]
12331 [APPEND]
12332 [VAR <variable_name>]
12333 [INCLUDE_QUIET_PACKAGES]
12334 [FATAL_ON_MISSING_REQUIRED_PACKAGES]
12335 [DESCRIPTION "Found packages:"]
12336 WHAT (ALL | PACKAGES_FOUND | PACKAGES_NOT_FOUND
12337 | ENABLED_FEATURES | DISABLED_FEATURES]
12338 )
12339
12340
12341
12342
12343 The FEATURE_SUMMARY() macro can be used to print information
12344 about enabled or disabled packages or features of a project. By
12345 default, only the names of the features/packages will be printed
12346 and their required version when one was specified. Use SET_PACK‐
12347 AGE_PROPERTIES() to add more useful information, like e.g. a
12348 download URL for the respective package or their purpose in the
12349 project.
12350
12351
12352 The WHAT option is the only mandatory option. Here you specify
12353 what information will be printed:
12354
12355
12356 ALL: print everything
12357 ENABLED_FEATURES: the list of all features which are enabled
12358 DISABLED_FEATURES: the list of all features which are disabled
12359 PACKAGES_FOUND: the list of all packages which have been found
12360 PACKAGES_NOT_FOUND: the list of all packages which have not been found
12361 OPTIONAL_PACKAGES_FOUND: only those packages which have been found which have the type OPTIONAL
12362 OPTIONAL_PACKAGES_NOT_FOUND: only those packages which have not been found which have the type OPTIONAL
12363 RECOMMENDED_PACKAGES_FOUND: only those packages which have been found which have the type RECOMMENDED
12364 RECOMMENDED_PACKAGES_NOT_FOUND: only those packages which have not been found which have the type RECOMMENDED
12365 REQUIRED_PACKAGES_FOUND: only those packages which have been found which have the type REQUIRED
12366 REQUIRED_PACKAGES_NOT_FOUND: only those packages which have not been found which have the type REQUIRED
12367 RUNTIME_PACKAGES_FOUND: only those packages which have been found which have the type RUNTIME
12368 RUNTIME_PACKAGES_NOT_FOUND: only those packages which have not been found which have the type RUNTIME
12369
12370
12371
12372
12373 If a FILENAME is given, the information is printed into this
12374 file. If APPEND is used, it is appended to this file, otherwise
12375 the file is overwritten if it already existed. If the VAR option
12376 is used, the information is "printed" into the specified vari‐
12377 able. If FILENAME is not used, the information is printed to the
12378 terminal. Using the DESCRIPTION option a description or headline
12379 can be set which will be printed above the actual content. If
12380 INCLUDE_QUIET_PACKAGES is given, packages which have been
12381 searched with find_package(... QUIET) will also be listed. By
12382 default they are skipped. If FATAL_ON_MISSING_REQUIRED_PACKAGES
12383 is given, CMake will abort if a package which is marked as
12384 REQUIRED has not been found.
12385
12386
12387 Example 1, append everything to a file:
12388
12389
12390 feature_summary(WHAT ALL
12391 FILENAME ${CMAKE_BINARY_DIR}/all.log APPEND)
12392
12393
12394
12395
12396 Example 2, print the enabled features into the variable enabled‐
12397 FeaturesText, including QUIET packages:
12398
12399
12400 feature_summary(WHAT ENABLED_FEATURES
12401 INCLUDE_QUIET_PACKAGES
12402 DESCRIPTION "Enabled Features:"
12403 VAR enabledFeaturesText)
12404 message(STATUS "${enabledFeaturesText}")
12405
12406
12407
12408
12409
12410
12411
12412 SET_PACKAGE_PROPERTIES(<name> PROPERTIES [ URL <url> ]
12413 [ DESCRIPTION <description> ]
12414 [ TYPE (RUNTIME|OPTIONAL|RECOMMENDED|REQUIRED) ]
12415 [ PURPOSE <purpose> ]
12416 )
12417
12418
12419
12420
12421 Use this macro to set up information about the named package,
12422 which can then be displayed via FEATURE_SUMMARY(). This can be
12423 done either directly in the Find-module or in the project which
12424 uses the module after the find_package() call. The features for
12425 which information can be set are added automatically by the
12426 find_package() command.
12427
12428
12429 URL: this should be the homepage of the package, or something
12430 similar. Ideally this is set already directly in the Find-mod‐
12431 ule.
12432
12433
12434 DESCRIPTION: A short description what that package is, at most
12435 one sentence. Ideally this is set already directly in the
12436 Find-module.
12437
12438
12439 TYPE: What type of dependency has the using project on that
12440 package. Default is OPTIONAL. In this case it is a package which
12441 can be used by the project when available at buildtime, but it
12442 also work without. RECOMMENDED is similar to OPTIONAL, i.e. the
12443 project will build if the package is not present, but the func‐
12444 tionality of the resulting binaries will be severly limited. If
12445 a REQUIRED package is not available at buildtime, the project
12446 may not even build. This can be combined with the FATAL_ON_MISS‐
12447 ING_REQUIRED_PACKAGES argument for feature_summary(). Last, a
12448 RUNTIME package is a package which is actually not used at all
12449 during the build, but which is required for actually running the
12450 resulting binaries. So if such a package is missing, the project
12451 can still be built, but it may not work later on. If set_pack‐
12452 age_properties() is called multiple times for the same package
12453 with different TYPEs, the TYPE is only changed to higher TYPEs (
12454 RUNTIME < OPTIONAL < RECOMMENDED < REQUIRED ), lower TYPEs are
12455 ignored. The TYPE property is project-specific, so it cannot be
12456 set by the Find-module, but must be set in the project.
12457
12458
12459 PURPOSE: This describes which features this package enables in
12460 the project, i.e. it tells the user what functionality he gets
12461 in the resulting binaries. If set_package_properties() is called
12462 multiple times for a package, all PURPOSE properties are
12463 appended to a list of purposes of the package in the project. As
12464 the TYPE property, also the PURPOSE property is project-spe‐
12465 cific, so it cannot be set by the Find-module, but must be set
12466 in the project.
12467
12468
12469
12470
12471
12472 Example for setting the info for a package:
12473
12474
12475 find_package(LibXml2)
12476 set_package_properties(LibXml2 PROPERTIES DESCRIPTION "A XML processing library."
12477 URL "http://xmlsoft.org/")
12478
12479
12480
12481
12482 set_package_properties(LibXml2 PROPERTIES TYPE RECOMMENDED
12483 PURPOSE "Enables HTML-import in MyWordProcessor")
12484 ...
12485 set_package_properties(LibXml2 PROPERTIES TYPE OPTIONAL
12486 PURPOSE "Enables odt-export in MyWordProcessor")
12487
12488
12489
12490
12491 find_package(DBUS)
12492 set_package_properties(DBUS PROPERTIES TYPE RUNTIME
12493 PURPOSE "Necessary to disable the screensaver during a presentation" )
12494
12495
12496
12497
12498 ADD_FEATURE_INFO(<name> <enabled> <description>)
12499
12500 Use this macro to add information about a feature with the given
12501 <name>. <enabled> contains whether this feature is enabled or
12502 not, <description> is a text describing the feature. The infor‐
12503 mation can be displayed using feature_summary() for ENABLED_FEA‐
12504 TURES and DISABLED_FEATURES respectively.
12505
12506
12507 Example for setting the info for a feature:
12508
12509
12510 option(WITH_FOO "Help for foo" ON)
12511 add_feature_info(Foo WITH_FOO "The Foo feature provides very cool stuff.")
12512
12513
12514
12515
12516
12517
12518
12519 The following macros are provided for compatibility with previ‐
12520 ous CMake versions:
12521
12522
12523 SET_PACKAGE_INFO(<name> <description> [<url> [<purpose>] ] )
12524
12525 Use this macro to set up information about the named package,
12526 which can then be displayed via FEATURE_SUMMARY(). This can be
12527 done either directly in the Find-module or in the project which
12528 uses the module after the find_package() call. The features for
12529 which information can be set are added automatically by the
12530 find_package() command.
12531
12532
12533 PRINT_ENABLED_FEATURES()
12534
12535 Does the same as FEATURE_SUMMARY(WHAT ENABLED_FEATURES DESCRIP‐
12536 TION "Enabled features:")
12537
12538
12539 PRINT_DISABLED_FEATURES()
12540
12541 Does the same as FEATURE_SUMMARY(WHAT DISABLED_FEATURES
12542 DESCRIPTION "Disabled features:")
12543
12544
12545 SET_FEATURE_INFO(<name> <description> [<url>] )
12546
12547 Does the same as SET_PACKAGE_INFO(<name> <description> <url> )
12548
12549
12550 FindALSA
12551 Find alsa
12552
12553 Find the alsa libraries (asound)
12554
12555
12556 This module defines the following variables:
12557 ALSA_FOUND - True if ALSA_INCLUDE_DIR & ALSA_LIBRARY are found
12558 ALSA_LIBRARIES - Set when ALSA_LIBRARY is found
12559 ALSA_INCLUDE_DIRS - Set when ALSA_INCLUDE_DIR is found
12560
12561
12562
12563
12564 ALSA_INCLUDE_DIR - where to find asoundlib.h, etc.
12565 ALSA_LIBRARY - the asound library
12566 ALSA_VERSION_STRING - the version of alsa found (since CMake 2.8.8)
12567
12568
12569
12570
12571
12572 FindASPELL
12573 Try to find ASPELL
12574
12575 Once done this will define
12576
12577
12578 ASPELL_FOUND - system has ASPELL
12579 ASPELL_EXECUTABLE - the ASPELL executable
12580 ASPELL_INCLUDE_DIR - the ASPELL include directory
12581 ASPELL_LIBRARIES - The libraries needed to use ASPELL
12582 ASPELL_DEFINITIONS - Compiler switches required for using ASPELL
12583
12584
12585 FindAVIFile
12586 Locate AVIFILE library and include paths
12587
12588 AVIFILE (http://avifile.sourceforge.net/)is a set of libraries
12589 for i386 machines to use various AVI codecs. Support is limited
12590 beyond Linux. Windows provides native AVI support, and so
12591 doesn't need this library. This module defines
12592
12593
12594 AVIFILE_INCLUDE_DIR, where to find avifile.h , etc.
12595 AVIFILE_LIBRARIES, the libraries to link against
12596 AVIFILE_DEFINITIONS, definitions to use when compiling
12597 AVIFILE_FOUND, If false, don't try to use AVIFILE
12598
12599
12600 FindArmadillo
12601 Find Armadillo
12602
12603 Find the Armadillo C++ library
12604
12605
12606 Using Armadillo:
12607
12608
12609 find_package(Armadillo REQUIRED)
12610 include_directories(${ARMADILLO_INCLUDE_DIRS})
12611 add_executable(foo foo.cc)
12612 target_link_libraries(foo ${ARMADILLO_LIBRARIES})
12613
12614 This module sets the following variables:
12615
12616
12617 ARMADILLO_FOUND - set to true if the library is found
12618 ARMADILLO_INCLUDE_DIRS - list of required include directories
12619 ARMADILLO_LIBRARIES - list of libraries to be linked
12620 ARMADILLO_VERSION_MAJOR - major version number
12621 ARMADILLO_VERSION_MINOR - minor version number
12622 ARMADILLO_VERSION_PATCH - patch version number
12623 ARMADILLO_VERSION_STRING - version number as a string (ex: "1.0.4")
12624 ARMADILLO_VERSION_NAME - name of the version (ex: "Antipodean Antileech")
12625
12626
12627 FindBISON
12628 Find bison executable and provides macros to generate custom
12629 build rules
12630
12631 The module defines the following variables:
12632
12633
12634 BISON_EXECUTABLE - path to the bison program
12635 BISON_VERSION - version of bison
12636 BISON_FOUND - true if the program was found
12637
12638
12639
12640
12641 The minimum required version of bison can be specified using the
12642 standard CMake syntax, e.g. find_package(BISON 2.1.3)
12643
12644
12645 If bison is found, the module defines the macros:
12646
12647
12648 BISON_TARGET(<Name> <YaccInput> <CodeOutput> [VERBOSE <file>]
12649 [COMPILE_FLAGS <string>])
12650
12651 which will create a custom rule to generate a parser. <YaccIn‐
12652 put> is the path to a yacc file. <CodeOutput> is the name of
12653 the source file generated by bison. A header file is also be
12654 generated, and contains the token list. If COMPILE_FLAGS
12655 option is specified, the next parameter is added in the
12656 bison command line. if VERBOSE option is specified, <file> is
12657 created and contains verbose descriptions of the grammar and
12658 parser. The macro defines a set of variables:
12659
12660
12661 BISON_${Name}_DEFINED - true is the macro ran successfully
12662 BISON_${Name}_INPUT - The input source file, an alias for <YaccInput>
12663 BISON_${Name}_OUTPUT_SOURCE - The source file generated by bison
12664 BISON_${Name}_OUTPUT_HEADER - The header file generated by bison
12665 BISON_${Name}_OUTPUTS - The sources files generated by bison
12666 BISON_${Name}_COMPILE_FLAGS - Options used in the bison command line
12667
12668
12669
12670
12671 ====================================================================
12672 Example:
12673
12674
12675
12676
12677 find_package(BISON)
12678 BISON_TARGET(MyParser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp)
12679 add_executable(Foo main.cpp ${BISON_MyParser_OUTPUTS})
12680 ====================================================================
12681
12682
12683 FindBLAS
12684 Find BLAS library
12685
12686 This module finds an installed fortran library that implements
12687 the BLAS linear-algebra interface (see
12688 http://www.netlib.org/blas/). The list of libraries searched for
12689 is taken from the autoconf macro file, acx_blas.m4 (distributed
12690 at http://ac-archive.sourceforge.net/ac-archive/acx_blas.html).
12691
12692
12693 This module sets the following variables:
12694
12695
12696 BLAS_FOUND - set to true if a library implementing the BLAS interface
12697 is found
12698 BLAS_LINKER_FLAGS - uncached list of required linker flags (excluding -l
12699 and -L).
12700 BLAS_LIBRARIES - uncached list of libraries (using full path name) to
12701 link against to use BLAS
12702 BLAS95_LIBRARIES - uncached list of libraries (using full path name)
12703 to link against to use BLAS95 interface
12704 BLAS95_FOUND - set to true if a library implementing the BLAS f95 interface
12705 is found
12706 BLA_STATIC if set on this determines what kind of linkage we do (static)
12707 BLA_VENDOR if set checks only the specified vendor, if not set checks
12708 all the possibilities
12709 BLA_F95 if set on tries to find the f95 interfaces for BLAS/LAPACK
12710
12711 C/CXX should be enabled to use Intel mkl
12712
12713
12714 FindBZip2
12715 Try to find BZip2
12716
12717 Once done this will define
12718
12719
12720 BZIP2_FOUND - system has BZip2
12721 BZIP2_INCLUDE_DIR - the BZip2 include directory
12722 BZIP2_LIBRARIES - Link these to use BZip2
12723 BZIP2_NEED_PREFIX - this is set if the functions are prefixed with BZ2_
12724 BZIP2_VERSION_STRING - the version of BZip2 found (since CMake 2.8.8)
12725
12726
12727 FindBoost
12728 Find Boost include dirs and libraries
12729
12730 Use this module by invoking find_package with the form:
12731
12732
12733 find_package(Boost
12734 [version] [EXACT] # Minimum or EXACT version e.g. 1.36.0
12735 [REQUIRED] # Fail with error if Boost is not found
12736 [COMPONENTS <libs>...] # Boost libraries by their canonical name
12737 ) # e.g. "date_time" for "libboost_date_time"
12738
12739 This module finds headers and requested component libraries OR a
12740 CMake package configuration file provided by a "Boost CMake"
12741 build. For the latter case skip to the "Boost CMake" section
12742 below. For the former case results are reported in variables:
12743
12744
12745 Boost_FOUND - True if headers and requested libraries were found
12746 Boost_INCLUDE_DIRS - Boost include directories
12747 Boost_LIBRARY_DIRS - Link directories for Boost libraries
12748 Boost_LIBRARIES - Boost component libraries to be linked
12749 Boost_<C>_FOUND - True if component <C> was found (<C> is upper-case)
12750 Boost_<C>_LIBRARY - Libraries to link for component <C> (may include
12751 target_link_libraries debug/optimized keywords)
12752 Boost_VERSION - BOOST_VERSION value from boost/version.hpp
12753 Boost_LIB_VERSION - Version string appended to library filenames
12754 Boost_MAJOR_VERSION - Boost major version number (X in X.y.z)
12755 Boost_MINOR_VERSION - Boost minor version number (Y in x.Y.z)
12756 Boost_SUBMINOR_VERSION - Boost subminor version number (Z in x.y.Z)
12757 Boost_LIB_DIAGNOSTIC_DEFINITIONS (Windows)
12758 - Pass to add_definitions() to have diagnostic
12759 information about Boost's automatic linking
12760 displayed during compilation
12761
12762
12763
12764
12765 This module reads hints about search locations from variables:
12766
12767
12768 BOOST_ROOT - Preferred installation prefix
12769 (or BOOSTROOT)
12770 BOOST_INCLUDEDIR - Preferred include directory e.g. <prefix>/include
12771 BOOST_LIBRARYDIR - Preferred library directory e.g. <prefix>/lib
12772 Boost_NO_SYSTEM_PATHS - Set to ON to disable searching in locations not
12773 specified by these hint variables. Default is OFF.
12774 Boost_ADDITIONAL_VERSIONS
12775 - List of Boost versions not known to this module
12776 (Boost install locations may contain the version)
12777
12778 and saves search results persistently in CMake cache entries:
12779
12780
12781 Boost_INCLUDE_DIR - Directory containing Boost headers
12782 Boost_LIBRARY_DIR - Directory containing Boost libraries
12783 Boost_<C>_LIBRARY_DEBUG - Component <C> library debug variant
12784 Boost_<C>_LIBRARY_RELEASE - Component <C> library release variant
12785
12786 Users may set these hints or results as cache entries. Projects
12787 should not read these entries directly but instead use the above
12788 result variables. Note that some hint names start in upper-case
12789 "BOOST". One may specify these as environment variables if they
12790 are not specified as CMake variables or cache entries.
12791
12792
12793 This module first searches for the Boost header files using the
12794 above hint variables (excluding BOOST_LIBRARYDIR) and saves the
12795 result in Boost_INCLUDE_DIR. Then it searches for requested
12796 component libraries using the above hints (excluding
12797 BOOST_INCLUDEDIR and Boost_ADDITIONAL_VERSIONS), "lib" directo‐
12798 ries near Boost_INCLUDE_DIR, and the library name configuration
12799 settings below. It saves the library directory in
12800 Boost_LIBRARY_DIR and individual library locations in
12801 Boost_<C>_LIBRARY_DEBUG and Boost_<C>_LIBRARY_RELEASE. When one
12802 changes settings used by previous searches in the same build
12803 tree (excluding environment variables) this module discards pre‐
12804 vious search results affected by the changes and searches again.
12805
12806
12807 Boost libraries come in many variants encoded in their file
12808 name. Users or projects may tell this module which variant to
12809 find by setting variables:
12810
12811
12812 Boost_USE_MULTITHREADED - Set to OFF to use the non-multithreaded
12813 libraries ('mt' tag). Default is ON.
12814 Boost_USE_STATIC_LIBS - Set to ON to force the use of the static
12815 libraries. Default is OFF.
12816 Boost_USE_STATIC_RUNTIME - Set to ON or OFF to specify whether to use
12817 libraries linked statically to the C++ runtime
12818 ('s' tag). Default is platform dependent.
12819 Boost_USE_DEBUG_PYTHON - Set to ON to use libraries compiled with a
12820 debug Python build ('y' tag). Default is OFF.
12821 Boost_USE_STLPORT - Set to ON to use libraries compiled with
12822 STLPort ('p' tag). Default is OFF.
12823 Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS
12824 - Set to ON to use libraries compiled with
12825 STLPort deprecated "native iostreams"
12826 ('n' tag). Default is OFF.
12827 Boost_COMPILER - Set to the compiler-specific library suffix
12828 (e.g. "-gcc43"). Default is auto-computed
12829 for the C++ compiler in use.
12830 Boost_THREADAPI - Suffix for "thread" component library name,
12831 such as "pthread" or "win32". Names with
12832 and without this suffix will both be tried.
12833
12834 Other variables one may set to control this module are:
12835
12836
12837 Boost_DEBUG - Set to ON to enable debug output from FindBoost.
12838 Please enable this before filing any bug report.
12839 Boost_DETAILED_FAILURE_MSG
12840 - Set to ON to add detailed information to the
12841 failure message even when the REQUIRED option
12842 is not given to the find_package call.
12843 Boost_REALPATH - Set to ON to resolve symlinks for discovered
12844 libraries to assist with packaging. For example,
12845 the "system" component library may be resolved to
12846 "/usr/lib/libboost_system.so.1.42.0" instead of
12847 "/usr/lib/libboost_system.so". This does not
12848 affect linking and should not be enabled unless
12849 the user needs this information.
12850
12851 On Visual Studio and Borland compilers Boost headers request
12852 automatic linking to corresponding libraries. This requires
12853 matching libraries to be linked explicitly or available in the
12854 link library search path. In this case setting
12855 Boost_USE_STATIC_LIBS to OFF may not achieve dynamic linking.
12856 Boost automatic linking typically requests static libraries with
12857 a few exceptions (such as Boost.Python). Use
12858
12859
12860 add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
12861
12862 to ask Boost to report information about automatic linking
12863 requests.
12864
12865
12866 Example to find Boost headers only:
12867
12868
12869 find_package(Boost 1.36.0)
12870 if(Boost_FOUND)
12871 include_directories(${Boost_INCLUDE_DIRS})
12872 add_executable(foo foo.cc)
12873 endif()
12874
12875 Example to find Boost headers and some libraries:
12876
12877
12878 set(Boost_USE_STATIC_LIBS ON)
12879 set(Boost_USE_MULTITHREADED ON)
12880 set(Boost_USE_STATIC_RUNTIME OFF)
12881 find_package(Boost 1.36.0 COMPONENTS date_time filesystem system ...)
12882 if(Boost_FOUND)
12883 include_directories(${Boost_INCLUDE_DIRS})
12884 add_executable(foo foo.cc)
12885 target_link_libraries(foo ${Boost_LIBRARIES})
12886 endif()
12887
12888
12889
12890
12891 Boost CMake
12892 ----------------------------------------------------------
12893
12894
12895 If Boost was built using the boost-cmake project it provides a
12896 package configuration file for use with find_package's Config
12897 mode. This module looks for the package configuration file
12898 called BoostConfig.cmake or boost-config.cmake and stores the
12899 result in cache entry "Boost_DIR". If found, the package con‐
12900 figuration file is loaded and this module returns with no fur‐
12901 ther action. See documentation of the Boost CMake package con‐
12902 figuration for details on what it provides.
12903
12904
12905 Set Boost_NO_BOOST_CMAKE to ON to disable the search for
12906 boost-cmake.
12907
12908
12909 FindBullet
12910 Try to find the Bullet physics engine
12911
12912
12913
12914
12915 This module defines the following variables
12916
12917
12918
12919
12920 BULLET_FOUND - Was bullet found
12921 BULLET_INCLUDE_DIRS - the Bullet include directories
12922 BULLET_LIBRARIES - Link to this, by default it includes
12923 all bullet components (Dynamics,
12924 Collision, LinearMath, & SoftBody)
12925
12926
12927
12928
12929 This module accepts the following variables
12930
12931
12932
12933
12934 BULLET_ROOT - Can be set to bullet install path or Windows build path
12935
12936
12937
12938
12939
12940 FindCABLE
12941 Find CABLE
12942
12943 This module finds if CABLE is installed and determines where the
12944 include files and libraries are. This code sets the following
12945 variables:
12946
12947
12948 CABLE the path to the cable executable
12949 CABLE_TCL_LIBRARY the path to the Tcl wrapper library
12950 CABLE_INCLUDE_DIR the path to the include directory
12951
12952
12953
12954
12955 To build Tcl wrappers, you should add shared library and link it
12956 to ${CABLE_TCL_LIBRARY}. You should also add
12957 ${CABLE_INCLUDE_DIR} as an include directory.
12958
12959
12960 FindCUDA
12961 Tools for building CUDA C files: libraries and build dependen‐
12962 cies.
12963
12964 This script locates the NVIDIA CUDA C tools. It should work on
12965 linux, windows, and mac and should be reasonably up to date with
12966 CUDA C releases.
12967
12968
12969 This script makes use of the standard find_package arguments of
12970 <VERSION>, REQUIRED and QUIET. CUDA_FOUND will report if an
12971 acceptable version of CUDA was found.
12972
12973
12974 The script will prompt the user to specify CUDA_TOOLKIT_ROOT_DIR
12975 if the prefix cannot be determined by the location of nvcc in
12976 the system path and REQUIRED is specified to find_package(). To
12977 use a different installed version of the toolkit set the envi‐
12978 ronment variable CUDA_BIN_PATH before running cmake (e.g.
12979 CUDA_BIN_PATH=/usr/local/cuda1.0 instead of the default
12980 /usr/local/cuda) or set CUDA_TOOLKIT_ROOT_DIR after configuring.
12981 If you change the value of CUDA_TOOLKIT_ROOT_DIR, various compo‐
12982 nents that depend on the path will be relocated.
12983
12984
12985 It might be necessary to set CUDA_TOOLKIT_ROOT_DIR manually on
12986 certain platforms, or to use a cuda runtime not installed in the
12987 default location. In newer versions of the toolkit the cuda
12988 library is included with the graphics driver- be sure that the
12989 driver version matches what is needed by the cuda runtime ver‐
12990 sion.
12991
12992
12993 The following variables affect the behavior of the macros in the
12994 script (in alphebetical order). Note that any of these flags
12995 can be changed multiple times in the same directory before call‐
12996 ing CUDA_ADD_EXECUTABLE, CUDA_ADD_LIBRARY, CUDA_COMPILE,
12997 CUDA_COMPILE_PTX or CUDA_WRAP_SRCS.
12998
12999
13000 CUDA_64_BIT_DEVICE_CODE (Default matches host bit size)
13001 -- Set to ON to compile for 64 bit device code, OFF for 32 bit device code.
13002 Note that making this different from the host code when generating object
13003 or C files from CUDA code just won't work, because size_t gets defined by
13004 nvcc in the generated source. If you compile to PTX and then load the
13005 file yourself, you can mix bit sizes between device and host.
13006
13007
13008
13009
13010 CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE (Default ON)
13011 -- Set to ON if you want the custom build rule to be attached to the source
13012 file in Visual Studio. Turn OFF if you add the same cuda file to multiple
13013 targets.
13014
13015
13016
13017
13018 This allows the user to build the target from the CUDA file; however, bad
13019 things can happen if the CUDA source file is added to multiple targets.
13020 When performing parallel builds it is possible for the custom build
13021 command to be run more than once and in parallel causing cryptic build
13022 errors. VS runs the rules for every source file in the target, and a
13023 source can have only one rule no matter how many projects it is added to.
13024 When the rule is run from multiple targets race conditions can occur on
13025 the generated file. Eventually everything will get built, but if the user
13026 is unaware of this behavior, there may be confusion. It would be nice if
13027 this script could detect the reuse of source files across multiple targets
13028 and turn the option off for the user, but no good solution could be found.
13029
13030
13031
13032
13033 CUDA_BUILD_CUBIN (Default OFF)
13034 -- Set to ON to enable and extra compilation pass with the -cubin option in
13035 Device mode. The output is parsed and register, shared memory usage is
13036 printed during build.
13037
13038
13039
13040
13041 CUDA_BUILD_EMULATION (Default OFF for device mode)
13042 -- Set to ON for Emulation mode. -D_DEVICEEMU is defined for CUDA C files
13043 when CUDA_BUILD_EMULATION is TRUE.
13044
13045
13046
13047
13048 CUDA_GENERATED_OUTPUT_DIR (Default CMAKE_CURRENT_BINARY_DIR)
13049 -- Set to the path you wish to have the generated files placed. If it is
13050 blank output files will be placed in CMAKE_CURRENT_BINARY_DIR.
13051 Intermediate files will always be placed in
13052 CMAKE_CURRENT_BINARY_DIR/CMakeFiles.
13053
13054
13055
13056
13057 CUDA_HOST_COMPILATION_CPP (Default ON)
13058 -- Set to OFF for C compilation of host code.
13059
13060
13061
13062
13063 CUDA_HOST_COMPILER (Default CMAKE_C_COMPILER, $(VCInstallDir)/bin for VS)
13064 -- Set the host compiler to be used by nvcc. Ignored if -ccbin or
13065 --compiler-bindir is already present in the CUDA_NVCC_FLAGS or
13066 CUDA_NVCC_FLAGS_<CONFIG> variables. For Visual Studio targets
13067 $(VCInstallDir)/bin is a special value that expands out to the path when
13068 the command is run from withing VS.
13069
13070
13071
13072
13073 CUDA_NVCC_FLAGS
13074 CUDA_NVCC_FLAGS_<CONFIG>
13075 -- Additional NVCC command line arguments. NOTE: multiple arguments must be
13076 semi-colon delimited (e.g. --compiler-options;-Wall)
13077
13078
13079
13080
13081 CUDA_PROPAGATE_HOST_FLAGS (Default ON)
13082 -- Set to ON to propagate CMAKE_{C,CXX}_FLAGS and their configuration
13083 dependent counterparts (e.g. CMAKE_C_FLAGS_DEBUG) automatically to the
13084 host compiler through nvcc's -Xcompiler flag. This helps make the
13085 generated host code match the rest of the system better. Sometimes
13086 certain flags give nvcc problems, and this will help you turn the flag
13087 propagation off. This does not affect the flags supplied directly to nvcc
13088 via CUDA_NVCC_FLAGS or through the OPTION flags specified through
13089 CUDA_ADD_LIBRARY, CUDA_ADD_EXECUTABLE, or CUDA_WRAP_SRCS. Flags used for
13090 shared library compilation are not affected by this flag.
13091
13092
13093
13094
13095 CUDA_SEPARABLE_COMPILATION (Default OFF)
13096 -- If set this will enable separable compilation for all CUDA runtime object
13097 files. If used outside of CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY
13098 (e.g. calling CUDA_WRAP_SRCS directly),
13099 CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME and
13100 CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS should be called.
13101
13102
13103
13104
13105 CUDA_VERBOSE_BUILD (Default OFF)
13106 -- Set to ON to see all the commands used when building the CUDA file. When
13107 using a Makefile generator the value defaults to VERBOSE (run make
13108 VERBOSE=1 to see output), although setting CUDA_VERBOSE_BUILD to ON will
13109 always print the output.
13110
13111
13112
13113
13114 The script creates the following macros (in alphebetical order):
13115
13116
13117 CUDA_ADD_CUFFT_TO_TARGET( cuda_target )
13118 -- Adds the cufft library to the target (can be any target). Handles whether
13119 you are in emulation mode or not.
13120
13121
13122
13123
13124 CUDA_ADD_CUBLAS_TO_TARGET( cuda_target )
13125 -- Adds the cublas library to the target (can be any target). Handles
13126 whether you are in emulation mode or not.
13127
13128
13129
13130
13131 CUDA_ADD_EXECUTABLE( cuda_target file0 file1 ...
13132 [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL] [OPTIONS ...] )
13133 -- Creates an executable "cuda_target" which is made up of the files
13134 specified. All of the non CUDA C files are compiled using the standard
13135 build rules specified by CMAKE and the cuda files are compiled to object
13136 files using nvcc and the host compiler. In addition CUDA_INCLUDE_DIRS is
13137 added automatically to include_directories(). Some standard CMake target
13138 calls can be used on the target after calling this macro
13139 (e.g. set_target_properties and target_link_libraries), but setting
13140 properties that adjust compilation flags will not affect code compiled by
13141 nvcc. Such flags should be modified before calling CUDA_ADD_EXECUTABLE,
13142 CUDA_ADD_LIBRARY or CUDA_WRAP_SRCS.
13143
13144
13145
13146
13147 CUDA_ADD_LIBRARY( cuda_target file0 file1 ...
13148 [STATIC | SHARED | MODULE] [EXCLUDE_FROM_ALL] [OPTIONS ...] )
13149 -- Same as CUDA_ADD_EXECUTABLE except that a library is created.
13150
13151
13152
13153
13154 CUDA_BUILD_CLEAN_TARGET()
13155 -- Creates a convience target that deletes all the dependency files
13156 generated. You should make clean after running this target to ensure the
13157 dependency files get regenerated.
13158
13159
13160
13161
13162 CUDA_COMPILE( generated_files file0 file1 ... [STATIC | SHARED | MODULE]
13163 [OPTIONS ...] )
13164 -- Returns a list of generated files from the input source files to be used
13165 with ADD_LIBRARY or ADD_EXECUTABLE.
13166
13167
13168
13169
13170 CUDA_COMPILE_PTX( generated_files file0 file1 ... [OPTIONS ...] )
13171 -- Returns a list of PTX files generated from the input source files.
13172
13173
13174
13175
13176 CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME( output_file_var
13177 cuda_target
13178 object_files )
13179 -- Compute the name of the intermediate link file used for separable
13180 compilation. This file name is typically passed into
13181 CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS. output_file_var is produced
13182 based on cuda_target the list of objects files that need separable
13183 compilation as specified by object_files. If the object_files list is
13184 empty, then output_file_var will be empty. This function is called
13185 automatically for CUDA_ADD_LIBRARY and CUDA_ADD_EXECUTABLE. Note that
13186 this is a function and not a macro.
13187
13188
13189
13190
13191 CUDA_INCLUDE_DIRECTORIES( path0 path1 ... )
13192 -- Sets the directories that should be passed to nvcc
13193 (e.g. nvcc -Ipath0 -Ipath1 ... ). These paths usually contain other .cu
13194 files.
13195
13196
13197
13198
13199
13200
13201
13202 CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS( output_file_var cuda_target
13203 nvcc_flags object_files)
13204
13205
13206
13207
13208 -- Generates the link object required by separable compilation from the given
13209 object files. This is called automatically for CUDA_ADD_EXECUTABLE and
13210 CUDA_ADD_LIBRARY, but can be called manually when using CUDA_WRAP_SRCS
13211 directly. When called from CUDA_ADD_LIBRARY or CUDA_ADD_EXECUTABLE the
13212 nvcc_flags passed in are the same as the flags passed in via the OPTIONS
13213 argument. The only nvcc flag added automatically is the bitness flag as
13214 specified by CUDA_64_BIT_DEVICE_CODE. Note that this is a function
13215 instead of a macro.
13216
13217
13218
13219
13220 CUDA_WRAP_SRCS ( cuda_target format generated_files file0 file1 ...
13221 [STATIC | SHARED | MODULE] [OPTIONS ...] )
13222 -- This is where all the magic happens. CUDA_ADD_EXECUTABLE,
13223 CUDA_ADD_LIBRARY, CUDA_COMPILE, and CUDA_COMPILE_PTX all call this
13224 function under the hood.
13225
13226
13227
13228
13229 Given the list of files (file0 file1 ... fileN) this macro generates
13230 custom commands that generate either PTX or linkable objects (use "PTX" or
13231 "OBJ" for the format argument to switch). Files that don't end with .cu
13232 or have the HEADER_FILE_ONLY property are ignored.
13233
13234
13235
13236
13237 The arguments passed in after OPTIONS are extra command line options to
13238 give to nvcc. You can also specify per configuration options by
13239 specifying the name of the configuration followed by the options. General
13240 options must preceed configuration specific options. Not all
13241 configurations need to be specified, only the ones provided will be used.
13242
13243
13244
13245
13246 OPTIONS -DFLAG=2 "-DFLAG_OTHER=space in flag"
13247 DEBUG -g
13248 RELEASE --use_fast_math
13249 RELWITHDEBINFO --use_fast_math;-g
13250 MINSIZEREL --use_fast_math
13251
13252
13253
13254
13255 For certain configurations (namely VS generating object files with
13256 CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE set to ON), no generated file will
13257 be produced for the given cuda file. This is because when you add the
13258 cuda file to Visual Studio it knows that this file produces an object file
13259 and will link in the resulting object file automatically.
13260
13261
13262
13263
13264 This script will also generate a separate cmake script that is used at
13265 build time to invoke nvcc. This is for several reasons.
13266
13267
13268
13269
13270 1. nvcc can return negative numbers as return values which confuses
13271 Visual Studio into thinking that the command succeeded. The script now
13272 checks the error codes and produces errors when there was a problem.
13273
13274
13275
13276
13277 2. nvcc has been known to not delete incomplete results when it
13278 encounters problems. This confuses build systems into thinking the
13279 target was generated when in fact an unusable file exists. The script
13280 now deletes the output files if there was an error.
13281
13282
13283
13284
13285 3. By putting all the options that affect the build into a file and then
13286 make the build rule dependent on the file, the output files will be
13287 regenerated when the options change.
13288
13289
13290
13291
13292 This script also looks at optional arguments STATIC, SHARED, or MODULE to
13293 determine when to target the object compilation for a shared library.
13294 BUILD_SHARED_LIBS is ignored in CUDA_WRAP_SRCS, but it is respected in
13295 CUDA_ADD_LIBRARY. On some systems special flags are added for building
13296 objects intended for shared libraries. A preprocessor macro,
13297 <target_name>_EXPORTS is defined when a shared library compilation is
13298 detected.
13299
13300
13301
13302
13303 Flags passed into add_definitions with -D or /D are passed along to nvcc.
13304
13305
13306
13307
13308 The script defines the following variables:
13309
13310
13311 CUDA_VERSION_MAJOR -- The major version of cuda as reported by nvcc.
13312 CUDA_VERSION_MINOR -- The minor version.
13313 CUDA_VERSION
13314 CUDA_VERSION_STRING -- CUDA_VERSION_MAJOR.CUDA_VERSION_MINOR
13315
13316
13317
13318
13319 CUDA_TOOLKIT_ROOT_DIR -- Path to the CUDA Toolkit (defined if not set).
13320 CUDA_SDK_ROOT_DIR -- Path to the CUDA SDK. Use this to find files in the
13321 SDK. This script will not directly support finding
13322 specific libraries or headers, as that isn't
13323 supported by NVIDIA. If you want to change
13324 libraries when the path changes see the
13325 FindCUDA.cmake script for an example of how to clear
13326 these variables. There are also examples of how to
13327 use the CUDA_SDK_ROOT_DIR to locate headers or
13328 libraries, if you so choose (at your own risk).
13329 CUDA_INCLUDE_DIRS -- Include directory for cuda headers. Added automatically
13330 for CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY.
13331 CUDA_LIBRARIES -- Cuda RT library.
13332 CUDA_CUFFT_LIBRARIES -- Device or emulation library for the Cuda FFT
13333 implementation (alternative to:
13334 CUDA_ADD_CUFFT_TO_TARGET macro)
13335 CUDA_CUBLAS_LIBRARIES -- Device or emulation library for the Cuda BLAS
13336 implementation (alterative to:
13337 CUDA_ADD_CUBLAS_TO_TARGET macro).
13338 CUDA_cupti_LIBRARY -- CUDA Profiling Tools Interface library.
13339 Only available for CUDA version 4.0+.
13340 CUDA_curand_LIBRARY -- CUDA Random Number Generation library.
13341 Only available for CUDA version 3.2+.
13342 CUDA_cusparse_LIBRARY -- CUDA Sparse Matrix library.
13343 Only available for CUDA version 3.2+.
13344 CUDA_npp_LIBRARY -- NVIDIA Performance Primitives library.
13345 Only available for CUDA version 4.0+.
13346 CUDA_nppc_LIBRARY -- NVIDIA Performance Primitives library (core).
13347 Only available for CUDA version 5.5+.
13348 CUDA_nppi_LIBRARY -- NVIDIA Performance Primitives library (image processing).
13349 Only available for CUDA version 5.5+.
13350 CUDA_npps_LIBRARY -- NVIDIA Performance Primitives library (signal processing).
13351 Only available for CUDA version 5.5+.
13352 CUDA_nvcuvenc_LIBRARY -- CUDA Video Encoder library.
13353 Only available for CUDA version 3.2+.
13354 Windows only.
13355 CUDA_nvcuvid_LIBRARY -- CUDA Video Decoder library.
13356 Only available for CUDA version 3.2+.
13357 Windows only.
13358
13359
13360
13361
13362
13363
13364
13365 James Bigler, NVIDIA Corp (nvidia.com - jbigler)
13366 Abe Stephens, SCI Institute -- http://www.sci.utah.edu/~abe/FindCuda.html
13367
13368
13369
13370
13371 Copyright (c) 2008 - 2009 NVIDIA Corporation. All rights reserved.
13372
13373
13374
13375
13376 Copyright (c) 2007-2009
13377 Scientific Computing and Imaging Institute, University of Utah
13378
13379
13380
13381
13382 This code is licensed under the MIT License. See the FindCUDA.cmake script
13383 for the text of the license.
13384
13385
13386 FindCURL
13387 Find curl
13388
13389 Find the native CURL headers and libraries.
13390
13391
13392 CURL_INCLUDE_DIRS - where to find curl/curl.h, etc.
13393 CURL_LIBRARIES - List of libraries when using curl.
13394 CURL_FOUND - True if curl found.
13395 CURL_VERSION_STRING - the version of curl found (since CMake 2.8.8)
13396
13397
13398 FindCVS
13399
13400
13401 The module defines the following variables:
13402
13403
13404 CVS_EXECUTABLE - path to cvs command line client
13405 CVS_FOUND - true if the command line client was found
13406
13407 Example usage:
13408
13409
13410 find_package(CVS)
13411 if(CVS_FOUND)
13412 message("CVS found: ${CVS_EXECUTABLE}")
13413 endif()
13414
13415
13416 FindCoin3D
13417 Find Coin3D (Open Inventor)
13418
13419 Coin3D is an implementation of the Open Inventor API. It pro‐
13420 vides data structures and algorithms for 3D visualization
13421 http://www.coin3d.org/
13422
13423
13424 This module defines the following variables
13425
13426
13427 COIN3D_FOUND - system has Coin3D - Open Inventor
13428 COIN3D_INCLUDE_DIRS - where the Inventor include directory can be found
13429 COIN3D_LIBRARIES - Link to this to use Coin3D
13430
13431
13432
13433
13434
13435 FindCups
13436 Try to find the Cups printing system
13437
13438 Once done this will define
13439
13440
13441 CUPS_FOUND - system has Cups
13442 CUPS_INCLUDE_DIR - the Cups include directory
13443 CUPS_LIBRARIES - Libraries needed to use Cups
13444 CUPS_VERSION_STRING - version of Cups found (since CMake 2.8.8)
13445 Set CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE to TRUE if you need a version which
13446 features this function (i.e. at least 1.1.19)
13447
13448
13449 FindCurses
13450 Find the curses include file and library
13451
13452
13453
13454
13455 CURSES_FOUND - system has Curses
13456 CURSES_INCLUDE_DIR - the Curses include directory
13457 CURSES_LIBRARIES - The libraries needed to use Curses
13458 CURSES_HAVE_CURSES_H - true if curses.h is available
13459 CURSES_HAVE_NCURSES_H - true if ncurses.h is available
13460 CURSES_HAVE_NCURSES_NCURSES_H - true if ncurses/ncurses.h is available
13461 CURSES_HAVE_NCURSES_CURSES_H - true if ncurses/curses.h is available
13462 CURSES_LIBRARY - set for backwards compatibility with 2.4 CMake
13463
13464
13465
13466
13467 Set CURSES_NEED_NCURSES to TRUE before the find_package() com‐
13468 mand if NCurses functionality is required.
13469
13470
13471 FindCxxTest
13472 Find CxxTest
13473
13474 Find the CxxTest suite and declare a helper macro for creating
13475 unit tests and integrating them with CTest. For more details on
13476 CxxTest see http://cxxtest.tigris.org
13477
13478
13479 INPUT Variables
13480
13481
13482 CXXTEST_USE_PYTHON [deprecated since 1.3]
13483 Only used in the case both Python & Perl
13484 are detected on the system to control
13485 which CxxTest code generator is used.
13486 Valid only for CxxTest version 3.
13487
13488
13489
13490
13491 NOTE: In older versions of this Find Module,
13492 this variable controlled if the Python test
13493 generator was used instead of the Perl one,
13494 regardless of which scripting language the
13495 user had installed.
13496
13497
13498
13499
13500 CXXTEST_TESTGEN_ARGS (since CMake 2.8.3)
13501 Specify a list of options to pass to the CxxTest code
13502 generator. If not defined, --error-printer is
13503 passed.
13504
13505
13506
13507
13508 OUTPUT Variables
13509
13510
13511 CXXTEST_FOUND
13512 True if the CxxTest framework was found
13513 CXXTEST_INCLUDE_DIRS
13514 Where to find the CxxTest include directory
13515 CXXTEST_PERL_TESTGEN_EXECUTABLE
13516 The perl-based test generator
13517 CXXTEST_PYTHON_TESTGEN_EXECUTABLE
13518 The python-based test generator
13519 CXXTEST_TESTGEN_EXECUTABLE (since CMake 2.8.3)
13520 The test generator that is actually used (chosen using user preferences
13521 and interpreters found in the system)
13522 CXXTEST_TESTGEN_INTERPRETER (since CMake 2.8.3)
13523 The full path to the Perl or Python executable on the system
13524
13525
13526
13527
13528 MACROS for optional use by CMake users:
13529
13530
13531 CXXTEST_ADD_TEST(<test_name> <gen_source_file> <input_files_to_testgen...>)
13532 Creates a CxxTest runner and adds it to the CTest testing suite
13533 Parameters:
13534 test_name The name of the test
13535 gen_source_file The generated source filename to be
13536 generated by CxxTest
13537 input_files_to_testgen The list of header files containing the
13538 CxxTest::TestSuite's to be included in
13539 this runner
13540
13541
13542
13543
13544 #==============
13545 Example Usage:
13546
13547
13548
13549
13550 find_package(CxxTest)
13551 if(CXXTEST_FOUND)
13552 include_directories(${CXXTEST_INCLUDE_DIR})
13553 enable_testing()
13554
13555
13556
13557
13558 CXXTEST_ADD_TEST(unittest_foo foo_test.cc
13559 ${CMAKE_CURRENT_SOURCE_DIR}/foo_test.h)
13560 target_link_libraries(unittest_foo foo) # as needed
13561 endif()
13562
13563
13564
13565
13566 This will (if CxxTest is found):
13567 1. Invoke the testgen executable to autogenerate foo_test.cc in the
13568 binary tree from "foo_test.h" in the current source directory.
13569 2. Create an executable and test called unittest_foo.
13570
13571
13572
13573
13574 #=============
13575 Example foo_test.h:
13576
13577
13578
13579
13580 #include <cxxtest/TestSuite.h>
13581
13582
13583
13584
13585 class MyTestSuite : public CxxTest::TestSuite
13586 {
13587 public:
13588 void testAddition( void )
13589 {
13590 TS_ASSERT( 1 + 1 > 1 );
13591 TS_ASSERT_EQUALS( 1 + 1, 2 );
13592 }
13593 };
13594
13595
13596
13597
13598
13599 FindCygwin
13600 this module looks for Cygwin
13601
13602
13603
13604
13605
13606 FindDCMTK
13607 find DCMTK libraries and applications
13608
13609
13610
13611
13612
13613 FindDart
13614 Find DART
13615
13616 This module looks for the dart testing software and sets
13617 DART_ROOT to point to where it found it.
13618
13619
13620
13621 FindDevIL
13622
13623
13624 This module locates the developer's image library. http://ope‐
13625 nil.sourceforge.net/
13626
13627
13628 This module sets:
13629
13630
13631 IL_LIBRARIES - the name of the IL library. These include the full path to
13632 the core DevIL library. This one has to be linked into the
13633 application.
13634 ILU_LIBRARIES - the name of the ILU library. Again, the full path. This
13635 library is for filters and effects, not actual loading. It
13636 doesn't have to be linked if the functionality it provides
13637 is not used.
13638 ILUT_LIBRARIES - the name of the ILUT library. Full path. This part of the
13639 library interfaces with OpenGL. It is not strictly needed
13640 in applications.
13641 IL_INCLUDE_DIR - where to find the il.h, ilu.h and ilut.h files.
13642 IL_FOUND - this is set to TRUE if all the above variables were set.
13643 This will be set to false if ILU or ILUT are not found,
13644 even if they are not needed. In most systems, if one
13645 library is found all the others are as well. That's the
13646 way the DevIL developers release it.
13647
13648
13649 FindDoxygen
13650 This module looks for Doxygen and the path to Graphviz's dot
13651
13652 Doxygen is a documentation generation tool. Please see
13653 http://www.doxygen.org
13654
13655
13656 This module accepts the following optional variables:
13657
13658
13659 DOXYGEN_SKIP_DOT = If true this module will skip trying to find Dot
13660 (an optional component often used by Doxygen)
13661
13662
13663
13664
13665 This modules defines the following variables:
13666
13667
13668 DOXYGEN_EXECUTABLE = The path to the doxygen command.
13669 DOXYGEN_FOUND = Was Doxygen found or not?
13670 DOXYGEN_VERSION = The version reported by doxygen --version
13671
13672
13673
13674
13675 DOXYGEN_DOT_EXECUTABLE = The path to the dot program used by doxygen.
13676 DOXYGEN_DOT_FOUND = Was Dot found or not?
13677 DOXYGEN_DOT_PATH = The path to dot not including the executable
13678
13679
13680
13681
13682
13683
13684
13685
13686 FindEXPAT
13687 Find expat
13688
13689 Find the native EXPAT headers and libraries.
13690
13691
13692 EXPAT_INCLUDE_DIRS - where to find expat.h, etc.
13693 EXPAT_LIBRARIES - List of libraries when using expat.
13694 EXPAT_FOUND - True if expat found.
13695
13696
13697 FindFLEX
13698 Find flex executable and provides a macro to generate custom
13699 build rules
13700
13701
13702
13703
13704 The module defines the following variables:
13705
13706
13707 FLEX_FOUND - true is flex executable is found
13708 FLEX_EXECUTABLE - the path to the flex executable
13709 FLEX_VERSION - the version of flex
13710 FLEX_LIBRARIES - The flex libraries
13711 FLEX_INCLUDE_DIRS - The path to the flex headers
13712
13713
13714
13715
13716 The minimum required version of flex can be specified using the
13717 standard syntax, e.g. find_package(FLEX 2.5.13)
13718
13719
13720
13721
13722
13723 If flex is found on the system, the module provides the macro:
13724
13725
13726 FLEX_TARGET(Name FlexInput FlexOutput [COMPILE_FLAGS <string>])
13727
13728 which creates a custom command to generate the <FlexOutput>
13729 file from the <FlexInput> file. If COMPILE_FLAGS option is
13730 specified, the next parameter is added to the flex command
13731 line. Name is an alias used to get details of this custom
13732 command. Indeed the macro defines the following variables:
13733
13734
13735 FLEX_${Name}_DEFINED - true is the macro ran successfully
13736 FLEX_${Name}_OUTPUTS - the source file generated by the custom rule, an
13737 alias for FlexOutput
13738 FLEX_${Name}_INPUT - the flex source file, an alias for ${FlexInput}
13739
13740
13741
13742
13743 Flex scanners oftenly use tokens defined by Bison: the code
13744 generated by Flex depends of the header generated by Bison.
13745 This module also defines a macro:
13746
13747
13748 ADD_FLEX_BISON_DEPENDENCY(FlexTarget BisonTarget)
13749
13750 which adds the required dependency between a scanner and a
13751 parser where <FlexTarget> and <BisonTarget> are the first
13752 parameters of respectively FLEX_TARGET and BISON_TARGET macros.
13753
13754
13755 ====================================================================
13756 Example:
13757
13758
13759
13760
13761 find_package(BISON)
13762 find_package(FLEX)
13763
13764
13765
13766
13767 BISON_TARGET(MyParser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp)
13768 FLEX_TARGET(MyScanner lexer.l ${CMAKE_CURRENT_BINARY_DIR}/lexer.cpp)
13769 ADD_FLEX_BISON_DEPENDENCY(MyScanner MyParser)
13770
13771
13772
13773
13774 include_directories(${CMAKE_CURRENT_BINARY_DIR})
13775 add_executable(Foo
13776 Foo.cc
13777 ${BISON_MyParser_OUTPUTS}
13778 ${FLEX_MyScanner_OUTPUTS}
13779 )
13780 ====================================================================
13781
13782
13783 FindFLTK
13784 Find the native FLTK includes and library
13785
13786
13787
13788
13789 By default FindFLTK.cmake will search for all of the FLTK compo‐
13790 nents and add them to the FLTK_LIBRARIES variable.
13791
13792
13793 You can limit the components which get placed in FLTK_LIBRARIES by
13794 defining one or more of the following three options:
13795
13796
13797
13798
13799 FLTK_SKIP_OPENGL, set to true to disable searching for opengl and
13800 the FLTK GL library
13801 FLTK_SKIP_FORMS, set to true to disable searching for fltk_forms
13802 FLTK_SKIP_IMAGES, set to true to disable searching for fltk_images
13803
13804
13805
13806
13807 FLTK_SKIP_FLUID, set to true if the fluid binary need not be present
13808 at build time
13809
13810
13811
13812
13813 The following variables will be defined:
13814
13815
13816 FLTK_FOUND, True if all components not skipped were found
13817 FLTK_INCLUDE_DIR, where to find include files
13818 FLTK_LIBRARIES, list of fltk libraries you should link against
13819 FLTK_FLUID_EXECUTABLE, where to find the Fluid tool
13820 FLTK_WRAP_UI, This enables the FLTK_WRAP_UI command
13821
13822
13823
13824
13825 The following cache variables are assigned but should not be
13826 used. See the FLTK_LIBRARIES variable instead.
13827
13828
13829 FLTK_BASE_LIBRARY = the full path to fltk.lib
13830 FLTK_GL_LIBRARY = the full path to fltk_gl.lib
13831 FLTK_FORMS_LIBRARY = the full path to fltk_forms.lib
13832 FLTK_IMAGES_LIBRARY = the full path to fltk_images.lib
13833
13834
13835 FindFLTK2
13836 Find the native FLTK2 includes and library
13837
13838 The following settings are defined
13839
13840
13841 FLTK2_FLUID_EXECUTABLE, where to find the Fluid tool
13842 FLTK2_WRAP_UI, This enables the FLTK2_WRAP_UI command
13843 FLTK2_INCLUDE_DIR, where to find include files
13844 FLTK2_LIBRARIES, list of fltk2 libraries
13845 FLTK2_FOUND, Don't use FLTK2 if false.
13846
13847 The following settings should not be used in general.
13848
13849
13850 FLTK2_BASE_LIBRARY = the full path to fltk2.lib
13851 FLTK2_GL_LIBRARY = the full path to fltk2_gl.lib
13852 FLTK2_IMAGES_LIBRARY = the full path to fltk2_images.lib
13853
13854
13855 FindFreetype
13856 Locate FreeType library
13857
13858 This module defines
13859
13860
13861 FREETYPE_LIBRARIES, the library to link against
13862 FREETYPE_FOUND, if false, do not try to link to FREETYPE
13863 FREETYPE_INCLUDE_DIRS, where to find headers.
13864 FREETYPE_VERSION_STRING, the version of freetype found (since CMake 2.8.8)
13865 This is the concatenation of the paths:
13866 FREETYPE_INCLUDE_DIR_ft2build
13867 FREETYPE_INCLUDE_DIR_freetype2
13868
13869
13870
13871
13872 $FREETYPE_DIR is an environment variable that would correspond
13873 to the ./configure --prefix=$FREETYPE_DIR used in building
13874 FREETYPE.
13875
13876
13877 FindGCCXML
13878 Find the GCC-XML front-end executable.
13879
13880
13881
13882
13883 This module will define the following variables:
13884
13885
13886 GCCXML - the GCC-XML front-end executable.
13887
13888
13889 FindGDAL
13890
13891
13892 Locate gdal
13893
13894
13895 This module accepts the following environment variables:
13896
13897
13898 GDAL_DIR or GDAL_ROOT - Specify the location of GDAL
13899
13900
13901
13902
13903 This module defines the following CMake variables:
13904
13905
13906 GDAL_FOUND - True if libgdal is found
13907 GDAL_LIBRARY - A variable pointing to the GDAL library
13908 GDAL_INCLUDE_DIR - Where to find the headers
13909
13910
13911 FindGIF
13912
13913
13914 This module searches giflib and defines GIF_LIBRARIES -
13915 libraries to link to in order to use GIF GIF_FOUND, if false, do
13916 not try to link GIF_INCLUDE_DIR, where to find the headers
13917 GIF_VERSION, reports either version 4 or 3 (for everything
13918 before version 4)
13919
13920
13921 The minimum required version of giflib can be specified using
13922 the standard syntax, e.g. find_package(GIF 4)
13923
13924
13925 $GIF_DIR is an environment variable that would correspond to the
13926 ./configure --prefix=$GIF_DIR
13927
13928
13929 FindGLEW
13930 Find the OpenGL Extension Wrangler Library (GLEW)
13931
13932 This module defines the following variables:
13933
13934
13935 GLEW_INCLUDE_DIRS - include directories for GLEW
13936 GLEW_LIBRARIES - libraries to link against GLEW
13937 GLEW_FOUND - true if GLEW has been found and can be used
13938
13939
13940 FindGLUT
13941 try to find glut library and include files
13942
13943 GLUT_INCLUDE_DIR, where to find GL/glut.h, etc.
13944 GLUT_LIBRARIES, the libraries to link against
13945 GLUT_FOUND, If false, do not try to use GLUT.
13946
13947 Also defined, but not for general use are:
13948
13949
13950 GLUT_glut_LIBRARY = the full path to the glut library.
13951 GLUT_Xmu_LIBRARY = the full path to the Xmu library.
13952 GLUT_Xi_LIBRARY = the full path to the Xi Library.
13953
13954
13955 FindGTK
13956 try to find GTK (and glib) and GTKGLArea
13957
13958 GTK_INCLUDE_DIR - Directories to include to use GTK
13959 GTK_LIBRARIES - Files to link against to use GTK
13960 GTK_FOUND - GTK was found
13961 GTK_GL_FOUND - GTK's GL features were found
13962
13963
13964 FindGTK2
13965 FindGTK2.cmake
13966
13967 This module can find the GTK2 widget libraries and several of
13968 its other optional components like gtkmm, glade, and glademm.
13969
13970
13971 NOTE: If you intend to use version checking, CMake 2.6.2 or
13972 later is
13973
13974
13975 required.
13976
13977
13978
13979
13980 Specify one or more of the following components as you call this
13981 find module. See example below.
13982
13983
13984 gtk
13985 gtkmm
13986 glade
13987 glademm
13988
13989
13990
13991
13992 The following variables will be defined for your use
13993
13994
13995 GTK2_FOUND - Were all of your specified components found?
13996 GTK2_INCLUDE_DIRS - All include directories
13997 GTK2_LIBRARIES - All libraries
13998 GTK2_DEFINITIONS - Additional compiler flags
13999
14000
14001
14002
14003 GTK2_VERSION - The version of GTK2 found (x.y.z)
14004 GTK2_MAJOR_VERSION - The major version of GTK2
14005 GTK2_MINOR_VERSION - The minor version of GTK2
14006 GTK2_PATCH_VERSION - The patch version of GTK2
14007
14008
14009
14010
14011 Optional variables you can define prior to calling this module:
14012
14013
14014 GTK2_DEBUG - Enables verbose debugging of the module
14015 GTK2_ADDITIONAL_SUFFIXES - Allows defining additional directories to
14016 search for include files
14017
14018
14019
14020
14021 ================= Example Usage:
14022
14023
14024 Call find_package() once, here are some examples to pick from:
14025
14026
14027
14028
14029 Require GTK 2.6 or later
14030 find_package(GTK2 2.6 REQUIRED gtk)
14031
14032
14033
14034
14035 Require GTK 2.10 or later and Glade
14036 find_package(GTK2 2.10 REQUIRED gtk glade)
14037
14038
14039
14040
14041 Search for GTK/GTKMM 2.8 or later
14042 find_package(GTK2 2.8 COMPONENTS gtk gtkmm)
14043
14044
14045
14046
14047 if(GTK2_FOUND)
14048 include_directories(${GTK2_INCLUDE_DIRS})
14049 add_executable(mygui mygui.cc)
14050 target_link_libraries(mygui ${GTK2_LIBRARIES})
14051 endif()
14052
14053
14054
14055
14056
14057 FindGTest
14058 --------------------
14059
14060 Locate the Google C++ Testing Framework.
14061
14062
14063 Defines the following variables:
14064
14065
14066 GTEST_FOUND - Found the Google Testing framework
14067 GTEST_INCLUDE_DIRS - Include directories
14068
14069
14070
14071
14072 Also defines the library variables below as normal variables.
14073 These contain debug/optimized keywords when a debugging library
14074 is found.
14075
14076
14077 GTEST_BOTH_LIBRARIES - Both libgtest & libgtest-main
14078 GTEST_LIBRARIES - libgtest
14079 GTEST_MAIN_LIBRARIES - libgtest-main
14080
14081
14082
14083
14084 Accepts the following variables as input:
14085
14086
14087 GTEST_ROOT - (as a CMake or environment variable)
14088 The root directory of the gtest install prefix
14089
14090
14091
14092
14093 GTEST_MSVC_SEARCH - If compiling with MSVC, this variable can be set to
14094 "MD" or "MT" to enable searching a GTest build tree
14095 (defaults: "MD")
14096
14097
14098
14099
14100 Example Usage:
14101
14102
14103 enable_testing()
14104 find_package(GTest REQUIRED)
14105 include_directories(${GTEST_INCLUDE_DIRS})
14106
14107
14108
14109
14110 add_executable(foo foo.cc)
14111 target_link_libraries(foo ${GTEST_BOTH_LIBRARIES})
14112
14113
14114
14115
14116 add_test(AllTestsInFoo foo)
14117
14118
14119
14120
14121
14122
14123
14124 If you would like each Google test to show up in CTest as a test
14125 you may use the following macro. NOTE: It will slow down your
14126 tests by running an executable for each test and test fixture.
14127 You will also have to rerun CMake after adding or removing tests
14128 or test fixtures.
14129
14130
14131 GTEST_ADD_TESTS(executable extra_args ARGN)
14132
14133
14134 executable = The path to the test executable
14135 extra_args = Pass a list of extra arguments to be passed to
14136 executable enclosed in quotes (or "" for none)
14137 ARGN = A list of source files to search for tests & test
14138 fixtures.
14139
14140
14141
14142
14143 Example:
14144 set(FooTestArgs --foo 1 --bar 2)
14145 add_executable(FooTest FooUnitTest.cc)
14146 GTEST_ADD_TESTS(FooTest "${FooTestArgs}" FooUnitTest.cc)
14147
14148
14149 FindGettext
14150 Find GNU gettext tools
14151
14152 This module looks for the GNU gettext tools. This module defines
14153 the following values:
14154
14155
14156 GETTEXT_MSGMERGE_EXECUTABLE: the full path to the msgmerge tool.
14157 GETTEXT_MSGFMT_EXECUTABLE: the full path to the msgfmt tool.
14158 GETTEXT_FOUND: True if gettext has been found.
14159 GETTEXT_VERSION_STRING: the version of gettext found (since CMake 2.8.8)
14160
14161
14162
14163
14164 Additionally it provides the following macros: GETTEXT_CRE‐
14165 ATE_TRANSLATIONS ( outputFile [ALL] file1 ... fileN )
14166
14167
14168 This will create a target "translations" which will convert the
14169 given input po files into the binary output mo file. If the
14170 ALL option is used, the translations will also be created when
14171 building the default target.
14172
14173 GETTEXT_PROCESS_POT( <potfile> [ALL] [INSTALL_DESTINATION <dest‐
14174 dir>] LANGUAGES <lang1> <lang2> ... )
14175
14176
14177 Process the given pot file to mo files.
14178 If INSTALL_DESTINATION is given then automatically install rules will be created,
14179 the language subdirectory will be taken into account (by default use share/locale/).
14180 If ALL is specified, the pot file is processed when building the all traget.
14181 It creates a custom target "potfile".
14182
14183 GETTEXT_PROCESS_PO_FILES( <lang> [ALL] [INSTALL_DESTINATION
14184 <dir>] PO_FILES <po1> <po2> ... )
14185
14186
14187 Process the given po files to mo files for the given language.
14188 If INSTALL_DESTINATION is given then automatically install rules will be created,
14189 the language subdirectory will be taken into account (by default use share/locale/).
14190 If ALL is specified, the po files are processed when building the all traget.
14191 It creates a custom target "pofiles".
14192
14193
14194 FindGit
14195
14196
14197 The module defines the following variables:
14198
14199
14200 GIT_EXECUTABLE - path to git command line client
14201 GIT_FOUND - true if the command line client was found
14202 GIT_VERSION_STRING - the version of git found (since CMake 2.8.8)
14203
14204 Example usage:
14205
14206
14207 find_package(Git)
14208 if(GIT_FOUND)
14209 message("git found: ${GIT_EXECUTABLE}")
14210 endif()
14211
14212
14213 FindGnuTLS
14214 Try to find the GNU Transport Layer Security library (gnutls)
14215
14216
14217
14218
14219 Once done this will define
14220
14221
14222 GNUTLS_FOUND - System has gnutls
14223 GNUTLS_INCLUDE_DIR - The gnutls include directory
14224 GNUTLS_LIBRARIES - The libraries needed to use gnutls
14225 GNUTLS_DEFINITIONS - Compiler switches required for using gnutls
14226
14227
14228 FindGnuplot
14229 this module looks for gnuplot
14230
14231
14232
14233
14234 Once done this will define
14235
14236
14237 GNUPLOT_FOUND - system has Gnuplot
14238 GNUPLOT_EXECUTABLE - the Gnuplot executable
14239 GNUPLOT_VERSION_STRING - the version of Gnuplot found (since CMake 2.8.8)
14240
14241
14242
14243
14244 GNUPLOT_VERSION_STRING will not work for old versions like
14245 3.7.1.
14246
14247
14248 FindHDF5
14249 Find HDF5, a library for reading and writing self describing
14250 array data.
14251
14252
14253
14254
14255 This module invokes the HDF5 wrapper compiler that should be
14256 installed alongside HDF5. Depending upon the HDF5 Configura‐
14257 tion, the wrapper compiler is called either h5cc or h5pcc. If
14258 this succeeds, the module will then call the compiler with the
14259 -show argument to see what flags are used when compiling an HDF5
14260 client application.
14261
14262
14263 The module will optionally accept the COMPONENTS argument. If
14264 no COMPONENTS are specified, then the find module will default
14265 to finding only the HDF5 C library. If one or more COMPONENTS
14266 are specified, the module will attempt to find the language
14267 bindings for the specified components. The only valid compo‐
14268 nents are C, CXX, Fortran, HL, and Fortran_HL. If the COMPO‐
14269 NENTS argument is not given, the module will attempt to find
14270 only the C bindings.
14271
14272
14273 On UNIX systems, this module will read the variable
14274 HDF5_USE_STATIC_LIBRARIES to determine whether or not to prefer
14275 a static link to a dynamic link for HDF5 and all of it's depen‐
14276 dencies. To use this feature, make sure that the
14277 HDF5_USE_STATIC_LIBRARIES variable is set before the call to
14278 find_package.
14279
14280
14281 To provide the module with a hint about where to find your HDF5
14282 installation, you can set the environment variable HDF5_ROOT.
14283 The Find module will then look in this path when searching for
14284 HDF5 executables, paths, and libraries.
14285
14286
14287 In addition to finding the includes and libraries required to
14288 compile an HDF5 client application, this module also makes an
14289 effort to find tools that come with the HDF5 distribution that
14290 may be useful for regression testing.
14291
14292
14293 This module will define the following variables:
14294
14295
14296 HDF5_INCLUDE_DIRS - Location of the hdf5 includes
14297 HDF5_INCLUDE_DIR - Location of the hdf5 includes (deprecated)
14298 HDF5_DEFINITIONS - Required compiler definitions for HDF5
14299 HDF5_C_LIBRARIES - Required libraries for the HDF5 C bindings.
14300 HDF5_CXX_LIBRARIES - Required libraries for the HDF5 C++ bindings
14301 HDF5_Fortran_LIBRARIES - Required libraries for the HDF5 Fortran bindings
14302 HDF5_HL_LIBRARIES - Required libraries for the HDF5 high level API
14303 HDF5_Fortran_HL_LIBRARIES - Required libraries for the high level Fortran
14304 bindings.
14305 HDF5_LIBRARIES - Required libraries for all requested bindings
14306 HDF5_FOUND - true if HDF5 was found on the system
14307 HDF5_LIBRARY_DIRS - the full set of library directories
14308 HDF5_IS_PARALLEL - Whether or not HDF5 was found with parallel IO support
14309 HDF5_C_COMPILER_EXECUTABLE - the path to the HDF5 C wrapper compiler
14310 HDF5_CXX_COMPILER_EXECUTABLE - the path to the HDF5 C++ wrapper compiler
14311 HDF5_Fortran_COMPILER_EXECUTABLE - the path to the HDF5 Fortran wrapper compiler
14312 HDF5_DIFF_EXECUTABLE - the path to the HDF5 dataset comparison tool
14313
14314
14315 FindHSPELL
14316 Try to find Hspell
14317
14318 Once done this will define
14319
14320
14321 HSPELL_FOUND - system has Hspell
14322 HSPELL_INCLUDE_DIR - the Hspell include directory
14323 HSPELL_LIBRARIES - The libraries needed to use Hspell
14324 HSPELL_DEFINITIONS - Compiler switches required for using Hspell
14325
14326
14327
14328
14329 HSPELL_VERSION_STRING - The version of Hspell found (x.y)
14330 HSPELL_MAJOR_VERSION - the major version of Hspell
14331 HSPELL_MINOR_VERSION - The minor version of Hspell
14332
14333
14334 FindHTMLHelp
14335 This module looks for Microsoft HTML Help Compiler
14336
14337 It defines:
14338
14339
14340 HTML_HELP_COMPILER : full path to the Compiler (hhc.exe)
14341 HTML_HELP_INCLUDE_PATH : include path to the API (htmlhelp.h)
14342 HTML_HELP_LIBRARY : full path to the library (htmlhelp.lib)
14343
14344
14345
14346
14347
14348 FindHg
14349
14350
14351 The module defines the following variables:
14352
14353
14354 HG_EXECUTABLE - path to mercurial command line client (hg)
14355 HG_FOUND - true if the command line client was found
14356 HG_VERSION_STRING - the version of mercurial found
14357
14358 Example usage:
14359
14360
14361 find_package(Hg)
14362 if(HG_FOUND)
14363 message("hg found: ${HG_EXECUTABLE}")
14364 endif()
14365
14366
14367 FindITK
14368 Find an ITK installation or build tree.
14369
14370
14371 FindIcotool
14372 Find icotool
14373
14374 This module looks for icotool. This module defines the following
14375 values:
14376
14377
14378 ICOTOOL_EXECUTABLE: the full path to the icotool tool.
14379 ICOTOOL_FOUND: True if icotool has been found.
14380 ICOTOOL_VERSION_STRING: the version of icotool found.
14381
14382
14383
14384
14385
14386 FindImageMagick
14387 Find the ImageMagick binary suite.
14388
14389 This module will search for a set of ImageMagick tools specified
14390 as components in the FIND_PACKAGE call. Typical components
14391 include, but are not limited to (future versions of ImageMagick
14392 might have additional components not listed here):
14393
14394
14395 animate
14396 compare
14397 composite
14398 conjure
14399 convert
14400 display
14401 identify
14402 import
14403 mogrify
14404 montage
14405 stream
14406
14407
14408
14409
14410 If no component is specified in the FIND_PACKAGE call, then it
14411 only searches for the ImageMagick executable directory. This
14412 code defines the following variables:
14413
14414
14415 ImageMagick_FOUND - TRUE if all components are found.
14416 ImageMagick_EXECUTABLE_DIR - Full path to executables directory.
14417 ImageMagick_<component>_FOUND - TRUE if <component> is found.
14418 ImageMagick_<component>_EXECUTABLE - Full path to <component> executable.
14419 ImageMagick_VERSION_STRING - the version of ImageMagick found
14420 (since CMake 2.8.8)
14421
14422
14423
14424
14425 ImageMagick_VERSION_STRING will not work for old versions like
14426 5.2.3.
14427
14428
14429 There are also components for the following ImageMagick APIs:
14430
14431
14432 Magick++
14433 MagickWand
14434 MagickCore
14435
14436
14437
14438
14439 For these components the following variables are set:
14440
14441
14442 ImageMagick_FOUND - TRUE if all components are found.
14443 ImageMagick_INCLUDE_DIRS - Full paths to all include dirs.
14444 ImageMagick_LIBRARIES - Full paths to all libraries.
14445 ImageMagick_<component>_FOUND - TRUE if <component> is found.
14446 ImageMagick_<component>_INCLUDE_DIRS - Full path to <component> include dirs.
14447 ImageMagick_<component>_LIBRARIES - Full path to <component> libraries.
14448
14449
14450
14451
14452 Example Usages:
14453
14454
14455 find_package(ImageMagick)
14456 find_package(ImageMagick COMPONENTS convert)
14457 find_package(ImageMagick COMPONENTS convert mogrify display)
14458 find_package(ImageMagick COMPONENTS Magick++)
14459 find_package(ImageMagick COMPONENTS Magick++ convert)
14460
14461
14462
14463
14464 Note that the standard FIND_PACKAGE features are supported
14465 (i.e., QUIET, REQUIRED, etc.).
14466
14467
14468 FindJNI
14469 Find JNI java libraries.
14470
14471 This module finds if Java is installed and determines where the
14472 include files and libraries are. It also determines what the
14473 name of the library is. This code sets the following variables:
14474
14475
14476 JNI_INCLUDE_DIRS = the include dirs to use
14477 JNI_LIBRARIES = the libraries to use
14478 JNI_FOUND = TRUE if JNI headers and libraries were found.
14479 JAVA_AWT_LIBRARY = the path to the jawt library
14480 JAVA_JVM_LIBRARY = the path to the jvm library
14481 JAVA_INCLUDE_PATH = the include path to jni.h
14482 JAVA_INCLUDE_PATH2 = the include path to jni_md.h
14483 JAVA_AWT_INCLUDE_PATH = the include path to jawt.h
14484
14485
14486
14487
14488
14489 FindJPEG
14490 Find JPEG
14491
14492 Find the native JPEG includes and library This module defines
14493
14494
14495 JPEG_INCLUDE_DIR, where to find jpeglib.h, etc.
14496 JPEG_LIBRARIES, the libraries needed to use JPEG.
14497 JPEG_FOUND, If false, do not try to use JPEG.
14498
14499 also defined, but not for general use are
14500
14501
14502 JPEG_LIBRARY, where to find the JPEG library.
14503
14504
14505 FindJasper
14506 Try to find the Jasper JPEG2000 library
14507
14508 Once done this will define
14509
14510
14511 JASPER_FOUND - system has Jasper
14512 JASPER_INCLUDE_DIR - the Jasper include directory
14513 JASPER_LIBRARIES - the libraries needed to use Jasper
14514 JASPER_VERSION_STRING - the version of Jasper found (since CMake 2.8.8)
14515
14516
14517 FindJava
14518 Find Java
14519
14520 This module finds if Java is installed and determines where the
14521 include files and libraries are. This code sets the following
14522 variables:
14523
14524
14525 Java_JAVA_EXECUTABLE = the full path to the Java runtime
14526 Java_JAVAC_EXECUTABLE = the full path to the Java compiler
14527 Java_JAVAH_EXECUTABLE = the full path to the Java header generator
14528 Java_JAVADOC_EXECUTABLE = the full path to the Java documention generator
14529 Java_JAR_EXECUTABLE = the full path to the Java archiver
14530 Java_VERSION_STRING = Version of the package found (java version), eg. 1.6.0_12
14531 Java_VERSION_MAJOR = The major version of the package found.
14532 Java_VERSION_MINOR = The minor version of the package found.
14533 Java_VERSION_PATCH = The patch version of the package found.
14534 Java_VERSION_TWEAK = The tweak version of the package found (after '_')
14535 Java_VERSION = This is set to: $major.$minor.$patch(.$tweak)
14536
14537
14538
14539
14540 The minimum required version of Java can be specified using the
14541 standard CMake syntax, e.g. find_package(Java 1.5)
14542
14543
14544 NOTE: ${Java_VERSION} and ${Java_VERSION_STRING} are not guaran‐
14545 teed to be identical. For example some java version may return:
14546 Java_VERSION_STRING = 1.5.0_17 and Java_VERSION =
14547 1.5.0.17
14548
14549
14550 another example is the Java OEM, with: Java_VERSION_STRING =
14551 1.6.0-oem and Java_VERSION = 1.6.0
14552
14553
14554 For these components the following variables are set:
14555
14556
14557 Java_FOUND - TRUE if all components are found.
14558 Java_INCLUDE_DIRS - Full paths to all include dirs.
14559 Java_LIBRARIES - Full paths to all libraries.
14560 Java_<component>_FOUND - TRUE if <component> is found.
14561
14562
14563
14564
14565 Example Usages:
14566
14567
14568 find_package(Java)
14569 find_package(Java COMPONENTS Runtime)
14570 find_package(Java COMPONENTS Development)
14571
14572
14573
14574
14575
14576 FindKDE3
14577 Find the KDE3 include and library dirs, KDE preprocessors and
14578 define a some macros
14579
14580
14581
14582
14583 This module defines the following variables:
14584
14585
14586 KDE3_DEFINITIONS - compiler definitions required for compiling KDE software
14587 KDE3_INCLUDE_DIR - the KDE include directory
14588 KDE3_INCLUDE_DIRS - the KDE and the Qt include directory, for use with include_directories()
14589 KDE3_LIB_DIR - the directory where the KDE libraries are installed, for use with link_directories()
14590 QT_AND_KDECORE_LIBS - this contains both the Qt and the kdecore library
14591 KDE3_DCOPIDL_EXECUTABLE - the dcopidl executable
14592 KDE3_DCOPIDL2CPP_EXECUTABLE - the dcopidl2cpp executable
14593 KDE3_KCFGC_EXECUTABLE - the kconfig_compiler executable
14594 KDE3_FOUND - set to TRUE if all of the above has been found
14595
14596
14597
14598
14599 The following user adjustable options are provided:
14600
14601
14602 KDE3_BUILD_TESTS - enable this to build KDE testcases
14603
14604
14605
14606
14607
14608
14609
14610 It also adds the following macros (from KDE3Macros.cmake)
14611 SRCS_VAR is always the variable which contains the list of
14612 source files for your application or library.
14613
14614
14615 KDE3_AUTOMOC(file1 ... fileN)
14616
14617
14618 Call this if you want to have automatic moc file handling.
14619 This means if you include "foo.moc" in the source file foo.cpp
14620 a moc file for the header foo.h will be created automatically.
14621 You can set the property SKIP_AUTOMAKE using set_source_files_properties()
14622 to exclude some files in the list from being processed.
14623
14624
14625
14626
14627 KDE3_ADD_MOC_FILES(SRCS_VAR file1 ... fileN )
14628
14629
14630 If you don't use the KDE3_AUTOMOC() macro, for the files
14631 listed here moc files will be created (named "foo.moc.cpp")
14632
14633
14634
14635
14636 KDE3_ADD_DCOP_SKELS(SRCS_VAR header1.h ... headerN.h )
14637
14638
14639 Use this to generate DCOP skeletions from the listed headers.
14640
14641
14642
14643
14644 KDE3_ADD_DCOP_STUBS(SRCS_VAR header1.h ... headerN.h )
14645
14646
14647 Use this to generate DCOP stubs from the listed headers.
14648
14649
14650
14651
14652 KDE3_ADD_UI_FILES(SRCS_VAR file1.ui ... fileN.ui )
14653
14654
14655 Use this to add the Qt designer ui files to your application/library.
14656
14657
14658
14659
14660 KDE3_ADD_KCFG_FILES(SRCS_VAR file1.kcfgc ... fileN.kcfgc )
14661
14662
14663 Use this to add KDE kconfig compiler files to your application/library.
14664
14665
14666
14667
14668 KDE3_INSTALL_LIBTOOL_FILE(target)
14669
14670
14671 This will create and install a simple libtool file for the given target.
14672
14673
14674
14675
14676 KDE3_ADD_EXECUTABLE(name file1 ... fileN )
14677
14678
14679 Currently identical to add_executable(), may provide some advanced features in the future.
14680
14681
14682
14683
14684 KDE3_ADD_KPART(name [WITH_PREFIX] file1 ... fileN )
14685
14686
14687 Create a KDE plugin (KPart, kioslave, etc.) from the given source files.
14688 If WITH_PREFIX is given, the resulting plugin will have the prefix "lib", otherwise it won't.
14689 It creates and installs an appropriate libtool la-file.
14690
14691
14692
14693
14694 KDE3_ADD_KDEINIT_EXECUTABLE(name file1 ... fileN )
14695
14696
14697 Create a KDE application in the form of a module loadable via kdeinit.
14698 A library named kdeinit_<name> will be created and a small executable which links to it.
14699
14700
14701
14702
14703 The option KDE3_ENABLE_FINAL to enable all-in-one compilation is
14704 no longer supported.
14705
14706
14707
14708
14709
14710 Author: Alexander Neundorf <neundorf@kde.org>
14711
14712
14713 FindKDE4
14714
14715
14716 Find KDE4 and provide all necessary variables and macros to com‐
14717 pile software for it. It looks for KDE 4 in the following direc‐
14718 tories in the given order:
14719
14720
14721 CMAKE_INSTALL_PREFIX
14722 KDEDIRS
14723 /opt/kde4
14724
14725
14726
14727
14728 Please look in FindKDE4Internal.cmake and KDE4Macros.cmake for
14729 more information. They are installed with the KDE 4 libraries in
14730 $KDEDIRS/share/apps/cmake/modules/.
14731
14732
14733 Author: Alexander Neundorf <neundorf@kde.org>
14734
14735
14736 FindLAPACK
14737 Find LAPACK library
14738
14739 This module finds an installed fortran library that implements
14740 the LAPACK linear-algebra interface (see
14741 http://www.netlib.org/lapack/).
14742
14743
14744 The approach follows that taken for the autoconf macro file,
14745 acx_lapack.m4 (distributed at http://ac-archive.source‐
14746 forge.net/ac-archive/acx_lapack.html).
14747
14748
14749 This module sets the following variables:
14750
14751
14752 LAPACK_FOUND - set to true if a library implementing the LAPACK interface
14753 is found
14754 LAPACK_LINKER_FLAGS - uncached list of required linker flags (excluding -l
14755 and -L).
14756 LAPACK_LIBRARIES - uncached list of libraries (using full path name) to
14757 link against to use LAPACK
14758 LAPACK95_LIBRARIES - uncached list of libraries (using full path name) to
14759 link against to use LAPACK95
14760 LAPACK95_FOUND - set to true if a library implementing the LAPACK f95
14761 interface is found
14762 BLA_STATIC if set on this determines what kind of linkage we do (static)
14763 BLA_VENDOR if set checks only the specified vendor, if not set checks
14764 all the possibilities
14765 BLA_F95 if set on tries to find the f95 interfaces for BLAS/LAPACK
14766
14767
14768 FindLATEX
14769 Find Latex
14770
14771 This module finds if Latex is installed and determines where the
14772 executables are. This code sets the following variables:
14773
14774
14775 LATEX_COMPILER: path to the LaTeX compiler
14776 PDFLATEX_COMPILER: path to the PdfLaTeX compiler
14777 BIBTEX_COMPILER: path to the BibTeX compiler
14778 MAKEINDEX_COMPILER: path to the MakeIndex compiler
14779 DVIPS_CONVERTER: path to the DVIPS converter
14780 PS2PDF_CONVERTER: path to the PS2PDF converter
14781 LATEX2HTML_CONVERTER: path to the LaTeX2Html converter
14782
14783
14784
14785
14786
14787 FindLibArchive
14788 Find libarchive library and headers
14789
14790 The module defines the following variables:
14791
14792
14793 LibArchive_FOUND - true if libarchive was found
14794 LibArchive_INCLUDE_DIRS - include search path
14795 LibArchive_LIBRARIES - libraries to link
14796 LibArchive_VERSION - libarchive 3-component version number
14797
14798
14799 FindLibLZMA
14800 Find LibLZMA
14801
14802 Find LibLZMA headers and library
14803
14804
14805 LIBLZMA_FOUND - True if liblzma is found.
14806 LIBLZMA_INCLUDE_DIRS - Directory where liblzma headers are located.
14807 LIBLZMA_LIBRARIES - Lzma libraries to link against.
14808 LIBLZMA_HAS_AUTO_DECODER - True if lzma_auto_decoder() is found (required).
14809 LIBLZMA_HAS_EASY_ENCODER - True if lzma_easy_encoder() is found (required).
14810 LIBLZMA_HAS_LZMA_PRESET - True if lzma_lzma_preset() is found (required).
14811 LIBLZMA_VERSION_MAJOR - The major version of lzma
14812 LIBLZMA_VERSION_MINOR - The minor version of lzma
14813 LIBLZMA_VERSION_PATCH - The patch version of lzma
14814 LIBLZMA_VERSION_STRING - version number as a string (ex: "5.0.3")
14815
14816
14817 FindLibXml2
14818 Try to find the LibXml2 xml processing library
14819
14820 Once done this will define
14821
14822
14823 LIBXML2_FOUND - System has LibXml2
14824 LIBXML2_INCLUDE_DIR - The LibXml2 include directory
14825 LIBXML2_LIBRARIES - The libraries needed to use LibXml2
14826 LIBXML2_DEFINITIONS - Compiler switches required for using LibXml2
14827 LIBXML2_XMLLINT_EXECUTABLE - The XML checking tool xmllint coming with LibXml2
14828 LIBXML2_VERSION_STRING - the version of LibXml2 found (since CMake 2.8.8)
14829
14830
14831 FindLibXslt
14832 Try to find the LibXslt library
14833
14834 Once done this will define
14835
14836
14837 LIBXSLT_FOUND - system has LibXslt
14838 LIBXSLT_INCLUDE_DIR - the LibXslt include directory
14839 LIBXSLT_LIBRARIES - Link these to LibXslt
14840 LIBXSLT_DEFINITIONS - Compiler switches required for using LibXslt
14841 LIBXSLT_VERSION_STRING - version of LibXslt found (since CMake 2.8.8)
14842
14843 Additionally, the following two variables are set (but not
14844 required for using xslt):
14845
14846
14847 LIBXSLT_EXSLT_LIBRARIES - Link to these if you need to link against the exslt library
14848 LIBXSLT_XSLTPROC_EXECUTABLE - Contains the full path to the xsltproc executable if found
14849
14850
14851 FindLua50
14852
14853
14854 Locate Lua library This module defines
14855
14856
14857 LUA50_FOUND, if false, do not try to link to Lua
14858 LUA_LIBRARIES, both lua and lualib
14859 LUA_INCLUDE_DIR, where to find lua.h and lualib.h (and probably lauxlib.h)
14860
14861
14862
14863
14864 Note that the expected include convention is
14865
14866
14867 #include "lua.h"
14868
14869 and not
14870
14871
14872 #include <lua/lua.h>
14873
14874 This is because, the lua location is not standardized and may
14875 exist in locations other than lua/
14876
14877
14878 FindLua51
14879
14880
14881 Locate Lua library This module defines
14882
14883
14884 LUA51_FOUND, if false, do not try to link to Lua
14885 LUA_LIBRARIES
14886 LUA_INCLUDE_DIR, where to find lua.h
14887 LUA_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
14888
14889
14890
14891
14892 Note that the expected include convention is
14893
14894
14895 #include "lua.h"
14896
14897 and not
14898
14899
14900 #include <lua/lua.h>
14901
14902 This is because, the lua location is not standardized and may
14903 exist in locations other than lua/
14904
14905
14906 FindLua52
14907
14908
14909 Locate Lua library This module defines
14910
14911
14912 LUA52_FOUND, if false, do not try to link to Lua
14913 LUA_LIBRARIES
14914 LUA_INCLUDE_DIR, where to find lua.h
14915 LUA_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
14916
14917
14918
14919
14920 Note that the expected include convention is
14921
14922
14923 #include "lua.h"
14924
14925 and not
14926
14927
14928 #include <lua/lua.h>
14929
14930 This is because, the lua location is not standardized and may
14931 exist in locations other than lua/
14932
14933
14934 FindMFC
14935 Find MFC on Windows
14936
14937 Find the native MFC - i.e. decide if an application can link to
14938 the MFC libraries.
14939
14940
14941 MFC_FOUND - Was MFC support found
14942
14943 You don't need to include anything or link anything to use it.
14944
14945
14946 FindMPEG
14947 Find the native MPEG includes and library
14948
14949 This module defines
14950
14951
14952 MPEG_INCLUDE_DIR, where to find MPEG.h, etc.
14953 MPEG_LIBRARIES, the libraries required to use MPEG.
14954 MPEG_FOUND, If false, do not try to use MPEG.
14955
14956 also defined, but not for general use are
14957
14958
14959 MPEG_mpeg2_LIBRARY, where to find the MPEG library.
14960 MPEG_vo_LIBRARY, where to find the vo library.
14961
14962
14963 FindMPEG2
14964 Find the native MPEG2 includes and library
14965
14966 This module defines
14967
14968
14969 MPEG2_INCLUDE_DIR, path to mpeg2dec/mpeg2.h, etc.
14970 MPEG2_LIBRARIES, the libraries required to use MPEG2.
14971 MPEG2_FOUND, If false, do not try to use MPEG2.
14972
14973 also defined, but not for general use are
14974
14975
14976 MPEG2_mpeg2_LIBRARY, where to find the MPEG2 library.
14977 MPEG2_vo_LIBRARY, where to find the vo library.
14978
14979
14980 FindMPI
14981 Find a Message Passing Interface (MPI) implementation
14982
14983 The Message Passing Interface (MPI) is a library used to write
14984 high-performance distributed-memory parallel applications, and
14985 is typically deployed on a cluster. MPI is a standard interface
14986 (defined by the MPI forum) for which many implementations are
14987 available. All of them have somewhat different include paths,
14988 libraries to link against, etc., and this module tries to smooth
14989 out those differences.
14990
14991
14992 === Variables ===
14993
14994
14995 This module will set the following variables per language in
14996 your project, where <lang> is one of C, CXX, or Fortran:
14997
14998
14999 MPI_<lang>_FOUND TRUE if FindMPI found MPI flags for <lang>
15000 MPI_<lang>_COMPILER MPI Compiler wrapper for <lang>
15001 MPI_<lang>_COMPILE_FLAGS Compilation flags for MPI programs
15002 MPI_<lang>_INCLUDE_PATH Include path(s) for MPI header
15003 MPI_<lang>_LINK_FLAGS Linking flags for MPI programs
15004 MPI_<lang>_LIBRARIES All libraries to link MPI programs against
15005
15006 Additionally, FindMPI sets the following variables for running
15007 MPI programs from the command line:
15008
15009
15010 MPIEXEC Executable for running MPI programs
15011 MPIEXEC_NUMPROC_FLAG Flag to pass to MPIEXEC before giving
15012 it the number of processors to run on
15013 MPIEXEC_PREFLAGS Flags to pass to MPIEXEC directly
15014 before the executable to run.
15015 MPIEXEC_POSTFLAGS Flags to pass to MPIEXEC after other flags
15016
15017 === Usage ===
15018
15019
15020 To use this module, simply call FindMPI from a CMakeLists.txt
15021 file, or run find_package(MPI), then run CMake. If you are
15022 happy with the auto- detected configuration for your language,
15023 then you're done. If not, you have two options:
15024
15025
15026 1. Set MPI_<lang>_COMPILER to the MPI wrapper (mpicc, etc.) of your
15027 choice and reconfigure. FindMPI will attempt to determine all the
15028 necessary variables using THAT compiler's compile and link flags.
15029 2. If this fails, or if your MPI implementation does not come with
15030 a compiler wrapper, then set both MPI_<lang>_LIBRARIES and
15031 MPI_<lang>_INCLUDE_PATH. You may also set any other variables
15032 listed above, but these two are required. This will circumvent
15033 autodetection entirely.
15034
15035 When configuration is successful, MPI_<lang>_COMPILER will be
15036 set to the compiler wrapper for <lang>, if it was found.
15037 MPI_<lang>_FOUND and other variables above will be set if any
15038 MPI implementation was found for <lang>, regardless of whether a
15039 compiler was found.
15040
15041
15042 When using MPIEXEC to execute MPI applications, you should typi‐
15043 cally use all of the MPIEXEC flags as follows:
15044
15045
15046 ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} PROCS
15047 ${MPIEXEC_PREFLAGS} EXECUTABLE ${MPIEXEC_POSTFLAGS} ARGS
15048
15049 where PROCS is the number of processors on which to execute the
15050 program, EXECUTABLE is the MPI program, and ARGS are the argu‐
15051 ments to pass to the MPI program.
15052
15053
15054 === Backward Compatibility ===
15055
15056
15057 For backward compatibility with older versions of FindMPI, these
15058 variables are set, but deprecated:
15059
15060
15061 MPI_FOUND MPI_COMPILER MPI_LIBRARY
15062 MPI_COMPILE_FLAGS MPI_INCLUDE_PATH MPI_EXTRA_LIBRARY
15063 MPI_LINK_FLAGS MPI_LIBRARIES
15064
15065 In new projects, please use the MPI_<lang>_XXX equivalents.
15066
15067
15068 FindMatlab
15069 this module looks for Matlab
15070
15071 Defines:
15072
15073
15074 MATLAB_INCLUDE_DIR: include path for mex.h, engine.h
15075 MATLAB_LIBRARIES: required libraries: libmex, etc
15076 MATLAB_MEX_LIBRARY: path to libmex.lib
15077 MATLAB_MX_LIBRARY: path to libmx.lib
15078 MATLAB_ENG_LIBRARY: path to libeng.lib
15079
15080
15081 FindMotif
15082 Try to find Motif (or lesstif)
15083
15084 Once done this will define:
15085
15086
15087 MOTIF_FOUND - system has MOTIF
15088 MOTIF_INCLUDE_DIR - include paths to use Motif
15089 MOTIF_LIBRARIES - Link these to use Motif
15090
15091
15092 FindOpenAL
15093
15094
15095 Locate OpenAL This module defines OPENAL_LIBRARY OPENAL_FOUND,
15096 if false, do not try to link to OpenAL OPENAL_INCLUDE_DIR, where
15097 to find the headers
15098
15099
15100 $OPENALDIR is an environment variable that would correspond to
15101 the ./configure --prefix=$OPENALDIR used in building OpenAL.
15102
15103
15104 Created by Eric Wing. This was influenced by the FindSDL.cmake
15105 module.
15106
15107
15108 FindOpenGL
15109 Try to find OpenGL
15110
15111 Once done this will define
15112
15113
15114 OPENGL_FOUND - system has OpenGL
15115 OPENGL_XMESA_FOUND - system has XMESA
15116 OPENGL_GLU_FOUND - system has GLU
15117 OPENGL_INCLUDE_DIR - the GL include directory
15118 OPENGL_LIBRARIES - Link these to use OpenGL and GLU
15119
15120
15121
15122
15123 If you want to use just GL you can use these values
15124
15125
15126 OPENGL_gl_LIBRARY - Path to OpenGL Library
15127 OPENGL_glu_LIBRARY - Path to GLU Library
15128
15129
15130
15131
15132 On OSX default to using the framework version of opengl People
15133 will have to change the cache values of OPENGL_glu_LIBRARY and
15134 OPENGL_gl_LIBRARY to use OpenGL with X11 on OSX
15135
15136
15137 FindOpenMP
15138 Finds OpenMP support
15139
15140 This module can be used to detect OpenMP support in a compiler.
15141 If the compiler supports OpenMP, the flags required to compile
15142 with OpenMP support are returned in variables for the different
15143 languages. The variables may be empty if the compiler does not
15144 need a special flag to support OpenMP.
15145
15146
15147 The following variables are set:
15148
15149
15150 OpenMP_C_FLAGS - flags to add to the C compiler for OpenMP support
15151 OpenMP_CXX_FLAGS - flags to add to the CXX compiler for OpenMP support
15152 OPENMP_FOUND - true if openmp is detected
15153
15154
15155
15156
15157 Supported compilers can be found at
15158 http://openmp.org/wp/openmp-compilers/
15159
15160
15161 FindOpenSSL
15162 Try to find the OpenSSL encryption library
15163
15164 Once done this will define
15165
15166
15167 OPENSSL_ROOT_DIR - Set this variable to the root installation of OpenSSL
15168
15169
15170
15171
15172 Read-Only variables:
15173
15174
15175 OPENSSL_FOUND - system has the OpenSSL library
15176 OPENSSL_INCLUDE_DIR - the OpenSSL include directory
15177 OPENSSL_LIBRARIES - The libraries needed to use OpenSSL
15178 OPENSSL_VERSION - This is set to $major.$minor.$revision$path (eg. 0.9.8s)
15179
15180
15181 FindOpenSceneGraph
15182 Find OpenSceneGraph
15183
15184 This module searches for the OpenSceneGraph core "osg" library
15185 as well as OpenThreads, and whatever additional COMPONENTS
15186 (nodekits) that you specify.
15187
15188
15189 See http://www.openscenegraph.org
15190
15191
15192
15193
15194 NOTE: To use this module effectively you must either require
15195 CMake >= 2.6.3 with cmake_minimum_required(VERSION 2.6.3) or
15196 download and place FindOpenThreads.cmake, Findosg_func‐
15197 tions.cmake, Findosg.cmake, and Find<etc>.cmake files into your
15198 CMAKE_MODULE_PATH.
15199
15200
15201 ==================================
15202
15203
15204 This module accepts the following variables (note mixed case)
15205
15206
15207 OpenSceneGraph_DEBUG - Enable debugging output
15208
15209
15210
15211
15212 OpenSceneGraph_MARK_AS_ADVANCED - Mark cache variables as advanced
15213 automatically
15214
15215
15216
15217
15218 The following environment variables are also respected for find‐
15219 ing the OSG and it's various components. CMAKE_PREFIX_PATH can
15220 also be used for this (see find_library() CMake documentation).
15221
15222
15223 <MODULE>_DIR (where MODULE is of the form "OSGVOLUME" and there is a FindosgVolume.cmake file)
15224 OSG_DIR
15225 OSGDIR
15226 OSG_ROOT
15227
15228
15229
15230
15231 [CMake 2.8.10]: The CMake variable OSG_DIR can now be used as
15232 well to influence detection, instead of needing to specify an
15233 environment variable.
15234
15235
15236 This module defines the following output variables:
15237
15238
15239 OPENSCENEGRAPH_FOUND - Was the OSG and all of the specified components found?
15240
15241
15242
15243
15244 OPENSCENEGRAPH_VERSION - The version of the OSG which was found
15245
15246
15247
15248
15249 OPENSCENEGRAPH_INCLUDE_DIRS - Where to find the headers
15250
15251
15252
15253
15254 OPENSCENEGRAPH_LIBRARIES - The OSG libraries
15255
15256
15257
15258
15259 ================================== Example Usage:
15260
15261
15262 find_package(OpenSceneGraph 2.0.0 REQUIRED osgDB osgUtil)
15263 # libOpenThreads & libosg automatically searched
15264 include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS})
15265
15266
15267
15268
15269 add_executable(foo foo.cc)
15270 target_link_libraries(foo ${OPENSCENEGRAPH_LIBRARIES})
15271
15272
15273
15274
15275
15276 FindOpenThreads
15277
15278
15279 OpenThreads is a C++ based threading library. Its largest user‐
15280 base seems to OpenSceneGraph so you might notice I accept OSGDIR
15281 as an environment path. I consider this part of the Findosg*
15282 suite used to find OpenSceneGraph components. Each component is
15283 separate and you must opt in to each module.
15284
15285
15286 Locate OpenThreads This module defines OPENTHREADS_LIBRARY
15287 OPENTHREADS_FOUND, if false, do not try to link to OpenThreads
15288 OPENTHREADS_INCLUDE_DIR, where to find the headers
15289
15290
15291 $OPENTHREADS_DIR is an environment variable that would corre‐
15292 spond to the ./configure --prefix=$OPENTHREADS_DIR used in
15293 building osg.
15294
15295
15296 [CMake 2.8.10]: The CMake variables OPENTHREADS_DIR or OSG_DIR
15297 can now be used as well to influence detection, instead of need‐
15298 ing to specify an environment variable.
15299
15300
15301 Created by Eric Wing.
15302
15303
15304 FindPHP4
15305 Find PHP4
15306
15307 This module finds if PHP4 is installed and determines where the
15308 include files and libraries are. It also determines what the
15309 name of the library is. This code sets the following variables:
15310
15311
15312 PHP4_INCLUDE_PATH = path to where php.h can be found
15313 PHP4_EXECUTABLE = full path to the php4 binary
15314
15315
15316
15317
15318
15319 FindPNG
15320 Find the native PNG includes and library
15321
15322
15323
15324
15325 This module searches libpng, the library for working with PNG
15326 images.
15327
15328
15329 It defines the following variables
15330
15331
15332 PNG_INCLUDE_DIRS, where to find png.h, etc.
15333 PNG_LIBRARIES, the libraries to link against to use PNG.
15334 PNG_DEFINITIONS - You should add_definitons(${PNG_DEFINITIONS}) before compiling code that includes png library files.
15335 PNG_FOUND, If false, do not try to use PNG.
15336 PNG_VERSION_STRING - the version of the PNG library found (since CMake 2.8.8)
15337
15338 Also defined, but not for general use are
15339
15340
15341 PNG_LIBRARY, where to find the PNG library.
15342
15343 For backward compatiblity the variable PNG_INCLUDE_DIR is also
15344 set. It has the same value as PNG_INCLUDE_DIRS.
15345
15346
15347 Since PNG depends on the ZLib compression library, none of the
15348 above will be defined unless ZLib can be found.
15349
15350
15351 FindPackageHandleStandardArgs
15352
15353
15354 FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> ... )
15355
15356
15357 This function is intended to be used in FindXXX.cmake modules
15358 files. It handles the REQUIRED, QUIET and version-related argu‐
15359 ments to find_package(). It also sets the <packagename>_FOUND
15360 variable. The package is considered found if all variables
15361 <var1>... listed contain valid results, e.g. valid filepaths.
15362
15363
15364 There are two modes of this function. The first argument in both
15365 modes is the name of the Find-module where it is called (in
15366 original casing).
15367
15368
15369 The first simple mode looks like this:
15370
15371
15372 FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> (DEFAULT_MSG|"Custom failure message") <var1>...<varN> )
15373
15374 If the variables <var1> to <varN> are all valid, then <UPPER‐
15375 CASED_NAME>_FOUND will be set to TRUE. If DEFAULT_MSG is given
15376 as second argument, then the function will generate itself use‐
15377 ful success and error messages. You can also supply a custom
15378 error message for the failure case. This is not recommended.
15379
15380
15381 The second mode is more powerful and also supports version
15382 checking:
15383
15384
15385 FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME [FOUND_VAR <resultVar>]
15386 [REQUIRED_VARS <var1>...<varN>]
15387 [VERSION_VAR <versionvar>]
15388 [HANDLE_COMPONENTS]
15389 [CONFIG_MODE]
15390 [FAIL_MESSAGE "Custom failure message"] )
15391
15392
15393
15394
15395 In this mode, the name of the result-variable can be set either
15396 to either <UPPERCASED_NAME>_FOUND or <OriginalCase_Name>_FOUND
15397 using the FOUND_VAR option. Other names for the result-variable
15398 are not allowed. So for a Find-module named FindFooBar.cmake,
15399 the two possible names are FooBar_FOUND and FOOBAR_FOUND. It is
15400 recommended to use the original case version. If the FOUND_VAR
15401 option is not used, the default is <UPPERCASED_NAME>_FOUND.
15402
15403
15404 As in the simple mode, if <var1> through <varN> are all valid,
15405 <packagename>_FOUND will be set to TRUE. After REQUIRED_VARS the
15406 variables which are required for this package are listed. Fol‐
15407 lowing VERSION_VAR the name of the variable can be specified
15408 which holds the version of the package which has been found. If
15409 this is done, this version will be checked against the (poten‐
15410 tially) specified required version used in the find_package()
15411 call. The EXACT keyword is also handled. The default messages
15412 include information about the required version and the version
15413 which has been actually found, both if the version is ok or not.
15414 If the package supports components, use the HANDLE_COMPONENTS
15415 option to enable handling them. In this case, find_package_han‐
15416 dle_standard_args() will report which components have been found
15417 and which are missing, and the <packagename>_FOUND variable will
15418 be set to FALSE if any of the required components (i.e. not the
15419 ones listed after OPTIONAL_COMPONENTS) are missing. Use the
15420 option CONFIG_MODE if your FindXXX.cmake module is a wrapper for
15421 a find_package(... NO_MODULE) call. In this case VERSION_VAR
15422 will be set to <NAME>_VERSION and the macro will automatically
15423 check whether the Config module was found. Via FAIL_MESSAGE a
15424 custom failure message can be specified, if this is not used,
15425 the default message will be displayed.
15426
15427
15428 Example for mode 1:
15429
15430
15431 find_package_handle_standard_args(LibXml2 DEFAULT_MSG LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
15432
15433
15434
15435
15436 LibXml2 is considered to be found, if both LIBXML2_LIBRARY and
15437 LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to
15438 TRUE. If it is not found and REQUIRED was used, it fails with
15439 FATAL_ERROR, independent whether QUIET was used or not. If it is
15440 found, success will be reported, including the content of
15441 <var1>. On repeated Cmake runs, the same message won't be
15442 printed again.
15443
15444
15445 Example for mode 2:
15446
15447
15448 find_package_handle_standard_args(LibXslt FOUND_VAR LibXslt_FOUND
15449 REQUIRED_VARS LibXslt_LIBRARIES LibXslt_INCLUDE_DIRS
15450 VERSION_VAR LibXslt_VERSION_STRING)
15451
15452 In this case, LibXslt is considered to be found if the vari‐
15453 able(s) listed after REQUIRED_VAR are all valid, i.e.
15454 LibXslt_LIBRARIES and LibXslt_INCLUDE_DIRS in this case. The
15455 result will then be stored in LibXslt_FOUND . Also the version
15456 of LibXslt will be checked by using the version contained in
15457 LibXslt_VERSION_STRING. Since no FAIL_MESSAGE is given, the
15458 default messages will be printed.
15459
15460
15461 Another example for mode 2:
15462
15463
15464 find_package(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4)
15465 find_package_handle_standard_args(Automoc4 CONFIG_MODE)
15466
15467 In this case, FindAutmoc4.cmake wraps a call to find_pack‐
15468 age(Automoc4 NO_MODULE) and adds an additional search directory
15469 for automoc4. Here the result will be stored in AUTOMOC4_FOUND.
15470 The following FIND_PACKAGE_HANDLE_STANDARD_ARGS() call produces
15471 a proper success/error message.
15472
15473
15474 FindPackageMessage
15475
15476
15477 FIND_PACKAGE_MESSAGE(<name> "message for user" "find result
15478 details")
15479
15480
15481 This macro is intended to be used in FindXXX.cmake modules
15482 files. It will print a message once for each unique find result.
15483 This is useful for telling the user where a package was found.
15484 The first argument specifies the name (XXX) of the package. The
15485 second argument specifies the message to display. The third
15486 argument lists details about the find result so that if they
15487 change the message will be displayed again. The macro also obeys
15488 the QUIET argument to the find_package command.
15489
15490
15491 Example:
15492
15493
15494 if(X11_FOUND)
15495 FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}"
15496 "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
15497 else()
15498 ...
15499 endif()
15500
15501
15502 FindPerl
15503 Find perl
15504
15505 this module looks for Perl
15506
15507
15508 PERL_EXECUTABLE - the full path to perl
15509 PERL_FOUND - If false, don't attempt to use perl.
15510 PERL_VERSION_STRING - version of perl found (since CMake 2.8.8)
15511
15512
15513 FindPerlLibs
15514 Find Perl libraries
15515
15516 This module finds if PERL is installed and determines where the
15517 include files and libraries are. It also determines what the
15518 name of the library is. This code sets the following variables:
15519
15520
15521 PERLLIBS_FOUND = True if perl.h & libperl were found
15522 PERL_INCLUDE_PATH = path to where perl.h is found
15523 PERL_LIBRARY = path to libperl
15524 PERL_EXECUTABLE = full path to the perl binary
15525
15526
15527
15528
15529 The minimum required version of Perl can be specified using the
15530 standard syntax, e.g. find_package(PerlLibs 6.0)
15531
15532
15533 The following variables are also available if needed
15534 (introduced after CMake 2.6.4)
15535
15536
15537
15538
15539 PERL_SITESEARCH = path to the sitesearch install dir
15540 PERL_SITELIB = path to the sitelib install directory
15541 PERL_VENDORARCH = path to the vendor arch install directory
15542 PERL_VENDORLIB = path to the vendor lib install directory
15543 PERL_ARCHLIB = path to the arch lib install directory
15544 PERL_PRIVLIB = path to the priv lib install directory
15545 PERL_EXTRA_C_FLAGS = Compilation flags used to build perl
15546
15547
15548
15549
15550
15551 FindPhysFS
15552
15553
15554 Locate PhysFS library This module defines PHYSFS_LIBRARY, the
15555 name of the library to link against PHYSFS_FOUND, if false, do
15556 not try to link to PHYSFS PHYSFS_INCLUDE_DIR, where to find
15557 physfs.h
15558
15559
15560 $PHYSFSDIR is an environment variable that would correspond to
15561 the ./configure --prefix=$PHYSFSDIR used in building PHYSFS.
15562
15563
15564 Created by Eric Wing.
15565
15566
15567 FindPike
15568 Find Pike
15569
15570 This module finds if PIKE is installed and determines where the
15571 include files and libraries are. It also determines what the
15572 name of the library is. This code sets the following variables:
15573
15574
15575 PIKE_INCLUDE_PATH = path to where program.h is found
15576 PIKE_EXECUTABLE = full path to the pike binary
15577
15578
15579
15580
15581
15582 FindPkgConfig
15583 a pkg-config module for CMake
15584
15585
15586
15587
15588 Usage:
15589
15590
15591 pkg_check_modules(<PREFIX> [REQUIRED] [QUIET] <MODULE> [<MODULE>]*)
15592 checks for all the given modules
15593
15594
15595
15596
15597 pkg_search_module(<PREFIX> [REQUIRED] [QUIET] <MODULE> [<MODULE>]*)
15598 checks for given modules and uses the first working one
15599
15600
15601
15602
15603 When the 'REQUIRED' argument was set, macros will fail with an
15604 error when module(s) could not be found
15605
15606
15607 When the 'QUIET' argument is set, no status messages will be
15608 printed.
15609
15610
15611 It sets the following variables:
15612
15613
15614 PKG_CONFIG_FOUND ... if pkg-config executable was found
15615 PKG_CONFIG_EXECUTABLE ... pathname of the pkg-config program
15616 PKG_CONFIG_VERSION_STRING ... the version of the pkg-config program found
15617 (since CMake 2.8.8)
15618
15619
15620
15621
15622 For the following variables two sets of values exist; first one
15623 is the common one and has the given PREFIX. The second set con‐
15624 tains flags which are given out when pkgconfig was called with
15625 the '--static' option.
15626
15627
15628 <XPREFIX>_FOUND ... set to 1 if module(s) exist
15629 <XPREFIX>_LIBRARIES ... only the libraries (w/o the '-l')
15630 <XPREFIX>_LIBRARY_DIRS ... the paths of the libraries (w/o the '-L')
15631 <XPREFIX>_LDFLAGS ... all required linker flags
15632 <XPREFIX>_LDFLAGS_OTHER ... all other linker flags
15633 <XPREFIX>_INCLUDE_DIRS ... the '-I' preprocessor flags (w/o the '-I')
15634 <XPREFIX>_CFLAGS ... all required cflags
15635 <XPREFIX>_CFLAGS_OTHER ... the other compiler flags
15636
15637
15638
15639
15640 <XPREFIX> = <PREFIX> for common case
15641 <XPREFIX> = <PREFIX>_STATIC for static linking
15642
15643
15644
15645
15646 There are some special variables whose prefix depends on the
15647 count of given modules. When there is only one module, <PREFIX>
15648 stays unchanged. When there are multiple modules, the prefix
15649 will be changed to <PREFIX>_<MODNAME>:
15650
15651
15652 <XPREFIX>_VERSION ... version of the module
15653 <XPREFIX>_PREFIX ... prefix-directory of the module
15654 <XPREFIX>_INCLUDEDIR ... include-dir of the module
15655 <XPREFIX>_LIBDIR ... lib-dir of the module
15656
15657
15658
15659
15660 <XPREFIX> = <PREFIX> when |MODULES| == 1, else
15661 <XPREFIX> = <PREFIX>_<MODNAME>
15662
15663
15664
15665
15666 A <MODULE> parameter can have the following formats:
15667
15668
15669 {MODNAME} ... matches any version
15670 {MODNAME}>={VERSION} ... at least version <VERSION> is required
15671 {MODNAME}={VERSION} ... exactly version <VERSION> is required
15672 {MODNAME}<={VERSION} ... modules must not be newer than <VERSION>
15673
15674
15675
15676
15677 Examples
15678
15679
15680 pkg_check_modules (GLIB2 glib-2.0)
15681
15682
15683
15684
15685 pkg_check_modules (GLIB2 glib-2.0>=2.10)
15686 requires at least version 2.10 of glib2 and defines e.g.
15687 GLIB2_VERSION=2.10.3
15688
15689
15690
15691
15692 pkg_check_modules (FOO glib-2.0>=2.10 gtk+-2.0)
15693 requires both glib2 and gtk2, and defines e.g.
15694 FOO_glib-2.0_VERSION=2.10.3
15695 FOO_gtk+-2.0_VERSION=2.8.20
15696
15697
15698
15699
15700 pkg_check_modules (XRENDER REQUIRED xrender)
15701 defines e.g.:
15702 XRENDER_LIBRARIES=Xrender;X11
15703 XRENDER_STATIC_LIBRARIES=Xrender;X11;pthread;Xau;Xdmcp
15704
15705
15706
15707
15708 pkg_search_module (BAR libxml-2.0 libxml2 libxml>=2)
15709
15710
15711 FindPostgreSQL
15712 Find the PostgreSQL installation.
15713
15714 In Windows, we make the assumption that, if the PostgreSQL files
15715 are installed, the default directory will be C:\Program
15716 Files\PostgreSQL.
15717
15718
15719 This module defines
15720
15721
15722 PostgreSQL_LIBRARIES - the PostgreSQL libraries needed for linking
15723 PostgreSQL_INCLUDE_DIRS - the directories of the PostgreSQL headers
15724 PostgreSQL_VERSION_STRING - the version of PostgreSQL found (since CMake 2.8.8)
15725
15726
15727 FindProducer
15728
15729
15730 Though Producer isn't directly part of OpenSceneGraph, its pri‐
15731 mary user is OSG so I consider this part of the Findosg* suite
15732 used to find OpenSceneGraph components. You'll notice that I
15733 accept OSGDIR as an environment path.
15734
15735
15736 Each component is separate and you must opt in to each module.
15737 You must also opt into OpenGL (and OpenThreads?) as these mod‐
15738 ules won't do it for you. This is to allow you control over your
15739 own system piece by piece in case you need to opt out of certain
15740 components or change the Find behavior for a particular module
15741 (perhaps because the default FindOpenGL.cmake module doesn't
15742 work with your system as an example). If you want to use a more
15743 convenient module that includes everything, use the FindOpen‐
15744 SceneGraph.cmake instead of the Findosg*.cmake modules.
15745
15746
15747 Locate Producer This module defines PRODUCER_LIBRARY PRO‐
15748 DUCER_FOUND, if false, do not try to link to Producer PRO‐
15749 DUCER_INCLUDE_DIR, where to find the headers
15750
15751
15752 $PRODUCER_DIR is an environment variable that would correspond
15753 to the ./configure --prefix=$PRODUCER_DIR used in building osg.
15754
15755
15756 Created by Eric Wing.
15757
15758
15759 FindProtobuf
15760
15761
15762 Locate and configure the Google Protocol Buffers library.
15763
15764
15765 The following variables can be set and are optional:
15766
15767
15768 PROTOBUF_SRC_ROOT_FOLDER - When compiling with MSVC, if this cache variable is set
15769 the protobuf-default VS project build locations
15770 (vsprojects/Debug & vsprojects/Release) will be searched
15771 for libraries and binaries.
15772
15773
15774
15775
15776 PROTOBUF_IMPORT_DIRS - List of additional directories to be searched for
15777 imported .proto files. (New in CMake 2.8.8)
15778
15779
15780
15781
15782 Defines the following variables:
15783
15784
15785 PROTOBUF_FOUND - Found the Google Protocol Buffers library (libprotobuf & header files)
15786 PROTOBUF_INCLUDE_DIRS - Include directories for Google Protocol Buffers
15787 PROTOBUF_LIBRARIES - The protobuf libraries
15788
15789 [New in CMake 2.8.5]
15790
15791
15792 PROTOBUF_PROTOC_LIBRARIES - The protoc libraries
15793 PROTOBUF_LITE_LIBRARIES - The protobuf-lite libraries
15794
15795
15796
15797
15798 The following cache variables are also available to set or use:
15799
15800
15801 PROTOBUF_LIBRARY - The protobuf library
15802 PROTOBUF_PROTOC_LIBRARY - The protoc library
15803 PROTOBUF_INCLUDE_DIR - The include directory for protocol buffers
15804 PROTOBUF_PROTOC_EXECUTABLE - The protoc compiler
15805
15806 [New in CMake 2.8.5]
15807
15808
15809 PROTOBUF_LIBRARY_DEBUG - The protobuf library (debug)
15810 PROTOBUF_PROTOC_LIBRARY_DEBUG - The protoc library (debug)
15811 PROTOBUF_LITE_LIBRARY - The protobuf lite library
15812 PROTOBUF_LITE_LIBRARY_DEBUG - The protobuf lite library (debug)
15813
15814
15815
15816
15817 ====================================================================
15818 Example:
15819
15820
15821
15822
15823 find_package(Protobuf REQUIRED)
15824 include_directories(${PROTOBUF_INCLUDE_DIRS})
15825
15826
15827
15828
15829 include_directories(${CMAKE_CURRENT_BINARY_DIR})
15830 PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS foo.proto)
15831 add_executable(bar bar.cc ${PROTO_SRCS} ${PROTO_HDRS})
15832 target_link_libraries(bar ${PROTOBUF_LIBRARIES})
15833
15834
15835
15836
15837 NOTE: You may need to link against pthreads, depending
15838
15839
15840 on the platform.
15841
15842
15843
15844
15845 NOTE: The PROTOBUF_GENERATE_CPP macro & add_executable() or
15846 add_library()
15847
15848
15849 calls only work properly within the same directory.
15850
15851
15852
15853
15854 ====================================================================
15855
15856
15857
15858
15859 PROTOBUF_GENERATE_CPP (public function)
15860
15861
15862 SRCS = Variable to define with autogenerated
15863 source files
15864 HDRS = Variable to define with autogenerated
15865 header files
15866 ARGN = proto files
15867
15868
15869
15870
15871 ====================================================================
15872
15873
15874 FindPythonInterp
15875 Find python interpreter
15876
15877 This module finds if Python interpreter is installed and deter‐
15878 mines where the executables are. This code sets the following
15879 variables:
15880
15881
15882 PYTHONINTERP_FOUND - Was the Python executable found
15883 PYTHON_EXECUTABLE - path to the Python interpreter
15884
15885
15886
15887
15888 PYTHON_VERSION_STRING - Python version found e.g. 2.5.2
15889 PYTHON_VERSION_MAJOR - Python major version found e.g. 2
15890 PYTHON_VERSION_MINOR - Python minor version found e.g. 5
15891 PYTHON_VERSION_PATCH - Python patch version found e.g. 2
15892
15893
15894
15895
15896 The Python_ADDITIONAL_VERSIONS variable can be used to specify a
15897 list of version numbers that should be taken into account when
15898 searching for Python. You need to set this variable before call‐
15899 ing find_package(PythonInterp).
15900
15901
15902 FindPythonLibs
15903 Find python libraries
15904
15905 This module finds if Python is installed and determines where
15906 the include files and libraries are. It also determines what the
15907 name of the library is. This code sets the following variables:
15908
15909
15910 PYTHONLIBS_FOUND - have the Python libs been found
15911 PYTHON_LIBRARIES - path to the python library
15912 PYTHON_INCLUDE_PATH - path to where Python.h is found (deprecated)
15913 PYTHON_INCLUDE_DIRS - path to where Python.h is found
15914 PYTHON_DEBUG_LIBRARIES - path to the debug library (deprecated)
15915 PYTHONLIBS_VERSION_STRING - version of the Python libs found (since CMake 2.8.8)
15916
15917
15918
15919
15920 The Python_ADDITIONAL_VERSIONS variable can be used to specify a
15921 list of version numbers that should be taken into account when
15922 searching for Python. You need to set this variable before call‐
15923 ing find_package(PythonLibs).
15924
15925
15926 If you'd like to specify the installation of Python to use, you
15927 should modify the following cache variables:
15928
15929
15930 PYTHON_LIBRARY - path to the python library
15931 PYTHON_INCLUDE_DIR - path to where Python.h is found
15932
15933
15934 FindQt Searches for all installed versions of Qt.
15935
15936 This should only be used if your project can work with multiple
15937 versions of Qt. If not, you should just directly use FindQt4 or
15938 FindQt3. If multiple versions of Qt are found on the machine,
15939 then The user must set the option DESIRED_QT_VERSION to the ver‐
15940 sion they want to use. If only one version of qt is found on
15941 the machine, then the DESIRED_QT_VERSION is set to that version
15942 and the matching FindQt3 or FindQt4 module is included. Once the
15943 user sets DESIRED_QT_VERSION, then the FindQt3 or FindQt4 module
15944 is included.
15945
15946
15947 QT_REQUIRED if this is set to TRUE then if CMake can
15948 not find Qt4 or Qt3 an error is raised
15949 and a message is sent to the user.
15950
15951
15952
15953
15954 DESIRED_QT_VERSION OPTION is created
15955 QT4_INSTALLED is set to TRUE if qt4 is found.
15956 QT3_INSTALLED is set to TRUE if qt3 is found.
15957
15958
15959 FindQt3
15960 Locate Qt include paths and libraries
15961
15962 This module defines:
15963
15964
15965 QT_INCLUDE_DIR - where to find qt.h, etc.
15966 QT_LIBRARIES - the libraries to link against to use Qt.
15967 QT_DEFINITIONS - definitions to use when
15968 compiling code that uses Qt.
15969 QT_FOUND - If false, don't try to use Qt.
15970 QT_VERSION_STRING - the version of Qt found
15971
15972
15973
15974
15975 If you need the multithreaded version of Qt, set QT_MT_REQUIRED
15976 to TRUE
15977
15978
15979 Also defined, but not for general use are:
15980
15981
15982 QT_MOC_EXECUTABLE, where to find the moc tool.
15983 QT_UIC_EXECUTABLE, where to find the uic tool.
15984 QT_QT_LIBRARY, where to find the Qt library.
15985 QT_QTMAIN_LIBRARY, where to find the qtmain
15986 library. This is only required by Qt3 on Windows.
15987
15988
15989 FindQt4
15990 Find Qt 4
15991
15992 This module can be used to find Qt4. The most important issue is
15993 that the Qt4 qmake is available via the system path. This qmake
15994 is then used to detect basically everything else. This module
15995 defines a number of key variables and macros. The variable
15996 QT_USE_FILE is set which is the path to a CMake file that can be
15997 included to compile Qt 4 applications and libraries. It sets up
15998 the compilation environment for include directories, preproces‐
15999 sor defines and populates a QT_LIBRARIES variable.
16000
16001
16002 Typical usage could be something like:
16003
16004
16005 find_package(Qt4 4.4.3 REQUIRED QtCore QtGui QtXml)
16006 include(${QT_USE_FILE})
16007 add_executable(myexe main.cpp)
16008 target_link_libraries(myexe ${QT_LIBRARIES})
16009
16010
16011
16012
16013 The minimum required version can be specified using the standard
16014 find_package()-syntax (see example above). For compatibility
16015 with older versions of FindQt4.cmake it is also possible to set
16016 the variable QT_MIN_VERSION to the minimum required version of
16017 Qt4 before the find_package(Qt4) command. If both are used, the
16018 version used in the find_package() command overrides the one
16019 from QT_MIN_VERSION.
16020
16021
16022 When using the components argument, QT_USE_QT* variables are
16023 automatically set for the QT_USE_FILE to pick up. If one wishes
16024 to manually set them, the available ones to set include:
16025
16026
16027 QT_DONT_USE_QTCORE
16028 QT_DONT_USE_QTGUI
16029 QT_USE_QT3SUPPORT
16030 QT_USE_QTASSISTANT
16031 QT_USE_QAXCONTAINER
16032 QT_USE_QAXSERVER
16033 QT_USE_QTDESIGNER
16034 QT_USE_QTMOTIF
16035 QT_USE_QTMAIN
16036 QT_USE_QTMULTIMEDIA
16037 QT_USE_QTNETWORK
16038 QT_USE_QTNSPLUGIN
16039 QT_USE_QTOPENGL
16040 QT_USE_QTSQL
16041 QT_USE_QTXML
16042 QT_USE_QTSVG
16043 QT_USE_QTTEST
16044 QT_USE_QTUITOOLS
16045 QT_USE_QTDBUS
16046 QT_USE_QTSCRIPT
16047 QT_USE_QTASSISTANTCLIENT
16048 QT_USE_QTHELP
16049 QT_USE_QTWEBKIT
16050 QT_USE_QTXMLPATTERNS
16051 QT_USE_PHONON
16052 QT_USE_QTSCRIPTTOOLS
16053 QT_USE_QTDECLARATIVE
16054
16055
16056
16057
16058 QT_USE_IMPORTED_TARGETS
16059 If this variable is set to TRUE, FindQt4.cmake will create imported
16060 library targets for the various Qt libraries and set the
16061 library variables like QT_QTCORE_LIBRARY to point at these imported
16062 targets instead of the library file on disk. This provides much better
16063 handling of the release and debug versions of the Qt libraries and is
16064 also always backwards compatible, except for the case that dependencies
16065 of libraries are exported, these will then also list the names of the
16066 imported targets as dependency and not the file location on disk. This
16067 is much more flexible, but requires that FindQt4.cmake is executed before
16068 such an exported dependency file is processed.
16069
16070
16071
16072
16073 Note that if using IMPORTED targets, the qtmain.lib static library is
16074 automatically linked on Windows. To disable that globally, set the
16075 QT4_NO_LINK_QTMAIN variable before finding Qt4. To disable that for a
16076 particular executable, set the QT4_NO_LINK_QTMAIN target property to
16077 True on the executable.
16078
16079
16080
16081
16082 QT_INCLUDE_DIRS_NO_SYSTEM
16083 If this variable is set to TRUE, the Qt include directories
16084 in the QT_USE_FILE will NOT have the SYSTEM keyword set.
16085
16086
16087
16088
16089 There are also some files that need processing by some Qt tools
16090 such as moc and uic. Listed below are macros that may be used
16091 to process those files.
16092
16093
16094 macro QT4_WRAP_CPP(outfiles inputfile ... OPTIONS ...)
16095 create moc code from a list of files containing Qt class with
16096 the Q_OBJECT declaration. Per-directory preprocessor definitions
16097 are also added. Options may be given to moc, such as those found
16098 when executing "moc -help".
16099
16100
16101
16102
16103 macro QT4_WRAP_UI(outfiles inputfile ... OPTIONS ...)
16104 create code from a list of Qt designer ui files.
16105 Options may be given to uic, such as those found
16106 when executing "uic -help"
16107
16108
16109
16110
16111 macro QT4_ADD_RESOURCES(outfiles inputfile ... OPTIONS ...)
16112 create code from a list of Qt resource files.
16113 Options may be given to rcc, such as those found
16114 when executing "rcc -help"
16115
16116
16117
16118
16119 macro QT4_GENERATE_MOC(inputfile outputfile )
16120 creates a rule to run moc on infile and create outfile.
16121 Use this if for some reason QT4_WRAP_CPP() isn't appropriate, e.g.
16122 because you need a custom filename for the moc file or something similar.
16123
16124
16125
16126
16127 macro QT4_AUTOMOC(sourcefile1 sourcefile2 ... )
16128 The qt4_automoc macro is obsolete. Use the CMAKE_AUTOMOC feature instead.
16129 This macro is still experimental.
16130 It can be used to have moc automatically handled.
16131 So if you have the files foo.h and foo.cpp, and in foo.h a
16132 a class uses the Q_OBJECT macro, moc has to run on it. If you don't
16133 want to use QT4_WRAP_CPP() (which is reliable and mature), you can insert
16134 #include "foo.moc"
16135 in foo.cpp and then give foo.cpp as argument to QT4_AUTOMOC(). This will the
16136 scan all listed files at cmake-time for such included moc files and if it finds
16137 them cause a rule to be generated to run moc at build time on the
16138 accompanying header file foo.h.
16139 If a source file has the SKIP_AUTOMOC property set it will be ignored by this macro.
16140
16141
16142
16143
16144 You should have a look on the AUTOMOC property for targets to achieve the same results.
16145
16146
16147
16148
16149 macro QT4_ADD_DBUS_INTERFACE(outfiles interface basename)
16150 Create the interface header and implementation files with the
16151 given basename from the given interface xml file and add it to
16152 the list of sources.
16153
16154
16155
16156
16157 You can pass additional parameters to the qdbusxml2cpp call by setting
16158 properties on the input file:
16159
16160
16161
16162
16163 INCLUDE the given file will be included in the generate interface header
16164
16165
16166
16167
16168 CLASSNAME the generated class is named accordingly
16169
16170
16171
16172
16173 NO_NAMESPACE the generated class is not wrapped in a namespace
16174
16175
16176
16177
16178 macro QT4_ADD_DBUS_INTERFACES(outfiles inputfile ... )
16179 Create the interface header and implementation files
16180 for all listed interface xml files.
16181 The basename will be automatically determined from the name of the xml file.
16182
16183
16184
16185
16186 The source file properties described for QT4_ADD_DBUS_INTERFACE also apply here.
16187
16188
16189
16190
16191 macro QT4_ADD_DBUS_ADAPTOR(outfiles xmlfile parentheader parentclassname [basename] [classname])
16192 create a dbus adaptor (header and implementation file) from the xml file
16193 describing the interface, and add it to the list of sources. The adaptor
16194 forwards the calls to a parent class, defined in parentheader and named
16195 parentclassname. The name of the generated files will be
16196 <basename>adaptor.{cpp,h} where basename defaults to the basename of the xml file.
16197 If <classname> is provided, then it will be used as the classname of the
16198 adaptor itself.
16199
16200
16201
16202
16203 macro QT4_GENERATE_DBUS_INTERFACE( header [interfacename] OPTIONS ...)
16204 generate the xml interface file from the given header.
16205 If the optional argument interfacename is omitted, the name of the
16206 interface file is constructed from the basename of the header with
16207 the suffix .xml appended.
16208 Options may be given to qdbuscpp2xml, such as those found when executing "qdbuscpp2xml --help"
16209
16210
16211
16212
16213 macro QT4_CREATE_TRANSLATION( qm_files directories ... sources ...
16214 ts_files ... OPTIONS ...)
16215 out: qm_files
16216 in: directories sources ts_files
16217 options: flags to pass to lupdate, such as -extensions to specify
16218 extensions for a directory scan.
16219 generates commands to create .ts (vie lupdate) and .qm
16220 (via lrelease) - files from directories and/or sources. The ts files are
16221 created and/or updated in the source tree (unless given with full paths).
16222 The qm files are generated in the build tree.
16223 Updating the translations can be done by adding the qm_files
16224 to the source list of your library/executable, so they are
16225 always updated, or by adding a custom target to control when
16226 they get updated/generated.
16227
16228
16229
16230
16231 macro QT4_ADD_TRANSLATION( qm_files ts_files ... )
16232 out: qm_files
16233 in: ts_files
16234 generates commands to create .qm from .ts - files. The generated
16235 filenames can be found in qm_files. The ts_files
16236 must exist and are not updated in any way.
16237
16238
16239
16240
16241 function QT4_USE_MODULES( target [link_type] modules...)
16242
16243
16244 This function is obsolete. Use target_link_libraries with IMPORTED targets instead.
16245 Make <target> use the <modules> from Qt. Using a Qt module means
16246 to link to the library, add the relevant include directories for the module,
16247 and add the relevant compiler defines for using the module.
16248 Modules are roughly equivalent to components of Qt4, so usage would be
16249 something like:
16250 qt4_use_modules(myexe Core Gui Declarative)
16251 to use QtCore, QtGui and QtDeclarative. The optional <link_type> argument can
16252 be specified as either LINK_PUBLIC or LINK_PRIVATE to specify the same argument
16253 to the target_link_libraries call.
16254
16255
16256
16257
16258
16259
16260
16261 Below is a detailed list of variables that FindQt4.cmake sets.
16262 QT_FOUND If false, don't try to use Qt.
16263 Qt4_FOUND If false, don't try to use Qt 4.
16264 QT4_FOUND If false, don't try to use Qt 4. This variable is for compatibility only.
16265
16266
16267
16268
16269 QT_VERSION_MAJOR The major version of Qt found.
16270 QT_VERSION_MINOR The minor version of Qt found.
16271 QT_VERSION_PATCH The patch version of Qt found.
16272
16273
16274
16275
16276 QT_EDITION Set to the edition of Qt (i.e. DesktopLight)
16277 QT_EDITION_DESKTOPLIGHT True if QT_EDITION == DesktopLight
16278 QT_QTCORE_FOUND True if QtCore was found.
16279 QT_QTGUI_FOUND True if QtGui was found.
16280 QT_QT3SUPPORT_FOUND True if Qt3Support was found.
16281 QT_QTASSISTANT_FOUND True if QtAssistant was found.
16282 QT_QTASSISTANTCLIENT_FOUND True if QtAssistantClient was found.
16283 QT_QAXCONTAINER_FOUND True if QAxContainer was found (Windows only).
16284 QT_QAXSERVER_FOUND True if QAxServer was found (Windows only).
16285 QT_QTDBUS_FOUND True if QtDBus was found.
16286 QT_QTDESIGNER_FOUND True if QtDesigner was found.
16287 QT_QTDESIGNERCOMPONENTS True if QtDesignerComponents was found.
16288 QT_QTHELP_FOUND True if QtHelp was found.
16289 QT_QTMOTIF_FOUND True if QtMotif was found.
16290 QT_QTMULTIMEDIA_FOUND True if QtMultimedia was found (since Qt 4.6.0).
16291 QT_QTNETWORK_FOUND True if QtNetwork was found.
16292 QT_QTNSPLUGIN_FOUND True if QtNsPlugin was found.
16293 QT_QTOPENGL_FOUND True if QtOpenGL was found.
16294 QT_QTSQL_FOUND True if QtSql was found.
16295 QT_QTSVG_FOUND True if QtSvg was found.
16296 QT_QTSCRIPT_FOUND True if QtScript was found.
16297 QT_QTSCRIPTTOOLS_FOUND True if QtScriptTools was found.
16298 QT_QTTEST_FOUND True if QtTest was found.
16299 QT_QTUITOOLS_FOUND True if QtUiTools was found.
16300 QT_QTWEBKIT_FOUND True if QtWebKit was found.
16301 QT_QTXML_FOUND True if QtXml was found.
16302 QT_QTXMLPATTERNS_FOUND True if QtXmlPatterns was found.
16303 QT_PHONON_FOUND True if phonon was found.
16304 QT_QTDECLARATIVE_FOUND True if QtDeclarative was found.
16305
16306
16307
16308
16309 QT_MAC_USE_COCOA For Mac OS X, its whether Cocoa or Carbon is used.
16310 In general, this should not be used, but its useful
16311 when having platform specific code.
16312
16313
16314
16315
16316 QT_DEFINITIONS Definitions to use when compiling code that uses Qt.
16317 You do not need to use this if you include QT_USE_FILE.
16318 The QT_USE_FILE will also define QT_DEBUG and QT_NO_DEBUG
16319 to fit your current build type. Those are not contained
16320 in QT_DEFINITIONS.
16321
16322
16323
16324
16325 QT_INCLUDES List of paths to all include directories of
16326 Qt4 QT_INCLUDE_DIR and QT_QTCORE_INCLUDE_DIR are
16327 always in this variable even if NOTFOUND,
16328 all other INCLUDE_DIRS are
16329 only added if they are found.
16330 You do not need to use this if you include QT_USE_FILE.
16331
16332
16333
16334
16335
16336
16337
16338 Include directories for the Qt modules are listed here.
16339 You do not need to use these variables if you include QT_USE_FILE.
16340
16341
16342
16343
16344 QT_INCLUDE_DIR Path to "include" of Qt4
16345 QT_QT3SUPPORT_INCLUDE_DIR Path to "include/Qt3Support"
16346 QT_QTASSISTANT_INCLUDE_DIR Path to "include/QtAssistant"
16347 QT_QTASSISTANTCLIENT_INCLUDE_DIR Path to "include/QtAssistant"
16348 QT_QAXCONTAINER_INCLUDE_DIR Path to "include/ActiveQt" (Windows only)
16349 QT_QAXSERVER_INCLUDE_DIR Path to "include/ActiveQt" (Windows only)
16350 QT_QTCORE_INCLUDE_DIR Path to "include/QtCore"
16351 QT_QTDBUS_INCLUDE_DIR Path to "include/QtDBus"
16352 QT_QTDESIGNER_INCLUDE_DIR Path to "include/QtDesigner"
16353 QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR Path to "include/QtDesigner"
16354 QT_QTGUI_INCLUDE_DIR Path to "include/QtGui"
16355 QT_QTHELP_INCLUDE_DIR Path to "include/QtHelp"
16356 QT_QTMOTIF_INCLUDE_DIR Path to "include/QtMotif"
16357 QT_QTMULTIMEDIA_INCLUDE_DIR Path to "include/QtMultimedia"
16358 QT_QTNETWORK_INCLUDE_DIR Path to "include/QtNetwork"
16359 QT_QTNSPLUGIN_INCLUDE_DIR Path to "include/QtNsPlugin"
16360 QT_QTOPENGL_INCLUDE_DIR Path to "include/QtOpenGL"
16361 QT_QTSCRIPT_INCLUDE_DIR Path to "include/QtScript"
16362 QT_QTSQL_INCLUDE_DIR Path to "include/QtSql"
16363 QT_QTSVG_INCLUDE_DIR Path to "include/QtSvg"
16364 QT_QTTEST_INCLUDE_DIR Path to "include/QtTest"
16365 QT_QTWEBKIT_INCLUDE_DIR Path to "include/QtWebKit"
16366 QT_QTXML_INCLUDE_DIR Path to "include/QtXml"
16367 QT_QTXMLPATTERNS_INCLUDE_DIR Path to "include/QtXmlPatterns"
16368 QT_PHONON_INCLUDE_DIR Path to "include/phonon"
16369 QT_QTSCRIPTTOOLS_INCLUDE_DIR Path to "include/QtScriptTools"
16370 QT_QTDECLARATIVE_INCLUDE_DIR Path to "include/QtDeclarative"
16371
16372
16373
16374
16375 QT_BINARY_DIR Path to "bin" of Qt4
16376 QT_LIBRARY_DIR Path to "lib" of Qt4
16377 QT_PLUGINS_DIR Path to "plugins" for Qt4
16378 QT_TRANSLATIONS_DIR Path to "translations" of Qt4
16379 QT_IMPORTS_DIR Path to "imports" of Qt4
16380 QT_DOC_DIR Path to "doc" of Qt4
16381 QT_MKSPECS_DIR Path to "mkspecs" of Qt4
16382
16383
16384
16385
16386
16387
16388
16389 The Qt toolkit may contain both debug and release libraries. In
16390 that case, the following library variables will contain both.
16391 You do not need to use these variables if you include
16392 QT_USE_FILE, and use QT_LIBRARIES.
16393
16394
16395 QT_QT3SUPPORT_LIBRARY The Qt3Support library
16396 QT_QTASSISTANT_LIBRARY The QtAssistant library
16397 QT_QTASSISTANTCLIENT_LIBRARY The QtAssistantClient library
16398 QT_QAXCONTAINER_LIBRARY The QAxContainer library (Windows only)
16399 QT_QAXSERVER_LIBRARY The QAxServer library (Windows only)
16400 QT_QTCORE_LIBRARY The QtCore library
16401 QT_QTDBUS_LIBRARY The QtDBus library
16402 QT_QTDESIGNER_LIBRARY The QtDesigner library
16403 QT_QTDESIGNERCOMPONENTS_LIBRARY The QtDesignerComponents library
16404 QT_QTGUI_LIBRARY The QtGui library
16405 QT_QTHELP_LIBRARY The QtHelp library
16406 QT_QTMOTIF_LIBRARY The QtMotif library
16407 QT_QTMULTIMEDIA_LIBRARY The QtMultimedia library
16408 QT_QTNETWORK_LIBRARY The QtNetwork library
16409 QT_QTNSPLUGIN_LIBRARY The QtNsPLugin library
16410 QT_QTOPENGL_LIBRARY The QtOpenGL library
16411 QT_QTSCRIPT_LIBRARY The QtScript library
16412 QT_QTSQL_LIBRARY The QtSql library
16413 QT_QTSVG_LIBRARY The QtSvg library
16414 QT_QTTEST_LIBRARY The QtTest library
16415 QT_QTUITOOLS_LIBRARY The QtUiTools library
16416 QT_QTWEBKIT_LIBRARY The QtWebKit library
16417 QT_QTXML_LIBRARY The QtXml library
16418 QT_QTXMLPATTERNS_LIBRARY The QtXmlPatterns library
16419 QT_QTMAIN_LIBRARY The qtmain library for Windows
16420 QT_PHONON_LIBRARY The phonon library
16421 QT_QTSCRIPTTOOLS_LIBRARY The QtScriptTools library
16422
16423
16424
16425
16426 The QtDeclarative library: QT_QTDECLARATIVE_LIBRARY
16427
16428
16429 also defined, but NOT for general use are
16430
16431
16432 QT_MOC_EXECUTABLE Where to find the moc tool.
16433 QT_UIC_EXECUTABLE Where to find the uic tool.
16434 QT_UIC3_EXECUTABLE Where to find the uic3 tool.
16435 QT_RCC_EXECUTABLE Where to find the rcc tool
16436 QT_DBUSCPP2XML_EXECUTABLE Where to find the qdbuscpp2xml tool.
16437 QT_DBUSXML2CPP_EXECUTABLE Where to find the qdbusxml2cpp tool.
16438 QT_LUPDATE_EXECUTABLE Where to find the lupdate tool.
16439 QT_LRELEASE_EXECUTABLE Where to find the lrelease tool.
16440 QT_QCOLLECTIONGENERATOR_EXECUTABLE Where to find the qcollectiongenerator tool.
16441 QT_DESIGNER_EXECUTABLE Where to find the Qt designer tool.
16442 QT_LINGUIST_EXECUTABLE Where to find the Qt linguist tool.
16443
16444
16445
16446
16447
16448
16449
16450 These are around for backwards compatibility they will be set
16451
16452
16453 QT_WRAP_CPP Set true if QT_MOC_EXECUTABLE is found
16454 QT_WRAP_UI Set true if QT_UIC_EXECUTABLE is found
16455
16456
16457
16458
16459 These variables do _NOT_ have any effect anymore (compared to
16460 FindQt.cmake)
16461
16462
16463 QT_MT_REQUIRED Qt4 is now always multithreaded
16464
16465
16466
16467
16468 These variables are set to "" Because Qt structure changed (They
16469 make no sense in Qt4)
16470
16471
16472 QT_QT_LIBRARY Qt-Library is now split
16473
16474
16475 FindQuickTime
16476
16477
16478 Locate QuickTime This module defines QUICKTIME_LIBRARY QUICK‐
16479 TIME_FOUND, if false, do not try to link to gdal QUICK‐
16480 TIME_INCLUDE_DIR, where to find the headers
16481
16482
16483 $QUICKTIME_DIR is an environment variable that would correspond
16484 to the ./configure --prefix=$QUICKTIME_DIR
16485
16486
16487 Created by Eric Wing.
16488
16489
16490 FindRTI
16491 Try to find M&S HLA RTI libraries
16492
16493 This module finds if any HLA RTI is installed and locates the
16494 standard RTI include files and libraries.
16495
16496
16497 RTI is a simulation infrastructure standardized by IEEE and
16498 SISO. It has a well defined C++ API that assures that simulation
16499 applications are independent on a particular RTI implementation.
16500
16501
16502 http://en.wikipedia.org/wiki/Run-Time_Infrastructure_(simulation)
16503
16504
16505
16506
16507 This code sets the following variables:
16508
16509
16510 RTI_INCLUDE_DIR = the directory where RTI includes file are found
16511 RTI_LIBRARIES = The libraries to link against to use RTI
16512 RTI_DEFINITIONS = -DRTI_USES_STD_FSTREAM
16513 RTI_FOUND = Set to FALSE if any HLA RTI was not found
16514
16515
16516
16517
16518 Report problems to <certi-devel@nongnu.org>
16519
16520
16521 FindRuby
16522 Find Ruby
16523
16524 This module finds if Ruby is installed and determines where the
16525 include files and libraries are. Ruby 1.8 and 1.9 are supported.
16526
16527
16528 The minimum required version of Ruby can be specified using the
16529 standard syntax, e.g. find_package(Ruby 1.8)
16530
16531
16532 It also determines what the name of the library is. This code
16533 sets the following variables:
16534
16535
16536 RUBY_EXECUTABLE = full path to the ruby binary
16537 RUBY_INCLUDE_DIRS = include dirs to be used when using the ruby library
16538 RUBY_LIBRARY = full path to the ruby library
16539 RUBY_VERSION = the version of ruby which was found, e.g. "1.8.7"
16540 RUBY_FOUND = set to true if ruby ws found successfully
16541
16542
16543
16544
16545 RUBY_INCLUDE_PATH = same as RUBY_INCLUDE_DIRS, only provided for compatibility reasons, don't use it
16546
16547
16548 FindSDL
16549 Locate SDL library
16550
16551 This module defines
16552
16553
16554 SDL_LIBRARY, the name of the library to link against
16555 SDL_FOUND, if false, do not try to link to SDL
16556 SDL_INCLUDE_DIR, where to find SDL.h
16557 SDL_VERSION_STRING, human-readable string containing the version of SDL
16558
16559
16560
16561
16562 This module responds to the the flag:
16563
16564
16565 SDL_BUILDING_LIBRARY
16566 If this is defined, then no SDL_main will be linked in because
16567 only applications need main().
16568 Otherwise, it is assumed you are building an application and this
16569 module will attempt to locate and set the the proper link flags
16570 as part of the returned SDL_LIBRARY variable.
16571
16572
16573
16574
16575 Don't forget to include SDLmain.h and SDLmain.m your project for
16576 the OS X framework based version. (Other versions link to -lSDL‐
16577 main which this module will try to find on your behalf.) Also
16578 for OS X, this module will automatically add the -framework
16579 Cocoa on your behalf.
16580
16581
16582
16583
16584
16585 Additional Note: If you see an empty SDL_LIBRARY_TEMP in your
16586 configuration and no SDL_LIBRARY, it means CMake did not find
16587 your SDL library (SDL.dll, libsdl.so, SDL.framework, etc). Set
16588 SDL_LIBRARY_TEMP to point to your SDL library, and configure
16589 again. Similarly, if you see an empty SDLMAIN_LIBRARY, you
16590 should set this value as appropriate. These values are used to
16591 generate the final SDL_LIBRARY variable, but when these values
16592 are unset, SDL_LIBRARY does not get created.
16593
16594
16595
16596
16597
16598 $SDLDIR is an environment variable that would correspond to the
16599 ./configure --prefix=$SDLDIR used in building SDL. l.e.galup
16600 9-20-02
16601
16602
16603 Modified by Eric Wing. Added code to assist with automated
16604 building by using environmental variables and providing a more
16605 controlled/consistent search behavior. Added new modifications
16606 to recognize OS X frameworks and additional Unix paths (FreeBSD,
16607 etc). Also corrected the header search path to follow "proper"
16608 SDL guidelines. Added a search for SDLmain which is needed by
16609 some platforms. Added a search for threads which is needed by
16610 some platforms. Added needed compile switches for MinGW.
16611
16612
16613 On OSX, this will prefer the Framework version (if found) over
16614 others. People will have to manually change the cache values of
16615 SDL_LIBRARY to override this selection or set the CMake environ‐
16616 ment CMAKE_INCLUDE_PATH to modify the search paths.
16617
16618
16619 Note that the header path has changed from SDL/SDL.h to just
16620 SDL.h This needed to change because "proper" SDL convention is
16621 #include "SDL.h", not <SDL/SDL.h>. This is done for portability
16622 reasons because not all systems place things in SDL/ (see Free‐
16623 BSD).
16624
16625
16626 FindSDL_image
16627 Locate SDL_image library
16628
16629 This module defines:
16630
16631
16632 SDL_IMAGE_LIBRARIES, the name of the library to link against
16633 SDL_IMAGE_INCLUDE_DIRS, where to find the headers
16634 SDL_IMAGE_FOUND, if false, do not try to link against
16635 SDL_IMAGE_VERSION_STRING - human-readable string containing the version of SDL_image
16636
16637
16638
16639
16640 For backward compatiblity the following variables are also set:
16641
16642
16643 SDLIMAGE_LIBRARY (same value as SDL_IMAGE_LIBRARIES)
16644 SDLIMAGE_INCLUDE_DIR (same value as SDL_IMAGE_INCLUDE_DIRS)
16645 SDLIMAGE_FOUND (same value as SDL_IMAGE_FOUND)
16646
16647
16648
16649
16650 $SDLDIR is an environment variable that would correspond to the
16651 ./configure --prefix=$SDLDIR used in building SDL.
16652
16653
16654 Created by Eric Wing. This was influenced by the FindSDL.cmake
16655 module, but with modifications to recognize OS X frameworks and
16656 additional Unix paths (FreeBSD, etc).
16657
16658
16659 FindSDL_mixer
16660 Locate SDL_mixer library
16661
16662 This module defines:
16663
16664
16665 SDL_MIXER_LIBRARIES, the name of the library to link against
16666 SDL_MIXER_INCLUDE_DIRS, where to find the headers
16667 SDL_MIXER_FOUND, if false, do not try to link against
16668 SDL_MIXER_VERSION_STRING - human-readable string containing the version of SDL_mixer
16669
16670
16671
16672
16673 For backward compatiblity the following variables are also set:
16674
16675
16676 SDLMIXER_LIBRARY (same value as SDL_MIXER_LIBRARIES)
16677 SDLMIXER_INCLUDE_DIR (same value as SDL_MIXER_INCLUDE_DIRS)
16678 SDLMIXER_FOUND (same value as SDL_MIXER_FOUND)
16679
16680
16681
16682
16683 $SDLDIR is an environment variable that would correspond to the
16684 ./configure --prefix=$SDLDIR used in building SDL.
16685
16686
16687 Created by Eric Wing. This was influenced by the FindSDL.cmake
16688 module, but with modifications to recognize OS X frameworks and
16689 additional Unix paths (FreeBSD, etc).
16690
16691
16692 FindSDL_net
16693 Locate SDL_net library
16694
16695 This module defines:
16696
16697
16698 SDL_NET_LIBRARIES, the name of the library to link against
16699 SDL_NET_INCLUDE_DIRS, where to find the headers
16700 SDL_NET_FOUND, if false, do not try to link against
16701 SDL_NET_VERSION_STRING - human-readable string containing the version of SDL_net
16702
16703
16704
16705
16706 For backward compatiblity the following variables are also set:
16707
16708
16709 SDLNET_LIBRARY (same value as SDL_NET_LIBRARIES)
16710 SDLNET_INCLUDE_DIR (same value as SDL_NET_INCLUDE_DIRS)
16711 SDLNET_FOUND (same value as SDL_NET_FOUND)
16712
16713
16714
16715
16716 $SDLDIR is an environment variable that would correspond to the
16717 ./configure --prefix=$SDLDIR used in building SDL.
16718
16719
16720 Created by Eric Wing. This was influenced by the FindSDL.cmake
16721 module, but with modifications to recognize OS X frameworks and
16722 additional Unix paths (FreeBSD, etc).
16723
16724
16725 FindSDL_sound
16726 Locates the SDL_sound library
16727
16728
16729
16730
16731 This module depends on SDL being found and must be called AFTER
16732 FindSDL.cmake is called.
16733
16734
16735 This module defines
16736
16737
16738 SDL_SOUND_INCLUDE_DIR, where to find SDL_sound.h
16739 SDL_SOUND_FOUND, if false, do not try to link to SDL_sound
16740 SDL_SOUND_LIBRARIES, this contains the list of libraries that you need
16741 to link against. This is a read-only variable and is marked INTERNAL.
16742 SDL_SOUND_EXTRAS, this is an optional variable for you to add your own
16743 flags to SDL_SOUND_LIBRARIES. This is prepended to SDL_SOUND_LIBRARIES.
16744 This is available mostly for cases this module failed to anticipate for
16745 and you must add additional flags. This is marked as ADVANCED.
16746 SDL_SOUND_VERSION_STRING, human-readable string containing the version of SDL_sound
16747
16748
16749
16750
16751 This module also defines (but you shouldn't need to use
16752 directly)
16753
16754
16755 SDL_SOUND_LIBRARY, the name of just the SDL_sound library you would link
16756 against. Use SDL_SOUND_LIBRARIES for you link instructions and not this one.
16757
16758 And might define the following as needed
16759
16760
16761 MIKMOD_LIBRARY
16762 MODPLUG_LIBRARY
16763 OGG_LIBRARY
16764 VORBIS_LIBRARY
16765 SMPEG_LIBRARY
16766 FLAC_LIBRARY
16767 SPEEX_LIBRARY
16768
16769
16770
16771
16772 Typically, you should not use these variables directly, and you
16773 should use SDL_SOUND_LIBRARIES which contains SDL_SOUND_LIBRARY
16774 and the other audio libraries (if needed) to successfully com‐
16775 pile on your system.
16776
16777
16778 Created by Eric Wing. This module is a bit more complicated than
16779 the other FindSDL* family modules. The reason is that SDL_sound
16780 can be compiled in a large variety of different ways which are
16781 independent of platform. SDL_sound may dynamically link against
16782 other 3rd party libraries to get additional codec support, such
16783 as Ogg Vorbis, SMPEG, ModPlug, MikMod, FLAC, Speex, and poten‐
16784 tially others. Under some circumstances which I don't fully
16785 understand, there seems to be a requirement that dependent
16786 libraries of libraries you use must also be explicitly linked
16787 against in order to successfully compile. SDL_sound does not
16788 currently have any system in place to know how it was compiled.
16789 So this CMake module does the hard work in trying to discover
16790 which 3rd party libraries are required for building (if any).
16791 This module uses a brute force approach to create a test program
16792 that uses SDL_sound, and then tries to build it. If the build
16793 fails, it parses the error output for known symbol names to fig‐
16794 ure out which libraries are needed.
16795
16796
16797 Responds to the $SDLDIR and $SDLSOUNDDIR environmental variable
16798 that would correspond to the ./configure --prefix=$SDLDIR used
16799 in building SDL.
16800
16801
16802 On OSX, this will prefer the Framework version (if found) over
16803 others. People will have to manually change the cache values of
16804 SDL_LIBRARY to override this selectionor set the CMake environ‐
16805 ment CMAKE_INCLUDE_PATH to modify the search paths.
16806
16807
16808 FindSDL_ttf
16809 Locate SDL_ttf library
16810
16811 This module defines:
16812
16813
16814 SDL_TTF_LIBRARIES, the name of the library to link against
16815 SDL_TTF_INCLUDE_DIRS, where to find the headers
16816 SDL_TTF_FOUND, if false, do not try to link against
16817 SDL_TTF_VERSION_STRING - human-readable string containing the version of SDL_ttf
16818
16819
16820
16821
16822 For backward compatiblity the following variables are also set:
16823
16824
16825 SDLTTF_LIBRARY (same value as SDL_TTF_LIBRARIES)
16826 SDLTTF_INCLUDE_DIR (same value as SDL_TTF_INCLUDE_DIRS)
16827 SDLTTF_FOUND (same value as SDL_TTF_FOUND)
16828
16829
16830
16831
16832 $SDLDIR is an environment variable that would correspond to the
16833 ./configure --prefix=$SDLDIR used in building SDL.
16834
16835
16836 Created by Eric Wing. This was influenced by the FindSDL.cmake
16837 module, but with modifications to recognize OS X frameworks and
16838 additional Unix paths (FreeBSD, etc).
16839
16840
16841 FindSWIG
16842 Find SWIG
16843
16844 This module finds an installed SWIG. It sets the following
16845 variables:
16846
16847
16848 SWIG_FOUND - set to true if SWIG is found
16849 SWIG_DIR - the directory where swig is installed
16850 SWIG_EXECUTABLE - the path to the swig executable
16851 SWIG_VERSION - the version number of the swig executable
16852
16853
16854
16855
16856 The minimum required version of SWIG can be specified using the
16857 standard syntax, e.g. find_package(SWIG 1.1)
16858
16859
16860 All information is collected from the SWIG_EXECUTABLE so the
16861 version to be found can be changed from the command line by
16862 means of setting SWIG_EXECUTABLE
16863
16864
16865
16866 FindSelfPackers
16867 Find upx
16868
16869 This module looks for some executable packers (i.e. software
16870 that compress executables or shared libs into on-the-fly
16871 self-extracting executables or shared libs. Examples:
16872
16873
16874 UPX: http://wildsau.idv.uni-linz.ac.at/mfx/upx.html
16875
16876
16877 FindSquish
16878 -- Typical Use
16879
16880
16881
16882
16883 This module can be used to find Squish. Currently Squish ver‐
16884 sions 3 and 4 are supported.
16885
16886
16887 SQUISH_FOUND If false, don't try to use Squish
16888 SQUISH_VERSION The full version of Squish found
16889 SQUISH_VERSION_MAJOR The major version of Squish found
16890 SQUISH_VERSION_MINOR The minor version of Squish found
16891 SQUISH_VERSION_PATCH The patch version of Squish found
16892
16893
16894
16895
16896 SQUISH_INSTALL_DIR The Squish installation directory (containing bin, lib, etc)
16897 SQUISH_SERVER_EXECUTABLE The squishserver executable
16898 SQUISH_CLIENT_EXECUTABLE The squishrunner executable
16899
16900
16901
16902
16903 SQUISH_INSTALL_DIR_FOUND Was the install directory found?
16904 SQUISH_SERVER_EXECUTABLE_FOUND Was the server executable found?
16905 SQUISH_CLIENT_EXECUTABLE_FOUND Was the client executable found?
16906
16907
16908
16909
16910 It provides the function squish_v4_add_test() for adding a
16911 squish test to cmake using Squish 4.x:
16912
16913
16914 squish_v4_add_test(cmakeTestName AUT targetName SUITE suiteName TEST squishTestName
16915 [SETTINGSGROUP group] [PRE_COMMAND command] [POST_COMMAND command] )
16916
16917
16918
16919
16920 The arguments have the following meaning:
16921
16922
16923 cmakeTestName: this will be used as the first argument for add_test()
16924 AUT targetName: the name of the cmake target which will be used as AUT, i.e. the
16925 executable which will be tested.
16926 SUITE suiteName: this is either the full path to the squish suite, or just the
16927 last directory of the suite, i.e. the suite name. In this case
16928 the CMakeLists.txt which calls squish_add_test() must be located
16929 in the parent directory of the suite directory.
16930 TEST squishTestName: the name of the squish test, i.e. the name of the subdirectory
16931 of the test inside the suite directory.
16932 SETTINGSGROUP group: if specified, the given settings group will be used for executing the test.
16933 If not specified, the groupname will be "CTest_<username>"
16934 PRE_COMMAND command: if specified, the given command will be executed before starting the squish test.
16935 POST_COMMAND command: same as PRE_COMMAND, but after the squish test has been executed.
16936
16937
16938
16939
16940 enable_testing()
16941 find_package(Squish 4.0)
16942 if (SQUISH_FOUND)
16943 squish_v4_add_test(myTestName AUT myApp SUITE ${CMAKE_SOURCE_DIR}/tests/mySuite TEST someSquishTest SETTINGSGROUP myGroup )
16944 endif ()
16945
16946
16947
16948
16949
16950
16951
16952 For users of Squish version 3.x the macro squish_v3_add_test()
16953 is provided:
16954
16955
16956 squish_v3_add_test(testName applicationUnderTest testCase envVars testWrapper)
16957 Use this macro to add a test using Squish 3.x.
16958
16959
16960
16961
16962 enable_testing()
16963 find_package(Squish)
16964 if (SQUISH_FOUND)
16965 squish_v3_add_test(myTestName myApplication testCase envVars testWrapper)
16966 endif ()
16967
16968
16969
16970
16971 macro SQUISH_ADD_TEST(testName applicationUnderTest testCase
16972 envVars testWrapper)
16973
16974
16975 This is deprecated. Use SQUISH_V3_ADD_TEST() if you are using Squish 3.x instead.
16976
16977
16978 FindSubversion
16979 Extract information from a subversion working copy
16980
16981 The module defines the following variables:
16982
16983
16984 Subversion_SVN_EXECUTABLE - path to svn command line client
16985 Subversion_VERSION_SVN - version of svn command line client
16986 Subversion_FOUND - true if the command line client was found
16987 SUBVERSION_FOUND - same as Subversion_FOUND, set for compatiblity reasons
16988
16989
16990
16991
16992 The minimum required version of Subversion can be specified
16993 using the standard syntax, e.g. find_package(Subversion 1.4)
16994
16995
16996 If the command line client executable is found two macros are
16997 defined:
16998
16999
17000 Subversion_WC_INFO(<dir> <var-prefix>)
17001 Subversion_WC_LOG(<dir> <var-prefix>)
17002
17003 Subversion_WC_INFO extracts information of a subversion working
17004 copy at a given location. This macro defines the following vari‐
17005 ables:
17006
17007
17008 <var-prefix>_WC_URL - url of the repository (at <dir>)
17009 <var-prefix>_WC_ROOT - root url of the repository
17010 <var-prefix>_WC_REVISION - current revision
17011 <var-prefix>_WC_LAST_CHANGED_AUTHOR - author of last commit
17012 <var-prefix>_WC_LAST_CHANGED_DATE - date of last commit
17013 <var-prefix>_WC_LAST_CHANGED_REV - revision of last commit
17014 <var-prefix>_WC_INFO - output of command `svn info <dir>'
17015
17016 Subversion_WC_LOG retrieves the log message of the base revision
17017 of a subversion working copy at a given location. This macro
17018 defines the variable:
17019
17020
17021 <var-prefix>_LAST_CHANGED_LOG - last log of base revision
17022
17023 Example usage:
17024
17025
17026 find_package(Subversion)
17027 if(SUBVERSION_FOUND)
17028 Subversion_WC_INFO(${PROJECT_SOURCE_DIR} Project)
17029 message("Current revision is ${Project_WC_REVISION}")
17030 Subversion_WC_LOG(${PROJECT_SOURCE_DIR} Project)
17031 message("Last changed log is ${Project_LAST_CHANGED_LOG}")
17032 endif()
17033
17034
17035 FindTCL
17036 TK_INTERNAL_PATH was removed.
17037
17038 This module finds if Tcl is installed and determines where the
17039 include files and libraries are. It also determines what the
17040 name of the library is. This code sets the following variables:
17041
17042
17043 TCL_FOUND = Tcl was found
17044 TK_FOUND = Tk was found
17045 TCLTK_FOUND = Tcl and Tk were found
17046 TCL_LIBRARY = path to Tcl library (tcl tcl80)
17047 TCL_INCLUDE_PATH = path to where tcl.h can be found
17048 TCL_TCLSH = path to tclsh binary (tcl tcl80)
17049 TK_LIBRARY = path to Tk library (tk tk80 etc)
17050 TK_INCLUDE_PATH = path to where tk.h can be found
17051 TK_WISH = full path to the wish executable
17052
17053
17054
17055
17056 In an effort to remove some clutter and clear up some issues for
17057 people who are not necessarily Tcl/Tk gurus/developpers, some
17058 variables were moved or removed. Changes compared to CMake 2.4
17059 are:
17060
17061
17062 => they were only useful for people writing Tcl/Tk extensions.
17063 => these libs are not packaged by default with Tcl/Tk distributions.
17064 Even when Tcl/Tk is built from source, several flavors of debug libs
17065 are created and there is no real reason to pick a single one
17066 specifically (say, amongst tcl84g, tcl84gs, or tcl84sgx).
17067 Let's leave that choice to the user by allowing him to assign
17068 TCL_LIBRARY to any Tcl library, debug or not.
17069 => this ended up being only a Win32 variable, and there is a lot of
17070 confusion regarding the location of this file in an installed Tcl/Tk
17071 tree anyway (see 8.5 for example). If you need the internal path at
17072 this point it is safer you ask directly where the *source* tree is
17073 and dig from there.
17074
17075
17076 FindTIFF
17077 Find TIFF library
17078
17079 Find the native TIFF includes and library This module defines
17080
17081
17082 TIFF_INCLUDE_DIR, where to find tiff.h, etc.
17083 TIFF_LIBRARIES, libraries to link against to use TIFF.
17084 TIFF_FOUND, If false, do not try to use TIFF.
17085
17086 also defined, but not for general use are
17087
17088
17089 TIFF_LIBRARY, where to find the TIFF library.
17090
17091
17092 FindTclStub
17093 TCL_STUB_LIBRARY_DEBUG and TK_STUB_LIBRARY_DEBUG were removed.
17094
17095 This module finds Tcl stub libraries. It first finds Tcl include
17096 files and libraries by calling FindTCL.cmake. How to Use the Tcl
17097 Stubs Library:
17098
17099
17100 http://tcl.activestate.com/doc/howto/stubs.html
17101
17102 Using Stub Libraries:
17103
17104
17105 http://safari.oreilly.com/0130385603/ch48lev1sec3
17106
17107 This code sets the following variables:
17108
17109
17110 TCL_STUB_LIBRARY = path to Tcl stub library
17111 TK_STUB_LIBRARY = path to Tk stub library
17112 TTK_STUB_LIBRARY = path to ttk stub library
17113
17114
17115
17116
17117 In an effort to remove some clutter and clear up some issues for
17118 people who are not necessarily Tcl/Tk gurus/developpers, some
17119 variables were moved or removed. Changes compared to CMake 2.4
17120 are:
17121
17122
17123 => these libs are not packaged by default with Tcl/Tk distributions.
17124 Even when Tcl/Tk is built from source, several flavors of debug libs
17125 are created and there is no real reason to pick a single one
17126 specifically (say, amongst tclstub84g, tclstub84gs, or tclstub84sgx).
17127 Let's leave that choice to the user by allowing him to assign
17128 TCL_STUB_LIBRARY to any Tcl library, debug or not.
17129
17130
17131 FindTclsh
17132 Find tclsh
17133
17134 This module finds if TCL is installed and determines where the
17135 include files and libraries are. It also determines what the
17136 name of the library is. This code sets the following variables:
17137
17138
17139 TCLSH_FOUND = TRUE if tclsh has been found
17140 TCL_TCLSH = the path to the tclsh executable
17141
17142 In cygwin, look for the cygwin version first. Don't look for it
17143 later to avoid finding the cygwin version on a Win32 build.
17144
17145
17146 FindThreads
17147 This module determines the thread library of the system.
17148
17149 The following variables are set
17150
17151
17152 CMAKE_THREAD_LIBS_INIT - the thread library
17153 CMAKE_USE_SPROC_INIT - are we using sproc?
17154 CMAKE_USE_WIN32_THREADS_INIT - using WIN32 threads?
17155 CMAKE_USE_PTHREADS_INIT - are we using pthreads
17156 CMAKE_HP_PTHREADS_INIT - are we using hp pthreads
17157
17158 For systems with multiple thread libraries, caller can set
17159
17160
17161 CMAKE_THREAD_PREFER_PTHREAD
17162
17163
17164 FindUnixCommands
17165 Find unix commands from cygwin
17166
17167 This module looks for some usual Unix commands.
17168
17169
17170
17171 FindVTK
17172 Find a VTK installation or build tree.
17173
17174 The following variables are set if VTK is found. If VTK is not
17175 found, VTK_FOUND is set to false.
17176
17177
17178 VTK_FOUND - Set to true when VTK is found.
17179 VTK_USE_FILE - CMake file to use VTK.
17180 VTK_MAJOR_VERSION - The VTK major version number.
17181 VTK_MINOR_VERSION - The VTK minor version number
17182 (odd non-release).
17183 VTK_BUILD_VERSION - The VTK patch level
17184 (meaningless for odd minor).
17185 VTK_INCLUDE_DIRS - Include directories for VTK
17186 VTK_LIBRARY_DIRS - Link directories for VTK libraries
17187 VTK_KITS - List of VTK kits, in CAPS
17188 (COMMON,IO,) etc.
17189 VTK_LANGUAGES - List of wrapped languages, in CAPS
17190 (TCL, PYHTON,) etc.
17191
17192 The following cache entries must be set by the user to locate
17193 VTK:
17194
17195
17196 VTK_DIR - The directory containing VTKConfig.cmake.
17197 This is either the root of the build tree,
17198 or the lib/vtk directory. This is the
17199 only cache entry.
17200
17201 The following variables are set for backward compatibility and
17202 should not be used in new code:
17203
17204
17205 USE_VTK_FILE - The full path to the UseVTK.cmake file.
17206 This is provided for backward
17207 compatibility. Use VTK_USE_FILE
17208 instead.
17209
17210
17211
17212
17213
17214 FindWget
17215 Find wget
17216
17217 This module looks for wget. This module defines the following
17218 values:
17219
17220
17221 WGET_EXECUTABLE: the full path to the wget tool.
17222 WGET_FOUND: True if wget has been found.
17223
17224
17225 FindWish
17226 Find wish installation
17227
17228 This module finds if TCL is installed and determines where the
17229 include files and libraries are. It also determines what the
17230 name of the library is. This code sets the following variables:
17231
17232
17233 TK_WISH = the path to the wish executable
17234
17235
17236
17237
17238 if UNIX is defined, then it will look for the cygwin version
17239 first
17240
17241
17242 FindX11
17243 Find X11 installation
17244
17245 Try to find X11 on UNIX systems. The following values are
17246 defined
17247
17248
17249 X11_FOUND - True if X11 is available
17250 X11_INCLUDE_DIR - include directories to use X11
17251 X11_LIBRARIES - link against these to use X11
17252
17253
17254
17255
17256 and also the following more fine grained variables: Include
17257 paths: X11_ICE_INCLUDE_PATH, X11_ICE_LIB,
17258 X11_ICE_FOUND
17259
17260
17261 X11_SM_INCLUDE_PATH, X11_SM_LIB, X11_SM_FOUND
17262 X11_X11_INCLUDE_PATH, X11_X11_LIB
17263 X11_Xaccessrules_INCLUDE_PATH, X11_Xaccess_FOUND
17264 X11_Xaccessstr_INCLUDE_PATH, X11_Xaccess_FOUND
17265 X11_Xau_INCLUDE_PATH, X11_Xau_LIB, X11_Xau_FOUND
17266 X11_Xcomposite_INCLUDE_PATH, X11_Xcomposite_LIB, X11_Xcomposite_FOUND
17267 X11_Xcursor_INCLUDE_PATH, X11_Xcursor_LIB, X11_Xcursor_FOUND
17268 X11_Xdamage_INCLUDE_PATH, X11_Xdamage_LIB, X11_Xdamage_FOUND
17269 X11_Xdmcp_INCLUDE_PATH, X11_Xdmcp_LIB, X11_Xdmcp_FOUND
17270 X11_Xext_LIB, X11_Xext_FOUND
17271 X11_dpms_INCLUDE_PATH, (in X11_Xext_LIB), X11_dpms_FOUND
17272 X11_XShm_INCLUDE_PATH, (in X11_Xext_LIB), X11_XShm_FOUND
17273 X11_Xshape_INCLUDE_PATH, (in X11_Xext_LIB), X11_Xshape_FOUND
17274 X11_xf86misc_INCLUDE_PATH, X11_Xxf86misc_LIB, X11_xf86misc_FOUND
17275 X11_xf86vmode_INCLUDE_PATH, X11_Xxf86vm_LIB X11_xf86vmode_FOUND
17276 X11_Xfixes_INCLUDE_PATH, X11_Xfixes_LIB, X11_Xfixes_FOUND
17277 X11_Xft_INCLUDE_PATH, X11_Xft_LIB, X11_Xft_FOUND
17278 X11_Xi_INCLUDE_PATH, X11_Xi_LIB, X11_Xi_FOUND
17279 X11_Xinerama_INCLUDE_PATH, X11_Xinerama_LIB, X11_Xinerama_FOUND
17280 X11_Xinput_INCLUDE_PATH, X11_Xinput_LIB, X11_Xinput_FOUND
17281 X11_Xkb_INCLUDE_PATH, X11_Xkb_FOUND
17282 X11_Xkblib_INCLUDE_PATH, X11_Xkb_FOUND
17283 X11_Xkbfile_INCLUDE_PATH, X11_Xkbfile_LIB, X11_Xkbfile_FOUND
17284 X11_Xmu_INCLUDE_PATH, X11_Xmu_LIB, X11_Xmu_FOUND
17285 X11_Xpm_INCLUDE_PATH, X11_Xpm_LIB, X11_Xpm_FOUND
17286 X11_XTest_INCLUDE_PATH, X11_XTest_LIB, X11_XTest_FOUND
17287 X11_Xrandr_INCLUDE_PATH, X11_Xrandr_LIB, X11_Xrandr_FOUND
17288 X11_Xrender_INCLUDE_PATH, X11_Xrender_LIB, X11_Xrender_FOUND
17289 X11_Xscreensaver_INCLUDE_PATH, X11_Xscreensaver_LIB, X11_Xscreensaver_FOUND
17290 X11_Xt_INCLUDE_PATH, X11_Xt_LIB, X11_Xt_FOUND
17291 X11_Xutil_INCLUDE_PATH, X11_Xutil_FOUND
17292 X11_Xv_INCLUDE_PATH, X11_Xv_LIB, X11_Xv_FOUND
17293 X11_XSync_INCLUDE_PATH, (in X11_Xext_LIB), X11_XSync_FOUND
17294
17295
17296 FindXMLRPC
17297 Find xmlrpc
17298
17299 Find the native XMLRPC headers and libraries.
17300
17301
17302 XMLRPC_INCLUDE_DIRS - where to find xmlrpc.h, etc.
17303 XMLRPC_LIBRARIES - List of libraries when using xmlrpc.
17304 XMLRPC_FOUND - True if xmlrpc found.
17305
17306 XMLRPC modules may be specified as components for this find mod‐
17307 ule. Modules may be listed by running "xmlrpc-c-config". Mod‐
17308 ules include:
17309
17310
17311 c++ C++ wrapper code
17312 libwww-client libwww-based client
17313 cgi-server CGI-based server
17314 abyss-server ABYSS-based server
17315
17316 Typical usage:
17317
17318
17319 find_package(XMLRPC REQUIRED libwww-client)
17320
17321
17322 FindZLIB
17323 Find zlib
17324
17325 Find the native ZLIB includes and library. Once done this will
17326 define
17327
17328
17329 ZLIB_INCLUDE_DIRS - where to find zlib.h, etc.
17330 ZLIB_LIBRARIES - List of libraries when using zlib.
17331 ZLIB_FOUND - True if zlib found.
17332
17333
17334
17335
17336 ZLIB_VERSION_STRING - The version of zlib found (x.y.z)
17337 ZLIB_VERSION_MAJOR - The major version of zlib
17338 ZLIB_VERSION_MINOR - The minor version of zlib
17339 ZLIB_VERSION_PATCH - The patch version of zlib
17340 ZLIB_VERSION_TWEAK - The tweak version of zlib
17341
17342
17343
17344
17345 The following variable are provided for backward compatibility
17346
17347
17348 ZLIB_MAJOR_VERSION - The major version of zlib
17349 ZLIB_MINOR_VERSION - The minor version of zlib
17350 ZLIB_PATCH_VERSION - The patch version of zlib
17351
17352
17353
17354
17355 An includer may set ZLIB_ROOT to a zlib installation root to
17356 tell this module where to look.
17357
17358
17359 Findosg
17360
17361
17362
17363
17364
17365 NOTE: It is highly recommended that you use the new FindOpen‐
17366 SceneGraph.cmake introduced in CMake 2.6.3 and not use this Find
17367 module directly.
17368
17369
17370 This is part of the Findosg* suite used to find OpenSceneGraph
17371 components. Each component is separate and you must opt in to
17372 each module. You must also opt into OpenGL and OpenThreads (and
17373 Producer if needed) as these modules won't do it for you. This
17374 is to allow you control over your own system piece by piece in
17375 case you need to opt out of certain components or change the
17376 Find behavior for a particular module (perhaps because the
17377 default FindOpenGL.cmake module doesn't work with your system as
17378 an example). If you want to use a more convenient module that
17379 includes everything, use the FindOpenSceneGraph.cmake instead of
17380 the Findosg*.cmake modules.
17381
17382
17383 Locate osg This module defines
17384
17385
17386 OSG_FOUND - Was the Osg found? OSG_INCLUDE_DIR - Where to find
17387 the headers OSG_LIBRARIES - The libraries to link against for
17388 the OSG (use this)
17389
17390
17391 OSG_LIBRARY - The OSG library OSG_LIBRARY_DEBUG - The OSG debug
17392 library
17393
17394
17395 $OSGDIR is an environment variable that would correspond to the
17396 ./configure --prefix=$OSGDIR used in building osg.
17397
17398
17399 Created by Eric Wing.
17400
17401
17402 FindosgAnimation
17403
17404
17405 This is part of the Findosg* suite used to find OpenSceneGraph
17406 components. Each component is separate and you must opt in to
17407 each module. You must also opt into OpenGL and OpenThreads (and
17408 Producer if needed) as these modules won't do it for you. This
17409 is to allow you control over your own system piece by piece in
17410 case you need to opt out of certain components or change the
17411 Find behavior for a particular module (perhaps because the
17412 default FindOpenGL.cmake module doesn't work with your system as
17413 an example). If you want to use a more convenient module that
17414 includes everything, use the FindOpenSceneGraph.cmake instead of
17415 the Findosg*.cmake modules.
17416
17417
17418 Locate osgAnimation This module defines
17419
17420
17421 OSGANIMATION_FOUND - Was osgAnimation found? OSGANIMA‐
17422 TION_INCLUDE_DIR - Where to find the headers OSGANIMA‐
17423 TION_LIBRARIES - The libraries to link against for the OSG (use
17424 this)
17425
17426
17427 OSGANIMATION_LIBRARY - The OSG library OSGANIMA‐
17428 TION_LIBRARY_DEBUG - The OSG debug library
17429
17430
17431 $OSGDIR is an environment variable that would correspond to the
17432 ./configure --prefix=$OSGDIR used in building osg.
17433
17434
17435 Created by Eric Wing.
17436
17437
17438 FindosgDB
17439
17440
17441 This is part of the Findosg* suite used to find OpenSceneGraph
17442 components. Each component is separate and you must opt in to
17443 each module. You must also opt into OpenGL and OpenThreads (and
17444 Producer if needed) as these modules won't do it for you. This
17445 is to allow you control over your own system piece by piece in
17446 case you need to opt out of certain components or change the
17447 Find behavior for a particular module (perhaps because the
17448 default FindOpenGL.cmake module doesn't work with your system as
17449 an example). If you want to use a more convenient module that
17450 includes everything, use the FindOpenSceneGraph.cmake instead of
17451 the Findosg*.cmake modules.
17452
17453
17454 Locate osgDB This module defines
17455
17456
17457 OSGDB_FOUND - Was osgDB found? OSGDB_INCLUDE_DIR - Where to find
17458 the headers OSGDB_LIBRARIES - The libraries to link against for
17459 the osgDB (use this)
17460
17461
17462 OSGDB_LIBRARY - The osgDB library OSGDB_LIBRARY_DEBUG - The
17463 osgDB debug library
17464
17465
17466 $OSGDIR is an environment variable that would correspond to the
17467 ./configure --prefix=$OSGDIR used in building osg.
17468
17469
17470 Created by Eric Wing.
17471
17472
17473 FindosgFX
17474
17475
17476 This is part of the Findosg* suite used to find OpenSceneGraph
17477 components. Each component is separate and you must opt in to
17478 each module. You must also opt into OpenGL and OpenThreads (and
17479 Producer if needed) as these modules won't do it for you. This
17480 is to allow you control over your own system piece by piece in
17481 case you need to opt out of certain components or change the
17482 Find behavior for a particular module (perhaps because the
17483 default FindOpenGL.cmake module doesn't work with your system as
17484 an example). If you want to use a more convenient module that
17485 includes everything, use the FindOpenSceneGraph.cmake instead of
17486 the Findosg*.cmake modules.
17487
17488
17489 Locate osgFX This module defines
17490
17491
17492 OSGFX_FOUND - Was osgFX found? OSGFX_INCLUDE_DIR - Where to find
17493 the headers OSGFX_LIBRARIES - The libraries to link against for
17494 the osgFX (use this)
17495
17496
17497 OSGFX_LIBRARY - The osgFX library OSGFX_LIBRARY_DEBUG - The
17498 osgFX debug library
17499
17500
17501 $OSGDIR is an environment variable that would correspond to the
17502 ./configure --prefix=$OSGDIR used in building osg.
17503
17504
17505 Created by Eric Wing.
17506
17507
17508 FindosgGA
17509
17510
17511 This is part of the Findosg* suite used to find OpenSceneGraph
17512 components. Each component is separate and you must opt in to
17513 each module. You must also opt into OpenGL and OpenThreads (and
17514 Producer if needed) as these modules won't do it for you. This
17515 is to allow you control over your own system piece by piece in
17516 case you need to opt out of certain components or change the
17517 Find behavior for a particular module (perhaps because the
17518 default FindOpenGL.cmake module doesn't work with your system as
17519 an example). If you want to use a more convenient module that
17520 includes everything, use the FindOpenSceneGraph.cmake instead of
17521 the Findosg*.cmake modules.
17522
17523
17524 Locate osgGA This module defines
17525
17526
17527 OSGGA_FOUND - Was osgGA found? OSGGA_INCLUDE_DIR - Where to find
17528 the headers OSGGA_LIBRARIES - The libraries to link against for
17529 the osgGA (use this)
17530
17531
17532 OSGGA_LIBRARY - The osgGA library OSGGA_LIBRARY_DEBUG - The
17533 osgGA debug library
17534
17535
17536 $OSGDIR is an environment variable that would correspond to the
17537 ./configure --prefix=$OSGDIR used in building osg.
17538
17539
17540 Created by Eric Wing.
17541
17542
17543 FindosgIntrospection
17544
17545
17546 This is part of the Findosg* suite used to find OpenSceneGraph
17547 components. Each component is separate and you must opt in to
17548 each module. You must also opt into OpenGL and OpenThreads (and
17549 Producer if needed) as these modules won't do it for you. This
17550 is to allow you control over your own system piece by piece in
17551 case you need to opt out of certain components or change the
17552 Find behavior for a particular module (perhaps because the
17553 default FindOpenGL.cmake module doesn't work with your system as
17554 an example). If you want to use a more convenient module that
17555 includes everything, use the FindOpenSceneGraph.cmake instead of
17556 the Findosg*.cmake modules.
17557
17558
17559 Locate osgINTROSPECTION This module defines
17560
17561
17562 OSGINTROSPECTION_FOUND - Was osgIntrospection found? OSGINTRO‐
17563 SPECTION_INCLUDE_DIR - Where to find the headers OSGINTROSPEC‐
17564 TION_LIBRARIES - The libraries to link for osgIntrospection (use
17565 this)
17566
17567
17568 OSGINTROSPECTION_LIBRARY - The osgIntrospection library OSGIN‐
17569 TROSPECTION_LIBRARY_DEBUG - The osgIntrospection debug library
17570
17571
17572 $OSGDIR is an environment variable that would correspond to the
17573 ./configure --prefix=$OSGDIR used in building osg.
17574
17575
17576 Created by Eric Wing.
17577
17578
17579 FindosgManipulator
17580
17581
17582 This is part of the Findosg* suite used to find OpenSceneGraph
17583 components. Each component is separate and you must opt in to
17584 each module. You must also opt into OpenGL and OpenThreads (and
17585 Producer if needed) as these modules won't do it for you. This
17586 is to allow you control over your own system piece by piece in
17587 case you need to opt out of certain components or change the
17588 Find behavior for a particular module (perhaps because the
17589 default FindOpenGL.cmake module doesn't work with your system as
17590 an example). If you want to use a more convenient module that
17591 includes everything, use the FindOpenSceneGraph.cmake instead of
17592 the Findosg*.cmake modules.
17593
17594
17595 Locate osgManipulator This module defines
17596
17597
17598 OSGMANIPULATOR_FOUND - Was osgManipulator found? OSGMANIPULA‐
17599 TOR_INCLUDE_DIR - Where to find the headers OSGMANIPULA‐
17600 TOR_LIBRARIES - The libraries to link for osgManipulator (use
17601 this)
17602
17603
17604 OSGMANIPULATOR_LIBRARY - The osgManipulator library OSGMANIPULA‐
17605 TOR_LIBRARY_DEBUG - The osgManipulator debug library
17606
17607
17608 $OSGDIR is an environment variable that would correspond to the
17609 ./configure --prefix=$OSGDIR used in building osg.
17610
17611
17612 Created by Eric Wing.
17613
17614
17615 FindosgParticle
17616
17617
17618 This is part of the Findosg* suite used to find OpenSceneGraph
17619 components. Each component is separate and you must opt in to
17620 each module. You must also opt into OpenGL and OpenThreads (and
17621 Producer if needed) as these modules won't do it for you. This
17622 is to allow you control over your own system piece by piece in
17623 case you need to opt out of certain components or change the
17624 Find behavior for a particular module (perhaps because the
17625 default FindOpenGL.cmake module doesn't work with your system as
17626 an example). If you want to use a more convenient module that
17627 includes everything, use the FindOpenSceneGraph.cmake instead of
17628 the Findosg*.cmake modules.
17629
17630
17631 Locate osgParticle This module defines
17632
17633
17634 OSGPARTICLE_FOUND - Was osgParticle found? OSGPARTI‐
17635 CLE_INCLUDE_DIR - Where to find the headers OSGPARTI‐
17636 CLE_LIBRARIES - The libraries to link for osgParticle (use this)
17637
17638
17639 OSGPARTICLE_LIBRARY - The osgParticle library OSGPARTI‐
17640 CLE_LIBRARY_DEBUG - The osgParticle debug library
17641
17642
17643 $OSGDIR is an environment variable that would correspond to the
17644 ./configure --prefix=$OSGDIR used in building osg.
17645
17646
17647 Created by Eric Wing.
17648
17649
17650 FindosgPresentation
17651
17652
17653 This is part of the Findosg* suite used to find OpenSceneGraph
17654 components. Each component is separate and you must opt in to
17655 each module. You must also opt into OpenGL and OpenThreads (and
17656 Producer if needed) as these modules won't do it for you. This
17657 is to allow you control over your own system piece by piece in
17658 case you need to opt out of certain components or change the
17659 Find behavior for a particular module (perhaps because the
17660 default FindOpenGL.cmake module doesn't work with your system as
17661 an example). If you want to use a more convenient module that
17662 includes everything, use the FindOpenSceneGraph.cmake instead of
17663 the Findosg*.cmake modules.
17664
17665
17666 Locate osgPresentation This module defines
17667
17668
17669 OSGPRESENTATION_FOUND - Was osgPresentation found? OSGPRESENTA‐
17670 TION_INCLUDE_DIR - Where to find the headers OSGPRESENTA‐
17671 TION_LIBRARIES - The libraries to link for osgPresentation (use
17672 this)
17673
17674
17675 OSGPRESENTATION_LIBRARY - The osgPresentation library OSGPRESEN‐
17676 TATION_LIBRARY_DEBUG - The osgPresentation debug library
17677
17678
17679 $OSGDIR is an environment variable that would correspond to the
17680 ./configure --prefix=$OSGDIR used in building osg.
17681
17682
17683 Created by Eric Wing. Modified to work with osgPresentation by
17684 Robert Osfield, January 2012.
17685
17686
17687 FindosgProducer
17688
17689
17690 This is part of the Findosg* suite used to find OpenSceneGraph
17691 components. Each component is separate and you must opt in to
17692 each module. You must also opt into OpenGL and OpenThreads (and
17693 Producer if needed) as these modules won't do it for you. This
17694 is to allow you control over your own system piece by piece in
17695 case you need to opt out of certain components or change the
17696 Find behavior for a particular module (perhaps because the
17697 default FindOpenGL.cmake module doesn't work with your system as
17698 an example). If you want to use a more convenient module that
17699 includes everything, use the FindOpenSceneGraph.cmake instead of
17700 the Findosg*.cmake modules.
17701
17702
17703 Locate osgProducer This module defines
17704
17705
17706 OSGPRODUCER_FOUND - Was osgProducer found? OSGPRO‐
17707 DUCER_INCLUDE_DIR - Where to find the headers OSGPRO‐
17708 DUCER_LIBRARIES - The libraries to link for osgProducer (use
17709 this)
17710
17711
17712 OSGPRODUCER_LIBRARY - The osgProducer library OSGPRO‐
17713 DUCER_LIBRARY_DEBUG - The osgProducer debug library
17714
17715
17716 $OSGDIR is an environment variable that would correspond to the
17717 ./configure --prefix=$OSGDIR used in building osg.
17718
17719
17720 Created by Eric Wing.
17721
17722
17723 FindosgQt
17724
17725
17726 This is part of the Findosg* suite used to find OpenSceneGraph
17727 components. Each component is separate and you must opt in to
17728 each module. You must also opt into OpenGL and OpenThreads (and
17729 Producer if needed) as these modules won't do it for you. This
17730 is to allow you control over your own system piece by piece in
17731 case you need to opt out of certain components or change the
17732 Find behavior for a particular module (perhaps because the
17733 default FindOpenGL.cmake module doesn't work with your system as
17734 an example). If you want to use a more convenient module that
17735 includes everything, use the FindOpenSceneGraph.cmake instead of
17736 the Findosg*.cmake modules.
17737
17738
17739 Locate osgQt This module defines
17740
17741
17742 OSGQT_FOUND - Was osgQt found? OSGQT_INCLUDE_DIR - Where to find
17743 the headers OSGQT_LIBRARIES - The libraries to link for osgQt
17744 (use this)
17745
17746
17747 OSGQT_LIBRARY - The osgQt library OSGQT_LIBRARY_DEBUG - The
17748 osgQt debug library
17749
17750
17751 $OSGDIR is an environment variable that would correspond to the
17752 ./configure --prefix=$OSGDIR used in building osg.
17753
17754
17755 Created by Eric Wing. Modified to work with osgQt by Robert
17756 Osfield, January 2012.
17757
17758
17759 FindosgShadow
17760
17761
17762 This is part of the Findosg* suite used to find OpenSceneGraph
17763 components. Each component is separate and you must opt in to
17764 each module. You must also opt into OpenGL and OpenThreads (and
17765 Producer if needed) as these modules won't do it for you. This
17766 is to allow you control over your own system piece by piece in
17767 case you need to opt out of certain components or change the
17768 Find behavior for a particular module (perhaps because the
17769 default FindOpenGL.cmake module doesn't work with your system as
17770 an example). If you want to use a more convenient module that
17771 includes everything, use the FindOpenSceneGraph.cmake instead of
17772 the Findosg*.cmake modules.
17773
17774
17775 Locate osgShadow This module defines
17776
17777
17778 OSGSHADOW_FOUND - Was osgShadow found? OSGSHADOW_INCLUDE_DIR -
17779 Where to find the headers OSGSHADOW_LIBRARIES - The libraries to
17780 link for osgShadow (use this)
17781
17782
17783 OSGSHADOW_LIBRARY - The osgShadow library
17784 OSGSHADOW_LIBRARY_DEBUG - The osgShadow debug library
17785
17786
17787 $OSGDIR is an environment variable that would correspond to the
17788 ./configure --prefix=$OSGDIR used in building osg.
17789
17790
17791 Created by Eric Wing.
17792
17793
17794 FindosgSim
17795
17796
17797 This is part of the Findosg* suite used to find OpenSceneGraph
17798 components. Each component is separate and you must opt in to
17799 each module. You must also opt into OpenGL and OpenThreads (and
17800 Producer if needed) as these modules won't do it for you. This
17801 is to allow you control over your own system piece by piece in
17802 case you need to opt out of certain components or change the
17803 Find behavior for a particular module (perhaps because the
17804 default FindOpenGL.cmake module doesn't work with your system as
17805 an example). If you want to use a more convenient module that
17806 includes everything, use the FindOpenSceneGraph.cmake instead of
17807 the Findosg*.cmake modules.
17808
17809
17810 Locate osgSim This module defines
17811
17812
17813 OSGSIM_FOUND - Was osgSim found? OSGSIM_INCLUDE_DIR - Where to
17814 find the headers OSGSIM_LIBRARIES - The libraries to link for
17815 osgSim (use this)
17816
17817
17818 OSGSIM_LIBRARY - The osgSim library OSGSIM_LIBRARY_DEBUG - The
17819 osgSim debug library
17820
17821
17822 $OSGDIR is an environment variable that would correspond to the
17823 ./configure --prefix=$OSGDIR used in building osg.
17824
17825
17826 Created by Eric Wing.
17827
17828
17829 FindosgTerrain
17830
17831
17832 This is part of the Findosg* suite used to find OpenSceneGraph
17833 components. Each component is separate and you must opt in to
17834 each module. You must also opt into OpenGL and OpenThreads (and
17835 Producer if needed) as these modules won't do it for you. This
17836 is to allow you control over your own system piece by piece in
17837 case you need to opt out of certain components or change the
17838 Find behavior for a particular module (perhaps because the
17839 default FindOpenGL.cmake module doesn't work with your system as
17840 an example). If you want to use a more convenient module that
17841 includes everything, use the FindOpenSceneGraph.cmake instead of
17842 the Findosg*.cmake modules.
17843
17844
17845 Locate osgTerrain This module defines
17846
17847
17848 OSGTERRAIN_FOUND - Was osgTerrain found? OSGTERRAIN_INCLUDE_DIR
17849 - Where to find the headers OSGTERRAIN_LIBRARIES - The libraries
17850 to link for osgTerrain (use this)
17851
17852
17853 OSGTERRAIN_LIBRARY - The osgTerrain library OSGTER‐
17854 RAIN_LIBRARY_DEBUG - The osgTerrain debug library
17855
17856
17857 $OSGDIR is an environment variable that would correspond to the
17858 ./configure --prefix=$OSGDIR used in building osg.
17859
17860
17861 Created by Eric Wing.
17862
17863
17864 FindosgText
17865
17866
17867 This is part of the Findosg* suite used to find OpenSceneGraph
17868 components. Each component is separate and you must opt in to
17869 each module. You must also opt into OpenGL and OpenThreads (and
17870 Producer if needed) as these modules won't do it for you. This
17871 is to allow you control over your own system piece by piece in
17872 case you need to opt out of certain components or change the
17873 Find behavior for a particular module (perhaps because the
17874 default FindOpenGL.cmake module doesn't work with your system as
17875 an example). If you want to use a more convenient module that
17876 includes everything, use the FindOpenSceneGraph.cmake instead of
17877 the Findosg*.cmake modules.
17878
17879
17880 Locate osgText This module defines
17881
17882
17883 OSGTEXT_FOUND - Was osgText found? OSGTEXT_INCLUDE_DIR - Where
17884 to find the headers OSGTEXT_LIBRARIES - The libraries to link
17885 for osgText (use this)
17886
17887
17888 OSGTEXT_LIBRARY - The osgText library OSGTEXT_LIBRARY_DEBUG -
17889 The osgText debug library
17890
17891
17892 $OSGDIR is an environment variable that would correspond to the
17893 ./configure --prefix=$OSGDIR used in building osg.
17894
17895
17896 Created by Eric Wing.
17897
17898
17899 FindosgUtil
17900
17901
17902 This is part of the Findosg* suite used to find OpenSceneGraph
17903 components. Each component is separate and you must opt in to
17904 each module. You must also opt into OpenGL and OpenThreads (and
17905 Producer if needed) as these modules won't do it for you. This
17906 is to allow you control over your own system piece by piece in
17907 case you need to opt out of certain components or change the
17908 Find behavior for a particular module (perhaps because the
17909 default FindOpenGL.cmake module doesn't work with your system as
17910 an example). If you want to use a more convenient module that
17911 includes everything, use the FindOpenSceneGraph.cmake instead of
17912 the Findosg*.cmake modules.
17913
17914
17915 Locate osgUtil This module defines
17916
17917
17918 OSGUTIL_FOUND - Was osgUtil found? OSGUTIL_INCLUDE_DIR - Where
17919 to find the headers OSGUTIL_LIBRARIES - The libraries to link
17920 for osgUtil (use this)
17921
17922
17923 OSGUTIL_LIBRARY - The osgUtil library OSGUTIL_LIBRARY_DEBUG -
17924 The osgUtil debug library
17925
17926
17927 $OSGDIR is an environment variable that would correspond to the
17928 ./configure --prefix=$OSGDIR used in building osg.
17929
17930
17931 Created by Eric Wing.
17932
17933
17934 FindosgViewer
17935
17936
17937 This is part of the Findosg* suite used to find OpenSceneGraph
17938 components. Each component is separate and you must opt in to
17939 each module. You must also opt into OpenGL and OpenThreads (and
17940 Producer if needed) as these modules won't do it for you. This
17941 is to allow you control over your own system piece by piece in
17942 case you need to opt out of certain components or change the
17943 Find behavior for a particular module (perhaps because the
17944 default FindOpenGL.cmake module doesn't work with your system as
17945 an example). If you want to use a more convenient module that
17946 includes everything, use the FindOpenSceneGraph.cmake instead of
17947 the Findosg*.cmake modules.
17948
17949
17950 Locate osgViewer This module defines
17951
17952
17953 OSGVIEWER_FOUND - Was osgViewer found? OSGVIEWER_INCLUDE_DIR -
17954 Where to find the headers OSGVIEWER_LIBRARIES - The libraries to
17955 link for osgViewer (use this)
17956
17957
17958 OSGVIEWER_LIBRARY - The osgViewer library
17959 OSGVIEWER_LIBRARY_DEBUG - The osgViewer debug library
17960
17961
17962 $OSGDIR is an environment variable that would correspond to the
17963 ./configure --prefix=$OSGDIR used in building osg.
17964
17965
17966 Created by Eric Wing.
17967
17968
17969 FindosgVolume
17970
17971
17972 This is part of the Findosg* suite used to find OpenSceneGraph
17973 components. Each component is separate and you must opt in to
17974 each module. You must also opt into OpenGL and OpenThreads (and
17975 Producer if needed) as these modules won't do it for you. This
17976 is to allow you control over your own system piece by piece in
17977 case you need to opt out of certain components or change the
17978 Find behavior for a particular module (perhaps because the
17979 default FindOpenGL.cmake module doesn't work with your system as
17980 an example). If you want to use a more convenient module that
17981 includes everything, use the FindOpenSceneGraph.cmake instead of
17982 the Findosg*.cmake modules.
17983
17984
17985 Locate osgVolume This module defines
17986
17987
17988 OSGVOLUME_FOUND - Was osgVolume found? OSGVOLUME_INCLUDE_DIR -
17989 Where to find the headers OSGVOLUME_LIBRARIES - The libraries to
17990 link for osgVolume (use this)
17991
17992
17993 OSGVOLUME_LIBRARY - The osgVolume library OSGVOL‐
17994 UME_LIBRARY_DEBUG - The osgVolume debug library
17995
17996
17997 $OSGDIR is an environment variable that would correspond to the
17998 ./configure --prefix=$OSGDIR used in building osg.
17999
18000
18001 Created by Eric Wing.
18002
18003
18004 FindosgWidget
18005
18006
18007 This is part of the Findosg* suite used to find OpenSceneGraph
18008 components. Each component is separate and you must opt in to
18009 each module. You must also opt into OpenGL and OpenThreads (and
18010 Producer if needed) as these modules won't do it for you. This
18011 is to allow you control over your own system piece by piece in
18012 case you need to opt out of certain components or change the
18013 Find behavior for a particular module (perhaps because the
18014 default FindOpenGL.cmake module doesn't work with your system as
18015 an example). If you want to use a more convenient module that
18016 includes everything, use the FindOpenSceneGraph.cmake instead of
18017 the Findosg*.cmake modules.
18018
18019
18020 Locate osgWidget This module defines
18021
18022
18023 OSGWIDGET_FOUND - Was osgWidget found? OSGWIDGET_INCLUDE_DIR -
18024 Where to find the headers OSGWIDGET_LIBRARIES - The libraries to
18025 link for osgWidget (use this)
18026
18027
18028 OSGWIDGET_LIBRARY - The osgWidget library OSGWID‐
18029 GET_LIBRARY_DEBUG - The osgWidget debug library
18030
18031
18032 $OSGDIR is an environment variable that would correspond to the
18033 ./configure --prefix=$OSGDIR used in building osg.
18034
18035
18036 FindosgWidget.cmake tweaked from Findosg* suite as created by
18037 Eric Wing.
18038
18039
18040 Findosg_functions
18041
18042
18043
18044
18045
18046 This CMake file contains two macros to assist with searching for
18047 OSG libraries and nodekits. Please see FindOpenSceneGraph.cmake
18048 for full documentation.
18049
18050
18051
18052 FindwxWidgets
18053 Find a wxWidgets (a.k.a., wxWindows) installation.
18054
18055 This module finds if wxWidgets is installed and selects a
18056 default configuration to use. wxWidgets is a modular library. To
18057 specify the modules that you will use, you need to name them as
18058 components to the package:
18059
18060
18061 find_package(wxWidgets COMPONENTS core base ...)
18062
18063
18064 There are two search branches: a windows style and a unix style.
18065 For windows, the following variables are searched for and set to
18066 defaults in case of multiple choices. Change them if the
18067 defaults are not desired (i.e., these are the only variables you
18068 should change to select a configuration):
18069
18070
18071 wxWidgets_ROOT_DIR - Base wxWidgets directory
18072 (e.g., C:/wxWidgets-2.6.3).
18073 wxWidgets_LIB_DIR - Path to wxWidgets libraries
18074 (e.g., C:/wxWidgets-2.6.3/lib/vc_lib).
18075 wxWidgets_CONFIGURATION - Configuration to use
18076 (e.g., msw, mswd, mswu, mswunivud, etc.)
18077 wxWidgets_EXCLUDE_COMMON_LIBRARIES
18078 - Set to TRUE to exclude linking of
18079 commonly required libs (e.g., png tiff
18080 jpeg zlib regex expat).
18081
18082
18083
18084
18085 For unix style it uses the wx-config utility. You can select
18086 between debug/release, unicode/ansi, universal/non-universal,
18087 and static/shared in the QtDialog or ccmake interfaces by turn‐
18088 ing ON/OFF the following variables:
18089
18090
18091 wxWidgets_USE_DEBUG
18092 wxWidgets_USE_UNICODE
18093 wxWidgets_USE_UNIVERSAL
18094 wxWidgets_USE_STATIC
18095
18096
18097
18098
18099 There is also a wxWidgets_CONFIG_OPTIONS variable for all other
18100 options that need to be passed to the wx-config utility. For
18101 example, to use the base toolkit found in the /usr/local path,
18102 set the variable (before calling the FIND_PACKAGE command) as
18103 such:
18104
18105
18106 set(wxWidgets_CONFIG_OPTIONS --toolkit=base --prefix=/usr)
18107
18108
18109
18110
18111 The following are set after the configuration is done for both
18112 windows and unix style:
18113
18114
18115 wxWidgets_FOUND - Set to TRUE if wxWidgets was found.
18116 wxWidgets_INCLUDE_DIRS - Include directories for WIN32
18117 i.e., where to find "wx/wx.h" and
18118 "wx/setup.h"; possibly empty for unices.
18119 wxWidgets_LIBRARIES - Path to the wxWidgets libraries.
18120 wxWidgets_LIBRARY_DIRS - compile time link dirs, useful for
18121 rpath on UNIX. Typically an empty string
18122 in WIN32 environment.
18123 wxWidgets_DEFINITIONS - Contains defines required to compile/link
18124 against WX, e.g. WXUSINGDLL
18125 wxWidgets_DEFINITIONS_DEBUG- Contains defines required to compile/link
18126 against WX debug builds, e.g. __WXDEBUG__
18127 wxWidgets_CXX_FLAGS - Include dirs and compiler flags for
18128 unices, empty on WIN32. Essentially
18129 "`wx-config --cxxflags`".
18130 wxWidgets_USE_FILE - Convenience include file.
18131
18132
18133
18134
18135 Sample usage:
18136
18137
18138 # Note that for MinGW users the order of libs is important!
18139 find_package(wxWidgets COMPONENTS net gl core base)
18140 if(wxWidgets_FOUND)
18141 include(${wxWidgets_USE_FILE})
18142 # and for each of your dependent executable/library targets:
18143 target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES})
18144 endif()
18145
18146
18147
18148
18149 If wxWidgets is required (i.e., not an optional part):
18150
18151
18152 find_package(wxWidgets REQUIRED net gl core base)
18153 include(${wxWidgets_USE_FILE})
18154 # and for each of your dependent executable/library targets:
18155 target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES})
18156
18157
18158 FindwxWindows
18159 Find wxWindows (wxWidgets) installation
18160
18161 This module finds if wxWindows/wxWidgets is installed and deter‐
18162 mines where the include files and libraries are. It also deter‐
18163 mines what the name of the library is. Please note this file is
18164 DEPRECATED and replaced by FindwxWidgets.cmake. This code sets
18165 the following variables:
18166
18167
18168 WXWINDOWS_FOUND = system has WxWindows
18169 WXWINDOWS_LIBRARIES = path to the wxWindows libraries
18170 on Unix/Linux with additional
18171 linker flags from
18172 "wx-config --libs"
18173 CMAKE_WXWINDOWS_CXX_FLAGS = Compiler flags for wxWindows,
18174 essentially "`wx-config --cxxflags`"
18175 on Linux
18176 WXWINDOWS_INCLUDE_DIR = where to find "wx/wx.h" and "wx/setup.h"
18177 WXWINDOWS_LINK_DIRECTORIES = link directories, useful for rpath on
18178 Unix
18179 WXWINDOWS_DEFINITIONS = extra defines
18180
18181
18182
18183
18184 OPTIONS If you need OpenGL support please
18185
18186
18187 set(WXWINDOWS_USE_GL 1)
18188
18189 in your CMakeLists.txt *before* you include this file.
18190
18191
18192 HAVE_ISYSTEM - true required to replace -I by -isystem on g++
18193
18194
18195
18196
18197 For convenience include Use_wxWindows.cmake in your project's
18198 CMakeLists.txt using include(${CMAKE_CUR‐
18199 RENT_LIST_DIR}/Use_wxWindows.cmake).
18200
18201
18202 USAGE
18203
18204
18205 set(WXWINDOWS_USE_GL 1)
18206 find_package(wxWindows)
18207
18208
18209
18210
18211 NOTES wxWidgets 2.6.x is supported for monolithic builds e.g.
18212 compiled in wx/build/msw dir as:
18213
18214
18215 nmake -f makefile.vc BUILD=debug SHARED=0 USE_OPENGL=1 MONOLITHIC=1
18216
18217
18218
18219
18220 DEPRECATED
18221
18222
18223 CMAKE_WX_CAN_COMPILE
18224 WXWINDOWS_LIBRARY
18225 CMAKE_WX_CXX_FLAGS
18226 WXWINDOWS_INCLUDE_PATH
18227
18228
18229
18230
18231 AUTHOR Jan Woetzel <http://www.mip.informatik.uni-kiel.de/~jw>
18232 (07/2003-01/2006)
18233
18234
18235 FortranCInterface
18236 Fortran/C Interface Detection
18237
18238 This module automatically detects the API by which C and Fortran
18239 languages interact. Variables indicate if the mangling is
18240 found:
18241
18242
18243 FortranCInterface_GLOBAL_FOUND = Global subroutines and functions
18244 FortranCInterface_MODULE_FOUND = Module subroutines and functions
18245 (declared by "MODULE PROCEDURE")
18246
18247 A function is provided to generate a C header file containing
18248 macros to mangle symbol names:
18249
18250
18251 FortranCInterface_HEADER(<file>
18252 [MACRO_NAMESPACE <macro-ns>]
18253 [SYMBOL_NAMESPACE <ns>]
18254 [SYMBOLS [<module>:]<function> ...])
18255
18256 It generates in <file> definitions of the following macros:
18257
18258
18259 #define FortranCInterface_GLOBAL (name,NAME) ...
18260 #define FortranCInterface_GLOBAL_(name,NAME) ...
18261 #define FortranCInterface_MODULE (mod,name, MOD,NAME) ...
18262 #define FortranCInterface_MODULE_(mod,name, MOD,NAME) ...
18263
18264 These macros mangle four categories of Fortran symbols, respec‐
18265 tively:
18266
18267
18268 - Global symbols without '_': call mysub()
18269 - Global symbols with '_' : call my_sub()
18270 - Module symbols without '_': use mymod; call mysub()
18271 - Module symbols with '_' : use mymod; call my_sub()
18272
18273 If mangling for a category is not known, its macro is left unde‐
18274 fined. All macros require raw names in both lower case and upper
18275 case. The MACRO_NAMESPACE option replaces the default "FortranC‐
18276 Interface_" prefix with a given namespace "<macro-ns>".
18277
18278
18279 The SYMBOLS option lists symbols to mangle automatically with C
18280 preprocessor definitions:
18281
18282
18283 <function> ==> #define <ns><function> ...
18284 <module>:<function> ==> #define <ns><module>_<function> ...
18285
18286 If the mangling for some symbol is not known then no preproces‐
18287 sor definition is created, and a warning is displayed. The SYM‐
18288 BOL_NAMESPACE option prefixes all preprocessor definitions gen‐
18289 erated by the SYMBOLS option with a given namespace "<ns>".
18290
18291
18292 Example usage:
18293
18294
18295 include(FortranCInterface)
18296 FortranCInterface_HEADER(FC.h MACRO_NAMESPACE "FC_")
18297
18298 This creates a "FC.h" header that defines mangling macros
18299 FC_GLOBAL(), FC_GLOBAL_(), FC_MODULE(), and FC_MODULE_().
18300
18301
18302 Example usage:
18303
18304
18305 include(FortranCInterface)
18306 FortranCInterface_HEADER(FCMangle.h
18307 MACRO_NAMESPACE "FC_"
18308 SYMBOL_NAMESPACE "FC_"
18309 SYMBOLS mysub mymod:my_sub)
18310
18311 This creates a "FCMangle.h" header that defines the same FC_*()
18312 mangling macros as the previous example plus preprocessor sym‐
18313 bols FC_mysub and FC_mymod_my_sub.
18314
18315
18316 Another function is provided to verify that the Fortran and
18317 C/C++ compilers work together:
18318
18319
18320 FortranCInterface_VERIFY([CXX] [QUIET])
18321
18322 It tests whether a simple test executable using Fortran and C
18323 (and C++ when the CXX option is given) compiles and links suc‐
18324 cessfully. The result is stored in the cache entry FortranCIn‐
18325 terface_VERIFIED_C (or FortranCInterface_VERIFIED_CXX if CXX is
18326 given) as a boolean. If the check fails and QUIET is not given
18327 the function terminates with a FATAL_ERROR message describing
18328 the problem. The purpose of this check is to stop a build early
18329 for incompatible compiler combinations. The test is built in
18330 the Release configuration.
18331
18332
18333 FortranCInterface is aware of possible GLOBAL and MODULE man‐
18334 glings for many Fortran compilers, but it also provides an
18335 interface to specify new possible manglings. Set the variables
18336
18337
18338 FortranCInterface_GLOBAL_SYMBOLS
18339 FortranCInterface_MODULE_SYMBOLS
18340
18341 before including FortranCInterface to specify manglings of the
18342 symbols "MySub", "My_Sub", "MyModule:MySub", and "My_Mod‐
18343 ule:My_Sub". For example, the code:
18344
18345
18346 set(FortranCInterface_GLOBAL_SYMBOLS mysub_ my_sub__ MYSUB_)
18347 # ^^^^^ ^^^^^^ ^^^^^
18348 set(FortranCInterface_MODULE_SYMBOLS
18349 __mymodule_MOD_mysub __my_module_MOD_my_sub)
18350 # ^^^^^^^^ ^^^^^ ^^^^^^^^^ ^^^^^^
18351 include(FortranCInterface)
18352
18353 tells FortranCInterface to try given GLOBAL and MODULE man‐
18354 glings. (The carets point at raw symbol names for clarity in
18355 this example but are not needed.)
18356
18357
18358 GNUInstallDirs
18359 Define GNU standard installation directories
18360
18361 Provides install directory variables as defined for GNU soft‐
18362 ware:
18363
18364
18365 http://www.gnu.org/prep/standards/html_node/Directory-Variables.html
18366
18367 Inclusion of this module defines the following variables:
18368
18369
18370 CMAKE_INSTALL_<dir> - destination for files of a given type
18371 CMAKE_INSTALL_FULL_<dir> - corresponding absolute path
18372
18373 where <dir> is one of:
18374
18375
18376 BINDIR - user executables (bin)
18377 SBINDIR - system admin executables (sbin)
18378 LIBEXECDIR - program executables (libexec)
18379 SYSCONFDIR - read-only single-machine data (etc)
18380 SHAREDSTATEDIR - modifiable architecture-independent data (com)
18381 LOCALSTATEDIR - modifiable single-machine data (var)
18382 LIBDIR - object code libraries (lib or lib64 or lib/<multiarch-tuple> on Debian)
18383 INCLUDEDIR - C header files (include)
18384 OLDINCLUDEDIR - C header files for non-gcc (/usr/include)
18385 DATAROOTDIR - read-only architecture-independent data root (share)
18386 DATADIR - read-only architecture-independent data (DATAROOTDIR)
18387 INFODIR - info documentation (DATAROOTDIR/info)
18388 LOCALEDIR - locale-dependent data (DATAROOTDIR/locale)
18389 MANDIR - man documentation (DATAROOTDIR/man)
18390 DOCDIR - documentation root (DATAROOTDIR/doc/PROJECT_NAME)
18391
18392 Each CMAKE_INSTALL_<dir> value may be passed to the DESTINATION
18393 options of install() commands for the corresponding file type.
18394 If the includer does not define a value the above-shown default
18395 will be used and the value will appear in the cache for editing
18396 by the user. Each CMAKE_INSTALL_FULL_<dir> value contains an
18397 absolute path constructed from the corresponding destination by
18398 prepending (if necessary) the value of CMAKE_INSTALL_PREFIX.
18399
18400
18401 GenerateExportHeader
18402 Function for generation of export macros for libraries
18403
18404 This module provides the function GENERATE_EXPORT_HEADER() and
18405 the accompanying ADD_COMPILER_EXPORT_FLAGS() function.
18406
18407
18408 The GENERATE_EXPORT_HEADER function can be used to generate a
18409 file suitable for preprocessor inclusion which contains EXPORT
18410 macros to be used in library classes.
18411
18412
18413 GENERATE_EXPORT_HEADER( LIBRARY_TARGET
18414
18415
18416 [BASE_NAME <base_name>]
18417 [EXPORT_MACRO_NAME <export_macro_name>]
18418 [EXPORT_FILE_NAME <export_file_name>]
18419 [DEPRECATED_MACRO_NAME <deprecated_macro_name>]
18420 [NO_EXPORT_MACRO_NAME <no_export_macro_name>]
18421 [STATIC_DEFINE <static_define>]
18422 [NO_DEPRECATED_MACRO_NAME <no_deprecated_macro_name>]
18423 [DEFINE_NO_DEPRECATED]
18424 [PREFIX_NAME <prefix_name>]
18425
18426 )
18427
18428
18429 ADD_COMPILER_EXPORT_FLAGS( [<output_variable>] )
18430
18431
18432 By default GENERATE_EXPORT_HEADER() generates macro names in a
18433 file name determined by the name of the library. The ADD_COM‐
18434 PILER_EXPORT_FLAGS function adds -fvisibility=hidden to
18435 CMAKE_CXX_FLAGS if supported, and is a no-op on Windows which
18436 does not need extra compiler flags for exporting support. You
18437 may optionally pass a single argument to ADD_COM‐
18438 PILER_EXPORT_FLAGS that will be populated with the required
18439 CXX_FLAGS required to enable visibility support for the com‐
18440 piler/architecture in use.
18441
18442
18443 This means that in the simplest case, users of these functions
18444 will be equivalent to:
18445
18446
18447 add_compiler_export_flags()
18448 add_library(somelib someclass.cpp)
18449 generate_export_header(somelib)
18450 install(TARGETS somelib DESTINATION ${LIBRARY_INSTALL_DIR})
18451 install(FILES
18452 someclass.h
18453 ${PROJECT_BINARY_DIR}/somelib_export.h DESTINATION ${INCLUDE_INSTALL_DIR}
18454 )
18455
18456
18457
18458
18459 And in the ABI header files:
18460
18461
18462 #include "somelib_export.h"
18463 class SOMELIB_EXPORT SomeClass {
18464 ...
18465 };
18466
18467
18468
18469
18470 The CMake fragment will generate a file in the ${CMAKE_CUR‐
18471 RENT_BINARY_DIR} called somelib_export.h containing the macros
18472 SOMELIB_EXPORT, SOMELIB_NO_EXPORT, SOMELIB_DEPRECATED,
18473 SOMELIB_DEPRECATED_EXPORT and SOMELIB_DEPRECATED_NO_EXPORT. The
18474 resulting file should be installed with other headers in the
18475 library.
18476
18477
18478 The BASE_NAME argument can be used to override the file name and
18479 the names used for the macros
18480
18481
18482 add_library(somelib someclass.cpp)
18483 generate_export_header(somelib
18484 BASE_NAME other_name
18485 )
18486
18487
18488
18489
18490 Generates a file called other_name_export.h containing the
18491 macros OTHER_NAME_EXPORT, OTHER_NAME_NO_EXPORT and
18492 OTHER_NAME_DEPRECATED etc.
18493
18494
18495 The BASE_NAME may be overridden by specifiying other options in
18496 the function. For example:
18497
18498
18499 add_library(somelib someclass.cpp)
18500 generate_export_header(somelib
18501 EXPORT_MACRO_NAME OTHER_NAME_EXPORT
18502 )
18503
18504
18505
18506
18507 creates the macro OTHER_NAME_EXPORT instead of SOMELIB_EXPORT,
18508 but other macros and the generated file name is as default.
18509
18510
18511 add_library(somelib someclass.cpp)
18512 generate_export_header(somelib
18513 DEPRECATED_MACRO_NAME KDE_DEPRECATED
18514 )
18515
18516
18517
18518
18519 creates the macro KDE_DEPRECATED instead of SOMELIB_DEPRECATED.
18520
18521
18522 If LIBRARY_TARGET is a static library, macros are defined with‐
18523 out values.
18524
18525
18526 If the same sources are used to create both a shared and a
18527 static library, the uppercased symbol ${BASE_NAME}_STATIC_DEFINE
18528 should be used when building the static library
18529
18530
18531 add_library(shared_variant SHARED ${lib_SRCS})
18532 add_library(static_variant ${lib_SRCS})
18533 generate_export_header(shared_variant BASE_NAME libshared_and_static)
18534 set_target_properties(static_variant PROPERTIES
18535 COMPILE_FLAGS -DLIBSHARED_AND_STATIC_STATIC_DEFINE)
18536
18537
18538
18539
18540 This will cause the export macros to expand to nothing when
18541 building the static library.
18542
18543
18544 If DEFINE_NO_DEPRECATED is specified, then a macro
18545 ${BASE_NAME}_NO_DEPRECATED will be defined This macro can be
18546 used to remove deprecated code from preprocessor output.
18547
18548
18549 option(EXCLUDE_DEPRECATED "Exclude deprecated parts of the library" FALSE)
18550 if (EXCLUDE_DEPRECATED)
18551 set(NO_BUILD_DEPRECATED DEFINE_NO_DEPRECATED)
18552 endif()
18553 generate_export_header(somelib ${NO_BUILD_DEPRECATED})
18554
18555
18556
18557
18558 And then in somelib:
18559
18560
18561 class SOMELIB_EXPORT SomeClass
18562 {
18563 public:
18564 #ifndef SOMELIB_NO_DEPRECATED
18565 SOMELIB_DEPRECATED void oldMethod();
18566 #endif
18567 };
18568
18569
18570
18571
18572 #ifndef SOMELIB_NO_DEPRECATED
18573 void SomeClass::oldMethod() { }
18574 #endif
18575
18576
18577
18578
18579 If PREFIX_NAME is specified, the argument will be used as a pre‐
18580 fix to all generated macros.
18581
18582
18583 For example:
18584
18585
18586 generate_export_header(somelib PREFIX_NAME VTK_)
18587
18588
18589
18590
18591 Generates the macros VTK_SOMELIB_EXPORT etc.
18592
18593
18594 GetPrerequisites
18595 Functions to analyze and list executable file prerequisites.
18596
18597 This module provides functions to list the .dll, .dylib or .so
18598 files that an executable or shared library file depends on. (Its
18599 prerequisites.)
18600
18601
18602 It uses various tools to obtain the list of required shared
18603 library files:
18604
18605
18606 dumpbin (Windows)
18607 objdump (MinGW on Windows)
18608 ldd (Linux/Unix)
18609 otool (Mac OSX)
18610
18611 The following functions are provided by this module:
18612
18613
18614 get_prerequisites
18615 list_prerequisites
18616 list_prerequisites_by_glob
18617 gp_append_unique
18618 is_file_executable
18619 gp_item_default_embedded_path
18620 (projects can override with gp_item_default_embedded_path_override)
18621 gp_resolve_item
18622 (projects can override with gp_resolve_item_override)
18623 gp_resolved_file_type
18624 (projects can override with gp_resolved_file_type_override)
18625 gp_file_type
18626
18627 Requires CMake 2.6 or greater because it uses function, break,
18628 return and PARENT_SCOPE.
18629
18630
18631 GET_PREREQUISITES(<target> <prerequisites_var> <exclude_system> <recurse>
18632 <exepath> <dirs>)
18633
18634 Get the list of shared library files required by <target>. The
18635 list in the variable named <prerequisites_var> should be empty
18636 on first entry to this function. On exit, <prerequisites_var>
18637 will contain the list of required shared library files.
18638
18639
18640 <target> is the full path to an executable file. <prerequi‐
18641 sites_var> is the name of a CMake variable to contain the
18642 results. <exclude_system> must be 0 or 1 indicating whether to
18643 include or exclude "system" prerequisites. If <recurse> is set
18644 to 1 all prerequisites will be found recursively, if set to 0
18645 only direct prerequisites are listed. <exepath> is the path to
18646 the top level executable used for @executable_path replacment on
18647 the Mac. <dirs> is a list of paths where libraries might be
18648 found: these paths are searched first when a target without any
18649 path info is given. Then standard system locations are also
18650 searched: PATH, Framework locations, /usr/lib...
18651
18652
18653 LIST_PREREQUISITES(<target> [<recurse> [<exclude_system> [<verbose>]]])
18654
18655 Print a message listing the prerequisites of <target>.
18656
18657
18658 <target> is the name of a shared library or executable target or
18659 the full path to a shared library or executable file. If
18660 <recurse> is set to 1 all prerequisites will be found recur‐
18661 sively, if set to 0 only direct prerequisites are listed.
18662 <exclude_system> must be 0 or 1 indicating whether to include or
18663 exclude "system" prerequisites. With <verbose> set to 0 only the
18664 full path names of the prerequisites are printed, set to 1 extra
18665 informatin will be displayed.
18666
18667
18668 LIST_PREREQUISITES_BY_GLOB(<glob_arg> <glob_exp>)
18669
18670 Print the prerequisites of shared library and executable files
18671 matching a globbing pattern. <glob_arg> is GLOB or GLOB_RECURSE
18672 and <glob_exp> is a globbing expression used with "file(GLOB" or
18673 "file(GLOB_RECURSE" to retrieve a list of matching files. If a
18674 matching file is executable, its prerequisites are listed.
18675
18676
18677 Any additional (optional) arguments provided are passed along as
18678 the optional arguments to the list_prerequisites calls.
18679
18680
18681 GP_APPEND_UNIQUE(<list_var> <value>)
18682
18683 Append <value> to the list variable <list_var> only if the value
18684 is not already in the list.
18685
18686
18687 IS_FILE_EXECUTABLE(<file> <result_var>)
18688
18689 Return 1 in <result_var> if <file> is a binary executable, 0
18690 otherwise.
18691
18692
18693 GP_ITEM_DEFAULT_EMBEDDED_PATH(<item> <default_embedded_path_var>)
18694
18695 Return the path that others should refer to the item by when the
18696 item is embedded inside a bundle.
18697
18698
18699 Override on a per-project basis by providing a project-specific
18700 gp_item_default_embedded_path_override function.
18701
18702
18703 GP_RESOLVE_ITEM(<context> <item> <exepath> <dirs> <resolved_item_var>)
18704
18705 Resolve an item into an existing full path file.
18706
18707
18708 Override on a per-project basis by providing a project-specific
18709 gp_resolve_item_override function.
18710
18711
18712 GP_RESOLVED_FILE_TYPE(<original_file> <file> <exepath> <dirs> <type_var>)
18713
18714 Return the type of <file> with respect to <original_file>.
18715 String describing type of prerequisite is returned in variable
18716 named <type_var>.
18717
18718
18719 Use <exepath> and <dirs> if necessary to resolve non-absolute
18720 <file> values -- but only for non-embedded items.
18721
18722
18723 Possible types are:
18724
18725
18726 system
18727 local
18728 embedded
18729 other
18730
18731 Override on a per-project basis by providing a project-specific
18732 gp_resolved_file_type_override function.
18733
18734
18735 GP_FILE_TYPE(<original_file> <file> <type_var>)
18736
18737 Return the type of <file> with respect to <original_file>.
18738 String describing type of prerequisite is returned in variable
18739 named <type_var>.
18740
18741
18742 Possible types are:
18743
18744
18745 system
18746 local
18747 embedded
18748 other
18749
18750
18751 InstallRequiredSystemLibraries
18752
18753
18754 By including this file, all library files listed in the variable
18755 CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS will be installed with
18756 install(PROGRAMS ...) into bin for WIN32 and lib for non-WIN32.
18757 If CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP is set to TRUE before
18758 including this file, then the INSTALL command is not called. The
18759 user can use the variable CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS to
18760 use a custom install command and install them however they want.
18761 If it is the MSVC compiler, then the microsoft run time
18762 libraries will be found and automatically added to the
18763 CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS, and installed. If
18764 CMAKE_INSTALL_DEBUG_LIBRARIES is set and it is the MSVC com‐
18765 piler, then the debug libraries are installed when available. If
18766 CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY is set then only the debug
18767 libraries are installed when both debug and release are avail‐
18768 able. If CMAKE_INSTALL_MFC_LIBRARIES is set then the MFC run
18769 time libraries are installed as well as the CRT run time
18770 libraries. If CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION is set
18771 then the libraries are installed to that directory rather than
18772 the default. If CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS is
18773 NOT set, then this file warns about required files that do not
18774 exist. You can set this variable to ON before including this
18775 file to avoid the warning. For example, the Visual Studio
18776 Express editions do not include the redistributable files, so if
18777 you include this file on a machine with only VS Express
18778 installed, you'll get the warning.
18779
18780
18781 MacroAddFileDependencies
18782 MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...)
18783
18784 Using the macro MACRO_ADD_FILE_DEPENDENCIES() is discouraged.
18785 There are usually better ways to specify the correct dependen‐
18786 cies.
18787
18788
18789 MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...) is just a
18790 convenience wrapper around the OBJECT_DEPENDS source file prop‐
18791 erty. You can just use set_property(SOURCE <file> APPEND PROP‐
18792 ERTY OBJECT_DEPENDS depend_files) instead.
18793
18794
18795 ProcessorCount
18796 ProcessorCount(var)
18797
18798 Determine the number of processors/cores and save value in
18799 ${var}
18800
18801
18802 Sets the variable named ${var} to the number of physical cores
18803 available on the machine if the information can be determined.
18804 Otherwise it is set to 0. Currently this functionality is imple‐
18805 mented for AIX, cygwin, FreeBSD, HPUX, IRIX, Linux, Mac OS X,
18806 QNX, Sun and Windows.
18807
18808
18809 This function is guaranteed to return a positive integer (>=1)
18810 if it succeeds. It returns 0 if there's a problem determining
18811 the processor count.
18812
18813
18814 Example use, in a ctest -S dashboard script:
18815
18816
18817 include(ProcessorCount)
18818 ProcessorCount(N)
18819 if(NOT N EQUAL 0)
18820 set(CTEST_BUILD_FLAGS -j${N})
18821 set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N})
18822 endif()
18823
18824
18825
18826
18827 This function is intended to offer an approximation of the value
18828 of the number of compute cores available on the current machine,
18829 such that you may use that value for parallel building and par‐
18830 allel testing. It is meant to help utilize as much of the
18831 machine as seems reasonable. Of course, knowledge of what else
18832 might be running on the machine simultaneously should be used
18833 when deciding whether to request a machine's full capacity all
18834 for yourself.
18835
18836
18837 Qt4ConfigDependentSettings
18838
18839
18840 This file is included by FindQt4.cmake, don't include it
18841 directly.
18842
18843
18844 Qt4Macros
18845
18846
18847 This file is included by FindQt4.cmake, don't include it
18848 directly.
18849
18850
18851 SelectLibraryConfigurations
18852
18853
18854 select_library_configurations( basename )
18855
18856
18857 This macro takes a library base name as an argument, and will
18858 choose good values for basename_LIBRARY, basename_LIBRARIES,
18859 basename_LIBRARY_DEBUG, and basename_LIBRARY_RELEASE depending
18860 on what has been found and set. If only base‐
18861 name_LIBRARY_RELEASE is defined, basename_LIBRARY will be set to
18862 the release value, and basename_LIBRARY_DEBUG will be set to
18863 basename_LIBRARY_DEBUG-NOTFOUND. If only basename_LIBRARY_DEBUG
18864 is defined, then basename_LIBRARY will take the debug value, and
18865 basename_LIBRARY_RELEASE will be set to base‐
18866 name_LIBRARY_RELEASE-NOTFOUND.
18867
18868
18869 If the generator supports configuration types, then base‐
18870 name_LIBRARY and basename_LIBRARIES will be set with debug and
18871 optimized flags specifying the library to be used for the given
18872 configuration. If no build type has been set or the generator
18873 in use does not support configuration types, then base‐
18874 name_LIBRARY and basename_LIBRARIES will take only the release
18875 value, or the debug value if the release one is not set.
18876
18877
18878 SquishTestScript
18879
18880
18881
18882
18883
18884 This script launches a GUI test using Squish. You should not
18885 call the script directly; instead, you should access it via the
18886 SQUISH_ADD_TEST macro that is defined in FindSquish.cmake.
18887
18888
18889 This script starts the Squish server, launches the test on the
18890 client, and finally stops the squish server. If any of these
18891 steps fail (including if the tests do not pass) then a fatal
18892 error is raised.
18893
18894
18895
18896 TestBigEndian
18897 Define macro to determine endian type
18898
18899 Check if the system is big endian or little endian
18900
18901
18902 TEST_BIG_ENDIAN(VARIABLE)
18903 VARIABLE - variable to store the result to
18904
18905
18906
18907
18908
18909 TestCXXAcceptsFlag
18910 Test CXX compiler for a flag
18911
18912 Check if the CXX compiler accepts a flag
18913
18914
18915 Macro CHECK_CXX_ACCEPTS_FLAG(FLAGS VARIABLE) -
18916 checks if the function exists
18917 FLAGS - the flags to try
18918 VARIABLE - variable to store the result
18919
18920
18921
18922
18923
18924 TestForANSIForScope
18925 Check for ANSI for scope support
18926
18927 Check if the compiler restricts the scope of variables declared
18928 in a for-init-statement to the loop body.
18929
18930
18931 CMAKE_NO_ANSI_FOR_SCOPE - holds result
18932
18933
18934
18935
18936
18937 TestForANSIStreamHeaders
18938 Test for compiler support of ANSI stream headers iostream, etc.
18939
18940 check if the compiler supports the standard ANSI iostream header
18941 (without the .h)
18942
18943
18944 CMAKE_NO_ANSI_STREAM_HEADERS - defined by the results
18945
18946
18947
18948
18949
18950 TestForSSTREAM
18951 Test for compiler support of ANSI sstream header
18952
18953 check if the compiler supports the standard ANSI sstream header
18954
18955
18956 CMAKE_NO_ANSI_STRING_STREAM - defined by the results
18957
18958
18959
18960
18961
18962 TestForSTDNamespace
18963 Test for std:: namespace support
18964
18965 check if the compiler supports std:: on stl classes
18966
18967
18968 CMAKE_NO_STD_NAMESPACE - defined by the results
18969
18970
18971
18972
18973
18974 UseEcos
18975 This module defines variables and macros required to build eCos
18976 application.
18977
18978 This file contains the following macros: ECOS_ADD_INCLUDE_DIREC‐
18979 TORIES() - add the eCos include dirs ECOS_ADD_EXECUTABLE(name
18980 source1 ... sourceN ) - create an eCos executable
18981 ECOS_ADJUST_DIRECTORY(VAR source1 ... sourceN ) - adjusts the
18982 path of the source files and puts the result into VAR
18983
18984
18985 Macros for selecting the toolchain: ECOS_USE_ARM_ELF_TOOLS()
18986 - enable the ARM ELF toolchain for the directory where it is
18987 called ECOS_USE_I386_ELF_TOOLS() - enable the i386 ELF
18988 toolchain for the directory where it is called
18989 ECOS_USE_PPC_EABI_TOOLS() - enable the PowerPC toolchain
18990 for the directory where it is called
18991
18992
18993 It contains the following variables: ECOS_DEFINITIONS ECOSCON‐
18994 FIG_EXECUTABLE ECOS_CONFIG_FILE - defaults to
18995 ecos.ecc, if your eCos configuration file has a different name,
18996 adjust this variable for internal use only:
18997
18998
18999 ECOS_ADD_TARGET_LIB
19000
19001
19002 UseJava
19003 Use Module for Java
19004
19005 This file provides functions for Java. It is assumed that Find‐
19006 Java.cmake has already been loaded. See FindJava.cmake for
19007 information on how to load Java into your CMake project.
19008
19009
19010 add_jar(target_name
19011
19012
19013 [SOURCES] source1 [source2 ...] [resource1 ...]
19014 [INCLUDE_JARS jar1 [jar2 ...]]
19015 [ENTRY_POINT entry]
19016 [VERSION version]
19017 [OUTPUT_NAME name]
19018 [OUTPUT_DIR dir]
19019 )
19020
19021
19022
19023
19024 This command creates a <target_name>.jar. It compiles the given
19025 source files (source) and adds the given resource files
19026 (resource) to the jar file. If only resource files are given
19027 then just a jar file is created. The list of include jars are
19028 added to the classpath when compiling the java sources and also
19029 to the dependencies of the target. INCLUDE_JARS also accepts
19030 other target names created by add_jar. For backwards compatibil‐
19031 ity, jar files listed as sources are ignored (as they have been
19032 since the first version of this module).
19033
19034
19035 The default OUTPUT_DIR can also be changed by setting the vari‐
19036 able CMAKE_JAVA_TARGET_OUTPUT_DIR.
19037
19038
19039 Additional instructions:
19040
19041
19042 To add compile flags to the target you can set these flags with
19043 the following variable:
19044
19045
19046
19047
19048 set(CMAKE_JAVA_COMPILE_FLAGS -nowarn)
19049
19050
19051
19052
19053 To add a path or a jar file to the class path you can do this
19054 with the CMAKE_JAVA_INCLUDE_PATH variable.
19055
19056
19057
19058
19059 set(CMAKE_JAVA_INCLUDE_PATH /usr/share/java/shibboleet.jar)
19060
19061
19062
19063
19064 To use a different output name for the target you can set it with:
19065
19066
19067
19068
19069 add_jar(foobar foobar.java OUTPUT_NAME shibboleet.jar)
19070
19071
19072
19073
19074 To use a different output directory than CMAKE_CURRENT_BINARY_DIR
19075 you can set it with:
19076
19077
19078
19079
19080 add_jar(foobar foobar.java OUTPUT_DIR ${PROJECT_BINARY_DIR}/bin)
19081
19082
19083
19084
19085 To define an entry point in your jar you can set it with the ENTRY_POINT
19086 named argument:
19087
19088
19089
19090
19091 add_jar(example ENTRY_POINT com/examples/MyProject/Main)
19092
19093
19094
19095
19096 To add a VERSION to the target output name you can set it using
19097 the VERSION named argument to add_jar. This will create a jar file with the
19098 name shibboleet-1.0.0.jar and will create a symlink shibboleet.jar
19099 pointing to the jar with the version information.
19100
19101
19102
19103
19104 add_jar(shibboleet shibbotleet.java VERSION 1.2.0)
19105
19106
19107
19108
19109 If the target is a JNI library, utilize the following commands to
19110 create a JNI symbolic link:
19111
19112
19113
19114
19115 set(CMAKE_JNI_TARGET TRUE)
19116 add_jar(shibboleet shibbotleet.java VERSION 1.2.0)
19117 install_jar(shibboleet ${LIB_INSTALL_DIR}/shibboleet)
19118 install_jni_symlink(shibboleet ${JAVA_LIB_INSTALL_DIR})
19119
19120
19121
19122
19123 If a single target needs to produce more than one jar from its
19124 java source code, to prevent the accumulation of duplicate class
19125 files in subsequent jars, set/reset CMAKE_JAR_CLASSES_PREFIX prior
19126 to calling the add_jar() function:
19127
19128
19129
19130
19131 set(CMAKE_JAR_CLASSES_PREFIX com/redhat/foo)
19132 add_jar(foo foo.java)
19133
19134
19135
19136
19137 set(CMAKE_JAR_CLASSES_PREFIX com/redhat/bar)
19138 add_jar(bar bar.java)
19139
19140
19141
19142
19143 Target Properties:
19144
19145
19146 The add_jar() functions sets some target properties. You can get these
19147 properties with the
19148 get_property(TARGET <target_name> PROPERTY <propery_name>)
19149 command.
19150
19151
19152
19153
19154 INSTALL_FILES The files which should be installed. This is used by
19155 install_jar().
19156 JNI_SYMLINK The JNI symlink which should be installed.
19157 This is used by install_jni_symlink().
19158 JAR_FILE The location of the jar file so that you can include
19159 it.
19160 CLASS_DIR The directory where the class files can be found. For
19161 example to use them with javah.
19162
19163
19164
19165
19166 find_jar(<VAR>
19167
19168
19169 name | NAMES name1 [name2 ...]
19170 [PATHS path1 [path2 ... ENV var]]
19171 [VERSIONS version1 [version2]]
19172 [DOC "cache documentation string"]
19173 )
19174
19175
19176
19177
19178 This command is used to find a full path to the named jar. A
19179 cache entry named by <VAR> is created to stor the result of this
19180 command. If the full path to a jar is found the result is stored
19181 in the variable and the search will not repeated unless the
19182 variable is cleared. If nothing is found, the result will be
19183 <VAR>-NOTFOUND, and the search will be attempted again next time
19184 find_jar is invoked with the same variable. The name of the full
19185 path to a file that is searched for is specified by the names
19186 listed after NAMES argument. Additional search locations can be
19187 specified after the PATHS argument. If you require special a
19188 version of a jar file you can specify it with the VERSIONS argu‐
19189 ment. The argument after DOC will be used for the documentation
19190 string in the cache.
19191
19192
19193 install_jar(TARGET_NAME DESTINATION)
19194
19195
19196 This command installs the TARGET_NAME files to the given DESTI‐
19197 NATION. It should be called in the same scope as add_jar() or it
19198 will fail.
19199
19200
19201 install_jni_symlink(TARGET_NAME DESTINATION)
19202
19203
19204 This command installs the TARGET_NAME JNI symlinks to the given
19205 DESTINATION. It should be called in the same scope as add_jar()
19206 or it will fail.
19207
19208
19209 create_javadoc(<VAR>
19210
19211
19212 PACKAGES pkg1 [pkg2 ...]
19213 [SOURCEPATH <sourcepath>]
19214 [CLASSPATH <classpath>]
19215 [INSTALLPATH <install path>]
19216 [DOCTITLE "the documentation title"]
19217 [WINDOWTITLE "the title of the document"]
19218 [AUTHOR TRUE|FALSE]
19219 [USE TRUE|FALSE]
19220 [VERSION TRUE|FALSE]
19221 )
19222
19223
19224
19225
19226 Create java documentation based on files or packages. For more
19227 details please read the javadoc manpage.
19228
19229
19230 There are two main signatures for create_javadoc. The first sig‐
19231 nature works with package names on a path with source files:
19232
19233
19234 Example:
19235 create_javadoc(my_example_doc
19236 PACKAGES com.exmaple.foo com.example.bar
19237 SOURCEPATH "${CMAKE_CURRENT_SOURCE_DIR}"
19238 CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH}
19239 WINDOWTITLE "My example"
19240 DOCTITLE "<h1>My example</h1>"
19241 AUTHOR TRUE
19242 USE TRUE
19243 VERSION TRUE
19244 )
19245
19246
19247
19248
19249 The second signature for create_javadoc works on a given list of
19250 files.
19251
19252
19253 create_javadoc(<VAR>
19254 FILES file1 [file2 ...]
19255 [CLASSPATH <classpath>]
19256 [INSTALLPATH <install path>]
19257 [DOCTITLE "the documentation title"]
19258 [WINDOWTITLE "the title of the document"]
19259 [AUTHOR TRUE|FALSE]
19260 [USE TRUE|FALSE]
19261 [VERSION TRUE|FALSE]
19262 )
19263
19264
19265
19266
19267 Example:
19268
19269
19270 create_javadoc(my_example_doc
19271 FILES ${example_SRCS}
19272 CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH}
19273 WINDOWTITLE "My example"
19274 DOCTITLE "<h1>My example</h1>"
19275 AUTHOR TRUE
19276 USE TRUE
19277 VERSION TRUE
19278 )
19279
19280
19281
19282
19283 Both signatures share most of the options. These options are the
19284 same as what you can find in the javadoc manpage. Please look at
19285 the manpage for CLASSPATH, DOCTITLE, WINDOWTITLE, AUTHOR, USE
19286 and VERSION.
19287
19288
19289 The documentation will be by default installed to
19290
19291
19292 ${CMAKE_INSTALL_PREFIX}/share/javadoc/<VAR>
19293
19294
19295
19296
19297 if you don't set the INSTALLPATH.
19298
19299
19300
19301 UseJavaClassFilelist
19302
19303
19304
19305
19306
19307 This script create a list of compiled Java class files to be
19308 added to a jar file. This avoids including cmake files which get
19309 created in the binary directory.
19310
19311
19312
19313 UseJavaSymlinks
19314
19315
19316
19317
19318
19319 Helper script for UseJava.cmake
19320
19321
19322
19323 UsePkgConfig
19324 Obsolete pkg-config module for CMake, use FindPkgConfig instead.
19325
19326
19327
19328
19329 This module defines the following macro:
19330
19331
19332 PKGCONFIG(package includedir libdir linkflags cflags)
19333
19334
19335 Calling PKGCONFIG will fill the desired information into the 4
19336 given arguments, e.g. PKGCONFIG(libart-2.0 LIBART_INCLUDE_DIR
19337 LIBART_LINK_DIR LIBART_LINK_FLAGS LIBART_CFLAGS) if pkg-config
19338 was NOT found or the specified software package doesn't exist,
19339 the variable will be empty when the function returns, otherwise
19340 they will contain the respective information
19341
19342
19343
19344 UseQt4 Use Module for QT4
19345
19346 Sets up C and C++ to use Qt 4. It is assumed that FindQt.cmake
19347 has already been loaded. See FindQt.cmake for information on
19348 how to load Qt 4 into your CMake project.
19349
19350
19351 UseSWIG
19352 SWIG module for CMake
19353
19354 Defines the following macros:
19355
19356
19357 SWIG_ADD_MODULE(name language [ files ])
19358 - Define swig module with given name and specified language
19359 SWIG_LINK_LIBRARIES(name [ libraries ])
19360 - Link libraries to swig module
19361
19362 All other macros are for internal use only. To get the actual
19363 name of the swig module, use: ${SWIG_MODULE_${name}_REAL_NAME}.
19364 Set Source files properties such as CPLUSPLUS and SWIG_FLAGS to
19365 specify special behavior of SWIG. Also global CMAKE_SWIG_FLAGS
19366 can be used to add special flags to all swig calls. Another spe‐
19367 cial variable is CMAKE_SWIG_OUTDIR, it allows one to specify
19368 where to write all the swig generated module (swig -outdir
19369 option) The name-specific variable SWIG_MODULE_<name>_EXTRA_DEPS
19370 may be used to specify extra dependencies for the generated mod‐
19371 ules. If the source file generated by swig need some special
19372 flag you can use set_source_files_properties( ${swig_gener‐
19373 ated_file_fullname}
19374
19375
19376 PROPERTIES COMPILE_FLAGS "-bla")
19377
19378
19379 Use_wxWindows
19380 ---------------------------------------------------
19381
19382
19383
19384
19385 This convenience include finds if wxWindows is installed and set
19386 the appropriate libs, incdirs, flags etc. author Jan Woetzel <jw
19387 -at- mip.informatik.uni-kiel.de> (07/2003) USAGE:
19388
19389
19390 just include Use_wxWindows.cmake
19391 in your projects CMakeLists.txt
19392
19393 include( ${CMAKE_MODULE_PATH}/Use_wxWindows.cmake)
19394
19395
19396 if you are sure you need GL then
19397
19398 set(WXWINDOWS_USE_GL 1)
19399
19400
19401 *before* you include this file.
19402
19403
19404 UsewxWidgets
19405 Convenience include for using wxWidgets library.
19406
19407 Determines if wxWidgets was FOUND and sets the appropriate libs,
19408 incdirs, flags, etc. INCLUDE_DIRECTORIES and LINK_DIRECTORIES
19409 are called.
19410
19411
19412 USAGE
19413
19414
19415 # Note that for MinGW users the order of libs is important!
19416 find_package(wxWidgets REQUIRED net gl core base)
19417 include(${wxWidgets_USE_FILE})
19418 # and for each of your dependent executable/library targets:
19419 target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES})
19420
19421
19422
19423
19424 DEPRECATED
19425
19426
19427 LINK_LIBRARIES is not called in favor of adding dependencies per target.
19428
19429
19430
19431
19432 AUTHOR
19433
19434
19435 Jan Woetzel <jw -at- mip.informatik.uni-kiel.de>
19436
19437
19438 WriteBasicConfigVersionFile
19439
19440
19441 WRITE_BASIC_CONFIG_VERSION_FILE( filename VERSION major.minor.patch COMPATIBILITY (AnyNewerVersion|SameMajorVersion) )
19442
19443
19444
19445
19446 Deprecated, see WRITE_BASIC_PACKAGE_VERSION_FILE(), it is iden‐
19447 tical.
19448
19449
19452 BUILD_SHARED_LIBS
19453 Global flag to cause add_library to create shared libraries if
19454 on.
19455
19456 If present and true, this will cause all libraries to be built
19457 shared unless the library was explicitly added as a static
19458 library. This variable is often added to projects as an OPTION
19459 so that each user of a project can decide if they want to build
19460 the project using shared or static libraries.
19461
19462
19463 CMAKE_ABSOLUTE_DESTINATION_FILES
19464 List of files which have been installed using an ABSOLUTE DES‐
19465 TINATION path.
19466
19467 This variable is defined by CMake-generated cmake_install.cmake
19468 scripts. It can be used (read-only) by programs or scripts that
19469 source those install scripts. This is used by some CPack genera‐
19470 tors (e.g. RPM).
19471
19472
19473 CMAKE_AUTOMOC_RELAXED_MODE
19474 Switch between strict and relaxed automoc mode.
19475
19476 By default, automoc behaves exactly as described in the documen‐
19477 tation of the AUTOMOC target property. When set to TRUE, it
19478 accepts more input and tries to find the correct input file for
19479 moc even if it differs from the documented behaviour. In this
19480 mode it e.g. also checks whether a header file is intended to be
19481 processed by moc when a "foo.moc" file has been included.
19482
19483
19484 Relaxed mode has to be enabled for KDE4 compatibility.
19485
19486
19487 CMAKE_BACKWARDS_COMPATIBILITY
19488 Version of cmake required to build project
19489
19490 From the point of view of backwards compatibility, this speci‐
19491 fies what version of CMake should be supported. By default this
19492 value is the version number of CMake that you are running. You
19493 can set this to an older version of CMake to support deprecated
19494 commands of CMake in projects that were written to use older
19495 versions of CMake. This can be set by the user or set at the
19496 beginning of a CMakeLists file.
19497
19498
19499 CMAKE_BUILD_TYPE
19500 Specifies the build type on single-configuration generators.
19501
19502 This statically specifies what build type (configuration) will
19503 be built in this build tree. Possible values are empty, Debug,
19504 Release, RelWithDebInfo and MinSizeRel. This variable is only
19505 meaningful to single-configuration generators (such as make and
19506 Ninja) i.e. those which choose a single configuration when CMake
19507 runs to generate a build tree as opposed to multi-configuration
19508 generators which offer selection of the build configuration
19509 within the generated build environment. There are many per-con‐
19510 fig properties and variables (usually following clean
19511 SOME_VAR_<CONFIG> order conventions), such as
19512 CMAKE_C_FLAGS_<CONFIG>, specified as uppercase:
19513 CMAKE_C_FLAGS_[DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL]. For
19514 example, in a build tree configured to build type Debug, CMake
19515 will see to having CMAKE_C_FLAGS_DEBUG settings get added to the
19516 CMAKE_C_FLAGS settings. See also CMAKE_CONFIGURATION_TYPES.
19517
19518
19519 CMAKE_COLOR_MAKEFILE
19520 Enables color output when using the Makefile generator.
19521
19522 When enabled, the generated Makefiles will produce colored out‐
19523 put. Default is ON.
19524
19525
19526 CMAKE_CONFIGURATION_TYPES
19527 Specifies the available build types on multi-config generators.
19528
19529 This specifies what build types (configurations) will be avail‐
19530 able such as Debug, Release, RelWithDebInfo etc. This has rea‐
19531 sonable defaults on most platforms, but can be extended to pro‐
19532 vide other build types. See also CMAKE_BUILD_TYPE for details
19533 of managing configuration data, and CMAKE_CFG_INTDIR.
19534
19535
19536 CMAKE_DEBUG_TARGET_PROPERTIES
19537 Enables tracing output for target properties.
19538
19539 This variable can be populated with a list of properties to gen‐
19540 erate debug output for when evaluating target properties. Cur‐
19541 rently it can only be used when evaluating the INCLUDE_DIRECTO‐
19542 RIES, COMPILE_DEFINITIONS and COMPILE_OPTIONS target properties.
19543 In that case, it outputs a backtrace for each entry in the tar‐
19544 get property. Default is unset.
19545
19546
19547 CMAKE_DISABLE_FIND_PACKAGE_<PackageName>
19548 Variable for disabling find_package() calls.
19549
19550 Every non-REQUIRED find_package() call in a project can be dis‐
19551 abled by setting the variable CMAKE_DISABLE_FIND_PACKAGE_<Packa‐
19552 geName> to TRUE. This can be used to build a project without an
19553 optional package, although that package is installed.
19554
19555
19556 This switch should be used during the initial CMake run. Other‐
19557 wise if the package has already been found in a previous CMake
19558 run, the variables which have been stored in the cache will
19559 still be there. In that case it is recommended to remove the
19560 cache variables for this package from the cache using the cache
19561 editor or cmake -U
19562
19563
19564 CMAKE_ERROR_DEPRECATED
19565 Whether to issue deprecation errors for macros and functions.
19566
19567 If TRUE, this can be used by macros and functions to issue fatal
19568 errors when deprecated macros or functions are used. This vari‐
19569 able is FALSE by default.
19570
19571
19572 CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION
19573 Ask cmake_install.cmake script to error out as soon as a file
19574 with absolute INSTALL DESTINATION is encountered.
19575
19576 The fatal error is emitted before the installation of the
19577 offending file takes place. This variable is used by CMake-gen‐
19578 erated cmake_install.cmake scripts. If one sets this variable to
19579 ON while running the script, it may get fatal error messages
19580 from the script.
19581
19582
19583 CMAKE_FIND_LIBRARY_PREFIXES
19584 Prefixes to prepend when looking for libraries.
19585
19586 This specifies what prefixes to add to library names when the
19587 find_library command looks for libraries. On UNIX systems this
19588 is typically lib, meaning that when trying to find the foo
19589 library it will look for libfoo.
19590
19591
19592 CMAKE_FIND_LIBRARY_SUFFIXES
19593 Suffixes to append when looking for libraries.
19594
19595 This specifies what suffixes to add to library names when the
19596 find_library command looks for libraries. On Windows systems
19597 this is typically .lib and .dll, meaning that when trying to
19598 find the foo library it will look for foo.dll etc.
19599
19600
19601 CMAKE_FIND_PACKAGE_WARN_NO_MODULE
19602 Tell find_package to warn if called without an explicit mode.
19603
19604 If find_package is called without an explicit mode option (MOD‐
19605 ULE, CONFIG or NO_MODULE) and no Find<pkg>.cmake module is in
19606 CMAKE_MODULE_PATH then CMake implicitly assumes that the caller
19607 intends to search for a package configuration file. If no pack‐
19608 age configuration file is found then the wording of the failure
19609 message must account for both the case that the package is
19610 really missing and the case that the project has a bug and
19611 failed to provide the intended Find module. If instead the
19612 caller specifies an explicit mode option then the failure mes‐
19613 sage can be more specific.
19614
19615
19616 Set CMAKE_FIND_PACKAGE_WARN_NO_MODULE to TRUE to tell find_pack‐
19617 age to warn when it implicitly assumes Config mode. This helps
19618 developers enforce use of an explicit mode in all calls to
19619 find_package within a project.
19620
19621
19622 CMAKE_IGNORE_PATH
19623 Path to be ignored by FIND_XXX() commands.
19624
19625 Specifies directories to be ignored by searches in FIND_XXX()
19626 commands. This is useful in cross-compiled environments where
19627 some system directories contain incompatible but possibly link‐
19628 able libraries. For example, on cross-compiled cluster environ‐
19629 ments, this allows a user to ignore directories containing
19630 libraries meant for the front-end machine that modules like
19631 FindX11 (and others) would normally search. By default this is
19632 empty; it is intended to be set by the project. Note that
19633 CMAKE_IGNORE_PATH takes a list of directory names, NOT a list of
19634 prefixes. If you want to ignore paths under prefixes (bin,
19635 include, lib, etc.), you'll need to specify them explicitly.
19636 See also CMAKE_PREFIX_PATH, CMAKE_LIBRARY_PATH,
19637 CMAKE_INCLUDE_PATH, CMAKE_PROGRAM_PATH.
19638
19639
19640 CMAKE_INCLUDE_PATH
19641 Path used for searching by FIND_FILE() and FIND_PATH().
19642
19643 Specifies a path which will be used both by FIND_FILE() and
19644 FIND_PATH(). Both commands will check each of the contained
19645 directories for the existence of the file which is currently
19646 searched. By default it is empty, it is intended to be set by
19647 the project. See also CMAKE_SYSTEM_INCLUDE_PATH, CMAKE_PRE‐
19648 FIX_PATH.
19649
19650
19651 CMAKE_INSTALL_DEFAULT_COMPONENT_NAME
19652 Default component used in install() commands.
19653
19654 If an install() command is used without the COMPONENT argument,
19655 these files will be grouped into a default component. The name
19656 of this default install component will be taken from this vari‐
19657 able. It defaults to "Unspecified".
19658
19659
19660 CMAKE_INSTALL_PREFIX
19661 Install directory used by install.
19662
19663 If "make install" is invoked or INSTALL is built, this directory
19664 is prepended onto all install directories. This variable
19665 defaults to /usr/local on UNIX and c:/Program Files on Windows.
19666
19667
19668 On UNIX one can use the DESTDIR mechanism in order to relocate
19669 the whole installation. DESTDIR means DESTination DIRectory. It
19670 is commonly used by makefile users in order to install software
19671 at non-default location. It is usually invoked like this:
19672
19673
19674 make DESTDIR=/home/john install
19675
19676 which will install the concerned software using the installation
19677 prefix, e.g. "/usr/local" prepended with the DESTDIR value which
19678 finally gives "/home/john/usr/local".
19679
19680
19681 WARNING: DESTDIR may not be used on Windows because installation
19682 prefix usually contains a drive letter like in "C:/Program
19683 Files" which cannot be prepended with some other prefix.
19684
19685
19686 The installation prefix is also added to CMAKE_SYSTEM_PRE‐
19687 FIX_PATH so that find_package, find_program, find_library,
19688 find_path, and find_file will search the prefix for other soft‐
19689 ware.
19690
19691
19692 CMAKE_LIBRARY_PATH
19693 Path used for searching by FIND_LIBRARY().
19694
19695 Specifies a path which will be used by FIND_LIBRARY().
19696 FIND_LIBRARY() will check each of the contained directories for
19697 the existence of the library which is currently searched. By
19698 default it is empty, it is intended to be set by the project.
19699 See also CMAKE_SYSTEM_LIBRARY_PATH, CMAKE_PREFIX_PATH.
19700
19701
19702 CMAKE_MFC_FLAG
19703 Tell cmake to use MFC for an executable or dll.
19704
19705 This can be set in a CMakeLists.txt file and will enable MFC in
19706 the application. It should be set to 1 for the static MFC
19707 library, and 2 for the shared MFC library. This is used in Vis‐
19708 ual Studio 6 and 7 project files. The CMakeSetup dialog used
19709 MFC and the CMakeLists.txt looks like this:
19710
19711
19712 add_definitions(-D_AFXDLL)
19713 set(CMAKE_MFC_FLAG 2)
19714 add_executable(CMakeSetup WIN32 ${SRCS})
19715
19716
19717 CMAKE_MODULE_PATH
19718 List of directories to search for CMake modules.
19719
19720 Commands like include() and find_package() search for files in
19721 directories listed by this variable before checking the default
19722 modules that come with CMake.
19723
19724
19725 CMAKE_NOT_USING_CONFIG_FLAGS
19726 Skip _BUILD_TYPE flags if true.
19727
19728 This is an internal flag used by the generators in CMake to tell
19729 CMake to skip the _BUILD_TYPE flags.
19730
19731
19732 CMAKE_POLICY_DEFAULT_CMP<NNNN>
19733 Default for CMake Policy CMP<NNNN> when it is otherwise left
19734 unset.
19735
19736 Commands cmake_minimum_required(VERSION) and cmake_policy(VER‐
19737 SION) by default leave policies introduced after the given ver‐
19738 sion unset. Set CMAKE_POLICY_DEFAULT_CMP<NNNN> to OLD or NEW to
19739 specify the default for policy CMP<NNNN>, where <NNNN> is the
19740 policy number.
19741
19742
19743 This variable should not be set by a project in CMake code; use
19744 cmake_policy(SET) instead. Users running CMake may set this
19745 variable in the cache (e.g. -DCMAKE_POL‐
19746 ICY_DEFAULT_CMP<NNNN>=<OLD|NEW>) to set a policy not otherwise
19747 set by the project. Set to OLD to quiet a policy warning while
19748 using old behavior or to NEW to try building the project with
19749 new behavior.
19750
19751
19752 CMAKE_PREFIX_PATH
19753 Path used for searching by FIND_XXX(), with appropriate suffixes
19754 added.
19755
19756 Specifies a path which will be used by the FIND_XXX() commands.
19757 It contains the "base" directories, the FIND_XXX() commands
19758 append appropriate subdirectories to the base directories. So
19759 FIND_PROGRAM() adds /bin to each of the directories in the path,
19760 FIND_LIBRARY() appends /lib to each of the directories, and
19761 FIND_PATH() and FIND_FILE() append /include . By default it is
19762 empty, it is intended to be set by the project. See also
19763 CMAKE_SYSTEM_PREFIX_PATH, CMAKE_INCLUDE_PATH,
19764 CMAKE_LIBRARY_PATH, CMAKE_PROGRAM_PATH.
19765
19766
19767 CMAKE_PROGRAM_PATH
19768 Path used for searching by FIND_PROGRAM().
19769
19770 Specifies a path which will be used by FIND_PROGRAM(). FIND_PRO‐
19771 GRAM() will check each of the contained directories for the
19772 existence of the program which is currently searched. By default
19773 it is empty, it is intended to be set by the project. See also
19774 CMAKE_SYSTEM_PROGRAM_PATH, CMAKE_PREFIX_PATH.
19775
19776
19777 CMAKE_SKIP_INSTALL_ALL_DEPENDENCY
19778 Don't make the install target depend on the all target.
19779
19780 By default, the "install" target depends on the "all" target.
19781 This has the effect, that when "make install" is invoked or
19782 INSTALL is built, first the "all" target is built, then the
19783 installation starts. If CMAKE_SKIP_INSTALL_ALL_DEPENDENCY is
19784 set to TRUE, this dependency is not created, so the installation
19785 process will start immediately, independent from whether the
19786 project has been completely built or not.
19787
19788
19789 CMAKE_SYSTEM_IGNORE_PATH
19790 Path to be ignored by FIND_XXX() commands.
19791
19792 Specifies directories to be ignored by searches in FIND_XXX()
19793 commands. This is useful in cross-compiled environments where
19794 some system directories contain incompatible but possibly link‐
19795 able libraries. For example, on cross-compiled cluster environ‐
19796 ments, this allows a user to ignore directories containing
19797 libraries meant for the front-end machine that modules like
19798 FindX11 (and others) would normally search. By default this
19799 contains a list of directories containing incompatible binaries
19800 for the host system. See also CMAKE_SYSTEM_PREFIX_PATH,
19801 CMAKE_SYSTEM_LIBRARY_PATH, CMAKE_SYSTEM_INCLUDE_PATH, and
19802 CMAKE_SYSTEM_PROGRAM_PATH.
19803
19804
19805 CMAKE_SYSTEM_INCLUDE_PATH
19806 Path used for searching by FIND_FILE() and FIND_PATH().
19807
19808 Specifies a path which will be used both by FIND_FILE() and
19809 FIND_PATH(). Both commands will check each of the contained
19810 directories for the existence of the file which is currently
19811 searched. By default it contains the standard directories for
19812 the current system. It is NOT intended to be modified by the
19813 project, use CMAKE_INCLUDE_PATH for this. See also CMAKE_SYS‐
19814 TEM_PREFIX_PATH.
19815
19816
19817 CMAKE_SYSTEM_LIBRARY_PATH
19818 Path used for searching by FIND_LIBRARY().
19819
19820 Specifies a path which will be used by FIND_LIBRARY().
19821 FIND_LIBRARY() will check each of the contained directories for
19822 the existence of the library which is currently searched. By
19823 default it contains the standard directories for the current
19824 system. It is NOT intended to be modified by the project, use
19825 CMAKE_LIBRARY_PATH for this. See also CMAKE_SYSTEM_PREFIX_PATH.
19826
19827
19828 CMAKE_SYSTEM_PREFIX_PATH
19829 Path used for searching by FIND_XXX(), with appropriate suffixes
19830 added.
19831
19832 Specifies a path which will be used by the FIND_XXX() commands.
19833 It contains the "base" directories, the FIND_XXX() commands
19834 append appropriate subdirectories to the base directories. So
19835 FIND_PROGRAM() adds /bin to each of the directories in the path,
19836 FIND_LIBRARY() appends /lib to each of the directories, and
19837 FIND_PATH() and FIND_FILE() append /include . By default this
19838 contains the standard directories for the current system and the
19839 CMAKE_INSTALL_PREFIX. It is NOT intended to be modified by the
19840 project, use CMAKE_PREFIX_PATH for this. See also CMAKE_SYS‐
19841 TEM_INCLUDE_PATH, CMAKE_SYSTEM_LIBRARY_PATH, CMAKE_SYSTEM_PRO‐
19842 GRAM_PATH, and CMAKE_SYSTEM_IGNORE_PATH.
19843
19844
19845 CMAKE_SYSTEM_PROGRAM_PATH
19846 Path used for searching by FIND_PROGRAM().
19847
19848 Specifies a path which will be used by FIND_PROGRAM(). FIND_PRO‐
19849 GRAM() will check each of the contained directories for the
19850 existence of the program which is currently searched. By default
19851 it contains the standard directories for the current system. It
19852 is NOT intended to be modified by the project, use CMAKE_PRO‐
19853 GRAM_PATH for this. See also CMAKE_SYSTEM_PREFIX_PATH.
19854
19855
19856 CMAKE_USER_MAKE_RULES_OVERRIDE
19857 Specify a CMake file that overrides platform information.
19858
19859 CMake loads the specified file while enabling support for each
19860 language from either the project() or enable_language() com‐
19861 mands. It is loaded after CMake's builtin compiler and platform
19862 information modules have been loaded but before the information
19863 is used. The file may set platform information variables to
19864 override CMake's defaults.
19865
19866
19867 This feature is intended for use only in overriding information
19868 variables that must be set before CMake builds its first test
19869 project to check that the compiler for a language works. It
19870 should not be used to load a file in cases that a normal
19871 include() will work. Use it only as a last resort for behavior
19872 that cannot be achieved any other way. For example, one may set
19873 CMAKE_C_FLAGS_INIT to change the default value used to initial‐
19874 ize CMAKE_C_FLAGS before it is cached. The override file should
19875 NOT be used to set anything that could be set after languages
19876 are enabled, such as variables like CMAKE_RUNTIME_OUTPUT_DIREC‐
19877 TORY that affect the placement of binaries. Information set in
19878 the file will be used for try_compile and try_run builds too.
19879
19880
19881 CMAKE_WARN_DEPRECATED
19882 Whether to issue deprecation warnings for macros and functions.
19883
19884 If TRUE, this can be used by macros and functions to issue dep‐
19885 recation warnings. This variable is FALSE by default.
19886
19887
19888 CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION
19889 Ask cmake_install.cmake script to warn each time a file with
19890 absolute INSTALL DESTINATION is encountered.
19891
19892 This variable is used by CMake-generated cmake_install.cmake
19893 scripts. If one sets this variable to ON while running the
19894 script, it may get warning messages from the script.
19895
19896
19898 APPLE True if running on Mac OS X.
19899
19900 Set to true on Mac OS X.
19901
19902
19903 BORLAND
19904 True if the Borland compiler is being used.
19905
19906 This is set to true if the Borland compiler is being used.
19907
19908
19909 CMAKE_CL_64
19910 Using the 64 bit compiler from Microsoft
19911
19912 Set to true when using the 64 bit cl compiler from Microsoft.
19913
19914
19915 CMAKE_COMPILER_2005
19916 Using the Visual Studio 2005 compiler from Microsoft
19917
19918 Set to true when using the Visual Studio 2005 compiler from Mi‐
19919 crosoft.
19920
19921
19922 CMAKE_HOST_APPLE
19923 True for Apple OS X operating systems.
19924
19925 Set to true when the host system is Apple OS X.
19926
19927
19928 CMAKE_HOST_SYSTEM
19929 Name of system cmake is being run on.
19930
19931 The same as CMAKE_SYSTEM but for the host system instead of the
19932 target system when cross compiling.
19933
19934
19935 CMAKE_HOST_SYSTEM_NAME
19936 Name of the OS CMake is running on.
19937
19938 The same as CMAKE_SYSTEM_NAME but for the host system instead of
19939 the target system when cross compiling.
19940
19941
19942 CMAKE_HOST_SYSTEM_PROCESSOR
19943 The name of the CPU CMake is running on.
19944
19945 The same as CMAKE_SYSTEM_PROCESSOR but for the host system
19946 instead of the target system when cross compiling.
19947
19948
19949 CMAKE_HOST_SYSTEM_VERSION
19950 OS version CMake is running on.
19951
19952 The same as CMAKE_SYSTEM_VERSION but for the host system instead
19953 of the target system when cross compiling.
19954
19955
19956 CMAKE_HOST_UNIX
19957 True for UNIX and UNIX like operating systems.
19958
19959 Set to true when the host system is UNIX or UNIX like (i.e.
19960 APPLE and CYGWIN).
19961
19962
19963 CMAKE_HOST_WIN32
19964 True on windows systems, including win64.
19965
19966 Set to true when the host system is Windows and on Cygwin.
19967
19968
19969 CMAKE_LIBRARY_ARCHITECTURE
19970 Target architecture library directory name, if detected.
19971
19972 This is the value of CMAKE_<lang>_LIBRARY_ARCHITECTURE as
19973 detected for one of the enabled languages.
19974
19975
19976 CMAKE_LIBRARY_ARCHITECTURE_REGEX
19977 Regex matching possible target architecture library directory
19978 names.
19979
19980 This is used to detect CMAKE_<lang>_LIBRARY_ARCHITECTURE from
19981 the implicit linker search path by matching the <arch> name.
19982
19983
19984 CMAKE_OBJECT_PATH_MAX
19985 Maximum object file full-path length allowed by native build
19986 tools.
19987
19988 CMake computes for every source file an object file name that is
19989 unique to the source file and deterministic with respect to the
19990 full path to the source file. This allows multiple source files
19991 in a target to share the same name if they lie in different
19992 directories without rebuilding when one is added or removed.
19993 However, it can produce long full paths in a few cases, so CMake
19994 shortens the path using a hashing scheme when the full path to
19995 an object file exceeds a limit. CMake has a built-in limit for
19996 each platform that is sufficient for common tools, but some
19997 native tools may have a lower limit. This variable may be set
19998 to specify the limit explicitly. The value must be an integer
19999 no less than 128.
20000
20001
20002 CMAKE_SYSTEM
20003 Name of system cmake is compiling for.
20004
20005 This variable is the composite of CMAKE_SYSTEM_NAME and
20006 CMAKE_SYSTEM_VERSION, like this ${CMAKE_SYS‐
20007 TEM_NAME}-${CMAKE_SYSTEM_VERSION}. If CMAKE_SYSTEM_VERSION is
20008 not set, then CMAKE_SYSTEM is the same as CMAKE_SYSTEM_NAME.
20009
20010
20011 CMAKE_SYSTEM_NAME
20012 Name of the OS CMake is building for.
20013
20014 This is the name of the operating system on which CMake is tar‐
20015 geting. On systems that have the uname command, this variable
20016 is set to the output of uname -s. Linux, Windows, and Darwin
20017 for Mac OS X are the values found on the big three operating
20018 systems.
20019
20020
20021 CMAKE_SYSTEM_PROCESSOR
20022 The name of the CPU CMake is building for.
20023
20024 On systems that support uname, this variable is set to the out‐
20025 put of uname -p, on windows it is set to the value of the envi‐
20026 ronment variable PROCESSOR_ARCHITECTURE
20027
20028
20029 CMAKE_SYSTEM_VERSION
20030 OS version CMake is building for.
20031
20032 A numeric version string for the system, on systems that support
20033 uname, this variable is set to the output of uname -r. On other
20034 systems this is set to major-minor version numbers.
20035
20036
20037 CYGWIN True for Cygwin.
20038
20039 Set to true when using Cygwin.
20040
20041
20042 ENV Access environment variables.
20043
20044 Use the syntax $ENV{VAR} to read environment variable VAR. See
20045 also the set() command to set ENV{VAR}.
20046
20047
20048 MSVC True when using Microsoft Visual C
20049
20050 Set to true when the compiler is some version of Microsoft Vis‐
20051 ual C.
20052
20053
20054 MSVC10 True when using Microsoft Visual C 10.0
20055
20056 Set to true when the compiler is version 10.0 of Microsoft Vis‐
20057 ual C.
20058
20059
20060 MSVC11 True when using Microsoft Visual C 11.0
20061
20062 Set to true when the compiler is version 11.0 of Microsoft Vis‐
20063 ual C.
20064
20065
20066 MSVC12 True when using Microsoft Visual C 12.0
20067
20068 Set to true when the compiler is version 12.0 of Microsoft Vis‐
20069 ual C.
20070
20071
20072 MSVC60 True when using Microsoft Visual C 6.0
20073
20074 Set to true when the compiler is version 6.0 of Microsoft Visual
20075 C.
20076
20077
20078 MSVC70 True when using Microsoft Visual C 7.0
20079
20080 Set to true when the compiler is version 7.0 of Microsoft Visual
20081 C.
20082
20083
20084 MSVC71 True when using Microsoft Visual C 7.1
20085
20086 Set to true when the compiler is version 7.1 of Microsoft Visual
20087 C.
20088
20089
20090 MSVC80 True when using Microsoft Visual C 8.0
20091
20092 Set to true when the compiler is version 8.0 of Microsoft Visual
20093 C.
20094
20095
20096 MSVC90 True when using Microsoft Visual C 9.0
20097
20098 Set to true when the compiler is version 9.0 of Microsoft Visual
20099 C.
20100
20101
20102 MSVC_IDE
20103 True when using the Microsoft Visual C IDE
20104
20105 Set to true when the target platform is the Microsoft Visual C
20106 IDE, as opposed to the command line compiler.
20107
20108
20109 MSVC_VERSION
20110 The version of Microsoft Visual C/C++ being used if any.
20111
20112 Known version numbers are:
20113
20114
20115 1200 = VS 6.0
20116 1300 = VS 7.0
20117 1310 = VS 7.1
20118 1400 = VS 8.0
20119 1500 = VS 9.0
20120 1600 = VS 10.0
20121 1700 = VS 11.0
20122 1800 = VS 12.0
20123
20124
20125 UNIX True for UNIX and UNIX like operating systems.
20126
20127 Set to true when the target system is UNIX or UNIX like (i.e.
20128 APPLE and CYGWIN).
20129
20130
20131 WIN32 True on windows systems, including win64.
20132
20133 Set to true when the target system is Windows.
20134
20135
20136 XCODE_VERSION
20137 Version of Xcode (Xcode generator only).
20138
20139 Under the Xcode generator, this is the version of Xcode as spec‐
20140 ified in "Xcode.app/Contents/version.plist" (such as "3.1.2").
20141
20142
20144 CMAKE_<LANG>_ARCHIVE_APPEND
20145 Rule variable to append to a static archive.
20146
20147 This is a rule variable that tells CMake how to append to a
20148 static archive. It is used in place of CMAKE_<LANG>_CRE‐
20149 ATE_STATIC_LIBRARY on some platforms in order to support large
20150 object counts. See also CMAKE_<LANG>_ARCHIVE_CREATE and
20151 CMAKE_<LANG>_ARCHIVE_FINISH.
20152
20153
20154 CMAKE_<LANG>_ARCHIVE_CREATE
20155 Rule variable to create a new static archive.
20156
20157 This is a rule variable that tells CMake how to create a static
20158 archive. It is used in place of CMAKE_<LANG>_CRE‐
20159 ATE_STATIC_LIBRARY on some platforms in order to support large
20160 object counts. See also CMAKE_<LANG>_ARCHIVE_APPEND and
20161 CMAKE_<LANG>_ARCHIVE_FINISH.
20162
20163
20164 CMAKE_<LANG>_ARCHIVE_FINISH
20165 Rule variable to finish an existing static archive.
20166
20167 This is a rule variable that tells CMake how to finish a static
20168 archive. It is used in place of CMAKE_<LANG>_CRE‐
20169 ATE_STATIC_LIBRARY on some platforms in order to support large
20170 object counts. See also CMAKE_<LANG>_ARCHIVE_CREATE and
20171 CMAKE_<LANG>_ARCHIVE_APPEND.
20172
20173
20174 CMAKE_<LANG>_COMPILER
20175 The full path to the compiler for LANG.
20176
20177 This is the command that will be used as the <LANG> compiler.
20178 Once set, you can not change this variable.
20179
20180
20181 CMAKE_<LANG>_COMPILER_ABI
20182 An internal variable subject to change.
20183
20184 This is used in determining the compiler ABI and is subject to
20185 change.
20186
20187
20188 CMAKE_<LANG>_COMPILER_ID
20189 Compiler identification string.
20190
20191 A short string unique to the compiler vendor. Possible values
20192 include:
20193
20194
20195 Absoft = Absoft Fortran (absoft.com)
20196 ADSP = Analog VisualDSP++ (analog.com)
20197 Clang = LLVM Clang (clang.llvm.org)
20198 Cray = Cray Compiler (cray.com)
20199 Embarcadero, Borland = Embarcadero (embarcadero.com)
20200 G95 = G95 Fortran (g95.org)
20201 GNU = GNU Compiler Collection (gcc.gnu.org)
20202 HP = Hewlett-Packard Compiler (hp.com)
20203 Intel = Intel Compiler (intel.com)
20204 MIPSpro = SGI MIPSpro (sgi.com)
20205 MSVC = Microsoft Visual Studio (microsoft.com)
20206 PGI = The Portland Group (pgroup.com)
20207 PathScale = PathScale (pathscale.com)
20208 SDCC = Small Device C Compiler (sdcc.sourceforge.net)
20209 SunPro = Oracle Solaris Studio (oracle.com)
20210 TI = Texas Instruments (ti.com)
20211 TinyCC = Tiny C Compiler (tinycc.org)
20212 Watcom = Open Watcom (openwatcom.org)
20213 XL, VisualAge, zOS = IBM XL (ibm.com)
20214
20215 This variable is not guaranteed to be defined for all compilers
20216 or languages.
20217
20218
20219 CMAKE_<LANG>_COMPILER_LOADED
20220 Defined to true if the language is enabled.
20221
20222 When language <LANG> is enabled by project() or enable_lan‐
20223 guage() this variable is defined to 1.
20224
20225
20226 CMAKE_<LANG>_COMPILER_VERSION
20227 Compiler version string.
20228
20229 Compiler version in major[.minor[.patch[.tweak]]] format. This
20230 variable is not guaranteed to be defined for all compilers or
20231 languages.
20232
20233
20234 CMAKE_<LANG>_COMPILE_OBJECT
20235 Rule variable to compile a single object file.
20236
20237 This is a rule variable that tells CMake how to compile a single
20238 object file for the language <LANG>.
20239
20240
20241 CMAKE_<LANG>_CREATE_SHARED_LIBRARY
20242 Rule variable to create a shared library.
20243
20244 This is a rule variable that tells CMake how to create a shared
20245 library for the language <LANG>.
20246
20247
20248 CMAKE_<LANG>_CREATE_SHARED_MODULE
20249 Rule variable to create a shared module.
20250
20251 This is a rule variable that tells CMake how to create a shared
20252 library for the language <LANG>.
20253
20254
20255 CMAKE_<LANG>_CREATE_STATIC_LIBRARY
20256 Rule variable to create a static library.
20257
20258 This is a rule variable that tells CMake how to create a static
20259 library for the language <LANG>.
20260
20261
20262 CMAKE_<LANG>_FLAGS
20263 Flags for all build types.
20264
20265 <LANG> flags used regardless of the value of CMAKE_BUILD_TYPE.
20266
20267
20268 CMAKE_<LANG>_FLAGS_DEBUG
20269 Flags for Debug build type or configuration.
20270
20271 <LANG> flags used when CMAKE_BUILD_TYPE is Debug.
20272
20273
20274 CMAKE_<LANG>_FLAGS_MINSIZEREL
20275 Flags for MinSizeRel build type or configuration.
20276
20277 <LANG> flags used when CMAKE_BUILD_TYPE is MinSizeRel.Short for
20278 minimum size release.
20279
20280
20281 CMAKE_<LANG>_FLAGS_RELEASE
20282 Flags for Release build type or configuration.
20283
20284 <LANG> flags used when CMAKE_BUILD_TYPE is Release
20285
20286
20287 CMAKE_<LANG>_FLAGS_RELWITHDEBINFO
20288 Flags for RelWithDebInfo type or configuration.
20289
20290 <LANG> flags used when CMAKE_BUILD_TYPE is RelWithDebInfo.
20291 Short for Release With Debug Information.
20292
20293
20294 CMAKE_<LANG>_IGNORE_EXTENSIONS
20295 File extensions that should be ignored by the build.
20296
20297 This is a list of file extensions that may be part of a project
20298 for a given language but are not compiled.
20299
20300
20301 CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES
20302 Directories implicitly searched by the compiler for header
20303 files.
20304
20305 CMake does not explicitly specify these directories on compiler
20306 command lines for language <LANG>. This prevents system include
20307 directories from being treated as user include directories on
20308 some compilers.
20309
20310
20311 CMAKE_<LANG>_IMPLICIT_LINK_DIRECTORIES
20312 Implicit linker search path detected for language <LANG>.
20313
20314 Compilers typically pass directories containing language runtime
20315 libraries and default library search paths when they invoke a
20316 linker. These paths are implicit linker search directories for
20317 the compiler's language. CMake automatically detects these
20318 directories for each language and reports the results in this
20319 variable.
20320
20321
20322 When a library in one of these directories is given by full path
20323 to target_link_libraries() CMake will generate the -l<name> form
20324 on link lines to ensure the linker searches its implicit direc‐
20325 tories for the library. Note that some toolchains read implicit
20326 directories from an environment variable such as LIBRARY_PATH so
20327 keep its value consistent when operating in a given build tree.
20328
20329
20330 CMAKE_<LANG>_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES
20331 Implicit linker framework search path detected for language
20332 <LANG>.
20333
20334 These paths are implicit linker framework search directories for
20335 the compiler's language. CMake automatically detects these
20336 directories for each language and reports the results in this
20337 variable.
20338
20339
20340 CMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES
20341 Implicit link libraries and flags detected for language <LANG>.
20342
20343 Compilers typically pass language runtime library names and
20344 other flags when they invoke a linker. These flags are implicit
20345 link options for the compiler's language. CMake automatically
20346 detects these libraries and flags for each language and reports
20347 the results in this variable.
20348
20349
20350 CMAKE_<LANG>_LIBRARY_ARCHITECTURE
20351 Target architecture library directory name detected for <lang>.
20352
20353 If the <lang> compiler passes to the linker an architecture-spe‐
20354 cific system library search directory such as <pre‐
20355 fix>/lib/<arch> this variable contains the <arch> name if/as
20356 detected by CMake.
20357
20358
20359 CMAKE_<LANG>_LINKER_PREFERENCE
20360 Preference value for linker language selection.
20361
20362 The "linker language" for executable, shared library, and module
20363 targets is the language whose compiler will invoke the linker.
20364 The LINKER_LANGUAGE target property sets the language explic‐
20365 itly. Otherwise, the linker language is that whose linker pref‐
20366 erence value is highest among languages compiled and linked into
20367 the target. See also the CMAKE_<LANG>_LINKER_PREFERENCE_PROPA‐
20368 GATES variable.
20369
20370
20371 CMAKE_<LANG>_LINKER_PREFERENCE_PROPAGATES
20372 True if CMAKE_<LANG>_LINKER_PREFERENCE propagates across tar‐
20373 gets.
20374
20375 This is used when CMake selects a linker language for a target.
20376 Languages compiled directly into the target are always consid‐
20377 ered. A language compiled into static libraries linked by the
20378 target is considered if this variable is true.
20379
20380
20381 CMAKE_<LANG>_LINK_EXECUTABLE
20382 Rule variable to link an executable.
20383
20384 Rule variable to link an executable for the given language.
20385
20386
20387 CMAKE_<LANG>_OUTPUT_EXTENSION
20388 Extension for the output of a compile for a single file.
20389
20390 This is the extension for an object file for the given <LANG>.
20391 For example .obj for C on Windows.
20392
20393
20394 CMAKE_<LANG>_PLATFORM_ID
20395 An internal variable subject to change.
20396
20397 This is used in determining the platform and is subject to
20398 change.
20399
20400
20401 CMAKE_<LANG>_SIZEOF_DATA_PTR
20402 Size of pointer-to-data types for language <LANG>.
20403
20404 This holds the size (in bytes) of pointer-to-data types in the
20405 target platform ABI. It is defined for languages C and CXX
20406 (C++).
20407
20408
20409 CMAKE_<LANG>_SOURCE_FILE_EXTENSIONS
20410 Extensions of source files for the given language.
20411
20412 This is the list of extensions for a given language's source
20413 files.
20414
20415
20416 CMAKE_COMPILER_IS_GNU<LANG>
20417 True if the compiler is GNU.
20418
20419 If the selected <LANG> compiler is the GNU compiler then this is
20420 TRUE, if not it is FALSE. Unlike the other per-language vari‐
20421 ables, this uses the GNU syntax for identifying languages
20422 instead of the CMake syntax. Recognized values of the <LANG>
20423 suffix are:
20424
20425
20426 CC = C compiler
20427 CXX = C++ compiler
20428 G77 = Fortran compiler
20429
20430
20431 CMAKE_Fortran_MODDIR_DEFAULT
20432 Fortran default module output directory.
20433
20434 Most Fortran compilers write .mod files to the current working
20435 directory. For those that do not, this is set to "." and used
20436 when the Fortran_MODULE_DIRECTORY target property is not set.
20437
20438
20439 CMAKE_Fortran_MODDIR_FLAG
20440 Fortran flag for module output directory.
20441
20442 This stores the flag needed to pass the value of the For‐
20443 tran_MODULE_DIRECTORY target property to the compiler.
20444
20445
20446 CMAKE_Fortran_MODOUT_FLAG
20447 Fortran flag to enable module output.
20448
20449 Most Fortran compilers write .mod files out by default. For
20450 others, this stores the flag needed to enable module output.
20451
20452
20453 CMAKE_INTERNAL_PLATFORM_ABI
20454 An internal variable subject to change.
20455
20456 This is used in determining the compiler ABI and is subject to
20457 change.
20458
20459
20460 CMAKE_USER_MAKE_RULES_OVERRIDE_<LANG>
20461 Specify a CMake file that overrides platform information for
20462 <LANG>.
20463
20464 This is a language-specific version of
20465 CMAKE_USER_MAKE_RULES_OVERRIDE loaded only when enabling lan‐
20466 guage <LANG>.
20467
20468
20470 CMAKE_<CONFIG>_POSTFIX
20471 Default filename postfix for libraries under configuration <CON‐
20472 FIG>.
20473
20474 When a non-executable target is created its <CONFIG>_POSTFIX
20475 target property is initialized with the value of this variable
20476 if it is set.
20477
20478
20479 CMAKE_<LANG>_VISIBILITY_PRESET
20480 Default value for <LANG>_VISIBILITY_PRESET of targets.
20481
20482 This variable is used to initialize the <LANG>_VISIBILITY_PRESET
20483 property on all the targets. See that target property for addi‐
20484 tional information.
20485
20486
20487 CMAKE_ARCHIVE_OUTPUT_DIRECTORY
20488 Where to put all the ARCHIVE targets when built.
20489
20490 This variable is used to initialize the ARCHIVE_OUTPUT_DIRECTORY
20491 property on all the targets. See that target property for addi‐
20492 tional information.
20493
20494
20495 CMAKE_AUTOMOC
20496 Whether to handle moc automatically for Qt targets.
20497
20498 This variable is used to initialize the AUTOMOC property on all
20499 the targets. See that target property for additional informa‐
20500 tion.
20501
20502
20503 CMAKE_AUTOMOC_MOC_OPTIONS
20504 Additional options for moc when using automoc (see CMAKE_AUTO‐
20505 MOC).
20506
20507 This variable is used to initialize the AUTOMOC_MOC_OPTIONS
20508 property on all the targets. See that target property for addi‐
20509 tional information.
20510
20511
20512 CMAKE_BUILD_WITH_INSTALL_RPATH
20513 Use the install path for the RPATH
20514
20515 Normally CMake uses the build tree for the RPATH when building
20516 executables etc on systems that use RPATH. When the software is
20517 installed the executables etc are relinked by CMake to have the
20518 install RPATH. If this variable is set to true then the software
20519 is always built with the install path for the RPATH and does not
20520 need to be relinked when installed.
20521
20522
20523 CMAKE_DEBUG_POSTFIX
20524 See variable CMAKE_<CONFIG>_POSTFIX.
20525
20526 This variable is a special case of the more-general CMAKE_<CON‐
20527 FIG>_POSTFIX variable for the DEBUG configuration.
20528
20529
20530 CMAKE_EXE_LINKER_FLAGS
20531 Linker flags to be used to create executables.
20532
20533 These flags will be used by the linker when creating an exe‐
20534 cutable.
20535
20536
20537 CMAKE_EXE_LINKER_FLAGS_<CONFIG>
20538 Flags to be used when linking an executable.
20539
20540 Same as CMAKE_C_FLAGS_* but used by the linker when creating
20541 executables.
20542
20543
20544 CMAKE_Fortran_FORMAT
20545 Set to FIXED or FREE to indicate the Fortran source layout.
20546
20547 This variable is used to initialize the Fortran_FORMAT property
20548 on all the targets. See that target property for additional
20549 information.
20550
20551
20552 CMAKE_Fortran_MODULE_DIRECTORY
20553 Fortran module output directory.
20554
20555 This variable is used to initialize the Fortran_MODULE_DIRECTORY
20556 property on all the targets. See that target property for addi‐
20557 tional information.
20558
20559
20560 CMAKE_GNUtoMS
20561 Convert GNU import libraries (.dll.a) to MS format (.lib).
20562
20563 This variable is used to initialize the GNUtoMS property on tar‐
20564 gets when they are created. See that target property for addi‐
20565 tional information.
20566
20567
20568 CMAKE_INCLUDE_CURRENT_DIR
20569 Automatically add the current source- and build directories to
20570 the include path.
20571
20572 If this variable is enabled, CMake automatically adds in each
20573 directory ${CMAKE_CURRENT_SOURCE_DIR} and ${CMAKE_CUR‐
20574 RENT_BINARY_DIR} to the include path for this directory. These
20575 additional include directories do not propagate down to subdi‐
20576 rectories. This is useful mainly for out-of-source builds, where
20577 files generated into the build tree are included by files
20578 located in the source tree.
20579
20580
20581 By default CMAKE_INCLUDE_CURRENT_DIR is OFF.
20582
20583
20584 CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE
20585 Automatically add the current source- and build directories to
20586 the INTERFACE_INCLUDE_DIRECTORIES.
20587
20588 If this variable is enabled, CMake automatically adds for each
20589 shared library target, static library target, module target and
20590 executable target, ${CMAKE_CURRENT_SOURCE_DIR} and ${CMAKE_CUR‐
20591 RENT_BINARY_DIR} to the INTERFACE_INCLUDE_DIRECTORIES.By default
20592 CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE is OFF.
20593
20594
20595 CMAKE_INSTALL_NAME_DIR
20596 Mac OS X directory name for installed targets.
20597
20598 CMAKE_INSTALL_NAME_DIR is used to initialize the
20599 INSTALL_NAME_DIR property on all targets. See that target prop‐
20600 erty for more information.
20601
20602
20603 CMAKE_INSTALL_RPATH
20604 The rpath to use for installed targets.
20605
20606 A semicolon-separated list specifying the rpath to use in
20607 installed targets (for platforms that support it). This is used
20608 to initialize the target property INSTALL_RPATH for all targets.
20609
20610
20611 CMAKE_INSTALL_RPATH_USE_LINK_PATH
20612 Add paths to linker search and installed rpath.
20613
20614 CMAKE_INSTALL_RPATH_USE_LINK_PATH is a boolean that if set to
20615 true will append directories in the linker search path and out‐
20616 side the project to the INSTALL_RPATH. This is used to initial‐
20617 ize the target property INSTALL_RPATH_USE_LINK_PATH for all tar‐
20618 gets.
20619
20620
20621 CMAKE_LIBRARY_OUTPUT_DIRECTORY
20622 Where to put all the LIBRARY targets when built.
20623
20624 This variable is used to initialize the LIBRARY_OUTPUT_DIRECTORY
20625 property on all the targets. See that target property for addi‐
20626 tional information.
20627
20628
20629 CMAKE_LIBRARY_PATH_FLAG
20630 The flag to be used to add a library search path to a compiler.
20631
20632 The flag will be used to specify a library directory to the com‐
20633 piler. On most compilers this is "-L".
20634
20635
20636 CMAKE_LINK_DEF_FILE_FLAG
20637 Linker flag to be used to specify a .def file for dll creation.
20638
20639 The flag will be used to add a .def file when creating a dll on
20640 Windows; this is only defined on Windows.
20641
20642
20643 CMAKE_LINK_DEPENDS_NO_SHARED
20644 Whether to skip link dependencies on shared library files.
20645
20646 This variable initializes the LINK_DEPENDS_NO_SHARED property on
20647 targets when they are created. See that target property for
20648 additional information.
20649
20650
20651 CMAKE_LINK_INTERFACE_LIBRARIES
20652 Default value for LINK_INTERFACE_LIBRARIES of targets.
20653
20654 This variable is used to initialize the LINK_INTERFACE_LIBRARIES
20655 property on all the targets. See that target property for addi‐
20656 tional information.
20657
20658
20659 CMAKE_LINK_LIBRARY_FILE_FLAG
20660 Flag to be used to link a library specified by a path to its
20661 file.
20662
20663 The flag will be used before a library file path is given to the
20664 linker. This is needed only on very few platforms.
20665
20666
20667 CMAKE_LINK_LIBRARY_FLAG
20668 Flag to be used to link a library into an executable.
20669
20670 The flag will be used to specify a library to link to an exe‐
20671 cutable. On most compilers this is "-l".
20672
20673
20674 CMAKE_MACOSX_BUNDLE
20675 Default value for MACOSX_BUNDLE of targets.
20676
20677 This variable is used to initialize the MACOSX_BUNDLE property
20678 on all the targets. See that target property for additional
20679 information.
20680
20681
20682 CMAKE_MODULE_LINKER_FLAGS
20683 Linker flags to be used to create modules.
20684
20685 These flags will be used by the linker when creating a module.
20686
20687
20688 CMAKE_MODULE_LINKER_FLAGS_<CONFIG>
20689 Flags to be used when linking a module.
20690
20691 Same as CMAKE_C_FLAGS_* but used by the linker when creating
20692 modules.
20693
20694
20695 CMAKE_NO_BUILTIN_CHRPATH
20696 Do not use the builtin ELF editor to fix RPATHs on installation.
20697
20698 When an ELF binary needs to have a different RPATH after instal‐
20699 lation than it does in the build tree, CMake uses a builtin edi‐
20700 tor to change the RPATH in the installed copy. If this variable
20701 is set to true then CMake will relink the binary before instal‐
20702 lation instead of using its builtin editor.
20703
20704
20705 CMAKE_PDB_OUTPUT_DIRECTORY
20706 Where to put all the MS debug symbol files from linker.
20707
20708 This variable is used to initialize the PDB_OUTPUT_DIRECTORY
20709 property on all the targets. See that target property for addi‐
20710 tional information.
20711
20712
20713 CMAKE_POSITION_INDEPENDENT_CODE
20714 Default value for POSITION_INDEPENDENT_CODE of targets.
20715
20716 This variable is used to initialize the POSITION_INDEPEN‐
20717 DENT_CODE property on all the targets. See that target property
20718 for additional information.
20719
20720
20721 CMAKE_RUNTIME_OUTPUT_DIRECTORY
20722 Where to put all the RUNTIME targets when built.
20723
20724 This variable is used to initialize the RUNTIME_OUTPUT_DIRECTORY
20725 property on all the targets. See that target property for addi‐
20726 tional information.
20727
20728
20729 CMAKE_SHARED_LINKER_FLAGS
20730 Linker flags to be used to create shared libraries.
20731
20732 These flags will be used by the linker when creating a shared
20733 library.
20734
20735
20736 CMAKE_SHARED_LINKER_FLAGS_<CONFIG>
20737 Flags to be used when linking a shared library.
20738
20739 Same as CMAKE_C_FLAGS_* but used by the linker when creating
20740 shared libraries.
20741
20742
20743 CMAKE_SKIP_BUILD_RPATH
20744 Do not include RPATHs in the build tree.
20745
20746 Normally CMake uses the build tree for the RPATH when building
20747 executables etc on systems that use RPATH. When the software is
20748 installed the executables etc are relinked by CMake to have the
20749 install RPATH. If this variable is set to true then the software
20750 is always built with no RPATH.
20751
20752
20753 CMAKE_SKIP_INSTALL_RPATH
20754 Do not include RPATHs in the install tree.
20755
20756 Normally CMake uses the build tree for the RPATH when building
20757 executables etc on systems that use RPATH. When the software is
20758 installed the executables etc are relinked by CMake to have the
20759 install RPATH. If this variable is set to true then the software
20760 is always installed without RPATH, even if RPATH is enabled when
20761 building. This can be useful for example to allow running tests
20762 from the build directory with RPATH enabled before the installa‐
20763 tion step. To omit RPATH in both the build and install steps,
20764 use CMAKE_SKIP_RPATH instead.
20765
20766
20767 CMAKE_STATIC_LINKER_FLAGS
20768 Linker flags to be used to create static libraries.
20769
20770 These flags will be used by the linker when creating a static
20771 library.
20772
20773
20774 CMAKE_STATIC_LINKER_FLAGS_<CONFIG>
20775 Flags to be used when linking a static library.
20776
20777 Same as CMAKE_C_FLAGS_* but used by the linker when creating
20778 static libraries.
20779
20780
20781 CMAKE_TRY_COMPILE_CONFIGURATION
20782 Build configuration used for try_compile and try_run projects.
20783
20784 Projects built by try_compile and try_run are built syn‐
20785 chronously during the CMake configuration step. Therefore a
20786 specific build configuration must be chosen even if the gener‐
20787 ated build system supports multiple configurations.
20788
20789
20790 CMAKE_USE_RELATIVE_PATHS
20791 Use relative paths (May not work!).
20792
20793 If this is set to TRUE, then CMake will use relative paths
20794 between the source and binary tree. This option does not work
20795 for more complicated projects, and relative paths are used when
20796 possible. In general, it is not possible to move CMake gener‐
20797 ated makefiles to a different location regardless of the value
20798 of this variable.
20799
20800
20801 CMAKE_VISIBILITY_INLINES_HIDDEN
20802 Default value for VISIBILITY_INLINES_HIDDEN of targets.
20803
20804 This variable is used to initialize the VISIBILITY_INLINES_HID‐
20805 DEN property on all the targets. See that target property for
20806 additional information.
20807
20808
20809 CMAKE_WIN32_EXECUTABLE
20810 Default value for WIN32_EXECUTABLE of targets.
20811
20812 This variable is used to initialize the WIN32_EXECUTABLE prop‐
20813 erty on all the targets. See that target property for addi‐
20814 tional information.
20815
20816
20817 EXECUTABLE_OUTPUT_PATH
20818 Old executable location variable.
20819
20820 The target property RUNTIME_OUTPUT_DIRECTORY supercedes this
20821 variable for a target if it is set. Executable targets are oth‐
20822 erwise placed in this directory.
20823
20824
20825 LIBRARY_OUTPUT_PATH
20826 Old library location variable.
20827
20828 The target properties ARCHIVE_OUTPUT_DIRECTORY, LIBRARY_OUT‐
20829 PUT_DIRECTORY, and RUNTIME_OUTPUT_DIRECTORY supercede this vari‐
20830 able for a target if they are set. Library targets are other‐
20831 wise placed in this directory.
20832
20833
20835 CMAKE_AR
20836 Name of archiving tool for static libraries.
20837
20838 This specifies the name of the program that creates archive or
20839 static libraries.
20840
20841
20842 CMAKE_ARGC
20843 Number of command line arguments passed to CMake in script mode.
20844
20845 When run in -P script mode, CMake sets this variable to the num‐
20846 ber of command line arguments. See also CMAKE_ARGV0, 1, 2 ...
20847
20848
20849 CMAKE_ARGV0
20850 Command line argument passed to CMake in script mode.
20851
20852 When run in -P script mode, CMake sets this variable to the
20853 first command line argument. It then also sets CMAKE_ARGV1,
20854 CMAKE_ARGV2, ... and so on, up to the number of command line
20855 arguments given. See also CMAKE_ARGC.
20856
20857
20858 CMAKE_BINARY_DIR
20859 The path to the top level of the build tree.
20860
20861 This is the full path to the top level of the current CMake
20862 build tree. For an in-source build, this would be the same as
20863 CMAKE_SOURCE_DIR.
20864
20865
20866 CMAKE_BUILD_TOOL
20867 Tool used for the actual build process.
20868
20869 This variable is set to the program that will be needed to build
20870 the output of CMake. If the generator selected was Visual Stu‐
20871 dio 6, the CMAKE_BUILD_TOOL will be set to msdev, for Unix Make‐
20872 files it will be set to make or gmake, and for Visual Studio 7
20873 it set to devenv. For NMake Makefiles the value is nmake. This
20874 can be useful for adding special flags and commands based on the
20875 final build environment.
20876
20877
20878 CMAKE_CACHEFILE_DIR
20879 The directory with the CMakeCache.txt file.
20880
20881 This is the full path to the directory that has the CMake‐
20882 Cache.txt file in it. This is the same as CMAKE_BINARY_DIR.
20883
20884
20885 CMAKE_CACHE_MAJOR_VERSION
20886 Major version of CMake used to create the CMakeCache.txt file
20887
20888 This stores the major version of CMake used to write a CMake
20889 cache file. It is only different when a different version of
20890 CMake is run on a previously created cache file.
20891
20892
20893 CMAKE_CACHE_MINOR_VERSION
20894 Minor version of CMake used to create the CMakeCache.txt file
20895
20896 This stores the minor version of CMake used to write a CMake
20897 cache file. It is only different when a different version of
20898 CMake is run on a previously created cache file.
20899
20900
20901 CMAKE_CACHE_PATCH_VERSION
20902 Patch version of CMake used to create the CMakeCache.txt file
20903
20904 This stores the patch version of CMake used to write a CMake
20905 cache file. It is only different when a different version of
20906 CMake is run on a previously created cache file.
20907
20908
20909 CMAKE_CFG_INTDIR
20910 Build-time reference to per-configuration output subdirectory.
20911
20912 For native build systems supporting multiple configurations in
20913 the build tree (such as Visual Studio and Xcode), the value is a
20914 reference to a build-time variable specifying the name of the
20915 per-configuration output subdirectory. On Makefile generators
20916 this evaluates to "." because there is only one configuration in
20917 a build tree. Example values:
20918
20919
20920 $(IntDir) = Visual Studio 6
20921 $(OutDir) = Visual Studio 7, 8, 9
20922 $(Configuration) = Visual Studio 10
20923 $(CONFIGURATION) = Xcode
20924 . = Make-based tools
20925
20926 Since these values are evaluated by the native build system,
20927 this variable is suitable only for use in command lines that
20928 will be evaluated at build time. Example of intended usage:
20929
20930
20931 add_executable(mytool mytool.c)
20932 add_custom_command(
20933 OUTPUT out.txt
20934 COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/mytool
20935 ${CMAKE_CURRENT_SOURCE_DIR}/in.txt out.txt
20936 DEPENDS mytool in.txt
20937 )
20938 add_custom_target(drive ALL DEPENDS out.txt)
20939
20940 Note that CMAKE_CFG_INTDIR is no longer necessary for this pur‐
20941 pose but has been left for compatibility with existing projects.
20942 Instead add_custom_command() recognizes executable target names
20943 in its COMMAND option, so "${CMAKE_CUR‐
20944 RENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/mytool" can be replaced by
20945 just "mytool".
20946
20947
20948 This variable is read-only. Setting it is undefined behavior.
20949 In multi-configuration build systems the value of this variable
20950 is passed as the value of preprocessor symbol "CMAKE_INTDIR" to
20951 the compilation of all source files.
20952
20953
20954 CMAKE_COMMAND
20955 The full path to the cmake executable.
20956
20957 This is the full path to the CMake executable cmake which is
20958 useful from custom commands that want to use the cmake -E option
20959 for portable system commands. (e.g. /usr/local/bin/cmake
20960
20961
20962 CMAKE_CROSSCOMPILING
20963 Is CMake currently cross compiling.
20964
20965 This variable will be set to true by CMake if CMake is cross
20966 compiling. Specifically if the build platform is different from
20967 the target platform.
20968
20969
20970 CMAKE_CTEST_COMMAND
20971 Full path to ctest command installed with cmake.
20972
20973 This is the full path to the CTest executable ctest which is
20974 useful from custom commands that want to use the cmake -E option
20975 for portable system commands.
20976
20977
20978 CMAKE_CURRENT_BINARY_DIR
20979 The path to the binary directory currently being processed.
20980
20981 This the full path to the build directory that is currently
20982 being processed by cmake. Each directory added by add_subdirec‐
20983 tory will create a binary directory in the build tree, and as it
20984 is being processed this variable will be set. For in-source
20985 builds this is the current source directory being processed.
20986
20987
20988 CMAKE_CURRENT_LIST_DIR
20989 Full directory of the listfile currently being processed.
20990
20991 As CMake processes the listfiles in your project this variable
20992 will always be set to the directory where the listfile which is
20993 currently being processed (CMAKE_CURRENT_LIST_FILE) is located.
20994 The value has dynamic scope. When CMake starts processing com‐
20995 mands in a source file it sets this variable to the directory
20996 where this file is located. When CMake finishes processing com‐
20997 mands from the file it restores the previous value. Therefore
20998 the value of the variable inside a macro or function is the
20999 directory of the file invoking the bottom-most entry on the call
21000 stack, not the directory of the file containing the macro or
21001 function definition.
21002
21003
21004 See also CMAKE_CURRENT_LIST_FILE.
21005
21006
21007 CMAKE_CURRENT_LIST_FILE
21008 Full path to the listfile currently being processed.
21009
21010 As CMake processes the listfiles in your project this variable
21011 will always be set to the one currently being processed. The
21012 value has dynamic scope. When CMake starts processing commands
21013 in a source file it sets this variable to the location of the
21014 file. When CMake finishes processing commands from the file it
21015 restores the previous value. Therefore the value of the vari‐
21016 able inside a macro or function is the file invoking the bot‐
21017 tom-most entry on the call stack, not the file containing the
21018 macro or function definition.
21019
21020
21021 See also CMAKE_PARENT_LIST_FILE.
21022
21023
21024 CMAKE_CURRENT_LIST_LINE
21025 The line number of the current file being processed.
21026
21027 This is the line number of the file currently being processed by
21028 cmake.
21029
21030
21031 CMAKE_CURRENT_SOURCE_DIR
21032 The path to the source directory currently being processed.
21033
21034 This the full path to the source directory that is currently
21035 being processed by cmake.
21036
21037
21038 CMAKE_DL_LIBS
21039 Name of library containing dlopen and dlcose.
21040
21041 The name of the library that has dlopen and dlclose in it, usu‐
21042 ally -ldl on most UNIX machines.
21043
21044
21045 CMAKE_EDIT_COMMAND
21046 Full path to cmake-gui or ccmake.
21047
21048 This is the full path to the CMake executable that can graphi‐
21049 cally edit the cache. For example, cmake-gui, ccmake, or cmake
21050 -i.
21051
21052
21053 CMAKE_EXECUTABLE_SUFFIX
21054 The suffix for executables on this platform.
21055
21056 The suffix to use for the end of an executable filename if any,
21057 .exe on Windows.
21058
21059
21060 CMAKE_EXECUTABLE_SUFFIX_<LANG> overrides this for language
21061 <LANG>.
21062
21063
21064 CMAKE_EXTRA_GENERATOR
21065 The extra generator used to build the project.
21066
21067 When using the Eclipse, CodeBlocks or KDevelop generators, CMake
21068 generates Makefiles (CMAKE_GENERATOR) and additionally project
21069 files for the respective IDE. This IDE project file generator is
21070 stored in CMAKE_EXTRA_GENERATOR (e.g. "Eclipse CDT4").
21071
21072
21073 CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES
21074 Additional suffixes for shared libraries.
21075
21076 Extensions for shared libraries other than that specified by
21077 CMAKE_SHARED_LIBRARY_SUFFIX, if any. CMake uses this to recog‐
21078 nize external shared library files during analysis of libraries
21079 linked by a target.
21080
21081
21082 CMAKE_GENERATOR
21083 The generator used to build the project.
21084
21085 The name of the generator that is being used to generate the
21086 build files. (e.g. "Unix Makefiles", "Visual Studio 6", etc.)
21087
21088
21089 CMAKE_GENERATOR_TOOLSET
21090 Native build system toolset name specified by user.
21091
21092 Some CMake generators support a toolset name to be given to the
21093 native build system to choose a compiler. If the user specifies
21094 a toolset name (e.g. via the cmake -T option) the value will be
21095 available in this variable.
21096
21097
21098 CMAKE_HOME_DIRECTORY
21099 Path to top of source tree.
21100
21101 This is the path to the top level of the source tree.
21102
21103
21104 CMAKE_IMPORT_LIBRARY_PREFIX
21105 The prefix for import libraries that you link to.
21106
21107 The prefix to use for the name of an import library if used on
21108 this platform.
21109
21110
21111 CMAKE_IMPORT_LIBRARY_PREFIX_<LANG> overrides this for language
21112 <LANG>.
21113
21114
21115 CMAKE_IMPORT_LIBRARY_SUFFIX
21116 The suffix for import libraries that you link to.
21117
21118 The suffix to use for the end of an import library filename if
21119 used on this platform.
21120
21121
21122 CMAKE_IMPORT_LIBRARY_SUFFIX_<LANG> overrides this for language
21123 <LANG>.
21124
21125
21126 CMAKE_LINK_LIBRARY_SUFFIX
21127 The suffix for libraries that you link to.
21128
21129 The suffix to use for the end of a library filename, .lib on
21130 Windows.
21131
21132
21133 CMAKE_MAJOR_VERSION
21134 The Major version of cmake (i.e. the 2 in 2.X.X)
21135
21136 This specifies the major version of the CMake executable being
21137 run.
21138
21139
21140 CMAKE_MAKE_PROGRAM
21141 See CMAKE_BUILD_TOOL.
21142
21143 This variable is around for backwards compatibility, see
21144 CMAKE_BUILD_TOOL.
21145
21146
21147 CMAKE_MINIMUM_REQUIRED_VERSION
21148 Version specified to cmake_minimum_required command
21149
21150 Variable containing the VERSION component specified in the
21151 cmake_minimum_required command.
21152
21153
21154 CMAKE_MINOR_VERSION
21155 The Minor version of cmake (i.e. the 4 in X.4.X).
21156
21157 This specifies the minor version of the CMake executable being
21158 run.
21159
21160
21161 CMAKE_PARENT_LIST_FILE
21162 Full path to the CMake file that included the current one.
21163
21164 While processing a CMake file loaded by include() or find_pack‐
21165 age() this variable contains the full path to the file including
21166 it. The top of the include stack is always the CMakeLists.txt
21167 for the current directory. See also CMAKE_CURRENT_LIST_FILE.
21168
21169
21170 CMAKE_PATCH_VERSION
21171 The patch version of cmake (i.e. the 3 in X.X.3).
21172
21173 This specifies the patch version of the CMake executable being
21174 run.
21175
21176
21177 CMAKE_PROJECT_NAME
21178 The name of the current project.
21179
21180 This specifies name of the current project from the closest
21181 inherited PROJECT command.
21182
21183
21184 CMAKE_RANLIB
21185 Name of randomizing tool for static libraries.
21186
21187 This specifies name of the program that randomizes libraries on
21188 UNIX, not used on Windows, but may be present.
21189
21190
21191 CMAKE_ROOT
21192 Install directory for running cmake.
21193
21194 This is the install root for the running CMake and the Modules
21195 directory can be found here. This is commonly used in this for‐
21196 mat: ${CMAKE_ROOT}/Modules
21197
21198
21199 CMAKE_SCRIPT_MODE_FILE
21200 Full path to the -P script file currently being processed.
21201
21202 When run in -P script mode, CMake sets this variable to the full
21203 path of the script file. When run to configure a CMakeLists.txt
21204 file, this variable is not set.
21205
21206
21207 CMAKE_SHARED_LIBRARY_PREFIX
21208 The prefix for shared libraries that you link to.
21209
21210 The prefix to use for the name of a shared library, lib on UNIX.
21211
21212
21213 CMAKE_SHARED_LIBRARY_PREFIX_<LANG> overrides this for language
21214 <LANG>.
21215
21216
21217 CMAKE_SHARED_LIBRARY_SUFFIX
21218 The suffix for shared libraries that you link to.
21219
21220 The suffix to use for the end of a shared library filename, .dll
21221 on Windows.
21222
21223
21224 CMAKE_SHARED_LIBRARY_SUFFIX_<LANG> overrides this for language
21225 <LANG>.
21226
21227
21228 CMAKE_SHARED_MODULE_PREFIX
21229 The prefix for loadable modules that you link to.
21230
21231 The prefix to use for the name of a loadable module on this
21232 platform.
21233
21234
21235 CMAKE_SHARED_MODULE_PREFIX_<LANG> overrides this for language
21236 <LANG>.
21237
21238
21239 CMAKE_SHARED_MODULE_SUFFIX
21240 The suffix for shared libraries that you link to.
21241
21242 The suffix to use for the end of a loadable module filename on
21243 this platform
21244
21245
21246 CMAKE_SHARED_MODULE_SUFFIX_<LANG> overrides this for language
21247 <LANG>.
21248
21249
21250 CMAKE_SIZEOF_VOID_P
21251 Size of a void pointer.
21252
21253 This is set to the size of a pointer on the machine, and is
21254 determined by a try compile. If a 64 bit size is found, then the
21255 library search path is modified to look for 64 bit libraries
21256 first.
21257
21258
21259 CMAKE_SKIP_RPATH
21260 If true, do not add run time path information.
21261
21262 If this is set to TRUE, then the rpath information is not added
21263 to compiled executables. The default is to add rpath informa‐
21264 tion if the platform supports it. This allows for easy running
21265 from the build tree. To omit RPATH in the install step, but not
21266 the build step, use CMAKE_SKIP_INSTALL_RPATH instead.
21267
21268
21269 CMAKE_SOURCE_DIR
21270 The path to the top level of the source tree.
21271
21272 This is the full path to the top level of the current CMake
21273 source tree. For an in-source build, this would be the same as
21274 CMAKE_BINARY_DIR.
21275
21276
21277 CMAKE_STANDARD_LIBRARIES
21278 Libraries linked into every executable and shared library.
21279
21280 This is the list of libraries that are linked into all executa‐
21281 bles and libraries.
21282
21283
21284 CMAKE_STATIC_LIBRARY_PREFIX
21285 The prefix for static libraries that you link to.
21286
21287 The prefix to use for the name of a static library, lib on UNIX.
21288
21289
21290 CMAKE_STATIC_LIBRARY_PREFIX_<LANG> overrides this for language
21291 <LANG>.
21292
21293
21294 CMAKE_STATIC_LIBRARY_SUFFIX
21295 The suffix for static libraries that you link to.
21296
21297 The suffix to use for the end of a static library filename, .lib
21298 on Windows.
21299
21300
21301 CMAKE_STATIC_LIBRARY_SUFFIX_<LANG> overrides this for language
21302 <LANG>.
21303
21304
21305 CMAKE_TWEAK_VERSION
21306 The tweak version of cmake (i.e. the 1 in X.X.X.1).
21307
21308 This specifies the tweak version of the CMake executable being
21309 run. Releases use tweak < 20000000 and development versions use
21310 the date format CCYYMMDD for the tweak level.
21311
21312
21313 CMAKE_VERBOSE_MAKEFILE
21314 Create verbose makefiles if on.
21315
21316 This variable defaults to false. You can set this variable to
21317 true to make CMake produce verbose makefiles that show each com‐
21318 mand line as it is used.
21319
21320
21321 CMAKE_VERSION
21322 The full version of cmake in major.minor.patch[.tweak[-id]] for‐
21323 mat.
21324
21325 This specifies the full version of the CMake executable being
21326 run. This variable is defined by versions 2.6.3 and higher.
21327 See variables CMAKE_MAJOR_VERSION, CMAKE_MINOR_VERSION,
21328 CMAKE_PATCH_VERSION, and CMAKE_TWEAK_VERSION for individual ver‐
21329 sion components. The [-id] component appears in non-release
21330 versions and may be arbitrary text.
21331
21332
21333 CMAKE_VS_PLATFORM_TOOLSET
21334 Visual Studio Platform Toolset name.
21335
21336 VS 10 and above use MSBuild under the hood and support multiple
21337 compiler toolchains. CMake may specify a toolset explicitly,
21338 such as "v110" for VS 11 or "Windows7.1SDK" for 64-bit support
21339 in VS 10 Express. CMake provides the name of the chosen toolset
21340 in this variable.
21341
21342
21343 CMAKE_XCODE_PLATFORM_TOOLSET
21344 Xcode compiler selection.
21345
21346 Xcode supports selection of a compiler from one of the installed
21347 toolsets. CMake provides the name of the chosen toolset in this
21348 variable, if any is explicitly selected (e.g. via the cmake -T
21349 option).
21350
21351
21352 PROJECT_BINARY_DIR
21353 Full path to build directory for project.
21354
21355 This is the binary directory of the most recent PROJECT command.
21356
21357
21358 PROJECT_NAME
21359 Name of the project given to the project command.
21360
21361 This is the name given to the most recent PROJECT command.
21362
21363
21364 PROJECT_SOURCE_DIR
21365 Top level source directory for the current project.
21366
21367 This is the source directory of the most recent PROJECT command.
21368
21369
21370 [Project name]_BINARY_DIR
21371 Top level binary directory for the named project.
21372
21373 A variable is created with the name used in the PROJECT command,
21374 and is the binary directory for the project. This can be use‐
21375 ful when SUBDIR is used to connect several projects.
21376
21377
21378 [Project name]_SOURCE_DIR
21379 Top level source directory for the named project.
21380
21381 A variable is created with the name used in the PROJECT command,
21382 and is the source directory for the project. This can be use‐
21383 ful when add_subdirectory is used to connect several projects.
21384
21385
21387 Copyright 2000-2012 Kitware, Inc., Insight Software Consortium. All
21388 rights reserved.
21389
21390
21391 Redistribution and use in source and binary forms, with or without mod‐
21392 ification, are permitted provided that the following conditions are
21393 met:
21394
21395
21396 Redistributions of source code must retain the above copyright notice,
21397 this list of conditions and the following disclaimer.
21398
21399
21400 Redistributions in binary form must reproduce the above copyright
21401 notice, this list of conditions and the following disclaimer in the
21402 documentation and/or other materials provided with the distribution.
21403
21404
21405 Neither the names of Kitware, Inc., the Insight Software Consortium,
21406 nor the names of their contributors may be used to endorse or promote
21407 products derived from this software without specific prior written per‐
21408 mission.
21409
21410
21411 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
21412 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21413 TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTIC‐
21414 ULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
21415 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21416 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21417 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21418 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21419 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21420 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
21421 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21422
21423
21425 This manual page was generated by the "--help-man" option.
21426
21427
21428
21429
21430cmake 2.8.12.2 October 15, 2014 cmake(1)