1cmakemodules(1) General Commands Manual cmakemodules(1)
2
3
4
6 cmakemodules - Reference of available CMake modules.
7
8
10 The "cmake" executable is the CMake command-line interface. It may be
11 used to configure projects in scripts. Project configuration settings
12 may be specified on the command line with the -D option. The -i option
13 will cause cmake to interactively prompt for such settings.
14
15
16 CMake is a cross-platform build system generator. Projects specify
17 their build process with platform-independent CMake listfiles included
18 in each directory of a source tree with the name CMakeLists.txt. Users
19 build a project by using CMake to generate a build system for a native
20 tool on their platform.
21
22
24 The following modules are provided with CMake. They can be used with
25 INCLUDE(ModuleName).
26
27
28 CMake Modules - Modules coming with CMake, the Cross-Platform Makefile Generator.
29
30
31 This is the documentation for the modules and scripts coming with
32 CMake. Using these modules you can check the computer system for
33 installed software packages, features of the compiler and the existence
34 of headers to name just a few.
35
36
37 AddFileDependencies
38 ADD_FILE_DEPENDENCIES(source_file depend_files...)
39
40 Adds the given files as dependencies to source_file
41
42
43
44 BundleUtilities
45 Functions to help assemble a standalone bundle application.
46
47 A collection of CMake utility functions useful for dealing with
48 .app bundles on the Mac and bundle-like directories on any OS.
49
50
51 The following functions are provided by this module:
52
53
54 fixup_bundle
55 copy_and_fixup_bundle
56 verify_app
57 get_bundle_main_executable
58 get_dotapp_dir
59 get_bundle_and_executable
60 get_bundle_all_executables
61 get_item_key
62 clear_bundle_keys
63 set_bundle_key_values
64 get_bundle_keys
65 copy_resolved_item_into_bundle
66 copy_resolved_framework_into_bundle
67 fixup_bundle_item
68 verify_bundle_prerequisites
69 verify_bundle_symlinks
70
71 Requires CMake 2.6 or greater because it uses function, break
72 and PARENT_SCOPE. Also depends on GetPrerequisites.cmake.
73
74
75 FIXUP_BUNDLE(<app> <libs> <dirs>)
76
77 Fix up a bundle in-place and make it standalone, such that it
78 can be drag-n-drop copied to another machine and run on that
79 machine as long as all of the system libraries are compatible.
80
81
82 If you pass plugins to fixup_bundle as the libs parameter, you
83 should install them or copy them into the bundle before calling
84 fixup_bundle. The "libs" parameter is a list of libraries that
85 must be fixed up, but that cannot be determined by otool output
86 analysis. (i.e., plugins)
87
88
89 Gather all the keys for all the executables and libraries in a
90 bundle, and then, for each key, copy each prerequisite into the
91 bundle. Then fix each one up according to its own list of pre‐
92 requisites.
93
94
95 Then clear all the keys and call verify_app on the final bundle
96 to ensure that it is truly standalone.
97
98
99 COPY_AND_FIXUP_BUNDLE(<src> <dst> <libs> <dirs>)
100
101 Makes a copy of the bundle <src> at location <dst> and then
102 fixes up the new copied bundle in-place at <dst>...
103
104
105 VERIFY_APP(<app>)
106
107 Verifies that an application <app> appears valid based on run‐
108 ning analysis tools on it. Calls "message(FATAL_ERROR" if the
109 application is not verified.
110
111
112 GET_BUNDLE_MAIN_EXECUTABLE(<bundle> <result_var>)
113
114 The result will be the full path name of the bundle's main exe‐
115 cutable file or an "error:" prefixed string if it could not be
116 determined.
117
118
119 GET_DOTAPP_DIR(<exe> <dotapp_dir_var>)
120
121 Returns the nearest parent dir whose name ends with ".app" given
122 the full path to an executable. If there is no such parent dir,
123 then simply return the dir containing the executable.
124
125
126 The returned directory may or may not exist.
127
128
129 GET_BUNDLE_AND_EXECUTABLE(<app> <bundle_var> <executable_var> <valid_var>)
130
131 Takes either a ".app" directory name or the name of an exe‐
132 cutable nested inside a ".app" directory and returns the path to
133 the ".app" directory in <bundle_var> and the path to its main
134 executable in <executable_var>
135
136
137 GET_BUNDLE_ALL_EXECUTABLES(<bundle> <exes_var>)
138
139 Scans the given bundle recursively for all executable files and
140 accumulates them into a variable.
141
142
143 GET_ITEM_KEY(<item> <key_var>)
144
145 Given a file (item) name, generate a key that should be unique
146 considering the set of libraries that need copying or fixing up
147 to make a bundle standalone. This is essentially the file name
148 including extension with "." replaced by "_"
149
150
151 This key is used as a prefix for CMake variables so that we can
152 associate a set of variables with a given item based on its key.
153
154
155 CLEAR_BUNDLE_KEYS(<keys_var>)
156
157 Loop over the list of keys, clearing all the variables associ‐
158 ated with each key. After the loop, clear the list of keys
159 itself.
160
161
162 Caller of get_bundle_keys should call clear_bundle_keys when
163 done with list of keys.
164
165
166 SET_BUNDLE_KEY_VALUES(<keys_var> <context> <item> <exepath> <dirs>
167 <copyflag>)
168
169 Add a key to the list (if necessary) for the given item. If
170 added, also set all the variables associated with that key.
171
172
173 GET_BUNDLE_KEYS(<app> <libs> <dirs> <keys_var>)
174
175 Loop over all the executable and library files within the bundle
176 (and given as extra <libs>) and accumulate a list of keys repre‐
177 senting them. Set values associated with each key such that we
178 can loop over all of them and copy prerequisite libs into the
179 bundle and then do appropriate install_name_tool fixups.
180
181
182 COPY_RESOLVED_ITEM_INTO_BUNDLE(<resolved_item> <resolved_embedded_item>)
183
184 Copy a resolved item into the bundle if necessary. Copy is not
185 necessary if the resolved_item is "the same as" the
186 resolved_embedded_item.
187
188
189 COPY_RESOLVED_FRAMEWORK_INTO_BUNDLE(<resolved_item> <resolved_embedded_item>)
190
191 Copy a resolved framework into the bundle if necessary. Copy is
192 not necessary if the resolved_item is "the same as" the
193 resolved_embedded_item.
194
195
196 By default, BU_COPY_FULL_FRAMEWORK_CONTENTS is not set. If you
197 want full frameworks embedded in your bundles, set
198 BU_COPY_FULL_FRAMEWORK_CONTENTS to ON before calling fixup_bun‐
199 dle. By default, COPY_RESOLVED_FRAMEWORK_INTO_BUNDLE copies the
200 framework dylib itself plus the framework Resources directory.
201
202
203 FIXUP_BUNDLE_ITEM(<resolved_embedded_item> <exepath> <dirs>)
204
205 Get the direct/non-system prerequisites of the resolved embedded
206 item. For each prerequisite, change the way it is referenced to
207 the value of the _EMBEDDED_ITEM keyed variable for that prereq‐
208 uisite. (Most likely changing to an "@executable_path" style
209 reference.)
210
211
212 This function requires that the resolved_embedded_item be
213 "inside" the bundle already. In other words, if you pass plugins
214 to fixup_bundle as the libs parameter, you should install them
215 or copy them into the bundle before calling fixup_bundle. The
216 "libs" parameter is a list of libraries that must be fixed up,
217 but that cannot be determined by otool output analysis. (i.e.,
218 plugins)
219
220
221 Also, change the id of the item being fixed up to its own
222 _EMBEDDED_ITEM value.
223
224
225 Accumulate changes in a local variable and make *one* call to
226 install_name_tool at the end of the function with all the
227 changes at once.
228
229
230 If the BU_CHMOD_BUNDLE_ITEMS variable is set then bundle items
231 will be marked writable before install_name_tool tries to change
232 them.
233
234
235 VERIFY_BUNDLE_PREREQUISITES(<bundle> <result_var> <info_var>)
236
237 Verifies that the sum of all prerequisites of all files inside
238 the bundle are contained within the bundle or are "system"
239 libraries, presumed to exist everywhere.
240
241
242 VERIFY_BUNDLE_SYMLINKS(<bundle> <result_var> <info_var>)
243
244 Verifies that any symlinks found in the bundle point to other
245 files that are already also in the bundle... Anything that
246 points to an external file causes this function to fail the ver‐
247 ification.
248
249
250 CMakeAddFortranSubdirectory
251 Use MinGW gfortran from VS if a fortran compiler is not found.
252
253 The 'add_fortran_subdirectory' function adds a subdirectory to a
254 project that contains a fortran only sub-project. The module
255 will check the current compiler and see if it can support for‐
256 tran. If no fortran compiler is found and the compiler is MSVC,
257 then this module will find the MinGW gfortran. It will then use
258 an external project to build with the MinGW tools. It will also
259 create imported targets for the libraries created. This will
260 only work if the fortran code is built into a dll, so
261 BUILD_SHARED_LIBS is turned on in the project. In addition the
262 CMAKE_GNUtoMS option is set to on, so that the MS .lib files are
263 created. Usage is as follows:
264
265
266 cmake_add_fortran_subdirectory(
267 <subdir> # name of subdirectory
268 PROJECT <project_name> # project name in subdir top CMakeLists.txt
269 ARCHIVE_DIR <dir> # dir where project places .lib files
270 RUNTIME_DIR <dir> # dir where project places .dll files
271 LIBRARIES <lib>... # names of library targets to import
272 LINK_LIBRARIES # link interface libraries for LIBRARIES
273 [LINK_LIBS <lib> <dep>...]...
274 CMAKE_COMMAND_LINE ... # extra command line flags to pass to cmake
275 NO_EXTERNAL_INSTALL # skip installation of external project
276 )
277
278 Relative paths in ARCHIVE_DIR and RUNTIME_DIR are interpreted
279 with respect to the build directory corresponding to the source
280 directory in which the function is invoked.
281
282
283 Limitations:
284
285
286 NO_EXTERNAL_INSTALL is required for forward compatibility with a
287 future version that supports installation of the external
288 project binaries during "make install".
289
290
291 CMakeBackwardCompatibilityCXX
292 define a bunch of backwards compatibility variables
293
294 CMAKE_ANSI_CXXFLAGS - flag for ansi c++
295 CMAKE_HAS_ANSI_STRING_STREAM - has <strstream>
296 include(TestForANSIStreamHeaders)
297 include(CheckIncludeFileCXX)
298 include(TestForSTDNamespace)
299 include(TestForANSIForScope)
300
301
302 CMakeDependentOption
303 Macro to provide an option dependent on other options.
304
305 This macro presents an option to the user only if a set of other
306 conditions are true. When the option is not presented a default
307 value is used, but any value set by the user is preserved for
308 when the option is presented again. Example invocation:
309
310
311 CMAKE_DEPENDENT_OPTION(USE_FOO "Use Foo" ON
312 "USE_BAR;NOT USE_ZOT" OFF)
313
314 If USE_BAR is true and USE_ZOT is false, this provides an option
315 called USE_FOO that defaults to ON. Otherwise, it sets USE_FOO
316 to OFF. If the status of USE_BAR or USE_ZOT ever changes, any
317 value for the USE_FOO option is saved so that when the option is
318 re-enabled it retains its old value.
319
320
321 CMakeDetermineVSServicePack
322 Determine the Visual Studio service pack of the 'cl' in use.
323
324 The functionality of this module has been superseded by the
325 platform variable CMAKE_<LANG>_COMPILER_VERSION that contains
326 the compiler version number.
327
328
329 Usage:
330
331
332 if(MSVC)
333 include(CMakeDetermineVSServicePack)
334 DetermineVSServicePack( my_service_pack )
335 if( my_service_pack )
336 message(STATUS "Detected: ${my_service_pack}")
337 endif()
338 endif()
339
340 Function DetermineVSServicePack sets the given variable to one
341 of the following values or an empty string if unknown:
342
343
344 vc80, vc80sp1
345 vc90, vc90sp1
346 vc100, vc100sp1
347 vc110, vc110sp1, vc110sp2
348
349
350 CMakeExpandImportedTargets
351
352
353 CMAKE_EXPAND_IMPORTED_TARGETS(<var> LIBRARIES lib1 lib2...libN
354
355
356 [CONFIGURATION <config>] )
357
358
359
360
361 CMAKE_EXPAND_IMPORTED_TARGETS() takes a list of libraries and
362 replaces all imported targets contained in this list with their
363 actual file paths of the referenced libraries on disk, including
364 the libraries from their link interfaces. If a CONFIGURATION is
365 given, it uses the respective configuration of the imported tar‐
366 gets if it exists. If no CONFIGURATION is given, it uses the
367 first configuration from ${CMAKE_CONFIGURATION_TYPES} if set,
368 otherwise ${CMAKE_BUILD_TYPE}. This macro is used by all
369 Check*.cmake files which use try_compile() or try_run() and sup‐
370 port CMAKE_REQUIRED_LIBRARIES , so that these checks support
371 imported targets in CMAKE_REQUIRED_LIBRARIES:
372
373
374 cmake_expand_imported_targets(expandedLibs LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
375 CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}" )
376
377
378 CMakeFindFrameworks
379 helper module to find OSX frameworks
380
381
382 CMakeFindPackageMode
383
384
385 This file is executed by cmake when invoked with --find-package.
386 It expects that the following variables are set using -D:
387
388
389 NAME = name of the package
390 COMPILER_ID = the CMake compiler ID for which the result is, i.e. GNU/Intel/Clang/MSVC, etc.
391 LANGUAGE = language for which the result will be used, i.e. C/CXX/Fortan/ASM
392 MODE = EXIST : only check for existence of the given package
393 COMPILE : print the flags needed for compiling an object file which uses the given package
394 LINK : print the flags needed for linking when using the given package
395 QUIET = if TRUE, don't print anything
396
397
398 CMakeForceCompiler
399
400
401 This module defines macros intended for use by cross-compiling
402 toolchain files when CMake is not able to automatically detect
403 the compiler identification.
404
405
406 Macro CMAKE_FORCE_C_COMPILER has the following signature:
407
408
409 CMAKE_FORCE_C_COMPILER(<compiler> <compiler-id>)
410
411 It sets CMAKE_C_COMPILER to the given compiler and the cmake
412 internal variable CMAKE_C_COMPILER_ID to the given compiler-id.
413 It also bypasses the check for working compiler and basic com‐
414 piler information tests.
415
416
417 Macro CMAKE_FORCE_CXX_COMPILER has the following signature:
418
419
420 CMAKE_FORCE_CXX_COMPILER(<compiler> <compiler-id>)
421
422 It sets CMAKE_CXX_COMPILER to the given compiler and the cmake
423 internal variable CMAKE_CXX_COMPILER_ID to the given com‐
424 piler-id. It also bypasses the check for working compiler and
425 basic compiler information tests.
426
427
428 Macro CMAKE_FORCE_Fortran_COMPILER has the following signature:
429
430
431 CMAKE_FORCE_Fortran_COMPILER(<compiler> <compiler-id>)
432
433 It sets CMAKE_Fortran_COMPILER to the given compiler and the
434 cmake internal variable CMAKE_Fortran_COMPILER_ID to the given
435 compiler-id. It also bypasses the check for working compiler and
436 basic compiler information tests.
437
438
439 So a simple toolchain file could look like this:
440
441
442 include (CMakeForceCompiler)
443 set(CMAKE_SYSTEM_NAME Generic)
444 CMAKE_FORCE_C_COMPILER (chc12 MetrowerksHicross)
445 CMAKE_FORCE_CXX_COMPILER (chc12 MetrowerksHicross)
446
447
448 CMakeGraphVizOptions
449 The builtin graphviz support of CMake.
450
451 CMake can generate graphviz files, showing the dependencies
452 between the targets in a project and also external libraries
453 which are linked against. When CMake is run with the --gra‐
454 phiz=foo option, it will produce
455
456
457 * a foo.dot file showing all dependencies in the project
458 * a foo.dot.<target> file for each target, file showing on which other targets the respective target depends
459 * a foo.dot.<target>.dependers file, showing which other targets depend on the respective target
460
461
462
463
464 This can result in huge graphs. Using the file CMakeGraphVizOp‐
465 tions.cmake the look and content of the generated graphs can be
466 influenced. This file is searched first in ${CMAKE_BINARY_DIR}
467 and then in ${CMAKE_SOURCE_DIR}. If found, it is read and the
468 variables set in it are used to adjust options for the generated
469 graphviz files.
470
471
472 GRAPHVIZ_GRAPH_TYPE - The graph type
473 Mandatory : NO
474 Default : "digraph"
475 GRAPHVIZ_GRAPH_NAME - The graph name.
476 Mandatory : NO
477 Default : "GG"
478 GRAPHVIZ_GRAPH_HEADER - The header written at the top of the graphviz file.
479 Mandatory : NO
480 Default : "node [n fontsize = "12"];"
481 GRAPHVIZ_NODE_PREFIX - The prefix for each node in the graphviz file.
482 Mandatory : NO
483 Default : "node"
484 GRAPHVIZ_EXECUTABLES - Set this to FALSE to exclude executables from the generated graphs.
485 Mandatory : NO
486 Default : TRUE
487 GRAPHVIZ_STATIC_LIBS - Set this to FALSE to exclude static libraries from the generated graphs.
488 Mandatory : NO
489 Default : TRUE
490 GRAPHVIZ_SHARED_LIBS - Set this to FALSE to exclude shared libraries from the generated graphs.
491 Mandatory : NO
492 Default : TRUE
493 GRAPHVIZ_MODULE_LIBS - Set this to FALSE to exclude static libraries from the generated graphs.
494 Mandatory : NO
495 Default : TRUE
496 GRAPHVIZ_EXTERNAL_LIBS - Set this to FALSE to exclude external libraries from the generated graphs.
497 Mandatory : NO
498 Default : TRUE
499 GRAPHVIZ_IGNORE_TARGETS - A list of regular expressions for ignoring targets.
500 Mandatory : NO
501 Default : empty
502
503
504 CMakePackageConfigHelpers
505 CONFIGURE_PACKAGE_CONFIG_FILE(), WRITE_BASIC_PACKAGE_VER‐
506 SION_FILE()
507
508
509
510
511 CONFIGURE_PACKAGE_CONFIG_FILE(<input> <output> INSTALL_DESTINATION <path>
512 [PATH_VARS <var1> <var2> ... <varN>]
513 [NO_SET_AND_CHECK_MACRO]
514 [NO_CHECK_REQUIRED_COMPONENTS_MACRO])
515
516
517
518
519 CONFIGURE_PACKAGE_CONFIG_FILE() should be used instead of the
520 plain configure_file() command when creating the <Name>Con‐
521 fig.cmake or <Name>-config.cmake file for installing a project
522 or library. It helps making the resulting package relocatable by
523 avoiding hardcoded paths in the installed Config.cmake file.
524
525
526 In a FooConfig.cmake file there may be code like this to make
527 the install destinations know to the using project:
528
529
530 set(FOO_INCLUDE_DIR "@CMAKE_INSTALL_FULL_INCLUDEDIR@" )
531 set(FOO_DATA_DIR "@CMAKE_INSTALL_PREFIX@/@RELATIVE_DATA_INSTALL_DIR@" )
532 set(FOO_ICONS_DIR "@CMAKE_INSTALL_PREFIX@/share/icons" )
533 ...logic to determine installedPrefix from the own location...
534 set(FOO_CONFIG_DIR "${installedPrefix}/@CONFIG_INSTALL_DIR@" )
535
536 All 4 options shown above are not sufficient, since the first 3
537 hardcode the absolute directory locations, and the 4th case
538 works only if the logic to determine the installedPrefix is cor‐
539 rect, and if CONFIG_INSTALL_DIR contains a relative path, which
540 in general cannot be guaranteed. This has the effect that the
541 resulting FooConfig.cmake file would work poorly under Windows
542 and OSX, where users are used to choose the install location of
543 a binary package at install time, independent from how
544 CMAKE_INSTALL_PREFIX was set at build/cmake time.
545
546
547 Using CONFIGURE_PACKAGE_CONFIG_FILE() helps. If used correctly,
548 it makes the resulting FooConfig.cmake file relocatable. Usage:
549
550
551 1. write a FooConfig.cmake.in file as you are used to
552 2. insert a line containing only the string "@PACKAGE_INIT@"
553 3. instead of set(FOO_DIR "@SOME_INSTALL_DIR@"), use set(FOO_DIR "@PACKAGE_SOME_INSTALL_DIR@")
554 (this must be after the @PACKAGE_INIT@ line)
555 4. instead of using the normal configure_file(), use CONFIGURE_PACKAGE_CONFIG_FILE()
556
557
558
559
560 The <input> and <output> arguments are the input and output
561 file, the same way as in configure_file().
562
563
564 The <path> given to INSTALL_DESTINATION must be the destination
565 where the FooConfig.cmake file will be installed to. This can
566 either be a relative or absolute path, both work.
567
568
569 The variables <var1> to <varN> given as PATH_VARS are the vari‐
570 ables which contain install destinations. For each of them the
571 macro will create a helper variable PACKAGE_<var...>. These
572 helper variables must be used in the FooConfig.cmake.in file for
573 setting the installed location. They are calculated by CONFIG‐
574 URE_PACKAGE_CONFIG_FILE() so that they are always relative to
575 the installed location of the package. This works both for rela‐
576 tive and also for absolute locations. For absolute locations it
577 works only if the absolute location is a subdirectory of
578 CMAKE_INSTALL_PREFIX.
579
580
581 By default configure_package_config_file() also generates two
582 helper macros, set_and_check() and check_required_components()
583 into the FooConfig.cmake file.
584
585
586 set_and_check() should be used instead of the normal set() com‐
587 mand for setting directories and file locations. Additionally to
588 setting the variable it also checks that the referenced file or
589 directory actually exists and fails with a FATAL_ERROR other‐
590 wise. This makes sure that the created FooConfig.cmake file does
591 not contain wrong references. When using the
592 NO_SET_AND_CHECK_MACRO, this macro is not generated into the
593 FooConfig.cmake file.
594
595
596 check_required_components(<package_name>) should be called at
597 the end of the FooConfig.cmake file if the package supports com‐
598 ponents. This macro checks whether all requested, non-optional
599 components have been found, and if this is not the case, sets
600 the Foo_FOUND variable to FALSE, so that the package is consid‐
601 ered to be not found. It does that by testing the Foo_<Compo‐
602 nent>_FOUND variables for all requested required components.
603 When using the NO_CHECK_REQUIRED_COMPONENTS option, this macro
604 is not generated into the FooConfig.cmake file.
605
606
607 For an example see below the documentation for WRITE_BASIC_PACK‐
608 AGE_VERSION_FILE().
609
610
611
612
613
614 WRITE_BASIC_PACKAGE_VERSION_FILE( filename VERSION major.minor.patch COMPATIBILITY (AnyNewerVersion|SameMajorVersion|ExactVersion) )
615
616
617
618
619 Writes a file for use as <package>ConfigVersion.cmake file to
620 <filename>. See the documentation of find_package() for details
621 on this.
622
623
624 filename is the output filename, it should be in the build tree.
625 major.minor.patch is the version number of the project to be installed
626
627 The COMPATIBILITY mode AnyNewerVersion means that the installed
628 package version will be considered compatible if it is newer or
629 exactly the same as the requested version. This mode should be
630 used for packages which are fully backward compatible, also
631 across major versions. If SameMajorVersion is used instead, then
632 the behaviour differs from AnyNewerVersion in that the major
633 version number must be the same as requested, e.g. version 2.0
634 will not be considered compatible if 1.0 is requested. This mode
635 should be used for packages which guarantee backward compatibil‐
636 ity within the same major version. If ExactVersion is used, then
637 the package is only considered compatible if the requested ver‐
638 sion matches exactly its own version number (not considering the
639 tweak version). For example, version 1.2.3 of a package is only
640 considered compatible to requested version 1.2.3. This mode is
641 for packages without compatibility guarantees. If your project
642 has more elaborated version matching rules, you will need to
643 write your own custom ConfigVersion.cmake file instead of using
644 this macro.
645
646
647 Internally, this macro executes configure_file() to create the
648 resulting version file. Depending on the COMPATIBLITY, either
649 the file BasicConfigVersion-SameMajorVersion.cmake.in or Basic‐
650 ConfigVersion-AnyNewerVersion.cmake.in is used. Please note that
651 these two files are internal to CMake and you should not call
652 configure_file() on them yourself, but they can be used as
653 starting point to create more sophisticted custom ConfigVer‐
654 sion.cmake files.
655
656
657
658
659
660 Example using both configure_package_config_file() and
661 write_basic_package_version_file(): CMakeLists.txt:
662
663
664 set(INCLUDE_INSTALL_DIR include/ ... CACHE )
665 set(LIB_INSTALL_DIR lib/ ... CACHE )
666 set(SYSCONFIG_INSTALL_DIR etc/foo/ ... CACHE )
667 ...
668 include(CMakePackageConfigHelpers)
669 configure_package_config_file(FooConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake
670 INSTALL_DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake
671 PATH_VARS INCLUDE_INSTALL_DIR SYSCONFIG_INSTALL_DIR)
672 write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
673 VERSION 1.2.3
674 COMPATIBILITY SameMajorVersion )
675 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
676 DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake )
677
678
679
680
681 With a FooConfig.cmake.in:
682
683
684 set(FOO_VERSION x.y.z)
685 ...
686 @PACKAGE_INIT@
687 ...
688 set_and_check(FOO_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
689 set_and_check(FOO_SYSCONFIG_DIR "@PACKAGE_SYSCONFIG_INSTALL_DIR@")
690
691
692
693
694 check_required_components(Foo)
695
696
697 CMakeParseArguments
698
699
700 CMAKE_PARSE_ARGUMENTS(<prefix> <options> <one_value_keywords>
701 <multi_value_keywords> args...)
702
703
704 CMAKE_PARSE_ARGUMENTS() is intended to be used in macros or
705 functions for parsing the arguments given to that macro or func‐
706 tion. It processes the arguments and defines a set of variables
707 which hold the values of the respective options.
708
709
710 The <options> argument contains all options for the respective
711 macro, i.e. keywords which can be used when calling the macro
712 without any value following, like e.g. the OPTIONAL keyword of
713 the install() command.
714
715
716 The <one_value_keywords> argument contains all keywords for this
717 macro which are followed by one value, like e.g. DESTINATION
718 keyword of the install() command.
719
720
721 The <multi_value_keywords> argument contains all keywords for
722 this macro which can be followed by more than one value, like
723 e.g. the TARGETS or FILES keywords of the install() command.
724
725
726 When done, CMAKE_PARSE_ARGUMENTS() will have defined for each of
727 the keywords listed in <options>, <one_value_keywords> and
728 <multi_value_keywords> a variable composed of the given <prefix>
729 followed by "_" and the name of the respective keyword. These
730 variables will then hold the respective value from the argument
731 list. For the <options> keywords this will be TRUE or FALSE.
732
733
734 All remaining arguments are collected in a variable <pre‐
735 fix>_UNPARSED_ARGUMENTS, this can be checked afterwards to see
736 whether your macro was called with unrecognized parameters.
737
738
739 As an example here a my_install() macro, which takes similar
740 arguments as the real install() command:
741
742
743 function(MY_INSTALL)
744 set(options OPTIONAL FAST)
745 set(oneValueArgs DESTINATION RENAME)
746 set(multiValueArgs TARGETS CONFIGURATIONS)
747 cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
748 ...
749
750
751
752
753 Assume my_install() has been called like this:
754
755
756 my_install(TARGETS foo bar DESTINATION bin OPTIONAL blub)
757
758
759
760
761 After the cmake_parse_arguments() call the macro will have set
762 the following variables:
763
764
765 MY_INSTALL_OPTIONAL = TRUE
766 MY_INSTALL_FAST = FALSE (this option was not used when calling my_install()
767 MY_INSTALL_DESTINATION = "bin"
768 MY_INSTALL_RENAME = "" (was not used)
769 MY_INSTALL_TARGETS = "foo;bar"
770 MY_INSTALL_CONFIGURATIONS = "" (was not used)
771 MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (no value expected after "OPTIONAL"
772
773
774
775
776 You can then continue and process these variables.
777
778
779 Keywords terminate lists of values, e.g. if directly after a
780 one_value_keyword another recognized keyword follows, this is
781 interpreted as the beginning of the new option. E.g.
782 my_install(TARGETS foo DESTINATION OPTIONAL) would result in
783 MY_INSTALL_DESTINATION set to "OPTIONAL", but MY_INSTALL_DESTI‐
784 NATION would be empty and MY_INSTALL_OPTIONAL would be set to
785 TRUE therefor.
786
787
788 CMakePrintHelpers
789 Convenience macros for printing properties and variables, useful
790 e.g. for debugging.
791
792
793
794
795
796
797
798 CMAKE_PRINT_PROPERTIES([TARGETS target1 .. targetN]
799
800
801 [SOURCES source1 .. sourceN]
802 [DIRECTORIES dir1 .. dirN]
803 [TESTS test1 .. testN]
804 [CACHE_ENTRIES entry1 .. entryN]
805 PROPERTIES prop1 .. propN )
806
807
808
809
810 This macro prints the values of the properties of the given tar‐
811 gets, source files, directories, tests or cache entries. Exactly
812 one of the scope keywords must be used. Example:
813
814
815 cmake_print_properties(TARGETS foo bar PROPERTIES LOCATION INTERFACE_INCLUDE_DIRS)
816
817 This will print the LOCATION and INTERFACE_INCLUDE_DIRS proper‐
818 ties for both targets foo and bar.
819
820
821
822
823
824 CMAKE_PRINT_VARIABLES(var1 var2 .. varN)
825
826
827 This macro will print the name of each variable followed by its
828 value. Example:
829
830
831 cmake_print_variables(CMAKE_C_COMPILER CMAKE_MAJOR_VERSION THIS_ONE_DOES_NOT_EXIST)
832
833 Gives:
834
835
836 -- CMAKE_C_COMPILER="/usr/bin/gcc" ; CMAKE_MAJOR_VERSION="2" ; THIS_ONE_DOES_NOT_EXIST=""
837
838
839 CMakePrintSystemInformation
840 print system information
841
842 This file can be used for diagnostic purposes just include it in
843 a project to see various internal CMake variables.
844
845
846 CMakePushCheckState
847
848
849 This module defines three macros: CMAKE_PUSH_CHECK_STATE()
850 CMAKE_POP_CHECK_STATE() and CMAKE_RESET_CHECK_STATE() These
851 macros can be used to save, restore and reset (i.e., clear con‐
852 tents) the state of the variables CMAKE_REQUIRED_FLAGS,
853 CMAKE_REQUIRED_DEFINITIONS, CMAKE_REQUIRED_LIBRARIES and
854 CMAKE_REQUIRED_INCLUDES used by the various Check-files coming
855 with CMake, like e.g. check_function_exists() etc. The variable
856 contents are pushed on a stack, pushing multiple times is sup‐
857 ported. This is useful e.g. when executing such tests in a
858 Find-module, where they have to be set, but after the Find-mod‐
859 ule has been executed they should have the same value as they
860 had before.
861
862
863 CMAKE_PUSH_CHECK_STATE() macro receives optional argument RESET.
864 Whether it's specified, CMAKE_PUSH_CHECK_STATE() will set all
865 CMAKE_REQUIRED_* variables to empty values, same as
866 CMAKE_RESET_CHECK_STATE() call will do.
867
868
869 Usage:
870
871
872 cmake_push_check_state(RESET)
873 set(CMAKE_REQUIRED_DEFINITIONS -DSOME_MORE_DEF)
874 check_function_exists(...)
875 cmake_reset_check_state()
876 set(CMAKE_REQUIRED_DEFINITIONS -DANOTHER_DEF)
877 check_function_exists(...)
878 cmake_pop_check_state()
879
880
881 CMakeVerifyManifest
882
883
884 CMakeVerifyManifest.cmake
885
886
887 This script is used to verify that embeded manifests and side by
888 side manifests for a project match. To run this script, cd to a
889 directory and run the script with cmake -P. On the command line
890 you can pass in versions that are OK even if not found in the
891 .manifest files. For example, cmake -Dallow_versions=8.0.50608.0
892 -PCmakeVerifyManifest.cmake could be used to allow an embeded
893 manifest of 8.0.50608.0 to be used in a project even if that
894 version was not found in the .manifest file.
895
896
897 CPack Build binary and source package installers.
898
899 The CPack module generates binary and source installers in a
900 variety of formats using the cpack program. Inclusion of the
901 CPack module adds two new targets to the resulting makefiles,
902 package and package_source, which build the binary and source
903 installers, respectively. The generated binary installers con‐
904 tain everything installed via CMake's INSTALL command (and the
905 deprecated INSTALL_FILES, INSTALL_PROGRAMS, and INSTALL_TARGETS
906 commands).
907
908
909 For certain kinds of binary installers (including the graphical
910 installers on Mac OS X and Windows), CPack generates installers
911 that allow users to select individual application components to
912 install. See CPackComponent module for that.
913
914
915 The CPACK_GENERATOR variable has different meanings in different
916 contexts. In your CMakeLists.txt file, CPACK_GENERATOR is a
917 *list of generators*: when run with no other arguments, CPack
918 will iterate over that list and produce one package for each
919 generator. In a CPACK_PROJECT_CONFIG_FILE, though, CPACK_GENERA‐
920 TOR is a *string naming a single generator*. If you need
921 per-cpack- generator logic to control *other* cpack settings,
922 then you need a CPACK_PROJECT_CONFIG_FILE.
923
924
925 The CMake source tree itself contains a CPACK_PROJECT_CON‐
926 FIG_FILE. See the top level file CMakeCPackOptions.cmake.in for
927 an example.
928
929
930 If set, the CPACK_PROJECT_CONFIG_FILE is included automatically
931 on a per-generator basis. It only need contain overrides.
932
933
934 Here's how it works:
935
936
937 - cpack runs
938 - it includes CPackConfig.cmake
939 - it iterates over the generators listed in that file's
940 CPACK_GENERATOR list variable (unless told to use just a
941 specific one via -G on the command line...)
942
943
944
945
946 - foreach generator, it then
947 - sets CPACK_GENERATOR to the one currently being iterated
948 - includes the CPACK_PROJECT_CONFIG_FILE
949 - produces the package for that generator
950
951
952
953
954 This is the key: For each generator listed in CPACK_GENERATOR in
955 CPackConfig.cmake, cpack will *reset* CPACK_GENERATOR internally
956 to *the one currently being used* and then include the
957 CPACK_PROJECT_CONFIG_FILE.
958
959
960 Before including this CPack module in your CMakeLists.txt file,
961 there are a variety of variables that can be set to customize
962 the resulting installers. The most commonly-used variables are:
963
964
965 CPACK_PACKAGE_NAME - The name of the package (or application). If
966 not specified, defaults to the project name.
967
968
969
970
971 CPACK_PACKAGE_VENDOR - The name of the package vendor. (e.g.,
972 "Kitware").
973
974
975
976
977 CPACK_PACKAGE_DIRECTORY - The directory in which CPack is doing its
978 packaging. If it is not set then this will default (internally) to the
979 build dir. This variable may be defined in CPack config file or from
980 the cpack command line option "-B". If set the command line option
981 override the value found in the config file.
982
983
984
985
986 CPACK_PACKAGE_VERSION_MAJOR - Package major Version
987
988
989
990
991 CPACK_PACKAGE_VERSION_MINOR - Package minor Version
992
993
994
995
996 CPACK_PACKAGE_VERSION_PATCH - Package patch Version
997
998
999
1000
1001 CPACK_PACKAGE_DESCRIPTION_FILE - A text file used to describe the
1002 project. Used, for example, the introduction screen of a
1003 CPack-generated Windows installer to describe the project.
1004
1005
1006
1007
1008 CPACK_PACKAGE_DESCRIPTION_SUMMARY - Short description of the
1009 project (only a few words).
1010
1011
1012
1013
1014 CPACK_PACKAGE_FILE_NAME - The name of the package file to generate,
1015 not including the extension. For example, cmake-2.6.1-Linux-i686.
1016 The default value is
1017
1018
1019
1020
1021 ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}.
1022
1023
1024
1025
1026 CPACK_PACKAGE_INSTALL_DIRECTORY - Installation directory on the
1027 target system. This may be used by some CPack generators
1028 like NSIS to create an installation directory e.g., "CMake 2.5"
1029 below the installation prefix. All installed element will be
1030 put inside this directory.
1031
1032
1033
1034
1035 CPACK_PACKAGE_ICON - A branding image that will be displayed inside
1036 the installer (used by GUI installers).
1037
1038
1039
1040
1041 CPACK_PROJECT_CONFIG_FILE - CPack-time project CPack configuration
1042 file. This file included at cpack time, once per
1043 generator after CPack has set CPACK_GENERATOR to the actual generator
1044 being used. It allows per-generator setting of CPACK_* variables at
1045 cpack time.
1046
1047
1048
1049
1050 CPACK_RESOURCE_FILE_LICENSE - License to be embedded in the installer. It
1051 will typically be displayed to the user by the produced installer
1052 (often with an explicit "Accept" button, for graphical installers)
1053 prior to installation. This license file is NOT added to installed
1054 file but is used by some CPack generators like NSIS. If you want
1055 to install a license file (may be the same as this one)
1056 along with your project you must add an appropriate CMake INSTALL
1057 command in your CMakeLists.txt.
1058
1059
1060
1061
1062 CPACK_RESOURCE_FILE_README - ReadMe file to be embedded in the installer. It
1063 typically describes in some detail the purpose of the project
1064 during the installation. Not all CPack generators uses
1065 this file.
1066
1067
1068
1069
1070 CPACK_RESOURCE_FILE_WELCOME - Welcome file to be embedded in the
1071 installer. It welcomes users to this installer.
1072 Typically used in the graphical installers on Windows and Mac OS X.
1073
1074
1075
1076
1077 CPACK_MONOLITHIC_INSTALL - Disables the component-based
1078 installation mechanism. When set the component specification is ignored
1079 and all installed items are put in a single "MONOLITHIC" package.
1080 Some CPack generators do monolithic packaging by default and
1081 may be asked to do component packaging by setting
1082 CPACK_<GENNAME>_COMPONENT_INSTALL to 1/TRUE.
1083
1084
1085
1086
1087 CPACK_GENERATOR - List of CPack generators to use. If not
1088 specified, CPack will create a set of options CPACK_BINARY_<GENNAME> (e.g.,
1089 CPACK_BINARY_NSIS) allowing the user to enable/disable individual
1090 generators. This variable may be used on the command line
1091 as well as in:
1092
1093
1094
1095
1096 cpack -D CPACK_GENERATOR="ZIP;TGZ" /path/to/build/tree
1097
1098
1099
1100
1101 CPACK_OUTPUT_CONFIG_FILE - The name of the CPack binary configuration
1102 file. This file is the CPack configuration generated by the CPack module
1103 for binary installers. Defaults to CPackConfig.cmake.
1104
1105
1106
1107
1108 CPACK_PACKAGE_EXECUTABLES - Lists each of the executables and associated
1109 text label to be used to create Start Menu shortcuts. For example,
1110 setting this to the list ccmake;CMake will
1111 create a shortcut named "CMake" that will execute the installed
1112 executable ccmake. Not all CPack generators use it (at least NSIS and
1113 OSXX11 do).
1114
1115
1116
1117
1118 CPACK_STRIP_FILES - List of files to be stripped. Starting with
1119 CMake 2.6.0 CPACK_STRIP_FILES will be a boolean variable which
1120 enables stripping of all files (a list of files evaluates to TRUE
1121 in CMake, so this change is compatible).
1122
1123
1124
1125
1126 The following CPack variables are specific to source packages,
1127 and will not affect binary packages:
1128
1129
1130 CPACK_SOURCE_PACKAGE_FILE_NAME - The name of the source package. For
1131 example cmake-2.6.1.
1132
1133
1134
1135
1136 CPACK_SOURCE_STRIP_FILES - List of files in the source tree that
1137 will be stripped. Starting with CMake 2.6.0
1138 CPACK_SOURCE_STRIP_FILES will be a boolean variable which enables
1139 stripping of all files (a list of files evaluates to TRUE in CMake,
1140 so this change is compatible).
1141
1142
1143
1144
1145 CPACK_SOURCE_GENERATOR - List of generators used for the source
1146 packages. As with CPACK_GENERATOR, if this is not specified then
1147 CPack will create a set of options (e.g., CPACK_SOURCE_ZIP)
1148 allowing users to select which packages will be generated.
1149
1150
1151
1152
1153 CPACK_SOURCE_OUTPUT_CONFIG_FILE - The name of the CPack source
1154 configuration file. This file is the CPack configuration generated by the
1155 CPack module for source installers. Defaults to CPackSourceConfig.cmake.
1156
1157
1158
1159
1160 CPACK_SOURCE_IGNORE_FILES - Pattern of files in the source tree
1161 that won't be packaged when building a source package. This is a
1162 list of regular expression patterns (that must be properly escaped),
1163 e.g., /CVS/;/\\.svn/;\\.swp$;\\.#;/#;.*~;cscope.*
1164
1165
1166
1167
1168 The following variables are for advanced uses of CPack:
1169
1170
1171 CPACK_CMAKE_GENERATOR - What CMake generator should be used if the
1172 project is CMake project. Defaults to the value of CMAKE_GENERATOR
1173 few users will want to change this setting.
1174
1175
1176
1177
1178 CPACK_INSTALL_CMAKE_PROJECTS - List of four values that specify
1179 what project to install. The four values are: Build directory,
1180 Project Name, Project Component, Directory. If omitted, CPack will
1181 build an installer that installers everything.
1182
1183
1184
1185
1186 CPACK_SYSTEM_NAME - System name, defaults to the value of
1187 ${CMAKE_SYSTEM_NAME}.
1188
1189
1190
1191
1192 CPACK_PACKAGE_VERSION - Package full version, used internally. By
1193 default, this is built from CPACK_PACKAGE_VERSION_MAJOR,
1194 CPACK_PACKAGE_VERSION_MINOR, and CPACK_PACKAGE_VERSION_PATCH.
1195
1196
1197
1198
1199 CPACK_TOPLEVEL_TAG - Directory for the installed files.
1200
1201
1202
1203
1204 CPACK_INSTALL_COMMANDS - Extra commands to install components.
1205
1206
1207
1208
1209 CPACK_INSTALLED_DIRECTORIES - Extra directories to install.
1210
1211
1212
1213
1214 CPACK_PACKAGE_INSTALL_REGISTRY_KEY - Registry key used when
1215 installing this project. This is only used by installer for Windows.
1216 The default value is based on the installation directory.
1217 CPACK_CREATE_DESKTOP_LINKS - List of desktop links to create.
1218
1219
1220
1221
1222
1223 CPackBundle
1224 CPack Bundle generator (Mac OS X) specific options
1225
1226
1227
1228
1229 Installers built on Mac OS X using the Bundle generator use the
1230 aforementioned DragNDrop (CPACK_DMG_xxx) variables, plus the
1231 following Bundle-specific parameters (CPACK_BUNDLE_xxx).
1232
1233
1234 CPACK_BUNDLE_NAME - The name of the generated bundle. This
1235 appears in the OSX finder as the bundle name. Required.
1236
1237
1238
1239
1240 CPACK_BUNDLE_PLIST - Path to an OSX plist file that will be used
1241 for the generated bundle. This assumes that the caller has generated
1242 or specified their own Info.plist file. Required.
1243
1244
1245
1246
1247 CPACK_BUNDLE_ICON - Path to an OSX icon file that will be used as
1248 the icon for the generated bundle. This is the icon that appears in the
1249 OSX finder for the bundle, and in the OSX dock when the bundle is opened.
1250 Required.
1251
1252
1253
1254
1255 CPACK_BUNDLE_STARTUP_COMMAND - Path to a startup script. This is a path to
1256 an executable or script that will be run whenever an end-user double-clicks
1257 the generated bundle in the OSX Finder. Optional.
1258
1259
1260 CPackComponent
1261 Build binary and source package installers
1262
1263
1264
1265
1266 The CPackComponent module is the module which handles the compo‐
1267 nent part of CPack. See CPack module for general information
1268 about CPack.
1269
1270
1271 For certain kinds of binary installers (including the graphical
1272 installers on Mac OS X and Windows), CPack generates installers
1273 that allow users to select individual application components to
1274 install. The contents of each of the components are identified
1275 by the COMPONENT argument of CMake's INSTALL command. These com‐
1276 ponents can be annotated with user-friendly names and descrip‐
1277 tions, inter-component dependencies, etc., and grouped in vari‐
1278 ous ways to customize the resulting installer. See the
1279 cpack_add_* commands, described below, for more information
1280 about component-specific installations.
1281
1282
1283 Component-specific installation allows users to select specific
1284 sets of components to install during the install process.
1285 Installation components are identified by the COMPONENT argument
1286 of CMake's INSTALL commands, and should be further described by
1287 the following CPack commands:
1288
1289
1290 CPACK_COMPONENTS_ALL - The list of component to install.
1291
1292
1293
1294
1295 The default value of this variable is computed by CPack and con‐
1296 tains all components defined by the project. The user may set it
1297 to only include the specified components.
1298
1299
1300 CPACK_<GENNAME>_COMPONENT_INSTALL - Enable/Disable component install for
1301 CPack generator <GENNAME>.
1302
1303
1304
1305
1306 Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has
1307 a legacy default behavior. e.g. RPM builds monolithic whereas
1308 NSIS builds component. One can change the default behavior by
1309 setting this variable to 0/1 or OFF/ON.
1310
1311
1312 CPACK_COMPONENTS_GROUPING - Specify how components are grouped for multi-package
1313 component-aware CPack generators.
1314
1315
1316
1317
1318 Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) gen‐
1319 erates several packages files when asked for component packag‐
1320 ing. They group the component differently depending on the value
1321 of this variable:
1322
1323
1324 - ONE_PER_GROUP (default): creates one package file per component group
1325 - ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component
1326 - IGNORE : creates one package per component, i.e. IGNORE component group
1327
1328 One can specify different grouping for different CPack generator
1329 by using a CPACK_PROJECT_CONFIG_FILE.
1330
1331
1332 CPACK_COMPONENT_<compName>_DISPLAY_NAME - The name to be displayed for a component.
1333 CPACK_COMPONENT_<compName>_DESCRIPTION - The description of a component.
1334 CPACK_COMPONENT_<compName>_GROUP - The group of a component.
1335 CPACK_COMPONENT_<compName>_DEPENDS - The dependencies (list of components)
1336 on which this component depends.
1337 CPACK_COMPONENT_<compName>_REQUIRED - True is this component is required.
1338
1339 cpack_add_component - Describes a CPack installation component
1340 named by the COMPONENT argument to a CMake INSTALL command.
1341
1342
1343 cpack_add_component(compname
1344 [DISPLAY_NAME name]
1345 [DESCRIPTION description]
1346 [HIDDEN | REQUIRED | DISABLED ]
1347 [GROUP group]
1348 [DEPENDS comp1 comp2 ... ]
1349 [INSTALL_TYPES type1 type2 ... ]
1350 [DOWNLOADED]
1351 [ARCHIVE_FILE filename])
1352
1353
1354
1355
1356 The cmake_add_component command describes an installation compo‐
1357 nent, which the user can opt to install or remove as part of the
1358 graphical installation process. compname is the name of the com‐
1359 ponent, as provided to the COMPONENT argument of one or more
1360 CMake INSTALL commands.
1361
1362
1363 DISPLAY_NAME is the displayed name of the component, used in
1364 graphical installers to display the component name. This value
1365 can be any string.
1366
1367
1368 DESCRIPTION is an extended description of the component, used in
1369 graphical installers to give the user additional information
1370 about the component. Descriptions can span multiple lines using
1371 "\n" as the line separator. Typically, these descriptions should
1372 be no more than a few lines long.
1373
1374
1375 HIDDEN indicates that this component will be hidden in the
1376 graphical installer, so that the user cannot directly change
1377 whether it is installed or not.
1378
1379
1380 REQUIRED indicates that this component is required, and there‐
1381 fore will always be installed. It will be visible in the graphi‐
1382 cal installer, but it cannot be unselected. (Typically, required
1383 components are shown greyed out).
1384
1385
1386 DISABLED indicates that this component should be disabled (unse‐
1387 lected) by default. The user is free to select this component
1388 for installation, unless it is also HIDDEN.
1389
1390
1391 DEPENDS lists the components on which this component depends. If
1392 this component is selected, then each of the components listed
1393 must also be selected. The dependency information is encoded
1394 within the installer itself, so that users cannot install incon‐
1395 sistent sets of components.
1396
1397
1398 GROUP names the component group of which this component is a
1399 part. If not provided, the component will be a standalone compo‐
1400 nent, not part of any component group. Component groups are
1401 described with the cpack_add_component_group command, detailed
1402 below.
1403
1404
1405 INSTALL_TYPES lists the installation types of which this compo‐
1406 nent is a part. When one of these installations types is
1407 selected, this component will automatically be selected. Instal‐
1408 lation types are described with the cpack_add_install_type com‐
1409 mand, detailed below.
1410
1411
1412 DOWNLOADED indicates that this component should be downloaded
1413 on-the-fly by the installer, rather than packaged in with the
1414 installer itself. For more information, see the cpack_config‐
1415 ure_downloads command.
1416
1417
1418 ARCHIVE_FILE provides a name for the archive file created by
1419 CPack to be used for downloaded components. If not supplied,
1420 CPack will create a file with some name based on CPACK_PACK‐
1421 AGE_FILE_NAME and the name of the component. See cpack_config‐
1422 ure_downloads for more information.
1423
1424
1425 cpack_add_component_group - Describes a group of related CPack
1426 installation components.
1427
1428
1429 cpack_add_component_group(groupname
1430 [DISPLAY_NAME name]
1431 [DESCRIPTION description]
1432 [PARENT_GROUP parent]
1433 [EXPANDED]
1434 [BOLD_TITLE])
1435
1436
1437
1438
1439 The cpack_add_component_group describes a group of installation
1440 components, which will be placed together within the listing of
1441 options. Typically, component groups allow the user to
1442 select/deselect all of the components within a single group via
1443 a single group-level option. Use component groups to reduce the
1444 complexity of installers with many options. groupname is an
1445 arbitrary name used to identify the group in the GROUP argument
1446 of the cpack_add_component command, which is used to place a
1447 component in a group. The name of the group must not conflict
1448 with the name of any component.
1449
1450
1451 DISPLAY_NAME is the displayed name of the component group, used
1452 in graphical installers to display the component group name.
1453 This value can be any string.
1454
1455
1456 DESCRIPTION is an extended description of the component group,
1457 used in graphical installers to give the user additional infor‐
1458 mation about the components within that group. Descriptions can
1459 span multiple lines using "\n" as the line separator. Typically,
1460 these descriptions should be no more than a few lines long.
1461
1462
1463 PARENT_GROUP, if supplied, names the parent group of this group.
1464 Parent groups are used to establish a hierarchy of groups, pro‐
1465 viding an arbitrary hierarchy of groups.
1466
1467
1468 EXPANDED indicates that, by default, the group should show up as
1469 "expanded", so that the user immediately sees all of the compo‐
1470 nents within the group. Otherwise, the group will initially show
1471 up as a single entry.
1472
1473
1474 BOLD_TITLE indicates that the group title should appear in bold,
1475 to call the user's attention to the group.
1476
1477
1478 cpack_add_install_type - Add a new installation type containing
1479 a set of predefined component selections to the graphical in‐
1480 staller.
1481
1482
1483 cpack_add_install_type(typename
1484 [DISPLAY_NAME name])
1485
1486
1487
1488
1489 The cpack_add_install_type command identifies a set of prese‐
1490 lected components that represents a common use case for an
1491 application. For example, a "Developer" install type might
1492 include an application along with its header and library files,
1493 while an "End user" install type might just include the applica‐
1494 tion's executable. Each component identifies itself with one or
1495 more install types via the INSTALL_TYPES argument to
1496 cpack_add_component.
1497
1498
1499 DISPLAY_NAME is the displayed name of the install type, which
1500 will typically show up in a drop-down box within a graphical in‐
1501 staller. This value can be any string.
1502
1503
1504 cpack_configure_downloads - Configure CPack to download selected
1505 components on-the-fly as part of the installation process.
1506
1507
1508 cpack_configure_downloads(site
1509 [UPLOAD_DIRECTORY dirname]
1510 [ALL]
1511 [ADD_REMOVE|NO_ADD_REMOVE])
1512
1513
1514
1515
1516 The cpack_configure_downloads command configures installa‐
1517 tion-time downloads of selected components. For each download‐
1518 able component, CPack will create an archive containing the con‐
1519 tents of that component, which should be uploaded to the given
1520 site. When the user selects that component for installation, the
1521 installer will download and extract the component in place. This
1522 feature is useful for creating small installers that only down‐
1523 load the requested components, saving bandwidth. Additionally,
1524 the installers are small enough that they will be installed as
1525 part of the normal installation process, and the "Change" button
1526 in Windows Add/Remove Programs control panel will allow one to
1527 add or remove parts of the application after the original
1528 installation. On Windows, the downloaded-components functional‐
1529 ity requires the ZipDLL plug-in for NSIS, available at:
1530
1531
1532 http://nsis.sourceforge.net/ZipDLL_plug-in
1533
1534
1535
1536
1537 On Mac OS X, installers that download components on-the-fly can
1538 only be built and installed on system using Mac OS X 10.5 or
1539 later.
1540
1541
1542 The site argument is a URL where the archives for downloadable
1543 components will reside, e.g.,
1544 http://www.cmake.org/files/2.6.1/installer/ All of the archives
1545 produced by CPack should be uploaded to that location.
1546
1547
1548 UPLOAD_DIRECTORY is the local directory where CPack will create
1549 the various archives for each of the components. The contents of
1550 this directory should be uploaded to a location accessible by
1551 the URL given in the site argument. If omitted, CPack will use
1552 the directory CPackUploads inside the CMake binary directory to
1553 store the generated archives.
1554
1555
1556 The ALL flag indicates that all components be downloaded. Other‐
1557 wise, only those components explicitly marked as DOWNLOADED or
1558 that have a specified ARCHIVE_FILE will be downloaded. Addition‐
1559 ally, the ALL option implies ADD_REMOVE (unless NO_ADD_REMOVE is
1560 specified).
1561
1562
1563 ADD_REMOVE indicates that CPack should install a copy of the in‐
1564 staller that can be called from Windows' Add/Remove Programs
1565 dialog (via the "Modify" button) to change the set of installed
1566 components. NO_ADD_REMOVE turns off this behavior. This option
1567 is ignored on Mac OS X.
1568
1569
1570 CPackCygwin
1571 Cygwin CPack generator (Cygwin).
1572
1573 The following variable is specific to installers build on and/or
1574 for Cygwin:
1575
1576
1577 CPACK_CYGWIN_PATCH_NUMBER - The Cygwin patch number.
1578 FIXME: This documentation is incomplete.
1579 CPACK_CYGWIN_PATCH_FILE - The Cygwin patch file.
1580 FIXME: This documentation is incomplete.
1581 CPACK_CYGWIN_BUILD_SCRIPT - The Cygwin build script.
1582 FIXME: This documentation is incomplete.
1583
1584
1585 CPackDMG
1586 DragNDrop CPack generator (Mac OS X).
1587
1588 The following variables are specific to the DragNDrop installers
1589 built on Mac OS X:
1590
1591
1592 CPACK_DMG_VOLUME_NAME - The volume name of the generated disk
1593 image. Defaults to CPACK_PACKAGE_FILE_NAME.
1594
1595
1596
1597
1598 CPACK_DMG_FORMAT - The disk image format. Common values are UDRO
1599 (UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF
1600 bzip2-compressed). Refer to hdiutil(1) for more information on
1601 other available formats.
1602
1603
1604
1605
1606 CPACK_DMG_DS_STORE - Path to a custom DS_Store file. This .DS_Store
1607 file e.g. can be used to specify the Finder window
1608 position/geometry and layout (such as hidden toolbars, placement of the
1609 icons etc.). This file has to be generated by the Finder (either manually or
1610 through OSA-script) using a normal folder from which the .DS_Store
1611 file can then be extracted.
1612
1613
1614
1615
1616 CPACK_DMG_BACKGROUND_IMAGE - Path to a background image file. This
1617 file will be used as the background for the Finder Window when the disk
1618 image is opened. By default no background image is set. The background
1619 image is applied after applying the custom .DS_Store file.
1620
1621
1622
1623
1624 CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to
1625 operate on disk image files on Mac OS X. This variable can be used
1626 to override the automatically detected command (or specify its
1627 location if the auto-detection fails to find it.)
1628
1629
1630
1631
1632 CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set
1633 extended attributes on files and directories on Mac OS X. This
1634 variable can be used to override the automatically detected
1635 command (or specify its location if the auto-detection fails to
1636 find it.)
1637
1638
1639
1640
1641 CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile
1642 resources on Mac OS X. This variable can be used to override the
1643 automatically detected command (or specify its location if the
1644 auto-detection fails to find it.)
1645
1646
1647 CPackDeb
1648 The builtin (binary) CPack Deb generator (Unix only)
1649
1650 CPackDeb may be used to create Deb package using CPack. CPackDeb
1651 is a CPack generator thus it uses the CPACK_XXX variables used
1652 by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration.
1653 CPackDeb generator should work on any linux host but it will
1654 produce better deb package when Debian specific tools 'dpkg-xxx'
1655 are usable on the build system.
1656
1657
1658 CPackDeb has specific features which are controlled by the
1659 specifics CPACK_DEBIAN_XXX variables.You'll find a detailed
1660 usage on the wiki:
1661
1662
1663 http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#DEB_.28UNIX_only.29
1664
1665 However as a handy reminder here comes the list of specific
1666 variables:
1667
1668
1669 CPACK_DEBIAN_PACKAGE_NAME
1670
1671
1672 Mandatory : YES
1673 Default : CPACK_PACKAGE_NAME (lower case)
1674 The debian package summary
1675
1676 CPACK_DEBIAN_PACKAGE_VERSION
1677
1678
1679 Mandatory : YES
1680 Default : CPACK_PACKAGE_VERSION
1681 The debian package version
1682
1683 CPACK_DEBIAN_PACKAGE_ARCHITECTURE
1684
1685
1686 Mandatory : YES
1687 Default : Output of dpkg --print-architecture (or i386 if dpkg is not found)
1688 The debian package architecture
1689
1690 CPACK_DEBIAN_PACKAGE_DEPENDS
1691
1692
1693 Mandatory : NO
1694 Default : -
1695 May be used to set deb dependencies.
1696
1697 CPACK_DEBIAN_PACKAGE_MAINTAINER
1698
1699
1700 Mandatory : YES
1701 Default : CPACK_PACKAGE_CONTACT
1702 The debian package maintainer
1703
1704 CPACK_DEBIAN_PACKAGE_DESCRIPTION
1705
1706
1707 Mandatory : YES
1708 Default : CPACK_PACKAGE_DESCRIPTION_SUMMARY
1709 The debian package description
1710
1711 CPACK_DEBIAN_PACKAGE_SECTION
1712
1713
1714 Mandatory : YES
1715 Default : 'devel'
1716 The debian package section
1717
1718 CPACK_DEBIAN_PACKAGE_PRIORITY
1719
1720
1721 Mandatory : YES
1722 Default : 'optional'
1723 The debian package priority
1724
1725 CPACK_DEBIAN_PACKAGE_HOMEPAGE
1726
1727
1728 Mandatory : NO
1729 Default : -
1730 The URL of the web site for this package, preferably (when applicable) the
1731 site from which the original source can be obtained and any additional
1732 upstream documentation or information may be found.
1733 The content of this field is a simple URL without any surrounding
1734 characters such as <>.
1735
1736 CPACK_DEBIAN_PACKAGE_SHLIBDEPS
1737
1738
1739 Mandatory : NO
1740 Default : OFF
1741 May be set to ON in order to use dpkg-shlibdeps to generate
1742 better package dependency list.
1743 You may need set CMAKE_INSTALL_RPATH toi appropriate value
1744 if you use this feature, because if you don't dpkg-shlibdeps
1745 may fail to find your own shared libs.
1746 See http://www.cmake.org/Wiki/CMake_RPATH_handling.
1747
1748 CPACK_DEBIAN_PACKAGE_DEBUG
1749
1750
1751 Mandatory : NO
1752 Default : -
1753 May be set when invoking cpack in order to trace debug information
1754 during CPackDeb run.
1755
1756 CPACK_DEBIAN_PACKAGE_PREDEPENDS
1757
1758
1759 Mandatory : NO
1760 Default : -
1761 see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
1762 This field is like Depends, except that it also forces dpkg to complete installation of
1763 the packages named before even starting the installation of the package which declares
1764 the pre-dependency.
1765
1766 CPACK_DEBIAN_PACKAGE_ENHANCES
1767
1768
1769 Mandatory : NO
1770 Default : -
1771 see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
1772 This field is similar to Suggests but works in the opposite direction.
1773 It is used to declare that a package can enhance the functionality of another package.
1774
1775 CPACK_DEBIAN_PACKAGE_BREAKS
1776
1777
1778 Mandatory : NO
1779 Default : -
1780 see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
1781 When one binary package declares that it breaks another, dpkg will refuse to allow the
1782 package which declares Breaks be installed unless the broken package is deconfigured first,
1783 and it will refuse to allow the broken package to be reconfigured.
1784
1785 CPACK_DEBIAN_PACKAGE_CONFLICTS
1786
1787
1788 Mandatory : NO
1789 Default : -
1790 see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
1791 When one binary package declares a conflict with another using a Conflicts field,
1792 dpkg will refuse to allow them to be installed on the system at the same time.
1793
1794 CPACK_DEBIAN_PACKAGE_PROVIDES
1795
1796
1797 Mandatory : NO
1798 Default : -
1799 see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
1800 A virtual package is one which appears in the Provides control field of another package.
1801
1802 CPACK_DEBIAN_PACKAGE_REPLACES
1803
1804
1805 Mandatory : NO
1806 Default : -
1807 see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
1808 Packages can declare in their control file that they should overwrite
1809 files in certain other packages, or completely replace other packages.
1810
1811 CPACK_DEBIAN_PACKAGE_RECOMMENDS
1812
1813
1814 Mandatory : NO
1815 Default : -
1816 see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
1817 Allows packages to declare a strong, but not absolute, dependency on other packages.
1818
1819 CPACK_DEBIAN_PACKAGE_SUGGESTS
1820
1821
1822 Mandatory : NO
1823 Default : -
1824 see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
1825 Allows packages to declare a suggested package install grouping.
1826
1827 CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
1828
1829
1830 Mandatory : NO
1831 Default : -
1832 This variable allow advanced user to add custom script to the control.tar.gz
1833 Typical usage is for conffiles, postinst, postrm, prerm.
1834 Usage: set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
1835 "${CMAKE_CURRENT_SOURCE_DIR/prerm;${CMAKE_CURRENT_SOURCE_DIR}/postrm")
1836
1837
1838 CPackNSIS
1839 CPack NSIS generator specific options
1840
1841
1842
1843
1844 The following variables are specific to the graphical installers
1845 built on Windows using the Nullsoft Installation System.
1846
1847
1848 CPACK_NSIS_INSTALL_ROOT - The default installation directory presented
1849 to the end user by the NSIS installer is under this root dir. The full
1850 directory presented to the end user is:
1851 ${CPACK_NSIS_INSTALL_ROOT}/${CPACK_PACKAGE_INSTALL_DIRECTORY}
1852
1853
1854
1855
1856 CPACK_NSIS_MUI_ICON - An icon filename.
1857 The name of a *.ico file used as the main icon for the generated
1858 install program.
1859
1860
1861
1862
1863 CPACK_NSIS_MUI_UNIICON - An icon filename.
1864 The name of a *.ico file used as the main icon for the generated
1865 uninstall program.
1866
1867
1868
1869
1870 CPACK_NSIS_INSTALLER_MUI_ICON_CODE - undocumented.
1871
1872
1873
1874
1875 CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS - Extra NSIS commands that
1876 will be added to the beginning of the install Section, before your
1877 install tree is available on the target system.
1878
1879
1880
1881
1882 CPACK_NSIS_EXTRA_INSTALL_COMMANDS - Extra NSIS commands that
1883 will be added to the end of the install Section, after your
1884 install tree is available on the target system.
1885
1886
1887
1888
1889 CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS - Extra NSIS commands that will
1890 be added to the uninstall Section, before your install tree is
1891 removed from the target system.
1892
1893
1894
1895
1896 CPACK_NSIS_COMPRESSOR - The arguments that will be passed to the
1897 NSIS SetCompressor command.
1898
1899
1900
1901
1902 CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL - Ask about uninstalling
1903 previous versions first.
1904 If this is set to "ON", then an installer will look for previous
1905 installed versions and if one is found, ask the user whether to
1906 uninstall it before proceeding with the install.
1907
1908
1909
1910
1911 CPACK_NSIS_MODIFY_PATH - Modify PATH toggle.
1912 If this is set to "ON", then an extra page
1913 will appear in the installer that will allow the user to choose
1914 whether the program directory should be added to the system PATH
1915 variable.
1916
1917
1918
1919
1920 CPACK_NSIS_DISPLAY_NAME - The display name string that appears in
1921 the Windows Add/Remove Program control panel
1922
1923
1924
1925
1926 CPACK_NSIS_PACKAGE_NAME - The title displayed at the top of the
1927 installer.
1928
1929
1930
1931
1932 CPACK_NSIS_INSTALLED_ICON_NAME - A path to the executable that
1933 contains the installer icon.
1934
1935
1936
1937
1938 CPACK_NSIS_HELP_LINK - URL to a web site providing assistance in
1939 installing your application.
1940
1941
1942
1943
1944 CPACK_NSIS_URL_INFO_ABOUT - URL to a web site providing more
1945 information about your application.
1946
1947
1948
1949
1950 CPACK_NSIS_CONTACT - Contact information for questions and comments
1951 about the installation process.
1952
1953
1954
1955
1956 CPACK_NSIS_CREATE_ICONS_EXTRA - Additional NSIS commands for
1957 creating start menu shortcuts.
1958
1959
1960
1961
1962 CPACK_NSIS_DELETE_ICONS_EXTRA -Additional NSIS commands to
1963 uninstall start menu shortcuts.
1964
1965
1966
1967
1968 CPACK_NSIS_EXECUTABLES_DIRECTORY - Creating NSIS start menu links
1969 assumes that they are in 'bin' unless this variable is set.
1970 For example, you would set this to 'exec' if your executables are
1971 in an exec directory.
1972
1973
1974
1975
1976 CPACK_NSIS_MUI_FINISHPAGE_RUN - Specify an executable to add an option
1977 to run on the finish page of the NSIS installer.
1978 CPACK_NSIS_MENU_LINKS - Specify links in [application] menu.
1979 This should contain a list of pair "link" "link name". The link
1980 may be an URL or a path relative to installation prefix.
1981 Like:
1982 set(CPACK_NSIS_MENU_LINKS
1983 "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake.html" "CMake Help"
1984 "http://www.cmake.org" "CMake Web Site")
1985
1986
1987 CPackPackageMaker
1988 PackageMaker CPack generator (Mac OS X).
1989
1990 The following variable is specific to installers built on Mac OS
1991 X using PackageMaker:
1992
1993
1994 CPACK_OSX_PACKAGE_VERSION - The version of Mac OS X that the
1995 resulting PackageMaker archive should be compatible with. Different
1996 versions of Mac OS X support different
1997 features. For example, CPack can only build component-based
1998 installers for Mac OS X 10.4 or newer, and can only build
1999 installers that download component son-the-fly for Mac OS X 10.5
2000 or newer. If left blank, this value will be set to the minimum
2001 version of Mac OS X that supports the requested features. Set this
2002 variable to some value (e.g., 10.4) only if you want to guarantee
2003 that your installer will work on that version of Mac OS X, and
2004 don't mind missing extra features available in the installer
2005 shipping with later versions of Mac OS X.
2006
2007
2008 CPackRPM
2009 The builtin (binary) CPack RPM generator (Unix only)
2010
2011 CPackRPM may be used to create RPM package using CPack. CPackRPM
2012 is a CPack generator thus it uses the CPACK_XXX variables used
2013 by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration
2014
2015
2016 However CPackRPM has specific features which are controlled by
2017 the specifics CPACK_RPM_XXX variables. CPackRPM is a component
2018 aware generator so when CPACK_RPM_COMPONENT_INSTALL is ON some
2019 more CPACK_RPM_<ComponentName>_XXXX variables may be used in
2020 order to have component specific values. Note however that <com‐
2021 ponentName> refers to the **grouping name**. This may be either
2022 a component name or a component GROUP name. Usually those vars
2023 correspond to RPM spec file entities, one may find information
2024 about spec files here http://www.rpm.org/wiki/Docs. You'll find
2025 a detailed usage of CPackRPM on the wiki:
2026
2027
2028 http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#RPM_.28Unix_Only.29
2029
2030 However as a handy reminder here comes the list of specific
2031 variables:
2032
2033
2034 CPACK_RPM_PACKAGE_SUMMARY - The RPM package summary.
2035 Mandatory : YES
2036 Default : CPACK_PACKAGE_DESCRIPTION_SUMMARY
2037 CPACK_RPM_PACKAGE_NAME - The RPM package name.
2038 Mandatory : YES
2039 Default : CPACK_PACKAGE_NAME
2040 CPACK_RPM_PACKAGE_VERSION - The RPM package version.
2041 Mandatory : YES
2042 Default : CPACK_PACKAGE_VERSION
2043 CPACK_RPM_PACKAGE_ARCHITECTURE - The RPM package architecture.
2044 Mandatory : NO
2045 Default : -
2046 This may be set to "noarch" if you
2047 know you are building a noarch package.
2048 CPACK_RPM_PACKAGE_RELEASE - The RPM package release.
2049 Mandatory : YES
2050 Default : 1
2051 This is the numbering of the RPM package
2052 itself, i.e. the version of the packaging and not the version of the
2053 content (see CPACK_RPM_PACKAGE_VERSION). One may change the default
2054 value if the previous packaging was buggy and/or you want to put here
2055 a fancy Linux distro specific numbering.
2056 CPACK_RPM_PACKAGE_LICENSE - The RPM package license policy.
2057 Mandatory : YES
2058 Default : "unknown"
2059 CPACK_RPM_PACKAGE_GROUP - The RPM package group.
2060 Mandatory : YES
2061 Default : "unknown"
2062 CPACK_RPM_PACKAGE_VENDOR - The RPM package vendor.
2063 Mandatory : YES
2064 Default : CPACK_PACKAGE_VENDOR if set or "unknown"
2065 CPACK_RPM_PACKAGE_URL - The projects URL.
2066 Mandatory : NO
2067 Default : -
2068 CPACK_RPM_PACKAGE_DESCRIPTION - RPM package description.
2069 Mandatory : YES
2070 Default : CPACK_PACKAGE_DESCRIPTION_FILE if set or "no package description available"
2071 CPACK_RPM_COMPRESSION_TYPE - RPM compression type.
2072 Mandatory : NO
2073 Default : -
2074 May be used to override RPM compression type to be used
2075 to build the RPM. For example some Linux distribution now default
2076 to lzma or xz compression whereas older cannot use such RPM.
2077 Using this one can enforce compression type to be used.
2078 Possible value are: lzma, xz, bzip2 and gzip.
2079 CPACK_RPM_PACKAGE_REQUIRES - RPM spec requires field.
2080 Mandatory : NO
2081 Default : -
2082 May be used to set RPM dependencies (requires).
2083 Note that you must enclose the complete requires string between quotes,
2084 for example:
2085 set(CPACK_RPM_PACKAGE_REQUIRES "python >= 2.5.0, cmake >= 2.8")
2086 The required package list of an RPM file could be printed with
2087 rpm -qp --requires file.rpm
2088 CPACK_RPM_PACKAGE_SUGGESTS - RPM spec suggest field.
2089 Mandatory : NO
2090 Default : -
2091 May be used to set weak RPM dependencies (suggests).
2092 Note that you must enclose the complete requires string between quotes.
2093 CPACK_RPM_PACKAGE_PROVIDES - RPM spec provides field.
2094 Mandatory : NO
2095 Default : -
2096 May be used to set RPM dependencies (provides).
2097 The provided package list of an RPM file could be printed with
2098 rpm -qp --provides file.rpm
2099 CPACK_RPM_PACKAGE_OBSOLETES - RPM spec obsoletes field.
2100 Mandatory : NO
2101 Default : -
2102 May be used to set RPM packages that are obsoleted by this one.
2103 CPACK_RPM_PACKAGE_RELOCATABLE - build a relocatable RPM.
2104 Mandatory : NO
2105 Default : CPACK_PACKAGE_RELOCATABLE
2106 If this variable is set to TRUE or ON CPackRPM will try
2107 to build a relocatable RPM package. A relocatable RPM may
2108 be installed using rpm --prefix or --relocate in order to
2109 install it at an alternate place see rpm(8).
2110 Note that currently this may fail if CPACK_SET_DESTDIR is set to ON.
2111 If CPACK_SET_DESTDIR is set then you will get a warning message
2112 but if there is file installed with absolute path you'll get
2113 unexpected behavior.
2114 CPACK_RPM_SPEC_INSTALL_POST - [deprecated].
2115 Mandatory : NO
2116 Default : -
2117 This way of specifying post-install script is deprecated use
2118 CPACK_RPM_POST_INSTALL_SCRIPT_FILE
2119 May be used to set an RPM post-install command inside the spec file.
2120 For example setting it to "/bin/true" may be used to prevent
2121 rpmbuild to strip binaries.
2122 CPACK_RPM_SPEC_MORE_DEFINE - RPM extended spec definitions lines.
2123 Mandatory : NO
2124 Default : -
2125 May be used to add any %define lines to the generated spec file.
2126 CPACK_RPM_PACKAGE_DEBUG - Toggle CPackRPM debug output.
2127 Mandatory : NO
2128 Default : -
2129 May be set when invoking cpack in order to trace debug information
2130 during CPack RPM run. For example you may launch CPack like this
2131 cpack -D CPACK_RPM_PACKAGE_DEBUG=1 -G RPM
2132 CPACK_RPM_USER_BINARY_SPECFILE - A user provided spec file.
2133 Mandatory : NO
2134 Default : -
2135 May be set by the user in order to specify a USER binary spec file
2136 to be used by CPackRPM instead of generating the file.
2137 The specified file will be processed by configure_file( @ONLY).
2138 One can provide a component specific file by setting
2139 CPACK_RPM_<componentName>_USER_BINARY_SPECFILE.
2140 CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE - Spec file template.
2141 Mandatory : NO
2142 Default : -
2143 If set CPack will generate a template for USER specified binary
2144 spec file and stop with an error. For example launch CPack like this
2145 cpack -D CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE=1 -G RPM
2146 The user may then use this file in order to hand-craft is own
2147 binary spec file which may be used with CPACK_RPM_USER_BINARY_SPECFILE.
2148 CPACK_RPM_PRE_INSTALL_SCRIPT_FILE
2149 CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE
2150 Mandatory : NO
2151 Default : -
2152 May be used to embed a pre (un)installation script in the spec file.
2153 The refered script file(s) will be read and directly
2154 put after the %pre or %preun section
2155 If CPACK_RPM_COMPONENT_INSTALL is set to ON the (un)install script for
2156 each component can be overridden with
2157 CPACK_RPM_<COMPONENT>_PRE_INSTALL_SCRIPT_FILE and
2158 CPACK_RPM_<COMPONENT>_PRE_UNINSTALL_SCRIPT_FILE
2159 One may verify which scriptlet has been included with
2160 rpm -qp --scripts package.rpm
2161 CPACK_RPM_POST_INSTALL_SCRIPT_FILE
2162 CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE
2163 Mandatory : NO
2164 Default : -
2165 May be used to embed a post (un)installation script in the spec file.
2166 The refered script file(s) will be read and directly
2167 put after the %post or %postun section
2168 If CPACK_RPM_COMPONENT_INSTALL is set to ON the (un)install script for
2169 each component can be overridden with
2170 CPACK_RPM_<COMPONENT>_POST_INSTALL_SCRIPT_FILE and
2171 CPACK_RPM_<COMPONENT>_POST_UNINSTALL_SCRIPT_FILE
2172 One may verify which scriptlet has been included with
2173 rpm -qp --scripts package.rpm
2174 CPACK_RPM_USER_FILELIST
2175 CPACK_RPM_<COMPONENT>_USER_FILELIST
2176 Mandatory : NO
2177 Default : -
2178 May be used to explicitly specify %(<directive>) file line
2179 in the spec file. Like %config(noreplace) or any other directive
2180 that be found in the %files section. Since CPackRPM is generating
2181 the list of files (and directories) the user specified files of
2182 the CPACK_RPM_<COMPONENT>_USER_FILELIST list will be removed from the generated list.
2183 CPACK_RPM_CHANGELOG_FILE - RPM changelog file.
2184 Mandatory : NO
2185 Default : -
2186 May be used to embed a changelog in the spec file.
2187 The refered file will be read and directly put after the %changelog
2188 section.
2189 CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST - list of path to be excluded.
2190 Mandatory : NO
2191 Default : /etc /etc/init.d /usr /usr/share /usr/share/doc /usr/bin /usr/lib /usr/lib64 /usr/include
2192 May be used to exclude path (directories or files) from the auto-generated
2193 list of paths discovered by CPack RPM. The defaut value contains a reasonable
2194 set of values if the variable is not defined by the user. If the variable
2195 is defined by the user then CPackRPM will NOT any of the default path.
2196 If you want to add some path to the default list then you can use
2197 CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION variable.
2198 CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION - additional list of path to be excluded.
2199 Mandatory : NO
2200 Default : -
2201 May be used to add more exclude path (directories or files) from the initial
2202 default list of excluded paths. See CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST.
2203
2204
2205 CPackWIX
2206 CPack WiX generator specific options
2207
2208
2209
2210
2211 The following variables are specific to the installers built on
2212 Windows using WiX.
2213
2214
2215 CPACK_WIX_UPGRADE_GUID - Upgrade GUID (Product/@UpgradeCode)
2216
2217
2218
2219
2220 Will be automatically generated unless explicitly provided.
2221
2222
2223 It should be explicitly set to a constant generated gloabally
2224 unique identifier (GUID) to allow your installers to replace
2225 existing installations that use the same GUID.
2226
2227
2228 You may for example explicitly set this variable in your CMake‐
2229 Lists.txt to the value that has been generated per default. You
2230 should not use GUIDs that you did not generate yourself or which
2231 may belong to other projects.
2232
2233
2234 A GUID shall have the following fixed length syntax:
2235 XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
2236
2237
2238 (each X represents an uppercase hexadecimal digit)
2239 CPACK_WIX_PRODUCT_GUID - Product GUID (Product/@Id)
2240
2241
2242
2243
2244 Will be automatically generated unless explicitly provided.
2245
2246
2247 If explicitly provided this will set the Product Id of your in‐
2248 staller.
2249
2250
2251 The installer will abort if it detects a pre-existing installa‐
2252 tion that uses the same GUID.
2253
2254
2255 The GUID shall use the syntax described for
2256 CPACK_WIX_UPGRADE_GUID.
2257
2258
2259 CPACK_WIX_LICENSE_RTF - RTF License File
2260
2261
2262
2263
2264 If CPACK_RESOURCE_FILE_LICENSE has an .rtf extension it is used
2265 as-is.
2266
2267
2268 If CPACK_RESOURCE_FILE_LICENSE has an .txt extension it is
2269 implicitly converted to RTF by the WiX Generator.
2270
2271
2272 With CPACK_WIX_LICENSE_RTF you can override the license file
2273 used by the WiX Generator in case CPACK_RESOURCE_FILE_LICENSE is
2274 in an unsupported format or the .txt -> .rtf conversion does not
2275 work as expected.
2276
2277
2278
2279
2280
2281 CPACK_WIX_PRODUCT_ICON - The Icon shown next to the program name
2282 in Add/Remove programs.
2283
2284
2285 If set, this icon is used in place of the default icon.
2286
2287
2288
2289
2290
2291 CPACK_WIX_UI_BANNER - The bitmap will appear at the top of all
2292 installer pages other than the welcome and completion dialogs.
2293
2294
2295 If set, this image will replace the default banner image.
2296
2297
2298 This image must be 493 by 58 pixels.
2299
2300
2301
2302
2303
2304 CPACK_WIX_UI_DIALOG - Background bitmap used on the welcome and
2305 completion dialogs.
2306
2307
2308 If this variable is set, the installer will replace the default
2309 dialog image.
2310
2311
2312 This image must be 493 by 312 pixels.
2313
2314
2315
2316
2317
2318 CPACK_WIX_PROGRAM_MENU_FOLDER - Start menu folder name for
2319 launcher.
2320
2321
2322 If this variable is not set, it will be initialized with
2323 CPACK_PACKAGE_NAME
2324
2325
2326 CPACK_WIX_CULTURES - Language(s) of the installer
2327
2328
2329 Languages are compiled into the WixUI extension library. To use
2330 them, simply provide the name of the culture. If you specify
2331 more than one culture identifier in a comma or semicolon delim‐
2332 ited list, the first one that is found will be used. You can
2333 find a list of supported languages at: http://wix.source‐
2334 forge.net/manual-wix3/WixUI_localization.htm
2335
2336
2337 CPACK_WIX_TEMPLATE - Template file for WiX generation
2338
2339
2340 If this variable is set, the specified template will be used to
2341 generate the WiX wxs file. This should be used if further cus‐
2342 tomization of the output is required.
2343
2344
2345 If this variable is not set, the default MSI template included
2346 with CMake will be used.
2347
2348
2349
2350 CTest Configure a project for testing with CTest/CDash
2351
2352 Include this module in the top CMakeLists.txt file of a project
2353 to enable testing with CTest and dashboard submissions to CDash:
2354
2355
2356 project(MyProject)
2357 ...
2358 include(CTest)
2359
2360 The module automatically creates a BUILD_TESTING option that
2361 selects whether to enable testing support (ON by default).
2362 After including the module, use code like
2363
2364
2365 if(BUILD_TESTING)
2366 # ... CMake code to create tests ...
2367 endif()
2368
2369 to creating tests when testing is enabled.
2370
2371
2372 To enable submissions to a CDash server, create a CTestCon‐
2373 fig.cmake file at the top of the project with content such as
2374
2375
2376 set(CTEST_PROJECT_NAME "MyProject")
2377 set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
2378 set(CTEST_DROP_METHOD "http")
2379 set(CTEST_DROP_SITE "my.cdash.org")
2380 set(CTEST_DROP_LOCATION "/submit.php?project=MyProject")
2381 set(CTEST_DROP_SITE_CDASH TRUE)
2382
2383 (the CDash server can provide the file to a project administra‐
2384 tor who configures 'MyProject'). Settings in the config file are
2385 shared by both this CTest module and the CTest command-line
2386 tool's dashboard script mode (ctest -S).
2387
2388
2389 While building a project for submission to CDash, CTest scans
2390 the build output for errors and warnings and reports them with
2391 surrounding context from the build log. This generic approach
2392 works for all build tools, but does not give details about the
2393 command invocation that produced a given problem. One may get
2394 more detailed reports by adding
2395
2396
2397 set(CTEST_USE_LAUNCHERS 1)
2398
2399 to the CTestConfig.cmake file. When this option is enabled, the
2400 CTest module tells CMake's Makefile generators to invoke every
2401 command in the generated build system through a CTest launcher
2402 program. (Currently the CTEST_USE_LAUNCHERS option is ignored
2403 on non-Makefile generators.) During a manual build each
2404 launcher transparently runs the command it wraps. During a
2405 CTest-driven build for submission to CDash each launcher reports
2406 detailed information when its command fails or warns. (Setting
2407 CTEST_USE_LAUNCHERS in CTestConfig.cmake is convenient, but also
2408 adds the launcher overhead even for manual builds. One may
2409 instead set it in a CTest dashboard script and add it to the
2410 CMake cache for the build tree.)
2411
2412
2413 CTestScriptMode
2414
2415
2416 This file is read by ctest in script mode (-S)
2417
2418
2419 CTestUseLaunchers
2420 Set the RULE_LAUNCH_* global properties when CTEST_USE_LAUNCHERS
2421 is on.
2422
2423 CTestUseLaunchers is automatically included when you
2424 include(CTest). However, it is split out into its own module
2425 file so projects can use the CTEST_USE_LAUNCHERS functionality
2426 independently.
2427
2428
2429 To use launchers, set CTEST_USE_LAUNCHERS to ON in a ctest -S
2430 dashboard script, and then also set it in the cache of the con‐
2431 figured project. Both cmake and ctest need to know the value of
2432 it for the launchers to work properly. CMake needs to know in
2433 order to generate proper build rules, and ctest, in order to
2434 produce the proper error and warning analysis.
2435
2436
2437 For convenience, you may set the ENV variable CTEST_USE_LAUNCH‐
2438 ERS_DEFAULT in your ctest -S script, too. Then, as long as your
2439 CMakeLists uses include(CTest) or include(CTestUseLaunchers), it
2440 will use the value of the ENV variable to initialize a
2441 CTEST_USE_LAUNCHERS cache variable. This cache variable initial‐
2442 ization only occurs if CTEST_USE_LAUNCHERS is not already
2443 defined.
2444
2445
2446 CheckCCompilerFlag
2447 Check whether the C compiler supports a given flag.
2448
2449 CHECK_C_COMPILER_FLAG(<flag> <var>)
2450
2451
2452 <flag> - the compiler flag
2453 <var> - variable to store the result
2454
2455 This internally calls the check_c_source_compiles macro and sets
2456 CMAKE_REQUIRED_DEFINITIONS to <flag>. See help for CheckCSource‐
2457 Compiles for a listing of variables that can otherwise modify
2458 the build. The result only tells that the compiler does not give
2459 an error message when it encounters the flag. If the flag has
2460 any effect or even a specific one is beyond the scope of this
2461 module.
2462
2463
2464 CheckCSourceCompiles
2465 Check if given C source compiles and links into an executable
2466
2467 CHECK_C_SOURCE_COMPILES(<code> <var> [FAIL_REGEX <fail-regex>])
2468
2469
2470 <code> - source code to try to compile, must define 'main'
2471 <var> - variable to store whether the source code compiled
2472 <fail-regex> - fail if test output matches this regex
2473
2474 The following variables may be set before calling this macro to
2475 modify the way the check is run:
2476
2477
2478 CMAKE_REQUIRED_FLAGS = string of compile command line flags
2479 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
2480 CMAKE_REQUIRED_INCLUDES = list of include directories
2481 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
2482
2483
2484 CheckCSourceRuns
2485 Check if the given C source code compiles and runs.
2486
2487 CHECK_C_SOURCE_RUNS(<code> <var>)
2488
2489
2490 <code> - source code to try to compile
2491 <var> - variable to store the result
2492 (1 for success, empty for failure)
2493
2494 The following variables may be set before calling this macro to
2495 modify the way the check is run:
2496
2497
2498 CMAKE_REQUIRED_FLAGS = string of compile command line flags
2499 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
2500 CMAKE_REQUIRED_INCLUDES = list of include directories
2501 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
2502
2503
2504 CheckCXXCompilerFlag
2505 Check whether the CXX compiler supports a given flag.
2506
2507 CHECK_CXX_COMPILER_FLAG(<flag> <var>)
2508
2509
2510 <flag> - the compiler flag
2511 <var> - variable to store the result
2512
2513 This internally calls the check_cxx_source_compiles macro and
2514 sets CMAKE_REQUIRED_DEFINITIONS to <flag>. See help for Check‐
2515 CXXSourceCompiles for a listing of variables that can otherwise
2516 modify the build. The result only tells that the compiler does
2517 not give an error message when it encounters the flag. If the
2518 flag has any effect or even a specific one is beyond the scope
2519 of this module.
2520
2521
2522 CheckCXXSourceCompiles
2523 Check if given C++ source compiles and links into an executable
2524
2525 CHECK_CXX_SOURCE_COMPILES(<code> <var> [FAIL_REGEX
2526 <fail-regex>])
2527
2528
2529 <code> - source code to try to compile, must define 'main'
2530 <var> - variable to store whether the source code compiled
2531 <fail-regex> - fail if test output matches this regex
2532
2533 The following variables may be set before calling this macro to
2534 modify the way the check is run:
2535
2536
2537 CMAKE_REQUIRED_FLAGS = string of compile command line flags
2538 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
2539 CMAKE_REQUIRED_INCLUDES = list of include directories
2540 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
2541
2542
2543 CheckCXXSourceRuns
2544 Check if the given C++ source code compiles and runs.
2545
2546 CHECK_CXX_SOURCE_RUNS(<code> <var>)
2547
2548
2549 <code> - source code to try to compile
2550 <var> - variable to store the result
2551 (1 for success, empty for failure)
2552
2553 The following variables may be set before calling this macro to
2554 modify the way the check is run:
2555
2556
2557 CMAKE_REQUIRED_FLAGS = string of compile command line flags
2558 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
2559 CMAKE_REQUIRED_INCLUDES = list of include directories
2560 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
2561
2562
2563 CheckCXXSymbolExists
2564 Check if a symbol exists as a function, variable, or macro in
2565 C++
2566
2567 CHECK_CXX_SYMBOL_EXISTS(<symbol> <files> <variable>)
2568
2569
2570 Check that the <symbol> is available after including given
2571 header <files> and store the result in a <variable>. Specify
2572 the list of files in one argument as a semicolon-separated list.
2573 CHECK_CXX_SYMBOL_EXISTS() can be used to check in C++ files, as
2574 opposed to CHECK_SYMBOL_EXISTS(), which works only for C.
2575
2576
2577 If the header files define the symbol as a macro it is consid‐
2578 ered available and assumed to work. If the header files declare
2579 the symbol as a function or variable then the symbol must also
2580 be available for linking. If the symbol is a type or enum value
2581 it will not be recognized (consider using CheckTypeSize or
2582 CheckCSourceCompiles).
2583
2584
2585 The following variables may be set before calling this macro to
2586 modify the way the check is run:
2587
2588
2589 CMAKE_REQUIRED_FLAGS = string of compile command line flags
2590 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
2591 CMAKE_REQUIRED_INCLUDES = list of include directories
2592 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
2593
2594
2595 CheckFortranFunctionExists
2596 macro which checks if the Fortran function exists
2597
2598 CHECK_FORTRAN_FUNCTION_EXISTS(FUNCTION VARIABLE)
2599
2600
2601 FUNCTION - the name of the Fortran function
2602 VARIABLE - variable to store the result
2603
2604
2605
2606
2607 The following variables may be set before calling this macro to
2608 modify the way the check is run:
2609
2610
2611 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
2612
2613
2614 CheckFunctionExists
2615 Check if a C function can be linked
2616
2617 CHECK_FUNCTION_EXISTS(<function> <variable>)
2618
2619
2620 Check that the <function> is provided by libraries on the system
2621 and store the result in a <variable>. This does not verify that
2622 any system header file declares the function, only that it can
2623 be found at link time (consider using CheckSymbolExists).
2624
2625
2626 The following variables may be set before calling this macro to
2627 modify the way the check is run:
2628
2629
2630 CMAKE_REQUIRED_FLAGS = string of compile command line flags
2631 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
2632 CMAKE_REQUIRED_INCLUDES = list of include directories
2633 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
2634
2635
2636 CheckIncludeFile
2637 macro which checks the include file exists.
2638
2639 CHECK_INCLUDE_FILE(INCLUDE VARIABLE)
2640
2641
2642 INCLUDE - name of include file
2643 VARIABLE - variable to return result
2644
2645
2646
2647
2648 an optional third argument is the CFlags to add to the compile
2649 line or you can use CMAKE_REQUIRED_FLAGS
2650
2651
2652 The following variables may be set before calling this macro to
2653 modify the way the check is run:
2654
2655
2656 CMAKE_REQUIRED_FLAGS = string of compile command line flags
2657 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
2658 CMAKE_REQUIRED_INCLUDES = list of include directories
2659
2660
2661
2662
2663
2664 CheckIncludeFileCXX
2665 Check if the include file exists.
2666
2667 CHECK_INCLUDE_FILE_CXX(INCLUDE VARIABLE)
2668
2669
2670
2671
2672 INCLUDE - name of include file
2673 VARIABLE - variable to return result
2674
2675
2676
2677
2678 An optional third argument is the CFlags to add to the compile
2679 line or you can use CMAKE_REQUIRED_FLAGS.
2680
2681
2682 The following variables may be set before calling this macro to
2683 modify the way the check is run:
2684
2685
2686 CMAKE_REQUIRED_FLAGS = string of compile command line flags
2687 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
2688 CMAKE_REQUIRED_INCLUDES = list of include directories
2689
2690
2691
2692
2693
2694 CheckIncludeFiles
2695 Check if the files can be included
2696
2697
2698
2699
2700 CHECK_INCLUDE_FILES(INCLUDE VARIABLE)
2701
2702
2703 INCLUDE - list of files to include
2704 VARIABLE - variable to return result
2705
2706
2707
2708
2709 The following variables may be set before calling this macro to
2710 modify the way the check is run:
2711
2712
2713 CMAKE_REQUIRED_FLAGS = string of compile command line flags
2714 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
2715 CMAKE_REQUIRED_INCLUDES = list of include directories
2716
2717
2718 CheckLanguage
2719 Check if a language can be enabled
2720
2721 Usage:
2722
2723
2724 check_language(<lang>)
2725
2726 where <lang> is a language that may be passed to enable_lan‐
2727 guage() such as "Fortran". If CMAKE_<lang>_COMPILER is already
2728 defined the check does nothing. Otherwise it tries enabling the
2729 language in a test project. The result is cached in
2730 CMAKE_<lang>_COMPILER as the compiler that was found, or NOT‐
2731 FOUND if the language cannot be enabled.
2732
2733
2734 Example:
2735
2736
2737 check_language(Fortran)
2738 if(CMAKE_Fortran_COMPILER)
2739 enable_language(Fortran)
2740 else()
2741 message(STATUS "No Fortran support")
2742 endif()
2743
2744
2745 CheckLibraryExists
2746 Check if the function exists.
2747
2748 CHECK_LIBRARY_EXISTS (LIBRARY FUNCTION LOCATION VARIABLE)
2749
2750
2751 LIBRARY - the name of the library you are looking for
2752 FUNCTION - the name of the function
2753 LOCATION - location where the library should be found
2754 VARIABLE - variable to store the result
2755
2756
2757
2758
2759 The following variables may be set before calling this macro to
2760 modify the way the check is run:
2761
2762
2763 CMAKE_REQUIRED_FLAGS = string of compile command line flags
2764 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
2765 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
2766
2767
2768 CheckPrototypeDefinition
2769 Check if the protoype we expect is correct.
2770
2771 check_prototype_definition(FUNCTION PROTOTYPE RETURN HEADER
2772 VARIABLE)
2773
2774
2775 FUNCTION - The name of the function (used to check if prototype exists)
2776 PROTOTYPE- The prototype to check.
2777 RETURN - The return value of the function.
2778 HEADER - The header files required.
2779 VARIABLE - The variable to store the result.
2780
2781 Example:
2782
2783
2784 check_prototype_definition(getpwent_r
2785 "struct passwd *getpwent_r(struct passwd *src, char *buf, int buflen)"
2786 "NULL"
2787 "unistd.h;pwd.h"
2788 SOLARIS_GETPWENT_R)
2789
2790 The following variables may be set before calling this macro to
2791 modify the way the check is run:
2792
2793
2794 CMAKE_REQUIRED_FLAGS = string of compile command line flags
2795 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
2796 CMAKE_REQUIRED_INCLUDES = list of include directories
2797 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
2798
2799
2800 CheckStructHasMember
2801 Check if the given struct or class has the specified member
2802 variable
2803
2804 CHECK_STRUCT_HAS_MEMBER (STRUCT MEMBER HEADER VARIABLE)
2805
2806
2807 STRUCT - the name of the struct or class you are interested in
2808 MEMBER - the member which existence you want to check
2809 HEADER - the header(s) where the prototype should be declared
2810 VARIABLE - variable to store the result
2811
2812
2813
2814
2815 The following variables may be set before calling this macro to
2816 modify the way the check is run:
2817
2818
2819 CMAKE_REQUIRED_FLAGS = string of compile command line flags
2820 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
2821 CMAKE_REQUIRED_INCLUDES = list of include directories
2822
2823
2824
2825
2826 Example: CHECK_STRUCT_HAS_MEMBER("struct timeval" tv_sec
2827 sys/select.h HAVE_TIMEVAL_TV_SEC)
2828
2829
2830 CheckSymbolExists
2831 Check if a symbol exists as a function, variable, or macro
2832
2833 CHECK_SYMBOL_EXISTS(<symbol> <files> <variable>)
2834
2835
2836 Check that the <symbol> is available after including given
2837 header <files> and store the result in a <variable>. Specify
2838 the list of files in one argument as a semicolon-separated list.
2839
2840
2841 If the header files define the symbol as a macro it is consid‐
2842 ered available and assumed to work. If the header files declare
2843 the symbol as a function or variable then the symbol must also
2844 be available for linking. If the symbol is a type or enum value
2845 it will not be recognized (consider using CheckTypeSize or
2846 CheckCSourceCompiles). If the check needs to be done in C++,
2847 consider using CHECK_CXX_SYMBOL_EXISTS(), which does the same as
2848 CHECK_SYMBOL_EXISTS(), but in C++.
2849
2850
2851 The following variables may be set before calling this macro to
2852 modify the way the check is run:
2853
2854
2855 CMAKE_REQUIRED_FLAGS = string of compile command line flags
2856 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
2857 CMAKE_REQUIRED_INCLUDES = list of include directories
2858 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
2859
2860
2861 CheckTypeSize
2862 Check sizeof a type
2863
2864 CHECK_TYPE_SIZE(TYPE VARIABLE [BUILTIN_TYPES_ONLY])
2865
2866 Check if the type exists and determine its size. On return,
2867 "HAVE_${VARIABLE}" holds the existence of the type, and "${VARI‐
2868 ABLE}" holds one of the following:
2869
2870
2871 <size> = type has non-zero size <size>
2872 "0" = type has arch-dependent size (see below)
2873 "" = type does not exist
2874
2875 Furthermore, the variable "${VARIABLE}_CODE" holds C preproces‐
2876 sor code to define the macro "${VARIABLE}" to the size of the
2877 type, or leave the macro undefined if the type does not exist.
2878
2879
2880 The variable "${VARIABLE}" may be "0" when CMAKE_OSX_ARCHITEC‐
2881 TURES has multiple architectures for building OS X universal
2882 binaries. This indicates that the type size varies across archi‐
2883 tectures. In this case "${VARIABLE}_CODE" contains C preproces‐
2884 sor tests mapping from each architecture macro to the corre‐
2885 sponding type size. The list of architecture macros is stored in
2886 "${VARIABLE}_KEYS", and the value for each key is stored in
2887 "${VARIABLE}-${KEY}".
2888
2889
2890 If the BUILTIN_TYPES_ONLY option is not given, the macro checks
2891 for headers <sys/types.h>, <stdint.h>, and <stddef.h>, and saves
2892 results in HAVE_SYS_TYPES_H, HAVE_STDINT_H, and HAVE_STDDEF_H.
2893 The type size check automatically includes the available head‐
2894 ers, thus supporting checks of types defined in the headers.
2895
2896
2897 Despite the name of the macro you may use it to check the size
2898 of more complex expressions, too. To check e.g. for the size of
2899 a struct member you can do something like this:
2900
2901
2902 check_type_size("((struct something*)0)->member" SIZEOF_MEMBER)
2903
2904
2905
2906
2907 The following variables may be set before calling this macro to
2908 modify the way the check is run:
2909
2910
2911 CMAKE_REQUIRED_FLAGS = string of compile command line flags
2912 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
2913 CMAKE_REQUIRED_INCLUDES = list of include directories
2914 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
2915 CMAKE_EXTRA_INCLUDE_FILES = list of extra headers to include
2916
2917
2918 CheckVariableExists
2919 Check if the variable exists.
2920
2921 CHECK_VARIABLE_EXISTS(VAR VARIABLE)
2922
2923
2924
2925
2926 VAR - the name of the variable
2927 VARIABLE - variable to store the result
2928
2929
2930
2931
2932 This macro is only for C variables.
2933
2934
2935 The following variables may be set before calling this macro to
2936 modify the way the check is run:
2937
2938
2939 CMAKE_REQUIRED_FLAGS = string of compile command line flags
2940 CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
2941 CMAKE_REQUIRED_LIBRARIES = list of libraries to link
2942
2943
2944 Dart Configure a project for testing with CTest or old Dart Tcl
2945 Client
2946
2947 This file is the backwards-compatibility version of the CTest
2948 module. It supports using the old Dart 1 Tcl client for driving
2949 dashboard submissions as well as testing with CTest. This mod‐
2950 ule should be included in the CMakeLists.txt file at the top of
2951 a project. Typical usage:
2952
2953
2954 include(Dart)
2955 if(BUILD_TESTING)
2956 # ... testing related CMake code ...
2957 endif()
2958
2959 The BUILD_TESTING option is created by the Dart module to deter‐
2960 mine whether testing support should be enabled. The default is
2961 ON.
2962
2963
2964 DeployQt4
2965 Functions to help assemble a standalone Qt4 executable.
2966
2967 A collection of CMake utility functions useful for deploying Qt4
2968 executables.
2969
2970
2971 The following functions are provided by this module:
2972
2973
2974 write_qt4_conf
2975 resolve_qt4_paths
2976 fixup_qt4_executable
2977 install_qt4_plugin_path
2978 install_qt4_plugin
2979 install_qt4_executable
2980
2981 Requires CMake 2.6 or greater because it uses function and PAR‐
2982 ENT_SCOPE. Also depends on BundleUtilities.cmake.
2983
2984
2985 WRITE_QT4_CONF(<qt_conf_dir> <qt_conf_contents>)
2986
2987 Writes a qt.conf file with the <qt_conf_contents> into
2988 <qt_conf_dir>.
2989
2990
2991 RESOLVE_QT4_PATHS(<paths_var> [<executable_path>])
2992
2993 Loop through <paths_var> list and if any don't exist resolve
2994 them relative to the <executable_path> (if supplied) or the
2995 CMAKE_INSTALL_PREFIX.
2996
2997
2998 FIXUP_QT4_EXECUTABLE(<executable> [<qtplugins> <libs> <dirs> <plugins_dir> <request_qt_conf>])
2999
3000 Copies Qt plugins, writes a Qt configuration file (if needed)
3001 and fixes up a Qt4 executable using BundleUtilities so it is
3002 standalone and can be drag-and-drop copied to another machine as
3003 long as all of the system libraries are compatible.
3004
3005
3006 <executable> should point to the executable to be fixed-up.
3007
3008
3009 <qtplugins> should contain a list of the names or paths of any
3010 Qt plugins to be installed.
3011
3012
3013 <libs> will be passed to BundleUtilities and should be a list of
3014 any already installed plugins, libraries or executables to also
3015 be fixed-up.
3016
3017
3018 <dirs> will be passed to BundleUtilities and should contain and
3019 directories to be searched to find library dependencies.
3020
3021
3022 <plugins_dir> allows an custom plugins directory to be used.
3023
3024
3025 <request_qt_conf> will force a qt.conf file to be written even
3026 if not needed.
3027
3028
3029 INSTALL_QT4_PLUGIN_PATH(plugin executable copy installed_plugin_path_var <plugins_dir> <component> <configurations>)
3030
3031 Install (or copy) a resolved <plugin> to the default plugins
3032 directory (or <plugins_dir>) relative to <executable> and store
3033 the result in <installed_plugin_path_var>.
3034
3035
3036 If <copy> is set to TRUE then the plugins will be copied rather
3037 than installed. This is to allow this module to be used at CMake
3038 time rather than install time.
3039
3040
3041 If <component> is set then anything installed will use this COM‐
3042 PONENT.
3043
3044
3045 INSTALL_QT4_PLUGIN(plugin executable copy installed_plugin_path_var <plugins_dir> <component>)
3046
3047 Install (or copy) an unresolved <plugin> to the default plugins
3048 directory (or <plugins_dir>) relative to <executable> and store
3049 the result in <installed_plugin_path_var>. See documentation of
3050 INSTALL_QT4_PLUGIN_PATH.
3051
3052
3053 INSTALL_QT4_EXECUTABLE(<executable> [<qtplugins> <libs> <dirs> <plugins_dir> <request_qt_conf> <component>])
3054
3055 Installs Qt plugins, writes a Qt configuration file (if needed)
3056 and fixes up a Qt4 executable using BundleUtilities so it is
3057 standalone and can be drag-and-drop copied to another machine as
3058 long as all of the system libraries are compatible. The exe‐
3059 cutable will be fixed-up at install time. <component> is the
3060 COMPONENT used for bundle fixup and plugin installation. See
3061 documentation of FIXUP_QT4_BUNDLE.
3062
3063
3064 Documentation
3065 DocumentationVTK.cmake
3066
3067 This file provides support for the VTK documentation framework.
3068 It relies on several tools (Doxygen, Perl, etc).
3069
3070
3071 ExternalData
3072 Manage data files stored outside source tree
3073
3074 Use this module to unambiguously reference data files stored
3075 outside the source tree and fetch them at build time from arbi‐
3076 trary local and remote content-addressed locations. Functions
3077 provided by this module recognize arguments with the syntax
3078 "DATA{<name>}" as references to external data, replace them with
3079 full paths to local copies of those data, and create build rules
3080 to fetch and update the local copies.
3081
3082
3083 The DATA{} syntax is literal and the <name> is a full or rela‐
3084 tive path within the source tree. The source tree must contain
3085 either a real data file at <name> or a "content link" at
3086 <name><ext> containing a hash of the real file using a hash
3087 algorithm corresponding to <ext>. For example, the argument
3088 "DATA{img.png}" may be satisfied by either a real "img.png" file
3089 in the current source directory or a "img.png.md5" file contain‐
3090 ing its MD5 sum.
3091
3092
3093 The 'ExternalData_Expand_Arguments' function evaluates DATA{}
3094 references in its arguments and constructs a new list of argu‐
3095 ments:
3096
3097
3098 ExternalData_Expand_Arguments(
3099 <target> # Name of data management target
3100 <outVar> # Output variable
3101 [args...] # Input arguments, DATA{} allowed
3102 )
3103
3104 It replaces each DATA{} reference in an argument with the full
3105 path of a real data file on disk that will exist after the <tar‐
3106 get> builds.
3107
3108
3109 The 'ExternalData_Add_Test' function wraps around the CMake
3110 add_test() command but supports DATA{} references in its argu‐
3111 ments:
3112
3113
3114 ExternalData_Add_Test(
3115 <target> # Name of data management target
3116 ... # Arguments of add_test(), DATA{} allowed
3117 )
3118
3119 It passes its arguments through ExternalData_Expand_Arguments
3120 and then invokes add_test() using the results.
3121
3122
3123 The 'ExternalData_Add_Target' function creates a custom target
3124 to manage local instances of data files stored externally:
3125
3126
3127 ExternalData_Add_Target(
3128 <target> # Name of data management target
3129 )
3130
3131 It creates custom commands in the target as necessary to make
3132 data files available for each DATA{} reference previously evalu‐
3133 ated by other functions provided by this module. A list of URL
3134 templates must be provided in the variable ExternalData_URL_TEM‐
3135 PLATES using the placeholders "%(algo)" and "%(hash)" in each
3136 template. Data fetch rules try each URL template in order by
3137 substituting the hash algorithm name for "%(algo)" and the hash
3138 value for "%(hash)".
3139
3140
3141 The following hash algorithms are supported:
3142
3143
3144 %(algo) <ext> Description
3145 ------- ----- -----------
3146 MD5 .md5 Message-Digest Algorithm 5, RFC 1321
3147 SHA1 .sha1 US Secure Hash Algorithm 1, RFC 3174
3148 SHA224 .sha224 US Secure Hash Algorithms, RFC 4634
3149 SHA256 .sha256 US Secure Hash Algorithms, RFC 4634
3150 SHA384 .sha384 US Secure Hash Algorithms, RFC 4634
3151 SHA512 .sha512 US Secure Hash Algorithms, RFC 4634
3152
3153 Note that the hashes are used only for unique data identifica‐
3154 tion and download verification. This is not security software.
3155
3156
3157 Example usage:
3158
3159
3160 include(ExternalData)
3161 set(ExternalData_URL_TEMPLATES "file:///local/%(algo)/%(hash)"
3162 "http://data.org/%(algo)/%(hash)")
3163 ExternalData_Add_Test(MyData
3164 NAME MyTest
3165 COMMAND MyExe DATA{MyInput.png}
3166 )
3167 ExternalData_Add_Target(MyData)
3168
3169 When test "MyTest" runs the "DATA{MyInput.png}" argument will be
3170 replaced by the full path to a real instance of the data file
3171 "MyInput.png" on disk. If the source tree contains a content
3172 link such as "MyInput.png.md5" then the "MyData" target creates
3173 a real "MyInput.png" in the build tree.
3174
3175
3176 The DATA{} syntax can be told to fetch a file series using the
3177 form "DATA{<name>,:}", where the ":" is literal. If the source
3178 tree contains a group of files or content links named like a
3179 series then a reference to one member adds rules to fetch all of
3180 them. Although all members of a series are fetched, only the
3181 file originally named by the DATA{} argument is substituted for
3182 it. The default configuration recognizes file series names end‐
3183 ing with "#.ext", "_#.ext", ".#.ext", or "-#.ext" where "#" is a
3184 sequence of decimal digits and ".ext" is any single extension.
3185 Configure it with a regex that parses <number> and <suffix>
3186 parts from the end of <name>:
3187
3188
3189 ExternalData_SERIES_PARSE = regex of the form (<number>)(<suffix>)$
3190
3191 For more complicated cases set:
3192
3193
3194 ExternalData_SERIES_PARSE = regex with at least two () groups
3195 ExternalData_SERIES_PARSE_PREFIX = <prefix> regex group number, if any
3196 ExternalData_SERIES_PARSE_NUMBER = <number> regex group number
3197 ExternalData_SERIES_PARSE_SUFFIX = <suffix> regex group number
3198
3199 Configure series number matching with a regex that matches the
3200 <number> part of series members named <prefix><number><suffix>:
3201
3202
3203 ExternalData_SERIES_MATCH = regex matching <number> in all series members
3204
3205 Note that the <suffix> of a series does not include a hash-algo‐
3206 rithm extension.
3207
3208
3209 The DATA{} syntax can alternatively match files associated with
3210 the named file and contained in the same directory. Associated
3211 files may be specified by options using the syntax
3212 DATA{<name>,<opt1>,<opt2>,...}. Each option may specify one
3213 file by name or specify a regular expression to match file names
3214 using the syntax REGEX:<regex>. For example, the arguments
3215
3216
3217 DATA{MyData/MyInput.mhd,MyInput.img} # File pair
3218 DATA{MyData/MyFrames00.png,REGEX:MyFrames[0-9]+\\.png} # Series
3219
3220 will pass MyInput.mha and MyFrames00.png on the command line but
3221 ensure that the associated files are present next to them.
3222
3223
3224 The DATA{} syntax may reference a directory using a trailing
3225 slash and a list of associated files. The form
3226 DATA{<name>/,<opt1>,<opt2>,...} adds rules to fetch any files in
3227 the directory that match one of the associated file options.
3228 For example, the argument DATA{MyDataDir/,REGEX:.*} will pass
3229 the full path to a MyDataDir directory on the command line and
3230 ensure that the directory contains files corresponding to every
3231 file or content link in the MyDataDir source directory.
3232
3233
3234 The variable ExternalData_LINK_CONTENT may be set to the name of
3235 a supported hash algorithm to enable automatic conversion of
3236 real data files referenced by the DATA{} syntax into content
3237 links. For each such <file> a content link named "<file><ext>"
3238 is created. The original file is renamed to the form ".Exter‐
3239 nalData_<algo>_<hash>" to stage it for future transmission to
3240 one of the locations in the list of URL templates (by means out‐
3241 side the scope of this module). The data fetch rule created for
3242 the content link will use the staged object if it cannot be
3243 found using any URL template.
3244
3245
3246 The variable ExternalData_OBJECT_STORES may be set to a list of
3247 local directories that store objects using the layout
3248 <dir>/%(algo)/%(hash). These directories will be searched first
3249 for a needed object. If the object is not available in any
3250 store then it will be fetched remotely using the URL templates
3251 and added to the first local store listed. If no stores are
3252 specified the default is a location inside the build tree.
3253
3254
3255 The variable ExternalData_SOURCE_ROOT may be set to the highest
3256 source directory containing any path named by a DATA{} refer‐
3257 ence. The default is CMAKE_SOURCE_DIR. External‐
3258 Data_SOURCE_ROOT and CMAKE_SOURCE_DIR must refer to directories
3259 within a single source distribution (e.g. they come together in
3260 one tarball).
3261
3262
3263 The variable ExternalData_BINARY_ROOT may be set to the direc‐
3264 tory to hold the real data files named by expanded DATA{} refer‐
3265 ences. The default is CMAKE_BINARY_DIR. The directory layout
3266 will mirror that of content links under External‐
3267 Data_SOURCE_ROOT.
3268
3269
3270 Variables ExternalData_TIMEOUT_INACTIVITY and ExternalData_TIME‐
3271 OUT_ABSOLUTE set the download inactivity and absolute timeouts,
3272 in seconds. The defaults are 60 seconds and 300 seconds,
3273 respectively. Set either timeout to 0 seconds to disable
3274 enforcement.
3275
3276
3277 ExternalProject
3278 Create custom targets to build projects in external trees
3279
3280 The 'ExternalProject_Add' function creates a custom target to
3281 drive download, update/patch, configure, build, install and test
3282 steps of an external project:
3283
3284
3285 ExternalProject_Add(<name> # Name for custom target
3286 [DEPENDS projects...] # Targets on which the project depends
3287 [PREFIX dir] # Root dir for entire project
3288 [LIST_SEPARATOR sep] # Sep to be replaced by ; in cmd lines
3289 [TMP_DIR dir] # Directory to store temporary files
3290 [STAMP_DIR dir] # Directory to store step timestamps
3291 #--Download step--------------
3292 [DOWNLOAD_NAME fname] # File name to store (if not end of URL)
3293 [DOWNLOAD_DIR dir] # Directory to store downloaded files
3294 [DOWNLOAD_COMMAND cmd...] # Command to download source tree
3295 [CVS_REPOSITORY cvsroot] # CVSROOT of CVS repository
3296 [CVS_MODULE mod] # Module to checkout from CVS repo
3297 [CVS_TAG tag] # Tag to checkout from CVS repo
3298 [SVN_REPOSITORY url] # URL of Subversion repo
3299 [SVN_REVISION rev] # Revision to checkout from Subversion repo
3300 [SVN_USERNAME john ] # Username for Subversion checkout and update
3301 [SVN_PASSWORD doe ] # Password for Subversion checkout and update
3302 [SVN_TRUST_CERT 1 ] # Trust the Subversion server site certificate
3303 [GIT_REPOSITORY url] # URL of git repo
3304 [GIT_TAG tag] # Git branch name, commit id or tag
3305 [HG_REPOSITORY url] # URL of mercurial repo
3306 [HG_TAG tag] # Mercurial branch name, commit id or tag
3307 [URL /.../src.tgz] # Full path or URL of source
3308 [URL_HASH ALGO=value] # Hash of file at URL
3309 [URL_MD5 md5] # Equivalent to URL_HASH MD5=md5
3310 [TLS_VERIFY bool] # Should certificate for https be checked
3311 [TLS_CAINFO file] # Path to a certificate authority file
3312 [TIMEOUT seconds] # Time allowed for file download operations
3313 #--Update/Patch step----------
3314 [UPDATE_COMMAND cmd...] # Source work-tree update command
3315 [PATCH_COMMAND cmd...] # Command to patch downloaded source
3316 #--Configure step-------------
3317 [SOURCE_DIR dir] # Source dir to be used for build
3318 [CONFIGURE_COMMAND cmd...] # Build tree configuration command
3319 [CMAKE_COMMAND /.../cmake] # Specify alternative cmake executable
3320 [CMAKE_GENERATOR gen] # Specify generator for native build
3321 [CMAKE_GENERATOR_TOOLSET t] # Generator-specific toolset name
3322 [CMAKE_ARGS args...] # Arguments to CMake command line
3323 [CMAKE_CACHE_ARGS args...] # Initial cache arguments, of the form -Dvar:string=on
3324 #--Build step-----------------
3325 [BINARY_DIR dir] # Specify build dir location
3326 [BUILD_COMMAND cmd...] # Command to drive the native build
3327 [BUILD_IN_SOURCE 1] # Use source dir for build dir
3328 #--Install step---------------
3329 [INSTALL_DIR dir] # Installation prefix
3330 [INSTALL_COMMAND cmd...] # Command to drive install after build
3331 #--Test step------------------
3332 [TEST_BEFORE_INSTALL 1] # Add test step executed before install step
3333 [TEST_AFTER_INSTALL 1] # Add test step executed after install step
3334 [TEST_COMMAND cmd...] # Command to drive test
3335 #--Output logging-------------
3336 [LOG_DOWNLOAD 1] # Wrap download in script to log output
3337 [LOG_UPDATE 1] # Wrap update in script to log output
3338 [LOG_CONFIGURE 1] # Wrap configure in script to log output
3339 [LOG_BUILD 1] # Wrap build in script to log output
3340 [LOG_TEST 1] # Wrap test in script to log output
3341 [LOG_INSTALL 1] # Wrap install in script to log output
3342 #--Custom targets-------------
3343 [STEP_TARGETS st1 st2 ...] # Generate custom targets for these steps
3344 )
3345
3346 The *_DIR options specify directories for the project, with
3347 default directories computed as follows. If the PREFIX option is
3348 given to ExternalProject_Add() or the EP_PREFIX directory prop‐
3349 erty is set, then an external project is built and installed
3350 under the specified prefix:
3351
3352
3353 TMP_DIR = <prefix>/tmp
3354 STAMP_DIR = <prefix>/src/<name>-stamp
3355 DOWNLOAD_DIR = <prefix>/src
3356 SOURCE_DIR = <prefix>/src/<name>
3357 BINARY_DIR = <prefix>/src/<name>-build
3358 INSTALL_DIR = <prefix>
3359
3360 Otherwise, if the EP_BASE directory property is set then compo‐
3361 nents of an external project are stored under the specified
3362 base:
3363
3364
3365 TMP_DIR = <base>/tmp/<name>
3366 STAMP_DIR = <base>/Stamp/<name>
3367 DOWNLOAD_DIR = <base>/Download/<name>
3368 SOURCE_DIR = <base>/Source/<name>
3369 BINARY_DIR = <base>/Build/<name>
3370 INSTALL_DIR = <base>/Install/<name>
3371
3372 If no PREFIX, EP_PREFIX, or EP_BASE is specified then the
3373 default is to set PREFIX to "<name>-prefix". Relative paths are
3374 interpreted with respect to the build directory corresponding to
3375 the source directory in which ExternalProject_Add is invoked.
3376
3377
3378 If SOURCE_DIR is explicitly set to an existing directory the
3379 project will be built from it. Otherwise a download step must be
3380 specified using one of the DOWNLOAD_COMMAND, CVS_*, SVN_*, or
3381 URL options. The URL option may refer locally to a directory or
3382 source tarball, or refer to a remote tarball (e.g.
3383 http://.../src.tgz).
3384
3385
3386 The 'ExternalProject_Add_Step' function adds a custom step to an
3387 external project:
3388
3389
3390 ExternalProject_Add_Step(<name> <step> # Names of project and custom step
3391 [COMMAND cmd...] # Command line invoked by this step
3392 [COMMENT "text..."] # Text printed when step executes
3393 [DEPENDEES steps...] # Steps on which this step depends
3394 [DEPENDERS steps...] # Steps that depend on this step
3395 [DEPENDS files...] # Files on which this step depends
3396 [ALWAYS 1] # No stamp file, step always runs
3397 [WORKING_DIRECTORY dir] # Working directory for command
3398 [LOG 1] # Wrap step in script to log output
3399 )
3400
3401 The command line, comment, and working directory of every stan‐
3402 dard and custom step is processed to replace tokens
3403 <SOURCE_DIR>, <BINARY_DIR>, <INSTALL_DIR>, and <TMP_DIR> with
3404 corresponding property values.
3405
3406
3407 Any builtin step that specifies a "<step>_COMMAND cmd..." or
3408 custom step that specifies a "COMMAND cmd..." may specify addi‐
3409 tional command lines using the form "COMMAND cmd...". At build
3410 time the commands will be executed in order and aborted if any
3411 one fails. For example:
3412
3413
3414 ... BUILD_COMMAND make COMMAND echo done ...
3415
3416 specifies to run "make" and then "echo done" during the build
3417 step. Whether the current working directory is preserved between
3418 commands is not defined. Behavior of shell operators like "&&"
3419 is not defined.
3420
3421
3422 The 'ExternalProject_Get_Property' function retrieves external
3423 project target properties:
3424
3425
3426 ExternalProject_Get_Property(<name> [prop1 [prop2 [...]]])
3427
3428 It stores property values in variables of the same name. Prop‐
3429 erty names correspond to the keyword argument names of 'Exter‐
3430 nalProject_Add'.
3431
3432
3433 The 'ExternalProject_Add_StepTargets' function generates custom
3434 targets for the steps listed:
3435
3436
3437 ExternalProject_Add_StepTargets(<name> [step1 [step2 [...]]])
3438
3439
3440
3441
3442 If STEP_TARGETS is set then ExternalProject_Add_StepTargets is
3443 automatically called at the end of matching calls to External‐
3444 Project_Add_Step. Pass STEP_TARGETS explicitly to individual
3445 ExternalProject_Add calls, or implicitly to all ExternalPro‐
3446 ject_Add calls by setting the directory property EP_STEP_TAR‐
3447 GETS.
3448
3449
3450 If STEP_TARGETS is not set, clients may still manually call
3451 ExternalProject_Add_StepTargets after calling ExternalPro‐
3452 ject_Add or ExternalProject_Add_Step.
3453
3454
3455 This functionality is provided to make it easy to drive the
3456 steps independently of each other by specifying targets on build
3457 command lines. For example, you may be submitting to a
3458 sub-project based dashboard, where you want to drive the config‐
3459 ure portion of the build, then submit to the dashboard, followed
3460 by the build portion, followed by tests. If you invoke a custom
3461 target that depends on a step halfway through the step depen‐
3462 dency chain, then all the previous steps will also run to ensure
3463 everything is up to date.
3464
3465
3466 For example, to drive configure, build and test steps indepen‐
3467 dently for each ExternalProject_Add call in your project, write
3468 the following line prior to any ExternalProject_Add calls in
3469 your CMakeLists file:
3470
3471
3472 set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure build test)
3473
3474
3475 FeatureSummary
3476 Macros for generating a summary of enabled/disabled features
3477
3478
3479
3480
3481 This module provides the macros feature_summary(), set_pack‐
3482 age_properties() and add_feature_info(). For compatibility it
3483 also still provides set_package_info(), set_feature_info(),
3484 print_enabled_features() and print_disabled_features().
3485
3486
3487 These macros can be used to generate a summary of enabled and
3488 disabled packages and/or feature for a build tree:
3489
3490
3491 -- The following OPTIONAL packages have been found:
3492 LibXml2 (required version >= 2.4) , XML processing library. , <http://xmlsoft.org>
3493 * Enables HTML-import in MyWordProcessor
3494 * Enables odt-export in MyWordProcessor
3495 PNG , A PNG image library. , <http://www.libpng.org/pub/png/>
3496 * Enables saving screenshots
3497 -- The following OPTIONAL packages have not been found:
3498 Lua51 , The Lua scripting language. , <http://www.lua.org>
3499 * Enables macros in MyWordProcessor
3500 Foo , Foo provides cool stuff.
3501
3502
3503
3504
3505
3506
3507
3508 FEATURE_SUMMARY( [FILENAME <file>]
3509 [APPEND]
3510 [VAR <variable_name>]
3511 [INCLUDE_QUIET_PACKAGES]
3512 [FATAL_ON_MISSING_REQUIRED_PACKAGES]
3513 [DESCRIPTION "Found packages:"]
3514 WHAT (ALL | PACKAGES_FOUND | PACKAGES_NOT_FOUND
3515 | ENABLED_FEATURES | DISABLED_FEATURES]
3516 )
3517
3518
3519
3520
3521 The FEATURE_SUMMARY() macro can be used to print information
3522 about enabled or disabled packages or features of a project. By
3523 default, only the names of the features/packages will be printed
3524 and their required version when one was specified. Use SET_PACK‐
3525 AGE_PROPERTIES() to add more useful information, like e.g. a
3526 download URL for the respective package or their purpose in the
3527 project.
3528
3529
3530 The WHAT option is the only mandatory option. Here you specify
3531 what information will be printed:
3532
3533
3534 ALL: print everything
3535 ENABLED_FEATURES: the list of all features which are enabled
3536 DISABLED_FEATURES: the list of all features which are disabled
3537 PACKAGES_FOUND: the list of all packages which have been found
3538 PACKAGES_NOT_FOUND: the list of all packages which have not been found
3539 OPTIONAL_PACKAGES_FOUND: only those packages which have been found which have the type OPTIONAL
3540 OPTIONAL_PACKAGES_NOT_FOUND: only those packages which have not been found which have the type OPTIONAL
3541 RECOMMENDED_PACKAGES_FOUND: only those packages which have been found which have the type RECOMMENDED
3542 RECOMMENDED_PACKAGES_NOT_FOUND: only those packages which have not been found which have the type RECOMMENDED
3543 REQUIRED_PACKAGES_FOUND: only those packages which have been found which have the type REQUIRED
3544 REQUIRED_PACKAGES_NOT_FOUND: only those packages which have not been found which have the type REQUIRED
3545 RUNTIME_PACKAGES_FOUND: only those packages which have been found which have the type RUNTIME
3546 RUNTIME_PACKAGES_NOT_FOUND: only those packages which have not been found which have the type RUNTIME
3547
3548
3549
3550
3551 If a FILENAME is given, the information is printed into this
3552 file. If APPEND is used, it is appended to this file, otherwise
3553 the file is overwritten if it already existed. If the VAR option
3554 is used, the information is "printed" into the specified vari‐
3555 able. If FILENAME is not used, the information is printed to the
3556 terminal. Using the DESCRIPTION option a description or headline
3557 can be set which will be printed above the actual content. If
3558 INCLUDE_QUIET_PACKAGES is given, packages which have been
3559 searched with find_package(... QUIET) will also be listed. By
3560 default they are skipped. If FATAL_ON_MISSING_REQUIRED_PACKAGES
3561 is given, CMake will abort if a package which is marked as
3562 REQUIRED has not been found.
3563
3564
3565 Example 1, append everything to a file:
3566
3567
3568 feature_summary(WHAT ALL
3569 FILENAME ${CMAKE_BINARY_DIR}/all.log APPEND)
3570
3571
3572
3573
3574 Example 2, print the enabled features into the variable enabled‐
3575 FeaturesText, including QUIET packages:
3576
3577
3578 feature_summary(WHAT ENABLED_FEATURES
3579 INCLUDE_QUIET_PACKAGES
3580 DESCRIPTION "Enabled Features:"
3581 VAR enabledFeaturesText)
3582 message(STATUS "${enabledFeaturesText}")
3583
3584
3585
3586
3587
3588
3589
3590 SET_PACKAGE_PROPERTIES(<name> PROPERTIES [ URL <url> ]
3591 [ DESCRIPTION <description> ]
3592 [ TYPE (RUNTIME|OPTIONAL|RECOMMENDED|REQUIRED) ]
3593 [ PURPOSE <purpose> ]
3594 )
3595
3596
3597
3598
3599 Use this macro to set up information about the named package,
3600 which can then be displayed via FEATURE_SUMMARY(). This can be
3601 done either directly in the Find-module or in the project which
3602 uses the module after the find_package() call. The features for
3603 which information can be set are added automatically by the
3604 find_package() command.
3605
3606
3607 URL: this should be the homepage of the package, or something
3608 similar. Ideally this is set already directly in the Find-mod‐
3609 ule.
3610
3611
3612 DESCRIPTION: A short description what that package is, at most
3613 one sentence. Ideally this is set already directly in the
3614 Find-module.
3615
3616
3617 TYPE: What type of dependency has the using project on that
3618 package. Default is OPTIONAL. In this case it is a package which
3619 can be used by the project when available at buildtime, but it
3620 also work without. RECOMMENDED is similar to OPTIONAL, i.e. the
3621 project will build if the package is not present, but the func‐
3622 tionality of the resulting binaries will be severly limited. If
3623 a REQUIRED package is not available at buildtime, the project
3624 may not even build. This can be combined with the FATAL_ON_MISS‐
3625 ING_REQUIRED_PACKAGES argument for feature_summary(). Last, a
3626 RUNTIME package is a package which is actually not used at all
3627 during the build, but which is required for actually running the
3628 resulting binaries. So if such a package is missing, the project
3629 can still be built, but it may not work later on. If set_pack‐
3630 age_properties() is called multiple times for the same package
3631 with different TYPEs, the TYPE is only changed to higher TYPEs (
3632 RUNTIME < OPTIONAL < RECOMMENDED < REQUIRED ), lower TYPEs are
3633 ignored. The TYPE property is project-specific, so it cannot be
3634 set by the Find-module, but must be set in the project.
3635
3636
3637 PURPOSE: This describes which features this package enables in
3638 the project, i.e. it tells the user what functionality he gets
3639 in the resulting binaries. If set_package_properties() is called
3640 multiple times for a package, all PURPOSE properties are
3641 appended to a list of purposes of the package in the project. As
3642 the TYPE property, also the PURPOSE property is project-spe‐
3643 cific, so it cannot be set by the Find-module, but must be set
3644 in the project.
3645
3646
3647
3648
3649
3650 Example for setting the info for a package:
3651
3652
3653 find_package(LibXml2)
3654 set_package_properties(LibXml2 PROPERTIES DESCRIPTION "A XML processing library."
3655 URL "http://xmlsoft.org/")
3656
3657
3658
3659
3660 set_package_properties(LibXml2 PROPERTIES TYPE RECOMMENDED
3661 PURPOSE "Enables HTML-import in MyWordProcessor")
3662 ...
3663 set_package_properties(LibXml2 PROPERTIES TYPE OPTIONAL
3664 PURPOSE "Enables odt-export in MyWordProcessor")
3665
3666
3667
3668
3669 find_package(DBUS)
3670 set_package_properties(DBUS PROPERTIES TYPE RUNTIME
3671 PURPOSE "Necessary to disable the screensaver during a presentation" )
3672
3673
3674
3675
3676 ADD_FEATURE_INFO(<name> <enabled> <description>)
3677
3678 Use this macro to add information about a feature with the given
3679 <name>. <enabled> contains whether this feature is enabled or
3680 not, <description> is a text describing the feature. The infor‐
3681 mation can be displayed using feature_summary() for ENABLED_FEA‐
3682 TURES and DISABLED_FEATURES respectively.
3683
3684
3685 Example for setting the info for a feature:
3686
3687
3688 option(WITH_FOO "Help for foo" ON)
3689 add_feature_info(Foo WITH_FOO "The Foo feature provides very cool stuff.")
3690
3691
3692
3693
3694
3695
3696
3697 The following macros are provided for compatibility with previ‐
3698 ous CMake versions:
3699
3700
3701 SET_PACKAGE_INFO(<name> <description> [<url> [<purpose>] ] )
3702
3703 Use this macro to set up information about the named package,
3704 which can then be displayed via FEATURE_SUMMARY(). This can be
3705 done either directly in the Find-module or in the project which
3706 uses the module after the find_package() call. The features for
3707 which information can be set are added automatically by the
3708 find_package() command.
3709
3710
3711 PRINT_ENABLED_FEATURES()
3712
3713 Does the same as FEATURE_SUMMARY(WHAT ENABLED_FEATURES DESCRIP‐
3714 TION "Enabled features:")
3715
3716
3717 PRINT_DISABLED_FEATURES()
3718
3719 Does the same as FEATURE_SUMMARY(WHAT DISABLED_FEATURES
3720 DESCRIPTION "Disabled features:")
3721
3722
3723 SET_FEATURE_INFO(<name> <description> [<url>] )
3724
3725 Does the same as SET_PACKAGE_INFO(<name> <description> <url> )
3726
3727
3728 FindALSA
3729 Find alsa
3730
3731 Find the alsa libraries (asound)
3732
3733
3734 This module defines the following variables:
3735 ALSA_FOUND - True if ALSA_INCLUDE_DIR & ALSA_LIBRARY are found
3736 ALSA_LIBRARIES - Set when ALSA_LIBRARY is found
3737 ALSA_INCLUDE_DIRS - Set when ALSA_INCLUDE_DIR is found
3738
3739
3740
3741
3742 ALSA_INCLUDE_DIR - where to find asoundlib.h, etc.
3743 ALSA_LIBRARY - the asound library
3744 ALSA_VERSION_STRING - the version of alsa found (since CMake 2.8.8)
3745
3746
3747
3748
3749
3750 FindASPELL
3751 Try to find ASPELL
3752
3753 Once done this will define
3754
3755
3756 ASPELL_FOUND - system has ASPELL
3757 ASPELL_EXECUTABLE - the ASPELL executable
3758 ASPELL_INCLUDE_DIR - the ASPELL include directory
3759 ASPELL_LIBRARIES - The libraries needed to use ASPELL
3760 ASPELL_DEFINITIONS - Compiler switches required for using ASPELL
3761
3762
3763 FindAVIFile
3764 Locate AVIFILE library and include paths
3765
3766 AVIFILE (http://avifile.sourceforge.net/)is a set of libraries
3767 for i386 machines to use various AVI codecs. Support is limited
3768 beyond Linux. Windows provides native AVI support, and so
3769 doesn't need this library. This module defines
3770
3771
3772 AVIFILE_INCLUDE_DIR, where to find avifile.h , etc.
3773 AVIFILE_LIBRARIES, the libraries to link against
3774 AVIFILE_DEFINITIONS, definitions to use when compiling
3775 AVIFILE_FOUND, If false, don't try to use AVIFILE
3776
3777
3778 FindArmadillo
3779 Find Armadillo
3780
3781 Find the Armadillo C++ library
3782
3783
3784 Using Armadillo:
3785
3786
3787 find_package(Armadillo REQUIRED)
3788 include_directories(${ARMADILLO_INCLUDE_DIRS})
3789 add_executable(foo foo.cc)
3790 target_link_libraries(foo ${ARMADILLO_LIBRARIES})
3791
3792 This module sets the following variables:
3793
3794
3795 ARMADILLO_FOUND - set to true if the library is found
3796 ARMADILLO_INCLUDE_DIRS - list of required include directories
3797 ARMADILLO_LIBRARIES - list of libraries to be linked
3798 ARMADILLO_VERSION_MAJOR - major version number
3799 ARMADILLO_VERSION_MINOR - minor version number
3800 ARMADILLO_VERSION_PATCH - patch version number
3801 ARMADILLO_VERSION_STRING - version number as a string (ex: "1.0.4")
3802 ARMADILLO_VERSION_NAME - name of the version (ex: "Antipodean Antileech")
3803
3804
3805 FindBISON
3806 Find bison executable and provides macros to generate custom
3807 build rules
3808
3809 The module defines the following variables:
3810
3811
3812 BISON_EXECUTABLE - path to the bison program
3813 BISON_VERSION - version of bison
3814 BISON_FOUND - true if the program was found
3815
3816
3817
3818
3819 The minimum required version of bison can be specified using the
3820 standard CMake syntax, e.g. find_package(BISON 2.1.3)
3821
3822
3823 If bison is found, the module defines the macros:
3824
3825
3826 BISON_TARGET(<Name> <YaccInput> <CodeOutput> [VERBOSE <file>]
3827 [COMPILE_FLAGS <string>])
3828
3829 which will create a custom rule to generate a parser. <YaccIn‐
3830 put> is the path to a yacc file. <CodeOutput> is the name of
3831 the source file generated by bison. A header file is also be
3832 generated, and contains the token list. If COMPILE_FLAGS
3833 option is specified, the next parameter is added in the
3834 bison command line. if VERBOSE option is specified, <file> is
3835 created and contains verbose descriptions of the grammar and
3836 parser. The macro defines a set of variables:
3837
3838
3839 BISON_${Name}_DEFINED - true is the macro ran successfully
3840 BISON_${Name}_INPUT - The input source file, an alias for <YaccInput>
3841 BISON_${Name}_OUTPUT_SOURCE - The source file generated by bison
3842 BISON_${Name}_OUTPUT_HEADER - The header file generated by bison
3843 BISON_${Name}_OUTPUTS - The sources files generated by bison
3844 BISON_${Name}_COMPILE_FLAGS - Options used in the bison command line
3845
3846
3847
3848
3849 ====================================================================
3850 Example:
3851
3852
3853
3854
3855 find_package(BISON)
3856 BISON_TARGET(MyParser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp)
3857 add_executable(Foo main.cpp ${BISON_MyParser_OUTPUTS})
3858 ====================================================================
3859
3860
3861 FindBLAS
3862 Find BLAS library
3863
3864 This module finds an installed fortran library that implements
3865 the BLAS linear-algebra interface (see
3866 http://www.netlib.org/blas/). The list of libraries searched for
3867 is taken from the autoconf macro file, acx_blas.m4 (distributed
3868 at http://ac-archive.sourceforge.net/ac-archive/acx_blas.html).
3869
3870
3871 This module sets the following variables:
3872
3873
3874 BLAS_FOUND - set to true if a library implementing the BLAS interface
3875 is found
3876 BLAS_LINKER_FLAGS - uncached list of required linker flags (excluding -l
3877 and -L).
3878 BLAS_LIBRARIES - uncached list of libraries (using full path name) to
3879 link against to use BLAS
3880 BLAS95_LIBRARIES - uncached list of libraries (using full path name)
3881 to link against to use BLAS95 interface
3882 BLAS95_FOUND - set to true if a library implementing the BLAS f95 interface
3883 is found
3884 BLA_STATIC if set on this determines what kind of linkage we do (static)
3885 BLA_VENDOR if set checks only the specified vendor, if not set checks
3886 all the possibilities
3887 BLA_F95 if set on tries to find the f95 interfaces for BLAS/LAPACK
3888
3889 C/CXX should be enabled to use Intel mkl
3890
3891
3892 FindBZip2
3893 Try to find BZip2
3894
3895 Once done this will define
3896
3897
3898 BZIP2_FOUND - system has BZip2
3899 BZIP2_INCLUDE_DIR - the BZip2 include directory
3900 BZIP2_LIBRARIES - Link these to use BZip2
3901 BZIP2_NEED_PREFIX - this is set if the functions are prefixed with BZ2_
3902 BZIP2_VERSION_STRING - the version of BZip2 found (since CMake 2.8.8)
3903
3904
3905 FindBoost
3906 Find Boost include dirs and libraries
3907
3908 Use this module by invoking find_package with the form:
3909
3910
3911 find_package(Boost
3912 [version] [EXACT] # Minimum or EXACT version e.g. 1.36.0
3913 [REQUIRED] # Fail with error if Boost is not found
3914 [COMPONENTS <libs>...] # Boost libraries by their canonical name
3915 ) # e.g. "date_time" for "libboost_date_time"
3916
3917 This module finds headers and requested component libraries OR a
3918 CMake package configuration file provided by a "Boost CMake"
3919 build. For the latter case skip to the "Boost CMake" section
3920 below. For the former case results are reported in variables:
3921
3922
3923 Boost_FOUND - True if headers and requested libraries were found
3924 Boost_INCLUDE_DIRS - Boost include directories
3925 Boost_LIBRARY_DIRS - Link directories for Boost libraries
3926 Boost_LIBRARIES - Boost component libraries to be linked
3927 Boost_<C>_FOUND - True if component <C> was found (<C> is upper-case)
3928 Boost_<C>_LIBRARY - Libraries to link for component <C> (may include
3929 target_link_libraries debug/optimized keywords)
3930 Boost_VERSION - BOOST_VERSION value from boost/version.hpp
3931 Boost_LIB_VERSION - Version string appended to library filenames
3932 Boost_MAJOR_VERSION - Boost major version number (X in X.y.z)
3933 Boost_MINOR_VERSION - Boost minor version number (Y in x.Y.z)
3934 Boost_SUBMINOR_VERSION - Boost subminor version number (Z in x.y.Z)
3935 Boost_LIB_DIAGNOSTIC_DEFINITIONS (Windows)
3936 - Pass to add_definitions() to have diagnostic
3937 information about Boost's automatic linking
3938 displayed during compilation
3939
3940
3941
3942
3943 This module reads hints about search locations from variables:
3944
3945
3946 BOOST_ROOT - Preferred installation prefix
3947 (or BOOSTROOT)
3948 BOOST_INCLUDEDIR - Preferred include directory e.g. <prefix>/include
3949 BOOST_LIBRARYDIR - Preferred library directory e.g. <prefix>/lib
3950 Boost_NO_SYSTEM_PATHS - Set to ON to disable searching in locations not
3951 specified by these hint variables. Default is OFF.
3952 Boost_ADDITIONAL_VERSIONS
3953 - List of Boost versions not known to this module
3954 (Boost install locations may contain the version)
3955
3956 and saves search results persistently in CMake cache entries:
3957
3958
3959 Boost_INCLUDE_DIR - Directory containing Boost headers
3960 Boost_LIBRARY_DIR - Directory containing Boost libraries
3961 Boost_<C>_LIBRARY_DEBUG - Component <C> library debug variant
3962 Boost_<C>_LIBRARY_RELEASE - Component <C> library release variant
3963
3964 Users may set these hints or results as cache entries. Projects
3965 should not read these entries directly but instead use the above
3966 result variables. Note that some hint names start in upper-case
3967 "BOOST". One may specify these as environment variables if they
3968 are not specified as CMake variables or cache entries.
3969
3970
3971 This module first searches for the Boost header files using the
3972 above hint variables (excluding BOOST_LIBRARYDIR) and saves the
3973 result in Boost_INCLUDE_DIR. Then it searches for requested
3974 component libraries using the above hints (excluding
3975 BOOST_INCLUDEDIR and Boost_ADDITIONAL_VERSIONS), "lib" directo‐
3976 ries near Boost_INCLUDE_DIR, and the library name configuration
3977 settings below. It saves the library directory in
3978 Boost_LIBRARY_DIR and individual library locations in
3979 Boost_<C>_LIBRARY_DEBUG and Boost_<C>_LIBRARY_RELEASE. When one
3980 changes settings used by previous searches in the same build
3981 tree (excluding environment variables) this module discards pre‐
3982 vious search results affected by the changes and searches again.
3983
3984
3985 Boost libraries come in many variants encoded in their file
3986 name. Users or projects may tell this module which variant to
3987 find by setting variables:
3988
3989
3990 Boost_USE_MULTITHREADED - Set to OFF to use the non-multithreaded
3991 libraries ('mt' tag). Default is ON.
3992 Boost_USE_STATIC_LIBS - Set to ON to force the use of the static
3993 libraries. Default is OFF.
3994 Boost_USE_STATIC_RUNTIME - Set to ON or OFF to specify whether to use
3995 libraries linked statically to the C++ runtime
3996 ('s' tag). Default is platform dependent.
3997 Boost_USE_DEBUG_PYTHON - Set to ON to use libraries compiled with a
3998 debug Python build ('y' tag). Default is OFF.
3999 Boost_USE_STLPORT - Set to ON to use libraries compiled with
4000 STLPort ('p' tag). Default is OFF.
4001 Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS
4002 - Set to ON to use libraries compiled with
4003 STLPort deprecated "native iostreams"
4004 ('n' tag). Default is OFF.
4005 Boost_COMPILER - Set to the compiler-specific library suffix
4006 (e.g. "-gcc43"). Default is auto-computed
4007 for the C++ compiler in use.
4008 Boost_THREADAPI - Suffix for "thread" component library name,
4009 such as "pthread" or "win32". Names with
4010 and without this suffix will both be tried.
4011
4012 Other variables one may set to control this module are:
4013
4014
4015 Boost_DEBUG - Set to ON to enable debug output from FindBoost.
4016 Please enable this before filing any bug report.
4017 Boost_DETAILED_FAILURE_MSG
4018 - Set to ON to add detailed information to the
4019 failure message even when the REQUIRED option
4020 is not given to the find_package call.
4021 Boost_REALPATH - Set to ON to resolve symlinks for discovered
4022 libraries to assist with packaging. For example,
4023 the "system" component library may be resolved to
4024 "/usr/lib/libboost_system.so.1.42.0" instead of
4025 "/usr/lib/libboost_system.so". This does not
4026 affect linking and should not be enabled unless
4027 the user needs this information.
4028
4029 On Visual Studio and Borland compilers Boost headers request
4030 automatic linking to corresponding libraries. This requires
4031 matching libraries to be linked explicitly or available in the
4032 link library search path. In this case setting
4033 Boost_USE_STATIC_LIBS to OFF may not achieve dynamic linking.
4034 Boost automatic linking typically requests static libraries with
4035 a few exceptions (such as Boost.Python). Use
4036
4037
4038 add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
4039
4040 to ask Boost to report information about automatic linking
4041 requests.
4042
4043
4044 Example to find Boost headers only:
4045
4046
4047 find_package(Boost 1.36.0)
4048 if(Boost_FOUND)
4049 include_directories(${Boost_INCLUDE_DIRS})
4050 add_executable(foo foo.cc)
4051 endif()
4052
4053 Example to find Boost headers and some libraries:
4054
4055
4056 set(Boost_USE_STATIC_LIBS ON)
4057 set(Boost_USE_MULTITHREADED ON)
4058 set(Boost_USE_STATIC_RUNTIME OFF)
4059 find_package(Boost 1.36.0 COMPONENTS date_time filesystem system ...)
4060 if(Boost_FOUND)
4061 include_directories(${Boost_INCLUDE_DIRS})
4062 add_executable(foo foo.cc)
4063 target_link_libraries(foo ${Boost_LIBRARIES})
4064 endif()
4065
4066
4067
4068
4069 Boost CMake
4070 ----------------------------------------------------------
4071
4072
4073 If Boost was built using the boost-cmake project it provides a
4074 package configuration file for use with find_package's Config
4075 mode. This module looks for the package configuration file
4076 called BoostConfig.cmake or boost-config.cmake and stores the
4077 result in cache entry "Boost_DIR". If found, the package con‐
4078 figuration file is loaded and this module returns with no fur‐
4079 ther action. See documentation of the Boost CMake package con‐
4080 figuration for details on what it provides.
4081
4082
4083 Set Boost_NO_BOOST_CMAKE to ON to disable the search for
4084 boost-cmake.
4085
4086
4087 FindBullet
4088 Try to find the Bullet physics engine
4089
4090
4091
4092
4093 This module defines the following variables
4094
4095
4096
4097
4098 BULLET_FOUND - Was bullet found
4099 BULLET_INCLUDE_DIRS - the Bullet include directories
4100 BULLET_LIBRARIES - Link to this, by default it includes
4101 all bullet components (Dynamics,
4102 Collision, LinearMath, & SoftBody)
4103
4104
4105
4106
4107 This module accepts the following variables
4108
4109
4110
4111
4112 BULLET_ROOT - Can be set to bullet install path or Windows build path
4113
4114
4115
4116
4117
4118 FindCABLE
4119 Find CABLE
4120
4121 This module finds if CABLE is installed and determines where the
4122 include files and libraries are. This code sets the following
4123 variables:
4124
4125
4126 CABLE the path to the cable executable
4127 CABLE_TCL_LIBRARY the path to the Tcl wrapper library
4128 CABLE_INCLUDE_DIR the path to the include directory
4129
4130
4131
4132
4133 To build Tcl wrappers, you should add shared library and link it
4134 to ${CABLE_TCL_LIBRARY}. You should also add
4135 ${CABLE_INCLUDE_DIR} as an include directory.
4136
4137
4138 FindCUDA
4139 Tools for building CUDA C files: libraries and build dependen‐
4140 cies.
4141
4142 This script locates the NVIDIA CUDA C tools. It should work on
4143 linux, windows, and mac and should be reasonably up to date with
4144 CUDA C releases.
4145
4146
4147 This script makes use of the standard find_package arguments of
4148 <VERSION>, REQUIRED and QUIET. CUDA_FOUND will report if an
4149 acceptable version of CUDA was found.
4150
4151
4152 The script will prompt the user to specify CUDA_TOOLKIT_ROOT_DIR
4153 if the prefix cannot be determined by the location of nvcc in
4154 the system path and REQUIRED is specified to find_package(). To
4155 use a different installed version of the toolkit set the envi‐
4156 ronment variable CUDA_BIN_PATH before running cmake (e.g.
4157 CUDA_BIN_PATH=/usr/local/cuda1.0 instead of the default
4158 /usr/local/cuda) or set CUDA_TOOLKIT_ROOT_DIR after configuring.
4159 If you change the value of CUDA_TOOLKIT_ROOT_DIR, various compo‐
4160 nents that depend on the path will be relocated.
4161
4162
4163 It might be necessary to set CUDA_TOOLKIT_ROOT_DIR manually on
4164 certain platforms, or to use a cuda runtime not installed in the
4165 default location. In newer versions of the toolkit the cuda
4166 library is included with the graphics driver- be sure that the
4167 driver version matches what is needed by the cuda runtime ver‐
4168 sion.
4169
4170
4171 The following variables affect the behavior of the macros in the
4172 script (in alphebetical order). Note that any of these flags
4173 can be changed multiple times in the same directory before call‐
4174 ing CUDA_ADD_EXECUTABLE, CUDA_ADD_LIBRARY, CUDA_COMPILE,
4175 CUDA_COMPILE_PTX or CUDA_WRAP_SRCS.
4176
4177
4178 CUDA_64_BIT_DEVICE_CODE (Default matches host bit size)
4179 -- Set to ON to compile for 64 bit device code, OFF for 32 bit device code.
4180 Note that making this different from the host code when generating object
4181 or C files from CUDA code just won't work, because size_t gets defined by
4182 nvcc in the generated source. If you compile to PTX and then load the
4183 file yourself, you can mix bit sizes between device and host.
4184
4185
4186
4187
4188 CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE (Default ON)
4189 -- Set to ON if you want the custom build rule to be attached to the source
4190 file in Visual Studio. Turn OFF if you add the same cuda file to multiple
4191 targets.
4192
4193
4194
4195
4196 This allows the user to build the target from the CUDA file; however, bad
4197 things can happen if the CUDA source file is added to multiple targets.
4198 When performing parallel builds it is possible for the custom build
4199 command to be run more than once and in parallel causing cryptic build
4200 errors. VS runs the rules for every source file in the target, and a
4201 source can have only one rule no matter how many projects it is added to.
4202 When the rule is run from multiple targets race conditions can occur on
4203 the generated file. Eventually everything will get built, but if the user
4204 is unaware of this behavior, there may be confusion. It would be nice if
4205 this script could detect the reuse of source files across multiple targets
4206 and turn the option off for the user, but no good solution could be found.
4207
4208
4209
4210
4211 CUDA_BUILD_CUBIN (Default OFF)
4212 -- Set to ON to enable and extra compilation pass with the -cubin option in
4213 Device mode. The output is parsed and register, shared memory usage is
4214 printed during build.
4215
4216
4217
4218
4219 CUDA_BUILD_EMULATION (Default OFF for device mode)
4220 -- Set to ON for Emulation mode. -D_DEVICEEMU is defined for CUDA C files
4221 when CUDA_BUILD_EMULATION is TRUE.
4222
4223
4224
4225
4226 CUDA_GENERATED_OUTPUT_DIR (Default CMAKE_CURRENT_BINARY_DIR)
4227 -- Set to the path you wish to have the generated files placed. If it is
4228 blank output files will be placed in CMAKE_CURRENT_BINARY_DIR.
4229 Intermediate files will always be placed in
4230 CMAKE_CURRENT_BINARY_DIR/CMakeFiles.
4231
4232
4233
4234
4235 CUDA_HOST_COMPILATION_CPP (Default ON)
4236 -- Set to OFF for C compilation of host code.
4237
4238
4239
4240
4241 CUDA_HOST_COMPILER (Default CMAKE_C_COMPILER, $(VCInstallDir)/bin for VS)
4242 -- Set the host compiler to be used by nvcc. Ignored if -ccbin or
4243 --compiler-bindir is already present in the CUDA_NVCC_FLAGS or
4244 CUDA_NVCC_FLAGS_<CONFIG> variables. For Visual Studio targets
4245 $(VCInstallDir)/bin is a special value that expands out to the path when
4246 the command is run from withing VS.
4247
4248
4249
4250
4251 CUDA_NVCC_FLAGS
4252 CUDA_NVCC_FLAGS_<CONFIG>
4253 -- Additional NVCC command line arguments. NOTE: multiple arguments must be
4254 semi-colon delimited (e.g. --compiler-options;-Wall)
4255
4256
4257
4258
4259 CUDA_PROPAGATE_HOST_FLAGS (Default ON)
4260 -- Set to ON to propagate CMAKE_{C,CXX}_FLAGS and their configuration
4261 dependent counterparts (e.g. CMAKE_C_FLAGS_DEBUG) automatically to the
4262 host compiler through nvcc's -Xcompiler flag. This helps make the
4263 generated host code match the rest of the system better. Sometimes
4264 certain flags give nvcc problems, and this will help you turn the flag
4265 propagation off. This does not affect the flags supplied directly to nvcc
4266 via CUDA_NVCC_FLAGS or through the OPTION flags specified through
4267 CUDA_ADD_LIBRARY, CUDA_ADD_EXECUTABLE, or CUDA_WRAP_SRCS. Flags used for
4268 shared library compilation are not affected by this flag.
4269
4270
4271
4272
4273 CUDA_SEPARABLE_COMPILATION (Default OFF)
4274 -- If set this will enable separable compilation for all CUDA runtime object
4275 files. If used outside of CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY
4276 (e.g. calling CUDA_WRAP_SRCS directly),
4277 CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME and
4278 CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS should be called.
4279
4280
4281
4282
4283 CUDA_VERBOSE_BUILD (Default OFF)
4284 -- Set to ON to see all the commands used when building the CUDA file. When
4285 using a Makefile generator the value defaults to VERBOSE (run make
4286 VERBOSE=1 to see output), although setting CUDA_VERBOSE_BUILD to ON will
4287 always print the output.
4288
4289
4290
4291
4292 The script creates the following macros (in alphebetical order):
4293
4294
4295 CUDA_ADD_CUFFT_TO_TARGET( cuda_target )
4296 -- Adds the cufft library to the target (can be any target). Handles whether
4297 you are in emulation mode or not.
4298
4299
4300
4301
4302 CUDA_ADD_CUBLAS_TO_TARGET( cuda_target )
4303 -- Adds the cublas library to the target (can be any target). Handles
4304 whether you are in emulation mode or not.
4305
4306
4307
4308
4309 CUDA_ADD_EXECUTABLE( cuda_target file0 file1 ...
4310 [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL] [OPTIONS ...] )
4311 -- Creates an executable "cuda_target" which is made up of the files
4312 specified. All of the non CUDA C files are compiled using the standard
4313 build rules specified by CMAKE and the cuda files are compiled to object
4314 files using nvcc and the host compiler. In addition CUDA_INCLUDE_DIRS is
4315 added automatically to include_directories(). Some standard CMake target
4316 calls can be used on the target after calling this macro
4317 (e.g. set_target_properties and target_link_libraries), but setting
4318 properties that adjust compilation flags will not affect code compiled by
4319 nvcc. Such flags should be modified before calling CUDA_ADD_EXECUTABLE,
4320 CUDA_ADD_LIBRARY or CUDA_WRAP_SRCS.
4321
4322
4323
4324
4325 CUDA_ADD_LIBRARY( cuda_target file0 file1 ...
4326 [STATIC | SHARED | MODULE] [EXCLUDE_FROM_ALL] [OPTIONS ...] )
4327 -- Same as CUDA_ADD_EXECUTABLE except that a library is created.
4328
4329
4330
4331
4332 CUDA_BUILD_CLEAN_TARGET()
4333 -- Creates a convience target that deletes all the dependency files
4334 generated. You should make clean after running this target to ensure the
4335 dependency files get regenerated.
4336
4337
4338
4339
4340 CUDA_COMPILE( generated_files file0 file1 ... [STATIC | SHARED | MODULE]
4341 [OPTIONS ...] )
4342 -- Returns a list of generated files from the input source files to be used
4343 with ADD_LIBRARY or ADD_EXECUTABLE.
4344
4345
4346
4347
4348 CUDA_COMPILE_PTX( generated_files file0 file1 ... [OPTIONS ...] )
4349 -- Returns a list of PTX files generated from the input source files.
4350
4351
4352
4353
4354 CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME( output_file_var
4355 cuda_target
4356 object_files )
4357 -- Compute the name of the intermediate link file used for separable
4358 compilation. This file name is typically passed into
4359 CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS. output_file_var is produced
4360 based on cuda_target the list of objects files that need separable
4361 compilation as specified by object_files. If the object_files list is
4362 empty, then output_file_var will be empty. This function is called
4363 automatically for CUDA_ADD_LIBRARY and CUDA_ADD_EXECUTABLE. Note that
4364 this is a function and not a macro.
4365
4366
4367
4368
4369 CUDA_INCLUDE_DIRECTORIES( path0 path1 ... )
4370 -- Sets the directories that should be passed to nvcc
4371 (e.g. nvcc -Ipath0 -Ipath1 ... ). These paths usually contain other .cu
4372 files.
4373
4374
4375
4376
4377
4378
4379
4380 CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS( output_file_var cuda_target
4381 nvcc_flags object_files)
4382
4383
4384
4385
4386 -- Generates the link object required by separable compilation from the given
4387 object files. This is called automatically for CUDA_ADD_EXECUTABLE and
4388 CUDA_ADD_LIBRARY, but can be called manually when using CUDA_WRAP_SRCS
4389 directly. When called from CUDA_ADD_LIBRARY or CUDA_ADD_EXECUTABLE the
4390 nvcc_flags passed in are the same as the flags passed in via the OPTIONS
4391 argument. The only nvcc flag added automatically is the bitness flag as
4392 specified by CUDA_64_BIT_DEVICE_CODE. Note that this is a function
4393 instead of a macro.
4394
4395
4396
4397
4398 CUDA_WRAP_SRCS ( cuda_target format generated_files file0 file1 ...
4399 [STATIC | SHARED | MODULE] [OPTIONS ...] )
4400 -- This is where all the magic happens. CUDA_ADD_EXECUTABLE,
4401 CUDA_ADD_LIBRARY, CUDA_COMPILE, and CUDA_COMPILE_PTX all call this
4402 function under the hood.
4403
4404
4405
4406
4407 Given the list of files (file0 file1 ... fileN) this macro generates
4408 custom commands that generate either PTX or linkable objects (use "PTX" or
4409 "OBJ" for the format argument to switch). Files that don't end with .cu
4410 or have the HEADER_FILE_ONLY property are ignored.
4411
4412
4413
4414
4415 The arguments passed in after OPTIONS are extra command line options to
4416 give to nvcc. You can also specify per configuration options by
4417 specifying the name of the configuration followed by the options. General
4418 options must preceed configuration specific options. Not all
4419 configurations need to be specified, only the ones provided will be used.
4420
4421
4422
4423
4424 OPTIONS -DFLAG=2 "-DFLAG_OTHER=space in flag"
4425 DEBUG -g
4426 RELEASE --use_fast_math
4427 RELWITHDEBINFO --use_fast_math;-g
4428 MINSIZEREL --use_fast_math
4429
4430
4431
4432
4433 For certain configurations (namely VS generating object files with
4434 CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE set to ON), no generated file will
4435 be produced for the given cuda file. This is because when you add the
4436 cuda file to Visual Studio it knows that this file produces an object file
4437 and will link in the resulting object file automatically.
4438
4439
4440
4441
4442 This script will also generate a separate cmake script that is used at
4443 build time to invoke nvcc. This is for several reasons.
4444
4445
4446
4447
4448 1. nvcc can return negative numbers as return values which confuses
4449 Visual Studio into thinking that the command succeeded. The script now
4450 checks the error codes and produces errors when there was a problem.
4451
4452
4453
4454
4455 2. nvcc has been known to not delete incomplete results when it
4456 encounters problems. This confuses build systems into thinking the
4457 target was generated when in fact an unusable file exists. The script
4458 now deletes the output files if there was an error.
4459
4460
4461
4462
4463 3. By putting all the options that affect the build into a file and then
4464 make the build rule dependent on the file, the output files will be
4465 regenerated when the options change.
4466
4467
4468
4469
4470 This script also looks at optional arguments STATIC, SHARED, or MODULE to
4471 determine when to target the object compilation for a shared library.
4472 BUILD_SHARED_LIBS is ignored in CUDA_WRAP_SRCS, but it is respected in
4473 CUDA_ADD_LIBRARY. On some systems special flags are added for building
4474 objects intended for shared libraries. A preprocessor macro,
4475 <target_name>_EXPORTS is defined when a shared library compilation is
4476 detected.
4477
4478
4479
4480
4481 Flags passed into add_definitions with -D or /D are passed along to nvcc.
4482
4483
4484
4485
4486 The script defines the following variables:
4487
4488
4489 CUDA_VERSION_MAJOR -- The major version of cuda as reported by nvcc.
4490 CUDA_VERSION_MINOR -- The minor version.
4491 CUDA_VERSION
4492 CUDA_VERSION_STRING -- CUDA_VERSION_MAJOR.CUDA_VERSION_MINOR
4493
4494
4495
4496
4497 CUDA_TOOLKIT_ROOT_DIR -- Path to the CUDA Toolkit (defined if not set).
4498 CUDA_SDK_ROOT_DIR -- Path to the CUDA SDK. Use this to find files in the
4499 SDK. This script will not directly support finding
4500 specific libraries or headers, as that isn't
4501 supported by NVIDIA. If you want to change
4502 libraries when the path changes see the
4503 FindCUDA.cmake script for an example of how to clear
4504 these variables. There are also examples of how to
4505 use the CUDA_SDK_ROOT_DIR to locate headers or
4506 libraries, if you so choose (at your own risk).
4507 CUDA_INCLUDE_DIRS -- Include directory for cuda headers. Added automatically
4508 for CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY.
4509 CUDA_LIBRARIES -- Cuda RT library.
4510 CUDA_CUFFT_LIBRARIES -- Device or emulation library for the Cuda FFT
4511 implementation (alternative to:
4512 CUDA_ADD_CUFFT_TO_TARGET macro)
4513 CUDA_CUBLAS_LIBRARIES -- Device or emulation library for the Cuda BLAS
4514 implementation (alterative to:
4515 CUDA_ADD_CUBLAS_TO_TARGET macro).
4516 CUDA_cupti_LIBRARY -- CUDA Profiling Tools Interface library.
4517 Only available for CUDA version 4.0+.
4518 CUDA_curand_LIBRARY -- CUDA Random Number Generation library.
4519 Only available for CUDA version 3.2+.
4520 CUDA_cusparse_LIBRARY -- CUDA Sparse Matrix library.
4521 Only available for CUDA version 3.2+.
4522 CUDA_npp_LIBRARY -- NVIDIA Performance Primitives library.
4523 Only available for CUDA version 4.0+.
4524 CUDA_nppc_LIBRARY -- NVIDIA Performance Primitives library (core).
4525 Only available for CUDA version 5.5+.
4526 CUDA_nppi_LIBRARY -- NVIDIA Performance Primitives library (image processing).
4527 Only available for CUDA version 5.5+.
4528 CUDA_npps_LIBRARY -- NVIDIA Performance Primitives library (signal processing).
4529 Only available for CUDA version 5.5+.
4530 CUDA_nvcuvenc_LIBRARY -- CUDA Video Encoder library.
4531 Only available for CUDA version 3.2+.
4532 Windows only.
4533 CUDA_nvcuvid_LIBRARY -- CUDA Video Decoder library.
4534 Only available for CUDA version 3.2+.
4535 Windows only.
4536
4537
4538
4539
4540
4541
4542
4543 James Bigler, NVIDIA Corp (nvidia.com - jbigler)
4544 Abe Stephens, SCI Institute -- http://www.sci.utah.edu/~abe/FindCuda.html
4545
4546
4547
4548
4549 Copyright (c) 2008 - 2009 NVIDIA Corporation. All rights reserved.
4550
4551
4552
4553
4554 Copyright (c) 2007-2009
4555 Scientific Computing and Imaging Institute, University of Utah
4556
4557
4558
4559
4560 This code is licensed under the MIT License. See the FindCUDA.cmake script
4561 for the text of the license.
4562
4563
4564 FindCURL
4565 Find curl
4566
4567 Find the native CURL headers and libraries.
4568
4569
4570 CURL_INCLUDE_DIRS - where to find curl/curl.h, etc.
4571 CURL_LIBRARIES - List of libraries when using curl.
4572 CURL_FOUND - True if curl found.
4573 CURL_VERSION_STRING - the version of curl found (since CMake 2.8.8)
4574
4575
4576 FindCVS
4577
4578
4579 The module defines the following variables:
4580
4581
4582 CVS_EXECUTABLE - path to cvs command line client
4583 CVS_FOUND - true if the command line client was found
4584
4585 Example usage:
4586
4587
4588 find_package(CVS)
4589 if(CVS_FOUND)
4590 message("CVS found: ${CVS_EXECUTABLE}")
4591 endif()
4592
4593
4594 FindCoin3D
4595 Find Coin3D (Open Inventor)
4596
4597 Coin3D is an implementation of the Open Inventor API. It pro‐
4598 vides data structures and algorithms for 3D visualization
4599 http://www.coin3d.org/
4600
4601
4602 This module defines the following variables
4603
4604
4605 COIN3D_FOUND - system has Coin3D - Open Inventor
4606 COIN3D_INCLUDE_DIRS - where the Inventor include directory can be found
4607 COIN3D_LIBRARIES - Link to this to use Coin3D
4608
4609
4610
4611
4612
4613 FindCups
4614 Try to find the Cups printing system
4615
4616 Once done this will define
4617
4618
4619 CUPS_FOUND - system has Cups
4620 CUPS_INCLUDE_DIR - the Cups include directory
4621 CUPS_LIBRARIES - Libraries needed to use Cups
4622 CUPS_VERSION_STRING - version of Cups found (since CMake 2.8.8)
4623 Set CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE to TRUE if you need a version which
4624 features this function (i.e. at least 1.1.19)
4625
4626
4627 FindCurses
4628 Find the curses include file and library
4629
4630
4631
4632
4633 CURSES_FOUND - system has Curses
4634 CURSES_INCLUDE_DIR - the Curses include directory
4635 CURSES_LIBRARIES - The libraries needed to use Curses
4636 CURSES_HAVE_CURSES_H - true if curses.h is available
4637 CURSES_HAVE_NCURSES_H - true if ncurses.h is available
4638 CURSES_HAVE_NCURSES_NCURSES_H - true if ncurses/ncurses.h is available
4639 CURSES_HAVE_NCURSES_CURSES_H - true if ncurses/curses.h is available
4640 CURSES_LIBRARY - set for backwards compatibility with 2.4 CMake
4641
4642
4643
4644
4645 Set CURSES_NEED_NCURSES to TRUE before the find_package() com‐
4646 mand if NCurses functionality is required.
4647
4648
4649 FindCxxTest
4650 Find CxxTest
4651
4652 Find the CxxTest suite and declare a helper macro for creating
4653 unit tests and integrating them with CTest. For more details on
4654 CxxTest see http://cxxtest.tigris.org
4655
4656
4657 INPUT Variables
4658
4659
4660 CXXTEST_USE_PYTHON [deprecated since 1.3]
4661 Only used in the case both Python & Perl
4662 are detected on the system to control
4663 which CxxTest code generator is used.
4664 Valid only for CxxTest version 3.
4665
4666
4667
4668
4669 NOTE: In older versions of this Find Module,
4670 this variable controlled if the Python test
4671 generator was used instead of the Perl one,
4672 regardless of which scripting language the
4673 user had installed.
4674
4675
4676
4677
4678 CXXTEST_TESTGEN_ARGS (since CMake 2.8.3)
4679 Specify a list of options to pass to the CxxTest code
4680 generator. If not defined, --error-printer is
4681 passed.
4682
4683
4684
4685
4686 OUTPUT Variables
4687
4688
4689 CXXTEST_FOUND
4690 True if the CxxTest framework was found
4691 CXXTEST_INCLUDE_DIRS
4692 Where to find the CxxTest include directory
4693 CXXTEST_PERL_TESTGEN_EXECUTABLE
4694 The perl-based test generator
4695 CXXTEST_PYTHON_TESTGEN_EXECUTABLE
4696 The python-based test generator
4697 CXXTEST_TESTGEN_EXECUTABLE (since CMake 2.8.3)
4698 The test generator that is actually used (chosen using user preferences
4699 and interpreters found in the system)
4700 CXXTEST_TESTGEN_INTERPRETER (since CMake 2.8.3)
4701 The full path to the Perl or Python executable on the system
4702
4703
4704
4705
4706 MACROS for optional use by CMake users:
4707
4708
4709 CXXTEST_ADD_TEST(<test_name> <gen_source_file> <input_files_to_testgen...>)
4710 Creates a CxxTest runner and adds it to the CTest testing suite
4711 Parameters:
4712 test_name The name of the test
4713 gen_source_file The generated source filename to be
4714 generated by CxxTest
4715 input_files_to_testgen The list of header files containing the
4716 CxxTest::TestSuite's to be included in
4717 this runner
4718
4719
4720
4721
4722 #==============
4723 Example Usage:
4724
4725
4726
4727
4728 find_package(CxxTest)
4729 if(CXXTEST_FOUND)
4730 include_directories(${CXXTEST_INCLUDE_DIR})
4731 enable_testing()
4732
4733
4734
4735
4736 CXXTEST_ADD_TEST(unittest_foo foo_test.cc
4737 ${CMAKE_CURRENT_SOURCE_DIR}/foo_test.h)
4738 target_link_libraries(unittest_foo foo) # as needed
4739 endif()
4740
4741
4742
4743
4744 This will (if CxxTest is found):
4745 1. Invoke the testgen executable to autogenerate foo_test.cc in the
4746 binary tree from "foo_test.h" in the current source directory.
4747 2. Create an executable and test called unittest_foo.
4748
4749
4750
4751
4752 #=============
4753 Example foo_test.h:
4754
4755
4756
4757
4758 #include <cxxtest/TestSuite.h>
4759
4760
4761
4762
4763 class MyTestSuite : public CxxTest::TestSuite
4764 {
4765 public:
4766 void testAddition( void )
4767 {
4768 TS_ASSERT( 1 + 1 > 1 );
4769 TS_ASSERT_EQUALS( 1 + 1, 2 );
4770 }
4771 };
4772
4773
4774
4775
4776
4777 FindCygwin
4778 this module looks for Cygwin
4779
4780
4781
4782
4783
4784 FindDCMTK
4785 find DCMTK libraries and applications
4786
4787
4788
4789
4790
4791 FindDart
4792 Find DART
4793
4794 This module looks for the dart testing software and sets
4795 DART_ROOT to point to where it found it.
4796
4797
4798
4799 FindDevIL
4800
4801
4802 This module locates the developer's image library. http://ope‐
4803 nil.sourceforge.net/
4804
4805
4806 This module sets:
4807
4808
4809 IL_LIBRARIES - the name of the IL library. These include the full path to
4810 the core DevIL library. This one has to be linked into the
4811 application.
4812 ILU_LIBRARIES - the name of the ILU library. Again, the full path. This
4813 library is for filters and effects, not actual loading. It
4814 doesn't have to be linked if the functionality it provides
4815 is not used.
4816 ILUT_LIBRARIES - the name of the ILUT library. Full path. This part of the
4817 library interfaces with OpenGL. It is not strictly needed
4818 in applications.
4819 IL_INCLUDE_DIR - where to find the il.h, ilu.h and ilut.h files.
4820 IL_FOUND - this is set to TRUE if all the above variables were set.
4821 This will be set to false if ILU or ILUT are not found,
4822 even if they are not needed. In most systems, if one
4823 library is found all the others are as well. That's the
4824 way the DevIL developers release it.
4825
4826
4827 FindDoxygen
4828 This module looks for Doxygen and the path to Graphviz's dot
4829
4830 Doxygen is a documentation generation tool. Please see
4831 http://www.doxygen.org
4832
4833
4834 This module accepts the following optional variables:
4835
4836
4837 DOXYGEN_SKIP_DOT = If true this module will skip trying to find Dot
4838 (an optional component often used by Doxygen)
4839
4840
4841
4842
4843 This modules defines the following variables:
4844
4845
4846 DOXYGEN_EXECUTABLE = The path to the doxygen command.
4847 DOXYGEN_FOUND = Was Doxygen found or not?
4848 DOXYGEN_VERSION = The version reported by doxygen --version
4849
4850
4851
4852
4853 DOXYGEN_DOT_EXECUTABLE = The path to the dot program used by doxygen.
4854 DOXYGEN_DOT_FOUND = Was Dot found or not?
4855 DOXYGEN_DOT_PATH = The path to dot not including the executable
4856
4857
4858
4859
4860
4861
4862
4863
4864 FindEXPAT
4865 Find expat
4866
4867 Find the native EXPAT headers and libraries.
4868
4869
4870 EXPAT_INCLUDE_DIRS - where to find expat.h, etc.
4871 EXPAT_LIBRARIES - List of libraries when using expat.
4872 EXPAT_FOUND - True if expat found.
4873
4874
4875 FindFLEX
4876 Find flex executable and provides a macro to generate custom
4877 build rules
4878
4879
4880
4881
4882 The module defines the following variables:
4883
4884
4885 FLEX_FOUND - true is flex executable is found
4886 FLEX_EXECUTABLE - the path to the flex executable
4887 FLEX_VERSION - the version of flex
4888 FLEX_LIBRARIES - The flex libraries
4889 FLEX_INCLUDE_DIRS - The path to the flex headers
4890
4891
4892
4893
4894 The minimum required version of flex can be specified using the
4895 standard syntax, e.g. find_package(FLEX 2.5.13)
4896
4897
4898
4899
4900
4901 If flex is found on the system, the module provides the macro:
4902
4903
4904 FLEX_TARGET(Name FlexInput FlexOutput [COMPILE_FLAGS <string>])
4905
4906 which creates a custom command to generate the <FlexOutput>
4907 file from the <FlexInput> file. If COMPILE_FLAGS option is
4908 specified, the next parameter is added to the flex command
4909 line. Name is an alias used to get details of this custom
4910 command. Indeed the macro defines the following variables:
4911
4912
4913 FLEX_${Name}_DEFINED - true is the macro ran successfully
4914 FLEX_${Name}_OUTPUTS - the source file generated by the custom rule, an
4915 alias for FlexOutput
4916 FLEX_${Name}_INPUT - the flex source file, an alias for ${FlexInput}
4917
4918
4919
4920
4921 Flex scanners oftenly use tokens defined by Bison: the code
4922 generated by Flex depends of the header generated by Bison.
4923 This module also defines a macro:
4924
4925
4926 ADD_FLEX_BISON_DEPENDENCY(FlexTarget BisonTarget)
4927
4928 which adds the required dependency between a scanner and a
4929 parser where <FlexTarget> and <BisonTarget> are the first
4930 parameters of respectively FLEX_TARGET and BISON_TARGET macros.
4931
4932
4933 ====================================================================
4934 Example:
4935
4936
4937
4938
4939 find_package(BISON)
4940 find_package(FLEX)
4941
4942
4943
4944
4945 BISON_TARGET(MyParser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp)
4946 FLEX_TARGET(MyScanner lexer.l ${CMAKE_CURRENT_BINARY_DIR}/lexer.cpp)
4947 ADD_FLEX_BISON_DEPENDENCY(MyScanner MyParser)
4948
4949
4950
4951
4952 include_directories(${CMAKE_CURRENT_BINARY_DIR})
4953 add_executable(Foo
4954 Foo.cc
4955 ${BISON_MyParser_OUTPUTS}
4956 ${FLEX_MyScanner_OUTPUTS}
4957 )
4958 ====================================================================
4959
4960
4961 FindFLTK
4962 Find the native FLTK includes and library
4963
4964
4965
4966
4967 By default FindFLTK.cmake will search for all of the FLTK compo‐
4968 nents and add them to the FLTK_LIBRARIES variable.
4969
4970
4971 You can limit the components which get placed in FLTK_LIBRARIES by
4972 defining one or more of the following three options:
4973
4974
4975
4976
4977 FLTK_SKIP_OPENGL, set to true to disable searching for opengl and
4978 the FLTK GL library
4979 FLTK_SKIP_FORMS, set to true to disable searching for fltk_forms
4980 FLTK_SKIP_IMAGES, set to true to disable searching for fltk_images
4981
4982
4983
4984
4985 FLTK_SKIP_FLUID, set to true if the fluid binary need not be present
4986 at build time
4987
4988
4989
4990
4991 The following variables will be defined:
4992
4993
4994 FLTK_FOUND, True if all components not skipped were found
4995 FLTK_INCLUDE_DIR, where to find include files
4996 FLTK_LIBRARIES, list of fltk libraries you should link against
4997 FLTK_FLUID_EXECUTABLE, where to find the Fluid tool
4998 FLTK_WRAP_UI, This enables the FLTK_WRAP_UI command
4999
5000
5001
5002
5003 The following cache variables are assigned but should not be
5004 used. See the FLTK_LIBRARIES variable instead.
5005
5006
5007 FLTK_BASE_LIBRARY = the full path to fltk.lib
5008 FLTK_GL_LIBRARY = the full path to fltk_gl.lib
5009 FLTK_FORMS_LIBRARY = the full path to fltk_forms.lib
5010 FLTK_IMAGES_LIBRARY = the full path to fltk_images.lib
5011
5012
5013 FindFLTK2
5014 Find the native FLTK2 includes and library
5015
5016 The following settings are defined
5017
5018
5019 FLTK2_FLUID_EXECUTABLE, where to find the Fluid tool
5020 FLTK2_WRAP_UI, This enables the FLTK2_WRAP_UI command
5021 FLTK2_INCLUDE_DIR, where to find include files
5022 FLTK2_LIBRARIES, list of fltk2 libraries
5023 FLTK2_FOUND, Don't use FLTK2 if false.
5024
5025 The following settings should not be used in general.
5026
5027
5028 FLTK2_BASE_LIBRARY = the full path to fltk2.lib
5029 FLTK2_GL_LIBRARY = the full path to fltk2_gl.lib
5030 FLTK2_IMAGES_LIBRARY = the full path to fltk2_images.lib
5031
5032
5033 FindFreetype
5034 Locate FreeType library
5035
5036 This module defines
5037
5038
5039 FREETYPE_LIBRARIES, the library to link against
5040 FREETYPE_FOUND, if false, do not try to link to FREETYPE
5041 FREETYPE_INCLUDE_DIRS, where to find headers.
5042 FREETYPE_VERSION_STRING, the version of freetype found (since CMake 2.8.8)
5043 This is the concatenation of the paths:
5044 FREETYPE_INCLUDE_DIR_ft2build
5045 FREETYPE_INCLUDE_DIR_freetype2
5046
5047
5048
5049
5050 $FREETYPE_DIR is an environment variable that would correspond
5051 to the ./configure --prefix=$FREETYPE_DIR used in building
5052 FREETYPE.
5053
5054
5055 FindGCCXML
5056 Find the GCC-XML front-end executable.
5057
5058
5059
5060
5061 This module will define the following variables:
5062
5063
5064 GCCXML - the GCC-XML front-end executable.
5065
5066
5067 FindGDAL
5068
5069
5070 Locate gdal
5071
5072
5073 This module accepts the following environment variables:
5074
5075
5076 GDAL_DIR or GDAL_ROOT - Specify the location of GDAL
5077
5078
5079
5080
5081 This module defines the following CMake variables:
5082
5083
5084 GDAL_FOUND - True if libgdal is found
5085 GDAL_LIBRARY - A variable pointing to the GDAL library
5086 GDAL_INCLUDE_DIR - Where to find the headers
5087
5088
5089 FindGIF
5090
5091
5092 This module searches giflib and defines GIF_LIBRARIES -
5093 libraries to link to in order to use GIF GIF_FOUND, if false, do
5094 not try to link GIF_INCLUDE_DIR, where to find the headers
5095 GIF_VERSION, reports either version 4 or 3 (for everything
5096 before version 4)
5097
5098
5099 The minimum required version of giflib can be specified using
5100 the standard syntax, e.g. find_package(GIF 4)
5101
5102
5103 $GIF_DIR is an environment variable that would correspond to the
5104 ./configure --prefix=$GIF_DIR
5105
5106
5107 FindGLEW
5108 Find the OpenGL Extension Wrangler Library (GLEW)
5109
5110 This module defines the following variables:
5111
5112
5113 GLEW_INCLUDE_DIRS - include directories for GLEW
5114 GLEW_LIBRARIES - libraries to link against GLEW
5115 GLEW_FOUND - true if GLEW has been found and can be used
5116
5117
5118 FindGLUT
5119 try to find glut library and include files
5120
5121 GLUT_INCLUDE_DIR, where to find GL/glut.h, etc.
5122 GLUT_LIBRARIES, the libraries to link against
5123 GLUT_FOUND, If false, do not try to use GLUT.
5124
5125 Also defined, but not for general use are:
5126
5127
5128 GLUT_glut_LIBRARY = the full path to the glut library.
5129 GLUT_Xmu_LIBRARY = the full path to the Xmu library.
5130 GLUT_Xi_LIBRARY = the full path to the Xi Library.
5131
5132
5133 FindGTK
5134 try to find GTK (and glib) and GTKGLArea
5135
5136 GTK_INCLUDE_DIR - Directories to include to use GTK
5137 GTK_LIBRARIES - Files to link against to use GTK
5138 GTK_FOUND - GTK was found
5139 GTK_GL_FOUND - GTK's GL features were found
5140
5141
5142 FindGTK2
5143 FindGTK2.cmake
5144
5145 This module can find the GTK2 widget libraries and several of
5146 its other optional components like gtkmm, glade, and glademm.
5147
5148
5149 NOTE: If you intend to use version checking, CMake 2.6.2 or
5150 later is
5151
5152
5153 required.
5154
5155
5156
5157
5158 Specify one or more of the following components as you call this
5159 find module. See example below.
5160
5161
5162 gtk
5163 gtkmm
5164 glade
5165 glademm
5166
5167
5168
5169
5170 The following variables will be defined for your use
5171
5172
5173 GTK2_FOUND - Were all of your specified components found?
5174 GTK2_INCLUDE_DIRS - All include directories
5175 GTK2_LIBRARIES - All libraries
5176 GTK2_DEFINITIONS - Additional compiler flags
5177
5178
5179
5180
5181 GTK2_VERSION - The version of GTK2 found (x.y.z)
5182 GTK2_MAJOR_VERSION - The major version of GTK2
5183 GTK2_MINOR_VERSION - The minor version of GTK2
5184 GTK2_PATCH_VERSION - The patch version of GTK2
5185
5186
5187
5188
5189 Optional variables you can define prior to calling this module:
5190
5191
5192 GTK2_DEBUG - Enables verbose debugging of the module
5193 GTK2_ADDITIONAL_SUFFIXES - Allows defining additional directories to
5194 search for include files
5195
5196
5197
5198
5199 ================= Example Usage:
5200
5201
5202 Call find_package() once, here are some examples to pick from:
5203
5204
5205
5206
5207 Require GTK 2.6 or later
5208 find_package(GTK2 2.6 REQUIRED gtk)
5209
5210
5211
5212
5213 Require GTK 2.10 or later and Glade
5214 find_package(GTK2 2.10 REQUIRED gtk glade)
5215
5216
5217
5218
5219 Search for GTK/GTKMM 2.8 or later
5220 find_package(GTK2 2.8 COMPONENTS gtk gtkmm)
5221
5222
5223
5224
5225 if(GTK2_FOUND)
5226 include_directories(${GTK2_INCLUDE_DIRS})
5227 add_executable(mygui mygui.cc)
5228 target_link_libraries(mygui ${GTK2_LIBRARIES})
5229 endif()
5230
5231
5232
5233
5234
5235 FindGTest
5236 --------------------
5237
5238 Locate the Google C++ Testing Framework.
5239
5240
5241 Defines the following variables:
5242
5243
5244 GTEST_FOUND - Found the Google Testing framework
5245 GTEST_INCLUDE_DIRS - Include directories
5246
5247
5248
5249
5250 Also defines the library variables below as normal variables.
5251 These contain debug/optimized keywords when a debugging library
5252 is found.
5253
5254
5255 GTEST_BOTH_LIBRARIES - Both libgtest & libgtest-main
5256 GTEST_LIBRARIES - libgtest
5257 GTEST_MAIN_LIBRARIES - libgtest-main
5258
5259
5260
5261
5262 Accepts the following variables as input:
5263
5264
5265 GTEST_ROOT - (as a CMake or environment variable)
5266 The root directory of the gtest install prefix
5267
5268
5269
5270
5271 GTEST_MSVC_SEARCH - If compiling with MSVC, this variable can be set to
5272 "MD" or "MT" to enable searching a GTest build tree
5273 (defaults: "MD")
5274
5275
5276
5277
5278 Example Usage:
5279
5280
5281 enable_testing()
5282 find_package(GTest REQUIRED)
5283 include_directories(${GTEST_INCLUDE_DIRS})
5284
5285
5286
5287
5288 add_executable(foo foo.cc)
5289 target_link_libraries(foo ${GTEST_BOTH_LIBRARIES})
5290
5291
5292
5293
5294 add_test(AllTestsInFoo foo)
5295
5296
5297
5298
5299
5300
5301
5302 If you would like each Google test to show up in CTest as a test
5303 you may use the following macro. NOTE: It will slow down your
5304 tests by running an executable for each test and test fixture.
5305 You will also have to rerun CMake after adding or removing tests
5306 or test fixtures.
5307
5308
5309 GTEST_ADD_TESTS(executable extra_args ARGN)
5310
5311
5312 executable = The path to the test executable
5313 extra_args = Pass a list of extra arguments to be passed to
5314 executable enclosed in quotes (or "" for none)
5315 ARGN = A list of source files to search for tests & test
5316 fixtures.
5317
5318
5319
5320
5321 Example:
5322 set(FooTestArgs --foo 1 --bar 2)
5323 add_executable(FooTest FooUnitTest.cc)
5324 GTEST_ADD_TESTS(FooTest "${FooTestArgs}" FooUnitTest.cc)
5325
5326
5327 FindGettext
5328 Find GNU gettext tools
5329
5330 This module looks for the GNU gettext tools. This module defines
5331 the following values:
5332
5333
5334 GETTEXT_MSGMERGE_EXECUTABLE: the full path to the msgmerge tool.
5335 GETTEXT_MSGFMT_EXECUTABLE: the full path to the msgfmt tool.
5336 GETTEXT_FOUND: True if gettext has been found.
5337 GETTEXT_VERSION_STRING: the version of gettext found (since CMake 2.8.8)
5338
5339
5340
5341
5342 Additionally it provides the following macros: GETTEXT_CRE‐
5343 ATE_TRANSLATIONS ( outputFile [ALL] file1 ... fileN )
5344
5345
5346 This will create a target "translations" which will convert the
5347 given input po files into the binary output mo file. If the
5348 ALL option is used, the translations will also be created when
5349 building the default target.
5350
5351 GETTEXT_PROCESS_POT( <potfile> [ALL] [INSTALL_DESTINATION <dest‐
5352 dir>] LANGUAGES <lang1> <lang2> ... )
5353
5354
5355 Process the given pot file to mo files.
5356 If INSTALL_DESTINATION is given then automatically install rules will be created,
5357 the language subdirectory will be taken into account (by default use share/locale/).
5358 If ALL is specified, the pot file is processed when building the all traget.
5359 It creates a custom target "potfile".
5360
5361 GETTEXT_PROCESS_PO_FILES( <lang> [ALL] [INSTALL_DESTINATION
5362 <dir>] PO_FILES <po1> <po2> ... )
5363
5364
5365 Process the given po files to mo files for the given language.
5366 If INSTALL_DESTINATION is given then automatically install rules will be created,
5367 the language subdirectory will be taken into account (by default use share/locale/).
5368 If ALL is specified, the po files are processed when building the all traget.
5369 It creates a custom target "pofiles".
5370
5371
5372 FindGit
5373
5374
5375 The module defines the following variables:
5376
5377
5378 GIT_EXECUTABLE - path to git command line client
5379 GIT_FOUND - true if the command line client was found
5380 GIT_VERSION_STRING - the version of git found (since CMake 2.8.8)
5381
5382 Example usage:
5383
5384
5385 find_package(Git)
5386 if(GIT_FOUND)
5387 message("git found: ${GIT_EXECUTABLE}")
5388 endif()
5389
5390
5391 FindGnuTLS
5392 Try to find the GNU Transport Layer Security library (gnutls)
5393
5394
5395
5396
5397 Once done this will define
5398
5399
5400 GNUTLS_FOUND - System has gnutls
5401 GNUTLS_INCLUDE_DIR - The gnutls include directory
5402 GNUTLS_LIBRARIES - The libraries needed to use gnutls
5403 GNUTLS_DEFINITIONS - Compiler switches required for using gnutls
5404
5405
5406 FindGnuplot
5407 this module looks for gnuplot
5408
5409
5410
5411
5412 Once done this will define
5413
5414
5415 GNUPLOT_FOUND - system has Gnuplot
5416 GNUPLOT_EXECUTABLE - the Gnuplot executable
5417 GNUPLOT_VERSION_STRING - the version of Gnuplot found (since CMake 2.8.8)
5418
5419
5420
5421
5422 GNUPLOT_VERSION_STRING will not work for old versions like
5423 3.7.1.
5424
5425
5426 FindHDF5
5427 Find HDF5, a library for reading and writing self describing
5428 array data.
5429
5430
5431
5432
5433 This module invokes the HDF5 wrapper compiler that should be
5434 installed alongside HDF5. Depending upon the HDF5 Configura‐
5435 tion, the wrapper compiler is called either h5cc or h5pcc. If
5436 this succeeds, the module will then call the compiler with the
5437 -show argument to see what flags are used when compiling an HDF5
5438 client application.
5439
5440
5441 The module will optionally accept the COMPONENTS argument. If
5442 no COMPONENTS are specified, then the find module will default
5443 to finding only the HDF5 C library. If one or more COMPONENTS
5444 are specified, the module will attempt to find the language
5445 bindings for the specified components. The only valid compo‐
5446 nents are C, CXX, Fortran, HL, and Fortran_HL. If the COMPO‐
5447 NENTS argument is not given, the module will attempt to find
5448 only the C bindings.
5449
5450
5451 On UNIX systems, this module will read the variable
5452 HDF5_USE_STATIC_LIBRARIES to determine whether or not to prefer
5453 a static link to a dynamic link for HDF5 and all of it's depen‐
5454 dencies. To use this feature, make sure that the
5455 HDF5_USE_STATIC_LIBRARIES variable is set before the call to
5456 find_package.
5457
5458
5459 To provide the module with a hint about where to find your HDF5
5460 installation, you can set the environment variable HDF5_ROOT.
5461 The Find module will then look in this path when searching for
5462 HDF5 executables, paths, and libraries.
5463
5464
5465 In addition to finding the includes and libraries required to
5466 compile an HDF5 client application, this module also makes an
5467 effort to find tools that come with the HDF5 distribution that
5468 may be useful for regression testing.
5469
5470
5471 This module will define the following variables:
5472
5473
5474 HDF5_INCLUDE_DIRS - Location of the hdf5 includes
5475 HDF5_INCLUDE_DIR - Location of the hdf5 includes (deprecated)
5476 HDF5_DEFINITIONS - Required compiler definitions for HDF5
5477 HDF5_C_LIBRARIES - Required libraries for the HDF5 C bindings.
5478 HDF5_CXX_LIBRARIES - Required libraries for the HDF5 C++ bindings
5479 HDF5_Fortran_LIBRARIES - Required libraries for the HDF5 Fortran bindings
5480 HDF5_HL_LIBRARIES - Required libraries for the HDF5 high level API
5481 HDF5_Fortran_HL_LIBRARIES - Required libraries for the high level Fortran
5482 bindings.
5483 HDF5_LIBRARIES - Required libraries for all requested bindings
5484 HDF5_FOUND - true if HDF5 was found on the system
5485 HDF5_LIBRARY_DIRS - the full set of library directories
5486 HDF5_IS_PARALLEL - Whether or not HDF5 was found with parallel IO support
5487 HDF5_C_COMPILER_EXECUTABLE - the path to the HDF5 C wrapper compiler
5488 HDF5_CXX_COMPILER_EXECUTABLE - the path to the HDF5 C++ wrapper compiler
5489 HDF5_Fortran_COMPILER_EXECUTABLE - the path to the HDF5 Fortran wrapper compiler
5490 HDF5_DIFF_EXECUTABLE - the path to the HDF5 dataset comparison tool
5491
5492
5493 FindHSPELL
5494 Try to find Hspell
5495
5496 Once done this will define
5497
5498
5499 HSPELL_FOUND - system has Hspell
5500 HSPELL_INCLUDE_DIR - the Hspell include directory
5501 HSPELL_LIBRARIES - The libraries needed to use Hspell
5502 HSPELL_DEFINITIONS - Compiler switches required for using Hspell
5503
5504
5505
5506
5507 HSPELL_VERSION_STRING - The version of Hspell found (x.y)
5508 HSPELL_MAJOR_VERSION - the major version of Hspell
5509 HSPELL_MINOR_VERSION - The minor version of Hspell
5510
5511
5512 FindHTMLHelp
5513 This module looks for Microsoft HTML Help Compiler
5514
5515 It defines:
5516
5517
5518 HTML_HELP_COMPILER : full path to the Compiler (hhc.exe)
5519 HTML_HELP_INCLUDE_PATH : include path to the API (htmlhelp.h)
5520 HTML_HELP_LIBRARY : full path to the library (htmlhelp.lib)
5521
5522
5523
5524
5525
5526 FindHg
5527
5528
5529 The module defines the following variables:
5530
5531
5532 HG_EXECUTABLE - path to mercurial command line client (hg)
5533 HG_FOUND - true if the command line client was found
5534 HG_VERSION_STRING - the version of mercurial found
5535
5536 Example usage:
5537
5538
5539 find_package(Hg)
5540 if(HG_FOUND)
5541 message("hg found: ${HG_EXECUTABLE}")
5542 endif()
5543
5544
5545 FindITK
5546 Find an ITK installation or build tree.
5547
5548
5549 FindIcotool
5550 Find icotool
5551
5552 This module looks for icotool. This module defines the following
5553 values:
5554
5555
5556 ICOTOOL_EXECUTABLE: the full path to the icotool tool.
5557 ICOTOOL_FOUND: True if icotool has been found.
5558 ICOTOOL_VERSION_STRING: the version of icotool found.
5559
5560
5561
5562
5563
5564 FindImageMagick
5565 Find the ImageMagick binary suite.
5566
5567 This module will search for a set of ImageMagick tools specified
5568 as components in the FIND_PACKAGE call. Typical components
5569 include, but are not limited to (future versions of ImageMagick
5570 might have additional components not listed here):
5571
5572
5573 animate
5574 compare
5575 composite
5576 conjure
5577 convert
5578 display
5579 identify
5580 import
5581 mogrify
5582 montage
5583 stream
5584
5585
5586
5587
5588 If no component is specified in the FIND_PACKAGE call, then it
5589 only searches for the ImageMagick executable directory. This
5590 code defines the following variables:
5591
5592
5593 ImageMagick_FOUND - TRUE if all components are found.
5594 ImageMagick_EXECUTABLE_DIR - Full path to executables directory.
5595 ImageMagick_<component>_FOUND - TRUE if <component> is found.
5596 ImageMagick_<component>_EXECUTABLE - Full path to <component> executable.
5597 ImageMagick_VERSION_STRING - the version of ImageMagick found
5598 (since CMake 2.8.8)
5599
5600
5601
5602
5603 ImageMagick_VERSION_STRING will not work for old versions like
5604 5.2.3.
5605
5606
5607 There are also components for the following ImageMagick APIs:
5608
5609
5610 Magick++
5611 MagickWand
5612 MagickCore
5613
5614
5615
5616
5617 For these components the following variables are set:
5618
5619
5620 ImageMagick_FOUND - TRUE if all components are found.
5621 ImageMagick_INCLUDE_DIRS - Full paths to all include dirs.
5622 ImageMagick_LIBRARIES - Full paths to all libraries.
5623 ImageMagick_<component>_FOUND - TRUE if <component> is found.
5624 ImageMagick_<component>_INCLUDE_DIRS - Full path to <component> include dirs.
5625 ImageMagick_<component>_LIBRARIES - Full path to <component> libraries.
5626
5627
5628
5629
5630 Example Usages:
5631
5632
5633 find_package(ImageMagick)
5634 find_package(ImageMagick COMPONENTS convert)
5635 find_package(ImageMagick COMPONENTS convert mogrify display)
5636 find_package(ImageMagick COMPONENTS Magick++)
5637 find_package(ImageMagick COMPONENTS Magick++ convert)
5638
5639
5640
5641
5642 Note that the standard FIND_PACKAGE features are supported
5643 (i.e., QUIET, REQUIRED, etc.).
5644
5645
5646 FindJNI
5647 Find JNI java libraries.
5648
5649 This module finds if Java is installed and determines where the
5650 include files and libraries are. It also determines what the
5651 name of the library is. This code sets the following variables:
5652
5653
5654 JNI_INCLUDE_DIRS = the include dirs to use
5655 JNI_LIBRARIES = the libraries to use
5656 JNI_FOUND = TRUE if JNI headers and libraries were found.
5657 JAVA_AWT_LIBRARY = the path to the jawt library
5658 JAVA_JVM_LIBRARY = the path to the jvm library
5659 JAVA_INCLUDE_PATH = the include path to jni.h
5660 JAVA_INCLUDE_PATH2 = the include path to jni_md.h
5661 JAVA_AWT_INCLUDE_PATH = the include path to jawt.h
5662
5663
5664
5665
5666
5667 FindJPEG
5668 Find JPEG
5669
5670 Find the native JPEG includes and library This module defines
5671
5672
5673 JPEG_INCLUDE_DIR, where to find jpeglib.h, etc.
5674 JPEG_LIBRARIES, the libraries needed to use JPEG.
5675 JPEG_FOUND, If false, do not try to use JPEG.
5676
5677 also defined, but not for general use are
5678
5679
5680 JPEG_LIBRARY, where to find the JPEG library.
5681
5682
5683 FindJasper
5684 Try to find the Jasper JPEG2000 library
5685
5686 Once done this will define
5687
5688
5689 JASPER_FOUND - system has Jasper
5690 JASPER_INCLUDE_DIR - the Jasper include directory
5691 JASPER_LIBRARIES - the libraries needed to use Jasper
5692 JASPER_VERSION_STRING - the version of Jasper found (since CMake 2.8.8)
5693
5694
5695 FindJava
5696 Find Java
5697
5698 This module finds if Java is installed and determines where the
5699 include files and libraries are. This code sets the following
5700 variables:
5701
5702
5703 Java_JAVA_EXECUTABLE = the full path to the Java runtime
5704 Java_JAVAC_EXECUTABLE = the full path to the Java compiler
5705 Java_JAVAH_EXECUTABLE = the full path to the Java header generator
5706 Java_JAVADOC_EXECUTABLE = the full path to the Java documention generator
5707 Java_JAR_EXECUTABLE = the full path to the Java archiver
5708 Java_VERSION_STRING = Version of the package found (java version), eg. 1.6.0_12
5709 Java_VERSION_MAJOR = The major version of the package found.
5710 Java_VERSION_MINOR = The minor version of the package found.
5711 Java_VERSION_PATCH = The patch version of the package found.
5712 Java_VERSION_TWEAK = The tweak version of the package found (after '_')
5713 Java_VERSION = This is set to: $major.$minor.$patch(.$tweak)
5714
5715
5716
5717
5718 The minimum required version of Java can be specified using the
5719 standard CMake syntax, e.g. find_package(Java 1.5)
5720
5721
5722 NOTE: ${Java_VERSION} and ${Java_VERSION_STRING} are not guaran‐
5723 teed to be identical. For example some java version may return:
5724 Java_VERSION_STRING = 1.5.0_17 and Java_VERSION =
5725 1.5.0.17
5726
5727
5728 another example is the Java OEM, with: Java_VERSION_STRING =
5729 1.6.0-oem and Java_VERSION = 1.6.0
5730
5731
5732 For these components the following variables are set:
5733
5734
5735 Java_FOUND - TRUE if all components are found.
5736 Java_INCLUDE_DIRS - Full paths to all include dirs.
5737 Java_LIBRARIES - Full paths to all libraries.
5738 Java_<component>_FOUND - TRUE if <component> is found.
5739
5740
5741
5742
5743 Example Usages:
5744
5745
5746 find_package(Java)
5747 find_package(Java COMPONENTS Runtime)
5748 find_package(Java COMPONENTS Development)
5749
5750
5751
5752
5753
5754 FindKDE3
5755 Find the KDE3 include and library dirs, KDE preprocessors and
5756 define a some macros
5757
5758
5759
5760
5761 This module defines the following variables:
5762
5763
5764 KDE3_DEFINITIONS - compiler definitions required for compiling KDE software
5765 KDE3_INCLUDE_DIR - the KDE include directory
5766 KDE3_INCLUDE_DIRS - the KDE and the Qt include directory, for use with include_directories()
5767 KDE3_LIB_DIR - the directory where the KDE libraries are installed, for use with link_directories()
5768 QT_AND_KDECORE_LIBS - this contains both the Qt and the kdecore library
5769 KDE3_DCOPIDL_EXECUTABLE - the dcopidl executable
5770 KDE3_DCOPIDL2CPP_EXECUTABLE - the dcopidl2cpp executable
5771 KDE3_KCFGC_EXECUTABLE - the kconfig_compiler executable
5772 KDE3_FOUND - set to TRUE if all of the above has been found
5773
5774
5775
5776
5777 The following user adjustable options are provided:
5778
5779
5780 KDE3_BUILD_TESTS - enable this to build KDE testcases
5781
5782
5783
5784
5785
5786
5787
5788 It also adds the following macros (from KDE3Macros.cmake)
5789 SRCS_VAR is always the variable which contains the list of
5790 source files for your application or library.
5791
5792
5793 KDE3_AUTOMOC(file1 ... fileN)
5794
5795
5796 Call this if you want to have automatic moc file handling.
5797 This means if you include "foo.moc" in the source file foo.cpp
5798 a moc file for the header foo.h will be created automatically.
5799 You can set the property SKIP_AUTOMAKE using set_source_files_properties()
5800 to exclude some files in the list from being processed.
5801
5802
5803
5804
5805 KDE3_ADD_MOC_FILES(SRCS_VAR file1 ... fileN )
5806
5807
5808 If you don't use the KDE3_AUTOMOC() macro, for the files
5809 listed here moc files will be created (named "foo.moc.cpp")
5810
5811
5812
5813
5814 KDE3_ADD_DCOP_SKELS(SRCS_VAR header1.h ... headerN.h )
5815
5816
5817 Use this to generate DCOP skeletions from the listed headers.
5818
5819
5820
5821
5822 KDE3_ADD_DCOP_STUBS(SRCS_VAR header1.h ... headerN.h )
5823
5824
5825 Use this to generate DCOP stubs from the listed headers.
5826
5827
5828
5829
5830 KDE3_ADD_UI_FILES(SRCS_VAR file1.ui ... fileN.ui )
5831
5832
5833 Use this to add the Qt designer ui files to your application/library.
5834
5835
5836
5837
5838 KDE3_ADD_KCFG_FILES(SRCS_VAR file1.kcfgc ... fileN.kcfgc )
5839
5840
5841 Use this to add KDE kconfig compiler files to your application/library.
5842
5843
5844
5845
5846 KDE3_INSTALL_LIBTOOL_FILE(target)
5847
5848
5849 This will create and install a simple libtool file for the given target.
5850
5851
5852
5853
5854 KDE3_ADD_EXECUTABLE(name file1 ... fileN )
5855
5856
5857 Currently identical to add_executable(), may provide some advanced features in the future.
5858
5859
5860
5861
5862 KDE3_ADD_KPART(name [WITH_PREFIX] file1 ... fileN )
5863
5864
5865 Create a KDE plugin (KPart, kioslave, etc.) from the given source files.
5866 If WITH_PREFIX is given, the resulting plugin will have the prefix "lib", otherwise it won't.
5867 It creates and installs an appropriate libtool la-file.
5868
5869
5870
5871
5872 KDE3_ADD_KDEINIT_EXECUTABLE(name file1 ... fileN )
5873
5874
5875 Create a KDE application in the form of a module loadable via kdeinit.
5876 A library named kdeinit_<name> will be created and a small executable which links to it.
5877
5878
5879
5880
5881 The option KDE3_ENABLE_FINAL to enable all-in-one compilation is
5882 no longer supported.
5883
5884
5885
5886
5887
5888 Author: Alexander Neundorf <neundorf@kde.org>
5889
5890
5891 FindKDE4
5892
5893
5894 Find KDE4 and provide all necessary variables and macros to com‐
5895 pile software for it. It looks for KDE 4 in the following direc‐
5896 tories in the given order:
5897
5898
5899 CMAKE_INSTALL_PREFIX
5900 KDEDIRS
5901 /opt/kde4
5902
5903
5904
5905
5906 Please look in FindKDE4Internal.cmake and KDE4Macros.cmake for
5907 more information. They are installed with the KDE 4 libraries in
5908 $KDEDIRS/share/apps/cmake/modules/.
5909
5910
5911 Author: Alexander Neundorf <neundorf@kde.org>
5912
5913
5914 FindLAPACK
5915 Find LAPACK library
5916
5917 This module finds an installed fortran library that implements
5918 the LAPACK linear-algebra interface (see
5919 http://www.netlib.org/lapack/).
5920
5921
5922 The approach follows that taken for the autoconf macro file,
5923 acx_lapack.m4 (distributed at http://ac-archive.source‐
5924 forge.net/ac-archive/acx_lapack.html).
5925
5926
5927 This module sets the following variables:
5928
5929
5930 LAPACK_FOUND - set to true if a library implementing the LAPACK interface
5931 is found
5932 LAPACK_LINKER_FLAGS - uncached list of required linker flags (excluding -l
5933 and -L).
5934 LAPACK_LIBRARIES - uncached list of libraries (using full path name) to
5935 link against to use LAPACK
5936 LAPACK95_LIBRARIES - uncached list of libraries (using full path name) to
5937 link against to use LAPACK95
5938 LAPACK95_FOUND - set to true if a library implementing the LAPACK f95
5939 interface is found
5940 BLA_STATIC if set on this determines what kind of linkage we do (static)
5941 BLA_VENDOR if set checks only the specified vendor, if not set checks
5942 all the possibilities
5943 BLA_F95 if set on tries to find the f95 interfaces for BLAS/LAPACK
5944
5945
5946 FindLATEX
5947 Find Latex
5948
5949 This module finds if Latex is installed and determines where the
5950 executables are. This code sets the following variables:
5951
5952
5953 LATEX_COMPILER: path to the LaTeX compiler
5954 PDFLATEX_COMPILER: path to the PdfLaTeX compiler
5955 BIBTEX_COMPILER: path to the BibTeX compiler
5956 MAKEINDEX_COMPILER: path to the MakeIndex compiler
5957 DVIPS_CONVERTER: path to the DVIPS converter
5958 PS2PDF_CONVERTER: path to the PS2PDF converter
5959 LATEX2HTML_CONVERTER: path to the LaTeX2Html converter
5960
5961
5962
5963
5964
5965 FindLibArchive
5966 Find libarchive library and headers
5967
5968 The module defines the following variables:
5969
5970
5971 LibArchive_FOUND - true if libarchive was found
5972 LibArchive_INCLUDE_DIRS - include search path
5973 LibArchive_LIBRARIES - libraries to link
5974 LibArchive_VERSION - libarchive 3-component version number
5975
5976
5977 FindLibLZMA
5978 Find LibLZMA
5979
5980 Find LibLZMA headers and library
5981
5982
5983 LIBLZMA_FOUND - True if liblzma is found.
5984 LIBLZMA_INCLUDE_DIRS - Directory where liblzma headers are located.
5985 LIBLZMA_LIBRARIES - Lzma libraries to link against.
5986 LIBLZMA_HAS_AUTO_DECODER - True if lzma_auto_decoder() is found (required).
5987 LIBLZMA_HAS_EASY_ENCODER - True if lzma_easy_encoder() is found (required).
5988 LIBLZMA_HAS_LZMA_PRESET - True if lzma_lzma_preset() is found (required).
5989 LIBLZMA_VERSION_MAJOR - The major version of lzma
5990 LIBLZMA_VERSION_MINOR - The minor version of lzma
5991 LIBLZMA_VERSION_PATCH - The patch version of lzma
5992 LIBLZMA_VERSION_STRING - version number as a string (ex: "5.0.3")
5993
5994
5995 FindLibXml2
5996 Try to find the LibXml2 xml processing library
5997
5998 Once done this will define
5999
6000
6001 LIBXML2_FOUND - System has LibXml2
6002 LIBXML2_INCLUDE_DIR - The LibXml2 include directory
6003 LIBXML2_LIBRARIES - The libraries needed to use LibXml2
6004 LIBXML2_DEFINITIONS - Compiler switches required for using LibXml2
6005 LIBXML2_XMLLINT_EXECUTABLE - The XML checking tool xmllint coming with LibXml2
6006 LIBXML2_VERSION_STRING - the version of LibXml2 found (since CMake 2.8.8)
6007
6008
6009 FindLibXslt
6010 Try to find the LibXslt library
6011
6012 Once done this will define
6013
6014
6015 LIBXSLT_FOUND - system has LibXslt
6016 LIBXSLT_INCLUDE_DIR - the LibXslt include directory
6017 LIBXSLT_LIBRARIES - Link these to LibXslt
6018 LIBXSLT_DEFINITIONS - Compiler switches required for using LibXslt
6019 LIBXSLT_VERSION_STRING - version of LibXslt found (since CMake 2.8.8)
6020
6021 Additionally, the following two variables are set (but not
6022 required for using xslt):
6023
6024
6025 LIBXSLT_EXSLT_LIBRARIES - Link to these if you need to link against the exslt library
6026 LIBXSLT_XSLTPROC_EXECUTABLE - Contains the full path to the xsltproc executable if found
6027
6028
6029 FindLua50
6030
6031
6032 Locate Lua library This module defines
6033
6034
6035 LUA50_FOUND, if false, do not try to link to Lua
6036 LUA_LIBRARIES, both lua and lualib
6037 LUA_INCLUDE_DIR, where to find lua.h and lualib.h (and probably lauxlib.h)
6038
6039
6040
6041
6042 Note that the expected include convention is
6043
6044
6045 #include "lua.h"
6046
6047 and not
6048
6049
6050 #include <lua/lua.h>
6051
6052 This is because, the lua location is not standardized and may
6053 exist in locations other than lua/
6054
6055
6056 FindLua51
6057
6058
6059 Locate Lua library This module defines
6060
6061
6062 LUA51_FOUND, if false, do not try to link to Lua
6063 LUA_LIBRARIES
6064 LUA_INCLUDE_DIR, where to find lua.h
6065 LUA_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
6066
6067
6068
6069
6070 Note that the expected include convention is
6071
6072
6073 #include "lua.h"
6074
6075 and not
6076
6077
6078 #include <lua/lua.h>
6079
6080 This is because, the lua location is not standardized and may
6081 exist in locations other than lua/
6082
6083
6084 FindLua52
6085
6086
6087 Locate Lua library This module defines
6088
6089
6090 LUA52_FOUND, if false, do not try to link to Lua
6091 LUA_LIBRARIES
6092 LUA_INCLUDE_DIR, where to find lua.h
6093 LUA_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
6094
6095
6096
6097
6098 Note that the expected include convention is
6099
6100
6101 #include "lua.h"
6102
6103 and not
6104
6105
6106 #include <lua/lua.h>
6107
6108 This is because, the lua location is not standardized and may
6109 exist in locations other than lua/
6110
6111
6112 FindMFC
6113 Find MFC on Windows
6114
6115 Find the native MFC - i.e. decide if an application can link to
6116 the MFC libraries.
6117
6118
6119 MFC_FOUND - Was MFC support found
6120
6121 You don't need to include anything or link anything to use it.
6122
6123
6124 FindMPEG
6125 Find the native MPEG includes and library
6126
6127 This module defines
6128
6129
6130 MPEG_INCLUDE_DIR, where to find MPEG.h, etc.
6131 MPEG_LIBRARIES, the libraries required to use MPEG.
6132 MPEG_FOUND, If false, do not try to use MPEG.
6133
6134 also defined, but not for general use are
6135
6136
6137 MPEG_mpeg2_LIBRARY, where to find the MPEG library.
6138 MPEG_vo_LIBRARY, where to find the vo library.
6139
6140
6141 FindMPEG2
6142 Find the native MPEG2 includes and library
6143
6144 This module defines
6145
6146
6147 MPEG2_INCLUDE_DIR, path to mpeg2dec/mpeg2.h, etc.
6148 MPEG2_LIBRARIES, the libraries required to use MPEG2.
6149 MPEG2_FOUND, If false, do not try to use MPEG2.
6150
6151 also defined, but not for general use are
6152
6153
6154 MPEG2_mpeg2_LIBRARY, where to find the MPEG2 library.
6155 MPEG2_vo_LIBRARY, where to find the vo library.
6156
6157
6158 FindMPI
6159 Find a Message Passing Interface (MPI) implementation
6160
6161 The Message Passing Interface (MPI) is a library used to write
6162 high-performance distributed-memory parallel applications, and
6163 is typically deployed on a cluster. MPI is a standard interface
6164 (defined by the MPI forum) for which many implementations are
6165 available. All of them have somewhat different include paths,
6166 libraries to link against, etc., and this module tries to smooth
6167 out those differences.
6168
6169
6170 === Variables ===
6171
6172
6173 This module will set the following variables per language in
6174 your project, where <lang> is one of C, CXX, or Fortran:
6175
6176
6177 MPI_<lang>_FOUND TRUE if FindMPI found MPI flags for <lang>
6178 MPI_<lang>_COMPILER MPI Compiler wrapper for <lang>
6179 MPI_<lang>_COMPILE_FLAGS Compilation flags for MPI programs
6180 MPI_<lang>_INCLUDE_PATH Include path(s) for MPI header
6181 MPI_<lang>_LINK_FLAGS Linking flags for MPI programs
6182 MPI_<lang>_LIBRARIES All libraries to link MPI programs against
6183
6184 Additionally, FindMPI sets the following variables for running
6185 MPI programs from the command line:
6186
6187
6188 MPIEXEC Executable for running MPI programs
6189 MPIEXEC_NUMPROC_FLAG Flag to pass to MPIEXEC before giving
6190 it the number of processors to run on
6191 MPIEXEC_PREFLAGS Flags to pass to MPIEXEC directly
6192 before the executable to run.
6193 MPIEXEC_POSTFLAGS Flags to pass to MPIEXEC after other flags
6194
6195 === Usage ===
6196
6197
6198 To use this module, simply call FindMPI from a CMakeLists.txt
6199 file, or run find_package(MPI), then run CMake. If you are
6200 happy with the auto- detected configuration for your language,
6201 then you're done. If not, you have two options:
6202
6203
6204 1. Set MPI_<lang>_COMPILER to the MPI wrapper (mpicc, etc.) of your
6205 choice and reconfigure. FindMPI will attempt to determine all the
6206 necessary variables using THAT compiler's compile and link flags.
6207 2. If this fails, or if your MPI implementation does not come with
6208 a compiler wrapper, then set both MPI_<lang>_LIBRARIES and
6209 MPI_<lang>_INCLUDE_PATH. You may also set any other variables
6210 listed above, but these two are required. This will circumvent
6211 autodetection entirely.
6212
6213 When configuration is successful, MPI_<lang>_COMPILER will be
6214 set to the compiler wrapper for <lang>, if it was found.
6215 MPI_<lang>_FOUND and other variables above will be set if any
6216 MPI implementation was found for <lang>, regardless of whether a
6217 compiler was found.
6218
6219
6220 When using MPIEXEC to execute MPI applications, you should typi‐
6221 cally use all of the MPIEXEC flags as follows:
6222
6223
6224 ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} PROCS
6225 ${MPIEXEC_PREFLAGS} EXECUTABLE ${MPIEXEC_POSTFLAGS} ARGS
6226
6227 where PROCS is the number of processors on which to execute the
6228 program, EXECUTABLE is the MPI program, and ARGS are the argu‐
6229 ments to pass to the MPI program.
6230
6231
6232 === Backward Compatibility ===
6233
6234
6235 For backward compatibility with older versions of FindMPI, these
6236 variables are set, but deprecated:
6237
6238
6239 MPI_FOUND MPI_COMPILER MPI_LIBRARY
6240 MPI_COMPILE_FLAGS MPI_INCLUDE_PATH MPI_EXTRA_LIBRARY
6241 MPI_LINK_FLAGS MPI_LIBRARIES
6242
6243 In new projects, please use the MPI_<lang>_XXX equivalents.
6244
6245
6246 FindMatlab
6247 this module looks for Matlab
6248
6249 Defines:
6250
6251
6252 MATLAB_INCLUDE_DIR: include path for mex.h, engine.h
6253 MATLAB_LIBRARIES: required libraries: libmex, etc
6254 MATLAB_MEX_LIBRARY: path to libmex.lib
6255 MATLAB_MX_LIBRARY: path to libmx.lib
6256 MATLAB_ENG_LIBRARY: path to libeng.lib
6257
6258
6259 FindMotif
6260 Try to find Motif (or lesstif)
6261
6262 Once done this will define:
6263
6264
6265 MOTIF_FOUND - system has MOTIF
6266 MOTIF_INCLUDE_DIR - include paths to use Motif
6267 MOTIF_LIBRARIES - Link these to use Motif
6268
6269
6270 FindOpenAL
6271
6272
6273 Locate OpenAL This module defines OPENAL_LIBRARY OPENAL_FOUND,
6274 if false, do not try to link to OpenAL OPENAL_INCLUDE_DIR, where
6275 to find the headers
6276
6277
6278 $OPENALDIR is an environment variable that would correspond to
6279 the ./configure --prefix=$OPENALDIR used in building OpenAL.
6280
6281
6282 Created by Eric Wing. This was influenced by the FindSDL.cmake
6283 module.
6284
6285
6286 FindOpenGL
6287 Try to find OpenGL
6288
6289 Once done this will define
6290
6291
6292 OPENGL_FOUND - system has OpenGL
6293 OPENGL_XMESA_FOUND - system has XMESA
6294 OPENGL_GLU_FOUND - system has GLU
6295 OPENGL_INCLUDE_DIR - the GL include directory
6296 OPENGL_LIBRARIES - Link these to use OpenGL and GLU
6297
6298
6299
6300
6301 If you want to use just GL you can use these values
6302
6303
6304 OPENGL_gl_LIBRARY - Path to OpenGL Library
6305 OPENGL_glu_LIBRARY - Path to GLU Library
6306
6307
6308
6309
6310 On OSX default to using the framework version of opengl People
6311 will have to change the cache values of OPENGL_glu_LIBRARY and
6312 OPENGL_gl_LIBRARY to use OpenGL with X11 on OSX
6313
6314
6315 FindOpenMP
6316 Finds OpenMP support
6317
6318 This module can be used to detect OpenMP support in a compiler.
6319 If the compiler supports OpenMP, the flags required to compile
6320 with OpenMP support are returned in variables for the different
6321 languages. The variables may be empty if the compiler does not
6322 need a special flag to support OpenMP.
6323
6324
6325 The following variables are set:
6326
6327
6328 OpenMP_C_FLAGS - flags to add to the C compiler for OpenMP support
6329 OpenMP_CXX_FLAGS - flags to add to the CXX compiler for OpenMP support
6330 OPENMP_FOUND - true if openmp is detected
6331
6332
6333
6334
6335 Supported compilers can be found at
6336 http://openmp.org/wp/openmp-compilers/
6337
6338
6339 FindOpenSSL
6340 Try to find the OpenSSL encryption library
6341
6342 Once done this will define
6343
6344
6345 OPENSSL_ROOT_DIR - Set this variable to the root installation of OpenSSL
6346
6347
6348
6349
6350 Read-Only variables:
6351
6352
6353 OPENSSL_FOUND - system has the OpenSSL library
6354 OPENSSL_INCLUDE_DIR - the OpenSSL include directory
6355 OPENSSL_LIBRARIES - The libraries needed to use OpenSSL
6356 OPENSSL_VERSION - This is set to $major.$minor.$revision$path (eg. 0.9.8s)
6357
6358
6359 FindOpenSceneGraph
6360 Find OpenSceneGraph
6361
6362 This module searches for the OpenSceneGraph core "osg" library
6363 as well as OpenThreads, and whatever additional COMPONENTS
6364 (nodekits) that you specify.
6365
6366
6367 See http://www.openscenegraph.org
6368
6369
6370
6371
6372 NOTE: To use this module effectively you must either require
6373 CMake >= 2.6.3 with cmake_minimum_required(VERSION 2.6.3) or
6374 download and place FindOpenThreads.cmake, Findosg_func‐
6375 tions.cmake, Findosg.cmake, and Find<etc>.cmake files into your
6376 CMAKE_MODULE_PATH.
6377
6378
6379 ==================================
6380
6381
6382 This module accepts the following variables (note mixed case)
6383
6384
6385 OpenSceneGraph_DEBUG - Enable debugging output
6386
6387
6388
6389
6390 OpenSceneGraph_MARK_AS_ADVANCED - Mark cache variables as advanced
6391 automatically
6392
6393
6394
6395
6396 The following environment variables are also respected for find‐
6397 ing the OSG and it's various components. CMAKE_PREFIX_PATH can
6398 also be used for this (see find_library() CMake documentation).
6399
6400
6401 <MODULE>_DIR (where MODULE is of the form "OSGVOLUME" and there is a FindosgVolume.cmake file)
6402 OSG_DIR
6403 OSGDIR
6404 OSG_ROOT
6405
6406
6407
6408
6409 [CMake 2.8.10]: The CMake variable OSG_DIR can now be used as
6410 well to influence detection, instead of needing to specify an
6411 environment variable.
6412
6413
6414 This module defines the following output variables:
6415
6416
6417 OPENSCENEGRAPH_FOUND - Was the OSG and all of the specified components found?
6418
6419
6420
6421
6422 OPENSCENEGRAPH_VERSION - The version of the OSG which was found
6423
6424
6425
6426
6427 OPENSCENEGRAPH_INCLUDE_DIRS - Where to find the headers
6428
6429
6430
6431
6432 OPENSCENEGRAPH_LIBRARIES - The OSG libraries
6433
6434
6435
6436
6437 ================================== Example Usage:
6438
6439
6440 find_package(OpenSceneGraph 2.0.0 REQUIRED osgDB osgUtil)
6441 # libOpenThreads & libosg automatically searched
6442 include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS})
6443
6444
6445
6446
6447 add_executable(foo foo.cc)
6448 target_link_libraries(foo ${OPENSCENEGRAPH_LIBRARIES})
6449
6450
6451
6452
6453
6454 FindOpenThreads
6455
6456
6457 OpenThreads is a C++ based threading library. Its largest user‐
6458 base seems to OpenSceneGraph so you might notice I accept OSGDIR
6459 as an environment path. I consider this part of the Findosg*
6460 suite used to find OpenSceneGraph components. Each component is
6461 separate and you must opt in to each module.
6462
6463
6464 Locate OpenThreads This module defines OPENTHREADS_LIBRARY
6465 OPENTHREADS_FOUND, if false, do not try to link to OpenThreads
6466 OPENTHREADS_INCLUDE_DIR, where to find the headers
6467
6468
6469 $OPENTHREADS_DIR is an environment variable that would corre‐
6470 spond to the ./configure --prefix=$OPENTHREADS_DIR used in
6471 building osg.
6472
6473
6474 [CMake 2.8.10]: The CMake variables OPENTHREADS_DIR or OSG_DIR
6475 can now be used as well to influence detection, instead of need‐
6476 ing to specify an environment variable.
6477
6478
6479 Created by Eric Wing.
6480
6481
6482 FindPHP4
6483 Find PHP4
6484
6485 This module finds if PHP4 is installed and determines where the
6486 include files and libraries are. It also determines what the
6487 name of the library is. This code sets the following variables:
6488
6489
6490 PHP4_INCLUDE_PATH = path to where php.h can be found
6491 PHP4_EXECUTABLE = full path to the php4 binary
6492
6493
6494
6495
6496
6497 FindPNG
6498 Find the native PNG includes and library
6499
6500
6501
6502
6503 This module searches libpng, the library for working with PNG
6504 images.
6505
6506
6507 It defines the following variables
6508
6509
6510 PNG_INCLUDE_DIRS, where to find png.h, etc.
6511 PNG_LIBRARIES, the libraries to link against to use PNG.
6512 PNG_DEFINITIONS - You should add_definitons(${PNG_DEFINITIONS}) before compiling code that includes png library files.
6513 PNG_FOUND, If false, do not try to use PNG.
6514 PNG_VERSION_STRING - the version of the PNG library found (since CMake 2.8.8)
6515
6516 Also defined, but not for general use are
6517
6518
6519 PNG_LIBRARY, where to find the PNG library.
6520
6521 For backward compatiblity the variable PNG_INCLUDE_DIR is also
6522 set. It has the same value as PNG_INCLUDE_DIRS.
6523
6524
6525 Since PNG depends on the ZLib compression library, none of the
6526 above will be defined unless ZLib can be found.
6527
6528
6529 FindPackageHandleStandardArgs
6530
6531
6532 FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> ... )
6533
6534
6535 This function is intended to be used in FindXXX.cmake modules
6536 files. It handles the REQUIRED, QUIET and version-related argu‐
6537 ments to find_package(). It also sets the <packagename>_FOUND
6538 variable. The package is considered found if all variables
6539 <var1>... listed contain valid results, e.g. valid filepaths.
6540
6541
6542 There are two modes of this function. The first argument in both
6543 modes is the name of the Find-module where it is called (in
6544 original casing).
6545
6546
6547 The first simple mode looks like this:
6548
6549
6550 FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> (DEFAULT_MSG|"Custom failure message") <var1>...<varN> )
6551
6552 If the variables <var1> to <varN> are all valid, then <UPPER‐
6553 CASED_NAME>_FOUND will be set to TRUE. If DEFAULT_MSG is given
6554 as second argument, then the function will generate itself use‐
6555 ful success and error messages. You can also supply a custom
6556 error message for the failure case. This is not recommended.
6557
6558
6559 The second mode is more powerful and also supports version
6560 checking:
6561
6562
6563 FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME [FOUND_VAR <resultVar>]
6564 [REQUIRED_VARS <var1>...<varN>]
6565 [VERSION_VAR <versionvar>]
6566 [HANDLE_COMPONENTS]
6567 [CONFIG_MODE]
6568 [FAIL_MESSAGE "Custom failure message"] )
6569
6570
6571
6572
6573 In this mode, the name of the result-variable can be set either
6574 to either <UPPERCASED_NAME>_FOUND or <OriginalCase_Name>_FOUND
6575 using the FOUND_VAR option. Other names for the result-variable
6576 are not allowed. So for a Find-module named FindFooBar.cmake,
6577 the two possible names are FooBar_FOUND and FOOBAR_FOUND. It is
6578 recommended to use the original case version. If the FOUND_VAR
6579 option is not used, the default is <UPPERCASED_NAME>_FOUND.
6580
6581
6582 As in the simple mode, if <var1> through <varN> are all valid,
6583 <packagename>_FOUND will be set to TRUE. After REQUIRED_VARS the
6584 variables which are required for this package are listed. Fol‐
6585 lowing VERSION_VAR the name of the variable can be specified
6586 which holds the version of the package which has been found. If
6587 this is done, this version will be checked against the (poten‐
6588 tially) specified required version used in the find_package()
6589 call. The EXACT keyword is also handled. The default messages
6590 include information about the required version and the version
6591 which has been actually found, both if the version is ok or not.
6592 If the package supports components, use the HANDLE_COMPONENTS
6593 option to enable handling them. In this case, find_package_han‐
6594 dle_standard_args() will report which components have been found
6595 and which are missing, and the <packagename>_FOUND variable will
6596 be set to FALSE if any of the required components (i.e. not the
6597 ones listed after OPTIONAL_COMPONENTS) are missing. Use the
6598 option CONFIG_MODE if your FindXXX.cmake module is a wrapper for
6599 a find_package(... NO_MODULE) call. In this case VERSION_VAR
6600 will be set to <NAME>_VERSION and the macro will automatically
6601 check whether the Config module was found. Via FAIL_MESSAGE a
6602 custom failure message can be specified, if this is not used,
6603 the default message will be displayed.
6604
6605
6606 Example for mode 1:
6607
6608
6609 find_package_handle_standard_args(LibXml2 DEFAULT_MSG LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
6610
6611
6612
6613
6614 LibXml2 is considered to be found, if both LIBXML2_LIBRARY and
6615 LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to
6616 TRUE. If it is not found and REQUIRED was used, it fails with
6617 FATAL_ERROR, independent whether QUIET was used or not. If it is
6618 found, success will be reported, including the content of
6619 <var1>. On repeated Cmake runs, the same message won't be
6620 printed again.
6621
6622
6623 Example for mode 2:
6624
6625
6626 find_package_handle_standard_args(LibXslt FOUND_VAR LibXslt_FOUND
6627 REQUIRED_VARS LibXslt_LIBRARIES LibXslt_INCLUDE_DIRS
6628 VERSION_VAR LibXslt_VERSION_STRING)
6629
6630 In this case, LibXslt is considered to be found if the vari‐
6631 able(s) listed after REQUIRED_VAR are all valid, i.e.
6632 LibXslt_LIBRARIES and LibXslt_INCLUDE_DIRS in this case. The
6633 result will then be stored in LibXslt_FOUND . Also the version
6634 of LibXslt will be checked by using the version contained in
6635 LibXslt_VERSION_STRING. Since no FAIL_MESSAGE is given, the
6636 default messages will be printed.
6637
6638
6639 Another example for mode 2:
6640
6641
6642 find_package(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4)
6643 find_package_handle_standard_args(Automoc4 CONFIG_MODE)
6644
6645 In this case, FindAutmoc4.cmake wraps a call to find_pack‐
6646 age(Automoc4 NO_MODULE) and adds an additional search directory
6647 for automoc4. Here the result will be stored in AUTOMOC4_FOUND.
6648 The following FIND_PACKAGE_HANDLE_STANDARD_ARGS() call produces
6649 a proper success/error message.
6650
6651
6652 FindPackageMessage
6653
6654
6655 FIND_PACKAGE_MESSAGE(<name> "message for user" "find result
6656 details")
6657
6658
6659 This macro is intended to be used in FindXXX.cmake modules
6660 files. It will print a message once for each unique find result.
6661 This is useful for telling the user where a package was found.
6662 The first argument specifies the name (XXX) of the package. The
6663 second argument specifies the message to display. The third
6664 argument lists details about the find result so that if they
6665 change the message will be displayed again. The macro also obeys
6666 the QUIET argument to the find_package command.
6667
6668
6669 Example:
6670
6671
6672 if(X11_FOUND)
6673 FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}"
6674 "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
6675 else()
6676 ...
6677 endif()
6678
6679
6680 FindPerl
6681 Find perl
6682
6683 this module looks for Perl
6684
6685
6686 PERL_EXECUTABLE - the full path to perl
6687 PERL_FOUND - If false, don't attempt to use perl.
6688 PERL_VERSION_STRING - version of perl found (since CMake 2.8.8)
6689
6690
6691 FindPerlLibs
6692 Find Perl libraries
6693
6694 This module finds if PERL is installed and determines where the
6695 include files and libraries are. It also determines what the
6696 name of the library is. This code sets the following variables:
6697
6698
6699 PERLLIBS_FOUND = True if perl.h & libperl were found
6700 PERL_INCLUDE_PATH = path to where perl.h is found
6701 PERL_LIBRARY = path to libperl
6702 PERL_EXECUTABLE = full path to the perl binary
6703
6704
6705
6706
6707 The minimum required version of Perl can be specified using the
6708 standard syntax, e.g. find_package(PerlLibs 6.0)
6709
6710
6711 The following variables are also available if needed
6712 (introduced after CMake 2.6.4)
6713
6714
6715
6716
6717 PERL_SITESEARCH = path to the sitesearch install dir
6718 PERL_SITELIB = path to the sitelib install directory
6719 PERL_VENDORARCH = path to the vendor arch install directory
6720 PERL_VENDORLIB = path to the vendor lib install directory
6721 PERL_ARCHLIB = path to the arch lib install directory
6722 PERL_PRIVLIB = path to the priv lib install directory
6723 PERL_EXTRA_C_FLAGS = Compilation flags used to build perl
6724
6725
6726
6727
6728
6729 FindPhysFS
6730
6731
6732 Locate PhysFS library This module defines PHYSFS_LIBRARY, the
6733 name of the library to link against PHYSFS_FOUND, if false, do
6734 not try to link to PHYSFS PHYSFS_INCLUDE_DIR, where to find
6735 physfs.h
6736
6737
6738 $PHYSFSDIR is an environment variable that would correspond to
6739 the ./configure --prefix=$PHYSFSDIR used in building PHYSFS.
6740
6741
6742 Created by Eric Wing.
6743
6744
6745 FindPike
6746 Find Pike
6747
6748 This module finds if PIKE is installed and determines where the
6749 include files and libraries are. It also determines what the
6750 name of the library is. This code sets the following variables:
6751
6752
6753 PIKE_INCLUDE_PATH = path to where program.h is found
6754 PIKE_EXECUTABLE = full path to the pike binary
6755
6756
6757
6758
6759
6760 FindPkgConfig
6761 a pkg-config module for CMake
6762
6763
6764
6765
6766 Usage:
6767
6768
6769 pkg_check_modules(<PREFIX> [REQUIRED] [QUIET] <MODULE> [<MODULE>]*)
6770 checks for all the given modules
6771
6772
6773
6774
6775 pkg_search_module(<PREFIX> [REQUIRED] [QUIET] <MODULE> [<MODULE>]*)
6776 checks for given modules and uses the first working one
6777
6778
6779
6780
6781 When the 'REQUIRED' argument was set, macros will fail with an
6782 error when module(s) could not be found
6783
6784
6785 When the 'QUIET' argument is set, no status messages will be
6786 printed.
6787
6788
6789 It sets the following variables:
6790
6791
6792 PKG_CONFIG_FOUND ... if pkg-config executable was found
6793 PKG_CONFIG_EXECUTABLE ... pathname of the pkg-config program
6794 PKG_CONFIG_VERSION_STRING ... the version of the pkg-config program found
6795 (since CMake 2.8.8)
6796
6797
6798
6799
6800 For the following variables two sets of values exist; first one
6801 is the common one and has the given PREFIX. The second set con‐
6802 tains flags which are given out when pkgconfig was called with
6803 the '--static' option.
6804
6805
6806 <XPREFIX>_FOUND ... set to 1 if module(s) exist
6807 <XPREFIX>_LIBRARIES ... only the libraries (w/o the '-l')
6808 <XPREFIX>_LIBRARY_DIRS ... the paths of the libraries (w/o the '-L')
6809 <XPREFIX>_LDFLAGS ... all required linker flags
6810 <XPREFIX>_LDFLAGS_OTHER ... all other linker flags
6811 <XPREFIX>_INCLUDE_DIRS ... the '-I' preprocessor flags (w/o the '-I')
6812 <XPREFIX>_CFLAGS ... all required cflags
6813 <XPREFIX>_CFLAGS_OTHER ... the other compiler flags
6814
6815
6816
6817
6818 <XPREFIX> = <PREFIX> for common case
6819 <XPREFIX> = <PREFIX>_STATIC for static linking
6820
6821
6822
6823
6824 There are some special variables whose prefix depends on the
6825 count of given modules. When there is only one module, <PREFIX>
6826 stays unchanged. When there are multiple modules, the prefix
6827 will be changed to <PREFIX>_<MODNAME>:
6828
6829
6830 <XPREFIX>_VERSION ... version of the module
6831 <XPREFIX>_PREFIX ... prefix-directory of the module
6832 <XPREFIX>_INCLUDEDIR ... include-dir of the module
6833 <XPREFIX>_LIBDIR ... lib-dir of the module
6834
6835
6836
6837
6838 <XPREFIX> = <PREFIX> when |MODULES| == 1, else
6839 <XPREFIX> = <PREFIX>_<MODNAME>
6840
6841
6842
6843
6844 A <MODULE> parameter can have the following formats:
6845
6846
6847 {MODNAME} ... matches any version
6848 {MODNAME}>={VERSION} ... at least version <VERSION> is required
6849 {MODNAME}={VERSION} ... exactly version <VERSION> is required
6850 {MODNAME}<={VERSION} ... modules must not be newer than <VERSION>
6851
6852
6853
6854
6855 Examples
6856
6857
6858 pkg_check_modules (GLIB2 glib-2.0)
6859
6860
6861
6862
6863 pkg_check_modules (GLIB2 glib-2.0>=2.10)
6864 requires at least version 2.10 of glib2 and defines e.g.
6865 GLIB2_VERSION=2.10.3
6866
6867
6868
6869
6870 pkg_check_modules (FOO glib-2.0>=2.10 gtk+-2.0)
6871 requires both glib2 and gtk2, and defines e.g.
6872 FOO_glib-2.0_VERSION=2.10.3
6873 FOO_gtk+-2.0_VERSION=2.8.20
6874
6875
6876
6877
6878 pkg_check_modules (XRENDER REQUIRED xrender)
6879 defines e.g.:
6880 XRENDER_LIBRARIES=Xrender;X11
6881 XRENDER_STATIC_LIBRARIES=Xrender;X11;pthread;Xau;Xdmcp
6882
6883
6884
6885
6886 pkg_search_module (BAR libxml-2.0 libxml2 libxml>=2)
6887
6888
6889 FindPostgreSQL
6890 Find the PostgreSQL installation.
6891
6892 In Windows, we make the assumption that, if the PostgreSQL files
6893 are installed, the default directory will be C:\Program
6894 Files\PostgreSQL.
6895
6896
6897 This module defines
6898
6899
6900 PostgreSQL_LIBRARIES - the PostgreSQL libraries needed for linking
6901 PostgreSQL_INCLUDE_DIRS - the directories of the PostgreSQL headers
6902 PostgreSQL_VERSION_STRING - the version of PostgreSQL found (since CMake 2.8.8)
6903
6904
6905 FindProducer
6906
6907
6908 Though Producer isn't directly part of OpenSceneGraph, its pri‐
6909 mary user is OSG so I consider this part of the Findosg* suite
6910 used to find OpenSceneGraph components. You'll notice that I
6911 accept OSGDIR as an environment path.
6912
6913
6914 Each component is separate and you must opt in to each module.
6915 You must also opt into OpenGL (and OpenThreads?) as these mod‐
6916 ules won't do it for you. This is to allow you control over your
6917 own system piece by piece in case you need to opt out of certain
6918 components or change the Find behavior for a particular module
6919 (perhaps because the default FindOpenGL.cmake module doesn't
6920 work with your system as an example). If you want to use a more
6921 convenient module that includes everything, use the FindOpen‐
6922 SceneGraph.cmake instead of the Findosg*.cmake modules.
6923
6924
6925 Locate Producer This module defines PRODUCER_LIBRARY PRO‐
6926 DUCER_FOUND, if false, do not try to link to Producer PRO‐
6927 DUCER_INCLUDE_DIR, where to find the headers
6928
6929
6930 $PRODUCER_DIR is an environment variable that would correspond
6931 to the ./configure --prefix=$PRODUCER_DIR used in building osg.
6932
6933
6934 Created by Eric Wing.
6935
6936
6937 FindProtobuf
6938
6939
6940 Locate and configure the Google Protocol Buffers library.
6941
6942
6943 The following variables can be set and are optional:
6944
6945
6946 PROTOBUF_SRC_ROOT_FOLDER - When compiling with MSVC, if this cache variable is set
6947 the protobuf-default VS project build locations
6948 (vsprojects/Debug & vsprojects/Release) will be searched
6949 for libraries and binaries.
6950
6951
6952
6953
6954 PROTOBUF_IMPORT_DIRS - List of additional directories to be searched for
6955 imported .proto files. (New in CMake 2.8.8)
6956
6957
6958
6959
6960 Defines the following variables:
6961
6962
6963 PROTOBUF_FOUND - Found the Google Protocol Buffers library (libprotobuf & header files)
6964 PROTOBUF_INCLUDE_DIRS - Include directories for Google Protocol Buffers
6965 PROTOBUF_LIBRARIES - The protobuf libraries
6966
6967 [New in CMake 2.8.5]
6968
6969
6970 PROTOBUF_PROTOC_LIBRARIES - The protoc libraries
6971 PROTOBUF_LITE_LIBRARIES - The protobuf-lite libraries
6972
6973
6974
6975
6976 The following cache variables are also available to set or use:
6977
6978
6979 PROTOBUF_LIBRARY - The protobuf library
6980 PROTOBUF_PROTOC_LIBRARY - The protoc library
6981 PROTOBUF_INCLUDE_DIR - The include directory for protocol buffers
6982 PROTOBUF_PROTOC_EXECUTABLE - The protoc compiler
6983
6984 [New in CMake 2.8.5]
6985
6986
6987 PROTOBUF_LIBRARY_DEBUG - The protobuf library (debug)
6988 PROTOBUF_PROTOC_LIBRARY_DEBUG - The protoc library (debug)
6989 PROTOBUF_LITE_LIBRARY - The protobuf lite library
6990 PROTOBUF_LITE_LIBRARY_DEBUG - The protobuf lite library (debug)
6991
6992
6993
6994
6995 ====================================================================
6996 Example:
6997
6998
6999
7000
7001 find_package(Protobuf REQUIRED)
7002 include_directories(${PROTOBUF_INCLUDE_DIRS})
7003
7004
7005
7006
7007 include_directories(${CMAKE_CURRENT_BINARY_DIR})
7008 PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS foo.proto)
7009 add_executable(bar bar.cc ${PROTO_SRCS} ${PROTO_HDRS})
7010 target_link_libraries(bar ${PROTOBUF_LIBRARIES})
7011
7012
7013
7014
7015 NOTE: You may need to link against pthreads, depending
7016
7017
7018 on the platform.
7019
7020
7021
7022
7023 NOTE: The PROTOBUF_GENERATE_CPP macro & add_executable() or
7024 add_library()
7025
7026
7027 calls only work properly within the same directory.
7028
7029
7030
7031
7032 ====================================================================
7033
7034
7035
7036
7037 PROTOBUF_GENERATE_CPP (public function)
7038
7039
7040 SRCS = Variable to define with autogenerated
7041 source files
7042 HDRS = Variable to define with autogenerated
7043 header files
7044 ARGN = proto files
7045
7046
7047
7048
7049 ====================================================================
7050
7051
7052 FindPythonInterp
7053 Find python interpreter
7054
7055 This module finds if Python interpreter is installed and deter‐
7056 mines where the executables are. This code sets the following
7057 variables:
7058
7059
7060 PYTHONINTERP_FOUND - Was the Python executable found
7061 PYTHON_EXECUTABLE - path to the Python interpreter
7062
7063
7064
7065
7066 PYTHON_VERSION_STRING - Python version found e.g. 2.5.2
7067 PYTHON_VERSION_MAJOR - Python major version found e.g. 2
7068 PYTHON_VERSION_MINOR - Python minor version found e.g. 5
7069 PYTHON_VERSION_PATCH - Python patch version found e.g. 2
7070
7071
7072
7073
7074 The Python_ADDITIONAL_VERSIONS variable can be used to specify a
7075 list of version numbers that should be taken into account when
7076 searching for Python. You need to set this variable before call‐
7077 ing find_package(PythonInterp).
7078
7079
7080 FindPythonLibs
7081 Find python libraries
7082
7083 This module finds if Python is installed and determines where
7084 the include files and libraries are. It also determines what the
7085 name of the library is. This code sets the following variables:
7086
7087
7088 PYTHONLIBS_FOUND - have the Python libs been found
7089 PYTHON_LIBRARIES - path to the python library
7090 PYTHON_INCLUDE_PATH - path to where Python.h is found (deprecated)
7091 PYTHON_INCLUDE_DIRS - path to where Python.h is found
7092 PYTHON_DEBUG_LIBRARIES - path to the debug library (deprecated)
7093 PYTHONLIBS_VERSION_STRING - version of the Python libs found (since CMake 2.8.8)
7094
7095
7096
7097
7098 The Python_ADDITIONAL_VERSIONS variable can be used to specify a
7099 list of version numbers that should be taken into account when
7100 searching for Python. You need to set this variable before call‐
7101 ing find_package(PythonLibs).
7102
7103
7104 If you'd like to specify the installation of Python to use, you
7105 should modify the following cache variables:
7106
7107
7108 PYTHON_LIBRARY - path to the python library
7109 PYTHON_INCLUDE_DIR - path to where Python.h is found
7110
7111
7112 FindQt Searches for all installed versions of Qt.
7113
7114 This should only be used if your project can work with multiple
7115 versions of Qt. If not, you should just directly use FindQt4 or
7116 FindQt3. If multiple versions of Qt are found on the machine,
7117 then The user must set the option DESIRED_QT_VERSION to the ver‐
7118 sion they want to use. If only one version of qt is found on
7119 the machine, then the DESIRED_QT_VERSION is set to that version
7120 and the matching FindQt3 or FindQt4 module is included. Once the
7121 user sets DESIRED_QT_VERSION, then the FindQt3 or FindQt4 module
7122 is included.
7123
7124
7125 QT_REQUIRED if this is set to TRUE then if CMake can
7126 not find Qt4 or Qt3 an error is raised
7127 and a message is sent to the user.
7128
7129
7130
7131
7132 DESIRED_QT_VERSION OPTION is created
7133 QT4_INSTALLED is set to TRUE if qt4 is found.
7134 QT3_INSTALLED is set to TRUE if qt3 is found.
7135
7136
7137 FindQt3
7138 Locate Qt include paths and libraries
7139
7140 This module defines:
7141
7142
7143 QT_INCLUDE_DIR - where to find qt.h, etc.
7144 QT_LIBRARIES - the libraries to link against to use Qt.
7145 QT_DEFINITIONS - definitions to use when
7146 compiling code that uses Qt.
7147 QT_FOUND - If false, don't try to use Qt.
7148 QT_VERSION_STRING - the version of Qt found
7149
7150
7151
7152
7153 If you need the multithreaded version of Qt, set QT_MT_REQUIRED
7154 to TRUE
7155
7156
7157 Also defined, but not for general use are:
7158
7159
7160 QT_MOC_EXECUTABLE, where to find the moc tool.
7161 QT_UIC_EXECUTABLE, where to find the uic tool.
7162 QT_QT_LIBRARY, where to find the Qt library.
7163 QT_QTMAIN_LIBRARY, where to find the qtmain
7164 library. This is only required by Qt3 on Windows.
7165
7166
7167 FindQt4
7168 Find Qt 4
7169
7170 This module can be used to find Qt4. The most important issue is
7171 that the Qt4 qmake is available via the system path. This qmake
7172 is then used to detect basically everything else. This module
7173 defines a number of key variables and macros. The variable
7174 QT_USE_FILE is set which is the path to a CMake file that can be
7175 included to compile Qt 4 applications and libraries. It sets up
7176 the compilation environment for include directories, preproces‐
7177 sor defines and populates a QT_LIBRARIES variable.
7178
7179
7180 Typical usage could be something like:
7181
7182
7183 find_package(Qt4 4.4.3 REQUIRED QtCore QtGui QtXml)
7184 include(${QT_USE_FILE})
7185 add_executable(myexe main.cpp)
7186 target_link_libraries(myexe ${QT_LIBRARIES})
7187
7188
7189
7190
7191 The minimum required version can be specified using the standard
7192 find_package()-syntax (see example above). For compatibility
7193 with older versions of FindQt4.cmake it is also possible to set
7194 the variable QT_MIN_VERSION to the minimum required version of
7195 Qt4 before the find_package(Qt4) command. If both are used, the
7196 version used in the find_package() command overrides the one
7197 from QT_MIN_VERSION.
7198
7199
7200 When using the components argument, QT_USE_QT* variables are
7201 automatically set for the QT_USE_FILE to pick up. If one wishes
7202 to manually set them, the available ones to set include:
7203
7204
7205 QT_DONT_USE_QTCORE
7206 QT_DONT_USE_QTGUI
7207 QT_USE_QT3SUPPORT
7208 QT_USE_QTASSISTANT
7209 QT_USE_QAXCONTAINER
7210 QT_USE_QAXSERVER
7211 QT_USE_QTDESIGNER
7212 QT_USE_QTMOTIF
7213 QT_USE_QTMAIN
7214 QT_USE_QTMULTIMEDIA
7215 QT_USE_QTNETWORK
7216 QT_USE_QTNSPLUGIN
7217 QT_USE_QTOPENGL
7218 QT_USE_QTSQL
7219 QT_USE_QTXML
7220 QT_USE_QTSVG
7221 QT_USE_QTTEST
7222 QT_USE_QTUITOOLS
7223 QT_USE_QTDBUS
7224 QT_USE_QTSCRIPT
7225 QT_USE_QTASSISTANTCLIENT
7226 QT_USE_QTHELP
7227 QT_USE_QTWEBKIT
7228 QT_USE_QTXMLPATTERNS
7229 QT_USE_PHONON
7230 QT_USE_QTSCRIPTTOOLS
7231 QT_USE_QTDECLARATIVE
7232
7233
7234
7235
7236 QT_USE_IMPORTED_TARGETS
7237 If this variable is set to TRUE, FindQt4.cmake will create imported
7238 library targets for the various Qt libraries and set the
7239 library variables like QT_QTCORE_LIBRARY to point at these imported
7240 targets instead of the library file on disk. This provides much better
7241 handling of the release and debug versions of the Qt libraries and is
7242 also always backwards compatible, except for the case that dependencies
7243 of libraries are exported, these will then also list the names of the
7244 imported targets as dependency and not the file location on disk. This
7245 is much more flexible, but requires that FindQt4.cmake is executed before
7246 such an exported dependency file is processed.
7247
7248
7249
7250
7251 Note that if using IMPORTED targets, the qtmain.lib static library is
7252 automatically linked on Windows. To disable that globally, set the
7253 QT4_NO_LINK_QTMAIN variable before finding Qt4. To disable that for a
7254 particular executable, set the QT4_NO_LINK_QTMAIN target property to
7255 True on the executable.
7256
7257
7258
7259
7260 QT_INCLUDE_DIRS_NO_SYSTEM
7261 If this variable is set to TRUE, the Qt include directories
7262 in the QT_USE_FILE will NOT have the SYSTEM keyword set.
7263
7264
7265
7266
7267 There are also some files that need processing by some Qt tools
7268 such as moc and uic. Listed below are macros that may be used
7269 to process those files.
7270
7271
7272 macro QT4_WRAP_CPP(outfiles inputfile ... OPTIONS ...)
7273 create moc code from a list of files containing Qt class with
7274 the Q_OBJECT declaration. Per-directory preprocessor definitions
7275 are also added. Options may be given to moc, such as those found
7276 when executing "moc -help".
7277
7278
7279
7280
7281 macro QT4_WRAP_UI(outfiles inputfile ... OPTIONS ...)
7282 create code from a list of Qt designer ui files.
7283 Options may be given to uic, such as those found
7284 when executing "uic -help"
7285
7286
7287
7288
7289 macro QT4_ADD_RESOURCES(outfiles inputfile ... OPTIONS ...)
7290 create code from a list of Qt resource files.
7291 Options may be given to rcc, such as those found
7292 when executing "rcc -help"
7293
7294
7295
7296
7297 macro QT4_GENERATE_MOC(inputfile outputfile )
7298 creates a rule to run moc on infile and create outfile.
7299 Use this if for some reason QT4_WRAP_CPP() isn't appropriate, e.g.
7300 because you need a custom filename for the moc file or something similar.
7301
7302
7303
7304
7305 macro QT4_AUTOMOC(sourcefile1 sourcefile2 ... )
7306 The qt4_automoc macro is obsolete. Use the CMAKE_AUTOMOC feature instead.
7307 This macro is still experimental.
7308 It can be used to have moc automatically handled.
7309 So if you have the files foo.h and foo.cpp, and in foo.h a
7310 a class uses the Q_OBJECT macro, moc has to run on it. If you don't
7311 want to use QT4_WRAP_CPP() (which is reliable and mature), you can insert
7312 #include "foo.moc"
7313 in foo.cpp and then give foo.cpp as argument to QT4_AUTOMOC(). This will the
7314 scan all listed files at cmake-time for such included moc files and if it finds
7315 them cause a rule to be generated to run moc at build time on the
7316 accompanying header file foo.h.
7317 If a source file has the SKIP_AUTOMOC property set it will be ignored by this macro.
7318
7319
7320
7321
7322 You should have a look on the AUTOMOC property for targets to achieve the same results.
7323
7324
7325
7326
7327 macro QT4_ADD_DBUS_INTERFACE(outfiles interface basename)
7328 Create the interface header and implementation files with the
7329 given basename from the given interface xml file and add it to
7330 the list of sources.
7331
7332
7333
7334
7335 You can pass additional parameters to the qdbusxml2cpp call by setting
7336 properties on the input file:
7337
7338
7339
7340
7341 INCLUDE the given file will be included in the generate interface header
7342
7343
7344
7345
7346 CLASSNAME the generated class is named accordingly
7347
7348
7349
7350
7351 NO_NAMESPACE the generated class is not wrapped in a namespace
7352
7353
7354
7355
7356 macro QT4_ADD_DBUS_INTERFACES(outfiles inputfile ... )
7357 Create the interface header and implementation files
7358 for all listed interface xml files.
7359 The basename will be automatically determined from the name of the xml file.
7360
7361
7362
7363
7364 The source file properties described for QT4_ADD_DBUS_INTERFACE also apply here.
7365
7366
7367
7368
7369 macro QT4_ADD_DBUS_ADAPTOR(outfiles xmlfile parentheader parentclassname [basename] [classname])
7370 create a dbus adaptor (header and implementation file) from the xml file
7371 describing the interface, and add it to the list of sources. The adaptor
7372 forwards the calls to a parent class, defined in parentheader and named
7373 parentclassname. The name of the generated files will be
7374 <basename>adaptor.{cpp,h} where basename defaults to the basename of the xml file.
7375 If <classname> is provided, then it will be used as the classname of the
7376 adaptor itself.
7377
7378
7379
7380
7381 macro QT4_GENERATE_DBUS_INTERFACE( header [interfacename] OPTIONS ...)
7382 generate the xml interface file from the given header.
7383 If the optional argument interfacename is omitted, the name of the
7384 interface file is constructed from the basename of the header with
7385 the suffix .xml appended.
7386 Options may be given to qdbuscpp2xml, such as those found when executing "qdbuscpp2xml --help"
7387
7388
7389
7390
7391 macro QT4_CREATE_TRANSLATION( qm_files directories ... sources ...
7392 ts_files ... OPTIONS ...)
7393 out: qm_files
7394 in: directories sources ts_files
7395 options: flags to pass to lupdate, such as -extensions to specify
7396 extensions for a directory scan.
7397 generates commands to create .ts (vie lupdate) and .qm
7398 (via lrelease) - files from directories and/or sources. The ts files are
7399 created and/or updated in the source tree (unless given with full paths).
7400 The qm files are generated in the build tree.
7401 Updating the translations can be done by adding the qm_files
7402 to the source list of your library/executable, so they are
7403 always updated, or by adding a custom target to control when
7404 they get updated/generated.
7405
7406
7407
7408
7409 macro QT4_ADD_TRANSLATION( qm_files ts_files ... )
7410 out: qm_files
7411 in: ts_files
7412 generates commands to create .qm from .ts - files. The generated
7413 filenames can be found in qm_files. The ts_files
7414 must exist and are not updated in any way.
7415
7416
7417
7418
7419 function QT4_USE_MODULES( target [link_type] modules...)
7420
7421
7422 This function is obsolete. Use target_link_libraries with IMPORTED targets instead.
7423 Make <target> use the <modules> from Qt. Using a Qt module means
7424 to link to the library, add the relevant include directories for the module,
7425 and add the relevant compiler defines for using the module.
7426 Modules are roughly equivalent to components of Qt4, so usage would be
7427 something like:
7428 qt4_use_modules(myexe Core Gui Declarative)
7429 to use QtCore, QtGui and QtDeclarative. The optional <link_type> argument can
7430 be specified as either LINK_PUBLIC or LINK_PRIVATE to specify the same argument
7431 to the target_link_libraries call.
7432
7433
7434
7435
7436
7437
7438
7439 Below is a detailed list of variables that FindQt4.cmake sets.
7440 QT_FOUND If false, don't try to use Qt.
7441 Qt4_FOUND If false, don't try to use Qt 4.
7442 QT4_FOUND If false, don't try to use Qt 4. This variable is for compatibility only.
7443
7444
7445
7446
7447 QT_VERSION_MAJOR The major version of Qt found.
7448 QT_VERSION_MINOR The minor version of Qt found.
7449 QT_VERSION_PATCH The patch version of Qt found.
7450
7451
7452
7453
7454 QT_EDITION Set to the edition of Qt (i.e. DesktopLight)
7455 QT_EDITION_DESKTOPLIGHT True if QT_EDITION == DesktopLight
7456 QT_QTCORE_FOUND True if QtCore was found.
7457 QT_QTGUI_FOUND True if QtGui was found.
7458 QT_QT3SUPPORT_FOUND True if Qt3Support was found.
7459 QT_QTASSISTANT_FOUND True if QtAssistant was found.
7460 QT_QTASSISTANTCLIENT_FOUND True if QtAssistantClient was found.
7461 QT_QAXCONTAINER_FOUND True if QAxContainer was found (Windows only).
7462 QT_QAXSERVER_FOUND True if QAxServer was found (Windows only).
7463 QT_QTDBUS_FOUND True if QtDBus was found.
7464 QT_QTDESIGNER_FOUND True if QtDesigner was found.
7465 QT_QTDESIGNERCOMPONENTS True if QtDesignerComponents was found.
7466 QT_QTHELP_FOUND True if QtHelp was found.
7467 QT_QTMOTIF_FOUND True if QtMotif was found.
7468 QT_QTMULTIMEDIA_FOUND True if QtMultimedia was found (since Qt 4.6.0).
7469 QT_QTNETWORK_FOUND True if QtNetwork was found.
7470 QT_QTNSPLUGIN_FOUND True if QtNsPlugin was found.
7471 QT_QTOPENGL_FOUND True if QtOpenGL was found.
7472 QT_QTSQL_FOUND True if QtSql was found.
7473 QT_QTSVG_FOUND True if QtSvg was found.
7474 QT_QTSCRIPT_FOUND True if QtScript was found.
7475 QT_QTSCRIPTTOOLS_FOUND True if QtScriptTools was found.
7476 QT_QTTEST_FOUND True if QtTest was found.
7477 QT_QTUITOOLS_FOUND True if QtUiTools was found.
7478 QT_QTWEBKIT_FOUND True if QtWebKit was found.
7479 QT_QTXML_FOUND True if QtXml was found.
7480 QT_QTXMLPATTERNS_FOUND True if QtXmlPatterns was found.
7481 QT_PHONON_FOUND True if phonon was found.
7482 QT_QTDECLARATIVE_FOUND True if QtDeclarative was found.
7483
7484
7485
7486
7487 QT_MAC_USE_COCOA For Mac OS X, its whether Cocoa or Carbon is used.
7488 In general, this should not be used, but its useful
7489 when having platform specific code.
7490
7491
7492
7493
7494 QT_DEFINITIONS Definitions to use when compiling code that uses Qt.
7495 You do not need to use this if you include QT_USE_FILE.
7496 The QT_USE_FILE will also define QT_DEBUG and QT_NO_DEBUG
7497 to fit your current build type. Those are not contained
7498 in QT_DEFINITIONS.
7499
7500
7501
7502
7503 QT_INCLUDES List of paths to all include directories of
7504 Qt4 QT_INCLUDE_DIR and QT_QTCORE_INCLUDE_DIR are
7505 always in this variable even if NOTFOUND,
7506 all other INCLUDE_DIRS are
7507 only added if they are found.
7508 You do not need to use this if you include QT_USE_FILE.
7509
7510
7511
7512
7513
7514
7515
7516 Include directories for the Qt modules are listed here.
7517 You do not need to use these variables if you include QT_USE_FILE.
7518
7519
7520
7521
7522 QT_INCLUDE_DIR Path to "include" of Qt4
7523 QT_QT3SUPPORT_INCLUDE_DIR Path to "include/Qt3Support"
7524 QT_QTASSISTANT_INCLUDE_DIR Path to "include/QtAssistant"
7525 QT_QTASSISTANTCLIENT_INCLUDE_DIR Path to "include/QtAssistant"
7526 QT_QAXCONTAINER_INCLUDE_DIR Path to "include/ActiveQt" (Windows only)
7527 QT_QAXSERVER_INCLUDE_DIR Path to "include/ActiveQt" (Windows only)
7528 QT_QTCORE_INCLUDE_DIR Path to "include/QtCore"
7529 QT_QTDBUS_INCLUDE_DIR Path to "include/QtDBus"
7530 QT_QTDESIGNER_INCLUDE_DIR Path to "include/QtDesigner"
7531 QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR Path to "include/QtDesigner"
7532 QT_QTGUI_INCLUDE_DIR Path to "include/QtGui"
7533 QT_QTHELP_INCLUDE_DIR Path to "include/QtHelp"
7534 QT_QTMOTIF_INCLUDE_DIR Path to "include/QtMotif"
7535 QT_QTMULTIMEDIA_INCLUDE_DIR Path to "include/QtMultimedia"
7536 QT_QTNETWORK_INCLUDE_DIR Path to "include/QtNetwork"
7537 QT_QTNSPLUGIN_INCLUDE_DIR Path to "include/QtNsPlugin"
7538 QT_QTOPENGL_INCLUDE_DIR Path to "include/QtOpenGL"
7539 QT_QTSCRIPT_INCLUDE_DIR Path to "include/QtScript"
7540 QT_QTSQL_INCLUDE_DIR Path to "include/QtSql"
7541 QT_QTSVG_INCLUDE_DIR Path to "include/QtSvg"
7542 QT_QTTEST_INCLUDE_DIR Path to "include/QtTest"
7543 QT_QTWEBKIT_INCLUDE_DIR Path to "include/QtWebKit"
7544 QT_QTXML_INCLUDE_DIR Path to "include/QtXml"
7545 QT_QTXMLPATTERNS_INCLUDE_DIR Path to "include/QtXmlPatterns"
7546 QT_PHONON_INCLUDE_DIR Path to "include/phonon"
7547 QT_QTSCRIPTTOOLS_INCLUDE_DIR Path to "include/QtScriptTools"
7548 QT_QTDECLARATIVE_INCLUDE_DIR Path to "include/QtDeclarative"
7549
7550
7551
7552
7553 QT_BINARY_DIR Path to "bin" of Qt4
7554 QT_LIBRARY_DIR Path to "lib" of Qt4
7555 QT_PLUGINS_DIR Path to "plugins" for Qt4
7556 QT_TRANSLATIONS_DIR Path to "translations" of Qt4
7557 QT_IMPORTS_DIR Path to "imports" of Qt4
7558 QT_DOC_DIR Path to "doc" of Qt4
7559 QT_MKSPECS_DIR Path to "mkspecs" of Qt4
7560
7561
7562
7563
7564
7565
7566
7567 The Qt toolkit may contain both debug and release libraries. In
7568 that case, the following library variables will contain both.
7569 You do not need to use these variables if you include
7570 QT_USE_FILE, and use QT_LIBRARIES.
7571
7572
7573 QT_QT3SUPPORT_LIBRARY The Qt3Support library
7574 QT_QTASSISTANT_LIBRARY The QtAssistant library
7575 QT_QTASSISTANTCLIENT_LIBRARY The QtAssistantClient library
7576 QT_QAXCONTAINER_LIBRARY The QAxContainer library (Windows only)
7577 QT_QAXSERVER_LIBRARY The QAxServer library (Windows only)
7578 QT_QTCORE_LIBRARY The QtCore library
7579 QT_QTDBUS_LIBRARY The QtDBus library
7580 QT_QTDESIGNER_LIBRARY The QtDesigner library
7581 QT_QTDESIGNERCOMPONENTS_LIBRARY The QtDesignerComponents library
7582 QT_QTGUI_LIBRARY The QtGui library
7583 QT_QTHELP_LIBRARY The QtHelp library
7584 QT_QTMOTIF_LIBRARY The QtMotif library
7585 QT_QTMULTIMEDIA_LIBRARY The QtMultimedia library
7586 QT_QTNETWORK_LIBRARY The QtNetwork library
7587 QT_QTNSPLUGIN_LIBRARY The QtNsPLugin library
7588 QT_QTOPENGL_LIBRARY The QtOpenGL library
7589 QT_QTSCRIPT_LIBRARY The QtScript library
7590 QT_QTSQL_LIBRARY The QtSql library
7591 QT_QTSVG_LIBRARY The QtSvg library
7592 QT_QTTEST_LIBRARY The QtTest library
7593 QT_QTUITOOLS_LIBRARY The QtUiTools library
7594 QT_QTWEBKIT_LIBRARY The QtWebKit library
7595 QT_QTXML_LIBRARY The QtXml library
7596 QT_QTXMLPATTERNS_LIBRARY The QtXmlPatterns library
7597 QT_QTMAIN_LIBRARY The qtmain library for Windows
7598 QT_PHONON_LIBRARY The phonon library
7599 QT_QTSCRIPTTOOLS_LIBRARY The QtScriptTools library
7600
7601
7602
7603
7604 The QtDeclarative library: QT_QTDECLARATIVE_LIBRARY
7605
7606
7607 also defined, but NOT for general use are
7608
7609
7610 QT_MOC_EXECUTABLE Where to find the moc tool.
7611 QT_UIC_EXECUTABLE Where to find the uic tool.
7612 QT_UIC3_EXECUTABLE Where to find the uic3 tool.
7613 QT_RCC_EXECUTABLE Where to find the rcc tool
7614 QT_DBUSCPP2XML_EXECUTABLE Where to find the qdbuscpp2xml tool.
7615 QT_DBUSXML2CPP_EXECUTABLE Where to find the qdbusxml2cpp tool.
7616 QT_LUPDATE_EXECUTABLE Where to find the lupdate tool.
7617 QT_LRELEASE_EXECUTABLE Where to find the lrelease tool.
7618 QT_QCOLLECTIONGENERATOR_EXECUTABLE Where to find the qcollectiongenerator tool.
7619 QT_DESIGNER_EXECUTABLE Where to find the Qt designer tool.
7620 QT_LINGUIST_EXECUTABLE Where to find the Qt linguist tool.
7621
7622
7623
7624
7625
7626
7627
7628 These are around for backwards compatibility they will be set
7629
7630
7631 QT_WRAP_CPP Set true if QT_MOC_EXECUTABLE is found
7632 QT_WRAP_UI Set true if QT_UIC_EXECUTABLE is found
7633
7634
7635
7636
7637 These variables do _NOT_ have any effect anymore (compared to
7638 FindQt.cmake)
7639
7640
7641 QT_MT_REQUIRED Qt4 is now always multithreaded
7642
7643
7644
7645
7646 These variables are set to "" Because Qt structure changed (They
7647 make no sense in Qt4)
7648
7649
7650 QT_QT_LIBRARY Qt-Library is now split
7651
7652
7653 FindQuickTime
7654
7655
7656 Locate QuickTime This module defines QUICKTIME_LIBRARY QUICK‐
7657 TIME_FOUND, if false, do not try to link to gdal QUICK‐
7658 TIME_INCLUDE_DIR, where to find the headers
7659
7660
7661 $QUICKTIME_DIR is an environment variable that would correspond
7662 to the ./configure --prefix=$QUICKTIME_DIR
7663
7664
7665 Created by Eric Wing.
7666
7667
7668 FindRTI
7669 Try to find M&S HLA RTI libraries
7670
7671 This module finds if any HLA RTI is installed and locates the
7672 standard RTI include files and libraries.
7673
7674
7675 RTI is a simulation infrastructure standardized by IEEE and
7676 SISO. It has a well defined C++ API that assures that simulation
7677 applications are independent on a particular RTI implementation.
7678
7679
7680 http://en.wikipedia.org/wiki/Run-Time_Infrastructure_(simulation)
7681
7682
7683
7684
7685 This code sets the following variables:
7686
7687
7688 RTI_INCLUDE_DIR = the directory where RTI includes file are found
7689 RTI_LIBRARIES = The libraries to link against to use RTI
7690 RTI_DEFINITIONS = -DRTI_USES_STD_FSTREAM
7691 RTI_FOUND = Set to FALSE if any HLA RTI was not found
7692
7693
7694
7695
7696 Report problems to <certi-devel@nongnu.org>
7697
7698
7699 FindRuby
7700 Find Ruby
7701
7702 This module finds if Ruby is installed and determines where the
7703 include files and libraries are. Ruby 1.8 and 1.9 are supported.
7704
7705
7706 The minimum required version of Ruby can be specified using the
7707 standard syntax, e.g. find_package(Ruby 1.8)
7708
7709
7710 It also determines what the name of the library is. This code
7711 sets the following variables:
7712
7713
7714 RUBY_EXECUTABLE = full path to the ruby binary
7715 RUBY_INCLUDE_DIRS = include dirs to be used when using the ruby library
7716 RUBY_LIBRARY = full path to the ruby library
7717 RUBY_VERSION = the version of ruby which was found, e.g. "1.8.7"
7718 RUBY_FOUND = set to true if ruby ws found successfully
7719
7720
7721
7722
7723 RUBY_INCLUDE_PATH = same as RUBY_INCLUDE_DIRS, only provided for compatibility reasons, don't use it
7724
7725
7726 FindSDL
7727 Locate SDL library
7728
7729 This module defines
7730
7731
7732 SDL_LIBRARY, the name of the library to link against
7733 SDL_FOUND, if false, do not try to link to SDL
7734 SDL_INCLUDE_DIR, where to find SDL.h
7735 SDL_VERSION_STRING, human-readable string containing the version of SDL
7736
7737
7738
7739
7740 This module responds to the the flag:
7741
7742
7743 SDL_BUILDING_LIBRARY
7744 If this is defined, then no SDL_main will be linked in because
7745 only applications need main().
7746 Otherwise, it is assumed you are building an application and this
7747 module will attempt to locate and set the the proper link flags
7748 as part of the returned SDL_LIBRARY variable.
7749
7750
7751
7752
7753 Don't forget to include SDLmain.h and SDLmain.m your project for
7754 the OS X framework based version. (Other versions link to -lSDL‐
7755 main which this module will try to find on your behalf.) Also
7756 for OS X, this module will automatically add the -framework
7757 Cocoa on your behalf.
7758
7759
7760
7761
7762
7763 Additional Note: If you see an empty SDL_LIBRARY_TEMP in your
7764 configuration and no SDL_LIBRARY, it means CMake did not find
7765 your SDL library (SDL.dll, libsdl.so, SDL.framework, etc). Set
7766 SDL_LIBRARY_TEMP to point to your SDL library, and configure
7767 again. Similarly, if you see an empty SDLMAIN_LIBRARY, you
7768 should set this value as appropriate. These values are used to
7769 generate the final SDL_LIBRARY variable, but when these values
7770 are unset, SDL_LIBRARY does not get created.
7771
7772
7773
7774
7775
7776 $SDLDIR is an environment variable that would correspond to the
7777 ./configure --prefix=$SDLDIR used in building SDL. l.e.galup
7778 9-20-02
7779
7780
7781 Modified by Eric Wing. Added code to assist with automated
7782 building by using environmental variables and providing a more
7783 controlled/consistent search behavior. Added new modifications
7784 to recognize OS X frameworks and additional Unix paths (FreeBSD,
7785 etc). Also corrected the header search path to follow "proper"
7786 SDL guidelines. Added a search for SDLmain which is needed by
7787 some platforms. Added a search for threads which is needed by
7788 some platforms. Added needed compile switches for MinGW.
7789
7790
7791 On OSX, this will prefer the Framework version (if found) over
7792 others. People will have to manually change the cache values of
7793 SDL_LIBRARY to override this selection or set the CMake environ‐
7794 ment CMAKE_INCLUDE_PATH to modify the search paths.
7795
7796
7797 Note that the header path has changed from SDL/SDL.h to just
7798 SDL.h This needed to change because "proper" SDL convention is
7799 #include "SDL.h", not <SDL/SDL.h>. This is done for portability
7800 reasons because not all systems place things in SDL/ (see Free‐
7801 BSD).
7802
7803
7804 FindSDL_image
7805 Locate SDL_image library
7806
7807 This module defines:
7808
7809
7810 SDL_IMAGE_LIBRARIES, the name of the library to link against
7811 SDL_IMAGE_INCLUDE_DIRS, where to find the headers
7812 SDL_IMAGE_FOUND, if false, do not try to link against
7813 SDL_IMAGE_VERSION_STRING - human-readable string containing the version of SDL_image
7814
7815
7816
7817
7818 For backward compatiblity the following variables are also set:
7819
7820
7821 SDLIMAGE_LIBRARY (same value as SDL_IMAGE_LIBRARIES)
7822 SDLIMAGE_INCLUDE_DIR (same value as SDL_IMAGE_INCLUDE_DIRS)
7823 SDLIMAGE_FOUND (same value as SDL_IMAGE_FOUND)
7824
7825
7826
7827
7828 $SDLDIR is an environment variable that would correspond to the
7829 ./configure --prefix=$SDLDIR used in building SDL.
7830
7831
7832 Created by Eric Wing. This was influenced by the FindSDL.cmake
7833 module, but with modifications to recognize OS X frameworks and
7834 additional Unix paths (FreeBSD, etc).
7835
7836
7837 FindSDL_mixer
7838 Locate SDL_mixer library
7839
7840 This module defines:
7841
7842
7843 SDL_MIXER_LIBRARIES, the name of the library to link against
7844 SDL_MIXER_INCLUDE_DIRS, where to find the headers
7845 SDL_MIXER_FOUND, if false, do not try to link against
7846 SDL_MIXER_VERSION_STRING - human-readable string containing the version of SDL_mixer
7847
7848
7849
7850
7851 For backward compatiblity the following variables are also set:
7852
7853
7854 SDLMIXER_LIBRARY (same value as SDL_MIXER_LIBRARIES)
7855 SDLMIXER_INCLUDE_DIR (same value as SDL_MIXER_INCLUDE_DIRS)
7856 SDLMIXER_FOUND (same value as SDL_MIXER_FOUND)
7857
7858
7859
7860
7861 $SDLDIR is an environment variable that would correspond to the
7862 ./configure --prefix=$SDLDIR used in building SDL.
7863
7864
7865 Created by Eric Wing. This was influenced by the FindSDL.cmake
7866 module, but with modifications to recognize OS X frameworks and
7867 additional Unix paths (FreeBSD, etc).
7868
7869
7870 FindSDL_net
7871 Locate SDL_net library
7872
7873 This module defines:
7874
7875
7876 SDL_NET_LIBRARIES, the name of the library to link against
7877 SDL_NET_INCLUDE_DIRS, where to find the headers
7878 SDL_NET_FOUND, if false, do not try to link against
7879 SDL_NET_VERSION_STRING - human-readable string containing the version of SDL_net
7880
7881
7882
7883
7884 For backward compatiblity the following variables are also set:
7885
7886
7887 SDLNET_LIBRARY (same value as SDL_NET_LIBRARIES)
7888 SDLNET_INCLUDE_DIR (same value as SDL_NET_INCLUDE_DIRS)
7889 SDLNET_FOUND (same value as SDL_NET_FOUND)
7890
7891
7892
7893
7894 $SDLDIR is an environment variable that would correspond to the
7895 ./configure --prefix=$SDLDIR used in building SDL.
7896
7897
7898 Created by Eric Wing. This was influenced by the FindSDL.cmake
7899 module, but with modifications to recognize OS X frameworks and
7900 additional Unix paths (FreeBSD, etc).
7901
7902
7903 FindSDL_sound
7904 Locates the SDL_sound library
7905
7906
7907
7908
7909 This module depends on SDL being found and must be called AFTER
7910 FindSDL.cmake is called.
7911
7912
7913 This module defines
7914
7915
7916 SDL_SOUND_INCLUDE_DIR, where to find SDL_sound.h
7917 SDL_SOUND_FOUND, if false, do not try to link to SDL_sound
7918 SDL_SOUND_LIBRARIES, this contains the list of libraries that you need
7919 to link against. This is a read-only variable and is marked INTERNAL.
7920 SDL_SOUND_EXTRAS, this is an optional variable for you to add your own
7921 flags to SDL_SOUND_LIBRARIES. This is prepended to SDL_SOUND_LIBRARIES.
7922 This is available mostly for cases this module failed to anticipate for
7923 and you must add additional flags. This is marked as ADVANCED.
7924 SDL_SOUND_VERSION_STRING, human-readable string containing the version of SDL_sound
7925
7926
7927
7928
7929 This module also defines (but you shouldn't need to use
7930 directly)
7931
7932
7933 SDL_SOUND_LIBRARY, the name of just the SDL_sound library you would link
7934 against. Use SDL_SOUND_LIBRARIES for you link instructions and not this one.
7935
7936 And might define the following as needed
7937
7938
7939 MIKMOD_LIBRARY
7940 MODPLUG_LIBRARY
7941 OGG_LIBRARY
7942 VORBIS_LIBRARY
7943 SMPEG_LIBRARY
7944 FLAC_LIBRARY
7945 SPEEX_LIBRARY
7946
7947
7948
7949
7950 Typically, you should not use these variables directly, and you
7951 should use SDL_SOUND_LIBRARIES which contains SDL_SOUND_LIBRARY
7952 and the other audio libraries (if needed) to successfully com‐
7953 pile on your system.
7954
7955
7956 Created by Eric Wing. This module is a bit more complicated than
7957 the other FindSDL* family modules. The reason is that SDL_sound
7958 can be compiled in a large variety of different ways which are
7959 independent of platform. SDL_sound may dynamically link against
7960 other 3rd party libraries to get additional codec support, such
7961 as Ogg Vorbis, SMPEG, ModPlug, MikMod, FLAC, Speex, and poten‐
7962 tially others. Under some circumstances which I don't fully
7963 understand, there seems to be a requirement that dependent
7964 libraries of libraries you use must also be explicitly linked
7965 against in order to successfully compile. SDL_sound does not
7966 currently have any system in place to know how it was compiled.
7967 So this CMake module does the hard work in trying to discover
7968 which 3rd party libraries are required for building (if any).
7969 This module uses a brute force approach to create a test program
7970 that uses SDL_sound, and then tries to build it. If the build
7971 fails, it parses the error output for known symbol names to fig‐
7972 ure out which libraries are needed.
7973
7974
7975 Responds to the $SDLDIR and $SDLSOUNDDIR environmental variable
7976 that would correspond to the ./configure --prefix=$SDLDIR used
7977 in building SDL.
7978
7979
7980 On OSX, this will prefer the Framework version (if found) over
7981 others. People will have to manually change the cache values of
7982 SDL_LIBRARY to override this selectionor set the CMake environ‐
7983 ment CMAKE_INCLUDE_PATH to modify the search paths.
7984
7985
7986 FindSDL_ttf
7987 Locate SDL_ttf library
7988
7989 This module defines:
7990
7991
7992 SDL_TTF_LIBRARIES, the name of the library to link against
7993 SDL_TTF_INCLUDE_DIRS, where to find the headers
7994 SDL_TTF_FOUND, if false, do not try to link against
7995 SDL_TTF_VERSION_STRING - human-readable string containing the version of SDL_ttf
7996
7997
7998
7999
8000 For backward compatiblity the following variables are also set:
8001
8002
8003 SDLTTF_LIBRARY (same value as SDL_TTF_LIBRARIES)
8004 SDLTTF_INCLUDE_DIR (same value as SDL_TTF_INCLUDE_DIRS)
8005 SDLTTF_FOUND (same value as SDL_TTF_FOUND)
8006
8007
8008
8009
8010 $SDLDIR is an environment variable that would correspond to the
8011 ./configure --prefix=$SDLDIR used in building SDL.
8012
8013
8014 Created by Eric Wing. This was influenced by the FindSDL.cmake
8015 module, but with modifications to recognize OS X frameworks and
8016 additional Unix paths (FreeBSD, etc).
8017
8018
8019 FindSWIG
8020 Find SWIG
8021
8022 This module finds an installed SWIG. It sets the following
8023 variables:
8024
8025
8026 SWIG_FOUND - set to true if SWIG is found
8027 SWIG_DIR - the directory where swig is installed
8028 SWIG_EXECUTABLE - the path to the swig executable
8029 SWIG_VERSION - the version number of the swig executable
8030
8031
8032
8033
8034 The minimum required version of SWIG can be specified using the
8035 standard syntax, e.g. find_package(SWIG 1.1)
8036
8037
8038 All information is collected from the SWIG_EXECUTABLE so the
8039 version to be found can be changed from the command line by
8040 means of setting SWIG_EXECUTABLE
8041
8042
8043
8044 FindSelfPackers
8045 Find upx
8046
8047 This module looks for some executable packers (i.e. software
8048 that compress executables or shared libs into on-the-fly
8049 self-extracting executables or shared libs. Examples:
8050
8051
8052 UPX: http://wildsau.idv.uni-linz.ac.at/mfx/upx.html
8053
8054
8055 FindSquish
8056 -- Typical Use
8057
8058
8059
8060
8061 This module can be used to find Squish. Currently Squish ver‐
8062 sions 3 and 4 are supported.
8063
8064
8065 SQUISH_FOUND If false, don't try to use Squish
8066 SQUISH_VERSION The full version of Squish found
8067 SQUISH_VERSION_MAJOR The major version of Squish found
8068 SQUISH_VERSION_MINOR The minor version of Squish found
8069 SQUISH_VERSION_PATCH The patch version of Squish found
8070
8071
8072
8073
8074 SQUISH_INSTALL_DIR The Squish installation directory (containing bin, lib, etc)
8075 SQUISH_SERVER_EXECUTABLE The squishserver executable
8076 SQUISH_CLIENT_EXECUTABLE The squishrunner executable
8077
8078
8079
8080
8081 SQUISH_INSTALL_DIR_FOUND Was the install directory found?
8082 SQUISH_SERVER_EXECUTABLE_FOUND Was the server executable found?
8083 SQUISH_CLIENT_EXECUTABLE_FOUND Was the client executable found?
8084
8085
8086
8087
8088 It provides the function squish_v4_add_test() for adding a
8089 squish test to cmake using Squish 4.x:
8090
8091
8092 squish_v4_add_test(cmakeTestName AUT targetName SUITE suiteName TEST squishTestName
8093 [SETTINGSGROUP group] [PRE_COMMAND command] [POST_COMMAND command] )
8094
8095
8096
8097
8098 The arguments have the following meaning:
8099
8100
8101 cmakeTestName: this will be used as the first argument for add_test()
8102 AUT targetName: the name of the cmake target which will be used as AUT, i.e. the
8103 executable which will be tested.
8104 SUITE suiteName: this is either the full path to the squish suite, or just the
8105 last directory of the suite, i.e. the suite name. In this case
8106 the CMakeLists.txt which calls squish_add_test() must be located
8107 in the parent directory of the suite directory.
8108 TEST squishTestName: the name of the squish test, i.e. the name of the subdirectory
8109 of the test inside the suite directory.
8110 SETTINGSGROUP group: if specified, the given settings group will be used for executing the test.
8111 If not specified, the groupname will be "CTest_<username>"
8112 PRE_COMMAND command: if specified, the given command will be executed before starting the squish test.
8113 POST_COMMAND command: same as PRE_COMMAND, but after the squish test has been executed.
8114
8115
8116
8117
8118 enable_testing()
8119 find_package(Squish 4.0)
8120 if (SQUISH_FOUND)
8121 squish_v4_add_test(myTestName AUT myApp SUITE ${CMAKE_SOURCE_DIR}/tests/mySuite TEST someSquishTest SETTINGSGROUP myGroup )
8122 endif ()
8123
8124
8125
8126
8127
8128
8129
8130 For users of Squish version 3.x the macro squish_v3_add_test()
8131 is provided:
8132
8133
8134 squish_v3_add_test(testName applicationUnderTest testCase envVars testWrapper)
8135 Use this macro to add a test using Squish 3.x.
8136
8137
8138
8139
8140 enable_testing()
8141 find_package(Squish)
8142 if (SQUISH_FOUND)
8143 squish_v3_add_test(myTestName myApplication testCase envVars testWrapper)
8144 endif ()
8145
8146
8147
8148
8149 macro SQUISH_ADD_TEST(testName applicationUnderTest testCase
8150 envVars testWrapper)
8151
8152
8153 This is deprecated. Use SQUISH_V3_ADD_TEST() if you are using Squish 3.x instead.
8154
8155
8156 FindSubversion
8157 Extract information from a subversion working copy
8158
8159 The module defines the following variables:
8160
8161
8162 Subversion_SVN_EXECUTABLE - path to svn command line client
8163 Subversion_VERSION_SVN - version of svn command line client
8164 Subversion_FOUND - true if the command line client was found
8165 SUBVERSION_FOUND - same as Subversion_FOUND, set for compatiblity reasons
8166
8167
8168
8169
8170 The minimum required version of Subversion can be specified
8171 using the standard syntax, e.g. find_package(Subversion 1.4)
8172
8173
8174 If the command line client executable is found two macros are
8175 defined:
8176
8177
8178 Subversion_WC_INFO(<dir> <var-prefix>)
8179 Subversion_WC_LOG(<dir> <var-prefix>)
8180
8181 Subversion_WC_INFO extracts information of a subversion working
8182 copy at a given location. This macro defines the following vari‐
8183 ables:
8184
8185
8186 <var-prefix>_WC_URL - url of the repository (at <dir>)
8187 <var-prefix>_WC_ROOT - root url of the repository
8188 <var-prefix>_WC_REVISION - current revision
8189 <var-prefix>_WC_LAST_CHANGED_AUTHOR - author of last commit
8190 <var-prefix>_WC_LAST_CHANGED_DATE - date of last commit
8191 <var-prefix>_WC_LAST_CHANGED_REV - revision of last commit
8192 <var-prefix>_WC_INFO - output of command `svn info <dir>'
8193
8194 Subversion_WC_LOG retrieves the log message of the base revision
8195 of a subversion working copy at a given location. This macro
8196 defines the variable:
8197
8198
8199 <var-prefix>_LAST_CHANGED_LOG - last log of base revision
8200
8201 Example usage:
8202
8203
8204 find_package(Subversion)
8205 if(SUBVERSION_FOUND)
8206 Subversion_WC_INFO(${PROJECT_SOURCE_DIR} Project)
8207 message("Current revision is ${Project_WC_REVISION}")
8208 Subversion_WC_LOG(${PROJECT_SOURCE_DIR} Project)
8209 message("Last changed log is ${Project_LAST_CHANGED_LOG}")
8210 endif()
8211
8212
8213 FindTCL
8214 TK_INTERNAL_PATH was removed.
8215
8216 This module finds if Tcl is installed and determines where the
8217 include files and libraries are. It also determines what the
8218 name of the library is. This code sets the following variables:
8219
8220
8221 TCL_FOUND = Tcl was found
8222 TK_FOUND = Tk was found
8223 TCLTK_FOUND = Tcl and Tk were found
8224 TCL_LIBRARY = path to Tcl library (tcl tcl80)
8225 TCL_INCLUDE_PATH = path to where tcl.h can be found
8226 TCL_TCLSH = path to tclsh binary (tcl tcl80)
8227 TK_LIBRARY = path to Tk library (tk tk80 etc)
8228 TK_INCLUDE_PATH = path to where tk.h can be found
8229 TK_WISH = full path to the wish executable
8230
8231
8232
8233
8234 In an effort to remove some clutter and clear up some issues for
8235 people who are not necessarily Tcl/Tk gurus/developpers, some
8236 variables were moved or removed. Changes compared to CMake 2.4
8237 are:
8238
8239
8240 => they were only useful for people writing Tcl/Tk extensions.
8241 => these libs are not packaged by default with Tcl/Tk distributions.
8242 Even when Tcl/Tk is built from source, several flavors of debug libs
8243 are created and there is no real reason to pick a single one
8244 specifically (say, amongst tcl84g, tcl84gs, or tcl84sgx).
8245 Let's leave that choice to the user by allowing him to assign
8246 TCL_LIBRARY to any Tcl library, debug or not.
8247 => this ended up being only a Win32 variable, and there is a lot of
8248 confusion regarding the location of this file in an installed Tcl/Tk
8249 tree anyway (see 8.5 for example). If you need the internal path at
8250 this point it is safer you ask directly where the *source* tree is
8251 and dig from there.
8252
8253
8254 FindTIFF
8255 Find TIFF library
8256
8257 Find the native TIFF includes and library This module defines
8258
8259
8260 TIFF_INCLUDE_DIR, where to find tiff.h, etc.
8261 TIFF_LIBRARIES, libraries to link against to use TIFF.
8262 TIFF_FOUND, If false, do not try to use TIFF.
8263
8264 also defined, but not for general use are
8265
8266
8267 TIFF_LIBRARY, where to find the TIFF library.
8268
8269
8270 FindTclStub
8271 TCL_STUB_LIBRARY_DEBUG and TK_STUB_LIBRARY_DEBUG were removed.
8272
8273 This module finds Tcl stub libraries. It first finds Tcl include
8274 files and libraries by calling FindTCL.cmake. How to Use the Tcl
8275 Stubs Library:
8276
8277
8278 http://tcl.activestate.com/doc/howto/stubs.html
8279
8280 Using Stub Libraries:
8281
8282
8283 http://safari.oreilly.com/0130385603/ch48lev1sec3
8284
8285 This code sets the following variables:
8286
8287
8288 TCL_STUB_LIBRARY = path to Tcl stub library
8289 TK_STUB_LIBRARY = path to Tk stub library
8290 TTK_STUB_LIBRARY = path to ttk stub library
8291
8292
8293
8294
8295 In an effort to remove some clutter and clear up some issues for
8296 people who are not necessarily Tcl/Tk gurus/developpers, some
8297 variables were moved or removed. Changes compared to CMake 2.4
8298 are:
8299
8300
8301 => these libs are not packaged by default with Tcl/Tk distributions.
8302 Even when Tcl/Tk is built from source, several flavors of debug libs
8303 are created and there is no real reason to pick a single one
8304 specifically (say, amongst tclstub84g, tclstub84gs, or tclstub84sgx).
8305 Let's leave that choice to the user by allowing him to assign
8306 TCL_STUB_LIBRARY to any Tcl library, debug or not.
8307
8308
8309 FindTclsh
8310 Find tclsh
8311
8312 This module finds if TCL is installed and determines where the
8313 include files and libraries are. It also determines what the
8314 name of the library is. This code sets the following variables:
8315
8316
8317 TCLSH_FOUND = TRUE if tclsh has been found
8318 TCL_TCLSH = the path to the tclsh executable
8319
8320 In cygwin, look for the cygwin version first. Don't look for it
8321 later to avoid finding the cygwin version on a Win32 build.
8322
8323
8324 FindThreads
8325 This module determines the thread library of the system.
8326
8327 The following variables are set
8328
8329
8330 CMAKE_THREAD_LIBS_INIT - the thread library
8331 CMAKE_USE_SPROC_INIT - are we using sproc?
8332 CMAKE_USE_WIN32_THREADS_INIT - using WIN32 threads?
8333 CMAKE_USE_PTHREADS_INIT - are we using pthreads
8334 CMAKE_HP_PTHREADS_INIT - are we using hp pthreads
8335
8336 For systems with multiple thread libraries, caller can set
8337
8338
8339 CMAKE_THREAD_PREFER_PTHREAD
8340
8341
8342 FindUnixCommands
8343 Find unix commands from cygwin
8344
8345 This module looks for some usual Unix commands.
8346
8347
8348
8349 FindVTK
8350 Find a VTK installation or build tree.
8351
8352 The following variables are set if VTK is found. If VTK is not
8353 found, VTK_FOUND is set to false.
8354
8355
8356 VTK_FOUND - Set to true when VTK is found.
8357 VTK_USE_FILE - CMake file to use VTK.
8358 VTK_MAJOR_VERSION - The VTK major version number.
8359 VTK_MINOR_VERSION - The VTK minor version number
8360 (odd non-release).
8361 VTK_BUILD_VERSION - The VTK patch level
8362 (meaningless for odd minor).
8363 VTK_INCLUDE_DIRS - Include directories for VTK
8364 VTK_LIBRARY_DIRS - Link directories for VTK libraries
8365 VTK_KITS - List of VTK kits, in CAPS
8366 (COMMON,IO,) etc.
8367 VTK_LANGUAGES - List of wrapped languages, in CAPS
8368 (TCL, PYHTON,) etc.
8369
8370 The following cache entries must be set by the user to locate
8371 VTK:
8372
8373
8374 VTK_DIR - The directory containing VTKConfig.cmake.
8375 This is either the root of the build tree,
8376 or the lib/vtk directory. This is the
8377 only cache entry.
8378
8379 The following variables are set for backward compatibility and
8380 should not be used in new code:
8381
8382
8383 USE_VTK_FILE - The full path to the UseVTK.cmake file.
8384 This is provided for backward
8385 compatibility. Use VTK_USE_FILE
8386 instead.
8387
8388
8389
8390
8391
8392 FindWget
8393 Find wget
8394
8395 This module looks for wget. This module defines the following
8396 values:
8397
8398
8399 WGET_EXECUTABLE: the full path to the wget tool.
8400 WGET_FOUND: True if wget has been found.
8401
8402
8403 FindWish
8404 Find wish installation
8405
8406 This module finds if TCL is installed and determines where the
8407 include files and libraries are. It also determines what the
8408 name of the library is. This code sets the following variables:
8409
8410
8411 TK_WISH = the path to the wish executable
8412
8413
8414
8415
8416 if UNIX is defined, then it will look for the cygwin version
8417 first
8418
8419
8420 FindX11
8421 Find X11 installation
8422
8423 Try to find X11 on UNIX systems. The following values are
8424 defined
8425
8426
8427 X11_FOUND - True if X11 is available
8428 X11_INCLUDE_DIR - include directories to use X11
8429 X11_LIBRARIES - link against these to use X11
8430
8431
8432
8433
8434 and also the following more fine grained variables: Include
8435 paths: X11_ICE_INCLUDE_PATH, X11_ICE_LIB,
8436 X11_ICE_FOUND
8437
8438
8439 X11_SM_INCLUDE_PATH, X11_SM_LIB, X11_SM_FOUND
8440 X11_X11_INCLUDE_PATH, X11_X11_LIB
8441 X11_Xaccessrules_INCLUDE_PATH, X11_Xaccess_FOUND
8442 X11_Xaccessstr_INCLUDE_PATH, X11_Xaccess_FOUND
8443 X11_Xau_INCLUDE_PATH, X11_Xau_LIB, X11_Xau_FOUND
8444 X11_Xcomposite_INCLUDE_PATH, X11_Xcomposite_LIB, X11_Xcomposite_FOUND
8445 X11_Xcursor_INCLUDE_PATH, X11_Xcursor_LIB, X11_Xcursor_FOUND
8446 X11_Xdamage_INCLUDE_PATH, X11_Xdamage_LIB, X11_Xdamage_FOUND
8447 X11_Xdmcp_INCLUDE_PATH, X11_Xdmcp_LIB, X11_Xdmcp_FOUND
8448 X11_Xext_LIB, X11_Xext_FOUND
8449 X11_dpms_INCLUDE_PATH, (in X11_Xext_LIB), X11_dpms_FOUND
8450 X11_XShm_INCLUDE_PATH, (in X11_Xext_LIB), X11_XShm_FOUND
8451 X11_Xshape_INCLUDE_PATH, (in X11_Xext_LIB), X11_Xshape_FOUND
8452 X11_xf86misc_INCLUDE_PATH, X11_Xxf86misc_LIB, X11_xf86misc_FOUND
8453 X11_xf86vmode_INCLUDE_PATH, X11_Xxf86vm_LIB X11_xf86vmode_FOUND
8454 X11_Xfixes_INCLUDE_PATH, X11_Xfixes_LIB, X11_Xfixes_FOUND
8455 X11_Xft_INCLUDE_PATH, X11_Xft_LIB, X11_Xft_FOUND
8456 X11_Xi_INCLUDE_PATH, X11_Xi_LIB, X11_Xi_FOUND
8457 X11_Xinerama_INCLUDE_PATH, X11_Xinerama_LIB, X11_Xinerama_FOUND
8458 X11_Xinput_INCLUDE_PATH, X11_Xinput_LIB, X11_Xinput_FOUND
8459 X11_Xkb_INCLUDE_PATH, X11_Xkb_FOUND
8460 X11_Xkblib_INCLUDE_PATH, X11_Xkb_FOUND
8461 X11_Xkbfile_INCLUDE_PATH, X11_Xkbfile_LIB, X11_Xkbfile_FOUND
8462 X11_Xmu_INCLUDE_PATH, X11_Xmu_LIB, X11_Xmu_FOUND
8463 X11_Xpm_INCLUDE_PATH, X11_Xpm_LIB, X11_Xpm_FOUND
8464 X11_XTest_INCLUDE_PATH, X11_XTest_LIB, X11_XTest_FOUND
8465 X11_Xrandr_INCLUDE_PATH, X11_Xrandr_LIB, X11_Xrandr_FOUND
8466 X11_Xrender_INCLUDE_PATH, X11_Xrender_LIB, X11_Xrender_FOUND
8467 X11_Xscreensaver_INCLUDE_PATH, X11_Xscreensaver_LIB, X11_Xscreensaver_FOUND
8468 X11_Xt_INCLUDE_PATH, X11_Xt_LIB, X11_Xt_FOUND
8469 X11_Xutil_INCLUDE_PATH, X11_Xutil_FOUND
8470 X11_Xv_INCLUDE_PATH, X11_Xv_LIB, X11_Xv_FOUND
8471 X11_XSync_INCLUDE_PATH, (in X11_Xext_LIB), X11_XSync_FOUND
8472
8473
8474 FindXMLRPC
8475 Find xmlrpc
8476
8477 Find the native XMLRPC headers and libraries.
8478
8479
8480 XMLRPC_INCLUDE_DIRS - where to find xmlrpc.h, etc.
8481 XMLRPC_LIBRARIES - List of libraries when using xmlrpc.
8482 XMLRPC_FOUND - True if xmlrpc found.
8483
8484 XMLRPC modules may be specified as components for this find mod‐
8485 ule. Modules may be listed by running "xmlrpc-c-config". Mod‐
8486 ules include:
8487
8488
8489 c++ C++ wrapper code
8490 libwww-client libwww-based client
8491 cgi-server CGI-based server
8492 abyss-server ABYSS-based server
8493
8494 Typical usage:
8495
8496
8497 find_package(XMLRPC REQUIRED libwww-client)
8498
8499
8500 FindZLIB
8501 Find zlib
8502
8503 Find the native ZLIB includes and library. Once done this will
8504 define
8505
8506
8507 ZLIB_INCLUDE_DIRS - where to find zlib.h, etc.
8508 ZLIB_LIBRARIES - List of libraries when using zlib.
8509 ZLIB_FOUND - True if zlib found.
8510
8511
8512
8513
8514 ZLIB_VERSION_STRING - The version of zlib found (x.y.z)
8515 ZLIB_VERSION_MAJOR - The major version of zlib
8516 ZLIB_VERSION_MINOR - The minor version of zlib
8517 ZLIB_VERSION_PATCH - The patch version of zlib
8518 ZLIB_VERSION_TWEAK - The tweak version of zlib
8519
8520
8521
8522
8523 The following variable are provided for backward compatibility
8524
8525
8526 ZLIB_MAJOR_VERSION - The major version of zlib
8527 ZLIB_MINOR_VERSION - The minor version of zlib
8528 ZLIB_PATCH_VERSION - The patch version of zlib
8529
8530
8531
8532
8533 An includer may set ZLIB_ROOT to a zlib installation root to
8534 tell this module where to look.
8535
8536
8537 Findosg
8538
8539
8540
8541
8542
8543 NOTE: It is highly recommended that you use the new FindOpen‐
8544 SceneGraph.cmake introduced in CMake 2.6.3 and not use this Find
8545 module directly.
8546
8547
8548 This is part of the Findosg* suite used to find OpenSceneGraph
8549 components. Each component is separate and you must opt in to
8550 each module. You must also opt into OpenGL and OpenThreads (and
8551 Producer if needed) as these modules won't do it for you. This
8552 is to allow you control over your own system piece by piece in
8553 case you need to opt out of certain components or change the
8554 Find behavior for a particular module (perhaps because the
8555 default FindOpenGL.cmake module doesn't work with your system as
8556 an example). If you want to use a more convenient module that
8557 includes everything, use the FindOpenSceneGraph.cmake instead of
8558 the Findosg*.cmake modules.
8559
8560
8561 Locate osg This module defines
8562
8563
8564 OSG_FOUND - Was the Osg found? OSG_INCLUDE_DIR - Where to find
8565 the headers OSG_LIBRARIES - The libraries to link against for
8566 the OSG (use this)
8567
8568
8569 OSG_LIBRARY - The OSG library OSG_LIBRARY_DEBUG - The OSG debug
8570 library
8571
8572
8573 $OSGDIR is an environment variable that would correspond to the
8574 ./configure --prefix=$OSGDIR used in building osg.
8575
8576
8577 Created by Eric Wing.
8578
8579
8580 FindosgAnimation
8581
8582
8583 This is part of the Findosg* suite used to find OpenSceneGraph
8584 components. Each component is separate and you must opt in to
8585 each module. You must also opt into OpenGL and OpenThreads (and
8586 Producer if needed) as these modules won't do it for you. This
8587 is to allow you control over your own system piece by piece in
8588 case you need to opt out of certain components or change the
8589 Find behavior for a particular module (perhaps because the
8590 default FindOpenGL.cmake module doesn't work with your system as
8591 an example). If you want to use a more convenient module that
8592 includes everything, use the FindOpenSceneGraph.cmake instead of
8593 the Findosg*.cmake modules.
8594
8595
8596 Locate osgAnimation This module defines
8597
8598
8599 OSGANIMATION_FOUND - Was osgAnimation found? OSGANIMA‐
8600 TION_INCLUDE_DIR - Where to find the headers OSGANIMA‐
8601 TION_LIBRARIES - The libraries to link against for the OSG (use
8602 this)
8603
8604
8605 OSGANIMATION_LIBRARY - The OSG library OSGANIMA‐
8606 TION_LIBRARY_DEBUG - The OSG debug library
8607
8608
8609 $OSGDIR is an environment variable that would correspond to the
8610 ./configure --prefix=$OSGDIR used in building osg.
8611
8612
8613 Created by Eric Wing.
8614
8615
8616 FindosgDB
8617
8618
8619 This is part of the Findosg* suite used to find OpenSceneGraph
8620 components. Each component is separate and you must opt in to
8621 each module. You must also opt into OpenGL and OpenThreads (and
8622 Producer if needed) as these modules won't do it for you. This
8623 is to allow you control over your own system piece by piece in
8624 case you need to opt out of certain components or change the
8625 Find behavior for a particular module (perhaps because the
8626 default FindOpenGL.cmake module doesn't work with your system as
8627 an example). If you want to use a more convenient module that
8628 includes everything, use the FindOpenSceneGraph.cmake instead of
8629 the Findosg*.cmake modules.
8630
8631
8632 Locate osgDB This module defines
8633
8634
8635 OSGDB_FOUND - Was osgDB found? OSGDB_INCLUDE_DIR - Where to find
8636 the headers OSGDB_LIBRARIES - The libraries to link against for
8637 the osgDB (use this)
8638
8639
8640 OSGDB_LIBRARY - The osgDB library OSGDB_LIBRARY_DEBUG - The
8641 osgDB debug library
8642
8643
8644 $OSGDIR is an environment variable that would correspond to the
8645 ./configure --prefix=$OSGDIR used in building osg.
8646
8647
8648 Created by Eric Wing.
8649
8650
8651 FindosgFX
8652
8653
8654 This is part of the Findosg* suite used to find OpenSceneGraph
8655 components. Each component is separate and you must opt in to
8656 each module. You must also opt into OpenGL and OpenThreads (and
8657 Producer if needed) as these modules won't do it for you. This
8658 is to allow you control over your own system piece by piece in
8659 case you need to opt out of certain components or change the
8660 Find behavior for a particular module (perhaps because the
8661 default FindOpenGL.cmake module doesn't work with your system as
8662 an example). If you want to use a more convenient module that
8663 includes everything, use the FindOpenSceneGraph.cmake instead of
8664 the Findosg*.cmake modules.
8665
8666
8667 Locate osgFX This module defines
8668
8669
8670 OSGFX_FOUND - Was osgFX found? OSGFX_INCLUDE_DIR - Where to find
8671 the headers OSGFX_LIBRARIES - The libraries to link against for
8672 the osgFX (use this)
8673
8674
8675 OSGFX_LIBRARY - The osgFX library OSGFX_LIBRARY_DEBUG - The
8676 osgFX debug library
8677
8678
8679 $OSGDIR is an environment variable that would correspond to the
8680 ./configure --prefix=$OSGDIR used in building osg.
8681
8682
8683 Created by Eric Wing.
8684
8685
8686 FindosgGA
8687
8688
8689 This is part of the Findosg* suite used to find OpenSceneGraph
8690 components. Each component is separate and you must opt in to
8691 each module. You must also opt into OpenGL and OpenThreads (and
8692 Producer if needed) as these modules won't do it for you. This
8693 is to allow you control over your own system piece by piece in
8694 case you need to opt out of certain components or change the
8695 Find behavior for a particular module (perhaps because the
8696 default FindOpenGL.cmake module doesn't work with your system as
8697 an example). If you want to use a more convenient module that
8698 includes everything, use the FindOpenSceneGraph.cmake instead of
8699 the Findosg*.cmake modules.
8700
8701
8702 Locate osgGA This module defines
8703
8704
8705 OSGGA_FOUND - Was osgGA found? OSGGA_INCLUDE_DIR - Where to find
8706 the headers OSGGA_LIBRARIES - The libraries to link against for
8707 the osgGA (use this)
8708
8709
8710 OSGGA_LIBRARY - The osgGA library OSGGA_LIBRARY_DEBUG - The
8711 osgGA debug library
8712
8713
8714 $OSGDIR is an environment variable that would correspond to the
8715 ./configure --prefix=$OSGDIR used in building osg.
8716
8717
8718 Created by Eric Wing.
8719
8720
8721 FindosgIntrospection
8722
8723
8724 This is part of the Findosg* suite used to find OpenSceneGraph
8725 components. Each component is separate and you must opt in to
8726 each module. You must also opt into OpenGL and OpenThreads (and
8727 Producer if needed) as these modules won't do it for you. This
8728 is to allow you control over your own system piece by piece in
8729 case you need to opt out of certain components or change the
8730 Find behavior for a particular module (perhaps because the
8731 default FindOpenGL.cmake module doesn't work with your system as
8732 an example). If you want to use a more convenient module that
8733 includes everything, use the FindOpenSceneGraph.cmake instead of
8734 the Findosg*.cmake modules.
8735
8736
8737 Locate osgINTROSPECTION This module defines
8738
8739
8740 OSGINTROSPECTION_FOUND - Was osgIntrospection found? OSGINTRO‐
8741 SPECTION_INCLUDE_DIR - Where to find the headers OSGINTROSPEC‐
8742 TION_LIBRARIES - The libraries to link for osgIntrospection (use
8743 this)
8744
8745
8746 OSGINTROSPECTION_LIBRARY - The osgIntrospection library OSGIN‐
8747 TROSPECTION_LIBRARY_DEBUG - The osgIntrospection debug library
8748
8749
8750 $OSGDIR is an environment variable that would correspond to the
8751 ./configure --prefix=$OSGDIR used in building osg.
8752
8753
8754 Created by Eric Wing.
8755
8756
8757 FindosgManipulator
8758
8759
8760 This is part of the Findosg* suite used to find OpenSceneGraph
8761 components. Each component is separate and you must opt in to
8762 each module. You must also opt into OpenGL and OpenThreads (and
8763 Producer if needed) as these modules won't do it for you. This
8764 is to allow you control over your own system piece by piece in
8765 case you need to opt out of certain components or change the
8766 Find behavior for a particular module (perhaps because the
8767 default FindOpenGL.cmake module doesn't work with your system as
8768 an example). If you want to use a more convenient module that
8769 includes everything, use the FindOpenSceneGraph.cmake instead of
8770 the Findosg*.cmake modules.
8771
8772
8773 Locate osgManipulator This module defines
8774
8775
8776 OSGMANIPULATOR_FOUND - Was osgManipulator found? OSGMANIPULA‐
8777 TOR_INCLUDE_DIR - Where to find the headers OSGMANIPULA‐
8778 TOR_LIBRARIES - The libraries to link for osgManipulator (use
8779 this)
8780
8781
8782 OSGMANIPULATOR_LIBRARY - The osgManipulator library OSGMANIPULA‐
8783 TOR_LIBRARY_DEBUG - The osgManipulator debug library
8784
8785
8786 $OSGDIR is an environment variable that would correspond to the
8787 ./configure --prefix=$OSGDIR used in building osg.
8788
8789
8790 Created by Eric Wing.
8791
8792
8793 FindosgParticle
8794
8795
8796 This is part of the Findosg* suite used to find OpenSceneGraph
8797 components. Each component is separate and you must opt in to
8798 each module. You must also opt into OpenGL and OpenThreads (and
8799 Producer if needed) as these modules won't do it for you. This
8800 is to allow you control over your own system piece by piece in
8801 case you need to opt out of certain components or change the
8802 Find behavior for a particular module (perhaps because the
8803 default FindOpenGL.cmake module doesn't work with your system as
8804 an example). If you want to use a more convenient module that
8805 includes everything, use the FindOpenSceneGraph.cmake instead of
8806 the Findosg*.cmake modules.
8807
8808
8809 Locate osgParticle This module defines
8810
8811
8812 OSGPARTICLE_FOUND - Was osgParticle found? OSGPARTI‐
8813 CLE_INCLUDE_DIR - Where to find the headers OSGPARTI‐
8814 CLE_LIBRARIES - The libraries to link for osgParticle (use this)
8815
8816
8817 OSGPARTICLE_LIBRARY - The osgParticle library OSGPARTI‐
8818 CLE_LIBRARY_DEBUG - The osgParticle debug library
8819
8820
8821 $OSGDIR is an environment variable that would correspond to the
8822 ./configure --prefix=$OSGDIR used in building osg.
8823
8824
8825 Created by Eric Wing.
8826
8827
8828 FindosgPresentation
8829
8830
8831 This is part of the Findosg* suite used to find OpenSceneGraph
8832 components. Each component is separate and you must opt in to
8833 each module. You must also opt into OpenGL and OpenThreads (and
8834 Producer if needed) as these modules won't do it for you. This
8835 is to allow you control over your own system piece by piece in
8836 case you need to opt out of certain components or change the
8837 Find behavior for a particular module (perhaps because the
8838 default FindOpenGL.cmake module doesn't work with your system as
8839 an example). If you want to use a more convenient module that
8840 includes everything, use the FindOpenSceneGraph.cmake instead of
8841 the Findosg*.cmake modules.
8842
8843
8844 Locate osgPresentation This module defines
8845
8846
8847 OSGPRESENTATION_FOUND - Was osgPresentation found? OSGPRESENTA‐
8848 TION_INCLUDE_DIR - Where to find the headers OSGPRESENTA‐
8849 TION_LIBRARIES - The libraries to link for osgPresentation (use
8850 this)
8851
8852
8853 OSGPRESENTATION_LIBRARY - The osgPresentation library OSGPRESEN‐
8854 TATION_LIBRARY_DEBUG - The osgPresentation debug library
8855
8856
8857 $OSGDIR is an environment variable that would correspond to the
8858 ./configure --prefix=$OSGDIR used in building osg.
8859
8860
8861 Created by Eric Wing. Modified to work with osgPresentation by
8862 Robert Osfield, January 2012.
8863
8864
8865 FindosgProducer
8866
8867
8868 This is part of the Findosg* suite used to find OpenSceneGraph
8869 components. Each component is separate and you must opt in to
8870 each module. You must also opt into OpenGL and OpenThreads (and
8871 Producer if needed) as these modules won't do it for you. This
8872 is to allow you control over your own system piece by piece in
8873 case you need to opt out of certain components or change the
8874 Find behavior for a particular module (perhaps because the
8875 default FindOpenGL.cmake module doesn't work with your system as
8876 an example). If you want to use a more convenient module that
8877 includes everything, use the FindOpenSceneGraph.cmake instead of
8878 the Findosg*.cmake modules.
8879
8880
8881 Locate osgProducer This module defines
8882
8883
8884 OSGPRODUCER_FOUND - Was osgProducer found? OSGPRO‐
8885 DUCER_INCLUDE_DIR - Where to find the headers OSGPRO‐
8886 DUCER_LIBRARIES - The libraries to link for osgProducer (use
8887 this)
8888
8889
8890 OSGPRODUCER_LIBRARY - The osgProducer library OSGPRO‐
8891 DUCER_LIBRARY_DEBUG - The osgProducer debug library
8892
8893
8894 $OSGDIR is an environment variable that would correspond to the
8895 ./configure --prefix=$OSGDIR used in building osg.
8896
8897
8898 Created by Eric Wing.
8899
8900
8901 FindosgQt
8902
8903
8904 This is part of the Findosg* suite used to find OpenSceneGraph
8905 components. Each component is separate and you must opt in to
8906 each module. You must also opt into OpenGL and OpenThreads (and
8907 Producer if needed) as these modules won't do it for you. This
8908 is to allow you control over your own system piece by piece in
8909 case you need to opt out of certain components or change the
8910 Find behavior for a particular module (perhaps because the
8911 default FindOpenGL.cmake module doesn't work with your system as
8912 an example). If you want to use a more convenient module that
8913 includes everything, use the FindOpenSceneGraph.cmake instead of
8914 the Findosg*.cmake modules.
8915
8916
8917 Locate osgQt This module defines
8918
8919
8920 OSGQT_FOUND - Was osgQt found? OSGQT_INCLUDE_DIR - Where to find
8921 the headers OSGQT_LIBRARIES - The libraries to link for osgQt
8922 (use this)
8923
8924
8925 OSGQT_LIBRARY - The osgQt library OSGQT_LIBRARY_DEBUG - The
8926 osgQt debug library
8927
8928
8929 $OSGDIR is an environment variable that would correspond to the
8930 ./configure --prefix=$OSGDIR used in building osg.
8931
8932
8933 Created by Eric Wing. Modified to work with osgQt by Robert
8934 Osfield, January 2012.
8935
8936
8937 FindosgShadow
8938
8939
8940 This is part of the Findosg* suite used to find OpenSceneGraph
8941 components. Each component is separate and you must opt in to
8942 each module. You must also opt into OpenGL and OpenThreads (and
8943 Producer if needed) as these modules won't do it for you. This
8944 is to allow you control over your own system piece by piece in
8945 case you need to opt out of certain components or change the
8946 Find behavior for a particular module (perhaps because the
8947 default FindOpenGL.cmake module doesn't work with your system as
8948 an example). If you want to use a more convenient module that
8949 includes everything, use the FindOpenSceneGraph.cmake instead of
8950 the Findosg*.cmake modules.
8951
8952
8953 Locate osgShadow This module defines
8954
8955
8956 OSGSHADOW_FOUND - Was osgShadow found? OSGSHADOW_INCLUDE_DIR -
8957 Where to find the headers OSGSHADOW_LIBRARIES - The libraries to
8958 link for osgShadow (use this)
8959
8960
8961 OSGSHADOW_LIBRARY - The osgShadow library
8962 OSGSHADOW_LIBRARY_DEBUG - The osgShadow debug library
8963
8964
8965 $OSGDIR is an environment variable that would correspond to the
8966 ./configure --prefix=$OSGDIR used in building osg.
8967
8968
8969 Created by Eric Wing.
8970
8971
8972 FindosgSim
8973
8974
8975 This is part of the Findosg* suite used to find OpenSceneGraph
8976 components. Each component is separate and you must opt in to
8977 each module. You must also opt into OpenGL and OpenThreads (and
8978 Producer if needed) as these modules won't do it for you. This
8979 is to allow you control over your own system piece by piece in
8980 case you need to opt out of certain components or change the
8981 Find behavior for a particular module (perhaps because the
8982 default FindOpenGL.cmake module doesn't work with your system as
8983 an example). If you want to use a more convenient module that
8984 includes everything, use the FindOpenSceneGraph.cmake instead of
8985 the Findosg*.cmake modules.
8986
8987
8988 Locate osgSim This module defines
8989
8990
8991 OSGSIM_FOUND - Was osgSim found? OSGSIM_INCLUDE_DIR - Where to
8992 find the headers OSGSIM_LIBRARIES - The libraries to link for
8993 osgSim (use this)
8994
8995
8996 OSGSIM_LIBRARY - The osgSim library OSGSIM_LIBRARY_DEBUG - The
8997 osgSim debug library
8998
8999
9000 $OSGDIR is an environment variable that would correspond to the
9001 ./configure --prefix=$OSGDIR used in building osg.
9002
9003
9004 Created by Eric Wing.
9005
9006
9007 FindosgTerrain
9008
9009
9010 This is part of the Findosg* suite used to find OpenSceneGraph
9011 components. Each component is separate and you must opt in to
9012 each module. You must also opt into OpenGL and OpenThreads (and
9013 Producer if needed) as these modules won't do it for you. This
9014 is to allow you control over your own system piece by piece in
9015 case you need to opt out of certain components or change the
9016 Find behavior for a particular module (perhaps because the
9017 default FindOpenGL.cmake module doesn't work with your system as
9018 an example). If you want to use a more convenient module that
9019 includes everything, use the FindOpenSceneGraph.cmake instead of
9020 the Findosg*.cmake modules.
9021
9022
9023 Locate osgTerrain This module defines
9024
9025
9026 OSGTERRAIN_FOUND - Was osgTerrain found? OSGTERRAIN_INCLUDE_DIR
9027 - Where to find the headers OSGTERRAIN_LIBRARIES - The libraries
9028 to link for osgTerrain (use this)
9029
9030
9031 OSGTERRAIN_LIBRARY - The osgTerrain library OSGTER‐
9032 RAIN_LIBRARY_DEBUG - The osgTerrain debug library
9033
9034
9035 $OSGDIR is an environment variable that would correspond to the
9036 ./configure --prefix=$OSGDIR used in building osg.
9037
9038
9039 Created by Eric Wing.
9040
9041
9042 FindosgText
9043
9044
9045 This is part of the Findosg* suite used to find OpenSceneGraph
9046 components. Each component is separate and you must opt in to
9047 each module. You must also opt into OpenGL and OpenThreads (and
9048 Producer if needed) as these modules won't do it for you. This
9049 is to allow you control over your own system piece by piece in
9050 case you need to opt out of certain components or change the
9051 Find behavior for a particular module (perhaps because the
9052 default FindOpenGL.cmake module doesn't work with your system as
9053 an example). If you want to use a more convenient module that
9054 includes everything, use the FindOpenSceneGraph.cmake instead of
9055 the Findosg*.cmake modules.
9056
9057
9058 Locate osgText This module defines
9059
9060
9061 OSGTEXT_FOUND - Was osgText found? OSGTEXT_INCLUDE_DIR - Where
9062 to find the headers OSGTEXT_LIBRARIES - The libraries to link
9063 for osgText (use this)
9064
9065
9066 OSGTEXT_LIBRARY - The osgText library OSGTEXT_LIBRARY_DEBUG -
9067 The osgText debug library
9068
9069
9070 $OSGDIR is an environment variable that would correspond to the
9071 ./configure --prefix=$OSGDIR used in building osg.
9072
9073
9074 Created by Eric Wing.
9075
9076
9077 FindosgUtil
9078
9079
9080 This is part of the Findosg* suite used to find OpenSceneGraph
9081 components. Each component is separate and you must opt in to
9082 each module. You must also opt into OpenGL and OpenThreads (and
9083 Producer if needed) as these modules won't do it for you. This
9084 is to allow you control over your own system piece by piece in
9085 case you need to opt out of certain components or change the
9086 Find behavior for a particular module (perhaps because the
9087 default FindOpenGL.cmake module doesn't work with your system as
9088 an example). If you want to use a more convenient module that
9089 includes everything, use the FindOpenSceneGraph.cmake instead of
9090 the Findosg*.cmake modules.
9091
9092
9093 Locate osgUtil This module defines
9094
9095
9096 OSGUTIL_FOUND - Was osgUtil found? OSGUTIL_INCLUDE_DIR - Where
9097 to find the headers OSGUTIL_LIBRARIES - The libraries to link
9098 for osgUtil (use this)
9099
9100
9101 OSGUTIL_LIBRARY - The osgUtil library OSGUTIL_LIBRARY_DEBUG -
9102 The osgUtil debug library
9103
9104
9105 $OSGDIR is an environment variable that would correspond to the
9106 ./configure --prefix=$OSGDIR used in building osg.
9107
9108
9109 Created by Eric Wing.
9110
9111
9112 FindosgViewer
9113
9114
9115 This is part of the Findosg* suite used to find OpenSceneGraph
9116 components. Each component is separate and you must opt in to
9117 each module. You must also opt into OpenGL and OpenThreads (and
9118 Producer if needed) as these modules won't do it for you. This
9119 is to allow you control over your own system piece by piece in
9120 case you need to opt out of certain components or change the
9121 Find behavior for a particular module (perhaps because the
9122 default FindOpenGL.cmake module doesn't work with your system as
9123 an example). If you want to use a more convenient module that
9124 includes everything, use the FindOpenSceneGraph.cmake instead of
9125 the Findosg*.cmake modules.
9126
9127
9128 Locate osgViewer This module defines
9129
9130
9131 OSGVIEWER_FOUND - Was osgViewer found? OSGVIEWER_INCLUDE_DIR -
9132 Where to find the headers OSGVIEWER_LIBRARIES - The libraries to
9133 link for osgViewer (use this)
9134
9135
9136 OSGVIEWER_LIBRARY - The osgViewer library
9137 OSGVIEWER_LIBRARY_DEBUG - The osgViewer debug library
9138
9139
9140 $OSGDIR is an environment variable that would correspond to the
9141 ./configure --prefix=$OSGDIR used in building osg.
9142
9143
9144 Created by Eric Wing.
9145
9146
9147 FindosgVolume
9148
9149
9150 This is part of the Findosg* suite used to find OpenSceneGraph
9151 components. Each component is separate and you must opt in to
9152 each module. You must also opt into OpenGL and OpenThreads (and
9153 Producer if needed) as these modules won't do it for you. This
9154 is to allow you control over your own system piece by piece in
9155 case you need to opt out of certain components or change the
9156 Find behavior for a particular module (perhaps because the
9157 default FindOpenGL.cmake module doesn't work with your system as
9158 an example). If you want to use a more convenient module that
9159 includes everything, use the FindOpenSceneGraph.cmake instead of
9160 the Findosg*.cmake modules.
9161
9162
9163 Locate osgVolume This module defines
9164
9165
9166 OSGVOLUME_FOUND - Was osgVolume found? OSGVOLUME_INCLUDE_DIR -
9167 Where to find the headers OSGVOLUME_LIBRARIES - The libraries to
9168 link for osgVolume (use this)
9169
9170
9171 OSGVOLUME_LIBRARY - The osgVolume library OSGVOL‐
9172 UME_LIBRARY_DEBUG - The osgVolume debug library
9173
9174
9175 $OSGDIR is an environment variable that would correspond to the
9176 ./configure --prefix=$OSGDIR used in building osg.
9177
9178
9179 Created by Eric Wing.
9180
9181
9182 FindosgWidget
9183
9184
9185 This is part of the Findosg* suite used to find OpenSceneGraph
9186 components. Each component is separate and you must opt in to
9187 each module. You must also opt into OpenGL and OpenThreads (and
9188 Producer if needed) as these modules won't do it for you. This
9189 is to allow you control over your own system piece by piece in
9190 case you need to opt out of certain components or change the
9191 Find behavior for a particular module (perhaps because the
9192 default FindOpenGL.cmake module doesn't work with your system as
9193 an example). If you want to use a more convenient module that
9194 includes everything, use the FindOpenSceneGraph.cmake instead of
9195 the Findosg*.cmake modules.
9196
9197
9198 Locate osgWidget This module defines
9199
9200
9201 OSGWIDGET_FOUND - Was osgWidget found? OSGWIDGET_INCLUDE_DIR -
9202 Where to find the headers OSGWIDGET_LIBRARIES - The libraries to
9203 link for osgWidget (use this)
9204
9205
9206 OSGWIDGET_LIBRARY - The osgWidget library OSGWID‐
9207 GET_LIBRARY_DEBUG - The osgWidget debug library
9208
9209
9210 $OSGDIR is an environment variable that would correspond to the
9211 ./configure --prefix=$OSGDIR used in building osg.
9212
9213
9214 FindosgWidget.cmake tweaked from Findosg* suite as created by
9215 Eric Wing.
9216
9217
9218 Findosg_functions
9219
9220
9221
9222
9223
9224 This CMake file contains two macros to assist with searching for
9225 OSG libraries and nodekits. Please see FindOpenSceneGraph.cmake
9226 for full documentation.
9227
9228
9229
9230 FindwxWidgets
9231 Find a wxWidgets (a.k.a., wxWindows) installation.
9232
9233 This module finds if wxWidgets is installed and selects a
9234 default configuration to use. wxWidgets is a modular library. To
9235 specify the modules that you will use, you need to name them as
9236 components to the package:
9237
9238
9239 find_package(wxWidgets COMPONENTS core base ...)
9240
9241
9242 There are two search branches: a windows style and a unix style.
9243 For windows, the following variables are searched for and set to
9244 defaults in case of multiple choices. Change them if the
9245 defaults are not desired (i.e., these are the only variables you
9246 should change to select a configuration):
9247
9248
9249 wxWidgets_ROOT_DIR - Base wxWidgets directory
9250 (e.g., C:/wxWidgets-2.6.3).
9251 wxWidgets_LIB_DIR - Path to wxWidgets libraries
9252 (e.g., C:/wxWidgets-2.6.3/lib/vc_lib).
9253 wxWidgets_CONFIGURATION - Configuration to use
9254 (e.g., msw, mswd, mswu, mswunivud, etc.)
9255 wxWidgets_EXCLUDE_COMMON_LIBRARIES
9256 - Set to TRUE to exclude linking of
9257 commonly required libs (e.g., png tiff
9258 jpeg zlib regex expat).
9259
9260
9261
9262
9263 For unix style it uses the wx-config utility. You can select
9264 between debug/release, unicode/ansi, universal/non-universal,
9265 and static/shared in the QtDialog or ccmake interfaces by turn‐
9266 ing ON/OFF the following variables:
9267
9268
9269 wxWidgets_USE_DEBUG
9270 wxWidgets_USE_UNICODE
9271 wxWidgets_USE_UNIVERSAL
9272 wxWidgets_USE_STATIC
9273
9274
9275
9276
9277 There is also a wxWidgets_CONFIG_OPTIONS variable for all other
9278 options that need to be passed to the wx-config utility. For
9279 example, to use the base toolkit found in the /usr/local path,
9280 set the variable (before calling the FIND_PACKAGE command) as
9281 such:
9282
9283
9284 set(wxWidgets_CONFIG_OPTIONS --toolkit=base --prefix=/usr)
9285
9286
9287
9288
9289 The following are set after the configuration is done for both
9290 windows and unix style:
9291
9292
9293 wxWidgets_FOUND - Set to TRUE if wxWidgets was found.
9294 wxWidgets_INCLUDE_DIRS - Include directories for WIN32
9295 i.e., where to find "wx/wx.h" and
9296 "wx/setup.h"; possibly empty for unices.
9297 wxWidgets_LIBRARIES - Path to the wxWidgets libraries.
9298 wxWidgets_LIBRARY_DIRS - compile time link dirs, useful for
9299 rpath on UNIX. Typically an empty string
9300 in WIN32 environment.
9301 wxWidgets_DEFINITIONS - Contains defines required to compile/link
9302 against WX, e.g. WXUSINGDLL
9303 wxWidgets_DEFINITIONS_DEBUG- Contains defines required to compile/link
9304 against WX debug builds, e.g. __WXDEBUG__
9305 wxWidgets_CXX_FLAGS - Include dirs and compiler flags for
9306 unices, empty on WIN32. Essentially
9307 "`wx-config --cxxflags`".
9308 wxWidgets_USE_FILE - Convenience include file.
9309
9310
9311
9312
9313 Sample usage:
9314
9315
9316 # Note that for MinGW users the order of libs is important!
9317 find_package(wxWidgets COMPONENTS net gl core base)
9318 if(wxWidgets_FOUND)
9319 include(${wxWidgets_USE_FILE})
9320 # and for each of your dependent executable/library targets:
9321 target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES})
9322 endif()
9323
9324
9325
9326
9327 If wxWidgets is required (i.e., not an optional part):
9328
9329
9330 find_package(wxWidgets REQUIRED net gl core base)
9331 include(${wxWidgets_USE_FILE})
9332 # and for each of your dependent executable/library targets:
9333 target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES})
9334
9335
9336 FindwxWindows
9337 Find wxWindows (wxWidgets) installation
9338
9339 This module finds if wxWindows/wxWidgets is installed and deter‐
9340 mines where the include files and libraries are. It also deter‐
9341 mines what the name of the library is. Please note this file is
9342 DEPRECATED and replaced by FindwxWidgets.cmake. This code sets
9343 the following variables:
9344
9345
9346 WXWINDOWS_FOUND = system has WxWindows
9347 WXWINDOWS_LIBRARIES = path to the wxWindows libraries
9348 on Unix/Linux with additional
9349 linker flags from
9350 "wx-config --libs"
9351 CMAKE_WXWINDOWS_CXX_FLAGS = Compiler flags for wxWindows,
9352 essentially "`wx-config --cxxflags`"
9353 on Linux
9354 WXWINDOWS_INCLUDE_DIR = where to find "wx/wx.h" and "wx/setup.h"
9355 WXWINDOWS_LINK_DIRECTORIES = link directories, useful for rpath on
9356 Unix
9357 WXWINDOWS_DEFINITIONS = extra defines
9358
9359
9360
9361
9362 OPTIONS If you need OpenGL support please
9363
9364
9365 set(WXWINDOWS_USE_GL 1)
9366
9367 in your CMakeLists.txt *before* you include this file.
9368
9369
9370 HAVE_ISYSTEM - true required to replace -I by -isystem on g++
9371
9372
9373
9374
9375 For convenience include Use_wxWindows.cmake in your project's
9376 CMakeLists.txt using include(${CMAKE_CUR‐
9377 RENT_LIST_DIR}/Use_wxWindows.cmake).
9378
9379
9380 USAGE
9381
9382
9383 set(WXWINDOWS_USE_GL 1)
9384 find_package(wxWindows)
9385
9386
9387
9388
9389 NOTES wxWidgets 2.6.x is supported for monolithic builds e.g.
9390 compiled in wx/build/msw dir as:
9391
9392
9393 nmake -f makefile.vc BUILD=debug SHARED=0 USE_OPENGL=1 MONOLITHIC=1
9394
9395
9396
9397
9398 DEPRECATED
9399
9400
9401 CMAKE_WX_CAN_COMPILE
9402 WXWINDOWS_LIBRARY
9403 CMAKE_WX_CXX_FLAGS
9404 WXWINDOWS_INCLUDE_PATH
9405
9406
9407
9408
9409 AUTHOR Jan Woetzel <http://www.mip.informatik.uni-kiel.de/~jw>
9410 (07/2003-01/2006)
9411
9412
9413 FortranCInterface
9414 Fortran/C Interface Detection
9415
9416 This module automatically detects the API by which C and Fortran
9417 languages interact. Variables indicate if the mangling is
9418 found:
9419
9420
9421 FortranCInterface_GLOBAL_FOUND = Global subroutines and functions
9422 FortranCInterface_MODULE_FOUND = Module subroutines and functions
9423 (declared by "MODULE PROCEDURE")
9424
9425 A function is provided to generate a C header file containing
9426 macros to mangle symbol names:
9427
9428
9429 FortranCInterface_HEADER(<file>
9430 [MACRO_NAMESPACE <macro-ns>]
9431 [SYMBOL_NAMESPACE <ns>]
9432 [SYMBOLS [<module>:]<function> ...])
9433
9434 It generates in <file> definitions of the following macros:
9435
9436
9437 #define FortranCInterface_GLOBAL (name,NAME) ...
9438 #define FortranCInterface_GLOBAL_(name,NAME) ...
9439 #define FortranCInterface_MODULE (mod,name, MOD,NAME) ...
9440 #define FortranCInterface_MODULE_(mod,name, MOD,NAME) ...
9441
9442 These macros mangle four categories of Fortran symbols, respec‐
9443 tively:
9444
9445
9446 - Global symbols without '_': call mysub()
9447 - Global symbols with '_' : call my_sub()
9448 - Module symbols without '_': use mymod; call mysub()
9449 - Module symbols with '_' : use mymod; call my_sub()
9450
9451 If mangling for a category is not known, its macro is left unde‐
9452 fined. All macros require raw names in both lower case and upper
9453 case. The MACRO_NAMESPACE option replaces the default "FortranC‐
9454 Interface_" prefix with a given namespace "<macro-ns>".
9455
9456
9457 The SYMBOLS option lists symbols to mangle automatically with C
9458 preprocessor definitions:
9459
9460
9461 <function> ==> #define <ns><function> ...
9462 <module>:<function> ==> #define <ns><module>_<function> ...
9463
9464 If the mangling for some symbol is not known then no preproces‐
9465 sor definition is created, and a warning is displayed. The SYM‐
9466 BOL_NAMESPACE option prefixes all preprocessor definitions gen‐
9467 erated by the SYMBOLS option with a given namespace "<ns>".
9468
9469
9470 Example usage:
9471
9472
9473 include(FortranCInterface)
9474 FortranCInterface_HEADER(FC.h MACRO_NAMESPACE "FC_")
9475
9476 This creates a "FC.h" header that defines mangling macros
9477 FC_GLOBAL(), FC_GLOBAL_(), FC_MODULE(), and FC_MODULE_().
9478
9479
9480 Example usage:
9481
9482
9483 include(FortranCInterface)
9484 FortranCInterface_HEADER(FCMangle.h
9485 MACRO_NAMESPACE "FC_"
9486 SYMBOL_NAMESPACE "FC_"
9487 SYMBOLS mysub mymod:my_sub)
9488
9489 This creates a "FCMangle.h" header that defines the same FC_*()
9490 mangling macros as the previous example plus preprocessor sym‐
9491 bols FC_mysub and FC_mymod_my_sub.
9492
9493
9494 Another function is provided to verify that the Fortran and
9495 C/C++ compilers work together:
9496
9497
9498 FortranCInterface_VERIFY([CXX] [QUIET])
9499
9500 It tests whether a simple test executable using Fortran and C
9501 (and C++ when the CXX option is given) compiles and links suc‐
9502 cessfully. The result is stored in the cache entry FortranCIn‐
9503 terface_VERIFIED_C (or FortranCInterface_VERIFIED_CXX if CXX is
9504 given) as a boolean. If the check fails and QUIET is not given
9505 the function terminates with a FATAL_ERROR message describing
9506 the problem. The purpose of this check is to stop a build early
9507 for incompatible compiler combinations. The test is built in
9508 the Release configuration.
9509
9510
9511 FortranCInterface is aware of possible GLOBAL and MODULE man‐
9512 glings for many Fortran compilers, but it also provides an
9513 interface to specify new possible manglings. Set the variables
9514
9515
9516 FortranCInterface_GLOBAL_SYMBOLS
9517 FortranCInterface_MODULE_SYMBOLS
9518
9519 before including FortranCInterface to specify manglings of the
9520 symbols "MySub", "My_Sub", "MyModule:MySub", and "My_Mod‐
9521 ule:My_Sub". For example, the code:
9522
9523
9524 set(FortranCInterface_GLOBAL_SYMBOLS mysub_ my_sub__ MYSUB_)
9525 # ^^^^^ ^^^^^^ ^^^^^
9526 set(FortranCInterface_MODULE_SYMBOLS
9527 __mymodule_MOD_mysub __my_module_MOD_my_sub)
9528 # ^^^^^^^^ ^^^^^ ^^^^^^^^^ ^^^^^^
9529 include(FortranCInterface)
9530
9531 tells FortranCInterface to try given GLOBAL and MODULE man‐
9532 glings. (The carets point at raw symbol names for clarity in
9533 this example but are not needed.)
9534
9535
9536 GNUInstallDirs
9537 Define GNU standard installation directories
9538
9539 Provides install directory variables as defined for GNU soft‐
9540 ware:
9541
9542
9543 http://www.gnu.org/prep/standards/html_node/Directory-Variables.html
9544
9545 Inclusion of this module defines the following variables:
9546
9547
9548 CMAKE_INSTALL_<dir> - destination for files of a given type
9549 CMAKE_INSTALL_FULL_<dir> - corresponding absolute path
9550
9551 where <dir> is one of:
9552
9553
9554 BINDIR - user executables (bin)
9555 SBINDIR - system admin executables (sbin)
9556 LIBEXECDIR - program executables (libexec)
9557 SYSCONFDIR - read-only single-machine data (etc)
9558 SHAREDSTATEDIR - modifiable architecture-independent data (com)
9559 LOCALSTATEDIR - modifiable single-machine data (var)
9560 LIBDIR - object code libraries (lib or lib64 or lib/<multiarch-tuple> on Debian)
9561 INCLUDEDIR - C header files (include)
9562 OLDINCLUDEDIR - C header files for non-gcc (/usr/include)
9563 DATAROOTDIR - read-only architecture-independent data root (share)
9564 DATADIR - read-only architecture-independent data (DATAROOTDIR)
9565 INFODIR - info documentation (DATAROOTDIR/info)
9566 LOCALEDIR - locale-dependent data (DATAROOTDIR/locale)
9567 MANDIR - man documentation (DATAROOTDIR/man)
9568 DOCDIR - documentation root (DATAROOTDIR/doc/PROJECT_NAME)
9569
9570 Each CMAKE_INSTALL_<dir> value may be passed to the DESTINATION
9571 options of install() commands for the corresponding file type.
9572 If the includer does not define a value the above-shown default
9573 will be used and the value will appear in the cache for editing
9574 by the user. Each CMAKE_INSTALL_FULL_<dir> value contains an
9575 absolute path constructed from the corresponding destination by
9576 prepending (if necessary) the value of CMAKE_INSTALL_PREFIX.
9577
9578
9579 GenerateExportHeader
9580 Function for generation of export macros for libraries
9581
9582 This module provides the function GENERATE_EXPORT_HEADER() and
9583 the accompanying ADD_COMPILER_EXPORT_FLAGS() function.
9584
9585
9586 The GENERATE_EXPORT_HEADER function can be used to generate a
9587 file suitable for preprocessor inclusion which contains EXPORT
9588 macros to be used in library classes.
9589
9590
9591 GENERATE_EXPORT_HEADER( LIBRARY_TARGET
9592
9593
9594 [BASE_NAME <base_name>]
9595 [EXPORT_MACRO_NAME <export_macro_name>]
9596 [EXPORT_FILE_NAME <export_file_name>]
9597 [DEPRECATED_MACRO_NAME <deprecated_macro_name>]
9598 [NO_EXPORT_MACRO_NAME <no_export_macro_name>]
9599 [STATIC_DEFINE <static_define>]
9600 [NO_DEPRECATED_MACRO_NAME <no_deprecated_macro_name>]
9601 [DEFINE_NO_DEPRECATED]
9602 [PREFIX_NAME <prefix_name>]
9603
9604 )
9605
9606
9607 ADD_COMPILER_EXPORT_FLAGS( [<output_variable>] )
9608
9609
9610 By default GENERATE_EXPORT_HEADER() generates macro names in a
9611 file name determined by the name of the library. The ADD_COM‐
9612 PILER_EXPORT_FLAGS function adds -fvisibility=hidden to
9613 CMAKE_CXX_FLAGS if supported, and is a no-op on Windows which
9614 does not need extra compiler flags for exporting support. You
9615 may optionally pass a single argument to ADD_COM‐
9616 PILER_EXPORT_FLAGS that will be populated with the required
9617 CXX_FLAGS required to enable visibility support for the com‐
9618 piler/architecture in use.
9619
9620
9621 This means that in the simplest case, users of these functions
9622 will be equivalent to:
9623
9624
9625 add_compiler_export_flags()
9626 add_library(somelib someclass.cpp)
9627 generate_export_header(somelib)
9628 install(TARGETS somelib DESTINATION ${LIBRARY_INSTALL_DIR})
9629 install(FILES
9630 someclass.h
9631 ${PROJECT_BINARY_DIR}/somelib_export.h DESTINATION ${INCLUDE_INSTALL_DIR}
9632 )
9633
9634
9635
9636
9637 And in the ABI header files:
9638
9639
9640 #include "somelib_export.h"
9641 class SOMELIB_EXPORT SomeClass {
9642 ...
9643 };
9644
9645
9646
9647
9648 The CMake fragment will generate a file in the ${CMAKE_CUR‐
9649 RENT_BINARY_DIR} called somelib_export.h containing the macros
9650 SOMELIB_EXPORT, SOMELIB_NO_EXPORT, SOMELIB_DEPRECATED,
9651 SOMELIB_DEPRECATED_EXPORT and SOMELIB_DEPRECATED_NO_EXPORT. The
9652 resulting file should be installed with other headers in the
9653 library.
9654
9655
9656 The BASE_NAME argument can be used to override the file name and
9657 the names used for the macros
9658
9659
9660 add_library(somelib someclass.cpp)
9661 generate_export_header(somelib
9662 BASE_NAME other_name
9663 )
9664
9665
9666
9667
9668 Generates a file called other_name_export.h containing the
9669 macros OTHER_NAME_EXPORT, OTHER_NAME_NO_EXPORT and
9670 OTHER_NAME_DEPRECATED etc.
9671
9672
9673 The BASE_NAME may be overridden by specifiying other options in
9674 the function. For example:
9675
9676
9677 add_library(somelib someclass.cpp)
9678 generate_export_header(somelib
9679 EXPORT_MACRO_NAME OTHER_NAME_EXPORT
9680 )
9681
9682
9683
9684
9685 creates the macro OTHER_NAME_EXPORT instead of SOMELIB_EXPORT,
9686 but other macros and the generated file name is as default.
9687
9688
9689 add_library(somelib someclass.cpp)
9690 generate_export_header(somelib
9691 DEPRECATED_MACRO_NAME KDE_DEPRECATED
9692 )
9693
9694
9695
9696
9697 creates the macro KDE_DEPRECATED instead of SOMELIB_DEPRECATED.
9698
9699
9700 If LIBRARY_TARGET is a static library, macros are defined with‐
9701 out values.
9702
9703
9704 If the same sources are used to create both a shared and a
9705 static library, the uppercased symbol ${BASE_NAME}_STATIC_DEFINE
9706 should be used when building the static library
9707
9708
9709 add_library(shared_variant SHARED ${lib_SRCS})
9710 add_library(static_variant ${lib_SRCS})
9711 generate_export_header(shared_variant BASE_NAME libshared_and_static)
9712 set_target_properties(static_variant PROPERTIES
9713 COMPILE_FLAGS -DLIBSHARED_AND_STATIC_STATIC_DEFINE)
9714
9715
9716
9717
9718 This will cause the export macros to expand to nothing when
9719 building the static library.
9720
9721
9722 If DEFINE_NO_DEPRECATED is specified, then a macro
9723 ${BASE_NAME}_NO_DEPRECATED will be defined This macro can be
9724 used to remove deprecated code from preprocessor output.
9725
9726
9727 option(EXCLUDE_DEPRECATED "Exclude deprecated parts of the library" FALSE)
9728 if (EXCLUDE_DEPRECATED)
9729 set(NO_BUILD_DEPRECATED DEFINE_NO_DEPRECATED)
9730 endif()
9731 generate_export_header(somelib ${NO_BUILD_DEPRECATED})
9732
9733
9734
9735
9736 And then in somelib:
9737
9738
9739 class SOMELIB_EXPORT SomeClass
9740 {
9741 public:
9742 #ifndef SOMELIB_NO_DEPRECATED
9743 SOMELIB_DEPRECATED void oldMethod();
9744 #endif
9745 };
9746
9747
9748
9749
9750 #ifndef SOMELIB_NO_DEPRECATED
9751 void SomeClass::oldMethod() { }
9752 #endif
9753
9754
9755
9756
9757 If PREFIX_NAME is specified, the argument will be used as a pre‐
9758 fix to all generated macros.
9759
9760
9761 For example:
9762
9763
9764 generate_export_header(somelib PREFIX_NAME VTK_)
9765
9766
9767
9768
9769 Generates the macros VTK_SOMELIB_EXPORT etc.
9770
9771
9772 GetPrerequisites
9773 Functions to analyze and list executable file prerequisites.
9774
9775 This module provides functions to list the .dll, .dylib or .so
9776 files that an executable or shared library file depends on. (Its
9777 prerequisites.)
9778
9779
9780 It uses various tools to obtain the list of required shared
9781 library files:
9782
9783
9784 dumpbin (Windows)
9785 objdump (MinGW on Windows)
9786 ldd (Linux/Unix)
9787 otool (Mac OSX)
9788
9789 The following functions are provided by this module:
9790
9791
9792 get_prerequisites
9793 list_prerequisites
9794 list_prerequisites_by_glob
9795 gp_append_unique
9796 is_file_executable
9797 gp_item_default_embedded_path
9798 (projects can override with gp_item_default_embedded_path_override)
9799 gp_resolve_item
9800 (projects can override with gp_resolve_item_override)
9801 gp_resolved_file_type
9802 (projects can override with gp_resolved_file_type_override)
9803 gp_file_type
9804
9805 Requires CMake 2.6 or greater because it uses function, break,
9806 return and PARENT_SCOPE.
9807
9808
9809 GET_PREREQUISITES(<target> <prerequisites_var> <exclude_system> <recurse>
9810 <exepath> <dirs>)
9811
9812 Get the list of shared library files required by <target>. The
9813 list in the variable named <prerequisites_var> should be empty
9814 on first entry to this function. On exit, <prerequisites_var>
9815 will contain the list of required shared library files.
9816
9817
9818 <target> is the full path to an executable file. <prerequi‐
9819 sites_var> is the name of a CMake variable to contain the
9820 results. <exclude_system> must be 0 or 1 indicating whether to
9821 include or exclude "system" prerequisites. If <recurse> is set
9822 to 1 all prerequisites will be found recursively, if set to 0
9823 only direct prerequisites are listed. <exepath> is the path to
9824 the top level executable used for @executable_path replacment on
9825 the Mac. <dirs> is a list of paths where libraries might be
9826 found: these paths are searched first when a target without any
9827 path info is given. Then standard system locations are also
9828 searched: PATH, Framework locations, /usr/lib...
9829
9830
9831 LIST_PREREQUISITES(<target> [<recurse> [<exclude_system> [<verbose>]]])
9832
9833 Print a message listing the prerequisites of <target>.
9834
9835
9836 <target> is the name of a shared library or executable target or
9837 the full path to a shared library or executable file. If
9838 <recurse> is set to 1 all prerequisites will be found recur‐
9839 sively, if set to 0 only direct prerequisites are listed.
9840 <exclude_system> must be 0 or 1 indicating whether to include or
9841 exclude "system" prerequisites. With <verbose> set to 0 only the
9842 full path names of the prerequisites are printed, set to 1 extra
9843 informatin will be displayed.
9844
9845
9846 LIST_PREREQUISITES_BY_GLOB(<glob_arg> <glob_exp>)
9847
9848 Print the prerequisites of shared library and executable files
9849 matching a globbing pattern. <glob_arg> is GLOB or GLOB_RECURSE
9850 and <glob_exp> is a globbing expression used with "file(GLOB" or
9851 "file(GLOB_RECURSE" to retrieve a list of matching files. If a
9852 matching file is executable, its prerequisites are listed.
9853
9854
9855 Any additional (optional) arguments provided are passed along as
9856 the optional arguments to the list_prerequisites calls.
9857
9858
9859 GP_APPEND_UNIQUE(<list_var> <value>)
9860
9861 Append <value> to the list variable <list_var> only if the value
9862 is not already in the list.
9863
9864
9865 IS_FILE_EXECUTABLE(<file> <result_var>)
9866
9867 Return 1 in <result_var> if <file> is a binary executable, 0
9868 otherwise.
9869
9870
9871 GP_ITEM_DEFAULT_EMBEDDED_PATH(<item> <default_embedded_path_var>)
9872
9873 Return the path that others should refer to the item by when the
9874 item is embedded inside a bundle.
9875
9876
9877 Override on a per-project basis by providing a project-specific
9878 gp_item_default_embedded_path_override function.
9879
9880
9881 GP_RESOLVE_ITEM(<context> <item> <exepath> <dirs> <resolved_item_var>)
9882
9883 Resolve an item into an existing full path file.
9884
9885
9886 Override on a per-project basis by providing a project-specific
9887 gp_resolve_item_override function.
9888
9889
9890 GP_RESOLVED_FILE_TYPE(<original_file> <file> <exepath> <dirs> <type_var>)
9891
9892 Return the type of <file> with respect to <original_file>.
9893 String describing type of prerequisite is returned in variable
9894 named <type_var>.
9895
9896
9897 Use <exepath> and <dirs> if necessary to resolve non-absolute
9898 <file> values -- but only for non-embedded items.
9899
9900
9901 Possible types are:
9902
9903
9904 system
9905 local
9906 embedded
9907 other
9908
9909 Override on a per-project basis by providing a project-specific
9910 gp_resolved_file_type_override function.
9911
9912
9913 GP_FILE_TYPE(<original_file> <file> <type_var>)
9914
9915 Return the type of <file> with respect to <original_file>.
9916 String describing type of prerequisite is returned in variable
9917 named <type_var>.
9918
9919
9920 Possible types are:
9921
9922
9923 system
9924 local
9925 embedded
9926 other
9927
9928
9929 InstallRequiredSystemLibraries
9930
9931
9932 By including this file, all library files listed in the variable
9933 CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS will be installed with
9934 install(PROGRAMS ...) into bin for WIN32 and lib for non-WIN32.
9935 If CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP is set to TRUE before
9936 including this file, then the INSTALL command is not called. The
9937 user can use the variable CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS to
9938 use a custom install command and install them however they want.
9939 If it is the MSVC compiler, then the microsoft run time
9940 libraries will be found and automatically added to the
9941 CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS, and installed. If
9942 CMAKE_INSTALL_DEBUG_LIBRARIES is set and it is the MSVC com‐
9943 piler, then the debug libraries are installed when available. If
9944 CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY is set then only the debug
9945 libraries are installed when both debug and release are avail‐
9946 able. If CMAKE_INSTALL_MFC_LIBRARIES is set then the MFC run
9947 time libraries are installed as well as the CRT run time
9948 libraries. If CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION is set
9949 then the libraries are installed to that directory rather than
9950 the default. If CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS is
9951 NOT set, then this file warns about required files that do not
9952 exist. You can set this variable to ON before including this
9953 file to avoid the warning. For example, the Visual Studio
9954 Express editions do not include the redistributable files, so if
9955 you include this file on a machine with only VS Express
9956 installed, you'll get the warning.
9957
9958
9959 MacroAddFileDependencies
9960 MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...)
9961
9962 Using the macro MACRO_ADD_FILE_DEPENDENCIES() is discouraged.
9963 There are usually better ways to specify the correct dependen‐
9964 cies.
9965
9966
9967 MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...) is just a
9968 convenience wrapper around the OBJECT_DEPENDS source file prop‐
9969 erty. You can just use set_property(SOURCE <file> APPEND PROP‐
9970 ERTY OBJECT_DEPENDS depend_files) instead.
9971
9972
9973 ProcessorCount
9974 ProcessorCount(var)
9975
9976 Determine the number of processors/cores and save value in
9977 ${var}
9978
9979
9980 Sets the variable named ${var} to the number of physical cores
9981 available on the machine if the information can be determined.
9982 Otherwise it is set to 0. Currently this functionality is imple‐
9983 mented for AIX, cygwin, FreeBSD, HPUX, IRIX, Linux, Mac OS X,
9984 QNX, Sun and Windows.
9985
9986
9987 This function is guaranteed to return a positive integer (>=1)
9988 if it succeeds. It returns 0 if there's a problem determining
9989 the processor count.
9990
9991
9992 Example use, in a ctest -S dashboard script:
9993
9994
9995 include(ProcessorCount)
9996 ProcessorCount(N)
9997 if(NOT N EQUAL 0)
9998 set(CTEST_BUILD_FLAGS -j${N})
9999 set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N})
10000 endif()
10001
10002
10003
10004
10005 This function is intended to offer an approximation of the value
10006 of the number of compute cores available on the current machine,
10007 such that you may use that value for parallel building and par‐
10008 allel testing. It is meant to help utilize as much of the
10009 machine as seems reasonable. Of course, knowledge of what else
10010 might be running on the machine simultaneously should be used
10011 when deciding whether to request a machine's full capacity all
10012 for yourself.
10013
10014
10015 Qt4ConfigDependentSettings
10016
10017
10018 This file is included by FindQt4.cmake, don't include it
10019 directly.
10020
10021
10022 Qt4Macros
10023
10024
10025 This file is included by FindQt4.cmake, don't include it
10026 directly.
10027
10028
10029 SelectLibraryConfigurations
10030
10031
10032 select_library_configurations( basename )
10033
10034
10035 This macro takes a library base name as an argument, and will
10036 choose good values for basename_LIBRARY, basename_LIBRARIES,
10037 basename_LIBRARY_DEBUG, and basename_LIBRARY_RELEASE depending
10038 on what has been found and set. If only base‐
10039 name_LIBRARY_RELEASE is defined, basename_LIBRARY will be set to
10040 the release value, and basename_LIBRARY_DEBUG will be set to
10041 basename_LIBRARY_DEBUG-NOTFOUND. If only basename_LIBRARY_DEBUG
10042 is defined, then basename_LIBRARY will take the debug value, and
10043 basename_LIBRARY_RELEASE will be set to base‐
10044 name_LIBRARY_RELEASE-NOTFOUND.
10045
10046
10047 If the generator supports configuration types, then base‐
10048 name_LIBRARY and basename_LIBRARIES will be set with debug and
10049 optimized flags specifying the library to be used for the given
10050 configuration. If no build type has been set or the generator
10051 in use does not support configuration types, then base‐
10052 name_LIBRARY and basename_LIBRARIES will take only the release
10053 value, or the debug value if the release one is not set.
10054
10055
10056 SquishTestScript
10057
10058
10059
10060
10061
10062 This script launches a GUI test using Squish. You should not
10063 call the script directly; instead, you should access it via the
10064 SQUISH_ADD_TEST macro that is defined in FindSquish.cmake.
10065
10066
10067 This script starts the Squish server, launches the test on the
10068 client, and finally stops the squish server. If any of these
10069 steps fail (including if the tests do not pass) then a fatal
10070 error is raised.
10071
10072
10073
10074 TestBigEndian
10075 Define macro to determine endian type
10076
10077 Check if the system is big endian or little endian
10078
10079
10080 TEST_BIG_ENDIAN(VARIABLE)
10081 VARIABLE - variable to store the result to
10082
10083
10084
10085
10086
10087 TestCXXAcceptsFlag
10088 Test CXX compiler for a flag
10089
10090 Check if the CXX compiler accepts a flag
10091
10092
10093 Macro CHECK_CXX_ACCEPTS_FLAG(FLAGS VARIABLE) -
10094 checks if the function exists
10095 FLAGS - the flags to try
10096 VARIABLE - variable to store the result
10097
10098
10099
10100
10101
10102 TestForANSIForScope
10103 Check for ANSI for scope support
10104
10105 Check if the compiler restricts the scope of variables declared
10106 in a for-init-statement to the loop body.
10107
10108
10109 CMAKE_NO_ANSI_FOR_SCOPE - holds result
10110
10111
10112
10113
10114
10115 TestForANSIStreamHeaders
10116 Test for compiler support of ANSI stream headers iostream, etc.
10117
10118 check if the compiler supports the standard ANSI iostream header
10119 (without the .h)
10120
10121
10122 CMAKE_NO_ANSI_STREAM_HEADERS - defined by the results
10123
10124
10125
10126
10127
10128 TestForSSTREAM
10129 Test for compiler support of ANSI sstream header
10130
10131 check if the compiler supports the standard ANSI sstream header
10132
10133
10134 CMAKE_NO_ANSI_STRING_STREAM - defined by the results
10135
10136
10137
10138
10139
10140 TestForSTDNamespace
10141 Test for std:: namespace support
10142
10143 check if the compiler supports std:: on stl classes
10144
10145
10146 CMAKE_NO_STD_NAMESPACE - defined by the results
10147
10148
10149
10150
10151
10152 UseEcos
10153 This module defines variables and macros required to build eCos
10154 application.
10155
10156 This file contains the following macros: ECOS_ADD_INCLUDE_DIREC‐
10157 TORIES() - add the eCos include dirs ECOS_ADD_EXECUTABLE(name
10158 source1 ... sourceN ) - create an eCos executable
10159 ECOS_ADJUST_DIRECTORY(VAR source1 ... sourceN ) - adjusts the
10160 path of the source files and puts the result into VAR
10161
10162
10163 Macros for selecting the toolchain: ECOS_USE_ARM_ELF_TOOLS()
10164 - enable the ARM ELF toolchain for the directory where it is
10165 called ECOS_USE_I386_ELF_TOOLS() - enable the i386 ELF
10166 toolchain for the directory where it is called
10167 ECOS_USE_PPC_EABI_TOOLS() - enable the PowerPC toolchain
10168 for the directory where it is called
10169
10170
10171 It contains the following variables: ECOS_DEFINITIONS ECOSCON‐
10172 FIG_EXECUTABLE ECOS_CONFIG_FILE - defaults to
10173 ecos.ecc, if your eCos configuration file has a different name,
10174 adjust this variable for internal use only:
10175
10176
10177 ECOS_ADD_TARGET_LIB
10178
10179
10180 UseJava
10181 Use Module for Java
10182
10183 This file provides functions for Java. It is assumed that Find‐
10184 Java.cmake has already been loaded. See FindJava.cmake for
10185 information on how to load Java into your CMake project.
10186
10187
10188 add_jar(target_name
10189
10190
10191 [SOURCES] source1 [source2 ...] [resource1 ...]
10192 [INCLUDE_JARS jar1 [jar2 ...]]
10193 [ENTRY_POINT entry]
10194 [VERSION version]
10195 [OUTPUT_NAME name]
10196 [OUTPUT_DIR dir]
10197 )
10198
10199
10200
10201
10202 This command creates a <target_name>.jar. It compiles the given
10203 source files (source) and adds the given resource files
10204 (resource) to the jar file. If only resource files are given
10205 then just a jar file is created. The list of include jars are
10206 added to the classpath when compiling the java sources and also
10207 to the dependencies of the target. INCLUDE_JARS also accepts
10208 other target names created by add_jar. For backwards compatibil‐
10209 ity, jar files listed as sources are ignored (as they have been
10210 since the first version of this module).
10211
10212
10213 The default OUTPUT_DIR can also be changed by setting the vari‐
10214 able CMAKE_JAVA_TARGET_OUTPUT_DIR.
10215
10216
10217 Additional instructions:
10218
10219
10220 To add compile flags to the target you can set these flags with
10221 the following variable:
10222
10223
10224
10225
10226 set(CMAKE_JAVA_COMPILE_FLAGS -nowarn)
10227
10228
10229
10230
10231 To add a path or a jar file to the class path you can do this
10232 with the CMAKE_JAVA_INCLUDE_PATH variable.
10233
10234
10235
10236
10237 set(CMAKE_JAVA_INCLUDE_PATH /usr/share/java/shibboleet.jar)
10238
10239
10240
10241
10242 To use a different output name for the target you can set it with:
10243
10244
10245
10246
10247 add_jar(foobar foobar.java OUTPUT_NAME shibboleet.jar)
10248
10249
10250
10251
10252 To use a different output directory than CMAKE_CURRENT_BINARY_DIR
10253 you can set it with:
10254
10255
10256
10257
10258 add_jar(foobar foobar.java OUTPUT_DIR ${PROJECT_BINARY_DIR}/bin)
10259
10260
10261
10262
10263 To define an entry point in your jar you can set it with the ENTRY_POINT
10264 named argument:
10265
10266
10267
10268
10269 add_jar(example ENTRY_POINT com/examples/MyProject/Main)
10270
10271
10272
10273
10274 To add a VERSION to the target output name you can set it using
10275 the VERSION named argument to add_jar. This will create a jar file with the
10276 name shibboleet-1.0.0.jar and will create a symlink shibboleet.jar
10277 pointing to the jar with the version information.
10278
10279
10280
10281
10282 add_jar(shibboleet shibbotleet.java VERSION 1.2.0)
10283
10284
10285
10286
10287 If the target is a JNI library, utilize the following commands to
10288 create a JNI symbolic link:
10289
10290
10291
10292
10293 set(CMAKE_JNI_TARGET TRUE)
10294 add_jar(shibboleet shibbotleet.java VERSION 1.2.0)
10295 install_jar(shibboleet ${LIB_INSTALL_DIR}/shibboleet)
10296 install_jni_symlink(shibboleet ${JAVA_LIB_INSTALL_DIR})
10297
10298
10299
10300
10301 If a single target needs to produce more than one jar from its
10302 java source code, to prevent the accumulation of duplicate class
10303 files in subsequent jars, set/reset CMAKE_JAR_CLASSES_PREFIX prior
10304 to calling the add_jar() function:
10305
10306
10307
10308
10309 set(CMAKE_JAR_CLASSES_PREFIX com/redhat/foo)
10310 add_jar(foo foo.java)
10311
10312
10313
10314
10315 set(CMAKE_JAR_CLASSES_PREFIX com/redhat/bar)
10316 add_jar(bar bar.java)
10317
10318
10319
10320
10321 Target Properties:
10322
10323
10324 The add_jar() functions sets some target properties. You can get these
10325 properties with the
10326 get_property(TARGET <target_name> PROPERTY <propery_name>)
10327 command.
10328
10329
10330
10331
10332 INSTALL_FILES The files which should be installed. This is used by
10333 install_jar().
10334 JNI_SYMLINK The JNI symlink which should be installed.
10335 This is used by install_jni_symlink().
10336 JAR_FILE The location of the jar file so that you can include
10337 it.
10338 CLASS_DIR The directory where the class files can be found. For
10339 example to use them with javah.
10340
10341
10342
10343
10344 find_jar(<VAR>
10345
10346
10347 name | NAMES name1 [name2 ...]
10348 [PATHS path1 [path2 ... ENV var]]
10349 [VERSIONS version1 [version2]]
10350 [DOC "cache documentation string"]
10351 )
10352
10353
10354
10355
10356 This command is used to find a full path to the named jar. A
10357 cache entry named by <VAR> is created to stor the result of this
10358 command. If the full path to a jar is found the result is stored
10359 in the variable and the search will not repeated unless the
10360 variable is cleared. If nothing is found, the result will be
10361 <VAR>-NOTFOUND, and the search will be attempted again next time
10362 find_jar is invoked with the same variable. The name of the full
10363 path to a file that is searched for is specified by the names
10364 listed after NAMES argument. Additional search locations can be
10365 specified after the PATHS argument. If you require special a
10366 version of a jar file you can specify it with the VERSIONS argu‐
10367 ment. The argument after DOC will be used for the documentation
10368 string in the cache.
10369
10370
10371 install_jar(TARGET_NAME DESTINATION)
10372
10373
10374 This command installs the TARGET_NAME files to the given DESTI‐
10375 NATION. It should be called in the same scope as add_jar() or it
10376 will fail.
10377
10378
10379 install_jni_symlink(TARGET_NAME DESTINATION)
10380
10381
10382 This command installs the TARGET_NAME JNI symlinks to the given
10383 DESTINATION. It should be called in the same scope as add_jar()
10384 or it will fail.
10385
10386
10387 create_javadoc(<VAR>
10388
10389
10390 PACKAGES pkg1 [pkg2 ...]
10391 [SOURCEPATH <sourcepath>]
10392 [CLASSPATH <classpath>]
10393 [INSTALLPATH <install path>]
10394 [DOCTITLE "the documentation title"]
10395 [WINDOWTITLE "the title of the document"]
10396 [AUTHOR TRUE|FALSE]
10397 [USE TRUE|FALSE]
10398 [VERSION TRUE|FALSE]
10399 )
10400
10401
10402
10403
10404 Create java documentation based on files or packages. For more
10405 details please read the javadoc manpage.
10406
10407
10408 There are two main signatures for create_javadoc. The first sig‐
10409 nature works with package names on a path with source files:
10410
10411
10412 Example:
10413 create_javadoc(my_example_doc
10414 PACKAGES com.exmaple.foo com.example.bar
10415 SOURCEPATH "${CMAKE_CURRENT_SOURCE_DIR}"
10416 CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH}
10417 WINDOWTITLE "My example"
10418 DOCTITLE "<h1>My example</h1>"
10419 AUTHOR TRUE
10420 USE TRUE
10421 VERSION TRUE
10422 )
10423
10424
10425
10426
10427 The second signature for create_javadoc works on a given list of
10428 files.
10429
10430
10431 create_javadoc(<VAR>
10432 FILES file1 [file2 ...]
10433 [CLASSPATH <classpath>]
10434 [INSTALLPATH <install path>]
10435 [DOCTITLE "the documentation title"]
10436 [WINDOWTITLE "the title of the document"]
10437 [AUTHOR TRUE|FALSE]
10438 [USE TRUE|FALSE]
10439 [VERSION TRUE|FALSE]
10440 )
10441
10442
10443
10444
10445 Example:
10446
10447
10448 create_javadoc(my_example_doc
10449 FILES ${example_SRCS}
10450 CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH}
10451 WINDOWTITLE "My example"
10452 DOCTITLE "<h1>My example</h1>"
10453 AUTHOR TRUE
10454 USE TRUE
10455 VERSION TRUE
10456 )
10457
10458
10459
10460
10461 Both signatures share most of the options. These options are the
10462 same as what you can find in the javadoc manpage. Please look at
10463 the manpage for CLASSPATH, DOCTITLE, WINDOWTITLE, AUTHOR, USE
10464 and VERSION.
10465
10466
10467 The documentation will be by default installed to
10468
10469
10470 ${CMAKE_INSTALL_PREFIX}/share/javadoc/<VAR>
10471
10472
10473
10474
10475 if you don't set the INSTALLPATH.
10476
10477
10478
10479 UseJavaClassFilelist
10480
10481
10482
10483
10484
10485 This script create a list of compiled Java class files to be
10486 added to a jar file. This avoids including cmake files which get
10487 created in the binary directory.
10488
10489
10490
10491 UseJavaSymlinks
10492
10493
10494
10495
10496
10497 Helper script for UseJava.cmake
10498
10499
10500
10501 UsePkgConfig
10502 Obsolete pkg-config module for CMake, use FindPkgConfig instead.
10503
10504
10505
10506
10507 This module defines the following macro:
10508
10509
10510 PKGCONFIG(package includedir libdir linkflags cflags)
10511
10512
10513 Calling PKGCONFIG will fill the desired information into the 4
10514 given arguments, e.g. PKGCONFIG(libart-2.0 LIBART_INCLUDE_DIR
10515 LIBART_LINK_DIR LIBART_LINK_FLAGS LIBART_CFLAGS) if pkg-config
10516 was NOT found or the specified software package doesn't exist,
10517 the variable will be empty when the function returns, otherwise
10518 they will contain the respective information
10519
10520
10521
10522 UseQt4 Use Module for QT4
10523
10524 Sets up C and C++ to use Qt 4. It is assumed that FindQt.cmake
10525 has already been loaded. See FindQt.cmake for information on
10526 how to load Qt 4 into your CMake project.
10527
10528
10529 UseSWIG
10530 SWIG module for CMake
10531
10532 Defines the following macros:
10533
10534
10535 SWIG_ADD_MODULE(name language [ files ])
10536 - Define swig module with given name and specified language
10537 SWIG_LINK_LIBRARIES(name [ libraries ])
10538 - Link libraries to swig module
10539
10540 All other macros are for internal use only. To get the actual
10541 name of the swig module, use: ${SWIG_MODULE_${name}_REAL_NAME}.
10542 Set Source files properties such as CPLUSPLUS and SWIG_FLAGS to
10543 specify special behavior of SWIG. Also global CMAKE_SWIG_FLAGS
10544 can be used to add special flags to all swig calls. Another spe‐
10545 cial variable is CMAKE_SWIG_OUTDIR, it allows one to specify
10546 where to write all the swig generated module (swig -outdir
10547 option) The name-specific variable SWIG_MODULE_<name>_EXTRA_DEPS
10548 may be used to specify extra dependencies for the generated mod‐
10549 ules. If the source file generated by swig need some special
10550 flag you can use set_source_files_properties( ${swig_gener‐
10551 ated_file_fullname}
10552
10553
10554 PROPERTIES COMPILE_FLAGS "-bla")
10555
10556
10557 Use_wxWindows
10558 ---------------------------------------------------
10559
10560
10561
10562
10563 This convenience include finds if wxWindows is installed and set
10564 the appropriate libs, incdirs, flags etc. author Jan Woetzel <jw
10565 -at- mip.informatik.uni-kiel.de> (07/2003) USAGE:
10566
10567
10568 just include Use_wxWindows.cmake
10569 in your projects CMakeLists.txt
10570
10571 include( ${CMAKE_MODULE_PATH}/Use_wxWindows.cmake)
10572
10573
10574 if you are sure you need GL then
10575
10576 set(WXWINDOWS_USE_GL 1)
10577
10578
10579 *before* you include this file.
10580
10581
10582 UsewxWidgets
10583 Convenience include for using wxWidgets library.
10584
10585 Determines if wxWidgets was FOUND and sets the appropriate libs,
10586 incdirs, flags, etc. INCLUDE_DIRECTORIES and LINK_DIRECTORIES
10587 are called.
10588
10589
10590 USAGE
10591
10592
10593 # Note that for MinGW users the order of libs is important!
10594 find_package(wxWidgets REQUIRED net gl core base)
10595 include(${wxWidgets_USE_FILE})
10596 # and for each of your dependent executable/library targets:
10597 target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES})
10598
10599
10600
10601
10602 DEPRECATED
10603
10604
10605 LINK_LIBRARIES is not called in favor of adding dependencies per target.
10606
10607
10608
10609
10610 AUTHOR
10611
10612
10613 Jan Woetzel <jw -at- mip.informatik.uni-kiel.de>
10614
10615
10616 WriteBasicConfigVersionFile
10617
10618
10619 WRITE_BASIC_CONFIG_VERSION_FILE( filename VERSION major.minor.patch COMPATIBILITY (AnyNewerVersion|SameMajorVersion) )
10620
10621
10622
10623
10624 Deprecated, see WRITE_BASIC_PACKAGE_VERSION_FILE(), it is iden‐
10625 tical.
10626
10627
10629 Copyright 2000-2012 Kitware, Inc., Insight Software Consortium. All
10630 rights reserved.
10631
10632
10633 Redistribution and use in source and binary forms, with or without mod‐
10634 ification, are permitted provided that the following conditions are
10635 met:
10636
10637
10638 Redistributions of source code must retain the above copyright notice,
10639 this list of conditions and the following disclaimer.
10640
10641
10642 Redistributions in binary form must reproduce the above copyright
10643 notice, this list of conditions and the following disclaimer in the
10644 documentation and/or other materials provided with the distribution.
10645
10646
10647 Neither the names of Kitware, Inc., the Insight Software Consortium,
10648 nor the names of their contributors may be used to endorse or promote
10649 products derived from this software without specific prior written per‐
10650 mission.
10651
10652
10653 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
10654 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
10655 TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTIC‐
10656 ULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
10657 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
10658 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
10659 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
10660 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
10661 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
10662 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
10663 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
10664
10665
10667 ccmake(1), cpack(1), ctest(1), cmakecommands(1), cmakecompat(1), cmake‐
10668 modules(1), cmakeprops(1), cmakevars(1)
10669
10670
10671 The following resources are available to get help using CMake:
10672
10673
10674 Home Page
10675 http://www.cmake.org
10676
10677 The primary starting point for learning about CMake.
10678
10679
10680 Frequently Asked Questions
10681 http://www.cmake.org/Wiki/CMake_FAQ
10682
10683 A Wiki is provided containing answers to frequently asked ques‐
10684 tions.
10685
10686
10687 Online Documentation
10688 http://www.cmake.org/HTML/Documentation.html
10689
10690 Links to available documentation may be found on this web page.
10691
10692
10693 Mailing List
10694 http://www.cmake.org/HTML/MailingLists.html
10695
10696 For help and discussion about using cmake, a mailing list is
10697 provided at cmake@cmake.org. The list is member-post-only but
10698 one may sign up on the CMake web page. Please first read the
10699 full documentation at http://www.cmake.org before posting ques‐
10700 tions to the list.
10701
10702
10703
10704
10705cmake 2.8.12.2 November 05, 2016 cmakemodules(1)