cmake - Cross-Platform Makefile Generator.
cmake [options] <path-to-source>
cmake [options] <path-to-existing-build>
The "cmake" executable is the CMake command-line interface. It may be used to configure projects in scripts. Project configuration settings may be specified on the command line with the -D option. The -i option will cause cmake to interactively prompt for such settings.
CMake is a cross-platform build system generator. Projects specify their build process with platform-independent CMake listfiles included in each directory of a source tree with the name CMakeLists.txt. Users build a project by using CMake to generate a build system for a native tool on their platform.
-C <initial-cache>-D <var>:<type>=<value>-U <globbing_expr>-G <generator-name>-Wno-dev-Wdev-E-i-L[A][H]--build <dir>-N-P <file>--find-package--graphviz=[file]--system-information [file]--debug-trycompile--debug-output--trace--warn-uninitialized--warn-unused-vars--no-warn-unused-cli--check-system-vars--help-command cmd [file]--help-command-list [file]--help-commands [file]--help-compatcommands [file]--help-module module [file]--help-module-list [file]--help-modules [file]--help-custom-modules [file]--help-policy cmp [file]--help-policies [file]--help-property prop [file]--help-property-list [file]--help-properties [file]--help-variable var [file]--help-variable-list [file]--help-variables [file]--copyright [file]--help,-help,-usage,-h,-H,/?--help-full [file]--help-html [file]--help-man [file]--version,-version,/V [file]-C <initial-cache>: Pre-load a script to populate the cache.When cmake is first run in an empty build tree, it creates a CMakeCache.txt file and populates it with customizable settings for the project. This option may be used to specify a file from which to load cache entries before the first pass through the project's cmake listfiles. The loaded entries take priority over the project's default values. The given file should be a CMake script containing SET commands that use the CACHE option, not a cache-format file.
-D <var>:<type>=<value>: Create a cmake cache entry.When cmake is first run in an empty build tree, it creates a CMakeCache.txt file and populates it with customizable settings for the project. This option may be used to specify a setting that takes priority over the project's default value. The option may be repeated for as many cache entries as desired.
-U <globbing_expr>: Remove matching entries from CMake cache.This option may be used to remove one or more variables from the CMakeCache.txt file, globbing expressions using * and ? are supported. The option may be repeated for as many cache entries as desired.
Use with care, you can make your CMakeCache.txt non-working.
-G <generator-name>: Specify a makefile generator.CMake may support multiple native build systems on certain platforms. A makefile generator is responsible for generating a particular build system. Possible generator names are specified in the Generators section.
-Wno-dev: Suppress developer warnings.Suppress warnings that are meant for the author of the CMakeLists.txt files.
-Wdev: Enable developer warnings.Enable warnings that are meant for the author of the CMakeLists.txt files.
-E: CMake command mode.For true platform independence, CMake provides a list of commands that can be used on all systems. Run with -E help for the usage information. Commands available are: chdir, compare_files, copy, copy_directory, copy_if_different, echo, echo_append, environment, make_directory, md5sum, remove, remove_directory, rename, tar, time, touch, touch_nocreate. In addition, some platform specific commands are available. On Windows: comspec, delete_regv, write_regv. On UNIX: create_symlink.
-i: Run in wizard mode.Wizard mode runs cmake interactively without a GUI. The user is prompted to answer questions about the project configuration. The answers are used to set cmake cache values.
-L[A][H]: List non-advanced cached variables.List cache variables will run CMake and list all the variables from the CMake cache that are not marked as INTERNAL or ADVANCED. This will effectively display current CMake settings, which can be then changed with -D option. Changing some of the variable may result in more variables being created. If A is specified, then it will display also advanced variables. If H is specified, it will also display help for each variable.
--build <dir>: Build a CMake-generated project binary tree.This abstracts a native build tool's command-line interface with the following options:
<dir> = Project binary directory to be built.
--target <tgt> = Build <tgt> instead of default targets.
--config <cfg> = For multi-configuration tools, choose <cfg>.
--clean-first = Build target 'clean' first, then build.
(To clean only, use --target 'clean'.)
--use-stderr = Don't merge stdout/stderr.
-- = Pass remaining options to the native tool.
Run cmake --build with no options for quick help.
-N: View mode only.Only load the cache. Do not actually run configure and generate steps.
-P <file>: Process script mode.Process the given cmake file as a script written in the CMake language. No configure or generate step is performed and the cache is not modified. If variables are defined using -D, this must be done before the -P argument.
--find-package: Run in pkg-config like mode.Search a package using find_package() and print the resulting flags to stdout. This can be used to use cmake instead of pkg-config to find installed libraries in plain Makefile-based projects or in autoconf-based projects (via share/aclocal/cmake.m4).
--graphviz=[file]: Generate graphviz of dependencies.Generate a graphviz input file that will contain all the library and executable dependencies in the project.
--system-information [file]: Dump information about this system.Dump a wide range of information about the current system. If run from the top of a binary tree for a CMake project it will dump additional information such as the cache, log files etc.
--debug-trycompile: Do not delete the try_compile build tree. Only useful on one try_compile at a time.Do not delete the files and directories created for try_compile calls. This is useful in debugging failed try_compiles. It may however change the results of the try-compiles as old junk from a previous try-compile may cause a different test to either pass or fail incorrectly. This option is best used for one try-compile at a time, and only when debugging.
--debug-output: Put cmake in a debug mode.Print extra stuff during the cmake run like stack traces with message(send_error ) calls.
--trace: Put cmake in trace mode.Print a trace of all calls made and from where with message(send_error ) calls.
--warn-uninitialized: Warn about uninitialized values.Print a warning when an uninitialized variable is used.
--warn-unused-vars: Warn about unused variables.Find variables that are declared or set, but not used.
--no-warn-unused-cli: Don't warn about command line options.Don't find variables that are declared on the command line, but not used.
--check-system-vars: Find problems with variable usage in system files.Normally, unused and uninitialized variables are searched for only in CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR. This flag tells CMake to warn about other files as well.
--help-command cmd [file]: Print help for a single command and exit.Full documentation specific to the given command is displayed. If a file is specified, the documentation is written into and the output format is determined depending on the filename suffix. Supported are man page, HTML, DocBook and plain text.
--help-command-list [file]: List available listfile commands and exit.The list contains all commands for which help may be obtained by using the --help-command argument followed by a command name. If a file is specified, the documentation is written into and the output format is determined depending on the filename suffix. Supported are man page, HTML, DocBook and plain text.
--help-commands [file]: Print help for all commands and exit.Full documentation specific for all current command is displayed.If a file is specified, the documentation is written into and the output format is determined depending on the filename suffix. Supported are man page, HTML, DocBook and plain text.
--help-compatcommands [file]: Print help for compatibility commands. Full documentation specific for all compatibility commands is displayed.If a file is specified, the documentation is written into and the output format is determined depending on the filename suffix. Supported are man page, HTML, DocBook and plain text.
--help-module module [file]: Print help for a single module and exit.Full documentation specific to the given module is displayed.If a file is specified, the documentation is written into and the output format is determined depending on the filename suffix. Supported are man page, HTML, DocBook and plain text.
--help-module-list [file]: List available modules and exit.The list contains all modules for which help may be obtained by using the --help-module argument followed by a module name. If a file is specified, the documentation is written into and the output format is determined depending on the filename suffix. Supported are man page, HTML, DocBook and plain text.
--help-modules [file]: Print help for all modules and exit.Full documentation for all modules is displayed. If a file is specified, the documentation is written into and the output format is determined depending on the filename suffix. Supported are man page, HTML, DocBook and plain text.
--help-custom-modules [file]: Print help for all custom modules and exit.Full documentation for all custom modules is displayed. If a file is specified, the documentation is written into and the output format is determined depending on the filename suffix. Supported are man page, HTML, DocBook and plain text.
--help-policy cmp [file]: Print help for a single policy and exit.Full documentation specific to the given policy is displayed.If a file is specified, the documentation is written into and the output format is determined depending on the filename suffix. Supported are man page, HTML, DocBook and plain text.
--help-policies [file]: Print help for all policies and exit.Full documentation for all policies is displayed.If a file is specified, the documentation is written into and the output format is determined depending on the filename suffix. Supported are man page, HTML, DocBook and plain text.
--help-property prop [file]: Print help for a single property and exit.Full documentation specific to the given property is displayed.If a file is specified, the documentation is written into and the output format is determined depending on the filename suffix. Supported are man page, HTML, DocBook and plain text.
--help-property-list [file]: List available properties and exit.The list contains all properties for which help may be obtained by using the --help-property argument followed by a property name. If a file is specified, the help is written into it.If a file is specified, the documentation is written into and the output format is determined depending on the filename suffix. Supported are man page, HTML, DocBook and plain text.
--help-properties [file]: Print help for all properties and exit.Full documentation for all properties is displayed.If a file is specified, the documentation is written into and the output format is determined depending on the filename suffix. Supported are man page, HTML, DocBook and plain text.
--help-variable var [file]: Print help for a single variable and exit.Full documentation specific to the given variable is displayed.If a file is specified, the documentation is written into and the output format is determined depending on the filename suffix. Supported are man page, HTML, DocBook and plain text.
--help-variable-list [file]: List documented variables and exit.The list contains all variables for which help may be obtained by using the --help-variable argument followed by a variable name. If a file is specified, the help is written into it.If a file is specified, the documentation is written into and the output format is determined depending on the filename suffix. Supported are man page, HTML, DocBook and plain text.
--help-variables [file]: Print help for all variables and exit.Full documentation for all variables is displayed.If a file is specified, the documentation is written into and the output format is determined depending on the filename suffix. Supported are man page, HTML, DocBook and plain text.
--copyright [file]: Print the CMake copyright and exit.If a file is specified, the copyright is written into it.
--help,-help,-usage,-h,-H,/?: Print usage information and exit.Usage describes the basic command line interface and its options.
--help-full [file]: Print full help and exit.Full help displays most of the documentation provided by the UNIX man page. It is provided for use on non-UNIX platforms, but is also convenient if the man page is not installed. If a file is specified, the help is written into it.
--help-html [file]: Print full help in HTML format.This option is used by CMake authors to help produce web pages. If a file is specified, the help is written into it.
--help-man [file]: Print full help as a UNIX man page and exit.This option is used by the cmake build to generate the UNIX man page. If a file is specified, the help is written into it.
--version,-version,/V [file]: Show program name/version banner and exit.If a file is specified, the version is written into it.
NinjaUnix MakefilesCodeBlocks - NinjaCodeBlocks - Unix MakefilesEclipse CDT4 - NinjaEclipse CDT4 - Unix MakefilesKDevelop3KDevelop3 - Unix MakefilesThe following generators are available on this platform:
Ninja: Generates build.ninja files (experimental).A build.ninja file is generated into the build tree. Recent versions of the ninja program can build the project through the "all" target. An "install" target is also provided.
Unix Makefiles: Generates standard UNIX makefiles.A hierarchy of UNIX makefiles is generated into the build tree. Any standard UNIX-style make program can build the project through the default make target. A "make install" target is also provided.
CodeBlocks - Ninja: Generates CodeBlocks project files.Project files for CodeBlocks will be created in the top directory and in every subdirectory which features a CMakeLists.txt file containing a PROJECT() call. Additionally a hierarchy of makefiles is generated into the build tree. The appropriate make program can build the project through the default make target. A "make install" target is also provided.
CodeBlocks - Unix Makefiles: Generates CodeBlocks project files.Project files for CodeBlocks will be created in the top directory and in every subdirectory which features a CMakeLists.txt file containing a PROJECT() call. Additionally a hierarchy of makefiles is generated into the build tree. The appropriate make program can build the project through the default make target. A "make install" target is also provided.
Eclipse CDT4 - Ninja: Generates Eclipse CDT 4.0 project files.Project files for Eclipse will be created in the top directory. In out of source builds, a linked resource to the top level source directory will be created.Additionally a hierarchy of makefiles is generated into the build tree. The appropriate make program can build the project through the default make target. A "make install" target is also provided.
Eclipse CDT4 - Unix Makefiles: Generates Eclipse CDT 4.0 project files.Project files for Eclipse will be created in the top directory. In out of source builds, a linked resource to the top level source directory will be created.Additionally a hierarchy of makefiles is generated into the build tree. The appropriate make program can build the project through the default make target. A "make install" target is also provided.
KDevelop3: Generates KDevelop 3 project files.Project files for KDevelop 3 will be created in the top directory and in every subdirectory which features a CMakeLists.txt file containing a PROJECT() call. If you change the settings using KDevelop cmake will try its best to keep your changes when regenerating the project files. Additionally a hierarchy of UNIX makefiles is generated into the build tree. Any standard UNIX-style make program can build the project through the default make target. A "make install" target is also provided.
KDevelop3 - Unix Makefiles: Generates KDevelop 3 project files.Project files for KDevelop 3 will be created in the top directory and in every subdirectory which features a CMakeLists.txt file containing a PROJECT() call. If you change the settings using KDevelop cmake will try its best to keep your changes when regenerating the project files. Additionally a hierarchy of UNIX makefiles is generated into the build tree. Any standard UNIX-style make program can build the project through the default make target. A "make install" target is also provided.
add_custom_commandadd_custom_targetadd_definitionsadd_dependenciesadd_executableadd_libraryadd_subdirectoryadd_testaux_source_directorybreakbuild_commandcmake_minimum_requiredcmake_policyconfigure_filecreate_test_sourcelistdefine_propertyelseelseifenable_languageenable_testingendforeachendfunctionendifendmacroendwhileexecute_processexportfilefind_filefind_libraryfind_packagefind_pathfind_programfltk_wrap_uiforeachfunctionget_cmake_propertyget_directory_propertyget_filename_componentget_propertyget_source_file_propertyget_target_propertyget_test_propertyifincludeinclude_directoriesinclude_external_msprojectinclude_regular_expressioninstalllink_directorieslistload_cacheload_commandmacromark_as_advancedmathmessageoptionprojectqt_wrap_cppqt_wrap_uiremove_definitionsreturnseparate_argumentssetset_directory_propertiesset_propertyset_source_files_propertiesset_target_propertiesset_tests_propertiessite_namesource_groupstringtarget_link_librariestry_compiletry_rununsetvariable_watchwhileadd_custom_command: Add a custom build rule to the generated build system.There are two main signatures for add_custom_command The first signature is for adding a custom command to produce an output.
add_custom_command(OUTPUT output1 [output2 ...]
COMMAND command1 [ARGS] [args1...]
[COMMAND command2 [ARGS] [args2...] ...]
[MAIN_DEPENDENCY depend]
[DEPENDS [depends...]]
[IMPLICIT_DEPENDS <lang1> depend1 ...]
[WORKING_DIRECTORY dir]
[COMMENT comment] [VERBATIM] [APPEND])
This defines a command to generate specified OUTPUT file(s). A target created in the same directory (CMakeLists.txt file) that specifies any output of the custom command as a source file is given a rule to generate the file using the command at build time. Do not list the output in more than one independent target that may build in parallel or the two instances of the rule may conflict (instead use add_custom_target to drive the command and make the other targets depend on that one). If an output name is a relative path it will be interpreted relative to the build tree directory corresponding to the current source directory. Note that MAIN_DEPENDENCY is completely optional and is used as a suggestion to visual studio about where to hang the custom command. In makefile terms this creates a new target in the following form:
OUTPUT: MAIN_DEPENDENCY DEPENDS
COMMAND
If more than one command is specified they will be executed in order. The optional ARGS argument is for backward compatibility and will be ignored.
The second signature adds a custom command to a target such as a library or executable. This is useful for performing an operation before or after building the target. The command becomes part of the target and will only execute when the target itself is built. If the target is already built, the command will not execute.
add_custom_command(TARGET target
PRE_BUILD | PRE_LINK | POST_BUILD
COMMAND command1 [ARGS] [args1...]
[COMMAND command2 [ARGS] [args2...] ...]
[WORKING_DIRECTORY dir]
[COMMENT comment] [VERBATIM])
This defines a new command that will be associated with building the specified target. When the command will happen is determined by which of the following is specified:
PRE_BUILD - run before all other dependencies
PRE_LINK - run after other dependencies
POST_BUILD - run after the target has been built
Note that the PRE_BUILD option is only supported on Visual Studio 7 or later. For all other generators PRE_BUILD will be treated as PRE_LINK.
If WORKING_DIRECTORY is specified the command will be executed in the directory given. If it is a relative path it will be interpreted relative to the build tree directory corresponding to the current source directory. If COMMENT is set, the value will be displayed as a message before the commands are executed at build time. If APPEND is specified the COMMAND and DEPENDS option values are appended to the custom command for the first output specified. There must have already been a previous call to this command with the same output. The COMMENT, WORKING_DIRECTORY, and MAIN_DEPENDENCY options are currently ignored when APPEND is given, but may be used in the future.
If VERBATIM is given then all arguments to the commands will be escaped properly for the build tool so that the invoked command receives each argument unchanged. Note that one level of escapes is still used by the CMake language processor before add_custom_command even sees the arguments. Use of VERBATIM is recommended as it enables correct behavior. When VERBATIM is not given the behavior is platform specific because there is no protection of tool-specific special characters.
If the output of the custom command is not actually created as a file on disk it should be marked as SYMBOLIC with SET_SOURCE_FILES_PROPERTIES.
The IMPLICIT_DEPENDS option requests scanning of implicit dependencies of an input file. The language given specifies the programming language whose corresponding dependency scanner should be used. Currently only C and CXX language scanners are supported. Dependencies discovered from the scanning are added to those of the custom command at build time. Note that the IMPLICIT_DEPENDS option is currently supported only for Makefile generators and will be ignored by other generators.
If COMMAND specifies an executable target (created by ADD_EXECUTABLE) it will automatically be replaced by the location of the executable created at build time. Additionally a target-level dependency will be added so that the executable target will be built before any target using this custom command. However this does NOT add a file-level dependency that would cause the custom command to re-run whenever the executable is recompiled.
Arguments to COMMAND may use "generator expressions" with the syntax "$<...>". Generator expressions are evaluted during build system generation to produce information specific to each build configuration. Valid expressions are:
$<CONFIGURATION> = configuration name
$<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)
$<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)
$<TARGET_SONAME_FILE:tgt> = file with soname (.so.3)
where "tgt" is the name of a target. Target file expressions produce a full path, but _DIR and _NAME versions can produce the directory and file name components:
$<TARGET_FILE_DIR:tgt>/$<TARGET_FILE_NAME:tgt>
$<TARGET_LINKER_FILE_DIR:tgt>/$<TARGET_LINKER_FILE_NAME:tgt>
$<TARGET_SONAME_FILE_DIR:tgt>/$<TARGET_SONAME_FILE_NAME:tgt>
References to target names in generator expressions imply target-level dependencies, but NOT file-level dependencies. List target names with the DEPENDS option to add file dependencies.
The DEPENDS option specifies files on which the command depends. If any dependency is an OUTPUT of another custom command in the same directory (CMakeLists.txt file) CMake automatically brings the other custom command into the target in which this command is built. If DEPENDS is not specified the command will run whenever the OUTPUT is missing; if the command does not actually create the OUTPUT then the rule will always run. If DEPENDS specifies any target (created by an ADD_* command) a target-level dependency is created to make sure the target is built before any target using this custom command. Additionally, if the target is an executable or library a file-level dependency is created to cause the custom command to re-run whenever the target is recompiled.
add_custom_target: Add a target with no output so it will always be built.add_custom_target(Name [ALL] [command1 [args1...]]
[COMMAND command2 [args2...] ...]
[DEPENDS depend depend depend ... ]
[WORKING_DIRECTORY dir]
[COMMENT comment] [VERBATIM]
[SOURCES src1 [src2...]])
Adds a target with the given name that executes the given commands. The target has no output file and is ALWAYS CONSIDERED OUT OF DATE even if the commands try to create a file with the name of the target. Use ADD_CUSTOM_COMMAND to generate a file with dependencies. By default nothing depends on the custom target. Use ADD_DEPENDENCIES to add dependencies to or from other targets. If the ALL option is specified it indicates that this target should be added to the default build target so that it will be run every time (the command cannot be called ALL). The command and arguments are optional and if not specified an empty target will be created. If WORKING_DIRECTORY is set, then the command will be run in that directory. If it is a relative path it will be interpreted relative to the build tree directory corresponding to the current source directory. If COMMENT is set, the value will be displayed as a message before the commands are executed at build time. Dependencies listed with the DEPENDS argument may reference files and outputs of custom commands created with add_custom_command() in the same directory (CMakeLists.txt file).
If VERBATIM is given then all arguments to the commands will be escaped properly for the build tool so that the invoked command receives each argument unchanged. Note that one level of escapes is still used by the CMake language processor before add_custom_target even sees the arguments. Use of VERBATIM is recommended as it enables correct behavior. When VERBATIM is not given the behavior is platform specific because there is no protection of tool-specific special characters.
The SOURCES option specifies additional source files to be included in the custom target. Specified source files will be added to IDE project files for convenience in editing even if they have not build rules.
add_definitions: Adds -D define flags to the compilation of source files.add_definitions(-DFOO -DBAR ...)
Adds flags to the compiler command line for sources in the current directory and below. This command can be used to add any flags, but it was originally intended to add preprocessor definitions. Flags beginning in -D or /D that look like preprocessor definitions are automatically added to the COMPILE_DEFINITIONS property for the current directory. Definitions with non-trival values may be left in the set of flags instead of being converted for reasons of backwards compatibility. See documentation of the directory, target, and source file COMPILE_DEFINITIONS properties for details on adding preprocessor definitions to specific scopes and configurations.
add_dependencies: Add a dependency between top-level targets.add_dependencies(target-name depend-target1
depend-target2 ...)
Make a top-level target depend on other top-level targets. A top-level target is one created by ADD_EXECUTABLE, ADD_LIBRARY, or ADD_CUSTOM_TARGET. Adding dependencies with this command can be used to make sure one target is built before another target. Dependencies added to an IMPORTED target are followed transitively in its place since the target itself does not build. See the DEPENDS option of ADD_CUSTOM_TARGET and ADD_CUSTOM_COMMAND for adding file-level dependencies in custom rules. See the OBJECT_DEPENDS option in SET_SOURCE_FILES_PROPERTIES to add file-level dependencies to object files.
add_executable: Add an executable to the project using the specified source files.add_executable(<name> [WIN32] [MACOSX_BUNDLE]
[EXCLUDE_FROM_ALL]
source1 source2 ... sourceN)
Adds an executable target called <name> to be built from the source files listed in the command invocation. The <name> corresponds to the logical target name and must be globally unique within a project. The actual file name of the executable built is constructed based on conventions of the native platform (such as <name>.exe or just <name>).
By default the executable file will be created in the build tree directory corresponding to the source tree directory in which the command was invoked. See documentation of the RUNTIME_OUTPUT_DIRECTORY target property to change this location. See documentation of the OUTPUT_NAME target property to change the <name> part of the final file name.
If WIN32 is given the property WIN32_EXECUTABLE will be set on the target created. See documentation of that target property for details.
If MACOSX_BUNDLE is given the corresponding property will be set on the created target. See documentation of the MACOSX_BUNDLE target property for details.
If EXCLUDE_FROM_ALL is given the corresponding property will be set on the created target. See documentation of the EXCLUDE_FROM_ALL target property for details.
The add_executable command can also create IMPORTED executable targets using this signature:
add_executable(<name> IMPORTED [GLOBAL])
An IMPORTED executable target references an executable file located outside the project. No rules are generated to build it. The target name has scope in the directory in which it is created and below, but the GLOBAL option extends visibility. It may be referenced like any target built within the project. IMPORTED executables are useful for convenient reference from commands like add_custom_command. Details about the imported executable are specified by setting properties whose names begin in "IMPORTED_". The most important such property is IMPORTED_LOCATION (and its per-configuration version IMPORTED_LOCATION_<CONFIG>) which specifies the location of the main executable file on disk. See documentation of the IMPORTED_* properties for more information.
add_library: Add a library to the project using the specified source files.add_library(<name> [STATIC | SHARED | MODULE]
[EXCLUDE_FROM_ALL]
source1 source2 ... sourceN)
Adds a library target called <name> to be built from the source files listed in the command invocation. The <name> corresponds to the logical target name and must be globally unique within a project. The actual file name of the library built is constructed based on conventions of the native platform (such as lib<name>.a or <name>.lib).
STATIC, SHARED, or MODULE may be given to specify the type of library to be created. STATIC libraries are archives of object files for use when linking other targets. SHARED libraries are linked dynamically and loaded at runtime. MODULE libraries are plugins that are not linked into other targets but may be loaded dynamically at runtime using dlopen-like functionality. If no type is given explicitly the type is STATIC or SHARED based on whether the current value of the variable BUILD_SHARED_LIBS is true.
By default the library file will be created in the build tree directory corresponding to the source tree directory in which the command was invoked. See documentation of the ARCHIVE_OUTPUT_DIRECTORY, LIBRARY_OUTPUT_DIRECTORY, and RUNTIME_OUTPUT_DIRECTORY target properties to change this location. See documentation of the OUTPUT_NAME target property to change the <name> part of the final file name.
If EXCLUDE_FROM_ALL is given the corresponding property will be set on the created target. See documentation of the EXCLUDE_FROM_ALL target property for details.
The add_library command can also create IMPORTED library targets using this signature:
add_library(<name> <SHARED|STATIC|MODULE|UNKNOWN> IMPORTED
[GLOBAL])
An IMPORTED library target references a library file located outside the project. No rules are generated to build it. The target name has scope in the directory in which it is created and below, but the GLOBAL option extends visibility. It may be referenced like any target built within the project. IMPORTED libraries are useful for convenient reference from commands like target_link_libraries. Details about the imported library are specified by setting properties whose names begin in "IMPORTED_". The most important such property is IMPORTED_LOCATION (and its per-configuration version IMPORTED_LOCATION_<CONFIG>) which specifies the location of the main library file on disk. See documentation of the IMPORTED_* properties for more information.
The signature
add_library(<name> OBJECT <src>...)
creates a special "object library" target. An object library compiles source files but does not archive or link their object files into a library. Instead other targets created by add_library or add_executable may reference the objects using an expression of the form $<TARGET_OBJECTS:objlib> as a source, where "objlib" is the object library name. For example:
add_library(... $<TARGET_OBJECTS:objlib> ...)
add_executable(... $<TARGET_OBJECTS:objlib> ...)
will include objlib's object files in a library and an executable along with those compiled from their own sources. Object libraries may contain only sources (and headers) that compile to object files. They may contain custom commands generating such sources, but not PRE_BUILD, PRE_LINK, or POST_BUILD commands. Object libraries cannot be imported, exported, installed, or linked.
add_subdirectory: Add a subdirectory to the build.add_subdirectory(source_dir [binary_dir]
[EXCLUDE_FROM_ALL])
Add a subdirectory to the build. The source_dir specifies the directory in which the source CmakeLists.txt and code files are located. If it is a relative path it will be evaluated with respect to the current directory (the typical usage), but it may also be an absolute path. The binary_dir specifies the directory in which to place the output files. If it is a relative path it will be evaluated with respect to the current output directory, but it may also be an absolute path. If binary_dir is not specified, the value of source_dir, before expanding any relative path, will be used (the typical usage). The CMakeLists.txt file in the specified source directory will be processed immediately by CMake before processing in the current input file continues beyond this command.
If the EXCLUDE_FROM_ALL argument is provided then targets in the subdirectory will not be included in the ALL target of the parent directory by default, and will be excluded from IDE project files. Users must explicitly build targets in the subdirectory. This is meant for use when the subdirectory contains a separate part of the project that is useful but not necessary, such as a set of examples. Typically the subdirectory should contain its own project() command invocation so that a full build system will be generated in the subdirectory (such as a VS IDE solution file). Note that inter-target dependencies supercede this exclusion. If a target built by the parent project depends on a target in the subdirectory, the dependee target will be included in the parent project build system to satisfy the dependency.
add_test: Add a test to the project with the specified arguments.add_test(testname Exename arg1 arg2 ... )
If the ENABLE_TESTING command has been run, this command adds a test target to the current directory. If ENABLE_TESTING has not been run, this command does nothing. The tests are run by the testing subsystem by executing Exename with the specified arguments. Exename can be either an executable built by this project or an arbitrary executable on the system (like tclsh). The test will be run with the current working directory set to the CMakeList.txt files corresponding directory in the binary tree.
add_test(NAME <name> [CONFIGURATIONS [Debug|Release|...]]
[WORKING_DIRECTORY dir]
COMMAND <command> [arg1 [arg2 ...]])
If COMMAND specifies an executable target (created by add_executable) it will automatically be replaced by the location of the executable created at build time. If a CONFIGURATIONS option is given then the test will be executed only when testing under one of the named configurations. If a WORKING_DIRECTORY option is given then the test will be executed in the given directory.
Arguments after COMMAND may use "generator expressions" with the syntax "$<...>". Generator expressions are evaluted during build system generation to produce information specific to each build configuration. Valid expressions are:
$<CONFIGURATION> = configuration name
$<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)
$<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)
$<TARGET_SONAME_FILE:tgt> = file with soname (.so.3)
where "tgt" is the name of a target. Target file expressions produce a full path, but _DIR and _NAME versions can produce the directory and file name components:
$<TARGET_FILE_DIR:tgt>/$<TARGET_FILE_NAME:tgt>
$<TARGET_LINKER_FILE_DIR:tgt>/$<TARGET_LINKER_FILE_NAME:tgt>
$<TARGET_SONAME_FILE_DIR:tgt>/$<TARGET_SONAME_FILE_NAME:tgt>
Example usage:
add_test(NAME mytest
COMMAND testDriver --config $<CONFIGURATION>
--exe $<TARGET_FILE:myexe>)
This creates a test "mytest" whose command runs a testDriver tool passing the configuration name and the full path to the executable file produced by target "myexe".
aux_source_directory: Find all source files in a directory.aux_source_directory(<dir> <variable>)
Collects the names of all the source files in the specified directory and stores the list in the <variable> provided. This command is intended to be used by projects that use explicit template instantiation. Template instantiation files can be stored in a "Templates" subdirectory and collected automatically using this command to avoid manually listing all instantiations.
It is tempting to use this command to avoid writing the list of source files for a library or executable target. While this seems to work, there is no way for CMake to generate a build system that knows when a new source file has been added. Normally the generated build system knows when it needs to rerun CMake because the CMakeLists.txt file is modified to add a new source. When the source is just added to the directory without modifying this file, one would have to manually rerun CMake to generate a build system incorporating the new file.
break: Break from an enclosing foreach or while loop.break()
Breaks from an enclosing foreach loop or while loop
build_command: Get the command line to build this project.build_command(<variable>
[CONFIGURATION <config>]
[PROJECT_NAME <projname>]
[TARGET <target>])
Sets the given <variable> to a string containing the command line for building one configuration of a target in a project using the build tool appropriate for the current CMAKE_GENERATOR.
If CONFIGURATION is omitted, CMake chooses a reasonable default value for multi-configuration generators. CONFIGURATION is ignored for single-configuration generators.
If PROJECT_NAME is omitted, the resulting command line will build the top level PROJECT in the current build tree.
If TARGET is omitted, the resulting command line will build everything, effectively using build target 'all' or 'ALL_BUILD'.
build_command(<cachevariable> <makecommand>)
This second signature is deprecated, but still available for backwards compatibility. Use the first signature instead.
Sets the given <cachevariable> to a string containing the command to build this project from the root of the build tree using the build tool given by <makecommand>. <makecommand> should be the full path to msdev, devenv, nmake, make or one of the end user build tools.
cmake_minimum_required: Set the minimum required version of cmake for a project.cmake_minimum_required(VERSION major[.minor[.patch[.tweak]]]
[FATAL_ERROR])
If the current version of CMake is lower than that required it will stop processing the project and report an error. When a version higher than 2.4 is specified the command implicitly invokes
cmake_policy(VERSION major[.minor[.patch[.tweak]]])
which sets the cmake policy version level to the version specified. When version 2.4 or lower is given the command implicitly invokes
cmake_policy(VERSION 2.4)
which enables compatibility features for CMake 2.4 and lower.
The FATAL_ERROR option is accepted but ignored by CMake 2.6 and higher. It should be specified so CMake versions 2.4 and lower fail with an error instead of just a warning.
cmake_policy: Manage CMake Policy settings.As CMake evolves it is sometimes necessary to change existing behavior in order to fix bugs or improve implementations of existing features. The CMake Policy mechanism is designed to help keep existing projects building as new versions of CMake introduce changes in behavior. Each new policy (behavioral change) is given an identifier of the form "CMP<NNNN>" where "<NNNN>" is an integer index. Documentation associated with each policy describes the OLD and NEW behavior and the reason the policy was introduced. Projects may set each policy to select the desired behavior. When CMake needs to know which behavior to use it checks for a setting specified by the project. If no setting is available the OLD behavior is assumed and a warning is produced requesting that the policy be set.
The cmake_policy command is used to set policies to OLD or NEW behavior. While setting policies individually is supported, we encourage projects to set policies based on CMake versions.
cmake_policy(VERSION major.minor[.patch[.tweak]])
Specify that the current CMake list file is written for the given version of CMake. All policies introduced in the specified version or earlier will be set to use NEW behavior. All policies introduced after the specified version will be unset (unless variable CMAKE_POLICY_DEFAULT_CMP<NNNN> sets a default). This effectively requests behavior preferred as of a given CMake version and tells newer CMake versions to warn about their new policies. The policy version specified must be at least 2.4 or the command will report an error. In order to get compatibility features supporting versions earlier than 2.4 see documentation of policy CMP0001.
cmake_policy(SET CMP<NNNN> NEW)
cmake_policy(SET CMP<NNNN> OLD)
Tell CMake to use the OLD or NEW behavior for a given policy. Projects depending on the old behavior of a given policy may silence a policy warning by setting the policy state to OLD. Alternatively one may fix the project to work with the new behavior and set the policy state to NEW.
cmake_policy(GET CMP<NNNN> <variable>)
Check whether a given policy is set to OLD or NEW behavior. The output variable value will be "OLD" or "NEW" if the policy is set, and empty otherwise.
CMake keeps policy settings on a stack, so changes made by the cmake_policy command affect only the top of the stack. A new entry on the policy stack is managed automatically for each subdirectory to protect its parents and siblings. CMake also manages a new entry for scripts loaded by include() and find_package() commands except when invoked with the NO_POLICY_SCOPE option (see also policy CMP0011). The cmake_policy command provides an interface to manage custom entries on the policy stack:
cmake_policy(PUSH)
cmake_policy(POP)
Each PUSH must have a matching POP to erase any changes. This is useful to make temporary changes to policy settings.
Functions and macros record policy settings when they are created and use the pre-record policies when they are invoked. If the function or macro implementation sets policies, the changes automatically propagate up through callers until they reach the closest nested policy stack entry.
configure_file: Copy a file to another location and modify its contents.configure_file(<input> <output>
[COPYONLY] [ESCAPE_QUOTES] [@ONLY]
[NEWLINE_STYLE [UNIX|DOS|WIN32|LF|CRLF] ])
Copies a file <input> to file <output> and substitutes variable values referenced in the file content. If <input> is a relative path it is evaluated with respect to the current source directory. The <input> must be a file, not a directory. If <output> is a relative path it is evaluated with respect to the current binary directory. If <output> names an existing directory the input file is placed in that directory with its original name.
This command replaces any variables in the input file referenced as ${VAR} or @VAR@ with their values as determined by CMake. If a variable is not defined, it will be replaced with nothing. If COPYONLY is specified, then no variable expansion will take place. If ESCAPE_QUOTES is specified then any substituted quotes will be C-style escaped. The file will be configured with the current values of CMake variables. If @ONLY is specified, only variables of the form @VAR@ will be replaces and ${VAR} will be ignored. This is useful for configuring scripts that use ${VAR}. Any occurrences of #cmakedefine VAR will be replaced with either #define VAR or /* #undef VAR */ depending on the setting of VAR in CMake. Any occurrences of #cmakedefine01 VAR will be replaced with either #define VAR 1 or #define VAR 0 depending on whether VAR evaluates to TRUE or FALSE in CMake.
With NEWLINE_STYLE the line ending could be adjusted:
'UNIX' or 'LF' for \n, 'DOS', 'WIN32' or 'CRLF' for \r\n.
COPYONLY must not be used with NEWLINE_STYLE.
create_test_sourcelist: Create a test driver and source list for building test programs.create_test_sourcelist(sourceListName driverName
test1 test2 test3
EXTRA_INCLUDE include.h
FUNCTION function)
A test driver is a program that links together many small tests into a single executable. This is useful when building static executables with large libraries to shrink the total required size. The list of source files needed to build the test driver will be in sourceListName. DriverName is the name of the test driver program. The rest of the arguments consist of a list of test source files, can be semicolon separated. Each test source file should have a function in it that is the same name as the file with no extension (foo.cxx should have int foo(int, char*[]);) DriverName will be able to call each of the tests by name on the command line. If EXTRA_INCLUDE is specified, then the next argument is included into the generated file. If FUNCTION is specified, then the next argument is taken as a function name that is passed a pointer to ac and av. This can be used to add extra command line processing to each test. The cmake variable CMAKE_TESTDRIVER_BEFORE_TESTMAIN can be set to have code that will be placed directly before calling the test main function. CMAKE_TESTDRIVER_AFTER_TESTMAIN can be set to have code that will be placed directly after the call to the test main function.
define_property: Define and document custom properties.define_property(<GLOBAL | DIRECTORY | TARGET | SOURCE |
TEST | VARIABLE | CACHED_VARIABLE>
PROPERTY <name> [INHERITED]
BRIEF_DOCS <brief-doc> [docs...]
FULL_DOCS <full-doc> [docs...])
Define one property in a scope for use with the set_property and get_property commands. This is primarily useful to associate documentation with property names that may be retrieved with the get_property command. The first argument determines the kind of scope in which the property should be used. It must be one of the following:
GLOBAL = associated with the global namespace
DIRECTORY = associated with one directory
TARGET = associated with one target
SOURCE = associated with one source file
TEST = associated with a test named with add_test
VARIABLE = documents a CMake language variable
CACHED_VARIABLE = documents a CMake cache variable
Note that unlike set_property and get_property no actual scope needs to be given; only the kind of scope is important.
The required PROPERTY option is immediately followed by the name of the property being defined.
If the INHERITED option then the get_property command will chain up to the next higher scope when the requested property is not set in the scope given to the command. DIRECTORY scope chains to GLOBAL. TARGET, SOURCE, and TEST chain to DIRECTORY.
The BRIEF_DOCS and FULL_DOCS options are followed by strings to be associated with the property as its brief and full documentation. Corresponding options to the get_property command will retrieve the documentation.
else: Starts the else portion of an if block.else(expression)
See the if command.
elseif: Starts the elseif portion of an if block.elseif(expression)
See the if command.
enable_language: Enable a language (CXX/C/Fortran/etc)enable_language(languageName [OPTIONAL] )
This command enables support for the named language in CMake. This is the same as the project command but does not create any of the extra variables that are created by the project command. Example languages are CXX, C, Fortran. If OPTIONAL is used, use the CMAKE_<languageName>_COMPILER_WORKS variable to check whether the language has been enabled successfully.
enable_testing: Enable testing for current directory and below.enable_testing()
Enables testing for this directory and below. See also the add_test command. Note that ctest expects to find a test file in the build directory root. Therefore, this command should be in the source directory root.
endforeach: Ends a list of commands in a FOREACH block.endforeach(expression)
See the FOREACH command.
endfunction: Ends a list of commands in a function block.endfunction(expression)
See the function command.
endif: Ends a list of commands in an if block.endif(expression)
See the if command.
endmacro: Ends a list of commands in a macro block.endmacro(expression)
See the macro command.
endwhile: Ends a list of commands in a while block.endwhile(expression)
See the while command.
execute_process: Execute one or more child processes.execute_process(COMMAND <cmd1> [args1...]]
[COMMAND <cmd2> [args2...] [...]]
[WORKING_DIRECTORY <directory>]
[TIMEOUT <seconds>]
[RESULT_VARIABLE <variable>]
[OUTPUT_VARIABLE <variable>]
[ERROR_VARIABLE <variable>]
[INPUT_FILE <file>]
[OUTPUT_FILE <file>]
[ERROR_FILE <file>]
[OUTPUT_QUIET]
[ERROR_QUIET]
[OUTPUT_STRIP_TRAILING_WHITESPACE]
[ERROR_STRIP_TRAILING_WHITESPACE])
Runs the given sequence of one or more commands with the standard output of each process piped to the standard input of the next. A single standard error pipe is used for all processes. If WORKING_DIRECTORY is given the named directory will be set as the current working directory of the child processes. If TIMEOUT is given the child processes will be terminated if they do not finish in the specified number of seconds (fractions are allowed). If RESULT_VARIABLE is given the variable will be set to contain the result of running the processes. This will be an integer return code from the last child or a string describing an error condition. If OUTPUT_VARIABLE or ERROR_VARIABLE are given the variable named will be set with the contents of the standard output and standard error pipes respectively. If the same variable is named for both pipes their output will be merged in the order produced. If INPUT_FILE, OUTPUT_FILE, or ERROR_FILE is given the file named will be attached to the standard input of the first process, standard output of the last process, or standard error of all processes respectively. If OUTPUT_QUIET or ERROR_QUIET is given then the standard output or standard error results will be quietly ignored. If more than one OUTPUT_* or ERROR_* option is given for the same pipe the precedence is not specified. If no OUTPUT_* or ERROR_* options are given the output will be shared with the corresponding pipes of the CMake process itself.
The execute_process command is a newer more powerful version of exec_program, but the old command has been kept for compatibility.
export: Export targets from the build tree for use by outside projects.export(TARGETS [target1 [target2 [...]]] [NAMESPACE <namespace>]
[APPEND] FILE <filename>)
Create a file <filename> that may be included by outside projects to import targets from the current project's build tree. This is useful during cross-compiling to build utility executables that can run on the host platform in one project and then import them into another project being compiled for the target platform. If the NAMESPACE option is given the <namespace> string will be prepended to all target names written to the file. If the APPEND option is given the generated code will be appended to the file instead of overwriting it. If a library target is included in the export but a target to which it links is not included the behavior is unspecified.
The file created by this command is specific to the build tree and should never be installed. See the install(EXPORT) command to export targets from an installation tree.
Do not set properties that affect the location of a target after passing it to this command. These include properties whose names match "(RUNTIME|LIBRARY|ARCHIVE)_OUTPUT_(NAME|DIRECTORY)(_<CONFIG>)?" or "(IMPLIB_)?(PREFIX|SUFFIX)". Failure to follow this rule is not diagnosed and leaves the location of the target undefined.
export(PACKAGE <name>)
Store the current build directory in the CMake user package registry for package <name>. The find_package command may consider the directory while searching for package <name>. This helps dependent projects find and use a package from the current project's build tree without help from the user. Note that the entry in the package registry that this command creates works only in conjunction with a package configuration file (<name>Config.cmake) that works with the build tree.
file: File manipulation command.file(WRITE filename "message to write"... )
file(APPEND filename "message to write"... )
file(READ filename variable [LIMIT numBytes] [OFFSET offset] [HEX])
file(<MD5|SHA1|SHA224|SHA256|SHA384|SHA512> filename variable)
file(STRINGS filename variable [LIMIT_COUNT num]
[LIMIT_INPUT numBytes] [LIMIT_OUTPUT numBytes]
[LENGTH_MINIMUM numBytes] [LENGTH_MAXIMUM numBytes]
[NEWLINE_CONSUME] [REGEX regex]
[NO_HEX_CONVERSION])
file(GLOB variable [RELATIVE path] [globbing expressions]...)
file(GLOB_RECURSE variable [RELATIVE path]
[FOLLOW_SYMLINKS] [globbing expressions]...)
file(RENAME <oldname> <newname>)
file(REMOVE [file1 ...])
file(REMOVE_RECURSE [file1 ...])
file(MAKE_DIRECTORY [directory1 directory2 ...])
file(RELATIVE_PATH variable directory file)
file(TO_CMAKE_PATH path result)
file(TO_NATIVE_PATH path result)
file(DOWNLOAD url file [INACTIVITY_TIMEOUT timeout]
[TIMEOUT timeout] [STATUS status] [LOG log] [SHOW_PROGRESS]
[EXPECTED_MD5 sum])
file(UPLOAD filename url [INACTIVITY_TIMEOUT timeout]
[TIMEOUT timeout] [STATUS status] [LOG log] [SHOW_PROGRESS])
WRITE will write a message into a file called 'filename'. It overwrites the file if it already exists, and creates the file if it does not exist.
APPEND will write a message into a file same as WRITE, except it will append it to the end of the file
READ will read the content of a file and store it into the variable. It will start at the given offset and read up to numBytes. If the argument HEX is given, the binary data will be converted to hexadecimal representation and this will be stored in the variable.
MD5, SHA1, SHA224, SHA256, SHA384, and SHA512 will compute a cryptographic hash of the content of a file.
STRINGS will parse a list of ASCII strings from a file and store it in a variable. Binary data in the file are ignored. Carriage return (CR) characters are ignored. It works also for Intel Hex and Motorola S-record files, which are automatically converted to binary format when reading them. Disable this using NO_HEX_CONVERSION.
LIMIT_COUNT sets the maximum number of strings to return. LIMIT_INPUT sets the maximum number of bytes to read from the input file. LIMIT_OUTPUT sets the maximum number of bytes to store in the output variable. LENGTH_MINIMUM sets the minimum length of a string to return. Shorter strings are ignored. LENGTH_MAXIMUM sets the maximum length of a string to return. Longer strings are split into strings no longer than the maximum length. NEWLINE_CONSUME allows newlines to be included in strings instead of terminating them.
REGEX specifies a regular expression that a string must match to be returned. Typical usage
file(STRINGS myfile.txt myfile)
stores a list in the variable "myfile" in which each item is a line from the input file.
GLOB will generate a list of all files that match the globbing expressions and store it into the variable. Globbing expressions are similar to regular expressions, but much simpler. If RELATIVE flag is specified for an expression, the results will be returned as a relative path to the given path. (We do not recommend using GLOB to collect a list of source files from your source tree. If no CMakeLists.txt file changes when a source is added or removed then the generated build system cannot know when to ask CMake to regenerate.)
Examples of globbing expressions include:
*.cxx - match all files with extension cxx
*.vt? - match all files with extension vta,...,vtz
f[3-5].txt - match files f3.txt, f4.txt, f5.txt
GLOB_RECURSE will generate a list similar to the regular GLOB, except it will traverse all the subdirectories of the matched directory and match the files. Subdirectories that are symlinks are only traversed if FOLLOW_SYMLINKS is given or cmake policy CMP0009 is not set to NEW. See cmake --help-policy CMP0009 for more information.
Examples of recursive globbing include:
/dir/*.py - match all python files in /dir and subdirectories
MAKE_DIRECTORY will create the given directories, also if their parent directories don't exist yet
RENAME moves a file or directory within a filesystem, replacing the destination atomically.
REMOVE will remove the given files, also in subdirectories
REMOVE_RECURSE will remove the given files and directories, also non-empty directories
RELATIVE_PATH will determine relative path from directory to the given file.
TO_CMAKE_PATH will convert path into a cmake style path with unix /. The input can be a single path or a system path like "$ENV{PATH}". Note the double quotes around the ENV call TO_CMAKE_PATH only takes one argument. This command will also convert the native list delimiters for a list of paths like the PATH environment variable.
TO_NATIVE_PATH works just like TO_CMAKE_PATH, but will convert from a cmake style path into the native path style \ for windows and / for UNIX.
DOWNLOAD will download the given URL to the given file. If LOG var is specified a log of the download will be put in var. If STATUS var is specified the status of the operation will be put in var. The status is returned in a list of length 2. The first element is the numeric return value for the operation, and the second element is a string value for the error. A 0 numeric error means no error in the operation. If TIMEOUT time is specified, the operation will timeout after time seconds, time should be specified as an integer. The INACTIVITY_TIMEOUT specifies an integer number of seconds of inactivity after which the operation should terminate. If EXPECTED_MD5 sum is specified, the operation will verify that the downloaded file's actual md5 sum matches the expected value. If it does not match, the operation fails with an error. If SHOW_PROGRESS is specified, progress information will be printed as status messages until the operation is complete.
UPLOAD will upload the given file to the given URL. If LOG var is specified a log of the upload will be put in var. If STATUS var is specified the status of the operation will be put in var. The status is returned in a list of length 2. The first element is the numeric return value for the operation, and the second element is a string value for the error. A 0 numeric error means no error in the operation. If TIMEOUT time is specified, the operation will timeout after time seconds, time should be specified as an integer. The INACTIVITY_TIMEOUT specifies an integer number of seconds of inactivity after which the operation should terminate. If SHOW_PROGRESS is specified, progress information will be printed as status messages until the operation is complete.
The file() command also provides COPY and INSTALL signatures:
file(<COPY|INSTALL> files... DESTINATION <dir>
[FILE_PERMISSIONS permissions...]
[DIRECTORY_PERMISSIONS permissions...]
[NO_SOURCE_PERMISSIONS] [USE_SOURCE_PERMISSIONS]
[FILES_MATCHING]
[[PATTERN <pattern> | REGEX <regex>]
[EXCLUDE] [PERMISSIONS permissions...]] [...])
The COPY signature copies files, directories, and symlinks to a destination folder. Relative input paths are evaluated with respect to the current source directory, and a relative destination is evaluated with respect to the current build directory. Copying preserves input file timestamps, and optimizes out a file if it exists at the destination with the same timestamp. Copying preserves input permissions unless explicit permissions or NO_SOURCE_PERMISSIONS are given (default is USE_SOURCE_PERMISSIONS). See the install(DIRECTORY) command for documentation of permissions, PATTERN, REGEX, and EXCLUDE options.
The INSTALL signature differs slightly from COPY: it prints status messages, and NO_SOURCE_PERMISSIONS is default. Installation scripts generated by the install() command use this signature (with some undocumented options for internal use).
find_file: Find the full path to a file.find_file(<VAR> name1 [path1 path2 ...])
This is the short-hand signature for the command that is sufficient in many cases. It is the same as find_file(<VAR> name1 [PATHS path1 path2 ...])
find_file(
<VAR>
name | NAMES name1 [name2 ...]
[HINTS path1 [path2 ... ENV var]]
[PATHS path1 [path2 ... ENV var]]
[PATH_SUFFIXES suffix1 [suffix2 ...]]
[DOC "cache documentation string"]
[NO_DEFAULT_PATH]
[NO_CMAKE_ENVIRONMENT_PATH]
[NO_CMAKE_PATH]
[NO_SYSTEM_ENVIRONMENT_PATH]
[NO_CMAKE_SYSTEM_PATH]
[CMAKE_FIND_ROOT_PATH_BOTH |
ONLY_CMAKE_FIND_ROOT_PATH |
NO_CMAKE_FIND_ROOT_PATH]
)
This command is used to find a full path to named file. A cache entry named by <VAR> is created to store the result of this command. If the full path to a file is found the result is stored in the variable and the search will not be repeated unless the variable is cleared. If nothing is found, the result will be <VAR>-NOTFOUND, and the search will be attempted again the next time find_file is invoked with the same variable. The name of the full path to a file that is searched for is specified by the names listed after the NAMES argument. Additional search locations can be specified after the PATHS argument. If ENV var is found in the HINTS or PATHS section the environment variable var will be read and converted from a system environment variable to a cmake style list of paths. For example ENV PATH would be a way to list the system path variable. The argument after DOC will be used for the documentation string in the cache. PATH_SUFFIXES specifies additional subdirectories to check below each search path.
If NO_DEFAULT_PATH is specified, then no additional paths are added to the search. If NO_DEFAULT_PATH is not specified, the search process is as follows:
1. Search paths specified in cmake-specific cache variables. These are intended to be used on the command line with a -DVAR=value. This can be skipped if NO_CMAKE_PATH is passed.
<prefix>/include for each <prefix> in CMAKE_PREFIX_PATH
CMAKE_INCLUDE_PATH
CMAKE_FRAMEWORK_PATH
2. Search paths specified in cmake-specific environment variables. These are intended to be set in the user's shell configuration. This can be skipped if NO_CMAKE_ENVIRONMENT_PATH is passed.
<prefix>/include for each <prefix> in CMAKE_PREFIX_PATH
CMAKE_INCLUDE_PATH
CMAKE_FRAMEWORK_PATH
3. Search the paths specified by the HINTS option. These should be paths computed by system introspection, such as a hint provided by the location of another item already found. Hard-coded guesses should be specified with the PATHS option.
4. Search the standard system environment variables. This can be skipped if NO_SYSTEM_ENVIRONMENT_PATH is an argument.
PATH
INCLUDE
5. Search cmake variables defined in the Platform files for the current system. This can be skipped if NO_CMAKE_SYSTEM_PATH is passed.
<prefix>/include for each <prefix> in CMAKE_SYSTEM_PREFIX_PATH
CMAKE_SYSTEM_INCLUDE_PATH
CMAKE_SYSTEM_FRAMEWORK_PATH
6. Search the paths specified by the PATHS option or in the short-hand version of the command. These are typically hard-coded guesses.
On Darwin or systems supporting OS X Frameworks, the cmake variable CMAKE_FIND_FRAMEWORK can be set to empty or one of the following:
"FIRST" - Try to find frameworks before standard
libraries or headers. This is the default on Darwin.
"LAST" - Try to find frameworks after standard
libraries or headers.
"ONLY" - Only try to find frameworks.
"NEVER" - Never try to find frameworks.
On Darwin or systems supporting OS X Application Bundles, the cmake variable CMAKE_FIND_APPBUNDLE can be set to empty or one of the following:
"FIRST" - Try to find application bundles before standard
programs. This is the default on Darwin.
"LAST" - Try to find application bundles after standard
programs.
"ONLY" - Only try to find application bundles.
"NEVER" - Never try to find application bundles.
The CMake variable CMAKE_FIND_ROOT_PATH specifies one or more directories to be prepended to all other search directories. This effectively "re-roots" the entire search under given locations. By default it is empty. It is especially useful when cross-compiling to point to the root directory of the target environment and CMake will search there too. By default at first the directories listed in CMAKE_FIND_ROOT_PATH and then the non-rooted directories will be searched. The default behavior can be adjusted by setting CMAKE_FIND_ROOT_PATH_MODE_INCLUDE. This behavior can be manually overridden on a per-call basis. By using CMAKE_FIND_ROOT_PATH_BOTH the search order will be as described above. If NO_CMAKE_FIND_ROOT_PATH is used then CMAKE_FIND_ROOT_PATH will not be used. If ONLY_CMAKE_FIND_ROOT_PATH is used then only the re-rooted directories will be searched.
The default search order is designed to be most-specific to least-specific for common use cases. Projects may override the order by simply calling the command multiple times and using the NO_* options:
find_file(<VAR> NAMES name PATHS paths... NO_DEFAULT_PATH)
find_file(<VAR> NAMES name)
Once one of the calls succeeds the result variable will be set and stored in the cache so that no call will search again.
find_library: Find a library.find_library(<VAR> name1 [path1 path2 ...])
This is the short-hand signature for the command that is sufficient in many cases. It is the same as find_library(<VAR> name1 [PATHS path1 path2 ...])
find_library(
<VAR>
name | NAMES name1 [name2 ...]
[HINTS path1 [path2 ... ENV var]]
[PATHS path1 [path2 ... ENV var]]
[PATH_SUFFIXES suffix1 [suffix2 ...]]
[DOC "cache documentation string"]
[NO_DEFAULT_PATH]
[NO_CMAKE_ENVIRONMENT_PATH]
[NO_CMAKE_PATH]
[NO_SYSTEM_ENVIRONMENT_PATH]
[NO_CMAKE_SYSTEM_PATH]
[CMAKE_FIND_ROOT_PATH_BOTH |
ONLY_CMAKE_FIND_ROOT_PATH |
NO_CMAKE_FIND_ROOT_PATH]
)
This command is used to find a library. A cache entry named by <VAR> is created to store the result of this command. If the library is found the result is stored in the variable and the search will not be repeated unless the variable is cleared. If nothing is found, the result will be <VAR>-NOTFOUND, and the search will be attempted again the next time find_library is invoked with the same variable. The name of the library that is searched for is specified by the names listed after the NAMES argument. Additional search locations can be specified after the PATHS argument. If ENV var is found in the HINTS or PATHS section the environment variable var will be read and converted from a system environment variable to a cmake style list of paths. For example ENV PATH would be a way to list the system path variable. The argument after DOC will be used for the documentation string in the cache. PATH_SUFFIXES specifies additional subdirectories to check below each search path.
If NO_DEFAULT_PATH is specified, then no additional paths are added to the search. If NO_DEFAULT_PATH is not specified, the search process is as follows:
1. Search paths specified in cmake-specific cache variables. These are intended to be used on the command line with a -DVAR=value. This can be skipped if NO_CMAKE_PATH is passed.
<prefix>/lib/<arch> if CMAKE_LIBRARY_ARCHITECTURE is set, and
<prefix>/lib for each <prefix> in CMAKE_PREFIX_PATH
CMAKE_LIBRARY_PATH
CMAKE_FRAMEWORK_PATH
2. Search paths specified in cmake-specific environment variables. These are intended to be set in the user's shell configuration. This can be skipped if NO_CMAKE_ENVIRONMENT_PATH is passed.
<prefix>/lib/<arch> if CMAKE_LIBRARY_ARCHITECTURE is set, and
<prefix>/lib for each <prefix> in CMAKE_PREFIX_PATH
CMAKE_LIBRARY_PATH
CMAKE_FRAMEWORK_PATH
3. Search the paths specified by the HINTS option. These should be paths computed by system introspection, such as a hint provided by the location of another item already found. Hard-coded guesses should be specified with the PATHS option.
4. Search the standard system environment variables. This can be skipped if NO_SYSTEM_ENVIRONMENT_PATH is an argument.
PATH
LIB
5. Search cmake variables defined in the Platform files for the current system. This can be skipped if NO_CMAKE_SYSTEM_PATH is passed.
<prefix>/lib/<arch> if CMAKE_LIBRARY_ARCHITECTURE is set, and
<prefix>/lib for each <prefix> in CMAKE_SYSTEM_PREFIX_PATH
CMAKE_SYSTEM_LIBRARY_PATH
CMAKE_SYSTEM_FRAMEWORK_PATH
6. Search the paths specified by the PATHS option or in the short-hand version of the command. These are typically hard-coded guesses.
On Darwin or systems supporting OS X Frameworks, the cmake variable CMAKE_FIND_FRAMEWORK can be set to empty or one of the following:
"FIRST" - Try to find frameworks before standard
libraries or headers. This is the default on Darwin.
"LAST" - Try to find frameworks after standard
libraries or headers.
"ONLY" - Only try to find frameworks.
"NEVER" - Never try to find frameworks.
On Darwin or systems supporting OS X Application Bundles, the cmake variable CMAKE_FIND_APPBUNDLE can be set to empty or one of the following:
"FIRST" - Try to find application bundles before standard
programs. This is the default on Darwin.
"LAST" - Try to find application bundles after standard
programs.
"ONLY" - Only try to find application bundles.
"NEVER" - Never try to find application bundles.
The CMake variable CMAKE_FIND_ROOT_PATH specifies one or more directories to be prepended to all other search directories. This effectively "re-roots" the entire search under given locations. By default it is empty. It is especially useful when cross-compiling to point to the root directory of the target environment and CMake will search there too. By default at first the directories listed in CMAKE_FIND_ROOT_PATH and then the non-rooted directories will be searched. The default behavior can be adjusted by setting CMAKE_FIND_ROOT_PATH_MODE_LIBRARY. This behavior can be manually overridden on a per-call basis. By using CMAKE_FIND_ROOT_PATH_BOTH the search order will be as described above. If NO_CMAKE_FIND_ROOT_PATH is used then CMAKE_FIND_ROOT_PATH will not be used. If ONLY_CMAKE_FIND_ROOT_PATH is used then only the re-rooted directories will be searched.
The default search order is designed to be most-specific to least-specific for common use cases. Projects may override the order by simply calling the command multiple times and using the NO_* options:
find_library(<VAR> NAMES name PATHS paths... NO_DEFAULT_PATH)
find_library(<VAR> NAMES name)
Once one of the calls succeeds the result variable will be set and stored in the cache so that no call will search again.
If the library found is a framework, then VAR will be set to the full path to the framework <fullPath>/A.framework. When a full path to a framework is used as a library, CMake will use a -framework A, and a -F<fullPath> to link the framework to the target.
If the global property FIND_LIBRARY_USE_LIB64_PATHS is set all search paths will be tested as normal, with "64/" appended, and with all matches of "lib/" replaced with "lib64/". This property is automatically set for the platforms that are known to need it if at least one of the languages supported by the PROJECT command is enabled.
find_package: Load settings for an external project.find_package(<package> [version] [EXACT] [QUIET] [MODULE]
[REQUIRED] [[COMPONENTS] [components...]]
[OPTIONAL_COMPONENTS components...]
[NO_POLICY_SCOPE])
Finds and loads settings from an external project. <package>_FOUND will be set to indicate whether the package was found. When the package is found package-specific information is provided through variables documented by the package itself. The QUIET option disables messages if the package cannot be found. The MODULE option disables the second signature documented below. The REQUIRED option stops processing with an error message if the package cannot be found.
A package-specific list of required components may be listed after the COMPONENTS option (or after the REQUIRED option if present). Additional optional components may be listed after OPTIONAL_COMPONENTS. Available components and their influence on whether a package is considered to be found are defined by the target package.
The [version] argument requests a version with which the package found should be compatible (format is major[.minor[.patch[.tweak]]]). The EXACT option requests that the version be matched exactly. If no [version] and/or component list is given to a recursive invocation inside a find-module, the corresponding arguments are forwarded automatically from the outer call (including the EXACT flag for [version]). Version support is currently provided only on a package-by-package basis (details below).
User code should generally look for packages using the above simple signature. The remainder of this command documentation specifies the full command signature and details of the search process. Project maintainers wishing to provide a package to be found by this command are encouraged to read on.
The command has two modes by which it searches for packages: "Module" mode and "Config" mode. Module mode is available when the command is invoked with the above reduced signature. CMake searches for a file called "Find<package>.cmake" in the CMAKE_MODULE_PATH followed by the CMake installation. If the file is found, it is read and processed by CMake. It is responsible for finding the package, checking the version, and producing any needed messages. Many find-modules provide limited or no support for versioning; check the module documentation. If no module is found and the MODULE option is not given the command proceeds to Config mode.
The complete Config mode command signature is:
find_package(<package> [version] [EXACT] [QUIET]
[REQUIRED] [[COMPONENTS] [components...]]
[CONFIG|NO_MODULE]
[NO_POLICY_SCOPE]
[NAMES name1 [name2 ...]]
[CONFIGS config1 [config2 ...]]
[HINTS path1 [path2 ... ]]
[PATHS path1 [path2 ... ]]
[PATH_SUFFIXES suffix1 [suffix2 ...]]
[NO_DEFAULT_PATH]
[NO_CMAKE_ENVIRONMENT_PATH]
[NO_CMAKE_PATH]
[NO_SYSTEM_ENVIRONMENT_PATH]
[NO_CMAKE_PACKAGE_REGISTRY]
[NO_CMAKE_BUILDS_PATH]
[NO_CMAKE_SYSTEM_PATH]
[NO_CMAKE_SYSTEM_PACKAGE_REGISTRY]
[CMAKE_FIND_ROOT_PATH_BOTH |
ONLY_CMAKE_FIND_ROOT_PATH |
NO_CMAKE_FIND_ROOT_PATH])
The CONFIG option may be used to skip Module mode explicitly and switch to Config mode. It is synonymous to using NO_MODULE. Config mode is also implied by use of options not specified in the reduced signature.
Config mode attempts to locate a configuration file provided by the package to be found. A cache entry called <package>_DIR is created to hold the directory containing the file. By default the command searches for a package with the name <package>. If the NAMES option is given the names following it are used instead of <package>. The command searches for a file called "<name>Config.cmake" or "<lower-case-name>-config.cmake" for each name specified. A replacement set of possible configuration file names may be given using the CONFIGS option. The search procedure is specified below. Once found, the configuration file is read and processed by CMake. Since the file is provided by the package it already knows the location of package contents. The full path to the configuration file is stored in the cmake variable <package>_CONFIG.
All configuration files which have been considered by CMake while searching for an installation of the package with an appropriate version are stored in the cmake variable <package>_CONSIDERED_CONFIGS, the associated versions in <package>_CONSIDERED_VERSIONS.
If the package configuration file cannot be found CMake will generate an error describing the problem unless the QUIET argument is specified. If REQUIRED is specified and the package is not found a fatal error is generated and the configure step stops executing. If <package>_DIR has been set to a directory not containing a configuration file CMake will ignore it and search from scratch.
When the [version] argument is given Config mode will only find a version of the package that claims compatibility with the requested version (format is major[.minor[.patch[.tweak]]]). If the EXACT option is given only a version of the package claiming an exact match of the requested version may be found. CMake does not establish any convention for the meaning of version numbers. Package version numbers are checked by "version" files provided by the packages themselves. For a candidate package configuration file "<config-file>.cmake" the corresponding version file is located next to it and named either "<config-file>-version.cmake" or "<config-file>Version.cmake". If no such version file is available then the configuration file is assumed to not be compatible with any requested version. A basic version file containing generic version matching code can be created using the macro write_basic_package_version_file(), see its documentation for more details. When a version file is found it is loaded to check the requested version number. The version file is loaded in a nested scope in which the following variables have been defined:
PACKAGE_FIND_NAME = the <package> name
PACKAGE_FIND_VERSION = full requested version string
PACKAGE_FIND_VERSION_MAJOR = major version if requested, else 0
PACKAGE_FIND_VERSION_MINOR = minor version if requested, else 0
PACKAGE_FIND_VERSION_PATCH = patch version if requested, else 0
PACKAGE_FIND_VERSION_TWEAK = tweak version if requested, else 0
PACKAGE_FIND_VERSION_COUNT = number of version components, 0 to 4
The version file checks whether it satisfies the requested version and sets these variables:
PACKAGE_VERSION = full provided version string
PACKAGE_VERSION_EXACT = true if version is exact match
PACKAGE_VERSION_COMPATIBLE = true if version is compatible
PACKAGE_VERSION_UNSUITABLE = true if unsuitable as any version
These variables are checked by the find_package command to determine whether the configuration file provides an acceptable version. They are not available after the find_package call returns. If the version is acceptable the following variables are set:
<package>_VERSION = full provided version string
<package>_VERSION_MAJOR = major version if provided, else 0
<package>_VERSION_MINOR = minor version if provided, else 0
<package>_VERSION_PATCH = patch version if provided, else 0
<package>_VERSION_TWEAK = tweak version if provided, else 0
<package>_VERSION_COUNT = number of version components, 0 to 4
and the corresponding package configuration file is loaded. When multiple package configuration files are available whose version files claim compatibility with the version requested it is unspecified which one is chosen. No attempt is made to choose a highest or closest version number.
Config mode provides an elaborate interface and search procedure. Much of the interface is provided for completeness and for use internally by find-modules loaded by Module mode. Most user code should simply call
find_package(<package> [major[.minor]] [EXACT] [REQUIRED|QUIET])
in order to find a package. Package maintainers providing CMake package configuration files are encouraged to name and install them such that the procedure outlined below will find them without requiring use of additional options.
CMake constructs a set of possible installation prefixes for the package. Under each prefix several directories are searched for a configuration file. The tables below show the directories searched. Each entry is meant for installation trees following Windows (W), UNIX (U), or Apple (A) conventions.
<prefix>/ (W)
<prefix>/(cmake|CMake)/ (W)
<prefix>/<name>*/ (W)
<prefix>/<name>*/(cmake|CMake)/ (W)
<prefix>/(lib/<arch>|lib|share)/cmake/<name>*/ (U)
<prefix>/(lib/<arch>|lib|share)/<name>*/ (U)
<prefix>/(lib/<arch>|lib|share)/<name>*/(cmake|CMake)/ (U)
On systems supporting OS X Frameworks and Application Bundles the following directories are searched for frameworks or bundles containing a configuration file:
<prefix>/<name>.framework/Resources/ (A)
<prefix>/<name>.framework/Resources/CMake/ (A)
<prefix>/<name>.framework/Versions/*/Resources/ (A)
<prefix>/<name>.framework/Versions/*/Resources/CMake/ (A)
<prefix>/<name>.app/Contents/Resources/ (A)
<prefix>/<name>.app/Contents/Resources/CMake/ (A)
In all cases the <name> is treated as case-insensitive and corresponds to any of the names specified (<package> or names given by NAMES). Paths with lib/<arch> are enabled if CMAKE_LIBRARY_ARCHITECTURE is set. If PATH_SUFFIXES is specified the suffixes are appended to each (W) or (U) directory entry one-by-one.
This set of directories is intended to work in cooperation with projects that provide configuration files in their installation trees. Directories above marked with (W) are intended for installations on Windows where the prefix may point at the top of an application's installation directory. Those marked with (U) are intended for installations on UNIX platforms where the prefix is shared by multiple packages. This is merely a convention, so all (W) and (U) directories are still searched on all platforms. Directories marked with (A) are intended for installations on Apple platforms. The cmake variables CMAKE_FIND_FRAMEWORK and CMAKE_FIND_APPBUNDLE determine the order of preference as specified below.
The set of installation prefixes is constructed using the following steps. If NO_DEFAULT_PATH is specified all NO_* options are enabled.
1. Search paths specified in cmake-specific cache variables. These are intended to be used on the command line with a -DVAR=value. This can be skipped if NO_CMAKE_PATH is passed.
CMAKE_PREFIX_PATH
CMAKE_FRAMEWORK_PATH
CMAKE_APPBUNDLE_PATH
2. Search paths specified in cmake-specific environment variables. These are intended to be set in the user's shell configuration. This can be skipped if NO_CMAKE_ENVIRONMENT_PATH is passed.
<package>_DIR
CMAKE_PREFIX_PATH
CMAKE_FRAMEWORK_PATH
CMAKE_APPBUNDLE_PATH
3. Search paths specified by the HINTS option. These should be paths computed by system introspection, such as a hint provided by the location of another item already found. Hard-coded guesses should be specified with the PATHS option.
4. Search the standard system environment variables. This can be skipped if NO_SYSTEM_ENVIRONMENT_PATH is passed. Path entries ending in "/bin" or "/sbin" are automatically converted to their parent directories.
PATH
5. Search project build trees recently configured in a CMake GUI. This can be skipped if NO_CMAKE_BUILDS_PATH is passed. It is intended for the case when a user is building multiple dependent projects one after another.
6. Search paths stored in the CMake user package registry. This can be skipped if NO_CMAKE_PACKAGE_REGISTRY is passed. On Windows a <package> may appear under registry key
HKEY_CURRENT_USER\Software\Kitware\CMake\Packages\<package>
as a REG_SZ value, with arbitrary name, that specifies the directory containing the package configuration file. On UNIX platforms a <package> may appear under the directory
~/.cmake/packages/<package>
as a file, with arbitrary name, whose content specifies the directory containing the package configuration file. See the export(PACKAGE) command to create user package registry entries for project build trees.
7. Search cmake variables defined in the Platform files for the current system. This can be skipped if NO_CMAKE_SYSTEM_PATH is passed.
CMAKE_SYSTEM_PREFIX_PATH
CMAKE_SYSTEM_FRAMEWORK_PATH
CMAKE_SYSTEM_APPBUNDLE_PATH
8. Search paths stored in the CMake system package registry. This can be skipped if NO_CMAKE_SYSTEM_PACKAGE_REGISTRY is passed. On Windows a <package> may appear under registry key
HKEY_LOCAL_MACHINE\Software\Kitware\CMake\Packages\<package>
as a REG_SZ value, with arbitrary name, that specifies the directory containing the package configuration file. There is no system package registry on non-Windows platforms.
9. Search paths specified by the PATHS option. These are typically hard-coded guesses.
On Darwin or systems supporting OS X Frameworks, the cmake variable CMAKE_FIND_FRAMEWORK can be set to empty or one of the following:
"FIRST" - Try to find frameworks before standard
libraries or headers. This is the default on Darwin.
"LAST" - Try to find frameworks after standard
libraries or headers.
"ONLY" - Only try to find frameworks.
"NEVER" - Never try to find frameworks.
On Darwin or systems supporting OS X Application Bundles, the cmake variable CMAKE_FIND_APPBUNDLE can be set to empty or one of the following:
"FIRST" - Try to find application bundles before standard
programs. This is the default on Darwin.
"LAST" - Try to find application bundles after standard
programs.
"ONLY" - Only try to find application bundles.
"NEVER" - Never try to find application bundles.
The CMake variable CMAKE_FIND_ROOT_PATH specifies one or more directories to be prepended to all other search directories. This effectively "re-roots" the entire search under given locations. By default it is empty. It is especially useful when cross-compiling to point to the root directory of the target environment and CMake will search there too. By default at first the directories listed in CMAKE_FIND_ROOT_PATH and then the non-rooted directories will be searched. The default behavior can be adjusted by setting CMAKE_FIND_ROOT_PATH_MODE_PACKAGE. This behavior can be manually overridden on a per-call basis. By using CMAKE_FIND_ROOT_PATH_BOTH the search order will be as described above. If NO_CMAKE_FIND_ROOT_PATH is used then CMAKE_FIND_ROOT_PATH will not be used. If ONLY_CMAKE_FIND_ROOT_PATH is used then only the re-rooted directories will be searched.
The default search order is designed to be most-specific to least-specific for common use cases. Projects may override the order by simply calling the command multiple times and using the NO_* options:
find_package(<package> PATHS paths... NO_DEFAULT_PATH)
find_package(<package>)
Once one of the calls succeeds the result variable will be set and stored in the cache so that no call will search again.
Every non-REQUIRED find_package() call can be disabled by setting the variable CMAKE_DISABLE_FIND_PACKAGE_<package> to TRUE. See the documentation for the CMAKE_DISABLE_FIND_PACKAGE_<package> variable for more information.
When loading a find module or package configuration file find_package defines variables to provide information about the call arguments (and restores their original state before returning):
<package>_FIND_REQUIRED = true if REQUIRED option was given
<package>_FIND_QUIETLY = true if QUIET option was given
<package>_FIND_VERSION = full requested version string
<package>_FIND_VERSION_MAJOR = major version if requested, else 0
<package>_FIND_VERSION_MINOR = minor version if requested, else 0
<package>_FIND_VERSION_PATCH = patch version if requested, else 0
<package>_FIND_VERSION_TWEAK = tweak version if requested, else 0
<package>_FIND_VERSION_COUNT = number of version components, 0 to 4
<package>_FIND_VERSION_EXACT = true if EXACT option was given
<package>_FIND_COMPONENTS = list of requested components
<package>_FIND_REQUIRED_<c> = true if component <c> is required
false if component <c> is optional
In Module mode the loaded find module is responsible to honor the request detailed by these variables; see the find module for details. In Config mode find_package handles REQUIRED, QUIET, and version options automatically but leaves it to the package configuration file to handle components in a way that makes sense for the package. The package configuration file may set <package>_FOUND to false to tell find_package that component requirements are not satisfied.
See the cmake_policy() command documentation for discussion of the NO_POLICY_SCOPE option.
find_path: Find the directory containing a file.find_path(<VAR> name1 [path1 path2 ...])
This is the short-hand signature for the command that is sufficient in many cases. It is the same as find_path(<VAR> name1 [PATHS path1 path2 ...])
find_path(
<VAR>
name | NAMES name1 [name2 ...]
[HINTS path1 [path2 ... ENV var]]
[PATHS path1 [path2 ... ENV var]]
[PATH_SUFFIXES suffix1 [suffix2 ...]]
[DOC "cache documentation string"]
[NO_DEFAULT_PATH]
[NO_CMAKE_ENVIRONMENT_PATH]
[NO_CMAKE_PATH]
[NO_SYSTEM_ENVIRONMENT_PATH]
[NO_CMAKE_SYSTEM_PATH]
[CMAKE_FIND_ROOT_PATH_BOTH |
ONLY_CMAKE_FIND_ROOT_PATH |
NO_CMAKE_FIND_ROOT_PATH]
)
This command is used to find a directory containing the named file. A cache entry named by <VAR> is created to store the result of this command. If the file in a directory is found the result is stored in the variable and the search will not be repeated unless the variable is cleared. If nothing is found, the result will be <VAR>-NOTFOUND, and the search will be attempted again the next time find_path is invoked with the same variable. The name of the file in a directory that is searched for is specified by the names listed after the NAMES argument. Additional search locations can be specified after the PATHS argument. If ENV var is found in the HINTS or PATHS section the environment variable var will be read and converted from a system environment variable to a cmake style list of paths. For example ENV PATH would be a way to list the system path variable. The argument after DOC will be used for the documentation string in the cache. PATH_SUFFIXES specifies additional subdirectories to check below each search path.
If NO_DEFAULT_PATH is specified, then no additional paths are added to the search. If NO_DEFAULT_PATH is not specified, the search process is as follows:
1. Search paths specified in cmake-specific cache variables. These are intended to be used on the command line with a -DVAR=value. This can be skipped if NO_CMAKE_PATH is passed.
<prefix>/include for each <prefix> in CMAKE_PREFIX_PATH
CMAKE_INCLUDE_PATH
CMAKE_FRAMEWORK_PATH
2. Search paths specified in cmake-specific environment variables. These are intended to be set in the user's shell configuration. This can be skipped if NO_CMAKE_ENVIRONMENT_PATH is passed.
<prefix>/include for each <prefix> in CMAKE_PREFIX_PATH
CMAKE_INCLUDE_PATH
CMAKE_FRAMEWORK_PATH
3. Search the paths specified by the HINTS option. These should be paths computed by system introspection, such as a hint provided by the location of another item already found. Hard-coded guesses should be specified with the PATHS option.
4. Search the standard system environment variables. This can be skipped if NO_SYSTEM_ENVIRONMENT_PATH is an argument.
PATH
INCLUDE
5. Search cmake variables defined in the Platform files for the current system. This can be skipped if NO_CMAKE_SYSTEM_PATH is passed.
<prefix>/include for each <prefix> in CMAKE_SYSTEM_PREFIX_PATH
CMAKE_SYSTEM_INCLUDE_PATH
CMAKE_SYSTEM_FRAMEWORK_PATH
6. Search the paths specified by the PATHS option or in the short-hand version of the command. These are typically hard-coded guesses.
On Darwin or systems supporting OS X Frameworks, the cmake variable CMAKE_FIND_FRAMEWORK can be set to empty or one of the following:
"FIRST" - Try to find frameworks before standard
libraries or headers. This is the default on Darwin.
"LAST" - Try to find frameworks after standard
libraries or headers.
"ONLY" - Only try to find frameworks.
"NEVER" - Never try to find frameworks.
On Darwin or systems supporting OS X Application Bundles, the cmake variable CMAKE_FIND_APPBUNDLE can be set to empty or one of the following:
"FIRST" - Try to find application bundles before standard
programs. This is the default on Darwin.
"LAST" - Try to find application bundles after standard
programs.
"ONLY" - Only try to find application bundles.
"NEVER" - Never try to find application bundles.
The CMake variable CMAKE_FIND_ROOT_PATH specifies one or more directories to be prepended to all other search directories. This effectively "re-roots" the entire search under given locations. By default it is empty. It is especially useful when cross-compiling to point to the root directory of the target environment and CMake will search there too. By default at first the directories listed in CMAKE_FIND_ROOT_PATH and then the non-rooted directories will be searched. The default behavior can be adjusted by setting CMAKE_FIND_ROOT_PATH_MODE_INCLUDE. This behavior can be manually overridden on a per-call basis. By using CMAKE_FIND_ROOT_PATH_BOTH the search order will be as described above. If NO_CMAKE_FIND_ROOT_PATH is used then CMAKE_FIND_ROOT_PATH will not be used. If ONLY_CMAKE_FIND_ROOT_PATH is used then only the re-rooted directories will be searched.
The default search order is designed to be most-specific to least-specific for common use cases. Projects may override the order by simply calling the command multiple times and using the NO_* options:
find_path(<VAR> NAMES name PATHS paths... NO_DEFAULT_PATH)
find_path(<VAR> NAMES name)
Once one of the calls succeeds the result variable will be set and stored in the cache so that no call will search again.
When searching for frameworks, if the file is specified as A/b.h, then the framework search will look for A.framework/Headers/b.h. If that is found the path will be set to the path to the framework. CMake will convert this to the correct -F option to include the file.
find_program: Find an executable program.find_program(<VAR> name1 [path1 path2 ...])
This is the short-hand signature for the command that is sufficient in many cases. It is the same as find_program(<VAR> name1 [PATHS path1 path2 ...])
find_program(
<VAR>
name | NAMES name1 [name2 ...]
[HINTS path1 [path2 ... ENV var]]
[PATHS path1 [path2 ... ENV var]]
[PATH_SUFFIXES suffix1 [suffix2 ...]]
[DOC "cache documentation string"]
[NO_DEFAULT_PATH]
[NO_CMAKE_ENVIRONMENT_PATH]
[NO_CMAKE_PATH]
[NO_SYSTEM_ENVIRONMENT_PATH]
[NO_CMAKE_SYSTEM_PATH]
[CMAKE_FIND_ROOT_PATH_BOTH |
ONLY_CMAKE_FIND_ROOT_PATH |
NO_CMAKE_FIND_ROOT_PATH]
)
This command is used to find a program. A cache entry named by <VAR> is created to store the result of this command. If the program is found the result is stored in the variable and the search will not be repeated unless the variable is cleared. If nothing is found, the result will be <VAR>-NOTFOUND, and the search will be attempted again the next time find_program is invoked with the same variable. The name of the program that is searched for is specified by the names listed after the NAMES argument. Additional search locations can be specified after the PATHS argument. If ENV var is found in the HINTS or PATHS section the environment variable var will be read and converted from a system environment variable to a cmake style list of paths. For example ENV PATH would be a way to list the system path variable. The argument after DOC will be used for the documentation string in the cache. PATH_SUFFIXES specifies additional subdirectories to check below each search path.
If NO_DEFAULT_PATH is specified, then no additional paths are added to the search. If NO_DEFAULT_PATH is not specified, the search process is as follows:
1. Search paths specified in cmake-specific cache variables. These are intended to be used on the command line with a -DVAR=value. This can be skipped if NO_CMAKE_PATH is passed.
<prefix>/[s]bin for each <prefix> in CMAKE_PREFIX_PATH
CMAKE_PROGRAM_PATH
CMAKE_APPBUNDLE_PATH
2. Search paths specified in cmake-specific environment variables. These are intended to be set in the user's shell configuration. This can be skipped if NO_CMAKE_ENVIRONMENT_PATH is passed.
<prefix>/[s]bin for each <prefix> in CMAKE_PREFIX_PATH
CMAKE_PROGRAM_PATH
CMAKE_APPBUNDLE_PATH
3. Search the paths specified by the HINTS option. These should be paths computed by system introspection, such as a hint provided by the location of another item already found. Hard-coded guesses should be specified with the PATHS option.
4. Search the standard system environment variables. This can be skipped if NO_SYSTEM_ENVIRONMENT_PATH is an argument.
PATH
5. Search cmake variables defined in the Platform files for the current system. This can be skipped if NO_CMAKE_SYSTEM_PATH is passed.
<prefix>/[s]bin for each <prefix> in CMAKE_SYSTEM_PREFIX_PATH
CMAKE_SYSTEM_PROGRAM_PATH
CMAKE_SYSTEM_APPBUNDLE_PATH
6. Search the paths specified by the PATHS option or in the short-hand version of the command. These are typically hard-coded guesses.
On Darwin or systems supporting OS X Frameworks, the cmake variable CMAKE_FIND_FRAMEWORK can be set to empty or one of the following:
"FIRST" - Try to find frameworks before standard
libraries or headers. This is the default on Darwin.
"LAST" - Try to find frameworks after standard
libraries or headers.
"ONLY" - Only try to find frameworks.
"NEVER" - Never try to find frameworks.
On Darwin or systems supporting OS X Application Bundles, the cmake variable CMAKE_FIND_APPBUNDLE can be set to empty or one of the following:
"FIRST" - Try to find application bundles before standard
programs. This is the default on Darwin.
"LAST" - Try to find application bundles after standard
programs.
"ONLY" - Only try to find application bundles.
"NEVER" - Never try to find application bundles.
The CMake variable CMAKE_FIND_ROOT_PATH specifies one or more directories to be prepended to all other search directories. This effectively "re-roots" the entire search under given locations. By default it is empty. It is especially useful when cross-compiling to point to the root directory of the target environment and CMake will search there too. By default at first the directories listed in CMAKE_FIND_ROOT_PATH and then the non-rooted directories will be searched. The default behavior can be adjusted by setting CMAKE_FIND_ROOT_PATH_MODE_PROGRAM. This behavior can be manually overridden on a per-call basis. By using CMAKE_FIND_ROOT_PATH_BOTH the search order will be as described above. If NO_CMAKE_FIND_ROOT_PATH is used then CMAKE_FIND_ROOT_PATH will not be used. If ONLY_CMAKE_FIND_ROOT_PATH is used then only the re-rooted directories will be searched.
The default search order is designed to be most-specific to least-specific for common use cases. Projects may override the order by simply calling the command multiple times and using the NO_* options:
find_program(<VAR> NAMES name PATHS paths... NO_DEFAULT_PATH)
find_program(<VAR> NAMES name)
Once one of the calls succeeds the result variable will be set and stored in the cache so that no call will search again.
fltk_wrap_ui: Create FLTK user interfaces Wrappers.fltk_wrap_ui(resultingLibraryName source1
source2 ... sourceN )
Produce .h and .cxx files for all the .fl and .fld files listed. The resulting .h and .cxx files will be added to a variable named resultingLibraryName_FLTK_UI_SRCS which should be added to your library.
foreach: Evaluate a group of commands for each value in a list.foreach(loop_var arg1 arg2 ...)
COMMAND1(ARGS ...)
COMMAND2(ARGS ...)
...
endforeach(loop_var)
All commands between foreach and the matching endforeach are recorded without being invoked. Once the endforeach is evaluated, the recorded list of commands is invoked once for each argument listed in the original foreach command. Before each iteration of the loop "${loop_var}" will be set as a variable with the current value in the list.
foreach(loop_var RANGE total)
foreach(loop_var RANGE start stop [step])
Foreach can also iterate over a generated range of numbers. There are three types of this iteration:
* When specifying single number, the range will have elements 0 to "total".
* When specifying two numbers, the range will have elements from the first number to the second number.
* The third optional number is the increment used to iterate from the first number to the second number.
foreach(loop_var IN [LISTS [list1 [...]]]
[ITEMS [item1 [...]]])
Iterates over a precise list of items. The LISTS option names list-valued variables to be traversed, including empty elements (an empty string is a zero-length list). The ITEMS option ends argument parsing and includes all arguments following it in the iteration.
function: Start recording a function for later invocation as a command.function(<name> [arg1 [arg2 [arg3 ...]]])
COMMAND1(ARGS ...)
COMMAND2(ARGS ...)
...
endfunction(<name>)
Define a function named <name> that takes arguments named arg1 arg2 arg3 (...). Commands listed after function, but before the matching endfunction, are not invoked until the function is invoked. When it is invoked, the commands recorded in the function are first modified by replacing formal parameters (${arg1}) with the arguments passed, and then invoked as normal commands. In addition to referencing the formal parameters you can reference the variable ARGC which will be set to the number of arguments passed into the function as well as ARGV0 ARGV1 ARGV2 ... which will have the actual values of the arguments passed in. This facilitates creating functions with optional arguments. Additionally ARGV holds the list of all arguments given to the function and ARGN holds the list of argument past the last expected argument.
See the cmake_policy() command documentation for the behavior of policies inside functions.
get_cmake_property: Get a property of the CMake instance.get_cmake_property(VAR property)
Get a property from the CMake instance. The value of the property is stored in the variable VAR. If the property is not found, VAR will be set to "NOTFOUND". Some supported properties include: VARIABLES, CACHE_VARIABLES, COMMANDS, MACROS, and COMPONENTS.
See also the more general get_property() command.
get_directory_property: Get a property of DIRECTORY scope.get_directory_property(<variable> [DIRECTORY <dir>] <prop-name>)
Store a property of directory scope in the named variable. If the property is not defined the empty-string is returned. The DIRECTORY argument specifies another directory from which to retrieve the property value. The specified directory must have already been traversed by CMake.
get_directory_property(<variable> [DIRECTORY <dir>]
DEFINITION <var-name>)
Get a variable definition from a directory. This form is useful to get a variable definition from another directory.
See also the more general get_property() command.
get_filename_component: Get a specific component of a full filename.get_filename_component(<VAR> FileName
PATH|ABSOLUTE|NAME|EXT|NAME_WE|REALPATH
[CACHE])
Set <VAR> to be the path (PATH), file name (NAME), file extension (EXT), file name without extension (NAME_WE) of FileName, the full path (ABSOLUTE), or the full path with all symlinks resolved (REALPATH). Note that the path is converted to Unix slashes format and has no trailing slashes. The longest file extension is always considered. If the optional CACHE argument is specified, the result variable is added to the cache.
get_filename_component(<VAR> FileName
PROGRAM [PROGRAM_ARGS <ARG_VAR>]
[CACHE])
The program in FileName will be found in the system search path or left as a full path. If PROGRAM_ARGS is present with PROGRAM, then any command-line arguments present in the FileName string are split from the program name and stored in <ARG_VAR>. This is used to separate a program name from its arguments in a command line string.
get_property: Get a property.get_property(<variable>
<GLOBAL |
DIRECTORY [dir] |
TARGET <target> |
SOURCE <source> |
TEST <test> |
CACHE <entry> |
VARIABLE>
PROPERTY <name>
[SET | DEFINED | BRIEF_DOCS | FULL_DOCS])
Get one property from one object in a scope. The first argument specifies the variable in which to store the result. The second argument determines the scope from which to get the property. It must be one of the following:
GLOBAL scope is unique and does not accept a name.
DIRECTORY scope defaults to the current directory but another directory (already processed by CMake) may be named by full or relative path.
TARGET scope must name one existing target.
SOURCE scope must name one source file.
TEST scope must name one existing test.
CACHE scope must name one cache entry.
VARIABLE scope is unique and does not accept a name.
The required PROPERTY option is immediately followed by the name of the property to get. If the property is not set an empty value is returned. If the SET option is given the variable is set to a boolean value indicating whether the property has been set. If the DEFINED option is given the variable is set to a boolean value indicating whether the property has been defined such as with define_property. If BRIEF_DOCS or FULL_DOCS is given then the variable is set to a string containing documentation for the requested property. If documentation is requested for a property that has not been defined NOTFOUND is returned.
get_source_file_property: Get a property for a source file.get_source_file_property(VAR file property)
Get a property from a source file. The value of the property is stored in the variable VAR. If the property is not found, VAR will be set to "NOTFOUND". Use set_source_files_properties to set property values. Source file properties usually control how the file is built. One property that is always there is LOCATION
See also the more general get_property() command.
get_target_property: Get a property from a target.get_target_property(VAR target property)
Get a property from a target. The value of the property is stored in the variable VAR. If the property is not found, VAR will be set to "NOTFOUND". Use set_target_properties to set property values. Properties are usually used to control how a target is built, but some query the target instead. This command can get properties for any target so far created. The targets do not need to be in the current CMakeLists.txt file.
See also the more general get_property() command.
get_test_property: Get a property of the test.get_test_property(test property VAR)
Get a property from the Test. The value of the property is stored in the variable VAR. If the property is not found, VAR will be set to "NOTFOUND". For a list of standard properties you can type cmake --help-property-list
See also the more general get_property() command.
if: Conditionally execute a group of commands.if(expression)
# then section.
COMMAND1(ARGS ...)
COMMAND2(ARGS ...)
...
elseif(expression2)
# elseif section.
COMMAND1(ARGS ...)
COMMAND2(ARGS ...)
...
else(expression)
# else section.
COMMAND1(ARGS ...)
COMMAND2(ARGS ...)
...
endif(expression)
Evaluates the given expression. If the result is true, the commands in the THEN section are invoked. Otherwise, the commands in the else section are invoked. The elseif and else sections are optional. You may have multiple elseif clauses. Note that the expression in the else and endif clause is optional. Long expressions can be used and there is a traditional order of precedence. Parenthetical expressions are evaluated first followed by unary operators such as EXISTS, COMMAND, and DEFINED. Then any EQUAL, LESS, GREATER, STRLESS, STRGREATER, STREQUAL, MATCHES will be evaluated. Then NOT operators and finally AND, OR operators will be evaluated. Possible expressions are:
if(<constant>)
True if the constant is 1, ON, YES, TRUE, Y, or a non-zero number. False if the constant is 0, OFF, NO, FALSE, N, IGNORE, "", or ends in the suffix '-NOTFOUND'. Named boolean constants are case-insensitive. If the argument is not one of these constants, it is treated as a variable:
if(<variable>)
True if the variable is defined to a value that is not a false constant. False otherwise. (Note macro arguments are not variables.)
if(NOT <expression>)
True if the expression is not true.
if(<expr1> AND <expr2>)
True if both expressions would be considered true individually.
if(<expr1> OR <expr2>)
True if either expression would be considered true individually.
if(COMMAND command-name)
True if the given name is a command, macro or function that can be invoked.
if(POLICY policy-id)
True if the given name is an existing policy (of the form CMP<NNNN>).
if(TARGET target-name)
True if the given name is an existing target, built or imported.
if(EXISTS file-name)
if(EXISTS directory-name)
True if the named file or directory exists. Behavior is well-defined only for full paths.
if(file1 IS_NEWER_THAN file2)
True if file1 is newer than file2 or if one of the two files doesn't exist. Behavior is well-defined only for full paths.
if(IS_DIRECTORY directory-name)
True if the given name is a directory. Behavior is well-defined only for full paths.
if(IS_SYMLINK file-name)
True if the given name is a symbolic link. Behavior is well-defined only for full paths.
if(IS_ABSOLUTE path)
True if the given path is an absolute path.
if(<variable|string> MATCHES regex)
True if the given string or variable's value matches the given regular expression.
if(<variable|string> LESS <variable|string>)
if(<variable|string> GREATER <variable|string>)
if(<variable|string> EQUAL <variable|string>)
True if the given string or variable's value is a valid number and the inequality or equality is true.
if(<variable|string> STRLESS <variable|string>)
if(<variable|string> STRGREATER <variable|string>)
if(<variable|string> STREQUAL <variable|string>)
True if the given string or variable's value is lexicographically less (or greater, or equal) than the string or variable on the right.
if(<variable|string> VERSION_LESS <variable|string>)
if(<variable|string> VERSION_EQUAL <variable|string>)
if(<variable|string> VERSION_GREATER <variable|string>)
Component-wise integer version number comparison (version format is major[.minor[.patch[.tweak]]]).
if(DEFINED <variable>)
True if the given variable is defined. It does not matter if the variable is true or false just if it has been set.
if((expression) AND (expression OR (expression)))
The expressions inside the parenthesis are evaluated first and then the remaining expression is evaluated as in the previous examples. Where there are nested parenthesis the innermost are evaluated as part of evaluating the expression that contains them.
The if command was written very early in CMake's history, predating the ${} variable evaluation syntax, and for convenience evaluates variables named by its arguments as shown in the above signatures. Note that normal variable evaluation with ${} applies before the if command even receives the arguments. Therefore code like
set(var1 OFF)
set(var2 "var1")
if(${var2})
appears to the if command as
if(var1)
and is evaluated according to the if(<variable>) case documented above. The result is OFF which is false. However, if we remove the ${} from the example then the command sees
if(var2)
which is true because var2 is defined to "var1" which is not a false constant.
Automatic evaluation applies in the other cases whenever the above-documented signature accepts <variable|string>:
1) The left hand argument to MATCHES is first checked to see if it is a defined variable, if so the variable's value is used, otherwise the original value is used.
2) If the left hand argument to MATCHES is missing it returns false without error
3) Both left and right hand arguments to LESS GREATER EQUAL are independently tested to see if they are defined variables, if so their defined values are used otherwise the original value is used.
4) Both left and right hand arguments to STRLESS STREQUAL STRGREATER are independently tested to see if they are defined variables, if so their defined values are used otherwise the original value is used.
5) Both left and right hand argumemnts to VERSION_LESS VERSION_EQUAL VERSION_GREATER are independently tested to see if they are defined variables, if so their defined values are used otherwise the original value is used.
6) The right hand argument to NOT is tested to see if it is a boolean constant, if so the value is used, otherwise it is assumed to be a variable and it is dereferenced.
7) The left and right hand arguments to AND OR are independently tested to see if they are boolean constants, if so they are used as such, otherwise they are assumed to be variables and are dereferenced.
include: Read CMake listfile code from the given file.include(<file|module> [OPTIONAL] [RESULT_VARIABLE <VAR>]
[NO_POLICY_SCOPE])
Reads CMake listfile code from the given file. Commands in the file are processed immediately as if they were written in place of the include command. If OPTIONAL is present, then no error is raised if the file does not exist. If RESULT_VARIABLE is given the variable will be set to the full filename which has been included or NOTFOUND if it failed.
If a module is specified instead of a file, the file with name <modulename>.cmake is searched first in CMAKE_MODULE_PATH, then in the CMake module directory. There is one exception to this: if the file which calls include() is located itself in the CMake module directory, then first the CMake module directory is searched and CMAKE_MODULE_PATH afterwards. See also policy CMP0017.
See the cmake_policy() command documentation for discussion of the NO_POLICY_SCOPE option.
include_directories: Add include directories to the build.include_directories([AFTER|BEFORE] [SYSTEM] dir1 dir2 ...)
Add the given directories to those the compiler uses to search for include files. These directories are added to the directory property INCLUDE_DIRECTORIES for the current CMakeLists file. They are also added to the target property INCLUDE_DIRECTORIES for each target in the current CMakeLists file. The target property values are the ones used by the generators.
By default the directories are appended onto the current list of directories. This default behavior can be changed by setting CMAKE_INCLUDE_DIRECTORIES_BEFORE to ON. By using AFTER or BEFORE explicitly, you can select between appending and prepending, independent of the default. If the SYSTEM option is given, the compiler will be told the directories are meant as system include directories on some platforms.
include_external_msproject: Include an external Microsoft project file in a workspace.include_external_msproject(projectname location
[TYPE projectTypeGUID]
[GUID projectGUID]
[PLATFORM platformName]
dep1 dep2 ...)
Includes an external Microsoft project in the generated workspace file. Currently does nothing on UNIX. This will create a target named [projectname]. This can be used in the add_dependencies command to make things depend on the external project.
TYPE, GUID and PLATFORM are optional parameters that allow one to specify the type of project, id (GUID) of the project and the name of the target platform. This is useful for projects requiring values other than the default (e.g. WIX projects). These options are not supported by the Visual Studio 6 generator.
include_regular_expression: Set the regular expression used for dependency checking.include_regular_expression(regex_match [regex_complain])
Set the regular expressions used in dependency checking. Only files matching regex_match will be traced as dependencies. Only files matching regex_complain will generate warnings if they cannot be found (standard header paths are not searched). The defaults are:
regex_match = "^.*$" (match everything)
regex_complain = "^$" (match empty string only)
install: Specify rules to run at install time.This command generates installation rules for a project. Rules specified by calls to this command within a source directory are executed in order during installation. The order across directories is not defined.
There are multiple signatures for this command. Some of them define installation properties for files and targets. Properties common to multiple signatures are covered here but they are valid only for signatures that specify them.
DESTINATION arguments specify the directory on disk to which a file will be installed. If a full path (with a leading slash or drive letter) is given it is used directly. If a relative path is given it is interpreted relative to the value of CMAKE_INSTALL_PREFIX.
PERMISSIONS arguments specify permissions for installed files. Valid permissions are OWNER_READ, OWNER_WRITE, OWNER_EXECUTE, GROUP_READ, GROUP_WRITE, GROUP_EXECUTE, WORLD_READ, WORLD_WRITE, WORLD_EXECUTE, SETUID, and SETGID. Permissions that do not make sense on certain platforms are ignored on those platforms.
The CONFIGURATIONS argument specifies a list of build configurations for which the install rule applies (Debug, Release, etc.).
The COMPONENT argument specifies an installation component name with which the install rule is associated, such as "runtime" or "development". During component-specific installation only install rules associated with the given component name will be executed. During a full installation all components are installed. If COMPONENT is not provided a default component "Unspecified" is created. The default component name may be controlled with the CMAKE_INSTALL_DEFAULT_COMPONENT_NAME variable.
The RENAME argument specifies a name for an installed file that may be different from the original file. Renaming is allowed only when a single file is installed by the command.
The OPTIONAL argument specifies that it is not an error if the file to be installed does not exist.
The TARGETS signature:
install(TARGETS targets... [EXPORT <export-name>]
[[ARCHIVE|LIBRARY|RUNTIME|FRAMEWORK|BUNDLE|
PRIVATE_HEADER|PUBLIC_HEADER|RESOURCE]
[DESTINATION <dir>]
[PERMISSIONS permissions...]
[CONFIGURATIONS [Debug|Release|...]]
[COMPONENT <component>]
[OPTIONAL] [NAMELINK_ONLY|NAMELINK_SKIP]
] [...])
The TARGETS form specifies rules for installing targets from a project. There are five kinds of target files that may be installed: ARCHIVE, LIBRARY, RUNTIME, FRAMEWORK, and BUNDLE. Executables are treated as RUNTIME targets, except that those marked with the MACOSX_BUNDLE property are treated as BUNDLE targets on OS X. Static libraries are always treated as ARCHIVE targets. Module libraries are always treated as LIBRARY targets. For non-DLL platforms shared libraries are treated as LIBRARY targets, except that those marked with the FRAMEWORK property are treated as FRAMEWORK targets on OS X. For DLL platforms the DLL part of a shared library is treated as a RUNTIME target and the corresponding import library is treated as an ARCHIVE target. All Windows-based systems including Cygwin are DLL platforms. The ARCHIVE, LIBRARY, RUNTIME, and FRAMEWORK arguments change the type of target to which the subsequent properties apply. If none is given the installation properties apply to all target types. If only one is given then only targets of that type will be installed (which can be used to install just a DLL or just an import library).
The PRIVATE_HEADER, PUBLIC_HEADER, and RESOURCE arguments cause subsequent properties to be applied to installing a FRAMEWORK shared library target's associated files on non-Apple platforms. Rules defined by these arguments are ignored on Apple platforms because the associated files are installed into the appropriate locations inside the framework folder. See documentation of the PRIVATE_HEADER, PUBLIC_HEADER, and RESOURCE target properties for details.
Either NAMELINK_ONLY or NAMELINK_SKIP may be specified as a LIBRARY option. On some platforms a versioned shared library has a symbolic link such as
lib<name>.so -> lib<name>.so.1
where "lib<name>.so.1" is the soname of the library and "lib<name>.so" is a "namelink" allowing linkers to find the library when given "-l<name>". The NAMELINK_ONLY option causes installation of only the namelink when a library target is installed. The NAMELINK_SKIP option causes installation of library files other than the namelink when a library target is installed. When neither option is given both portions are installed. On platforms where versioned shared libraries do not have namelinks or when a library is not versioned the NAMELINK_SKIP option installs the library and the NAMELINK_ONLY option installs nothing. See the VERSION and SOVERSION target properties for details on creating versioned shared libraries.
One or more groups of properties may be specified in a single call to the TARGETS form of this command. A target may be installed more than once to different locations. Consider hypothetical targets "myExe", "mySharedLib", and "myStaticLib". The code
install(TARGETS myExe mySharedLib myStaticLib
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/static)
install(TARGETS mySharedLib DESTINATION /some/full/path)
will install myExe to <prefix>/bin and myStaticLib to <prefix>/lib/static. On non-DLL platforms mySharedLib will be installed to <prefix>/lib and /some/full/path. On DLL platforms the mySharedLib DLL will be installed to <prefix>/bin and /some/full/path and its import library will be installed to <prefix>/lib/static and /some/full/path.
The EXPORT option associates the installed target files with an export called <export-name>. It must appear before any RUNTIME, LIBRARY, or ARCHIVE options. To actually install the export file itself, call install(EXPORT). See documentation of the install(EXPORT ...) signature below for details.
Installing a target with EXCLUDE_FROM_ALL set to true has undefined behavior.
The FILES signature:
install(FILES files... DESTINATION <dir>
[PERMISSIONS permissions...]
[CONFIGURATIONS [Debug|Release|...]]
[COMPONENT <component>]
[RENAME <name>] [OPTIONAL])
The FILES form specifies rules for installing files for a project. File names given as relative paths are interpreted with respect to the current source directory. Files installed by this form are by default given permissions OWNER_WRITE, OWNER_READ, GROUP_READ, and WORLD_READ if no PERMISSIONS argument is given.
The PROGRAMS signature:
install(PROGRAMS files... DESTINATION <dir>
[PERMISSIONS permissions...]
[CONFIGURATIONS [Debug|Release|...]]
[COMPONENT <component>]
[RENAME <name>] [OPTIONAL])
The PROGRAMS form is identical to the FILES form except that the default permissions for the installed file also include OWNER_EXECUTE, GROUP_EXECUTE, and WORLD_EXECUTE. This form is intended to install programs that are not targets, such as shell scripts. Use the TARGETS form to install targets built within the project.
The DIRECTORY signature:
install(DIRECTORY dirs... DESTINATION <dir>
[FILE_PERMISSIONS permissions...]
[DIRECTORY_PERMISSIONS permissions...]
[USE_SOURCE_PERMISSIONS] [OPTIONAL]
[CONFIGURATIONS [Debug|Release|...]]
[COMPONENT <component>] [FILES_MATCHING]
[[PATTERN <pattern> | REGEX <regex>]
[EXCLUDE] [PERMISSIONS permissions...]] [...])
The DIRECTORY form installs contents of one or more directories to a given destination. The directory structure is copied verbatim to the destination. The last component of each directory name is appended to the destination directory but a trailing slash may be used to avoid this because it leaves the last component empty. Directory names given as relative paths are interpreted with respect to the current source directory. If no input directory names are given the destination directory will be created but nothing will be installed into it. The FILE_PERMISSIONS and DIRECTORY_PERMISSIONS options specify permissions given to files and directories in the destination. If USE_SOURCE_PERMISSIONS is specified and FILE_PERMISSIONS is not, file permissions will be copied from the source directory structure. If no permissions are specified files will be given the default permissions specified in the FILES form of the command, and the directories will be given the default permissions specified in the PROGRAMS form of the command.
Installation of directories may be controlled with fine granularity using the PATTERN or REGEX options. These "match" options specify a globbing pattern or regular expression to match directories or files encountered within input directories. They may be used to apply certain options (see below) to a subset of the files and directories encountered. The full path to each input file or directory (with forward slashes) is matched against the expression. A PATTERN will match only complete file names: the portion of the full path matching the pattern must occur at the end of the file name and be preceded by a slash. A REGEX will match any portion of the full path but it may use '/' and '$' to simulate the PATTERN behavior. By default all files and directories are installed whether or not they are matched. The FILES_MATCHING option may be given before the first match option to disable installation of files (but not directories) not matched by any expression. For example, the code
install(DIRECTORY src/ DESTINATION include/myproj
FILES_MATCHING PATTERN "*.h")
will extract and install header files from a source tree.
Some options may follow a PATTERN or REGEX expression and are applied only to files or directories matching them. The EXCLUDE option will skip the matched file or directory. The PERMISSIONS option overrides the permissions setting for the matched file or directory. For example the code
install(DIRECTORY icons scripts/ DESTINATION share/myproj
PATTERN "CVS" EXCLUDE
PATTERN "scripts/*"
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
GROUP_EXECUTE GROUP_READ)
will install the icons directory to share/myproj/icons and the scripts directory to share/myproj. The icons will get default file permissions, the scripts will be given specific permissions, and any CVS directories will be excluded.
The SCRIPT and CODE signature:
install([[SCRIPT <file>] [CODE <code>]] [...])
The SCRIPT form will invoke the given CMake script files during installation. If the script file name is a relative path it will be interpreted with respect to the current source directory. The CODE form will invoke the given CMake code during installation. Code is specified as a single argument inside a double-quoted string. For example, the code
install(CODE "MESSAGE(\"Sample install message.\")")
will print a message during installation.
The EXPORT signature:
install(EXPORT <export-name> DESTINATION <dir>
[NAMESPACE <namespace>] [FILE <name>.cmake]
[PERMISSIONS permissions...]
[CONFIGURATIONS [Debug|Release|...]]
[COMPONENT <component>])
The EXPORT form generates and installs a CMake file containing code to import targets from the installation tree into another project. Target installations are associated with the export <export-name> using the EXPORT option of the install(TARGETS ...) signature documented above. The NAMESPACE option will prepend <namespace> to the target names as they are written to the import file. By default the generated file will be called <export-name>.cmake but the FILE option may be used to specify a different name. The value given to the FILE option must be a file name with the ".cmake" extension. If a CONFIGURATIONS option is given then the file will only be installed when one of the named configurations is installed. Additionally, the generated import file will reference only the matching target configurations. If a COMPONENT option is specified that does not match that given to the targets associated with <export-name> the behavior is undefined. If a library target is included in the export but a target to which it links is not included the behavior is unspecified.
The EXPORT form is useful to help outside projects use targets built and installed by the current project. For example, the code
install(TARGETS myexe EXPORT myproj DESTINATION bin)
install(EXPORT myproj NAMESPACE mp_ DESTINATION lib/myproj)
will install the executable myexe to <prefix>/bin and code to import it in the file "<prefix>/lib/myproj/myproj.cmake". An outside project may load this file with the include command and reference the myexe executable from the installation tree using the imported target name mp_myexe as if the target were built in its own tree.
NOTE: This command supercedes the INSTALL_TARGETS command and the target properties PRE_INSTALL_SCRIPT and POST_INSTALL_SCRIPT. It also replaces the FILES forms of the INSTALL_FILES and INSTALL_PROGRAMS commands. The processing order of these install rules relative to those generated by INSTALL_TARGETS, INSTALL_FILES, and INSTALL_PROGRAMS commands is not defined.
link_directories: Specify directories in which the linker will look for libraries.link_directories(directory1 directory2 ...)
Specify the paths in which the linker should search for libraries. The command will apply only to targets created after it is called. For historical reasons, relative paths given to this command are passed to the linker unchanged (unlike many CMake commands which interpret them relative to the current source directory).
Note that this command is rarely necessary. Library locations returned by find_package() and find_library() are absolute paths. Pass these absolute library file paths directly to the target_link_libraries() command. CMake will ensure the linker finds them.
list: List operations.list(LENGTH <list> <output variable>)
list(GET <list> <element index> [<element index> ...]
<output variable>)
list(APPEND <list> <element> [<element> ...])
list(FIND <list> <value> <output variable>)
list(INSERT <list> <element_index> <element> [<element> ...])
list(REMOVE_ITEM <list> <value> [<value> ...])
list(REMOVE_AT <list> <index> [<index> ...])
list(REMOVE_DUPLICATES <list>)
list(REVERSE <list>)
list(SORT <list>)
LENGTH will return a given list's length.
GET will return list of elements specified by indices from the list.
APPEND will append elements to the list.
FIND will return the index of the element specified in the list or -1 if it wasn't found.
INSERT will insert elements to the list to the specified location.
REMOVE_AT and REMOVE_ITEM will remove items from the list. The difference is that REMOVE_ITEM will remove the given items, while REMOVE_AT will remove the items at the given indices.
REMOVE_DUPLICATES will remove duplicated items in the list.
REVERSE reverses the contents of the list in-place.
SORT sorts the list in-place alphabetically.
The list subcommands APPEND, INSERT, REMOVE_AT, REMOVE_ITEM, REMOVE_DUPLICATES, REVERSE and SORT may create new values for the list within the current CMake variable scope. Similar to the SET command, the LIST command creates new variable values in the current scope, even if the list itself is actually defined in a parent scope. To propagate the results of these operations upwards, use SET with PARENT_SCOPE, SET with CACHE INTERNAL, or some other means of value propagation.
NOTES: A list in cmake is a ; separated group of strings. To create a list the set command can be used. For example, set(var a b c d e) creates a list with a;b;c;d;e, and set(var "a b c d e") creates a string or a list with one item in it.
When specifying index values, if <element index> is 0 or greater, it is indexed from the beginning of the list, with 0 representing the first list element. If <element index> is -1 or lesser, it is indexed from the end of the list, with -1 representing the last list element. Be careful when counting with negative indices: they do not start from 0. -0 is equivalent to 0, the first list element.
load_cache: Load in the values from another project's CMake cache.load_cache(pathToCacheFile READ_WITH_PREFIX
prefix entry1...)
Read the cache and store the requested entries in variables with their name prefixed with the given prefix. This only reads the values, and does not create entries in the local project's cache.
load_cache(pathToCacheFile [EXCLUDE entry1...]
[INCLUDE_INTERNALS entry1...])
Load in the values from another cache and store them in the local project's cache as internal entries. This is useful for a project that depends on another project built in a different tree. EXCLUDE option can be used to provide a list of entries to be excluded. INCLUDE_INTERNALS can be used to provide a list of internal entries to be included. Normally, no internal entries are brought in. Use of this form of the command is strongly discouraged, but it is provided for backward compatibility.
load_command: Load a command into a running CMake.load_command(COMMAND_NAME <loc1> [loc2 ...])
The given locations are searched for a library whose name is cmCOMMAND_NAME. If found, it is loaded as a module and the command is added to the set of available CMake commands. Usually, TRY_COMPILE is used before this command to compile the module. If the command is successfully loaded a variable named
CMAKE_LOADED_COMMAND_<COMMAND_NAME>
will be set to the full path of the module that was loaded. Otherwise the variable will not be set.
macro: Start recording a macro for later invocation as a command.macro(<name> [arg1 [arg2 [arg3 ...]]])
COMMAND1(ARGS ...)
COMMAND2(ARGS ...)
...
endmacro(<name>)
Define a macro named <name> that takes arguments named arg1 arg2 arg3 (...). Commands listed after macro, but before the matching endmacro, are not invoked until the macro is invoked. When it is invoked, the commands recorded in the macro are first modified by replacing formal parameters (${arg1}) with the arguments passed, and then invoked as normal commands. In addition to referencing the formal parameters you can reference the values ${ARGC} which will be set to the number of arguments passed into the function as well as ${ARGV0} ${ARGV1} ${ARGV2} ... which will have the actual values of the arguments passed in. This facilitates creating macros with optional arguments. Additionally ${ARGV} holds the list of all arguments given to the macro and ${ARGN} holds the list of argument past the last expected argument. Note that the parameters to a macro and values such as ARGN are not variables in the usual CMake sense. They are string replacements much like the c preprocessor would do with a macro. If you want true CMake variables you should look at the function command.
See the cmake_policy() command documentation for the behavior of policies inside macros.
mark_as_advanced: Mark cmake cached variables as advanced.mark_as_advanced([CLEAR|FORCE] VAR VAR2 VAR...)
Mark the named cached variables as advanced. An advanced variable will not be displayed in any of the cmake GUIs unless the show advanced option is on. If CLEAR is the first argument advanced variables are changed back to unadvanced. If FORCE is the first argument, then the variable is made advanced. If neither FORCE nor CLEAR is specified, new values will be marked as advanced, but if the variable already has an advanced/non-advanced state, it will not be changed.
It does nothing in script mode.
math: Mathematical expressions.math(EXPR <output variable> <math expression>)
EXPR evaluates mathematical expression and return result in the output variable. Example mathematical expression is '5 * ( 10 + 13 )'. Supported operators are + - * / % | & ^ ~ << >> * / %. They have the same meaning as they do in c code.
message: Display a message to the user.message([STATUS|WARNING|AUTHOR_WARNING|FATAL_ERROR|SEND_ERROR]
"message to display" ...)
The optional keyword determines the type of message:
(none) = Important information
STATUS = Incidental information
WARNING = CMake Warning, continue processing
AUTHOR_WARNING = CMake Warning (dev), continue processing
SEND_ERROR = CMake Error, continue but skip generation
FATAL_ERROR = CMake Error, stop all processing
The CMake command-line tool displays STATUS messages on stdout and all other message types on stderr. The CMake GUI displays all messages in its log area. The interactive dialogs (ccmake and CMakeSetup) show STATUS messages one at a time on a status line and other messages in interactive pop-up boxes.
CMake Warning and Error message text displays using a simple markup language. Non-indented text is formatted in line-wrapped paragraphs delimited by newlines. Indented text is considered pre-formatted.
option: Provides an option that the user can optionally select.option(<option_variable> "help string describing option"
[initial value])
Provide an option for the user to select as ON or OFF. If no initial value is provided, OFF is used.
If you have options that depend on the values of other options, see the module help for CMakeDependentOption.
project: Set a name for the entire project.project(<projectname> [languageName1 languageName2 ... ] )
Sets the name of the project. Additionally this sets the variables <projectName>_BINARY_DIR and <projectName>_SOURCE_DIR to the respective values.
Optionally you can specify which languages your project supports. Example languages are CXX (i.e. C++), C, Fortran, etc. By default C and CXX are enabled. E.g. if you do not have a C++ compiler, you can disable the check for it by explicitly listing the languages you want to support, e.g. C. By using the special language "NONE" all checks for any language can be disabled. If a variable exists called CMAKE_PROJECT_<projectName>_INCLUDE, the file pointed to by that variable will be included as the last step of the project command.
qt_wrap_cpp: Create Qt Wrappers.qt_wrap_cpp(resultingLibraryName DestName
SourceLists ...)
Produce moc files for all the .h files listed in the SourceLists. The moc files will be added to the library using the DestName source list.
qt_wrap_ui: Create Qt user interfaces Wrappers.qt_wrap_ui(resultingLibraryName HeadersDestName
SourcesDestName SourceLists ...)
Produce .h and .cxx files for all the .ui files listed in the SourceLists. The .h files will be added to the library using the HeadersDestNamesource list. The .cxx files will be added to the library using the SourcesDestNamesource list.
remove_definitions: Removes -D define flags added by add_definitions.remove_definitions(-DFOO -DBAR ...)
Removes flags (added by add_definitions) from the compiler command line for sources in the current directory and below.
return: Return from a file, directory or function.return()
Returns from a file, directory or function. When this command is encountered in an included file (via include() or find_package()), it causes processing of the current file to stop and control is returned to the including file. If it is encountered in a file which is not included by another file, e.g. a CMakeLists.txt, control is returned to the parent directory if there is one. If return is called in a function, control is returned to the caller of the function. Note that a macro is not a function and does not handle return like a function does.
separate_arguments: Parse space-separated arguments into a semicolon-separated list.separate_arguments(<var> <UNIX|WINDOWS>_COMMAND "<args>")
Parses a unix- or windows-style command-line string "<args>" and stores a semicolon-separated list of the arguments in <var>. The entire command line must be given in one "<args>" argument.
The UNIX_COMMAND mode separates arguments by unquoted whitespace. It recognizes both single-quote and double-quote pairs. A backslash escapes the next literal character (\" is "); there are no special escapes (\n is just n).
The WINDOWS_COMMAND mode parses a windows command-line using the same syntax the runtime library uses to construct argv at startup. It separates arguments by whitespace that is not double-quoted. Backslashes are literal unless they precede double-quotes. See the MSDN article "Parsing C Command-Line Arguments" for details.
separate_arguments(VARIABLE)
Convert the value of VARIABLE to a semi-colon separated list. All spaces are replaced with ';'. This helps with generating command lines.
set: Set a CMake, cache or environment variable to a given value.set(<variable> <value>
[[CACHE <type> <docstring> [FORCE]] | PARENT_SCOPE])
Within CMake sets <variable> to the value <value>. <value> is expanded before <variable> is set to it. Normally, set will set a regular CMake variable. If CACHE is present, then the <variable> is put in the cache instead, unless it is already in the cache. See section 'Variable types in CMake' below for details of regular and cache variables and their interactions. If CACHE is used, <type> and <docstring> are required. <type> is used by the CMake GUI to choose a widget with which the user sets a value. The value for <type> may be one of
FILEPATH = File chooser dialog.
PATH = Directory chooser dialog.
STRING = Arbitrary string.
BOOL = Boolean ON/OFF checkbox.
INTERNAL = No GUI entry (used for persistent variables).
If <type> is INTERNAL, the cache variable is marked as internal, and will not be shown to the user in tools like cmake-gui. This is intended for values that should be persisted in the cache, but which users should not normally change. INTERNAL implies FORCE.
Normally, set(...CACHE...) creates cache variables, but does not modify them. If FORCE is specified, the value of the cache variable is set, even if the variable is already in the cache. This should normally be avoided, as it will remove any changes to the cache variable's value by the user.
If PARENT_SCOPE is present, the variable will be set in the scope above the current scope. Each new directory or function creates a new scope. This command will set the value of a variable into the parent directory or calling function (whichever is applicable to the case at hand). PARENT_SCOPE cannot be combined with CACHE.
If <value> is not specified then the variable is removed instead of set. See also: the unset() command.
set(<variable> <value1> ... <valueN>)
In this case <variable> is set to a semicolon separated list of values.
<variable> can be an environment variable such as:
set( ENV{PATH} /home/martink )
in which case the environment variable will be set.
*** Variable types in CMake ***
In CMake there are two types of variables: normal variables and cache variables. Normal variables are meant for the internal use of the script (just like variables in most programming languages); they are not persisted across CMake runs. Cache variables (unless set with INTERNAL) are mostly intended for configuration settings where the first CMake run determines a suitable default value, which the user can then override, by editing the cache with tools such as ccmake or cmake-gui. Cache variables are stored in the CMake cache file, and are persisted across CMake runs.
Both types can exist at the same time with the same name but different values. When ${FOO} is evaluated, CMake first looks for a normal variable 'FOO' in scope and uses it if set. If and only if no normal variable exists then it falls back to the cache variable 'FOO'.
Some examples:
The code 'set(FOO "x")' sets the normal variable 'FOO'. It does not touch the cache, but it will hide any existing cache value 'FOO'.
The code 'set(FOO "x" CACHE ...)' checks for 'FOO' in the cache, ignoring any normal variable of the same name. If 'FOO' is in the cache then nothing happens to either the normal variable or the cache variable. If 'FOO' is not in the cache, then it is added to the cache.
Finally, whenever a cache variable is added or modified by a command, CMake also *removes* the normal variable of the same name from the current scope so that an immediately following evaluation of it will expose the newly cached value.
Normally projects should avoid using normal and cache variables of the same name, as this interaction can be hard to follow. However, in some situations it can be useful. One example (used by some projects):
A project has a subproject in its source tree. The child project has its own CMakeLists.txt, which is included from the parent CMakeLists.txt using add_subdirectory(). Now, if the parent and the child project provide the same option (for example a compiler option), the parent gets the first chance to add a user-editable option to the cache. Normally, the child would then use the same value that the parent uses. However, it may be necessary to hard-code the value for the child project's option while still allowing the user to edit the value used by the parent project. The parent project can achieve this simply by setting a normal variable with the same name as the option in a scope sufficient to hide the option's cache variable from the child completely. The parent has already set the cache variable, so the child's set(...CACHE...) will do nothing, and evaluating the option variable will use the value from the normal variable, which hides the cache variable.
set_directory_properties: Set a property of the directory.set_directory_properties(PROPERTIES prop1 value1 prop2 value2)
Set a property for the current directory and subdirectories. If the property is not found, CMake will report an error. The properties include: INCLUDE_DIRECTORIES, LINK_DIRECTORIES, INCLUDE_REGULAR_EXPRESSION, and ADDITIONAL_MAKE_CLEAN_FILES. ADDITIONAL_MAKE_CLEAN_FILES is a list of files that will be cleaned as a part of "make clean" stage.
set_property: Set a named property in a given scope.set_property(<GLOBAL |
DIRECTORY [dir] |
TARGET [target1 [target2 ...]] |
SOURCE [src1 [src2 ...]] |
TEST [test1 [test2 ...]] |
CACHE [entry1 [entry2 ...]]>
[APPEND] [APPEND_STRING]
PROPERTY <name> [value1 [value2 ...]])
Set one property on zero or more objects of a scope. The first argument determines the scope in which the property is set. It must be one of the following:
GLOBAL scope is unique and does not accept a name.
DIRECTORY scope defaults to the current directory but another directory (already processed by CMake) may be named by full or relative path.
TARGET scope may name zero or more existing targets.
SOURCE scope may name zero or more source files. Note that source file properties are visible only to targets added in the same directory (CMakeLists.txt).
TEST scope may name zero or more existing tests.
CACHE scope must name zero or more cache existing entries.
The required PROPERTY option is immediately followed by the name of the property to set. Remaining arguments are used to compose the property value in the form of a semicolon-separated list. If the APPEND option is given the list is appended to any existing property value.If the APPEND_STRING option is given the string is append to any existing property value as string, i.e. it results in a longer string and not a list of strings.
set_source_files_properties: Source files can have properties that affect how they are built.set_source_files_properties([file1 [file2 [...]]]
PROPERTIES prop1 value1
[prop2 value2 [...]])
Set properties associated with source files using a key/value paired list. See properties documentation for those known to CMake. Unrecognized properties are ignored. Source file properties are visible only to targets added in the same directory (CMakeLists.txt).
set_target_properties: Targets can have properties that affect how they are built.set_target_properties(target1 target2 ...
PROPERTIES prop1 value1
prop2 value2 ...)
Set properties on a target. The syntax for the command is to list all the files you want to change, and then provide the values you want to set next. You can use any prop value pair you want and extract it later with the GET_TARGET_PROPERTY command.
Properties that affect the name of a target's output file are as follows. The PREFIX and SUFFIX properties override the default target name prefix (such as "lib") and suffix (such as ".so"). IMPORT_PREFIX and IMPORT_SUFFIX are the equivalent properties for the import library corresponding to a DLL (for SHARED library targets). OUTPUT_NAME sets the real name of a target when it is built and can be used to help create two targets of the same name even though CMake requires unique logical target names. There is also a <CONFIG>_OUTPUT_NAME that can set the output name on a per-configuration basis. <CONFIG>_POSTFIX sets a postfix for the real name of the target when it is built under the configuration named by <CONFIG> (in upper-case, such as "DEBUG_POSTFIX"). The value of this property is initialized when the target is created to the value of the variable CMAKE_<CONFIG>_POSTFIX (except for executable targets because earlier CMake versions which did not use this variable for executables).
The LINK_FLAGS property can be used to add extra flags to the link step of a target. LINK_FLAGS_<CONFIG> will add to the configuration <CONFIG>, for example, DEBUG, RELEASE, MINSIZEREL, RELWITHDEBINFO. DEFINE_SYMBOL sets the name of the preprocessor symbol defined when compiling sources in a shared library. If not set here then it is set to target_EXPORTS by default (with some substitutions if the target is not a valid C identifier). This is useful for headers to know whether they are being included from inside their library or outside to properly setup dllexport/dllimport decorations. The COMPILE_FLAGS property sets additional compiler flags used to build sources within the target. It may also be used to pass additional preprocessor definitions.
The LINKER_LANGUAGE property is used to change the tool used to link an executable or shared library. The default is set the language to match the files in the library. CXX and C are common values for this property.
For shared libraries VERSION and SOVERSION can be used to specify the build version and api version respectively. When building or installing appropriate symlinks are created if the platform supports symlinks and the linker supports so-names. If only one of both is specified the missing is assumed to have the same version number. For executables VERSION can be used to specify the build version. When building or installing appropriate symlinks are created if the platform supports symlinks. For shared libraries and executables on Windows the VERSION attribute is parsed to extract a "major.minor" version number. These numbers are used as the image version of the binary.
There are a few properties used to specify RPATH rules. INSTALL_RPATH is a semicolon-separated list specifying the rpath to use in installed targets (for platforms that support it). INSTALL_RPATH_USE_LINK_PATH is a boolean that if set to true will append directories in the linker search path and outside the project to the INSTALL_RPATH. SKIP_BUILD_RPATH is a boolean specifying whether to skip automatic generation of an rpath allowing the target to run from the build tree. BUILD_WITH_INSTALL_RPATH is a boolean specifying whether to link the target in the build tree with the INSTALL_RPATH. This takes precedence over SKIP_BUILD_RPATH and avoids the need for relinking before installation. INSTALL_NAME_DIR is a string specifying the directory portion of the "install_name" field of shared libraries on Mac OSX to use in the installed targets. When the target is created the values of the variables CMAKE_INSTALL_RPATH, CMAKE_INSTALL_RPATH_USE_LINK_PATH, CMAKE_SKIP_BUILD_RPATH, CMAKE_BUILD_WITH_INSTALL_RPATH, and CMAKE_INSTALL_NAME_DIR are used to initialize these properties.
PROJECT_LABEL can be used to change the name of the target in an IDE like visual studio. VS_KEYWORD can be set to change the visual studio keyword, for example QT integration works better if this is set to Qt4VSv1.0.
VS_SCC_PROJECTNAME, VS_SCC_LOCALPATH, VS_SCC_PROVIDER and VS_SCC_AUXPATH can be set to add support for source control bindings in a Visual Studio project file.
VS_GLOBAL_<variable> can be set to add a Visual Studio project-specific global variable. Qt integration works better if VS_GLOBAL_QtVersion is set to the Qt version FindQt4.cmake found. For example, "4.7.3"
The PRE_INSTALL_SCRIPT and POST_INSTALL_SCRIPT properties are the old way to specify CMake scripts to run before and after installing a target. They are used only when the old INSTALL_TARGETS command is used to install the target. Use the INSTALL command instead.
The EXCLUDE_FROM_DEFAULT_BUILD property is used by the visual studio generators. If it is set to 1 the target will not be part of the default build when you select "Build Solution".
set_tests_properties: Set a property of the tests.set_tests_properties(test1 [test2...] PROPERTIES prop1 value1 prop2 value2)
Set a property for the tests. If the property is not found, CMake will report an error. The properties include:
WILL_FAIL: If set to true, this will invert the pass/fail flag of the test.
PASS_REGULAR_EXPRESSION: If set, the test output will be checked against the specified regular expressions and at least one of the regular expressions has to match, otherwise the test will fail.
Example: PASS_REGULAR_EXPRESSION "TestPassed;All ok"
FAIL_REGULAR_EXPRESSION: If set, if the output will match to one of specified regular expressions, the test will fail.
Example: PASS_REGULAR_EXPRESSION "[^a-z]Error;ERROR;Failed"
Both PASS_REGULAR_EXPRESSION and FAIL_REGULAR_EXPRESSION expect a list of regular expressions.
TIMEOUT: Setting this will limit the test runtime to the number of seconds specified.
site_name: Set the given variable to the name of the computer.site_name(variable)
source_group: Define a grouping for sources in the makefile.source_group(name [REGULAR_EXPRESSION regex] [FILES src1 src2 ...])
Defines a group into which sources will be placed in project files. This is mainly used to setup file tabs in Visual Studio. Any file whose name is listed or matches the regular expression will be placed in this group. If a file matches multiple groups, the LAST group that explicitly lists the file will be favored, if any. If no group explicitly lists the file, the LAST group whose regular expression matches the file will be favored.
The name of the group may contain backslashes to specify subgroups:
source_group(outer\\inner ...)
For backwards compatibility, this command is also supports the format:
source_group(name regex)
string: String operations.string(REGEX MATCH <regular_expression>
<output variable> <input> [<input>...])
string(REGEX MATCHALL <regular_expression>
<output variable> <input> [<input>...])
string(REGEX REPLACE <regular_expression>
<replace_expression> <output variable>
<input> [<input>...])
string(REPLACE <match_string>
<replace_string> <output variable>
<input> [<input>...])
string(<MD5|SHA1|SHA224|SHA256|SHA384|SHA512>
<output variable> <input>)
string(COMPARE EQUAL <string1> <string2> <output variable>)
string(COMPARE NOTEQUAL <string1> <string2> <output variable>)
string(COMPARE LESS <string1> <string2> <output variable>)
string(COMPARE GREATER <string1> <string2> <output variable>)
string(ASCII <number> [<number> ...] <output variable>)
string(CONFIGURE <string1> <output variable>
[@ONLY] [ESCAPE_QUOTES])
string(TOUPPER <string1> <output variable>)
string(TOLOWER <string1> <output variable>)
string(LENGTH <string> <output variable>)
string(SUBSTRING <string> <begin> <length> <output variable>)
string(STRIP <string> <output variable>)
string(RANDOM [LENGTH <length>] [ALPHABET <alphabet>]
[RANDOM_SEED <seed>] <output variable>)
string(FIND <string> <substring> <output variable> [REVERSE])
REGEX MATCH will match the regular expression once and store the match in the output variable.
REGEX MATCHALL will match the regular expression as many times as possible and store the matches in the output variable as a list.
REGEX REPLACE will match the regular expression as many times as possible and substitute the replacement expression for the match in the output. The replace expression may refer to paren-delimited subexpressions of the match using \1, \2, ..., \9. Note that two backslashes (\\1) are required in CMake code to get a backslash through argument parsing.
REPLACE will replace all occurrences of match_string in the input with replace_string and store the result in the output.
MD5, SHA1, SHA224, SHA256, SHA384, and SHA512 will compute a cryptographic hash of the input string.
COMPARE EQUAL/NOTEQUAL/LESS/GREATER will compare the strings and store true or false in the output variable.
ASCII will convert all numbers into corresponding ASCII characters.
CONFIGURE will transform a string like CONFIGURE_FILE transforms a file.
TOUPPER/TOLOWER will convert string to upper/lower characters.
LENGTH will return a given string's length.
SUBSTRING will return a substring of a given string. If length is -1 the remainder of the string starting at begin will be returned.
STRIP will return a substring of a given string with leading and trailing spaces removed.
RANDOM will return a random string of given length consisting of characters from the given alphabet. Default length is 5 characters and default alphabet is all numbers and upper and lower case letters. If an integer RANDOM_SEED is given, its value will be used to seed the random number generator.
FIND will return the position where the given substring was found in the supplied string. If the REVERSE flag was used, the command will search for the position of the last occurrence of the specified substring.
The following characters have special meaning in regular expressions:
^ Matches at beginning of a line
$ Matches at end of a line
. Matches any single character
[ ] Matches any character(s) inside the brackets
[^ ] Matches any character(s) not inside the brackets
- Matches any character in range on either side of a dash
* Matches preceding pattern zero or more times
+ Matches preceding pattern one or more times
? Matches preceding pattern zero or once only
| Matches a pattern on either side of the |
() Saves a matched subexpression, which can be referenced
in the REGEX REPLACE operation. Additionally it is saved
by all regular expression-related commands, including
e.g. if( MATCHES ), in the variables CMAKE_MATCH_(0..9).
target_link_libraries: Link a target to given libraries.target_link_libraries(<target> [item1 [item2 [...]]]
[[debug|optimized|general] <item>] ...)
Specify libraries or flags to use when linking a given target. The named <target> must have been created in the current directory by a command such as add_executable or add_library. The remaining arguments specify library names or flags. Repeated calls for the same <target> append items in the order called.
If a library name matches that of another target in the project a dependency will automatically be added in the build system to make sure the library being linked is up-to-date before the target links. Item names starting with '-', but not '-l' or '-framework', are treated as linker flags.
A "debug", "optimized", or "general" keyword indicates that the library immediately following it is to be used only for the corresponding build configuration. The "debug" keyword corresponds to the Debug configuration (or to configurations named in the DEBUG_CONFIGURATIONS global property if it is set). The "optimized" keyword corresponds to all other configurations. The "general" keyword corresponds to all configurations, and is purely optional (assumed if omitted). Higher granularity may be achieved for per-configuration rules by creating and linking to IMPORTED library targets. See the IMPORTED mode of the add_library command for more information.
Library dependencies are transitive by default. When this target is linked into another target then the libraries linked to this target will appear on the link line for the other target too. See the LINK_INTERFACE_LIBRARIES target property to override the set of transitive link dependencies for a target.
target_link_libraries(<target> LINK_INTERFACE_LIBRARIES
[[debug|optimized|general] <lib>] ...)
The LINK_INTERFACE_LIBRARIES mode appends the libraries to the LINK_INTERFACE_LIBRARIES and its per-configuration equivalent target properties instead of using them for linking. Libraries specified as "debug" are appended to the the LINK_INTERFACE_LIBRARIES_DEBUG property (or to the properties corresponding to configurations listed in the DEBUG_CONFIGURATIONS global property if it is set). Libraries specified as "optimized" are appended to the the LINK_INTERFACE_LIBRARIES property. Libraries specified as "general" (or without any keyword) are treated as if specified for both "debug" and "optimized".
target_link_libraries(<target>
<LINK_PRIVATE|LINK_PUBLIC>
[[debug|optimized|general] <lib>] ...
[<LINK_PRIVATE|LINK_PUBLIC>
[[debug|optimized|general] <lib>] ...])
The LINK_PUBLIC and LINK_PRIVATE modes can be used to specify both the link dependencies and the link interface in one command. Libraries and targets following LINK_PUBLIC are linked to, and are made part of the LINK_INTERFACE_LIBRARIES. Libraries and targets following LINK_PRIVATE are linked to, but are not made part of the LINK_INTERFACE_LIBRARIES.
The library dependency graph is normally acyclic (a DAG), but in the case of mutually-dependent STATIC libraries CMake allows the graph to contain cycles (strongly connected components). When another target links to one of the libraries CMake repeats the entire connected component. For example, the code
add_library(A STATIC a.c)
add_library(B STATIC b.c)
target_link_libraries(A B)
target_link_libraries(B A)
add_executable(main main.c)
target_link_libraries(main A)
links 'main' to 'A B A B'. (While one repetition is usually sufficient, pathological object file and symbol arrangements can require more. One may handle such cases by manually repeating the component in the last target_link_libraries call. However, if two archives are really so interdependent they should probably be combined into a single archive.)
try_compile: Try building some code.try_compile(RESULT_VAR <bindir> <srcdir>
<projectName> [targetName] [CMAKE_FLAGS flags...]
[OUTPUT_VARIABLE <var>])
Try building a project. In this form, srcdir should contain a complete CMake project with a CMakeLists.txt file and all sources. The bindir and srcdir will not be deleted after this command is run. Specify targetName to build a specific target instead of the 'all' or 'ALL_BUILD' target.
try_compile(RESULT_VAR <bindir> <srcfile>
[CMAKE_FLAGS flags...]
[COMPILE_DEFINITIONS flags...]
[OUTPUT_VARIABLE <var>]
[COPY_FILE <fileName>])
Try building a source file into an executable. In this form the user need only supply a source file that defines a 'main'. CMake will create a CMakeLists.txt file to build the source as an executable. Specify COPY_FILE to get a copy of the linked executable at the given fileName.
In this version all files in bindir/CMakeFiles/CMakeTmp will be cleaned automatically. For debugging, --debug-trycompile can be passed to cmake to avoid this clean. However, multiple sequential try_compile operations reuse this single output directory. If you use --debug-trycompile, you can only debug one try_compile call at a time. The recommended procedure is to configure with cmake all the way through once, then delete the cache entry associated with the try_compile call of interest, and then re-run cmake again with --debug-trycompile.
Some extra flags that can be included are, INCLUDE_DIRECTORIES, LINK_DIRECTORIES, and LINK_LIBRARIES. COMPILE_DEFINITIONS are -Ddefinition that will be passed to the compile line. try_compile creates a CMakeList.txt file on the fly that looks like this:
add_definitions( <expanded COMPILE_DEFINITIONS from calling cmake>)
include_directories(${INCLUDE_DIRECTORIES})
link_directories(${LINK_DIRECTORIES})
add_executable(cmTryCompileExec sources)
target_link_libraries(cmTryCompileExec ${LINK_LIBRARIES})
In both versions of the command, if OUTPUT_VARIABLE is specified, then the output from the build process is stored in the given variable. The success or failure of the try_compile, i.e. TRUE or FALSE respectively, is returned in RESULT_VAR. CMAKE_FLAGS can be used to pass -DVAR:TYPE=VALUE flags to the cmake that is run during the build. Set variable CMAKE_TRY_COMPILE_CONFIGURATION to choose a build configuration.
try_run: Try compiling and then running some code.try_run(RUN_RESULT_VAR COMPILE_RESULT_VAR
bindir srcfile [CMAKE_FLAGS <Flags>]
[COMPILE_DEFINITIONS <flags>]
[COMPILE_OUTPUT_VARIABLE comp]
[RUN_OUTPUT_VARIABLE run]
[OUTPUT_VARIABLE var]
[ARGS <arg1> <arg2>...])
Try compiling a srcfile. Return TRUE or FALSE for success or failure in COMPILE_RESULT_VAR. Then if the compile succeeded, run the executable and return its exit code in RUN_RESULT_VAR. If the executable was built, but failed to run, then RUN_RESULT_VAR will be set to FAILED_TO_RUN. COMPILE_OUTPUT_VARIABLE specifies the variable where the output from the compile step goes. RUN_OUTPUT_VARIABLE specifies the variable where the output from the running executable goes.
For compatibility reasons OUTPUT_VARIABLE is still supported, which gives you the output from the compile and run step combined.
Cross compiling issues
When cross compiling, the executable compiled in the first step usually cannot be run on the build host. try_run() checks the CMAKE_CROSSCOMPILING variable to detect whether CMake is in crosscompiling mode. If that's the case, it will still try to compile the executable, but it will not try to run the executable. Instead it will create cache variables which must be filled by the user or by presetting them in some CMake script file to the values the executable would have produced if it would have been run on its actual target platform. These variables are RUN_RESULT_VAR (explanation see above) and if RUN_OUTPUT_VARIABLE (or OUTPUT_VARIABLE) was used, an additional cache variable RUN_RESULT_VAR__COMPILE_RESULT_VAR__TRYRUN_OUTPUT.This is intended to hold stdout and stderr from the executable.
In order to make cross compiling your project easier, use try_run only if really required. If you use try_run, use RUN_OUTPUT_VARIABLE (or OUTPUT_VARIABLE) only if really required. Using them will require that when crosscompiling, the cache variables will have to be set manually to the output of the executable. You can also "guard" the calls to try_run with if(CMAKE_CROSSCOMPILING) and provide an easy-to-preset alternative for this case.
Set variable CMAKE_TRY_COMPILE_CONFIGURATION to choose a build configuration.
unset: Unset a variable, cache variable, or environment variable.unset(<variable> [CACHE])
Removes the specified variable causing it to become undefined. If CACHE is present then the variable is removed from the cache instead of the current scope.
<variable> can be an environment variable such as:
unset(ENV{LD_LIBRARY_PATH})
in which case the variable will be removed from the current environment.
variable_watch: Watch the CMake variable for change.variable_watch(<variable name> [<command to execute>])
If the specified variable changes, the message will be printed about the variable being changed. If the command is specified, the command will be executed. The command will receive the following arguments: COMMAND(<variable> <access> <value> <current list file> <stack>)
while: Evaluate a group of commands while a condition is truewhile(condition)
COMMAND1(ARGS ...)
COMMAND2(ARGS ...)
...
endwhile(condition)
All commands between while and the matching endwhile are recorded without being invoked. Once the endwhile is evaluated, the recorded list of commands is invoked as long as the condition is true. The condition is evaluated using the same logic as the if command.
CMake Properties - Properties supported by CMake, the Cross-Platform Makefile Generator.
This is the documentation for the properties supported by CMake. Properties can have different scopes. They can either be assigned to a source file, a directory, a target or globally to CMake. By modifying the values of properties the behaviour of the build system can be customized.
ALLOW_DUPLICATE_CUSTOM_TARGETSDEBUG_CONFIGURATIONSDISABLED_FEATURESENABLED_FEATURESENABLED_LANGUAGESFIND_LIBRARY_USE_LIB64_PATHSFIND_LIBRARY_USE_OPENBSD_VERSIONINGGLOBAL_DEPENDS_DEBUG_MODEGLOBAL_DEPENDS_NO_CYCLESIN_TRY_COMPILEPACKAGES_FOUNDPACKAGES_NOT_FOUNDPREDEFINED_TARGETS_FOLDERREPORT_UNDEFINED_PROPERTIESRULE_LAUNCH_COMPILERULE_LAUNCH_CUSTOMRULE_LAUNCH_LINKRULE_MESSAGESTARGET_ARCHIVES_MAY_BE_SHARED_LIBSTARGET_SUPPORTS_SHARED_LIBSUSE_FOLDERS__CMAKE_DELETE_CACHE_CHANGE_VARS_ALLOW_DUPLICATE_CUSTOM_TARGETS: Allow duplicate custom targets to be created.Normally CMake requires that all targets built in a project have globally unique logical names (see policy CMP0002). This is necessary to generate meaningful project file names in Xcode and VS IDE generators. It also allows the target names to be referenced unambiguously.
Makefile generators are capable of supporting duplicate custom target names. For projects that care only about Makefile generators and do not wish to support Xcode or VS IDE generators, one may set this property to true to allow duplicate custom targets. The property allows multiple add_custom_target command calls in different directories to specify the same target name. However, setting this property will cause non-Makefile generators to produce an error and refuse to generate the project.
DEBUG_CONFIGURATIONS: Specify which configurations are for debugging.The value must be a semi-colon separated list of configuration names. Currently this property is used only by the target_link_libraries command (see its documentation for details). Additional uses may be defined in the future.
This property must be set at the top level of the project and before the first target_link_libraries command invocation. If any entry in the list does not match a valid configuration for the project the behavior is undefined.
DISABLED_FEATURES: List of features which are disabled during the CMake run.List of features which are disabled during the CMake run. By default it contains the names of all packages which were not found. This is determined using the <NAME>_FOUND variables. Packages which are searched QUIET are not listed. A project can add its own features to this list. This property is used by the macros in FeatureSummary.cmake.
ENABLED_FEATURES: List of features which are enabled during the CMake run.List of features which are enabled during the CMake run. By default it contains the names of all packages which were found. This is determined using the <NAME>_FOUND variables. Packages which are searched QUIET are not listed. A project can add its own features to this list. This property is used by the macros in FeatureSummary.cmake.
ENABLED_LANGUAGES: Read-only property that contains the list of currently enabled languagesSet to list of currently enabled languages.
FIND_LIBRARY_USE_LIB64_PATHS: Whether FIND_LIBRARY should automatically search lib64 directories.FIND_LIBRARY_USE_LIB64_PATHS is a boolean specifying whether the FIND_LIBRARY command should automatically search the lib64 variant of directories called lib in the search path when building 64-bit binaries.
FIND_LIBRARY_USE_OPENBSD_VERSIONING: Whether FIND_LIBRARY should find OpenBSD-style shared libraries.This property is a boolean specifying whether the FIND_LIBRARY command should find shared libraries with OpenBSD-style versioned extension: ".so.<major>.<minor>". The property is set to true on OpenBSD and false on other platforms.
GLOBAL_DEPENDS_DEBUG_MODE: Enable global target dependency graph debug mode.CMake automatically analyzes the global inter-target dependency graph at the beginning of native build system generation. This property causes it to display details of its analysis to stderr.
GLOBAL_DEPENDS_NO_CYCLES: Disallow global target dependency graph cycles.CMake automatically analyzes the global inter-target dependency graph at the beginning of native build system generation. It reports an error if the dependency graph contains a cycle that does not consist of all STATIC library targets. This property tells CMake to disallow all cycles completely, even among static libraries.
IN_TRY_COMPILE: Read-only property that is true during a try-compile configuration.True when building a project inside a TRY_COMPILE or TRY_RUN command.
PACKAGES_FOUND: List of packages which were found during the CMake run.List of packages which were found during the CMake run. Whether a package has been found is determined using the <NAME>_FOUND variables.
PACKAGES_NOT_FOUND: List of packages which were not found during the CMake run.List of packages which were not found during the CMake run. Whether a package has been found is determined using the <NAME>_FOUND variables.
PREDEFINED_TARGETS_FOLDER: Name of FOLDER for targets that are added automatically by CMake.If not set, CMake uses "CMakePredefinedTargets" as a default value for this property. Targets such as INSTALL, PACKAGE and RUN_TESTS will be organized into this FOLDER. See also the documentation for the FOLDER target property.
REPORT_UNDEFINED_PROPERTIES: If set, report any undefined properties to this file.If this property is set to a filename then when CMake runs it will report any properties or variables that were accessed but not defined into the filename specified in this property.
RULE_LAUNCH_COMPILE: Specify a launcher for compile rules.Makefile generators prefix compiler commands with the given launcher command line. This is intended to allow launchers to intercept build problems with high granularity. Non-Makefile generators currently ignore this property.
RULE_LAUNCH_CUSTOM: Specify a launcher for custom rules.Makefile generators prefix custom commands with the given launcher command line. This is intended to allow launchers to intercept build problems with high granularity. Non-Makefile generators currently ignore this property.
RULE_LAUNCH_LINK: Specify a launcher for link rules.Makefile generators prefix link and archive commands with the given launcher command line. This is intended to allow launchers to intercept build problems with high granularity. Non-Makefile generators currently ignore this property.
RULE_MESSAGES: Specify whether to report a message for each make rule.This property specifies whether Makefile generators should add a progress message describing what each build rule does. If the property is not set the default is ON. Set the property to OFF to disable granular messages and report only as each target completes. This is intended to allow scripted builds to avoid the build time cost of detailed reports. If a CMAKE_RULE_MESSAGES cache entry exists its value initializes the value of this property. Non-Makefile generators currently ignore this property.
TARGET_ARCHIVES_MAY_BE_SHARED_LIBS: Set if shared libraries may be named like archives.On AIX shared libraries may be named "lib<name>.a". This property is set to true on such platforms.
TARGET_SUPPORTS_SHARED_LIBS: Does the target platform support shared libraries.TARGET_SUPPORTS_SHARED_LIBS is a boolean specifying whether the target platform supports shared libraries. Basically all current general general purpose OS do so, the exception are usually embedded systems with no or special OSs.
USE_FOLDERS: Use the FOLDER target property to organize targets into folders.If not set, CMake treats this property as OFF by default. CMake generators that are capable of organizing into a hierarchy of folders use the values of the FOLDER target property to name those folders. See also the documentation for the FOLDER target property.
__CMAKE_DELETE_CACHE_CHANGE_VARS_: Internal propertyUsed to detect compiler changes, Do not set.
ADDITIONAL_MAKE_CLEAN_FILESCACHE_VARIABLESCLEAN_NO_CUSTOMCOMPILE_DEFINITIONSCOMPILE_DEFINITIONS_<CONFIG>DEFINITIONSEXCLUDE_FROM_ALLIMPLICIT_DEPENDS_INCLUDE_TRANSFORMINCLUDE_DIRECTORIESINCLUDE_REGULAR_EXPRESSIONINTERPROCEDURAL_OPTIMIZATIONINTERPROCEDURAL_OPTIMIZATION_<CONFIG>LINK_DIRECTORIESLISTFILE_STACKMACROSPARENT_DIRECTORYRULE_LAUNCH_COMPILERULE_LAUNCH_CUSTOMRULE_LAUNCH_LINKTEST_INCLUDE_FILEVARIABLESADDITIONAL_MAKE_CLEAN_FILES: Additional files to clean during the make clean stage.A list of files that will be cleaned as a part of the "make clean" stage.
CACHE_VARIABLES: List of cache variables available in the current directory.This read-only property specifies the list of CMake cache variables currently defined. It is intended for debugging purposes.
CLEAN_NO_CUSTOM: Should the output of custom commands be left.If this is true then the outputs of custom commands for this directory will not be removed during the "make clean" stage.
COMPILE_DEFINITIONS: Preprocessor definitions for compiling a directory's sources.The COMPILE_DEFINITIONS property may be set to a semicolon-separated list of preprocessor definitions using the syntax VAR or VAR=value. Function-style definitions are not supported. CMake will automatically escape the value correctly for the native build system (note that CMake language syntax may require escapes to specify some values). This property may be set on a per-configuration basis using the name COMPILE_DEFINITIONS_<CONFIG> where <CONFIG> is an upper-case name (ex. "COMPILE_DEFINITIONS_DEBUG"). This property will be initialized in each directory by its value in the directory's parent.
CMake will automatically drop some definitions that are not supported by the native build tool. The VS6 IDE does not support definition values with spaces (but NMake does).
Disclaimer: Most native build tools have poor support for escaping certain values. CMake has work-arounds for many cases but some values may just not be possible to pass correctly. If a value does not seem to be escaped correctly, do not attempt to work-around the problem by adding escape sequences to the value. Your work-around may break in a future version of CMake that has improved escape support. Instead consider defining the macro in a (configured) header file. Then report the limitation. Known limitations include:
# - broken almost everywhere
; - broken in VS IDE and Borland Makefiles
, - broken in VS IDE
% - broken in some cases in NMake
& | - broken in some cases on MinGW
^ < > \" - broken in most Make tools on Windows
CMake does not reject these values outright because they do work in some cases. Use with caution.
COMPILE_DEFINITIONS_<CONFIG>: Per-configuration preprocessor definitions in a directory.This is the configuration-specific version of COMPILE_DEFINITIONS. This property will be initialized in each directory by its value in the directory's parent.
DEFINITIONS: For CMake 2.4 compatibility only. Use COMPILE_DEFINITIONS instead.This read-only property specifies the list of flags given so far to the add_definitions command. It is intended for debugging purposes. Use the COMPILE_DEFINITIONS instead.
EXCLUDE_FROM_ALL: Exclude the directory from the all target of its parent.A property on a directory that indicates if its targets are excluded from the default build target. If it is not, then with a Makefile for example typing make will cause the targets to be built. The same concept applies to the default build of other generators.
IMPLICIT_DEPENDS_INCLUDE_TRANSFORM: Specify #include line transforms for dependencies in a directory.This property specifies rules to transform macro-like #include lines during implicit dependency scanning of C and C++ source files. The list of rules must be semicolon-separated with each entry of the form "A_MACRO(%)=value-with-%" (the % must be literal). During dependency scanning occurrences of A_MACRO(...) on #include lines will be replaced by the value given with the macro argument substituted for '%'. For example, the entry
MYDIR(%)=<mydir/%>
will convert lines of the form
#include MYDIR(myheader.h)
to
#include <mydir/myheader.h>
allowing the dependency to be followed.
This property applies to sources in all targets within a directory. The property value is initialized in each directory by its value in the directory's parent.
INCLUDE_DIRECTORIES: List of preprocessor include file search directories.This property specifies the list of directories given so far to the include_directories command. This property exists on directories and targets. In addition to accepting values from the include_directories command, values may be set directly on any directory or any target using the set_property command. A target gets its initial value for this property from the value of the directory property. A directory gets its initial value from its parent directory if it has one. Both directory and target property values are adjusted by calls to the include_directories command.
The target property values are used by the generators to set the include paths for the compiler. See also the include_directories command.
INCLUDE_REGULAR_EXPRESSION: Include file scanning regular expression.This read-only property specifies the regular expression used during dependency scanning to match include files that should be followed. See the include_regular_expression command.
INTERPROCEDURAL_OPTIMIZATION: Enable interprocedural optimization for targets in a directory.If set to true, enables interprocedural optimizations if they are known to be supported by the compiler.
INTERPROCEDURAL_OPTIMIZATION_<CONFIG>: Per-configuration interprocedural optimization for a directory.This is a per-configuration version of INTERPROCEDURAL_OPTIMIZATION. If set, this property overrides the generic property for the named configuration.
LINK_DIRECTORIES: List of linker search directories.This read-only property specifies the list of directories given so far to the link_directories command. It is intended for debugging purposes.
LISTFILE_STACK: The current stack of listfiles being processed.This property is mainly useful when trying to debug errors in your CMake scripts. It returns a list of what list files are currently being processed, in order. So if one listfile does an INCLUDE command then that is effectively pushing the included listfile onto the stack.
MACROS: List of macro commands available in the current directory.This read-only property specifies the list of CMake macros currently defined. It is intended for debugging purposes. See the macro command.
PARENT_DIRECTORY: Source directory that added current subdirectory.This read-only property specifies the source directory that added the current source directory as a subdirectory of the build. In the top-level directory the value is the empty-string.
RULE_LAUNCH_COMPILE: Specify a launcher for compile rules.See the global property of the same name for details. This overrides the global property for a directory.
RULE_LAUNCH_CUSTOM: Specify a launcher for custom rules.See the global property of the same name for details. This overrides the global property for a directory.
RULE_LAUNCH_LINK: Specify a launcher for link rules.See the global property of the same name for details. This overrides the global property for a directory.
TEST_INCLUDE_FILE: A cmake file that will be included when ctest is run.If you specify TEST_INCLUDE_FILE, that file will be included and processed when ctest is run on the directory.
VARIABLES: List of variables defined in the current directory.This read-only property specifies the list of CMake variables currently defined. It is intended for debugging purposes.
<CONFIG>_OUTPUT_NAME<CONFIG>_POSTFIXARCHIVE_OUTPUT_DIRECTORYARCHIVE_OUTPUT_DIRECTORY_<CONFIG>ARCHIVE_OUTPUT_NAMEARCHIVE_OUTPUT_NAME_<CONFIG>AUTOMOCAUTOMOC_MOC_OPTIONSBUILD_WITH_INSTALL_RPATHBUNDLEBUNDLE_EXTENSIONCOMPILE_DEFINITIONSCOMPILE_DEFINITIONS_<CONFIG>COMPILE_FLAGSDEBUG_POSTFIXDEFINE_SYMBOLENABLE_EXPORTSEXCLUDE_FROM_ALLEchoStringFOLDERFRAMEWORKFortran_FORMATFortran_MODULE_DIRECTORYGENERATOR_FILE_NAMEGNUtoMSHAS_CXXIMPLICIT_DEPENDS_INCLUDE_TRANSFORMIMPORTEDIMPORTED_CONFIGURATIONSIMPORTED_IMPLIBIMPORTED_IMPLIB_<CONFIG>IMPORTED_LINK_DEPENDENT_LIBRARIESIMPORTED_LINK_DEPENDENT_LIBRARIES_<CONFIG>IMPORTED_LINK_INTERFACE_LANGUAGESIMPORTED_LINK_INTERFACE_LANGUAGES_<CONFIG>IMPORTED_LINK_INTERFACE_LIBRARIESIMPORTED_LINK_INTERFACE_LIBRARIES_<CONFIG>IMPORTED_LINK_INTERFACE_MULTIPLICITYIMPORTED_LINK_INTERFACE_MULTIPLICITY_<CONFIG>IMPORTED_LOCATIONIMPORTED_LOCATION_<CONFIG>IMPORTED_NO_SONAMEIMPORTED_NO_SONAME_<CONFIG>IMPORTED_SONAMEIMPORTED_SONAME_<CONFIG>IMPORT_PREFIXIMPORT_SUFFIXINCLUDE_DIRECTORIESINSTALL_NAME_DIRINSTALL_RPATHINSTALL_RPATH_USE_LINK_PATHINTERPROCEDURAL_OPTIMIZATIONINTERPROCEDURAL_OPTIMIZATION_<CONFIG>LABELSLIBRARY_OUTPUT_DIRECTORYLIBRARY_OUTPUT_DIRECTORY_<CONFIG>LIBRARY_OUTPUT_NAMELIBRARY_OUTPUT_NAME_<CONFIG>LINKER_LANGUAGELINK_DEPENDSLINK_FLAGSLINK_FLAGS_<CONFIG>LINK_INTERFACE_LIBRARIESLINK_INTERFACE_LIBRARIES_<CONFIG>LINK_INTERFACE_MULTIPLICITYLINK_INTERFACE_MULTIPLICITY_<CONFIG>LINK_SEARCH_END_STATICLINK_SEARCH_START_STATICLOCATIONLOCATION_<CONFIG>MACOSX_BUNDLEMACOSX_BUNDLE_INFO_PLISTMACOSX_FRAMEWORK_INFO_PLISTMAP_IMPORTED_CONFIG_<CONFIG>NO_SONAMEOSX_ARCHITECTURESOSX_ARCHITECTURES_<CONFIG>OUTPUT_NAMEOUTPUT_NAME_<CONFIG>POSITION_INDEPENDENT_CODEPOST_INSTALL_SCRIPTPREFIXPRE_INSTALL_SCRIPTPRIVATE_HEADERPROJECT_LABELPUBLIC_HEADERRESOURCERULE_LAUNCH_COMPILERULE_LAUNCH_CUSTOMRULE_LAUNCH_LINKRUNTIME_OUTPUT_DIRECTORYRUNTIME_OUTPUT_DIRECTORY_<CONFIG>RUNTIME_OUTPUT_NAMERUNTIME_OUTPUT_NAME_<CONFIG>SKIP_BUILD_RPATHSOURCESSOVERSIONSTATIC_LIBRARY_FLAGSSTATIC_LIBRARY_FLAGS_<CONFIG>SUFFIXTYPEVERSIONVS_DOTNET_REFERENCESVS_GLOBAL_<variable>VS_GLOBAL_KEYWORDVS_GLOBAL_PROJECT_TYPESVS_KEYWORDVS_SCC_AUXPATHVS_SCC_LOCALPATHVS_SCC_PROJECTNAMEVS_SCC_PROVIDERVS_WINRT_EXTENSIONSVS_WINRT_REFERENCESWIN32_EXECUTABLEXCODE_ATTRIBUTE_<an-attribute><CONFIG>_OUTPUT_NAME: Old per-configuration target file base name.This is a configuration-specific version of OUTPUT_NAME. Use OUTPUT_NAME_<CONFIG> instead.
<CONFIG>_POSTFIX: Postfix to append to the target file name for configuration <CONFIG>.When building with configuration <CONFIG> the value of this property is appended to the target file name built on disk. For non-executable targets, this property is initialized by the value of the variable CMAKE_<CONFIG>_POSTFIX if it is set when a target is created. This property is ignored on the Mac for Frameworks and App Bundles.
ARCHIVE_OUTPUT_DIRECTORY: Output directory in which to build ARCHIVE target files.This property specifies the directory into which archive target files should be built. Multi-configuration generators (VS, Xcode) append a per-configuration subdirectory to the specified directory. There are three kinds of target files that may be built: archive, library, and runtime. Executables are always treated as runtime targets. Static libraries are always treated as archive targets. Module libraries are always treated as library targets. For non-DLL platforms shared libraries are treated as library targets. For DLL platforms the DLL part of a shared library is treated as a runtime target and the corresponding import library is treated as an archive target. All Windows-based systems including Cygwin are DLL platforms. This property is initialized by the value of the variable CMAKE_ARCHIVE_OUTPUT_DIRECTORY if it is set when a target is created.
ARCHIVE_OUTPUT_DIRECTORY_<CONFIG>: Per-configuration output directory for ARCHIVE target files.This is a per-configuration version of ARCHIVE_OUTPUT_DIRECTORY, but multi-configuration generators (VS, Xcode) do NOT append a per-configuration subdirectory to the specified directory. This property is initialized by the value of the variable CMAKE_ARCHIVE_OUTPUT_DIRECTORY_<CONFIG> if it is set when a target is created.
ARCHIVE_OUTPUT_NAME: Output name for ARCHIVE target files.This property specifies the base name for archive target files. It overrides OUTPUT_NAME and OUTPUT_NAME_<CONFIG> properties. There are three kinds of target files that may be built: archive, library, and runtime. Executables are always treated as runtime targets. Static libraries are always treated as archive targets. Module libraries are always treated as library targets. For non-DLL platforms shared libraries are treated as library targets. For DLL platforms the DLL part of a shared library is treated as a runtime target and the corresponding import library is treated as an archive target. All Windows-based systems including Cygwin are DLL platforms.
ARCHIVE_OUTPUT_NAME_<CONFIG>: Per-configuration output name for ARCHIVE target files.This is the configuration-specific version of ARCHIVE_OUTPUT_NAME.
AUTOMOC: Should the target be processed with automoc (for Qt projects).AUTOMOC is a boolean specifying whether CMake will handle the Qt moc preprocessor automatically, i.e. without having to use the QT4_WRAP_CPP() macro. Currently Qt4 is supported. When this property is set to TRUE, CMake will scan the source files at build time and invoke moc accordingly. If an #include statement like #include "moc_foo.cpp" is found, the Q_OBJECT class declaration is expected in the header, and moc is run on the header file. If an #include statement like #include "foo.moc" is found, then a Q_OBJECT is expected in the current source file and moc is run on the file itself. Additionally, all header files are parsed for Q_OBJECT macros, and if found, moc is also executed on those files. The resulting moc files, which are not included as shown above in any of the source files are included in a generated <targetname>_automoc.cpp file, which is compiled as part of the target.This property is initialized by the value of the variable CMAKE_AUTOMOC if it is set when a target is created.
Additional command line options for moc can be set via the AUTOMOC_MOC_OPTIONS property.
By setting the CMAKE_AUTOMOC_RELAXED_MODE variable to TRUE the rules for searching the files which will be processed by moc can be relaxed. See the documentation for this variable for more details.
AUTOMOC_MOC_OPTIONS: Additional options for moc when using automoc (see the AUTOMOC property)This property is only used if the AUTOMOC property is set to TRUE for this target. In this case, it holds additional command line options which will be used when moc is executed during the build, i.e. it is equivalent to the optional OPTIONS argument of the qt4_wrap_cpp() macro.
By default it is empty.
BUILD_WITH_INSTALL_RPATH: Should build tree targets have install tree rpaths.BUILD_WITH_INSTALL_RPATH is a boolean specifying whether to link the target in the build tree with the INSTALL_RPATH. This takes precedence over SKIP_BUILD_RPATH and avoids the need for relinking before installation. This property is initialized by the value of the variable CMAKE_BUILD_WITH_INSTALL_RPATH if it is set when a target is created.
BUNDLE: This target is a CFBundle on the Mac.If a module library target has this property set to true it will be built as a CFBundle when built on the mac. It will have the directory structure required for a CFBundle and will be suitable to be used for creating Browser Plugins or other application resources.
BUNDLE_EXTENSION: The file extension used to name a BUNDLE target on the Mac.The default value is "bundle" - you can also use "plugin" or whatever file extension is required by the host app for your bundle.
COMPILE_DEFINITIONS: Preprocessor definitions for compiling a target's sources.The COMPILE_DEFINITIONS property may be set to a semicolon-separated list of preprocessor definitions using the syntax VAR or VAR=value. Function-style definitions are not supported. CMake will automatically escape the value correctly for the native build system (note that CMake language syntax may require escapes to specify some values). This property may be set on a per-configuration basis using the name COMPILE_DEFINITIONS_<CONFIG> where <CONFIG> is an upper-case name (ex. "COMPILE_DEFINITIONS_DEBUG").
CMake will automatically drop some definitions that are not supported by the native build tool. The VS6 IDE does not support definition values with spaces (but NMake does).
Disclaimer: Most native build tools have poor support for escaping certain values. CMake has work-arounds for many cases but some values may just not be possible to pass correctly. If a value does not seem to be escaped correctly, do not attempt to work-around the problem by adding escape sequences to the value. Your work-around may break in a future version of CMake that has improved escape support. Instead consider defining the macro in a (configured) header file. Then report the limitation. Known limitations include:
# - broken almost everywhere
; - broken in VS IDE and Borland Makefiles
, - broken in VS IDE
% - broken in some cases in NMake
& | - broken in some cases on MinGW
^ < > \" - broken in most Make tools on Windows
CMake does not reject these values outright because they do work in some cases. Use with caution.
COMPILE_DEFINITIONS_<CONFIG>: Per-configuration preprocessor definitions on a target.This is the configuration-specific version of COMPILE_DEFINITIONS.
COMPILE_FLAGS: Additional flags to use when compiling this target's sources.The COMPILE_FLAGS property sets additional compiler flags used to build sources within the target. Use COMPILE_DEFINITIONS to pass additional preprocessor definitions.
DEBUG_POSTFIX: See target property <CONFIG>_POSTFIX.This property is a special case of the more-general <CONFIG>_POSTFIX property for the DEBUG configuration.
DEFINE_SYMBOL: Define a symbol when compiling this target's sources.DEFINE_SYMBOL sets the name of the preprocessor symbol defined when compiling sources in a shared library. If not set here then it is set to target_EXPORTS by default (with some substitutions if the target is not a valid C identifier). This is useful for headers to know whether they are being included from inside their library our outside to properly setup dllexport/dllimport decorations.
ENABLE_EXPORTS: Specify whether an executable exports symbols for loadable modules.Normally an executable does not export any symbols because it is the final program. It is possible for an executable to export symbols to be used by loadable modules. When this property is set to true CMake will allow other targets to "link" to the executable with the TARGET_LINK_LIBRARIES command. On all platforms a target-level dependency on the executable is created for targets that link to it. For DLL platforms an import library will be created for the exported symbols and then used for linking. All Windows-based systems including Cygwin are DLL platforms. For non-DLL platforms that require all symbols to be resolved at link time, such as Mac OS X, the module will "link" to the executable using a flag like "-bundle_loader". For other non-DLL platforms the link rule is simply ignored since the dynamic loader will automatically bind symbols when the module is loaded.
EXCLUDE_FROM_ALL: Exclude the target from the all target.A property on a target that indicates if the target is excluded from the default build target. If it is not, then with a Makefile for example typing make will cause this target to be built. The same concept applies to the default build of other generators. Installing a target with EXCLUDE_FROM_ALL set to true has undefined behavior.
EchoString: A message to be displayed when the target is built.A message to display on some generators (such as makefiles) when the target is built.
FOLDER: Set the folder name. Use to organize targets in an IDE.Targets with no FOLDER property will appear as top level entities in IDEs like Visual Studio. Targets with the same FOLDER property value will appear next to each other in a folder of that name. To nest folders, use FOLDER values such as 'GUI/Dialogs' with '/' characters separating folder levels.
FRAMEWORK: This target is a framework on the Mac.If a shared library target has this property set to true it will be built as a framework when built on the mac. It will have the directory structure required for a framework and will be suitable to be used with the -framework option
Fortran_FORMAT: Set to FIXED or FREE to indicate the Fortran source layout.This property tells CMake whether the Fortran source files in a target use fixed-format or free-format. CMake will pass the corresponding format flag to the compiler. Use the source-specific Fortran_FORMAT property to change the format of a specific source file. If the variable CMAKE_Fortran_FORMAT is set when a target is created its value is used to initialize this property.
Fortran_MODULE_DIRECTORY: Specify output directory for Fortran modules provided by the target.If the target contains Fortran source files that provide modules and the compiler supports a module output directory this specifies the directory in which the modules will be placed. When this property is not set the modules will be placed in the build directory corresponding to the target's source directory. If the variable CMAKE_Fortran_MODULE_DIRECTORY is set when a target is created its value is used to initialize this property.
Note that some compilers will automatically search the module output directory for modules USEd during compilation but others will not. If your sources USE modules their location must be specified by INCLUDE_DIRECTORIES regardless of this property.
GENERATOR_FILE_NAME: Generator's file for this target.An internal property used by some generators to record the name of project or dsp file associated with this target.
GNUtoMS: Convert GNU import library (.dll.a) to MS format (.lib).When linking a shared library or executable that exports symbols using GNU tools on Windows (MinGW/MSYS) with Visual Studio installed convert the import library (.dll.a) from GNU to MS format (.lib). Both import libraries will be installed by install(TARGETS) and exported by install(EXPORT) and export() to be linked by applications with either GNU- or MS-compatible tools.
If the variable CMAKE_GNUtoMS is set when a target is created its value is used to initialize this property. The variable must be set prior to the first command that enables a language such as project() or enable_language(). CMake provides the variable as an option to the user automatically when configuring on Windows with GNU tools.
HAS_CXX: Link the target using the C++ linker tool (obsolete).This is equivalent to setting the LINKER_LANGUAGE property to CXX. See that property's documentation for details.
IMPLICIT_DEPENDS_INCLUDE_TRANSFORM: Specify #include line transforms for dependencies in a target.This property specifies rules to transform macro-like #include lines during implicit dependency scanning of C and C++ source files. The list of rules must be semicolon-separated with each entry of the form "A_MACRO(%)=value-with-%" (the % must be literal). During dependency scanning occurrences of A_MACRO(...) on #include lines will be replaced by the value given with the macro argument substituted for '%'. For example, the entry
MYDIR(%)=<mydir/%>
will convert lines of the form
#include MYDIR(myheader.h)
to
#include <mydir/myheader.h>
allowing the dependency to be followed.
This property applies to sources in the target on which it is set.
IMPORTED: Read-only indication of whether a target is IMPORTED.The boolean value of this property is true for targets created with the IMPORTED option to add_executable or add_library. It is false for targets built within the project.
IMPORTED_CONFIGURATIONS: Configurations provided for an IMPORTED target.Set this to the list of configuration names available for an IMPORTED target. The names correspond to configurations defined in the project from which the target is imported. If the importing project uses a different set of configurations the names may be mapped using the MAP_IMPORTED_CONFIG_<CONFIG> property. Ignored for non-imported targets.
IMPORTED_IMPLIB: Full path to the import library for an IMPORTED target.Set this to the location of the ".lib" part of a windows DLL. Ignored for non-imported targets.
IMPORTED_IMPLIB_<CONFIG>: <CONFIG>-specific version of IMPORTED_IMPLIB property.Configuration names correspond to those provided by the project from which the target is imported.
IMPORTED_LINK_DEPENDENT_LIBRARIES: Dependent shared libraries of an imported shared library.Shared libraries may be linked to other shared libraries as part of their implementation. On some platforms the linker searches for the dependent libraries of shared libraries they are including in the link. Set this property to the list of dependent shared libraries of an imported library. The list should be disjoint from the list of interface libraries in the IMPORTED_LINK_INTERFACE_LIBRARIES property. On platforms requiring dependent shared libraries to be found at link time CMake uses this list to add appropriate files or paths to the link command line. Ignored for non-imported targets.
IMPORTED_LINK_DEPENDENT_LIBRARIES_<CONFIG>: <CONFIG>-specific version of IMPORTED_LINK_DEPENDENT_LIBRARIES.Configuration names correspond to those provided by the project from which the target is imported. If set, this property completely overrides the generic property for the named configuration.
IMPORTED_LINK_INTERFACE_LANGUAGES: Languages compiled into an IMPORTED static library.Set this to the list of languages of source files compiled to produce a STATIC IMPORTED library (such as "C" or "CXX"). CMake accounts for these languages when computing how to link a target to the imported library. For example, when a C executable links to an imported C++ static library CMake chooses the C++ linker to satisfy language runtime dependencies of the static library.
This property is ignored for targets that are not STATIC libraries. This property is ignored for non-imported targets.
IMPORTED_LINK_INTERFACE_LANGUAGES_<CONFIG>: <CONFIG>-specific version of IMPORTED_LINK_INTERFACE_LANGUAGES.Configuration names correspond to those provided by the project from which the target is imported. If set, this property completely overrides the generic property for the named configuration.
IMPORTED_LINK_INTERFACE_LIBRARIES: Transitive link interface of an IMPORTED target.Set this to the list of libraries whose interface is included when an IMPORTED library target is linked to another target. The libraries will be included on the link line for the target. Unlike the LINK_INTERFACE_LIBRARIES property, this property applies to all imported target types, including STATIC libraries. This property is ignored for non-imported targets.
IMPORTED_LINK_INTERFACE_LIBRARIES_<CONFIG>: <CONFIG>-specific version of IMPORTED_LINK_INTERFACE_LIBRARIES.Configuration names correspond to those provided by the project from which the target is imported. If set, this property completely overrides the generic property for the named configuration.
IMPORTED_LINK_INTERFACE_MULTIPLICITY: Repetition count for cycles of IMPORTED static libraries.This is LINK_INTERFACE_MULTIPLICITY for IMPORTED targets.
IMPORTED_LINK_INTERFACE_MULTIPLICITY_<CONFIG>: <CONFIG>-specific version of IMPORTED_LINK_INTERFACE_MULTIPLICITY.If set, this property completely overrides the generic property for the named configuration.
IMPORTED_LOCATION: Full path to the main file on disk for an IMPORTED target.Set this to the location of an IMPORTED target file on disk. For executables this is the location of the executable file. For bundles on OS X this is the location of the executable file inside Contents/MacOS under the application bundle folder. For static libraries and modules this is the location of the library or module. For shared libraries on non-DLL platforms this is the location of the shared library. For frameworks on OS X this is the location of the library file symlink just inside the framework folder. For DLLs this is the location of the ".dll" part of the library. For UNKNOWN libraries this is the location of the file to be linked. Ignored for non-imported targets.
Projects may skip IMPORTED_LOCATION if the configuration-specific property IMPORTED_LOCATION_<CONFIG> is set. To get the location of an imported target read one of the LOCATION or LOCATION_<CONFIG> properties.
IMPORTED_LOCATION_<CONFIG>: <CONFIG>-specific version of IMPORTED_LOCATION property.Configuration names correspond to those provided by the project from which the target is imported.
IMPORTED_NO_SONAME: Specifies that an IMPORTED shared library target has no "soname". Set this property to true for an imported shared library file that has no "soname" field. CMake may adjust generated link commands for some platforms to prevent the linker from using the path to the library in place of its missing soname. Ignored for non-imported targets.
IMPORTED_NO_SONAME_<CONFIG>: <CONFIG>-specific version of IMPORTED_NO_SONAME property.Configuration names correspond to those provided by the project from which the target is imported.
IMPORTED_SONAME: The "soname" of an IMPORTED target of shared library type.Set this to the "soname" embedded in an imported shared library. This is meaningful only on platforms supporting the feature. Ignored for non-imported targets.
IMPORTED_SONAME_<CONFIG>: <CONFIG>-specific version of IMPORTED_SONAME property.Configuration names correspond to those provided by the project from which the target is imported.
IMPORT_PREFIX: What comes before the import library name.Similar to the target property PREFIX, but used for import libraries (typically corresponding to a DLL) instead of regular libraries. A target property that can be set to override the prefix (such as "lib") on an import library name.
IMPORT_SUFFIX: What comes after the import library name.Similar to the target property SUFFIX, but used for import libraries (typically corresponding to a DLL) instead of regular libraries. A target property that can be set to override the suffix (such as ".lib") on an import library name.
INCLUDE_DIRECTORIES: List of preprocessor include file search directories.This property specifies the list of directories given so far to the include_directories command. This property exists on directories and targets. In addition to accepting values from the include_directories command, values may be set directly on any directory or any target using the set_property command. A target gets its initial value for this property from the value of the directory property. A directory gets its initial value from its parent directory if it has one. Both directory and target property values are adjusted by calls to the include_directories command.
The target property values are used by the generators to set the include paths for the compiler. See also the include_directories command.
INSTALL_NAME_DIR: Mac OSX directory name for installed targets.INSTALL_NAME_DIR is a string specifying the directory portion of the "install_name" field of shared libraries on Mac OSX to use in the installed targets.
INSTALL_RPATH: The rpath to use for installed targets.A semicolon-separated list specifying the rpath to use in installed targets (for platforms that support it). This property is initialized by the value of the variable CMAKE_INSTALL_RPATH if it is set when a target is created.
INSTALL_RPATH_USE_LINK_PATH: Add paths to linker search and installed rpath.INSTALL_RPATH_USE_LINK_PATH is a boolean that if set to true will append directories in the linker search path and outside the project to the INSTALL_RPATH. This property is initialized by the value of the variable CMAKE_INSTALL_RPATH_USE_LINK_PATH if it is set when a target is created.
INTERPROCEDURAL_OPTIMIZATION: Enable interprocedural optimization for a target.If set to true, enables interprocedural optimizations if they are known to be supported by the compiler.
INTERPROCEDURAL_OPTIMIZATION_<CONFIG>: Per-configuration interprocedural optimization for a target.This is a per-configuration version of INTERPROCEDURAL_OPTIMIZATION. If set, this property overrides the generic property for the named configuration.
LABELS: Specify a list of text labels associated with a target.Target label semantics are currently unspecified.
LIBRARY_OUTPUT_DIRECTORY: Output directory in which to build LIBRARY target files.This property specifies the directory into which library target files should be built. Multi-configuration generators (VS, Xcode) append a per-configuration subdirectory to the specified directory. There are three kinds of target files that may be built: archive, library, and runtime. Executables are always treated as runtime targets. Static libraries are always treated as archive targets. Module libraries are always treated as library targets. For non-DLL platforms shared libraries are treated as library targets. For DLL platforms the DLL part of a shared library is treated as a runtime target and the corresponding import library is treated as an archive target. All Windows-based systems including Cygwin are DLL platforms. This property is initialized by the value of the variable CMAKE_LIBRARY_OUTPUT_DIRECTORY if it is set when a target is created.
LIBRARY_OUTPUT_DIRECTORY_<CONFIG>: Per-configuration output directory for LIBRARY target files.This is a per-configuration version of LIBRARY_OUTPUT_DIRECTORY, but multi-configuration generators (VS, Xcode) do NOT append a per-configuration subdirectory to the specified directory. This property is initialized by the value of the variable CMAKE_LIBRARY_OUTPUT_DIRECTORY_<CONFIG> if it is set when a target is created.
LIBRARY_OUTPUT_NAME: Output name for LIBRARY target files.This property specifies the base name for library target files. It overrides OUTPUT_NAME and OUTPUT_NAME_<CONFIG> properties. There are three kinds of target files that may be built: archive, library, and runtime. Executables are always treated as runtime targets. Static libraries are always treated as archive targets. Module libraries are always treated as library targets. For non-DLL platforms shared libraries are treated as library targets. For DLL platforms the DLL part of a shared library is treated as a runtime target and the corresponding import library is treated as an archive target. All Windows-based systems including Cygwin are DLL platforms.
LIBRARY_OUTPUT_NAME_<CONFIG>: Per-configuration output name for LIBRARY target files.This is the configuration-specific version of LIBRARY_OUTPUT_NAME.
LINKER_LANGUAGE: Specifies language whose compiler will invoke the linker.For executables, shared libraries, and modules, this sets the language whose compiler is used to link the target (such as "C" or "CXX"). A typical value for an executable is the language of the source file providing the program entry point (main). If not set, the language with the highest linker preference value is the default. See documentation of CMAKE_<LANG>_LINKER_PREFERENCE variables.
LINK_DEPENDS: Additional files on which a target binary depends for linking.Specifies a semicolon-separated list of full-paths to files on which the link rule for this target depends. The target binary will be linked if any of the named files is newer than it.
This property is ignored by non-Makefile generators. It is intended to specify dependencies on "linker scripts" for custom Makefile link rules.
LINK_FLAGS: Additional flags to use when linking this target.The LINK_FLAGS property can be used to add extra flags to the link step of a target. LINK_FLAGS_<CONFIG> will add to the configuration <CONFIG>, for example, DEBUG, RELEASE, MINSIZEREL, RELWITHDEBINFO.
LINK_FLAGS_<CONFIG>: Per-configuration linker flags for a target.This is the configuration-specific version of LINK_FLAGS.
LINK_INTERFACE_LIBRARIES: List public interface libraries for a shared library or executable.By default linking to a shared library target transitively links to targets with which the library itself was linked. For an executable with exports (see the ENABLE_EXPORTS property) no default transitive link dependencies are used. This property replaces the default transitive link dependencies with an explicit list. When the target is linked into another target the libraries listed (and recursively their link interface libraries) will be provided to the other target also. If the list is empty then no transitive link dependencies will be incorporated when this target is linked into another target even if the default set is non-empty. This property is initialized by the value of the variable CMAKE_LINK_INTERFACE_LIBRARIES if it is set when a target is created. This property is ignored for STATIC libraries.
LINK_INTERFACE_LIBRARIES_<CONFIG>: Per-configuration list of public interface libraries for a target.This is the configuration-specific version of LINK_INTERFACE_LIBRARIES. If set, this property completely overrides the generic property for the named configuration.
LINK_INTERFACE_MULTIPLICITY: Repetition count for STATIC libraries with cyclic dependencies.When linking to a STATIC library target with cyclic dependencies the linker may need to scan more than once through the archives in the strongly connected component of the dependency graph. CMake by default constructs the link line so that the linker will scan through the component at least twice. This property specifies the minimum number of scans if it is larger than the default. CMake uses the largest value specified by any target in a component.
LINK_INTERFACE_MULTIPLICITY_<CONFIG>: Per-configuration repetition count for cycles of STATIC libraries.This is the configuration-specific version of LINK_INTERFACE_MULTIPLICITY. If set, this property completely overrides the generic property for the named configuration.
LINK_SEARCH_END_STATIC: End a link line such that static system libraries are used.Some linkers support switches such as -Bstatic and -Bdynamic to determine whether to use static or shared libraries for -lXXX options. CMake uses these options to set the link type for libraries whose full paths are not known or (in some cases) are in implicit link directories for the platform. By default CMake adds an option at the end of the library list (if necessary) to set the linker search type back to its starting type. This property switches the final linker search type to -Bstatic regardless of how it started. See also LINK_SEARCH_START_STATIC.
LINK_SEARCH_START_STATIC: Assume the linker looks for static libraries by default.Some linkers support switches such as -Bstatic and -Bdynamic to determine whether to use static or shared libraries for -lXXX options. CMake uses these options to set the link type for libraries whose full paths are not known or (in some cases) are in implicit link directories for the platform. By default the linker search type is assumed to be -Bdynamic at the beginning of the library list. This property switches the assumption to -Bstatic. It is intended for use when linking an executable statically (e.g. with the GNU -static option). See also LINK_SEARCH_END_STATIC.
LOCATION: Read-only location of a target on disk.For an imported target, this read-only property returns the value of the LOCATION_<CONFIG> property for an unspecified configuration <CONFIG> provided by the target.
For a non-imported target, this property is provided for compatibility with CMake 2.4 and below. It was meant to get the location of an executable target's output file for use in add_custom_command. The path may contain a build-system-specific portion that is replaced at build time with the configuration getting built (such as "$(ConfigurationName)" in VS). In CMake 2.6 and above add_custom_command automatically recognizes a target name in its COMMAND and DEPENDS options and computes the target location. In CMake 2.8.4 and above add_custom_command recognizes generator expressions to refer to target locations anywhere in the command. Therefore this property is not needed for creating custom commands.
Do not set properties that affect the location of a target after reading this property. These include properties whose names match "(RUNTIME|LIBRARY|ARCHIVE)_OUTPUT_(NAME|DIRECTORY)(_<CONFIG>)?" or "(IMPLIB_)?(PREFIX|SUFFIX)". Failure to follow this rule is not diagnosed and leaves the location of the target undefined.
LOCATION_<CONFIG>: Read-only property providing a target location on disk.A read-only property that indicates where a target's main file is located on disk for the configuration <CONFIG>. The property is defined only for library and executable targets. An imported target may provide a set of configurations different from that of the importing project. By default CMake looks for an exact-match but otherwise uses an arbitrary available configuration. Use the MAP_IMPORTED_CONFIG_<CONFIG> property to map imported configurations explicitly.
Do not set properties that affect the location of a target after reading this property. These include properties whose names match "(RUNTIME|LIBRARY|ARCHIVE)_OUTPUT_(NAME|DIRECTORY)(_<CONFIG>)?" or "(IMPLIB_)?(PREFIX|SUFFIX)". Failure to follow this rule is not diagnosed and leaves the location of the target undefined.
MACOSX_BUNDLE: Build an executable as an application bundle on Mac OS X.When this property is set to true the executable when built on Mac OS X will be created as an application bundle. This makes it a GUI executable that can be launched from the Finder. See the MACOSX_BUNDLE_INFO_PLIST target property for information about creation of the Info.plist file for the application bundle. This property is initialized by the value of the variable CMAKE_MACOSX_BUNDLE if it is set when a target is created.
MACOSX_BUNDLE_INFO_PLIST: Specify a custom Info.plist template for a Mac OS X App Bundle.An executable target with MACOSX_BUNDLE enabled will be built as an application bundle on Mac OS X. By default its Info.plist file is created by configuring a template called MacOSXBundleInfo.plist.in located in the CMAKE_MODULE_PATH. This property specifies an alternative template file name which may be a full path.
The following target properties may be set to specify content to be configured into the file:
MACOSX_BUNDLE_INFO_STRING
MACOSX_BUNDLE_ICON_FILE
MACOSX_BUNDLE_GUI_IDENTIFIER
MACOSX_BUNDLE_LONG_VERSION_STRING
MACOSX_BUNDLE_BUNDLE_NAME
MACOSX_BUNDLE_SHORT_VERSION_STRING
MACOSX_BUNDLE_BUNDLE_VERSION
MACOSX_BUNDLE_COPYRIGHT
CMake variables of the same name may be set to affect all targets in a directory that do not have each specific property set. If a custom Info.plist is specified by this property it may of course hard-code all the settings instead of using the target properties.
MACOSX_FRAMEWORK_INFO_PLIST: Specify a custom Info.plist template for a Mac OS X Framework.An library target with FRAMEWORK enabled will be built as a framework on Mac OS X. By default its Info.plist file is created by configuring a template called MacOSXFrameworkInfo.plist.in located in the CMAKE_MODULE_PATH. This property specifies an alternative template file name which may be a full path.
The following target properties may be set to specify content to be configured into the file:
MACOSX_FRAMEWORK_ICON_FILE
MACOSX_FRAMEWORK_IDENTIFIER
MACOSX_FRAMEWORK_SHORT_VERSION_STRING
MACOSX_FRAMEWORK_BUNDLE_VERSION
CMake variables of the same name may be set to affect all targets in a directory that do not have each specific property set. If a custom Info.plist is specified by this property it may of course hard-code all the settings instead of using the target properties.
MAP_IMPORTED_CONFIG_<CONFIG>: Map from project configuration to IMPORTED target's configuration.Set this to the list of configurations of an imported target that may be used for the current project's <CONFIG> configuration. Targets imported from another project may not provide the same set of configuration names available in the current project. Setting this property tells CMake what imported configurations are suitable for use when building the <CONFIG> configuration. The first configuration in the list found to be provided by the imported target is selected. If this property is set and no matching configurations are available, then the imported target is considered to be not found. This property is ignored for non-imported targets.
NO_SONAME: Whether to set "soname" when linking a shared library or module.Enable this boolean property if a generated shared library or module should not have "soname" set. Default is to set "soname" on all shared libraries and modules as long as the platform supports it. Generally, use this property only for leaf private libraries or plugins. If you use it on normal shared libraries which other targets link against, on some platforms a linker will insert a full path to the library (as specified at link time) into the dynamic section of the dependent binary. Therefore, once installed, dynamic loader may eventually fail to locate the library for the binary.
OSX_ARCHITECTURES: Target specific architectures for OS X.The OSX_ARCHITECTURES property sets the target binary architecture for targets on OS X. This property is initialized by the value of the variable CMAKE_OSX_ARCHITECTURES if it is set when a target is created. Use OSX_ARCHITECTURES_<CONFIG> to set the binary architectures on a per-configuration basis. <CONFIG> is an upper-case name (ex: "OSX_ARCHITECTURES_DEBUG").
OSX_ARCHITECTURES_<CONFIG>: Per-configuration OS X binary architectures for a target.This property is the configuration-specific version of OSX_ARCHITECTURES.
OUTPUT_NAME: Output name for target files.This sets the base name for output files created for an executable or library target. If not set, the logical target name is used by default.
OUTPUT_NAME_<CONFIG>: Per-configuration target file base name.This is the configuration-specific version of OUTPUT_NAME.
POSITION_INDEPENDENT_CODE: Whether to create a position-independent targetThe POSITION_INDEPENDENT_CODE property determines whether position independent executables or shared libraries will be created. This property is true by default for SHARED and MODULE library targets and false otherwise.
POST_INSTALL_SCRIPT: Deprecated install support.The PRE_INSTALL_SCRIPT and POST_INSTALL_SCRIPT properties are the old way to specify CMake scripts to run before and after installing a target. They are used only when the old INSTALL_TARGETS command is used to install the target. Use the INSTALL command instead.
PREFIX: What comes before the library name.A target property that can be set to override the prefix (such as "lib") on a library name.
PRE_INSTALL_SCRIPT: Deprecated install support.The PRE_INSTALL_SCRIPT and POST_INSTALL_SCRIPT properties are the old way to specify CMake scripts to run before and after installing a target. They are used only when the old INSTALL_TARGETS command is used to install the target. Use the INSTALL command instead.
PRIVATE_HEADER: Specify private header files in a FRAMEWORK shared library target.Shared library targets marked with the FRAMEWORK property generate frameworks on OS X and normal shared libraries on other platforms. This property may be set to a list of header files to be placed in the PrivateHeaders directory inside the framework folder. On non-Apple platforms these headers may be installed using the PRIVATE_HEADER option to the install(TARGETS) command.
PROJECT_LABEL: Change the name of a target in an IDE.Can be used to change the name of the target in an IDE like Visual Studio.
PUBLIC_HEADER: Specify public header files in a FRAMEWORK shared library target.Shared library targets marked with the FRAMEWORK property generate frameworks on OS X and normal shared libraries on other platforms. This property may be set to a list of header files to be placed in the Headers directory inside the framework folder. On non-Apple platforms these headers may be installed using the PUBLIC_HEADER option to the install(TARGETS) command.
RESOURCE: Specify resource files in a FRAMEWORK shared library target.Shared library targets marked with the FRAMEWORK property generate frameworks on OS X and normal shared libraries on other platforms. This property may be set to a list of files to be placed in the Resources directory inside the framework folder. On non-Apple platforms these files may be installed using the RESOURCE option to the install(TARGETS) command.
RULE_LAUNCH_COMPILE: Specify a launcher for compile rules.See the global property of the same name for details. This overrides the global and directory property for a target.
RULE_LAUNCH_CUSTOM: Specify a launcher for custom rules.See the global property of the same name for details. This overrides the global and directory property for a target.
RULE_LAUNCH_LINK: Specify a launcher for link rules.See the global property of the same name for details. This overrides the global and directory property for a target.
RUNTIME_OUTPUT_DIRECTORY: Output directory in which to build RUNTIME target files.This property specifies the directory into which runtime target files should be built. Multi-configuration generators (VS, Xcode) append a per-configuration subdirectory to the specified directory. There are three kinds of target files that may be built: archive, library, and runtime. Executables are always treated as runtime targets. Static libraries are always treated as archive targets. Module libraries are always treated as library targets. For non-DLL platforms shared libraries are treated as library targets. For DLL platforms the DLL part of a shared library is treated as a runtime target and the corresponding import library is treated as an archive target. All Windows-based systems including Cygwin are DLL platforms. This property is initialized by the value of the variable CMAKE_RUNTIME_OUTPUT_DIRECTORY if it is set when a target is created.
RUNTIME_OUTPUT_DIRECTORY_<CONFIG>: Per-configuration output directory for RUNTIME target files.This is a per-configuration version of RUNTIME_OUTPUT_DIRECTORY, but multi-configuration generators (VS, Xcode) do NOT append a per-configuration subdirectory to the specified directory. This property is initialized by the value of the variable CMAKE_RUNTIME_OUTPUT_DIRECTORY_<CONFIG> if it is set when a target is created.
RUNTIME_OUTPUT_NAME: Output name for RUNTIME target files.This property specifies the base name for runtime target files. It overrides OUTPUT_NAME and OUTPUT_NAME_<CONFIG> properties. There are three kinds of target files that may be built: archive, library, and runtime. Executables are always treated as runtime targets. Static libraries are always treated as archive targets. Module libraries are always treated as library targets. For non-DLL platforms shared libraries are treated as library targets. For DLL platforms the DLL part of a shared library is treated as a runtime target and the corresponding import library is treated as an archive target. All Windows-based systems including Cygwin are DLL platforms.
RUNTIME_OUTPUT_NAME_<CONFIG>: Per-configuration output name for RUNTIME target files.This is the configuration-specific version of RUNTIME_OUTPUT_NAME.
SKIP_BUILD_RPATH: Should rpaths be used for the build tree.SKIP_BUILD_RPATH is a boolean specifying whether to skip automatic generation of an rpath allowing the target to run from the build tree. This property is initialized by the value of the variable CMAKE_SKIP_BUILD_RPATH if it is set when a target is created.
SOURCES: Source names specified for a target.Read-only list of sources specified for a target. The names returned are suitable for passing to the set_source_files_properties command.
SOVERSION: What version number is this target.For shared libraries VERSION and SOVERSION can be used to specify the build version and api version respectively. When building or installing appropriate symlinks are created if the platform supports symlinks and the linker supports so-names. If only one of both is specified the missing is assumed to have the same version number. SOVERSION is ignored if NO_SONAME property is set. For shared libraries and executables on Windows the VERSION attribute is parsed to extract a "major.minor" version number. These numbers are used as the image version of the binary.
STATIC_LIBRARY_FLAGS: Extra flags to use when linking static libraries.Extra flags to use when linking a static library.
STATIC_LIBRARY_FLAGS_<CONFIG>: Per-configuration flags for creating a static library.This is the configuration-specific version of STATIC_LIBRARY_FLAGS.
SUFFIX: What comes after the target name.A target property that can be set to override the suffix (such as ".so" or ".exe") on the name of a library, module or executable.
TYPE: The type of the target.This read-only property can be used to test the type of the given target. It will be one of STATIC_LIBRARY, MODULE_LIBRARY, SHARED_LIBRARY, EXECUTABLE or one of the internal target types.
VERSION: What version number is this target.For shared libraries VERSION and SOVERSION can be used to specify the build version and api version respectively. When building or installing appropriate symlinks are created if the platform supports symlinks and the linker supports so-names. If only one of both is specified the missing is assumed to have the same version number. For executables VERSION can be used to specify the build version. When building or installing appropriate symlinks are created if the platform supports symlinks. For shared libraries and executables on Windows the VERSION attribute is parsed to extract a "major.minor" version number. These numbers are used as the image version of the binary.
VS_DOTNET_REFERENCES: Visual Studio managed project .NET referencesAdds one or more semicolon-delimited .NET references to a generated Visual Studio project. For example, "System;System.Windows.Forms".
VS_GLOBAL_<variable>: Visual Studio project-specific global variable.Tell the Visual Studio generator to set the global variable '<variable>' to a given value in the generated Visual Studio project. Ignored on other generators. Qt integration works better if VS_GLOBAL_QtVersion is set to the version FindQt4.cmake found. For example, "4.7.3"
VS_GLOBAL_KEYWORD: Visual Studio project keyword.Sets the "keyword" attribute for a generated Visual Studio project. Defaults to "Win32Proj". You may wish to override this value with "ManagedCProj", for example, in a Visual Studio managed C++ unit test project.
VS_GLOBAL_PROJECT_TYPES: Visual Studio project type(s).Can be set to one or more UUIDs recognized by Visual Studio to indicate the type of project. This value is copied verbatim into the generated project file. Example for a managed C++ unit testing project:
{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}
UUIDs are semicolon-delimited.
VS_KEYWORD: Visual Studio project keyword.Can be set to change the visual studio keyword, for example QT integration works better if this is set to Qt4VSv1.0.
VS_SCC_AUXPATH: Visual Studio Source Code Control Aux Path.Can be set to change the visual studio source code control auxpath property.
VS_SCC_LOCALPATH: Visual Studio Source Code Control Local Path.Can be set to change the visual studio source code control local path property.
VS_SCC_PROJECTNAME: Visual Studio Source Code Control Project.Can be set to change the visual studio source code control project name property.
VS_SCC_PROVIDER: Visual Studio Source Code Control Provider.Can be set to change the visual studio source code control provider property.
VS_WINRT_EXTENSIONS: Visual Studio project C++/CX language extensions for Windows RuntimeCan be set to enable C++/CX language extensions.
VS_WINRT_REFERENCES: Visual Studio project Windows Runtime Metadata referencesAdds one or more semicolon-delimited WinRT references to a generated Visual Studio project. For example, "Windows;Windows.UI.Core".
WIN32_EXECUTABLE: Build an executable with a WinMain entry point on windows.When this property is set to true the executable when linked on Windows will be created with a WinMain() entry point instead of of just main().This makes it a GUI executable instead of a console application. See the CMAKE_MFC_FLAG variable documentation to configure use of MFC for WinMain executables. This property is initialized by the value of the variable CMAKE_WIN32_EXECUTABLE if it is set when a target is created.
XCODE_ATTRIBUTE_<an-attribute>: Set Xcode target attributes directly.Tell the Xcode generator to set '<an-attribute>' to a given value in the generated Xcode project. Ignored on other generators.
ATTACHED_FILESATTACHED_FILES_ON_FAILCOSTDEPENDSENVIRONMENTFAIL_REGULAR_EXPRESSIONLABELSMEASUREMENTPASS_REGULAR_EXPRESSIONPROCESSORSREQUIRED_FILESRESOURCE_LOCKRUN_SERIALTIMEOUTWILL_FAILWORKING_DIRECTORYATTACHED_FILES: Attach a list of files to a dashboard submission.Set this property to a list of files that will be encoded and submitted to the dashboard as an addition to the test result.
ATTACHED_FILES_ON_FAIL: Attach a list of files to a dashboard submission if the test fails.Same as ATTACHED_FILES, but these files will only be included if the test does not pass.
COST: Set this to a floating point value. Tests in a test set will be run in descending order of cost.This property describes the cost of a test. You can explicitly set this value; tests with higher COST values will run first.
DEPENDS: Specifies that this test should only be run after the specified list of tests.Set this to a list of tests that must finish before this test is run.
ENVIRONMENT: Specify environment variables that should be defined for running a test.If set to a list of environment variables and values of the form MYVAR=value those environment variables will be defined while running the test. The environment is restored to its previous state after the test is done.
FAIL_REGULAR_EXPRESSION: If the output matches this regular expression the test will fail.If set, if the output matches one of specified regular expressions, the test will fail.For example: PASS_REGULAR_EXPRESSION "[^a-z]Error;ERROR;Failed"
LABELS: Specify a list of text labels associated with a test.The list is reported in dashboard submissions.
MEASUREMENT: Specify a CDASH measurement and value to be reported for a test.If set to a name then that name will be reported to CDASH as a named measurement with a value of 1. You may also specify a value by setting MEASUREMENT to "measurement=value".
PASS_REGULAR_EXPRESSION: The output must match this regular expression for the test to pass.If set, the test output will be checked against the specified regular expressions and at least one of the regular expressions has to match, otherwise the test will fail.
PROCESSORS: How many process slots this test requiresDenotes the number of processors that this test will require. This is typically used for MPI tests, and should be used in conjunction with the ctest_test PARALLEL_LEVEL option.
REQUIRED_FILES: List of files required to run the test.If set to a list of files, the test will not be run unless all of the files exist.
RESOURCE_LOCK: Specify a list of resources that are locked by this test.If multiple tests specify the same resource lock, they are guaranteed not to run concurrently.
RUN_SERIAL: Do not run this test in parallel with any other test.Use this option in conjunction with the ctest_test PARALLEL_LEVEL option to specify that this test should not be run in parallel with any other tests.
TIMEOUT: How many seconds to allow for this test.This property if set will limit a test to not take more than the specified number of seconds to run. If it exceeds that the test process will be killed and ctest will move to the next test. This setting takes precedence over CTEST_TESTING_TIMEOUT.
WILL_FAIL: If set to true, this will invert the pass/fail flag of the test.This property can be used for tests that are expected to fail and return a non zero return code.
WORKING_DIRECTORY: The directory from which the test executable will be called.If this is not set it is called from the directory the test executable is located in.
ABSTRACTCOMPILE_DEFINITIONSCOMPILE_DEFINITIONS_<CONFIG>COMPILE_FLAGSEXTERNAL_OBJECTFortran_FORMATGENERATEDHEADER_FILE_ONLYKEEP_EXTENSIONLABELSLANGUAGELOCATIONMACOSX_PACKAGE_LOCATIONOBJECT_DEPENDSOBJECT_OUTPUTSSYMBOLICWRAP_EXCLUDEABSTRACT: Is this source file an abstract class.A property on a source file that indicates if the source file represents a class that is abstract. This only makes sense for languages that have a notion of an abstract class and it is only used by some tools that wrap classes into other languages.
COMPILE_DEFINITIONS: Preprocessor definitions for compiling a source file.The COMPILE_DEFINITIONS property may be set to a semicolon-separated list of preprocessor definitions using the syntax VAR or VAR=value. Function-style definitions are not supported. CMake will automatically escape the value correctly for the native build system (note that CMake language syntax may require escapes to specify some values). This property may be set on a per-configuration basis using the name COMPILE_DEFINITIONS_<CONFIG> where <CONFIG> is an upper-case name (ex. "COMPILE_DEFINITIONS_DEBUG").
CMake will automatically drop some definitions that are not supported by the native build tool. The VS6 IDE does not support definition values with spaces (but NMake does). Xcode does not support per-configuration definitions on source files.
Disclaimer: Most native build tools have poor support for escaping certain values. CMake has work-arounds for many cases but some values may just not be possible to pass correctly. If a value does not seem to be escaped correctly, do not attempt to work-around the problem by adding escape sequences to the value. Your work-around may break in a future version of CMake that has improved escape support. Instead consider defining the macro in a (configured) header file. Then report the limitation. Known limitations include:
# - broken almost everywhere
; - broken in VS IDE and Borland Makefiles
, - broken in VS IDE
% - broken in some cases in NMake
& | - broken in some cases on MinGW
^ < > \" - broken in most Make tools on Windows
CMake does not reject these values outright because they do work in some cases. Use with caution.
COMPILE_DEFINITIONS_<CONFIG>: Per-configuration preprocessor definitions on a source file.This is the configuration-specific version of COMPILE_DEFINITIONS. Note that Xcode does not support per-configuration source file flags so this property will be ignored by the Xcode generator.
COMPILE_FLAGS: Additional flags to be added when compiling this source file.These flags will be added to the list of compile flags when this source file builds. Use COMPILE_DEFINITIONS to pass additional preprocessor definitions.
EXTERNAL_OBJECT: If set to true then this is an object file.If this property is set to true then the source file is really an object file and should not be compiled. It will still be linked into the target though.
Fortran_FORMAT: Set to FIXED or FREE to indicate the Fortran source layout.This property tells CMake whether a given Fortran source file uses fixed-format or free-format. CMake will pass the corresponding format flag to the compiler. Consider using the target-wide Fortran_FORMAT property if all source files in a target share the same format.
GENERATED: Is this source file generated as part of the build process.If a source file is generated by the build process CMake will handle it differently in terms of dependency checking etc. Otherwise having a non-existent source file could create problems.
HEADER_FILE_ONLY: Is this source file only a header file.A property on a source file that indicates if the source file is a header file with no associated implementation. This is set automatically based on the file extension and is used by CMake to determine is certain dependency information should be computed.
KEEP_EXTENSION: Make the output file have the same extension as the source file.If this property is set then the file extension of the output file will be the same as that of the source file. Normally the output file extension is computed based on the language of the source file, for example .cxx will go to a .o extension.
LABELS: Specify a list of text labels associated with a source file.This property has meaning only when the source file is listed in a target whose LABELS property is also set. No other semantics are currently specified.
LANGUAGE: What programming language is the file.A property that can be set to indicate what programming language the source file is. If it is not set the language is determined based on the file extension. Typical values are CXX C etc. Setting this property for a file means this file will be compiled. Do not set this for header or files that should not be compiled.
LOCATION: The full path to a source file.A read only property on a SOURCE FILE that contains the full path to the source file.
MACOSX_PACKAGE_LOCATION: Place a source file inside a Mac OS X bundle, CFBundle, or framework.Executable targets with the MACOSX_BUNDLE property set are built as Mac OS X application bundles on Apple platforms. Shared library targets with the FRAMEWORK property set are built as Mac OS X frameworks on Apple platforms. Module library targets with the BUNDLE property set are built as Mac OS X CFBundle bundles on Apple platforms. Source files listed in the target with this property set will be copied to a directory inside the bundle or framework content folder specified by the property value. For bundles the content folder is "<name>.app/Contents". For frameworks the content folder is "<name>.framework/Versions/<version>". For cfbundles the content folder is "<name>.bundle/Contents" (unless the extension is changed). See the PUBLIC_HEADER, PRIVATE_HEADER, and RESOURCE target properties for specifying files meant for Headers, PrivateHeaders, or Resources directories.
OBJECT_DEPENDS: Additional files on which a compiled object file depends.Specifies a semicolon-separated list of full-paths to files on which any object files compiled from this source file depend. An object file will be recompiled if any of the named files is newer than it.
This property need not be used to specify the dependency of a source file on a generated header file that it includes. Although the property was originally introduced for this purpose, it is no longer necessary. If the generated header file is created by a custom command in the same target as the source file, the automatic dependency scanning process will recognize the dependency. If the generated header file is created by another target, an inter-target dependency should be created with the add_dependencies command (if one does not already exist due to linking relationships).
OBJECT_OUTPUTS: Additional outputs for a Makefile rule.Additional outputs created by compilation of this source file. If any of these outputs is missing the object will be recompiled. This is supported only on Makefile generators and will be ignored on other generators.
SYMBOLIC: Is this just a name for a rule.If SYMBOLIC (boolean) is set to true the build system will be informed that the source file is not actually created on disk but instead used as a symbolic name for a build rule.
WRAP_EXCLUDE: Exclude this source file from any code wrapping techniques.Some packages can wrap source files into alternate languages to provide additional functionality. For example, C++ code can be wrapped into Java or Python etc using SWIG etc. If WRAP_EXCLUDE is set to true (1 etc) that indicates then this source file should not be wrapped.
ADVANCED: True if entry should be hidden by default in GUIs.This is a boolean value indicating whether the entry is considered interesting only for advanced configuration. The mark_as_advanced() command modifies this property.
HELPSTRING: Help associated with entry in GUIs.This string summarizes the purpose of an entry to help users set it through a CMake GUI.
MODIFIED: Internal management property. Do not set or get.This is an internal cache entry property managed by CMake to track interactive user modification of entries. Ignore it.
STRINGS: Enumerate possible STRING entry values for GUI selection.For cache entries with type STRING, this enumerates a set of values. CMake GUIs may use this to provide a selection widget instead of a generic string entry field. This is for convenience only. CMake does not enforce that the value matches one of those listed.
TYPE: Widget type for entry in GUIs.Cache entry values are always strings, but CMake GUIs present widgets to help users set values. The GUIs use this property as a hint to determine the widget type. Valid TYPE values are:
BOOL = Boolean ON/OFF value.
PATH = Path to a directory.
FILEPATH = Path to a file.
STRING = Generic string value.
INTERNAL = Do not present in GUI at all.
STATIC = Value managed by CMake, do not change.
UNINITIALIZED = Type not yet specified.
Generally the TYPE of a cache entry should be set by the command which creates it (set, option, find_library, etc.).
VALUE: Value of a cache entry.This property maps to the actual value of a cache entry. Setting this property always sets the value without checking, so use with care.
build_nameexec_programexport_library_dependenciesinstall_filesinstall_programsinstall_targetslink_librariesmake_directoryoutput_required_filesremovesubdir_dependssubdirsuse_mangled_mesautility_sourcevariable_requireswrite_fileCMake Compatibility Listfile Commands - Obsolete commands supported by CMake for compatibility.
This is the documentation for now obsolete listfile commands from previous CMake versions, which are still supported for compatibility reasons. You should instead use the newer, faster and shinier new commands. ;-)
build_name: Deprecated. Use ${CMAKE_SYSTEM} and ${CMAKE_CXX_COMPILER} instead.build_name(variable)
Sets the specified variable to a string representing the platform and compiler settings. These values are now available through the CMAKE_SYSTEM and CMAKE_CXX_COMPILER variables.
exec_program: Deprecated. Use the execute_process() command instead.Run an executable program during the processing of the CMakeList.txt file.
exec_program(Executable [directory in which to run]
[ARGS <arguments to executable>]
[OUTPUT_VARIABLE <var>]
[RETURN_VALUE <var>])
The executable is run in the optionally specified directory. The executable can include arguments if it is double quoted, but it is better to use the optional ARGS argument to specify arguments to the program. This is because cmake will then be able to escape spaces in the executable path. An optional argument OUTPUT_VARIABLE specifies a variable in which to store the output. To capture the return value of the execution, provide a RETURN_VALUE. If OUTPUT_VARIABLE is specified, then no output will go to the stdout/stderr of the console running cmake.
export_library_dependencies: Deprecated. Use INSTALL(EXPORT) or EXPORT command.This command generates an old-style library dependencies file. Projects requiring CMake 2.6 or later should not use the command. Use instead the install(EXPORT) command to help export targets from an installation tree and the export() command to export targets from a build tree.
The old-style library dependencies file does not take into account per-configuration names of libraries or the LINK_INTERFACE_LIBRARIES target property.
export_library_dependencies(<file> [APPEND])
Create a file named <file> that can be included into a CMake listfile with the INCLUDE command. The file will contain a number of SET commands that will set all the variables needed for library dependency information. This should be the last command in the top level CMakeLists.txt file of the project. If the APPEND option is specified, the SET commands will be appended to the given file instead of replacing it.
install_files: Deprecated. Use the install(FILES ) command instead.This command has been superceded by the install command. It is provided for compatibility with older CMake code. The FILES form is directly replaced by the FILES form of the install command. The regexp form can be expressed more clearly using the GLOB form of the file command.
install_files(<dir> extension file file ...)
Create rules to install the listed files with the given extension into the given directory. Only files existing in the current source tree or its corresponding location in the binary tree may be listed. If a file specified already has an extension, that extension will be removed first. This is useful for providing lists of source files such as foo.cxx when you want the corresponding foo.h to be installed. A typical extension is '.h'.
install_files(<dir> regexp)
Any files in the current source directory that match the regular expression will be installed.
install_files(<dir> FILES file file ...)
Any files listed after the FILES keyword will be installed explicitly from the names given. Full paths are allowed in this form.
The directory <dir> is relative to the installation prefix, which is stored in the variable CMAKE_INSTALL_PREFIX.
install_programs: Deprecated. Use the install(PROGRAMS ) command instead.This command has been superceded by the install command. It is provided for compatibility with older CMake code. The FILES form is directly replaced by the PROGRAMS form of the INSTALL command. The regexp form can be expressed more clearly using the GLOB form of the FILE command.
install_programs(<dir> file1 file2 [file3 ...])
install_programs(<dir> FILES file1 [file2 ...])
Create rules to install the listed programs into the given directory. Use the FILES argument to guarantee that the file list version of the command will be used even when there is only one argument.
install_programs(<dir> regexp)
In the second form any program in the current source directory that matches the regular expression will be installed.
This command is intended to install programs that are not built by cmake, such as shell scripts. See the TARGETS form of the INSTALL command to create installation rules for targets built by cmake.
The directory <dir> is relative to the installation prefix, which is stored in the variable CMAKE_INSTALL_PREFIX.
install_targets: Deprecated. Use the install(TARGETS ) command instead.This command has been superceded by the install command. It is provided for compatibility with older CMake code.
install_targets(<dir> [RUNTIME_DIRECTORY dir] target target)
Create rules to install the listed targets into the given directory. The directory <dir> is relative to the installation prefix, which is stored in the variable CMAKE_INSTALL_PREFIX. If RUNTIME_DIRECTORY is specified, then on systems with special runtime files (Windows DLL), the files will be copied to that directory.
link_libraries: Deprecated. Use the target_link_libraries() command instead.Link libraries to all targets added later.
link_libraries(library1 <debug | optimized> library2 ...)
Specify a list of libraries to be linked into any following targets (typically added with the add_executable or add_library calls). This command is passed down to all subdirectories. The debug and optimized strings may be used to indicate that the next library listed is to be used only for that specific type of build.
make_directory: Deprecated. Use the file(MAKE_DIRECTORY ) command instead.make_directory(directory)
Creates the specified directory. Full paths should be given. Any parent directories that do not exist will also be created. Use with care.
output_required_files: Deprecated. Approximate C preprocessor dependency scanning.This command exists only because ancient CMake versions provided it. CMake handles preprocessor dependency scanning automatically using a more advanced scanner.
output_required_files(srcfile outputfile)
Outputs a list of all the source files that are required by the specified srcfile. This list is written into outputfile. This is similar to writing out the dependencies for srcfile except that it jumps from .h files into .cxx, .c and .cpp files if possible.
remove: Deprecated. Use the list(REMOVE_ITEM ) command instead.remove(VAR VALUE VALUE ...)
Removes VALUE from the variable VAR. This is typically used to remove entries from a vector (e.g. semicolon separated list). VALUE is expanded.
subdir_depends: Deprecated. Does nothing.subdir_depends(subdir dep1 dep2 ...)
Does not do anything. This command used to help projects order parallel builds correctly. This functionality is now automatic.
subdirs: Deprecated. Use the add_subdirectory() command instead.Add a list of subdirectories to the build.
subdirs(dir1 dir2 ...[EXCLUDE_FROM_ALL exclude_dir1 exclude_dir2 ...]
[PREORDER] )
Add a list of subdirectories to the build. The add_subdirectory command should be used instead of subdirs although subdirs will still work. This will cause any CMakeLists.txt files in the sub directories to be processed by CMake. Any directories after the PREORDER flag are traversed first by makefile builds, the PREORDER flag has no effect on IDE projects. Any directories after the EXCLUDE_FROM_ALL marker will not be included in the top level makefile or project file. This is useful for having CMake create makefiles or projects for a set of examples in a project. You would want CMake to generate makefiles or project files for all the examples at the same time, but you would not want them to show up in the top level project or be built each time make is run from the top.
use_mangled_mesa: Copy mesa headers for use in combination with system GL.use_mangled_mesa(PATH_TO_MESA OUTPUT_DIRECTORY)
The path to mesa includes, should contain gl_mangle.h. The mesa headers are copied to the specified output directory. This allows mangled mesa headers to override other GL headers by being added to the include directory path earlier.
utility_source: Specify the source tree of a third-party utility.utility_source(cache_entry executable_name
path_to_source [file1 file2 ...])
When a third-party utility's source is included in the distribution, this command specifies its location and name. The cache entry will not be set unless the path_to_source and all listed files exist. It is assumed that the source tree of the utility will have been built before it is needed.
When cross compiling CMake will print a warning if a utility_source() command is executed, because in many cases it is used to build an executable which is executed later on. This doesn't work when cross compiling, since the executable can run only on their target platform. So in this case the cache entry has to be adjusted manually so it points to an executable which is runnable on the build host.
variable_requires: Deprecated. Use the if() command instead.Assert satisfaction of an option's required variables.
variable_requires(TEST_VARIABLE RESULT_VARIABLE
REQUIRED_VARIABLE1
REQUIRED_VARIABLE2 ...)
The first argument (TEST_VARIABLE) is the name of the variable to be tested, if that variable is false nothing else is done. If TEST_VARIABLE is true, then the next argument (RESULT_VARIABLE) is a variable that is set to true if all the required variables are set. The rest of the arguments are variables that must be true or not set to NOTFOUND to avoid an error. If any are not true, an error is reported.
write_file: Deprecated. Use the file(WRITE ) command instead.write_file(filename "message to write"... [APPEND])
The first argument is the file name, the rest of the arguments are messages to write. If the argument APPEND is specified, then the message will be appended.
NOTE 1: file(WRITE ... and file(APPEND ... do exactly the same as this one but add some more functionality.
NOTE 2: When using write_file the produced file cannot be used as an input to CMake (CONFIGURE_FILE, source file ...) because it will lead to an infinite loop. Use configure_file if you want to generate input files to CMake.
AddFileDependenciesBundleUtilitiesCMakeAddFortranSubdirectoryCMakeBackwardCompatibilityCXXCMakeDependentOptionCMakeDetermineVSServicePackCMakeExpandImportedTargetsCMakeFindFrameworksCMakeFindPackageModeCMakeForceCompilerCMakePackageConfigHelpersCMakeParseArgumentsCMakePrintSystemInformationCMakePushCheckStateCMakeVerifyManifestCPackCPackBundleCPackComponentCPackCygwinCPackDMGCPackDebCPackNSISCPackPackageMakerCPackRPMCTestCTestScriptModeCheckCCompilerFlagCheckCSourceCompilesCheckCSourceRunsCheckCXXCompilerFlagCheckCXXSourceCompilesCheckCXXSourceRunsCheckCXXSymbolExistsCheckFortranFunctionExistsCheckFunctionExistsCheckIncludeFileCheckIncludeFileCXXCheckIncludeFilesCheckLanguageCheckLibraryExistsCheckPrototypeDefinitionCheckStructHasMemberCheckSymbolExistsCheckTypeSizeCheckVariableExistsDartDeployQt4DocumentationExternalProjectFeatureSummaryFindALSAFindASPELLFindAVIFileFindArmadilloFindBISONFindBLASFindBZip2FindBoostFindBulletFindCABLEFindCUDAFindCURLFindCVSFindCoin3DFindCupsFindCursesFindCxxTestFindCygwinFindDCMTKFindDartFindDevILFindDoxygenFindEXPATFindFLEXFindFLTKFindFLTK2FindFreetypeFindGCCXMLFindGDALFindGIFFindGLUTFindGTKFindGTK2FindGTestFindGettextFindGitFindGnuTLSFindGnuplotFindHDF5FindHSPELLFindHTMLHelpFindITKFindImageMagickFindJNIFindJPEGFindJasperFindJavaFindKDE3FindKDE4FindLAPACKFindLATEXFindLibArchiveFindLibLZMAFindLibXml2FindLibXsltFindLua50FindLua51FindMFCFindMPEGFindMPEG2FindMPIFindMatlabFindMotifFindOpenALFindOpenGLFindOpenMPFindOpenSSLFindOpenSceneGraphFindOpenThreadsFindPHP4FindPNGFindPackageHandleStandardArgsFindPackageMessageFindPerlFindPerlLibsFindPhysFSFindPikeFindPkgConfigFindPostgreSQLFindProducerFindProtobufFindPythonInterpFindPythonLibsFindQtFindQt3FindQt4FindQuickTimeFindRTIFindRubyFindSDLFindSDL_imageFindSDL_mixerFindSDL_netFindSDL_soundFindSDL_ttfFindSWIGFindSelfPackersFindSquishFindSubversionFindTCLFindTIFFFindTclStubFindTclshFindThreadsFindUnixCommandsFindVTKFindWgetFindWishFindX11FindXMLRPCFindZLIBFindosgFindosgAnimationFindosgDBFindosgFXFindosgGAFindosgIntrospectionFindosgManipulatorFindosgParticleFindosgPresentationFindosgProducerFindosgQtFindosgShadowFindosgSimFindosgTerrainFindosgTextFindosgUtilFindosgViewerFindosgVolumeFindosgWidgetFindosg_functionsFindwxWidgetsFindwxWindowsFortranCInterfaceGNUInstallDirsGenerateExportHeaderGetPrerequisitesInstallRequiredSystemLibrariesMacroAddFileDependenciesProcessorCountQt4ConfigDependentSettingsQt4MacrosSelectLibraryConfigurationsSquishTestScriptTestBigEndianTestCXXAcceptsFlagTestForANSIForScopeTestForANSIStreamHeadersTestForSSTREAMTestForSTDNamespaceUseEcosUseJavaUseJavaClassFilelistUseJavaSymlinksUsePkgConfigUseQt4UseSWIGUse_wxWindowsUsewxWidgetsWriteBasicConfigVersionFileThe following modules are provided with CMake. They can be used with INCLUDE(ModuleName).
CMake Modules - Modules coming with CMake, the Cross-Platform Makefile Generator.
This is the documentation for the modules and scripts coming with CMake. Using these modules you can check the computer system for installed software packages, features of the compiler and the existance of headers to name just a few.
AddFileDependencies: ADD_FILE_DEPENDENCIES(source_file depend_files...)Adds the given files as dependencies to source_file
BundleUtilities: Functions to help assemble a standalone bundle application.A collection of CMake utility functions useful for dealing with .app bundles on the Mac and bundle-like directories on any OS.
The following functions are provided by this module:
fixup_bundle
copy_and_fixup_bundle
verify_app
get_bundle_main_executable
get_dotapp_dir
get_bundle_and_executable
get_bundle_all_executables
get_item_key
clear_bundle_keys
set_bundle_key_values
get_bundle_keys
copy_resolved_item_into_bundle
copy_resolved_framework_into_bundle
fixup_bundle_item
verify_bundle_prerequisites
verify_bundle_symlinks
Requires CMake 2.6 or greater because it uses function, break and PARENT_SCOPE. Also depends on GetPrerequisites.cmake.
FIXUP_BUNDLE(<app> <libs> <dirs>)
Fix up a bundle in-place and make it standalone, such that it can be drag-n-drop copied to another machine and run on that machine as long as all of the system libraries are compatible.
If you pass plugins to fixup_bundle as the libs parameter, you should install them or copy them into the bundle before calling fixup_bundle. The "libs" parameter is a list of libraries that must be fixed up, but that cannot be determined by otool output analysis. (i.e., plugins)
Gather all the keys for all the executables and libraries in a bundle, and then, for each key, copy each prerequisite into the bundle. Then fix each one up according to its own list of prerequisites.
Then clear all the keys and call verify_app on the final bundle to ensure that it is truly standalone.
COPY_AND_FIXUP_BUNDLE(<src> <dst> <libs> <dirs>)
Makes a copy of the bundle <src> at location <dst> and then fixes up the new copied bundle in-place at <dst>...
VERIFY_APP(<app>)
Verifies that an application <app> appears valid based on running analysis tools on it. Calls "message(FATAL_ERROR" if the application is not verified.
GET_BUNDLE_MAIN_EXECUTABLE(<bundle> <result_var>)
The result will be the full path name of the bundle's main executable file or an "error:" prefixed string if it could not be determined.
GET_DOTAPP_DIR(<exe> <dotapp_dir_var>)
Returns the nearest parent dir whose name ends with ".app" given the full path to an executable. If there is no such parent dir, then simply return the dir containing the executable.
The returned directory may or may not exist.
GET_BUNDLE_AND_EXECUTABLE(<app> <bundle_var> <executable_var> <valid_var>)
Takes either a ".app" directory name or the name of an executable nested inside a ".app" directory and returns the path to the ".app" directory in <bundle_var> and the path to its main executable in <executable_var>
GET_BUNDLE_ALL_EXECUTABLES(<bundle> <exes_var>)
Scans the given bundle recursively for all executable files and accumulates them into a variable.
GET_ITEM_KEY(<item> <key_var>)
Given a file (item) name, generate a key that should be unique considering the set of libraries that need copying or fixing up to make a bundle standalone. This is essentially the file name including extension with "." replaced by "_"
This key is used as a prefix for CMake variables so that we can associate a set of variables with a given item based on its key.
CLEAR_BUNDLE_KEYS(<keys_var>)
Loop over the list of keys, clearing all the variables associated with each key. After the loop, clear the list of keys itself.
Caller of get_bundle_keys should call clear_bundle_keys when done with list of keys.
SET_BUNDLE_KEY_VALUES(<keys_var> <context> <item> <exepath> <dirs>
<copyflag>)
Add a key to the list (if necessary) for the given item. If added, also set all the variables associated with that key.
GET_BUNDLE_KEYS(<app> <libs> <dirs> <keys_var>)
Loop over all the executable and library files within the bundle (and given as extra <libs>) and accumulate a list of keys representing them. Set values associated with each key such that we can loop over all of them and copy prerequisite libs into the bundle and then do appropriate install_name_tool fixups.
COPY_RESOLVED_ITEM_INTO_BUNDLE(<resolved_item> <resolved_embedded_item>)
Copy a resolved item into the bundle if necessary. Copy is not necessary if the resolved_item is "the same as" the resolved_embedded_item.
COPY_RESOLVED_FRAMEWORK_INTO_BUNDLE(<resolved_item> <resolved_embedded_item>)
Copy a resolved framework into the bundle if necessary. Copy is not necessary if the resolved_item is "the same as" the resolved_embedded_item.
By default, BU_COPY_FULL_FRAMEWORK_CONTENTS is not set. If you want full frameworks embedded in your bundles, set BU_COPY_FULL_FRAMEWORK_CONTENTS to ON before calling fixup_bundle. By default, COPY_RESOLVED_FRAMEWORK_INTO_BUNDLE copies the framework dylib itself plus the framework Resources directory.
FIXUP_BUNDLE_ITEM(<resolved_embedded_item> <exepath> <dirs>)
Get the direct/non-system prerequisites of the resolved embedded item. For each prerequisite, change the way it is referenced to the value of the _EMBEDDED_ITEM keyed variable for that prerequisite. (Most likely changing to an "@executable_path" style reference.)
This function requires that the resolved_embedded_item be "inside" the bundle already. In other words, if you pass plugins to fixup_bundle as the libs parameter, you should install them or copy them into the bundle before calling fixup_bundle. The "libs" parameter is a list of libraries that must be fixed up, but that cannot be determined by otool output analysis. (i.e., plugins)
Also, change the id of the item being fixed up to its own _EMBEDDED_ITEM value.
Accumulate changes in a local variable and make *one* call to install_name_tool at the end of the function with all the changes at once.
If the BU_CHMOD_BUNDLE_ITEMS variable is set then bundle items will be marked writable before install_name_tool tries to change them.
VERIFY_BUNDLE_PREREQUISITES(<bundle> <result_var> <info_var>)
Verifies that the sum of all prerequisites of all files inside the bundle are contained within the bundle or are "system" libraries, presumed to exist everywhere.
VERIFY_BUNDLE_SYMLINKS(<bundle> <result_var> <info_var>)
Verifies that any symlinks found in the bundle point to other files that are already also in the bundle... Anything that points to an external file causes this function to fail the verification.
CMakeAddFortranSubdirectory: Use MinGW gfortran from VS if a fortran compiler is not found.The 'add_fortran_subdirectory' function adds a subdirectory to a project that contains a fortran only sub-project. The module will check the current compiler and see if it can support fortran. If no fortran compiler is found and the compiler is MSVC, then this module will find the MinGW gfortran. It will then use an external project to build with the MinGW tools. It will also create imported targets for the libraries created. This will only work if the fortran code is built into a dll, so BUILD_SHARED_LIBS is turned on in the project. In addition the CMAKE_GNUtoMS option is set to on, so that the MS .lib files are created. Usage is as follows:
cmake_add_fortran_subdirectory(
<subdir> # name of subdirectory
PROJECT <project_name> # project name in subdir top CMakeLists.txt
ARCHIVE_DIR <dir> # dir where project places .lib files
RUNTIME_DIR <dir> # dir where project places .dll files
LIBRARIES <lib>... # names of library targets to import
LINK_LIBRARIES # link interface libraries for LIBRARIES
[LINK_LIBS <lib> <dep>...]...
CMAKE_COMMAND_LINE ... # extra command line flags to pass to cmake
NO_EXTERNAL_INSTALL # skip installation of external project
)
Relative paths in ARCHIVE_DIR and RUNTIME_DIR are interpreted with respect to the build directory corresponding to the source directory in which the function is invoked.
Limitations:
NO_EXTERNAL_INSTALL is required for forward compatibility with a future version that supports installation of the external project binaries during "make install".
CMakeBackwardCompatibilityCXX: define a bunch of backwards compatibility variablesCMAKE_ANSI_CXXFLAGS - flag for ansi c++
CMAKE_HAS_ANSI_STRING_STREAM - has <strstream>
INCLUDE(TestForANSIStreamHeaders)
INCLUDE(CheckIncludeFileCXX)
INCLUDE(TestForSTDNamespace)
INCLUDE(TestForANSIForScope)
CMakeDependentOption: Macro to provide an option dependent on other options.This macro presents an option to the user only if a set of other conditions are true. When the option is not presented a default value is used, but any value set by the user is preserved for when the option is presented again. Example invocation:
CMAKE_DEPENDENT_OPTION(USE_FOO "Use Foo" ON
"USE_BAR;NOT USE_ZOT" OFF)
If USE_BAR is true and USE_ZOT is false, this provides an option called USE_FOO that defaults to ON. Otherwise, it sets USE_FOO to OFF. If the status of USE_BAR or USE_ZOT ever changes, any value for the USE_FOO option is saved so that when the option is re-enabled it retains its old value.
CMakeDetermineVSServicePack: Includes a public function for assisting users in trying to determine theVisual Studio service pack in use.
Sets the passed in variable to one of the following values or an empty string if unknown.
vc80
vc80sp1
vc90
vc90sp1
vc100
vc100sp1
Usage: ===========================
if(MSVC)
include(CMakeDetermineVSServicePack)
DetermineVSServicePack( my_service_pack )
if( my_service_pack )
message(STATUS "Detected: ${my_service_pack}")
endif()
endif()
===========================
CMakeExpandImportedTargets: CMAKE_EXPAND_IMPORTED_TARGETS(<var> LIBRARIES lib1 lib2...libN
[CONFIGURATION <config>] )
CMAKE_EXPAND_IMPORTED_TARGETS() takes a list of libraries and replaces all imported targets contained in this list with their actual file paths of the referenced libraries on disk, including the libraries from their link interfaces. If a CONFIGURATION is given, it uses the respective configuration of the imported targets if it exists. If no CONFIGURATION is given, it uses the first configuration from ${CMAKE_CONFIGURATION_TYPES} if set, otherwise ${CMAKE_BUILD_TYPE}. This macro is used by all Check*.cmake files which use TRY_COMPILE() or TRY_RUN() and support CMAKE_REQUIRED_LIBRARIES , so that these checks support imported targets in CMAKE_REQUIRED_LIBRARIES:
cmake_expand_imported_targets(expandedLibs LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}" )
CMakeFindFrameworks: helper module to find OSX frameworks
CMakeFindPackageMode: This file is executed by cmake when invoked with --find-package. It expects that the following variables are set using -D:
NAME = name of the package
COMPILER_ID = the CMake compiler ID for which the result is, i.e. GNU/Intel/Clang/MSVC, etc.
LANGUAGE = language for which the result will be used, i.e. C/CXX/Fortan/ASM
MODE = EXIST : only check for existance of the given package
COMPILE : print the flags needed for compiling an object file which uses the given package
LINK : print the flags needed for linking when using the given package
QUIET = if TRUE, don't print anything
CMakeForceCompiler: This module defines macros intended for use by cross-compiling toolchain files when CMake is not able to automatically detect the compiler identification.
Macro CMAKE_FORCE_C_COMPILER has the following signature:
CMAKE_FORCE_C_COMPILER(<compiler> <compiler-id>)
It sets CMAKE_C_COMPILER to the given compiler and the cmake internal variable CMAKE_C_COMPILER_ID to the given compiler-id. It also bypasses the check for working compiler and basic compiler information tests.
Macro CMAKE_FORCE_CXX_COMPILER has the following signature:
CMAKE_FORCE_CXX_COMPILER(<compiler> <compiler-id>)
It sets CMAKE_CXX_COMPILER to the given compiler and the cmake internal variable CMAKE_CXX_COMPILER_ID to the given compiler-id. It also bypasses the check for working compiler and basic compiler information tests.
Macro CMAKE_FORCE_Fortran_COMPILER has the following signature:
CMAKE_FORCE_Fortran_COMPILER(<compiler> <compiler-id>)
It sets CMAKE_Fortran_COMPILER to the given compiler and the cmake internal variable CMAKE_Fortran_COMPILER_ID to the given compiler-id. It also bypasses the check for working compiler and basic compiler information tests.
So a simple toolchain file could look like this:
INCLUDE (CMakeForceCompiler)
SET(CMAKE_SYSTEM_NAME Generic)
CMAKE_FORCE_C_COMPILER (chc12 MetrowerksHicross)
CMAKE_FORCE_CXX_COMPILER (chc12 MetrowerksHicross)
CMakePackageConfigHelpers: CONFIGURE_PACKAGE_CONFIG_FILE(), WRITE_BASIC_PACKAGE_VERSION_FILE()CONFIGURE_PACKAGE_CONFIG_FILE(<input> <output> INSTALL_DESTINATION <path>
[PATH_VARS <var1> <var2> ... <varN>]
[NO_SET_AND_CHECK_MACRO]
[NO_CHECK_REQUIRED_COMPONENTS_MACRO])
CONFIGURE_PACKAGE_CONFIG_FILE() should be used instead of the plain CONFIGURE_FILE() command when creating the <Name>Config.cmake or <Name>-config.cmake file for installing a project or library. It helps making the resulting package relocatable by avoiding hardcoded paths in the installed Config.cmake file.
In a FooConfig.cmake file there may be code like this to make the install destinations know to the using project:
set(FOO_INCLUDE_DIR "@CMAKE_INSTALL_FULL_INCLUDEDIR@" )
set(FOO_DATA_DIR "@CMAKE_INSTALL_PREFIX@/@RELATIVE_DATA_INSTALL_DIR@" )
set(FOO_ICONS_DIR "@CMAKE_INSTALL_PREFIX@/share/icons" )
...logic to determine installedPrefix from the own location...
set(FOO_CONFIG_DIR "${installedPrefix}/@CONFIG_INSTALL_DIR@" )
All 4 options shown above are not sufficient, since the first 3 hardcode the absolute directory locations, and the 4th case works only if the logic to determine the installedPrefix is correct, and if CONFIG_INSTALL_DIR contains a relative path, which in general cannot be guaranteed. This has the effect that the resulting FooConfig.cmake file would work poorly under Windows and OSX, where users are used to choose the install location of a binary package at install time, independent from how CMAKE_INSTALL_PREFIX was set at build/cmake time.
Using CONFIGURE_PACKAGE_CONFIG_FILE() helps. If used correctly, it makes the resulting FooConfig.cmake file relocatable. Usage:
1. write a FooConfig.cmake.in file as you are used to
2. insert a line containing only the string "@PACKAGE_INIT@"
3. instead of SET(FOO_DIR "@SOME_INSTALL_DIR@"), use SET(FOO_DIR "@PACKAGE_SOME_INSTALL_DIR@")
(this must be after the @PACKAGE_INIT@ line)
4. instead of using the normal CONFIGURE_FILE(), use CONFIGURE_PACKAGE_CONFIG_FILE()
The <input> and <output> arguments are the input and output file, the same way as in CONFIGURE_FILE().
The <path> given to INSTALL_DESTINATION must be the destination where the FooConfig.cmake file will be installed to. This can either be a relative or absolute path, both work.
The variables <var1> to <varN> given as PATH_VARS are the variables which contain install destinations. For each of them the macro will create a helper variable PACKAGE_<var...>. These helper variables must be used in the FooConfig.cmake.in file for setting the installed location. They are calculated by CONFIGURE_PACKAGE_CONFIG_FILE() so that they are always relative to the installed location of the package. This works both for relative and also for absolute locations. For absolute locations it works only if the absolute location is a subdirectory of CMAKE_INSTALL_PREFIX.
By default configure_package_config_file() also generates two helper macros, set_and_check() and check_required_components() into the FooConfig.cmake file.
set_and_check() should be used instead of the normal set() command for setting directories and file locations. Additionally to setting the variable it also checks that the referenced file or directory actually exists and fails with a FATAL_ERROR otherwise. This makes sure that the created FooConfig.cmake file does not contain wrong references. When using the NO_SET_AND_CHECK_MACRO, this macro is not generated into the FooConfig.cmake file.
check_required_components(<package_name>) should be called at the end of the FooConfig.cmake file if the package supports components. This macro checks whether all requested, non-optional components have been found, and if this is not the case, sets the Foo_FOUND variable to FALSE, so that the package is considered to be not found. It does that by testing the Foo_<Component>_FOUND variables for all requested required components. When using the NO_CHECK_REQUIRED_COMPONENTS option, this macro is not generated into the FooConfig.cmake file.
For an example see below the documentation for WRITE_BASIC_PACKAGE_VERSION_FILE().
WRITE_BASIC_PACKAGE_VERSION_FILE( filename VERSION major.minor.patch COMPATIBILITY (AnyNewerVersion|SameMajorVersion|ExactVersion) )
Writes a file for use as <package>ConfigVersion.cmake file to <filename>. See the documentation of FIND_PACKAGE() for details on this.
filename is the output filename, it should be in the build tree.
major.minor.patch is the version number of the project to be installed
The COMPATIBILITY mode AnyNewerVersion means that the installed package version will be considered compatible if it is newer or exactly the same as the requested version. This mode should be used for packages which are fully backward compatible, also across major versions. If SameMajorVersion is used instead, then the behaviour differs from AnyNewerVersion in that the major version number must be the same as requested, e.g. version 2.0 will not be considered compatible if 1.0 is requested. This mode should be used for packages which guarantee backward compatibility within the same major version. If ExactVersion is used, then the package is only considered compatible if the requested version matches exactly its own version number (not considering the tweak version). For example, version 1.2.3 of a package is only considered compatible to requested version 1.2.3. This mode is for packages without compatibility guarantees. If your project has more elaborated version matching rules, you will need to write your own custom ConfigVersion.cmake file instead of using this macro.
Internally, this macro executes configure_file() to create the resulting version file. Depending on the COMPATIBLITY, either the file BasicConfigVersion-SameMajorVersion.cmake.in or BasicConfigVersion-AnyNewerVersion.cmake.in is used. Please note that these two files are internal to CMake and you should not call configure_file() on them yourself, but they can be used as starting point to create more sophisticted custom ConfigVersion.cmake files.
Example using both configure_package_config_file() and write_basic_package_version_file(): CMakeLists.txt:
set(INCLUDE_INSTALL_DIR include/ ... CACHE )
set(LIB_INSTALL_DIR lib/ ... CACHE )
set(SYSCONFIG_INSTALL_DIR etc/foo/ ... CACHE )
...
include(CMakePackageConfigHelpers)
configure_package_config_file(FooConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake
INSTALL_DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake
PATH_VARS INCLUDE_INSTALL_DIR SYSCONFIG_INSTALL_DIR)
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
VERSION 1.2.3
COMPATIBILITY SameMajorVersion )
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake )
With a FooConfig.cmake.in:
set(FOO_VERSION x.y.z)
...
@PACKAGE_INIT@
...
set_and_check(FOO_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
set_and_check(FOO_SYSCONFIG_DIR "@PACKAGE_SYSCONFIG_INSTALL_DIR@")
check_required_components(Foo)
CMakeParseArguments: CMAKE_PARSE_ARGUMENTS(<prefix> <options> <one_value_keywords> <multi_value_keywords> args...)
CMAKE_PARSE_ARGUMENTS() is intended to be used in macros or functions for parsing the arguments given to that macro or function. It processes the arguments and defines a set of variables which hold the values of the respective options.
The <options> argument contains all options for the respective macro, i.e. keywords which can be used when calling the macro without any value following, like e.g. the OPTIONAL keyword of the install() command.
The <one_value_keywords> argument contains all keywords for this macro which are followed by one value, like e.g. DESTINATION keyword of the install() command.
The <multi_value_keywords> argument contains all keywords for this macro which can be followed by more than one value, like e.g. the TARGETS or FILES keywords of the install() command.
When done, CMAKE_PARSE_ARGUMENTS() will have defined for each of the keywords listed in <options>, <one_value_keywords> and <multi_value_keywords> a variable composed of the given <prefix> followed by "_" and the name of the respective keyword. These variables will then hold the respective value from the argument list. For the <options> keywords this will be TRUE or FALSE.
All remaining arguments are collected in a variable <prefix>_UNPARSED_ARGUMENTS, this can be checked afterwards to see whether your macro was called with unrecognized parameters.
As an example here a my_install() macro, which takes similar arguments as the real install() command:
function(MY_INSTALL)
set(options OPTIONAL FAST)
set(oneValueArgs DESTINATION RENAME)
set(multiValueArgs TARGETS CONFIGURATIONS)
cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
...
Assume my_install() has been called like this:
my_install(TARGETS foo bar DESTINATION bin OPTIONAL blub)
After the cmake_parse_arguments() call the macro will have set the following variables:
MY_INSTALL_OPTIONAL = TRUE
MY_INSTALL_FAST = FALSE (this option was not used when calling my_install()
MY_INSTALL_DESTINATION = "bin"
MY_INSTALL_RENAME = "" (was not used)
MY_INSTALL_TARGETS = "foo;bar"
MY_INSTALL_CONFIGURATIONS = "" (was not used)
MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (no value expected after "OPTIONAL"
You can the continue and process these variables.
Keywords terminate lists of values, e.g. if directly after a one_value_keyword another recognized keyword follows, this is interpreted as the beginning of the new option. E.g. my_install(TARGETS foo DESTINATION OPTIONAL) would result in MY_INSTALL_DESTINATION set to "OPTIONAL", but MY_INSTALL_DESTINATION would be empty and MY_INSTALL_OPTIONAL would be set to TRUE therefor.
CMakePrintSystemInformation: print system informationThis file can be used for diagnostic purposes just include it in a project to see various internal CMake variables.
CMakePushCheckState: This module defines two macros: CMAKE_PUSH_CHECK_STATE() and CMAKE_POP_CHECK_STATE() These two macros can be used to save and restore the state of the variables CMAKE_REQUIRED_FLAGS, CMAKE_REQUIRED_DEFINITIONS, CMAKE_REQUIRED_LIBRARIES and CMAKE_REQUIRED_INCLUDES used by the various Check-files coming with CMake, like e.g. check_function_exists() etc. The variable contents are pushed on a stack, pushing multiple times is supported. This is useful e.g. when executing such tests in a Find-module, where they have to be set, but after the Find-module has been executed they should have the same value as they had before.
Usage:
cmake_push_check_state()
set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -DSOME_MORE_DEF)
check_function_exists(...)
cmake_pop_check_state()
CMakeVerifyManifest: CMakeVerifyManifest.cmake
This script is used to verify that embeded manifests and side by side manifests for a project match. To run this script, cd to a directory and run the script with cmake -P. On the command line you can pass in versions that are OK even if not found in the .manifest files. For example, cmake -Dallow_versions=8.0.50608.0 -PCmakeVerifyManifest.cmake could be used to allow an embeded manifest of 8.0.50608.0 to be used in a project even if that version was not found in the .manifest file.
CPack: Build binary and source package installers.The CPack module generates binary and source installers in a variety of formats using the cpack program. Inclusion of the CPack module adds two new targets to the resulting makefiles, package and package_source, which build the binary and source installers, respectively. The generated binary installers contain everything installed via CMake's INSTALL command (and the deprecated INSTALL_FILES, INSTALL_PROGRAMS, and INSTALL_TARGETS commands).
For certain kinds of binary installers (including the graphical installers on Mac OS X and Windows), CPack generates installers that allow users to select individual application components to install. See CPackComponent module for that.
The CPACK_GENERATOR variable has different meanings in different contexts. In your CMakeLists.txt file, CPACK_GENERATOR is a *list of generators*: when run with no other arguments, CPack will iterate over that list and produce one package for each generator. In a CPACK_PROJECT_CONFIG_FILE, though, CPACK_GENERATOR is a *string naming a single generator*. If you need per-cpack- generator logic to control *other* cpack settings, then you need a CPACK_PROJECT_CONFIG_FILE.
The CMake source tree itself contains a CPACK_PROJECT_CONFIG_FILE. See the top level file CMakeCPackOptions.cmake.in for an example.
If set, the CPACK_PROJECT_CONFIG_FILE is included automatically on a per-generator basis. It only need contain overrides.
Here's how it works:
- cpack runs
- it includes CPackConfig.cmake
- it iterates over the generators listed in that file's
CPACK_GENERATOR list variable (unless told to use just a
specific one via -G on the command line...)
- foreach generator, it then
- sets CPACK_GENERATOR to the one currently being iterated
- includes the CPACK_PROJECT_CONFIG_FILE
- produces the package for that generator
This is the key: For each generator listed in CPACK_GENERATOR in CPackConfig.cmake, cpack will *reset* CPACK_GENERATOR internally to *the one currently being used* and then include the CPACK_PROJECT_CONFIG_FILE.
Before including this CPack module in your CMakeLists.txt file, there are a variety of variables that can be set to customize the resulting installers. The most commonly-used variables are:
CPACK_PACKAGE_NAME - The name of the package (or application). If
not specified, defaults to the project name.
CPACK_PACKAGE_VENDOR - The name of the package vendor. (e.g.,
"Kitware").
CPACK_PACKAGE_DIRECTORY - The directory in which CPack is doing its
packaging. If it is not set then this will default (internally) to the
build dir. This variable may be defined in CPack config file or from
the cpack command line option "-B". If set the command line option
override the value found in the config file.
CPACK_PACKAGE_VERSION_MAJOR - Package major Version
CPACK_PACKAGE_VERSION_MINOR - Package minor Version
CPACK_PACKAGE_VERSION_PATCH - Package patch Version
CPACK_PACKAGE_DESCRIPTION_FILE - A text file used to describe the
project. Used, for example, the introduction screen of a
CPack-generated Windows installer to describe the project.
CPACK_PACKAGE_DESCRIPTION_SUMMARY - Short description of the
project (only a few words).
CPACK_PACKAGE_FILE_NAME - The name of the package file to generate,
not including the extension. For example, cmake-2.6.1-Linux-i686.
The default value is
${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}.
CPACK_PACKAGE_INSTALL_DIRECTORY - Installation directory on the
target system. This may be used by some CPack generators
like NSIS to create an installation directory e.g., "CMake 2.5"
below the installation prefix. All installed element will be
put inside this directory.
CPACK_PACKAGE_ICON - A branding image that will be displayed inside
the installer (used by GUI installers).
CPACK_PROJECT_CONFIG_FILE - CPack-time project CPack configuration
file. This file included at cpack time, once per
generator after CPack has set CPACK_GENERATOR to the actual generator
being used. It allows per-generator setting of CPACK_* variables at
cpack time.
CPACK_RESOURCE_FILE_LICENSE - License to be embedded in the installer. It
will typically be displayed to the user by the produced installer
(often with an explicit "Accept" button, for graphical installers)
prior to installation. This license file is NOT added to installed
file but is used by some CPack generators like NSIS. If you want
to install a license file (may be the same as this one)
along with your project you must add an appropriate CMake INSTALL
command in your CMakeLists.txt.
CPACK_RESOURCE_FILE_README - ReadMe file to be embedded in the installer. It
typically describes in some detail the purpose of the project
during the installation. Not all CPack generators uses
this file.
CPACK_RESOURCE_FILE_WELCOME - Welcome file to be embedded in the
installer. It welcomes users to this installer.
Typically used in the graphical installers on Windows and Mac OS X.
CPACK_MONOLITHIC_INSTALL - Disables the component-based
installation mechanism. When set the component specification is ignored
and all installed items are put in a single "MONOLITHIC" package.
Some CPack generators do monolithic packaging by default and
may be asked to do component packaging by setting
CPACK_<GENNAME>_COMPONENT_INSTALL to 1/TRUE.
CPACK_GENERATOR - List of CPack generators to use. If not
specified, CPack will create a set of options CPACK_BINARY_<GENNAME> (e.g.,
CPACK_BINARY_NSIS) allowing the user to enable/disable individual
generators. This variable may be used on the command line
as well as in:
cpack -D CPACK_GENERATOR="ZIP;TGZ" /path/to/build/tree
CPACK_OUTPUT_CONFIG_FILE - The name of the CPack binary configuration
file. This file is the CPack configuration generated by the CPack module
for binary installers. Defaults to CPackConfig.cmake.
CPACK_PACKAGE_EXECUTABLES - Lists each of the executables and associated
text label to be used to create Start Menu shortcuts. For example,
setting this to the list ccmake;CMake will
create a shortcut named "CMake" that will execute the installed
executable ccmake. Not all CPack generators use it (at least NSIS and
OSXX11 do).
CPACK_STRIP_FILES - List of files to be stripped. Starting with
CMake 2.6.0 CPACK_STRIP_FILES will be a boolean variable which
enables stripping of all files (a list of files evaluates to TRUE
in CMake, so this change is compatible).
The following CPack variables are specific to source packages, and will not affect binary packages:
CPACK_SOURCE_PACKAGE_FILE_NAME - The name of the source package. For
example cmake-2.6.1.
CPACK_SOURCE_STRIP_FILES - List of files in the source tree that
will be stripped. Starting with CMake 2.6.0
CPACK_SOURCE_STRIP_FILES will be a boolean variable which enables
stripping of all files (a list of files evaluates to TRUE in CMake,
so this change is compatible).
CPACK_SOURCE_GENERATOR - List of generators used for the source
packages. As with CPACK_GENERATOR, if this is not specified then
CPack will create a set of options (e.g., CPACK_SOURCE_ZIP)
allowing users to select which packages will be generated.
CPACK_SOURCE_OUTPUT_CONFIG_FILE - The name of the CPack source
configuration file. This file is the CPack configuration generated by the
CPack module for source installers. Defaults to CPackSourceConfig.cmake.
CPACK_SOURCE_IGNORE_FILES - Pattern of files in the source tree
that won't be packaged when building a source package. This is a
list of regular expression patterns (that must be properly escaped),
e.g., /CVS/;/\\.svn/;\\.swp$;\\.#;/#;.*~;cscope.*
The following variables are for advanced uses of CPack:
CPACK_CMAKE_GENERATOR - What CMake generator should be used if the
project is CMake project. Defaults to the value of CMAKE_GENERATOR
few users will want to change this setting.
CPACK_INSTALL_CMAKE_PROJECTS - List of four values that specify
what project to install. The four values are: Build directory,
Project Name, Project Component, Directory. If omitted, CPack will
build an installer that installers everything.
CPACK_SYSTEM_NAME - System name, defaults to the value of
${CMAKE_SYSTEM_NAME}.
CPACK_PACKAGE_VERSION - Package full version, used internally. By
default, this is built from CPACK_PACKAGE_VERSION_MAJOR,
CPACK_PACKAGE_VERSION_MINOR, and CPACK_PACKAGE_VERSION_PATCH.
CPACK_TOPLEVEL_TAG - Directory for the installed files.
CPACK_INSTALL_COMMANDS - Extra commands to install components.
CPACK_INSTALLED_DIRECTORIES - Extra directories to install.
CPACK_PACKAGE_INSTALL_REGISTRY_KEY - Registry key used when
installing this project. This is only used
by installer for Windows.
CPACK_CREATE_DESKTOP_LINKS - List of desktop links to create.
CPackBundle: CPack Bundle generator (Mac OS X) specific optionsInstallers built on Mac OS X using the Bundle generator use the aforementioned DragNDrop (CPACK_DMG_xxx) variables, plus the following Bundle-specific parameters (CPACK_BUNDLE_xxx).
CPACK_BUNDLE_NAME - The name of the generated bundle. This
appears in the OSX finder as the bundle name. Required.
CPACK_BUNDLE_PLIST - Path to an OSX plist file that will be used
for the generated bundle. This assumes that the caller has generated
or specified their own Info.plist file. Required.
CPACK_BUNDLE_ICON - Path to an OSX icon file that will be used as
the icon for the generated bundle. This is the icon that appears in the
OSX finder for the bundle, and in the OSX dock when the bundle is opened.
Required.
CPACK_BUNDLE_STARTUP_COMMAND - Path to a startup script. This is a path to
an executable or script that will be run whenever an end-user double-clicks
the generated bundle in the OSX Finder. Optional.
CPackComponent: Build binary and source package installersThe CPackComponent module is the module which handles the component part of CPack. See CPack module for general information about CPack.
For certain kinds of binary installers (including the graphical installers on Mac OS X and Windows), CPack generates installers that allow users to select individual application components to install. The contents of each of the components are identified by the COMPONENT argument of CMake's INSTALL command. These components can be annotated with user-friendly names and descriptions, inter-component dependencies, etc., and grouped in various ways to customize the resulting installer. See the cpack_add_* commands, described below, for more information about component-specific installations.
Component-specific installation allows users to select specific sets of components to install during the install process. Installation components are identified by the COMPONENT argument of CMake's INSTALL commands, and should be further described by the following CPack commands:
CPACK_COMPONENTS_ALL - The list of component to install.
The default value of this variable is computed by CPack
and contains all components defined by the project. The
user may set it to only include the specified components.
CPACK_<GENNAME>_COMPONENT_INSTALL - Enable/Disable component install for
CPack generator <GENNAME>.
Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
default behavior. e.g. RPM builds monolithic whereas NSIS builds component.
One can change the default behavior by setting this variable to 0/1 or OFF/ON.
CPACK_COMPONENTS_GROUPING - Specify how components are grouped for multi-package
component-aware CPack generators.
Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates several
packages files when asked for component packaging. They group the component
differently depending on the value of this variable:
- ONE_PER_GROUP (default): creates one package file per component group
- ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component
- IGNORE : creates one package per component, i.e. IGNORE component group
One can specify different grouping for different CPack generator by using
a CPACK_PROJECT_CONFIG_FILE.
CPACK_COMPONENT_<compName>_DISPLAY_NAME - The name to be displayed for a component.
CPACK_COMPONENT_<compName>_DESCRIPTION - The description of a component.
CPACK_COMPONENT_<compName>_GROUP - The group of a component.
CPACK_COMPONENT_<compName>_DEPENDS - The dependencies (list of components)
on which this component depends.
CPACK_COMPONENT_<compName>_REQUIRED - True is this component is required.
cpack_add_component - Describes a CPack installation component
named by the COMPONENT argument to a CMake INSTALL command.
cpack_add_component(compname
[DISPLAY_NAME name]
[DESCRIPTION description]
[HIDDEN | REQUIRED | DISABLED ]
[GROUP group]
[DEPENDS comp1 comp2 ... ]
[INSTALL_TYPES type1 type2 ... ]
[DOWNLOADED]
[ARCHIVE_FILE filename])
The cmake_add_component command describes an installation
component, which the user can opt to install or remove as part of
the graphical installation process. compname is the name of the
component, as provided to the COMPONENT argument of one or more
CMake INSTALL commands.
DISPLAY_NAME is the displayed name of the component, used in
graphical installers to display the component name. This value can
be any string.
DESCRIPTION is an extended description of the component, used in
graphical installers to give the user additional information about
the component. Descriptions can span multiple lines using "\n" as
the line separator. Typically, these descriptions should be no
more than a few lines long.
HIDDEN indicates that this component will be hidden in the
graphical installer, so that the user cannot directly change
whether it is installed or not.
REQUIRED indicates that this component is required, and therefore
will always be installed. It will be visible in the graphical
installer, but it cannot be unselected. (Typically, required
components are shown greyed out).
DISABLED indicates that this component should be disabled
(unselected) by default. The user is free to select this component
for installation, unless it is also HIDDEN.
DEPENDS lists the components on which this component depends. If
this component is selected, then each of the components listed
must also be selected. The dependency information is encoded
within the installer itself, so that users cannot install
inconsitent sets of components.
GROUP names the component group of which this component is a
part. If not provided, the component will be a standalone
component, not part of any component group. Component groups are
described with the cpack_add_component_group command, detailed
below.
INSTALL_TYPES lists the installation types of which this component
is a part. When one of these installations types is selected, this
component will automatically be selected. Installation types are
described with the cpack_add_install_type command, detailed below.
DOWNLOADED indicates that this component should be downloaded
on-the-fly by the installer, rather than packaged in with the
installer itself. For more information, see the cpack_configure_downloads
command.
ARCHIVE_FILE provides a name for the archive file created by CPack
to be used for downloaded components. If not supplied, CPack will
create a file with some name based on CPACK_PACKAGE_FILE_NAME and
the name of the component. See cpack_configure_downloads for more
information.
cpack_add_component_group - Describes a group of related CPack
installation components.
cpack_add_component_group(groupname
[DISPLAY_NAME name]
[DESCRIPTION description]
[PARENT_GROUP parent]
[EXPANDED]
[BOLD_TITLE])
The cpack_add_component_group describes a group of installation
components, which will be placed together within the listing of
options. Typically, component groups allow the user to
select/deselect all of the components within a single group via a
single group-level option. Use component groups to reduce the
complexity of installers with many options. groupname is an
arbitrary name used to identify the group in the GROUP argument of
the cpack_add_component command, which is used to place a
component in a group. The name of the group must not conflict with
the name of any component.
DISPLAY_NAME is the displayed name of the component group, used in
graphical installers to display the component group name. This
value can be any string.
DESCRIPTION is an extended description of the component group,
used in graphical installers to give the user additional
information about the components within that group. Descriptions
can span multiple lines using "\n" as the line
separator. Typically, these descriptions should be no more than a
few lines long.
PARENT_GROUP, if supplied, names the parent group of this group.
Parent groups are used to establish a hierarchy of groups,
providing an arbitrary hierarchy of groups.
EXPANDED indicates that, by default, the group should show up as
"expanded", so that the user immediately sees all of the
components within the group. Otherwise, the group will initially
show up as a single entry.
BOLD_TITLE indicates that the group title should appear in bold,
to call the user's attention to the group.
cpack_add_install_type - Add a new installation type containing a
set of predefined component selections to the graphical installer.
cpack_add_install_type(typename
[DISPLAY_NAME name])
The cpack_add_install_type command identifies a set of preselected
components that represents a common use case for an
application. For example, a "Developer" install type might include
an application along with its header and library files, while an
"End user" install type might just include the application's
executable. Each component identifies itself with one or more
install types via the INSTALL_TYPES argument to
cpack_add_component.
DISPLAY_NAME is the displayed name of the install type, which will
typically show up in a drop-down box within a graphical
installer. This value can be any string.
cpack_configure_downloads - Configure CPack to download selected
components on-the-fly as part of the installation process.
cpack_configure_downloads(site
[UPLOAD_DIRECTORY dirname]
[ALL]
[ADD_REMOVE|NO_ADD_REMOVE])
The cpack_configure_downloads command configures installation-time
downloads of selected components. For each downloadable component,
CPack will create an archive containing the contents of that
component, which should be uploaded to the given site. When the
user selects that component for installation, the installer will
download and extract the component in place. This feature is
useful for creating small installers that only download the
requested components, saving bandwidth. Additionally, the
installers are small enough that they will be installed as part of
the normal installation process, and the "Change" button in
Windows Add/Remove Programs control panel will allow one to add or
remove parts of the application after the original
installation. On Windows, the downloaded-components functionality
requires the ZipDLL plug-in for NSIS, available at:
http://nsis.sourceforge.net/ZipDLL_plug-in
On Mac OS X, installers that download components on-the-fly can
only be built and installed on system using Mac OS X 10.5 or
later.
The site argument is a URL where the archives for downloadable
components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
All of the archives produced by CPack should be uploaded to that location.
UPLOAD_DIRECTORY is the local directory where CPack will create the
various archives for each of the components. The contents of this
directory should be uploaded to a location accessible by the URL given
in the site argument. If omitted, CPack will use the directory
CPackUploads inside the CMake binary directory to store the generated
archives.
The ALL flag indicates that all components be downloaded. Otherwise, only
those components explicitly marked as DOWNLOADED or that have a specified
ARCHIVE_FILE will be downloaded. Additionally, the ALL option implies
ADD_REMOVE (unless NO_ADD_REMOVE is specified).
ADD_REMOVE indicates that CPack should install a copy of the installer
that can be called from Windows' Add/Remove Programs dialog (via the
"Modify" button) to change the set of installed components. NO_ADD_REMOVE
turns off this behavior. This option is ignored on Mac OS X.
CPackCygwin: Cygwin CPack generator (Cygwin).The following variable is specific to installers build on and/or for Cygwin:
CPACK_CYGWIN_PATCH_NUMBER - The Cygwin patch number.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_PATCH_FILE - The Cygwin patch file.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_BUILD_SCRIPT - The Cygwin build script.
FIXME: This documentation is incomplete.
CPackDMG: DragNDrop CPack generator (Mac OS X).The following variables are specific to the DragNDrop installers built on Mac OS X:
CPACK_DMG_VOLUME_NAME - The volume name of the generated disk
image. Defaults to CPACK_PACKAGE_FILE_NAME.
CPACK_DMG_FORMAT - The disk image format. Common values are UDRO
(UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF
bzip2-compressed). Refer to hdiutil(1) for more information on
other available formats.
CPACK_DMG_DS_STORE - Path to a custom DS_Store file. This .DS_Store
file e.g. can be used to specify the Finder window
position/geometry and layout (such as hidden toolbars, placement of the
icons etc.). This file has to be generated by the Finder (either manually or
through OSA-script) using a normal folder from which the .DS_Store
file can then be extracted.
CPACK_DMG_BACKGROUND_IMAGE - Path to a background image file. This
file will be used as the background for the Finder Window when the disk
image is opened. By default no background image is set. The background
image is applied after applying the custom .DS_Store file.
CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to
operate on disk image files on Mac OS X. This variable can be used
to override the automatically detected command (or specify its
location if the auto-detection fails to find it.)
CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set
extended attributes on files and directories on Mac OS X. This
variable can be used to override the automatically detected
command (or specify its location if the auto-detection fails to
find it.)
CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile
resources on Mac OS X. This variable can be used to override the
automatically detected command (or specify its location if the
auto-detection fails to find it.)
CPackDeb: The builtin (binary) CPack Deb generator (Unix only)CPackDeb may be used to create Deb package using CPack. CPackDeb is a CPack generator thus it uses the CPACK_XXX variables used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration. CPackDeb generator should work on any linux host but it will SYSTEM_N user-friendly names and descriptions, inter-component dependencies, etc., and grouped in various ways to customize the resulting installer. See the cpack_add_* commands, described below, for more information about component-specific installations.
Component-specific installation allows users to select specific sets of components to install during the install process. Installation components are identified by the COMPONENT argument of CMake's INSTALL commands, and should be further described by the following CPack commands:
CPACK_COMPONENTS_ALL - The list of component to install.
The default value of this variable is computed by CPack
and contains all components defined by the project. The
user may set it to only include the specified components.
CPACK_<GENNAME>_COMPONENT_INSTALL - Enable/Disable component install for
CPack generator <GENNAME>.
Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
default behavior. e.g. RPM builds monolithic whereas NSIS builds component.
One can change the default behavior by setting this variable to 0/1 or OFF/ON.
CPACK_COMPONENTS_GROUPING - Specify how components are grouped for multi-package
component-aware CPack generators.
Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates several
packages files when asked for component packaging. They group the component
differently depending on the value of this variable:
- ONE_PER_GROUP (default): creates one package file per component group
- ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component
- IGNORE : creates one package per component, i.e. IGNORE component group
One can specify different grouping for different CPack generator by using
a CPACK_PROJECT_CONFIG_FILE.
CPACK_COMPONENT_<compName>_DISPLAY_NAME - The name to be displayed for a component.
CPACK_COMPONENT_<compName>_DESCRIPTION - The description of a component.
CPACK_COMPONENT_<compName>_GROUP - The group of a component.
CPACK_COMPONENT_<compName>_DEPENDS - The dependencies (list of components)
on which this component depends.
CPACK_COMPONENT_<compName>_REQUIRED - True is this component is required.
cpack_add_component - Describes a CPack installation component
named by the COMPONENT argument to a CMake INSTALL command.
cpack_add_component(compname
[DISPLAY_NAME name]
[DESCRIPTION description]
[HIDDEN | REQUIRED | DISABLED ]
[GROUP group]
[DEPENDS comp1 comp2 ... ]
[INSTALL_TYPES type1 type2 ... ]
[DOWNLOADED]
[ARCHIVE_FILE filename])
The cmake_add_component command describes an installation
component, which the user can opt to install or remove as part of
the graphical installation process. compname is the name of the
component, as provided to the COMPONENT argument of one or more
CMake INSTALL commands.
DISPLAY_NAME is the displayed name of the component, used in
graphical installers to display the component name. This value can
be any string.
DESCRIPTION is an extended description of the component, used in
graphical installers to give the user additional information about
the component. Descriptions can span multiple lines using "\n" as
the line separator. Typically, these descriptions should be no
more than a few lines long.
HIDDEN indicates that this component will be hidden in the
graphical installer, so that the user cannot directly change
whether it is installed or not.
REQUIRED indicates that this component is required, and therefore
will always be installed. It will be visible in the graphical
installer, but it cannot be unselected. (Typically, required
components are shown greyed out).
DISABLED indicates that this component should be disabled
(unselected) by default. The user is free to select this component
for installation, unless it is also HIDDEN.
DEPENDS lists the components on which this component depends. If
this component is selected, then each of the components listed
must also be selected. The dependency information is encoded
within the installer itself, so that users cannot install
inconsitent sets of components.
GROUP names the component group of which this component is a
part. If not provided, the component will be a standalone
component, not part of any component group. Component groups are
described with the cpack_add_component_group command, detailed
below.
INSTALL_TYPES lists the installation types of which this component
is a part. When one of these installations types is selected, this
component will automatically be selected. Installation types are
described with the cpack_add_install_type command, detailed below.
DOWNLOADED indicates that this component should be downloaded
on-the-fly by the installer, rather than packaged in with the
installer itself. For more information, see the cpack_configure_downloads
command.
ARCHIVE_FILE provides a name for the archive file created by CPack
to be used for downloaded components. If not supplied, CPack will
create a file with some name based on CPACK_PACKAGE_FILE_NAME and
the name of the component. See cpack_configure_downloads for more
information.
cpack_add_component_group - Describes a group of related CPack
installation components.
cpack_add_component_group(groupname
[DISPLAY_NAME name]
[DESCRIPTION description]
[PARENT_GROUP parent]
[EXPANDED]
[BOLD_TITLE])
The cpack_add_component_group describes a group of installation
components, which will be placed together within the listing of
options. Typically, component groups allow the user to
select/deselect all of the components within a single group via a
single group-level option. Use component groups to reduce the
complexity of installers with many options. groupname is an
arbitrary name used to identify the group in the GROUP argument of
the cpack_add_component command, which is used to place a
component in a group. The name of the group must not conflict with
the name of any component.
DISPLAY_NAME is the displayed name of the component group, used in
graphical installers to display the component group name. This
value can be any string.
DESCRIPTION is an extended description of the component group,
used in graphical installers to give the user additional
information about the components within that group. Descriptions
can span multiple lines using "\n" as the line
separator. Typically, these descriptions should be no more than a
few lines long.
PARENT_GROUP, if supplied, names the parent group of this group.
Parent groups are used to establish a hierarchy of groups,
providing an arbitrary hierarchy of groups.
EXPANDED indicates that, by default, the group should show up as
"expanded", so that the user immediately sees all of the
components within the group. Otherwise, the group will initially
show up as a single entry.
BOLD_TITLE indicates that the group title should appear in bold,
to call the user's attention to the group.
cpack_add_install_type - Add a new installation type containing a
set of predefined component selections to the graphical installer.
cpack_add_install_type(typename
[DISPLAY_NAME name])
The cpack_add_install_type command identifies a set of preselected
components that represents a common use case for an
application. For example, a "Developer" install type might include
an application along with its header and library files, while an
"End user" install type might just include the application's
executable. Each component identifies itself with one or more
install types via the INSTALL_TYPES argument to
cpack_add_component.
DISPLAY_NAME is the displayed name of the install type, which will
typically show up in a drop-down box within a graphical
installer. This value can be any string.
cpack_configure_downloads - Configure CPack to download selected
components on-the-fly as part of the installation process.
cpack_configure_downloads(site
[UPLOAD_DIRECTORY dirname]
[ALL]
[ADD_REMOVE|NO_ADD_REMOVE])
The cpack_configure_downloads command configures installation-time
downloads of selected components. For each downloadable component,
CPack will create an archive containing the contents of that
component, which should be uploaded to the given site. When the
user selects that component for installation, the installer will
download and extract the component in place. This feature is
useful for creating small installers that only download the
requested components, saving bandwidth. Additionally, the
installers are small enough that they will be installed as part of
the normal installation process, and the "Change" button in
Windows Add/Remove Programs control panel will allow one to add or
remove parts of the application after the original
installation. On Windows, the downloaded-components functionality
requires the ZipDLL plug-in for NSIS, available at:
http://nsis.sourceforge.net/ZipDLL_plug-in
On Mac OS X, installers that download components on-the-fly can
only be built and installed on system using Mac OS X 10.5 or
later.
The site argument is a URL where the archives for downloadable
components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
All of the archives produced by CPack should be uploaded to that location.
UPLOAD_DIRECTORY is the local directory where CPack will create the
various archives for each of the components. The contents of this
directory should be uploaded to a location accessible by the URL given
in the site argument. If omitted, CPack will use the directory
CPackUploads inside the CMake binary directory to store the generated
archives.
The ALL flag indicates that all components be downloaded. Otherwise, only
those components explicitly marked as DOWNLOADED or that have a specified
ARCHIVE_FILE will be downloaded. Additionally, the ALL option implies
ADD_REMOVE (unless NO_ADD_REMOVE is specified).
ADD_REMOVE indicates that CPack should install a copy of the installer
that can be called from Windows' Add/Remove Programs dialog (via the
"Modify" button) to change the set of installed components. NO_ADD_REMOVE
turns off this behavior. This option is ignored on Mac OS X.
CPackCygwin: Cygwin CPack generator (Cygwin).The following variable is specific to installers build on and/or for Cygwin:
CPACK_CYGWIN_PATCH_NUMBER - The Cygwin patch number.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_PATCH_FILE - The Cygwin patch file.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_BUILD_SCRIPT - The Cygwin build script.
FIXME: This documentation is incomplete.
CPackDMG: DragNDrop CPack generator (Mac OS X).The following variables are specific to the DragNDrop installers built on Mac OS X:
CPACK_DMG_VOLUME_NAME - The volume name of the generated disk
image. Defaults to CPACK_PACKAGE_FILE_NAME.
CPACK_DMG_FORMAT - The disk image format. Common values are UDRO
(UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF
bzip2-compressed). Refer to hdiutil(1) for more information on
other available formats.
CPACK_DMG_DS_STORE - Path to a custom DS_Store file. This .DS_Store
file e.g. can be used to specify the Finder window
position/geometry and layout (such as hidden toolbars, placement of the
icons etc.). This file has to be generated by the Finder (either manually or
through OSA-script) using a normal folder from which the .DS_Store
file can then be extracted.
CPACK_DMG_BACKGROUND_IMAGE - Path to a background image file. This
file will be used as the background for the Finder Window when the disk
image is opened. By default no background image is set. The background
image is applied after applying the custom .DS_Store file.
CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to
operate on disk image files on Mac OS X. This variable can be used
to override the automatically detected command (or specify its
location if the auto-detection fails to find it.)
CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set
extended attributes on files and directories on Mac OS X. This
variable can be used to override the automatically detected
command (or specify its location if the auto-detection fails to
find it.)
CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile
resources on Mac OS X. This variable can be used to override the
automatically detected command (or specify its location if the
auto-detection fails to find it.)
CPackDeb: The builtin (binary) CPack Deb generator (Unix only)CPackDeb may be used to create Deb package using CPack. CPackDeb is a CPack generator thus it uses the CPACK_XXX variables used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration. CPackDeb generator should work on any linux host but it will SYSTEM_N user-friendly names and descriptions, inter-component dependencies, etc., and grouped in various ways to customize the resulting installer. See the cpack_add_* commands, described below, for more information about component-specific installations.
Component-specific installation allows users to select specific sets of components to install during the install process. Installation components are identified by the COMPONENT argument of CMake's INSTALL commands, and should be further described by the following CPack commands:
CPACK_COMPONENTS_ALL - The list of component to install.
The default value of this variable is computed by CPack
and contains all components defined by the project. The
user may set it to only include the specified components.
CPACK_<GENNAME>_COMPONENT_INSTALL - Enable/Disable component install for
CPack generator <GENNAME>.
Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
default behavior. e.g. RPM builds monolithic whereas NSIS builds component.
One can change the default behavior by setting this variable to 0/1 or OFF/ON.
CPACK_COMPONENTS_GROUPING - Specify how components are grouped for multi-package
component-aware CPack generators.
Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates several
packages files when asked for component packaging. They group the component
differently depending on the value of this variable:
- ONE_PER_GROUP (default): creates one package file per component group
- ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component
- IGNORE : creates one package per component, i.e. IGNORE component group
One can specify different grouping for different CPack generator by using
a CPACK_PROJECT_CONFIG_FILE.
CPACK_COMPONENT_<compName>_DISPLAY_NAME - The name to be displayed for a component.
CPACK_COMPONENT_<compName>_DESCRIPTION - The description of a component.
CPACK_COMPONENT_<compName>_GROUP - The group of a component.
CPACK_COMPONENT_<compName>_DEPENDS - The dependencies (list of components)
on which this component depends.
CPACK_COMPONENT_<compName>_REQUIRED - True is this component is required.
cpack_add_component - Describes a CPack installation component
named by the COMPONENT argument to a CMake INSTALL command.
cpack_add_component(compname
[DISPLAY_NAME name]
[DESCRIPTION description]
[HIDDEN | REQUIRED | DISABLED ]
[GROUP group]
[DEPENDS comp1 comp2 ... ]
[INSTALL_TYPES type1 type2 ... ]
[DOWNLOADED]
[ARCHIVE_FILE filename])
The cmake_add_component command describes an installation
component, which the user can opt to install or remove as part of
the graphical installation process. compname is the name of the
component, as provided to the COMPONENT argument of one or more
CMake INSTALL commands.
DISPLAY_NAME is the displayed name of the component, used in
graphical installers to display the component name. This value can
be any string.
DESCRIPTION is an extended description of the component, used in
graphical installers to give the user additional information about
the component. Descriptions can span multiple lines using "\n" as
the line separator. Typically, these descriptions should be no
more than a few lines long.
HIDDEN indicates that this component will be hidden in the
graphical installer, so that the user cannot directly change
whether it is installed or not.
REQUIRED indicates that this component is required, and therefore
will always be installed. It will be visible in the graphical
installer, but it cannot be unselected. (Typically, required
components are shown greyed out).
DISABLED indicates that this component should be disabled
(unselected) by default. The user is free to select this component
for installation, unless it is also HIDDEN.
DEPENDS lists the components on which this component depends. If
this component is selected, then each of the components listed
must also be selected. The dependency information is encoded
within the installer itself, so that users cannot install
inconsitent sets of components.
GROUP names the component group of which this component is a
part. If not provided, the component will be a standalone
component, not part of any component group. Component groups are
described with the cpack_add_component_group command, detailed
below.
INSTALL_TYPES lists the installation types of which this component
is a part. When one of these installations types is selected, this
component will automatically be selected. Installation types are
described with the cpack_add_install_type command, detailed below.
DOWNLOADED indicates that this component should be downloaded
on-the-fly by the installer, rather than packaged in with the
installer itself. For more information, see the cpack_configure_downloads
command.
ARCHIVE_FILE provides a name for the archive file created by CPack
to be used for downloaded components. If not supplied, CPack will
create a file with some name based on CPACK_PACKAGE_FILE_NAME and
the name of the component. See cpack_configure_downloads for more
information.
cpack_add_component_group - Describes a group of related CPack
installation components.
cpack_add_component_group(groupname
[DISPLAY_NAME name]
[DESCRIPTION description]
[PARENT_GROUP parent]
[EXPANDED]
[BOLD_TITLE])
The cpack_add_component_group describes a group of installation
components, which will be placed together within the listing of
options. Typically, component groups allow the user to
select/deselect all of the components within a single group via a
single group-level option. Use component groups to reduce the
complexity of installers with many options. groupname is an
arbitrary name used to identify the group in the GROUP argument of
the cpack_add_component command, which is used to place a
component in a group. The name of the group must not conflict with
the name of any component.
DISPLAY_NAME is the displayed name of the component group, used in
graphical installers to display the component group name. This
value can be any string.
DESCRIPTION is an extended description of the component group,
used in graphical installers to give the user additional
information about the components within that group. Descriptions
can span multiple lines using "\n" as the line
separator. Typically, these descriptions should be no more than a
few lines long.
PARENT_GROUP, if supplied, names the parent group of this group.
Parent groups are used to establish a hierarchy of groups,
providing an arbitrary hierarchy of groups.
EXPANDED indicates that, by default, the group should show up as
"expanded", so that the user immediately sees all of the
components within the group. Otherwise, the group will initially
show up as a single entry.
BOLD_TITLE indicates that the group title should appear in bold,
to call the user's attention to the group.
cpack_add_install_type - Add a new installation type containing a
set of predefined component selections to the graphical installer.
cpack_add_install_type(typename
[DISPLAY_NAME name])
The cpack_add_install_type command identifies a set of preselected
components that represents a common use case for an
application. For example, a "Developer" install type might include
an application along with its header and library files, while an
"End user" install type might just include the application's
executable. Each component identifies itself with one or more
install types via the INSTALL_TYPES argument to
cpack_add_component.
DISPLAY_NAME is the displayed name of the install type, which will
typically show up in a drop-down box within a graphical
installer. This value can be any string.
cpack_configure_downloads - Configure CPack to download selected
components on-the-fly as part of the installation process.
cpack_configure_downloads(site
[UPLOAD_DIRECTORY dirname]
[ALL]
[ADD_REMOVE|NO_ADD_REMOVE])
The cpack_configure_downloads command configures installation-time
downloads of selected components. For each downloadable component,
CPack will create an archive containing the contents of that
component, which should be uploaded to the given site. When the
user selects that component for installation, the installer will
download and extract the component in place. This feature is
useful for creating small installers that only download the
requested components, saving bandwidth. Additionally, the
installers are small enough that they will be installed as part of
the normal installation process, and the "Change" button in
Windows Add/Remove Programs control panel will allow one to add or
remove parts of the application after the original
installation. On Windows, the downloaded-components functionality
requires the ZipDLL plug-in for NSIS, available at:
http://nsis.sourceforge.net/ZipDLL_plug-in
On Mac OS X, installers that download components on-the-fly can
only be built and installed on system using Mac OS X 10.5 or
later.
The site argument is a URL where the archives for downloadable
components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
All of the archives produced by CPack should be uploaded to that location.
UPLOAD_DIRECTORY is the local directory where CPack will create the
various archives for each of the components. The contents of this
directory should be uploaded to a location accessible by the URL given
in the site argument. If omitted, CPack will use the directory
CPackUploads inside the CMake binary directory to store the generated
archives.
The ALL flag indicates that all components be downloaded. Otherwise, only
those components explicitly marked as DOWNLOADED or that have a specified
ARCHIVE_FILE will be downloaded. Additionally, the ALL option implies
ADD_REMOVE (unless NO_ADD_REMOVE is specified).
ADD_REMOVE indicates that CPack should install a copy of the installer
that can be called from Windows' Add/Remove Programs dialog (via the
"Modify" button) to change the set of installed components. NO_ADD_REMOVE
turns off this behavior. This option is ignored on Mac OS X.
CPackCygwin: Cygwin CPack generator (Cygwin).The following variable is specific to installers build on and/or for Cygwin:
CPACK_CYGWIN_PATCH_NUMBER - The Cygwin patch number.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_PATCH_FILE - The Cygwin patch file.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_BUILD_SCRIPT - The Cygwin build script.
FIXME: This documentation is incomplete.
CPackDMG: DragNDrop CPack generator (Mac OS X).The following variables are specific to the DragNDrop installers built on Mac OS X:
CPACK_DMG_VOLUME_NAME - The volume name of the generated disk
image. Defaults to CPACK_PACKAGE_FILE_NAME.
CPACK_DMG_FORMAT - The disk image format. Common values are UDRO
(UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF
bzip2-compressed). Refer to hdiutil(1) for more information on
other available formats.
CPACK_DMG_DS_STORE - Path to a custom DS_Store file. This .DS_Store
file e.g. can be used to specify the Finder window
position/geometry and layout (such as hidden toolbars, placement of the
icons etc.). This file has to be generated by the Finder (either manually or
through OSA-script) using a normal folder from which the .DS_Store
file can then be extracted.
CPACK_DMG_BACKGROUND_IMAGE - Path to a background image file. This
file will be used as the background for the Finder Window when the disk
image is opened. By default no background image is set. The background
image is applied after applying the custom .DS_Store file.
CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to
operate on disk image files on Mac OS X. This variable can be used
to override the automatically detected command (or specify its
location if the auto-detection fails to find it.)
CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set
extended attributes on files and directories on Mac OS X. This
variable can be used to override the automatically detected
command (or specify its location if the auto-detection fails to
find it.)
CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile
resources on Mac OS X. This variable can be used to override the
automatically detected command (or specify its location if the
auto-detection fails to find it.)
CPackDeb: The builtin (binary) CPack Deb generator (Unix only)CPackDeb may be used to create Deb package using CPack. CPackDeb is a CPack generator thus it uses the CPACK_XXX variables used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration. CPackDeb generator should work on any linux host but it will SYSTEM_N user-friendly names and descriptions, inter-component dependencies, etc., and grouped in various ways to customize the resulting installer. See the cpack_add_* commands, described below, for more information about component-specific installations.
Component-specific installation allows users to select specific sets of components to install during the install process. Installation components are identified by the COMPONENT argument of CMake's INSTALL commands, and should be further described by the following CPack commands:
CPACK_COMPONENTS_ALL - The list of component to install.
The default value of this variable is computed by CPack
and contains all components defined by the project. The
user may set it to only include the specified components.
CPACK_<GENNAME>_COMPONENT_INSTALL - Enable/Disable component install for
CPack generator <GENNAME>.
Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
default behavior. e.g. RPM builds monolithic whereas NSIS builds component.
One can change the default behavior by setting this variable to 0/1 or OFF/ON.
CPACK_COMPONENTS_GROUPING - Specify how components are grouped for multi-package
component-aware CPack generators.
Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates several
packages files when asked for component packaging. They group the component
differently depending on the value of this variable:
- ONE_PER_GROUP (default): creates one package file per component group
- ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component
- IGNORE : creates one package per component, i.e. IGNORE component group
One can specify different grouping for different CPack generator by using
a CPACK_PROJECT_CONFIG_FILE.
CPACK_COMPONENT_<compName>_DISPLAY_NAME - The name to be displayed for a component.
CPACK_COMPONENT_<compName>_DESCRIPTION - The description of a component.
CPACK_COMPONENT_<compName>_GROUP - The group of a component.
CPACK_COMPONENT_<compName>_DEPENDS - The dependencies (list of components)
on which this component depends.
CPACK_COMPONENT_<compName>_REQUIRED - True is this component is required.
cpack_add_component - Describes a CPack installation component
named by the COMPONENT argument to a CMake INSTALL command.
cpack_add_component(compname
[DISPLAY_NAME name]
[DESCRIPTION description]
[HIDDEN | REQUIRED | DISABLED ]
[GROUP group]
[DEPENDS comp1 comp2 ... ]
[INSTALL_TYPES type1 type2 ... ]
[DOWNLOADED]
[ARCHIVE_FILE filename])
The cmake_add_component command describes an installation
component, which the user can opt to install or remove as part of
the graphical installation process. compname is the name of the
component, as provided to the COMPONENT argument of one or more
CMake INSTALL commands.
DISPLAY_NAME is the displayed name of the component, used in
graphical installers to display the component name. This value can
be any string.
DESCRIPTION is an extended description of the component, used in
graphical installers to give the user additional information about
the component. Descriptions can span multiple lines using "\n" as
the line separator. Typically, these descriptions should be no
more than a few lines long.
HIDDEN indicates that this component will be hidden in the
graphical installer, so that the user cannot directly change
whether it is installed or not.
REQUIRED indicates that this component is required, and therefore
will always be installed. It will be visible in the graphical
installer, but it cannot be unselected. (Typically, required
components are shown greyed out).
DISABLED indicates that this component should be disabled
(unselected) by default. The user is free to select this component
for installation, unless it is also HIDDEN.
DEPENDS lists the components on which this component depends. If
this component is selected, then each of the components listed
must also be selected. The dependency information is encoded
within the installer itself, so that users cannot install
inconsitent sets of components.
GROUP names the component group of which this component is a
part. If not provided, the component will be a standalone
component, not part of any component group. Component groups are
described with the cpack_add_component_group command, detailed
below.
INSTALL_TYPES lists the installation types of which this component
is a part. When one of these installations types is selected, this
component will automatically be selected. Installation types are
described with the cpack_add_install_type command, detailed below.
DOWNLOADED indicates that this component should be downloaded
on-the-fly by the installer, rather than packaged in with the
installer itself. For more information, see the cpack_configure_downloads
command.
ARCHIVE_FILE provides a name for the archive file created by CPack
to be used for downloaded components. If not supplied, CPack will
create a file with some name based on CPACK_PACKAGE_FILE_NAME and
the name of the component. See cpack_configure_downloads for more
information.
cpack_add_component_group - Describes a group of related CPack
installation components.
cpack_add_component_group(groupname
[DISPLAY_NAME name]
[DESCRIPTION description]
[PARENT_GROUP parent]
[EXPANDED]
[BOLD_TITLE])
The cpack_add_component_group describes a group of installation
components, which will be placed together within the listing of
options. Typically, component groups allow the user to
select/deselect all of the components within a single group via a
single group-level option. Use component groups to reduce the
complexity of installers with many options. groupname is an
arbitrary name used to identify the group in the GROUP argument of
the cpack_add_component command, which is used to place a
component in a group. The name of the group must not conflict with
the name of any component.
DISPLAY_NAME is the displayed name of the component group, used in
graphical installers to display the component group name. This
value can be any string.
DESCRIPTION is an extended description of the component group,
used in graphical installers to give the user additional
information about the components within that group. Descriptions
can span multiple lines using "\n" as the line
separator. Typically, these descriptions should be no more than a
few lines long.
PARENT_GROUP, if supplied, names the parent group of this group.
Parent groups are used to establish a hierarchy of groups,
providing an arbitrary hierarchy of groups.
EXPANDED indicates that, by default, the group should show up as
"expanded", so that the user immediately sees all of the
components within the group. Otherwise, the group will initially
show up as a single entry.
BOLD_TITLE indicates that the group title should appear in bold,
to call the user's attention to the group.
cpack_add_install_type - Add a new installation type containing a
set of predefined component selections to the graphical installer.
cpack_add_install_type(typename
[DISPLAY_NAME name])
The cpack_add_install_type command identifies a set of preselected
components that represents a common use case for an
application. For example, a "Developer" install type might include
an application along with its header and library files, while an
"End user" install type might just include the application's
executable. Each component identifies itself with one or more
install types via the INSTALL_TYPES argument to
cpack_add_component.
DISPLAY_NAME is the displayed name of the install type, which will
typically show up in a drop-down box within a graphical
installer. This value can be any string.
cpack_configure_downloads - Configure CPack to download selected
components on-the-fly as part of the installation process.
cpack_configure_downloads(site
[UPLOAD_DIRECTORY dirname]
[ALL]
[ADD_REMOVE|NO_ADD_REMOVE])
The cpack_configure_downloads command configures installation-time
downloads of selected components. For each downloadable component,
CPack will create an archive containing the contents of that
component, which should be uploaded to the given site. When the
user selects that component for installation, the installer will
download and extract the component in place. This feature is
useful for creating small installers that only download the
requested components, saving bandwidth. Additionally, the
installers are small enough that they will be installed as part of
the normal installation process, and the "Change" button in
Windows Add/Remove Programs control panel will allow one to add or
remove parts of the application after the original
installation. On Windows, the downloaded-components functionality
requires the ZipDLL plug-in for NSIS, available at:
http://nsis.sourceforge.net/ZipDLL_plug-in
On Mac OS X, installers that download components on-the-fly can
only be built and installed on system using Mac OS X 10.5 or
later.
The site argument is a URL where the archives for downloadable
components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
All of the archives produced by CPack should be uploaded to that location.
UPLOAD_DIRECTORY is the local directory where CPack will create the
various archives for each of the components. The contents of this
directory should be uploaded to a location accessible by the URL given
in the site argument. If omitted, CPack will use the directory
CPackUploads inside the CMake binary directory to store the generated
archives.
The ALL flag indicates that all components be downloaded. Otherwise, only
those components explicitly marked as DOWNLOADED or that have a specified
ARCHIVE_FILE will be downloaded. Additionally, the ALL option implies
ADD_REMOVE (unless NO_ADD_REMOVE is specified).
ADD_REMOVE indicates that CPack should install a copy of the installer
that can be called from Windows' Add/Remove Programs dialog (via the
"Modify" button) to change the set of installed components. NO_ADD_REMOVE
turns off this behavior. This option is ignored on Mac OS X.
CPackCygwin: Cygwin CPack generator (Cygwin).The following variable is specific to installers build on and/or for Cygwin:
CPACK_CYGWIN_PATCH_NUMBER - The Cygwin patch number.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_PATCH_FILE - The Cygwin patch file.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_BUILD_SCRIPT - The Cygwin build script.
FIXME: This documentation is incomplete.
CPackDMG: DragNDrop CPack generator (Mac OS X).The following variables are specific to the DragNDrop installers built on Mac OS X:
CPACK_DMG_VOLUME_NAME - The volume name of the generated disk
image. Defaults to CPACK_PACKAGE_FILE_NAME.
CPACK_DMG_FORMAT - The disk image format. Common values are UDRO
(UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF
bzip2-compressed). Refer to hdiutil(1) for more information on
other available formats.
CPACK_DMG_DS_STORE - Path to a custom DS_Store file. This .DS_Store
file e.g. can be used to specify the Finder window
position/geometry and layout (such as hidden toolbars, placement of the
icons etc.). This file has to be generated by the Finder (either manually or
through OSA-script) using a normal folder from which the .DS_Store
file can then be extracted.
CPACK_DMG_BACKGROUND_IMAGE - Path to a background image file. This
file will be used as the background for the Finder Window when the disk
image is opened. By default no background image is set. The background
image is applied after applying the custom .DS_Store file.
CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to
operate on disk image files on Mac OS X. This variable can be used
to override the automatically detected command (or specify its
location if the auto-detection fails to find it.)
CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set
extended attributes on files and directories on Mac OS X. This
variable can be used to override the automatically detected
command (or specify its location if the auto-detection fails to
find it.)
CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile
resources on Mac OS X. This variable can be used to override the
automatically detected command (or specify its location if the
auto-detection fails to find it.)
CPackDeb: The builtin (binary) CPack Deb generator (Unix only)CPackDeb may be used to create Deb package using CPack. CPackDeb is a CPack generator thus it uses the CPACK_XXX variables used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration. CPackDeb generator should work on any linux host but it will SYSTEM_N user-friendly names and descriptions, inter-component dependencies, etc., and grouped in various ways to customize the resulting installer. See the cpack_add_* commands, described below, for more information about component-specific installations.
Component-specific installation allows users to select specific sets of components to install during the install process. Installation components are identified by the COMPONENT argument of CMake's INSTALL commands, and should be further described by the following CPack commands:
CPACK_COMPONENTS_ALL - The list of component to install.
The default value of this variable is computed by CPack
and contains all components defined by the project. The
user may set it to only include the specified components.
CPACK_<GENNAME>_COMPONENT_INSTALL - Enable/Disable component install for
CPack generator <GENNAME>.
Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
default behavior. e.g. RPM builds monolithic whereas NSIS builds component.
One can change the default behavior by setting this variable to 0/1 or OFF/ON.
CPACK_COMPONENTS_GROUPING - Specify how components are grouped for multi-package
component-aware CPack generators.
Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates several
packages files when asked for component packaging. They group the component
differently depending on the value of this variable:
- ONE_PER_GROUP (default): creates one package file per component group
- ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component
- IGNORE : creates one package per component, i.e. IGNORE component group
One can specify different grouping for different CPack generator by using
a CPACK_PROJECT_CONFIG_FILE.
CPACK_COMPONENT_<compName>_DISPLAY_NAME - The name to be displayed for a component.
CPACK_COMPONENT_<compName>_DESCRIPTION - The description of a component.
CPACK_COMPONENT_<compName>_GROUP - The group of a component.
CPACK_COMPONENT_<compName>_DEPENDS - The dependencies (list of components)
on which this component depends.
CPACK_COMPONENT_<compName>_REQUIRED - True is this component is required.
cpack_add_component - Describes a CPack installation component
named by the COMPONENT argument to a CMake INSTALL command.
cpack_add_component(compname
[DISPLAY_NAME name]
[DESCRIPTION description]
[HIDDEN | REQUIRED | DISABLED ]
[GROUP group]
[DEPENDS comp1 comp2 ... ]
[INSTALL_TYPES type1 type2 ... ]
[DOWNLOADED]
[ARCHIVE_FILE filename])
The cmake_add_component command describes an installation
component, which the user can opt to install or remove as part of
the graphical installation process. compname is the name of the
component, as provided to the COMPONENT argument of one or more
CMake INSTALL commands.
DISPLAY_NAME is the displayed name of the component, used in
graphical installers to display the component name. This value can
be any string.
DESCRIPTION is an extended description of the component, used in
graphical installers to give the user additional information about
the component. Descriptions can span multiple lines using "\n" as
the line separator. Typically, these descriptions should be no
more than a few lines long.
HIDDEN indicates that this component will be hidden in the
graphical installer, so that the user cannot directly change
whether it is installed or not.
REQUIRED indicates that this component is required, and therefore
will always be installed. It will be visible in the graphical
installer, but it cannot be unselected. (Typically, required
components are shown greyed out).
DISABLED indicates that this component should be disabled
(unselected) by default. The user is free to select this component
for installation, unless it is also HIDDEN.
DEPENDS lists the components on which this component depends. If
this component is selected, then each of the components listed
must also be selected. The dependency information is encoded
within the installer itself, so that users cannot install
inconsitent sets of components.
GROUP names the component group of which this component is a
part. If not provided, the component will be a standalone
component, not part of any component group. Component groups are
described with the cpack_add_component_group command, detailed
below.
INSTALL_TYPES lists the installation types of which this component
is a part. When one of these installations types is selected, this
component will automatically be selected. Installation types are
described with the cpack_add_install_type command, detailed below.
DOWNLOADED indicates that this component should be downloaded
on-the-fly by the installer, rather than packaged in with the
installer itself. For more information, see the cpack_configure_downloads
command.
ARCHIVE_FILE provides a name for the archive file created by CPack
to be used for downloaded components. If not supplied, CPack will
create a file with some name based on CPACK_PACKAGE_FILE_NAME and
the name of the component. See cpack_configure_downloads for more
information.
cpack_add_component_group - Describes a group of related CPack
installation components.
cpack_add_component_group(groupname
[DISPLAY_NAME name]
[DESCRIPTION description]
[PARENT_GROUP parent]
[EXPANDED]
[BOLD_TITLE])
The cpack_add_component_group describes a group of installation
components, which will be placed together within the listing of
options. Typically, component groups allow the user to
select/deselect all of the components within a single group via a
single group-level option. Use component groups to reduce the
complexity of installers with many options. groupname is an
arbitrary name used to identify the group in the GROUP argument of
the cpack_add_component command, which is used to place a
component in a group. The name of the group must not conflict with
the name of any component.
DISPLAY_NAME is the displayed name of the component group, used in
graphical installers to display the component group name. This
value can be any string.
DESCRIPTION is an extended description of the component group,
used in graphical installers to give the user additional
information about the components within that group. Descriptions
can span multiple lines using "\n" as the line
separator. Typically, these descriptions should be no more than a
few lines long.
PARENT_GROUP, if supplied, names the parent group of this group.
Parent groups are used to establish a hierarchy of groups,
providing an arbitrary hierarchy of groups.
EXPANDED indicates that, by default, the group should show up as
"expanded", so that the user immediately sees all of the
components within the group. Otherwise, the group will initially
show up as a single entry.
BOLD_TITLE indicates that the group title should appear in bold,
to call the user's attention to the group.
cpack_add_install_type - Add a new installation type containing a
set of predefined component selections to the graphical installer.
cpack_add_install_type(typename
[DISPLAY_NAME name])
The cpack_add_install_type command identifies a set of preselected
components that represents a common use case for an
application. For example, a "Developer" install type might include
an application along with its header and library files, while an
"End user" install type might just include the application's
executable. Each component identifies itself with one or more
install types via the INSTALL_TYPES argument to
cpack_add_component.
DISPLAY_NAME is the displayed name of the install type, which will
typically show up in a drop-down box within a graphical
installer. This value can be any string.
cpack_configure_downloads - Configure CPack to download selected
components on-the-fly as part of the installation process.
cpack_configure_downloads(site
[UPLOAD_DIRECTORY dirname]
[ALL]
[ADD_REMOVE|NO_ADD_REMOVE])
The cpack_configure_downloads command configures installation-time
downloads of selected components. For each downloadable component,
CPack will create an archive containing the contents of that
component, which should be uploaded to the given site. When the
user selects that component for installation, the installer will
download and extract the component in place. This feature is
useful for creating small installers that only download the
requested components, saving bandwidth. Additionally, the
installers are small enough that they will be installed as part of
the normal installation process, and the "Change" button in
Windows Add/Remove Programs control panel will allow one to add or
remove parts of the application after the original
installation. On Windows, the downloaded-components functionality
requires the ZipDLL plug-in for NSIS, available at:
http://nsis.sourceforge.net/ZipDLL_plug-in
On Mac OS X, installers that download components on-the-fly can
only be built and installed on system using Mac OS X 10.5 or
later.
The site argument is a URL where the archives for downloadable
components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
All of the archives produced by CPack should be uploaded to that location.
UPLOAD_DIRECTORY is the local directory where CPack will create the
various archives for each of the components. The contents of this
directory should be uploaded to a location accessible by the URL given
in the site argument. If omitted, CPack will use the directory
CPackUploads inside the CMake binary directory to store the generated
archives.
The ALL flag indicates that all components be downloaded. Otherwise, only
those components explicitly marked as DOWNLOADED or that have a specified
ARCHIVE_FILE will be downloaded. Additionally, the ALL option implies
ADD_REMOVE (unless NO_ADD_REMOVE is specified).
ADD_REMOVE indicates that CPack should install a copy of the installer
that can be called from Windows' Add/Remove Programs dialog (via the
"Modify" button) to change the set of installed components. NO_ADD_REMOVE
turns off this behavior. This option is ignored on Mac OS X.
CPackCygwin: Cygwin CPack generator (Cygwin).The following variable is specific to installers build on and/or for Cygwin:
CPACK_CYGWIN_PATCH_NUMBER - The Cygwin patch number.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_PATCH_FILE - The Cygwin patch file.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_BUILD_SCRIPT - The Cygwin build script.
FIXME: This documentation is incomplete.
CPackDMG: DragNDrop CPack generator (Mac OS X).The following variables are specific to the DragNDrop installers built on Mac OS X:
CPACK_DMG_VOLUME_NAME - The volume name of the generated disk
image. Defaults to CPACK_PACKAGE_FILE_NAME.
CPACK_DMG_FORMAT - The disk image format. Common values are UDRO
(UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF
bzip2-compressed). Refer to hdiutil(1) for more information on
other available formats.
CPACK_DMG_DS_STORE - Path to a custom DS_Store file. This .DS_Store
file e.g. can be used to specify the Finder window
position/geometry and layout (such as hidden toolbars, placement of the
icons etc.). This file has to be generated by the Finder (either manually or
through OSA-script) using a normal folder from which the .DS_Store
file can then be extracted.
CPACK_DMG_BACKGROUND_IMAGE - Path to a background image file. This
file will be used as the background for the Finder Window when the disk
image is opened. By default no background image is set. The background
image is applied after applying the custom .DS_Store file.
CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to
operate on disk image files on Mac OS X. This variable can be used
to override the automatically detected command (or specify its
location if the auto-detection fails to find it.)
CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set
extended attributes on files and directories on Mac OS X. This
variable can be used to override the automatically detected
command (or specify its location if the auto-detection fails to
find it.)
CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile
resources on Mac OS X. This variable can be used to override the
automatically detected command (or specify its location if the
auto-detection fails to find it.)
CPackDeb: The builtin (binary) CPack Deb generator (Unix only)CPackDeb may be used to create Deb package using CPack. CPackDeb is a CPack generator thus it uses the CPACK_XXX variables used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration. CPackDeb generator should work on any linux host but it will SYSTEM_N user-friendly names and descriptions, inter-component dependencies, etc., and grouped in various ways to customize the resulting installer. See the cpack_add_* commands, described below, for more information about component-specific installations.
Component-specific installation allows users to select specific sets of components to install during the install process. Installation components are identified by the COMPONENT argument of CMake's INSTALL commands, and should be further described by the following CPack commands:
CPACK_COMPONENTS_ALL - The list of component to install.
The default value of this variable is computed by CPack
and contains all components defined by the project. The
user may set it to only include the specified components.
CPACK_<GENNAME>_COMPONENT_INSTALL - Enable/Disable component install for
CPack generator <GENNAME>.
Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
default behavior. e.g. RPM builds monolithic whereas NSIS builds component.
One can change the default behavior by setting this variable to 0/1 or OFF/ON.
CPACK_COMPONENTS_GROUPING - Specify how components are grouped for multi-package
component-aware CPack generators.
Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates several
packages files when asked for component packaging. They group the component
differently depending on the value of this variable:
- ONE_PER_GROUP (default): creates one package file per component group
- ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component
- IGNORE : creates one package per component, i.e. IGNORE component group
One can specify different grouping for different CPack generator by using
a CPACK_PROJECT_CONFIG_FILE.
CPACK_COMPONENT_<compName>_DISPLAY_NAME - The name to be displayed for a component.
CPACK_COMPONENT_<compName>_DESCRIPTION - The description of a component.
CPACK_COMPONENT_<compName>_GROUP - The group of a component.
CPACK_COMPONENT_<compName>_DEPENDS - The dependencies (list of components)
on which this component depends.
CPACK_COMPONENT_<compName>_REQUIRED - True is this component is required.
cpack_add_component - Describes a CPack installation component
named by the COMPONENT argument to a CMake INSTALL command.
cpack_add_component(compname
[DISPLAY_NAME name]
[DESCRIPTION description]
[HIDDEN | REQUIRED | DISABLED ]
[GROUP group]
[DEPENDS comp1 comp2 ... ]
[INSTALL_TYPES type1 type2 ... ]
[DOWNLOADED]
[ARCHIVE_FILE filename])
The cmake_add_component command describes an installation
component, which the user can opt to install or remove as part of
the graphical installation process. compname is the name of the
component, as provided to the COMPONENT argument of one or more
CMake INSTALL commands.
DISPLAY_NAME is the displayed name of the component, used in
graphical installers to display the component name. This value can
be any string.
DESCRIPTION is an extended description of the component, used in
graphical installers to give the user additional information about
the component. Descriptions can span multiple lines using "\n" as
the line separator. Typically, these descriptions should be no
more than a few lines long.
HIDDEN indicates that this component will be hidden in the
graphical installer, so that the user cannot directly change
whether it is installed or not.
REQUIRED indicates that this component is required, and therefore
will always be installed. It will be visible in the graphical
installer, but it cannot be unselected. (Typically, required
components are shown greyed out).
DISABLED indicates that this component should be disabled
(unselected) by default. The user is free to select this component
for installation, unless it is also HIDDEN.
DEPENDS lists the components on which this component depends. If
this component is selected, then each of the components listed
must also be selected. The dependency information is encoded
within the installer itself, so that users cannot install
inconsitent sets of components.
GROUP names the component group of which this component is a
part. If not provided, the component will be a standalone
component, not part of any component group. Component groups are
described with the cpack_add_component_group command, detailed
below.
INSTALL_TYPES lists the installation types of which this component
is a part. When one of these installations types is selected, this
component will automatically be selected. Installation types are
described with the cpack_add_install_type command, detailed below.
DOWNLOADED indicates that this component should be downloaded
on-the-fly by the installer, rather than packaged in with the
installer itself. For more information, see the cpack_configure_downloads
command.
ARCHIVE_FILE provides a name for the archive file created by CPack
to be used for downloaded components. If not supplied, CPack will
create a file with some name based on CPACK_PACKAGE_FILE_NAME and
the name of the component. See cpack_configure_downloads for more
information.
cpack_add_component_group - Describes a group of related CPack
installation components.
cpack_add_component_group(groupname
[DISPLAY_NAME name]
[DESCRIPTION description]
[PARENT_GROUP parent]
[EXPANDED]
[BOLD_TITLE])
The cpack_add_component_group describes a group of installation
components, which will be placed together within the listing of
options. Typically, component groups allow the user to
select/deselect all of the components within a single group via a
single group-level option. Use component groups to reduce the
complexity of installers with many options. groupname is an
arbitrary name used to identify the group in the GROUP argument of
the cpack_add_component command, which is used to place a
component in a group. The name of the group must not conflict with
the name of any component.
DISPLAY_NAME is the displayed name of the component group, used in
graphical installers to display the component group name. This
value can be any string.
DESCRIPTION is an extended description of the component group,
used in graphical installers to give the user additional
information about the components within that group. Descriptions
can span multiple lines using "\n" as the line
separator. Typically, these descriptions should be no more than a
few lines long.
PARENT_GROUP, if supplied, names the parent group of this group.
Parent groups are used to establish a hierarchy of groups,
providing an arbitrary hierarchy of groups.
EXPANDED indicates that, by default, the group should show up as
"expanded", so that the user immediately sees all of the
components within the group. Otherwise, the group will initially
show up as a single entry.
BOLD_TITLE indicates that the group title should appear in bold,
to call the user's attention to the group.
cpack_add_install_type - Add a new installation type containing a
set of predefined component selections to the graphical installer.
cpack_add_install_type(typename
[DISPLAY_NAME name])
The cpack_add_install_type command identifies a set of preselected
components that represents a common use case for an
application. For example, a "Developer" install type might include
an application along with its header and library files, while an
"End user" install type might just include the application's
executable. Each component identifies itself with one or more
install types via the INSTALL_TYPES argument to
cpack_add_component.
DISPLAY_NAME is the displayed name of the install type, which will
typically show up in a drop-down box within a graphical
installer. This value can be any string.
cpack_configure_downloads - Configure CPack to download selected
components on-the-fly as part of the installation process.
cpack_configure_downloads(site
[UPLOAD_DIRECTORY dirname]
[ALL]
[ADD_REMOVE|NO_ADD_REMOVE])
The cpack_configure_downloads command configures installation-time
downloads of selected components. For each downloadable component,
CPack will create an archive containing the contents of that
component, which should be uploaded to the given site. When the
user selects that component for installation, the installer will
download and extract the component in place. This feature is
useful for creating small installers that only download the
requested components, saving bandwidth. Additionally, the
installers are small enough that they will be installed as part of
the normal installation process, and the "Change" button in
Windows Add/Remove Programs control panel will allow one to add or
remove parts of the application after the original
installation. On Windows, the downloaded-components functionality
requires the ZipDLL plug-in for NSIS, available at:
http://nsis.sourceforge.net/ZipDLL_plug-in
On Mac OS X, installers that download components on-the-fly can
only be built and installed on system using Mac OS X 10.5 or
later.
The site argument is a URL where the archives for downloadable
components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
All of the archives produced by CPack should be uploaded to that location.
UPLOAD_DIRECTORY is the local directory where CPack will create the
various archives for each of the components. The contents of this
directory should be uploaded to a location accessible by the URL given
in the site argument. If omitted, CPack will use the directory
CPackUploads inside the CMake binary directory to store the generated
archives.
The ALL flag indicates that all components be downloaded. Otherwise, only
those components explicitly marked as DOWNLOADED or that have a specified
ARCHIVE_FILE will be downloaded. Additionally, the ALL option implies
ADD_REMOVE (unless NO_ADD_REMOVE is specified).
ADD_REMOVE indicates that CPack should install a copy of the installer
that can be called from Windows' Add/Remove Programs dialog (via the
"Modify" button) to change the set of installed components. NO_ADD_REMOVE
turns off this behavior. This option is ignored on Mac OS X.
CPackCygwin: Cygwin CPack generator (Cygwin).The following variable is specific to installers build on and/or for Cygwin:
CPACK_CYGWIN_PATCH_NUMBER - The Cygwin patch number.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_PATCH_FILE - The Cygwin patch file.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_BUILD_SCRIPT - The Cygwin build script.
FIXME: This documentation is incomplete.
CPackDMG: DragNDrop CPack generator (Mac OS X).The following variables are specific to the DragNDrop installers built on Mac OS X:
CPACK_DMG_VOLUME_NAME - The volume name of the generated disk
image. Defaults to CPACK_PACKAGE_FILE_NAME.
CPACK_DMG_FORMAT - The disk image format. Common values are UDRO
(UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF
bzip2-compressed). Refer to hdiutil(1) for more information on
other available formats.
CPACK_DMG_DS_STORE - Path to a custom DS_Store file. This .DS_Store
file e.g. can be used to specify the Finder window
position/geometry and layout (such as hidden toolbars, placement of the
icons etc.). This file has to be generated by the Finder (either manually or
through OSA-script) using a normal folder from which the .DS_Store
file can then be extracted.
CPACK_DMG_BACKGROUND_IMAGE - Path to a background image file. This
file will be used as the background for the Finder Window when the disk
image is opened. By default no background image is set. The background
image is applied after applying the custom .DS_Store file.
CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to
operate on disk image files on Mac OS X. This variable can be used
to override the automatically detected command (or specify its
location if the auto-detection fails to find it.)
CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set
extended attributes on files and directories on Mac OS X. This
variable can be used to override the automatically detected
command (or specify its location if the auto-detection fails to
find it.)
CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile
resources on Mac OS X. This variable can be used to override the
automatically detected command (or specify its location if the
auto-detection fails to find it.)
CPackDeb: The builtin (binary) CPack Deb generator (Unix only)CPackDeb may be used to create Deb package using CPack. CPackDeb is a CPack generator thus it uses the CPACK_XXX variables used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration. CPackDeb generator should work on any linux host but it will SYSTEM_N user-friendly names and descriptions, inter-component dependencies, etc., and grouped in various ways to customize the resulting installer. See the cpack_add_* commands, described below, for more information about component-specific installations.
Component-specific installation allows users to select specific sets of components to install during the install process. Installation components are identified by the COMPONENT argument of CMake's INSTALL commands, and should be further described by the following CPack commands:
CPACK_COMPONENTS_ALL - The list of component to install.
The default value of this variable is computed by CPack
and contains all components defined by the project. The
user may set it to only include the specified components.
CPACK_<GENNAME>_COMPONENT_INSTALL - Enable/Disable component install for
CPack generator <GENNAME>.
Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
default behavior. e.g. RPM builds monolithic whereas NSIS builds component.
One can change the default behavior by setting this variable to 0/1 or OFF/ON.
CPACK_COMPONENTS_GROUPING - Specify how components are grouped for multi-package
component-aware CPack generators.
Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates several
packages files when asked for component packaging. They group the component
differently depending on the value of this variable:
- ONE_PER_GROUP (default): creates one package file per component group
- ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component
- IGNORE : creates one package per component, i.e. IGNORE component group
One can specify different grouping for different CPack generator by using
a CPACK_PROJECT_CONFIG_FILE.
CPACK_COMPONENT_<compName>_DISPLAY_NAME - The name to be displayed for a component.
CPACK_COMPONENT_<compName>_DESCRIPTION - The description of a component.
CPACK_COMPONENT_<compName>_GROUP - The group of a component.
CPACK_COMPONENT_<compName>_DEPENDS - The dependencies (list of components)
on which this component depends.
CPACK_COMPONENT_<compName>_REQUIRED - True is this component is required.
cpack_add_component - Describes a CPack installation component
named by the COMPONENT argument to a CMake INSTALL command.
cpack_add_component(compname
[DISPLAY_NAME name]
[DESCRIPTION description]
[HIDDEN | REQUIRED | DISABLED ]
[GROUP group]
[DEPENDS comp1 comp2 ... ]
[INSTALL_TYPES type1 type2 ... ]
[DOWNLOADED]
[ARCHIVE_FILE filename])
The cmake_add_component command describes an installation
component, which the user can opt to install or remove as part of
the graphical installation process. compname is the name of the
component, as provided to the COMPONENT argument of one or more
CMake INSTALL commands.
DISPLAY_NAME is the displayed name of the component, used in
graphical installers to display the component name. This value can
be any string.
DESCRIPTION is an extended description of the component, used in
graphical installers to give the user additional information about
the component. Descriptions can span multiple lines using "\n" as
the line separator. Typically, these descriptions should be no
more than a few lines long.
HIDDEN indicates that this component will be hidden in the
graphical installer, so that the user cannot directly change
whether it is installed or not.
REQUIRED indicates that this component is required, and therefore
will always be installed. It will be visible in the graphical
installer, but it cannot be unselected. (Typically, required
components are shown greyed out).
DISABLED indicates that this component should be disabled
(unselected) by default. The user is free to select this component
for installation, unless it is also HIDDEN.
DEPENDS lists the components on which this component depends. If
this component is selected, then each of the components listed
must also be selected. The dependency information is encoded
within the installer itself, so that users cannot install
inconsitent sets of components.
GROUP names the component group of which this component is a
part. If not provided, the component will be a standalone
component, not part of any component group. Component groups are
described with the cpack_add_component_group command, detailed
below.
INSTALL_TYPES lists the installation types of which this component
is a part. When one of these installations types is selected, this
component will automatically be selected. Installation types are
described with the cpack_add_install_type command, detailed below.
DOWNLOADED indicates that this component should be downloaded
on-the-fly by the installer, rather than packaged in with the
installer itself. For more information, see the cpack_configure_downloads
command.
ARCHIVE_FILE provides a name for the archive file created by CPack
to be used for downloaded components. If not supplied, CPack will
create a file with some name based on CPACK_PACKAGE_FILE_NAME and
the name of the component. See cpack_configure_downloads for more
information.
cpack_add_component_group - Describes a group of related CPack
installation components.
cpack_add_component_group(groupname
[DISPLAY_NAME name]
[DESCRIPTION description]
[PARENT_GROUP parent]
[EXPANDED]
[BOLD_TITLE])
The cpack_add_component_group describes a group of installation
components, which will be placed together within the listing of
options. Typically, component groups allow the user to
select/deselect all of the components within a single group via a
single group-level option. Use component groups to reduce the
complexity of installers with many options. groupname is an
arbitrary name used to identify the group in the GROUP argument of
the cpack_add_component command, which is used to place a
component in a group. The name of the group must not conflict with
the name of any component.
DISPLAY_NAME is the displayed name of the component group, used in
graphical installers to display the component group name. This
value can be any string.
DESCRIPTION is an extended description of the component group,
used in graphical installers to give the user additional
information about the components within that group. Descriptions
can span multiple lines using "\n" as the line
separator. Typically, these descriptions should be no more than a
few lines long.
PARENT_GROUP, if supplied, names the parent group of this group.
Parent groups are used to establish a hierarchy of groups,
providing an arbitrary hierarchy of groups.
EXPANDED indicates that, by default, the group should show up as
"expanded", so that the user immediately sees all of the
components within the group. Otherwise, the group will initially
show up as a single entry.
BOLD_TITLE indicates that the group title should appear in bold,
to call the user's attention to the group.
cpack_add_install_type - Add a new installation type containing a
set of predefined component selections to the graphical installer.
cpack_add_install_type(typename
[DISPLAY_NAME name])
The cpack_add_install_type command identifies a set of preselected
components that represents a common use case for an
application. For example, a "Developer" install type might include
an application along with its header and library files, while an
"End user" install type might just include the application's
executable. Each component identifies itself with one or more
install types via the INSTALL_TYPES argument to
cpack_add_component.
DISPLAY_NAME is the displayed name of the install type, which will
typically show up in a drop-down box within a graphical
installer. This value can be any string.
cpack_configure_downloads - Configure CPack to download selected
components on-the-fly as part of the installation process.
cpack_configure_downloads(site
[UPLOAD_DIRECTORY dirname]
[ALL]
[ADD_REMOVE|NO_ADD_REMOVE])
The cpack_configure_downloads command configures installation-time
downloads of selected components. For each downloadable component,
CPack will create an archive containing the contents of that
component, which should be uploaded to the given site. When the
user selects that component for installation, the installer will
download and extract the component in place. This feature is
useful for creating small installers that only download the
requested components, saving bandwidth. Additionally, the
installers are small enough that they will be installed as part of
the normal installation process, and the "Change" button in
Windows Add/Remove Programs control panel will allow one to add or
remove parts of the application after the original
installation. On Windows, the downloaded-components functionality
requires the ZipDLL plug-in for NSIS, available at:
http://nsis.sourceforge.net/ZipDLL_plug-in
On Mac OS X, installers that download components on-the-fly can
only be built and installed on system using Mac OS X 10.5 or
later.
The site argument is a URL where the archives for downloadable
components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
All of the archives produced by CPack should be uploaded to that location.
UPLOAD_DIRECTORY is the local directory where CPack will create the
various archives for each of the components. The contents of this
directory should be uploaded to a location accessible by the URL given
in the site argument. If omitted, CPack will use the directory
CPackUploads inside the CMake binary directory to store the generated
archives.
The ALL flag indicates that all components be downloaded. Otherwise, only
those components explicitly marked as DOWNLOADED or that have a specified
ARCHIVE_FILE will be downloaded. Additionally, the ALL option implies
ADD_REMOVE (unless NO_ADD_REMOVE is specified).
ADD_REMOVE indicates that CPack should install a copy of the installer
that can be called from Windows' Add/Remove Programs dialog (via the
"Modify" button) to change the set of installed components. NO_ADD_REMOVE
turns off this behavior. This option is ignored on Mac OS X.
CPackCygwin: Cygwin CPack generator (Cygwin).The following variable is specific to installers build on and/or for Cygwin:
CPACK_CYGWIN_PATCH_NUMBER - The Cygwin patch number.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_PATCH_FILE - The Cygwin patch file.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_BUILD_SCRIPT - The Cygwin build script.
FIXME: This documentation is incomplete.
CPackDMG: DragNDrop CPack generator (Mac OS X).The following variables are specific to the DragNDrop installers built on Mac OS X:
CPACK_DMG_VOLUME_NAME - The volume name of the generated disk
image. Defaults to CPACK_PACKAGE_FILE_NAME.
CPACK_DMG_FORMAT - The disk image format. Common values are UDRO
(UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF
bzip2-compressed). Refer to hdiutil(1) for more information on
other available formats.
CPACK_DMG_DS_STORE - Path to a custom DS_Store file. This .DS_Store
file e.g. can be used to specify the Finder window
position/geometry and layout (such as hidden toolbars, placement of the
icons etc.). This file has to be generated by the Finder (either manually or
through OSA-script) using a normal folder from which the .DS_Store
file can then be extracted.
CPACK_DMG_BACKGROUND_IMAGE - Path to a background image file. This
file will be used as the background for the Finder Window when the disk
image is opened. By default no background image is set. The background
image is applied after applying the custom .DS_Store file.
CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to
operate on disk image files on Mac OS X. This variable can be used
to override the automatically detected command (or specify its
location if the auto-detection fails to find it.)
CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set
extended attributes on files and directories on Mac OS X. This
variable can be used to override the automatically detected
command (or specify its location if the auto-detection fails to
find it.)
CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile
resources on Mac OS X. This variable can be used to override the
automatically detected command (or specify its location if the
auto-detection fails to find it.)
CPackDeb: The builtin (binary) CPack Deb generator (Unix only)CPackDeb may be used to create Deb package using CPack. CPackDeb is a CPack generator thus it uses the CPACK_XXX variables used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration. CPackDeb generator should work on any linux host but it will SYSTEM_N user-friendly names and descriptions, inter-component dependencies, etc., and grouped in various ways to customize the resulting installer. See the cpack_add_* commands, described below, for more information about component-specific installations.
Component-specific installation allows users to select specific sets of components to install during the install process. Installation components are identified by the COMPONENT argument of CMake's INSTALL commands, and should be further described by the following CPack commands:
CPACK_COMPONENTS_ALL - The list of component to install.
The default value of this variable is computed by CPack
and contains all components defined by the project. The
user may set it to only include the specified components.
CPACK_<GENNAME>_COMPONENT_INSTALL - Enable/Disable component install for
CPack generator <GENNAME>.
Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
default behavior. e.g. RPM builds monolithic whereas NSIS builds component.
One can change the default behavior by setting this variable to 0/1 or OFF/ON.
CPACK_COMPONENTS_GROUPING - Specify how components are grouped for multi-package
component-aware CPack generators.
Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates several
packages files when asked for component packaging. They group the component
differently depending on the value of this variable:
- ONE_PER_GROUP (default): creates one package file per component group
- ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component
- IGNORE : creates one package per component, i.e. IGNORE component group
One can specify different grouping for different CPack generator by using
a CPACK_PROJECT_CONFIG_FILE.
CPACK_COMPONENT_<compName>_DISPLAY_NAME - The name to be displayed for a component.
CPACK_COMPONENT_<compName>_DESCRIPTION - The description of a component.
CPACK_COMPONENT_<compName>_GROUP - The group of a component.
CPACK_COMPONENT_<compName>_DEPENDS - The dependencies (list of components)
on which this component depends.
CPACK_COMPONENT_<compName>_REQUIRED - True is this component is required.
cpack_add_component - Describes a CPack installation component
named by the COMPONENT argument to a CMake INSTALL command.
cpack_add_component(compname
[DISPLAY_NAME name]
[DESCRIPTION description]
[HIDDEN | REQUIRED | DISABLED ]
[GROUP group]
[DEPENDS comp1 comp2 ... ]
[INSTALL_TYPES type1 type2 ... ]
[DOWNLOADED]
[ARCHIVE_FILE filename])
The cmake_add_component command describes an installation
component, which the user can opt to install or remove as part of
the graphical installation process. compname is the name of the
component, as provided to the COMPONENT argument of one or more
CMake INSTALL commands.
DISPLAY_NAME is the displayed name of the component, used in
graphical installers to display the component name. This value can
be any string.
DESCRIPTION is an extended description of the component, used in
graphical installers to give the user additional information about
the component. Descriptions can span multiple lines using "\n" as
the line separator. Typically, these descriptions should be no
more than a few lines long.
HIDDEN indicates that this component will be hidden in the
graphical installer, so that the user cannot directly change
whether it is installed or not.
REQUIRED indicates that this component is required, and therefore
will always be installed. It will be visible in the graphical
installer, but it cannot be unselected. (Typically, required
components are shown greyed out).
DISABLED indicates that this component should be disabled
(unselected) by default. The user is free to select this component
for installation, unless it is also HIDDEN.
DEPENDS lists the components on which this component depends. If
this component is selected, then each of the components listed
must also be selected. The dependency information is encoded
within the installer itself, so that users cannot install
inconsitent sets of components.
GROUP names the component group of which this component is a
part. If not provided, the component will be a standalone
component, not part of any component group. Component groups are
described with the cpack_add_component_group command, detailed
below.
INSTALL_TYPES lists the installation types of which this component
is a part. When one of these installations types is selected, this
component will automatically be selected. Installation types are
described with the cpack_add_install_type command, detailed below.
DOWNLOADED indicates that this component should be downloaded
on-the-fly by the installer, rather than packaged in with the
installer itself. For more information, see the cpack_configure_downloads
command.
ARCHIVE_FILE provides a name for the archive file created by CPack
to be used for downloaded components. If not supplied, CPack will
create a file with some name based on CPACK_PACKAGE_FILE_NAME and
the name of the component. See cpack_configure_downloads for more
information.
cpack_add_component_group - Describes a group of related CPack
installation components.
cpack_add_component_group(groupname
[DISPLAY_NAME name]
[DESCRIPTION description]
[PARENT_GROUP parent]
[EXPANDED]
[BOLD_TITLE])
The cpack_add_component_group describes a group of installation
components, which will be placed together within the listing of
options. Typically, component groups allow the user to
select/deselect all of the components within a single group via a
single group-level option. Use component groups to reduce the
complexity of installers with many options. groupname is an
arbitrary name used to identify the group in the GROUP argument of
the cpack_add_component command, which is used to place a
component in a group. The name of the group must not conflict with
the name of any component.
DISPLAY_NAME is the displayed name of the component group, used in
graphical installers to display the component group name. This
value can be any string.
DESCRIPTION is an extended description of the component group,
used in graphical installers to give the user additional
information about the components within that group. Descriptions
can span multiple lines using "\n" as the line
separator. Typically, these descriptions should be no more than a
few lines long.
PARENT_GROUP, if supplied, names the parent group of this group.
Parent groups are used to establish a hierarchy of groups,
providing an arbitrary hierarchy of groups.
EXPANDED indicates that, by default, the group should show up as
"expanded", so that the user immediately sees all of the
components within the group. Otherwise, the group will initially
show up as a single entry.
BOLD_TITLE indicates that the group title should appear in bold,
to call the user's attention to the group.
cpack_add_install_type - Add a new installation type containing a
set of predefined component selections to the graphical installer.
cpack_add_install_type(typename
[DISPLAY_NAME name])
The cpack_add_install_type command identifies a set of preselected
components that represents a common use case for an
application. For example, a "Developer" install type might include
an application along with its header and library files, while an
"End user" install type might just include the application's
executable. Each component identifies itself with one or more
install types via the INSTALL_TYPES argument to
cpack_add_component.
DISPLAY_NAME is the displayed name of the install type, which will
typically show up in a drop-down box within a graphical
installer. This value can be any string.
cpack_configure_downloads - Configure CPack to download selected
components on-the-fly as part of the installation process.
cpack_configure_downloads(site
[UPLOAD_DIRECTORY dirname]
[ALL]
[ADD_REMOVE|NO_ADD_REMOVE])
The cpack_configure_downloads command configures installation-time
downloads of selected components. For each downloadable component,
CPack will create an archive containing the contents of that
component, which should be uploaded to the given site. When the
user selects that component for installation, the installer will
download and extract the component in place. This feature is
useful for creating small installers that only download the
requested components, saving bandwidth. Additionally, the
installers are small enough that they will be installed as part of
the normal installation process, and the "Change" button in
Windows Add/Remove Programs control panel will allow one to add or
remove parts of the application after the original
installation. On Windows, the downloaded-components functionality
requires the ZipDLL plug-in for NSIS, available at:
http://nsis.sourceforge.net/ZipDLL_plug-in
On Mac OS X, installers that download components on-the-fly can
only be built and installed on system using Mac OS X 10.5 or
later.
The site argument is a URL where the archives for downloadable
components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
All of the archives produced by CPack should be uploaded to that location.
UPLOAD_DIRECTORY is the local directory where CPack will create the
various archives for each of the components. The contents of this
directory should be uploaded to a location accessible by the URL given
in the site argument. If omitted, CPack will use the directory
CPackUploads inside the CMake binary directory to store the generated
archives.
The ALL flag indicates that all components be downloaded. Otherwise, only
those components explicitly marked as DOWNLOADED or that have a specified
ARCHIVE_FILE will be downloaded. Additionally, the ALL option implies
ADD_REMOVE (unless NO_ADD_REMOVE is specified).
ADD_REMOVE indicates that CPack should install a copy of the installer
that can be called from Windows' Add/Remove Programs dialog (via the
"Modify" button) to change the set of installed components. NO_ADD_REMOVE
turns off this behavior. This option is ignored on Mac OS X.
CPackCygwin: Cygwin CPack generator (Cygwin).The following variable is specific to installers build on and/or for Cygwin:
CPACK_CYGWIN_PATCH_NUMBER - The Cygwin patch number.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_PATCH_FILE - The Cygwin patch file.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_BUILD_SCRIPT - The Cygwin build script.
FIXME: This documentation is incomplete.
CPackDMG: DragNDrop CPack generator (Mac OS X).The following variables are specific to the DragNDrop installers built on Mac OS X:
CPACK_DMG_VOLUME_NAME - The volume name of the generated disk
image. Defaults to CPACK_PACKAGE_FILE_NAME.
CPACK_DMG_FORMAT - The disk image format. Common values are UDRO
(UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF
bzip2-compressed). Refer to hdiutil(1) for more information on
other available formats.
CPACK_DMG_DS_STORE - Path to a custom DS_Store file. This .DS_Store
file e.g. can be used to specify the Finder window
position/geometry and layout (such as hidden toolbars, placement of the
icons etc.). This file has to be generated by the Finder (either manually or
through OSA-script) using a normal folder from which the .DS_Store
file can then be extracted.
CPACK_DMG_BACKGROUND_IMAGE - Path to a background image file. This
file will be used as the background for the Finder Window when the disk
image is opened. By default no background image is set. The background
image is applied after applying the custom .DS_Store file.
CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to
operate on disk image files on Mac OS X. This variable can be used
to override the automatically detected command (or specify its
location if the auto-detection fails to find it.)
CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set
extended attributes on files and directories on Mac OS X. This
variable can be used to override the automatically detected
command (or specify its location if the auto-detection fails to
find it.)
CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile
resources on Mac OS X. This variable can be used to override the
automatically detected command (or specify its location if the
auto-detection fails to find it.)
CPackDeb: The builtin (binary) CPack Deb generator (Unix only)CPackDeb may be used to create Deb package using CPack. CPackDeb is a CPack generator thus it uses the CPACK_XXX variables used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration. CPackDeb generator should work on any linux host but it will SYSTEM_N user-friendly names and descriptions, inter-component dependencies, etc., and grouped in various ways to customize the resulting installer. See the cpack_add_* commands, described below, for more information about component-specific installations.
Component-specific installation allows users to select specific sets of components to install during the install process. Installation components are identified by the COMPONENT argument of CMake's INSTALL commands, and should be further described by the following CPack commands:
CPACK_COMPONENTS_ALL - The list of component to install.
The default value of this variable is computed by CPack
and contains all components defined by the project. The
user may set it to only include the specified components.
CPACK_<GENNAME>_COMPONENT_INSTALL - Enable/Disable component install for
CPack generator <GENNAME>.
Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
default behavior. e.g. RPM builds monolithic whereas NSIS builds component.
One can change the default behavior by setting this variable to 0/1 or OFF/ON.
CPACK_COMPONENTS_GROUPING - Specify how components are grouped for multi-package
component-aware CPack generators.
Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates several
packages files when asked for component packaging. They group the component
differently depending on the value of this variable:
- ONE_PER_GROUP (default): creates one package file per component group
- ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component
- IGNORE : creates one package per component, i.e. IGNORE component group
One can specify different grouping for different CPack generator by using
a CPACK_PROJECT_CONFIG_FILE.
CPACK_COMPONENT_<compName>_DISPLAY_NAME - The name to be displayed for a component.
CPACK_COMPONENT_<compName>_DESCRIPTION - The description of a component.
CPACK_COMPONENT_<compName>_GROUP - The group of a component.
CPACK_COMPONENT_<compName>_DEPENDS - The dependencies (list of components)
on which this component depends.
CPACK_COMPONENT_<compName>_REQUIRED - True is this component is required.
cpack_add_component - Describes a CPack installation component
named by the COMPONENT argument to a CMake INSTALL command.
cpack_add_component(compname
[DISPLAY_NAME name]
[DESCRIPTION description]
[HIDDEN | REQUIRED | DISABLED ]
[GROUP group]
[DEPENDS comp1 comp2 ... ]
[INSTALL_TYPES type1 type2 ... ]
[DOWNLOADED]
[ARCHIVE_FILE filename])
The cmake_add_component command describes an installation
component, which the user can opt to install or remove as part of
the graphical installation process. compname is the name of the
component, as provided to the COMPONENT argument of one or more
CMake INSTALL commands.
DISPLAY_NAME is the displayed name of the component, used in
graphical installers to display the component name. This value can
be any string.
DESCRIPTION is an extended description of the component, used in
graphical installers to give the user additional information about
the component. Descriptions can span multiple lines using "\n" as
the line separator. Typically, these descriptions should be no
more than a few lines long.
HIDDEN indicates that this component will be hidden in the
graphical installer, so that the user cannot directly change
whether it is installed or not.
REQUIRED indicates that this component is required, and therefore
will always be installed. It will be visible in the graphical
installer, but it cannot be unselected. (Typically, required
components are shown greyed out).
DISABLED indicates that this component should be disabled
(unselected) by default. The user is free to select this component
for installation, unless it is also HIDDEN.
DEPENDS lists the components on which this component depends. If
this component is selected, then each of the components listed
must also be selected. The dependency information is encoded
within the installer itself, so that users cannot install
inconsitent sets of components.
GROUP names the component group of which this component is a
part. If not provided, the component will be a standalone
component, not part of any component group. Component groups are
described with the cpack_add_component_group command, detailed
below.
INSTALL_TYPES lists the installation types of which this component
is a part. When one of these installations types is selected, this
component will automatically be selected. Installation types are
described with the cpack_add_install_type command, detailed below.
DOWNLOADED indicates that this component should be downloaded
on-the-fly by the installer, rather than packaged in with the
installer itself. For more information, see the cpack_configure_downloads
command.
ARCHIVE_FILE provides a name for the archive file created by CPack
to be used for downloaded components. If not supplied, CPack will
create a file with some name based on CPACK_PACKAGE_FILE_NAME and
the name of the component. See cpack_configure_downloads for more
information.
cpack_add_component_group - Describes a group of related CPack
installation components.
cpack_add_component_group(groupname
[DISPLAY_NAME name]
[DESCRIPTION description]
[PARENT_GROUP parent]
[EXPANDED]
[BOLD_TITLE])
The cpack_add_component_group describes a group of installation
components, which will be placed together within the listing of
options. Typically, component groups allow the user to
select/deselect all of the components within a single group via a
single group-level option. Use component groups to reduce the
complexity of installers with many options. groupname is an
arbitrary name used to identify the group in the GROUP argument of
the cpack_add_component command, which is used to place a
component in a group. The name of the group must not conflict with
the name of any component.
DISPLAY_NAME is the displayed name of the component group, used in
graphical installers to display the component group name. This
value can be any string.
DESCRIPTION is an extended description of the component group,
used in graphical installers to give the user additional
information about the components within that group. Descriptions
can span multiple lines using "\n" as the line
separator. Typically, these descriptions should be no more than a
few lines long.
PARENT_GROUP, if supplied, names the parent group of this group.
Parent groups are used to establish a hierarchy of groups,
providing an arbitrary hierarchy of groups.
EXPANDED indicates that, by default, the group should show up as
"expanded", so that the user immediately sees all of the
components within the group. Otherwise, the group will initially
show up as a single entry.
BOLD_TITLE indicates that the group title should appear in bold,
to call the user's attention to the group.
cpack_add_install_type - Add a new installation type containing a
set of predefined component selections to the graphical installer.
cpack_add_install_type(typename
[DISPLAY_NAME name])
The cpack_add_install_type command identifies a set of preselected
components that represents a common use case for an
application. For example, a "Developer" install type might include
an application along with its header and library files, while an
"End user" install type might just include the application's
executable. Each component identifies itself with one or more
install types via the INSTALL_TYPES argument to
cpack_add_component.
DISPLAY_NAME is the displayed name of the install type, which will
typically show up in a drop-down box within a graphical
installer. This value can be any string.
cpack_configure_downloads - Configure CPack to download selected
components on-the-fly as part of the installation process.
cpack_configure_downloads(site
[UPLOAD_DIRECTORY dirname]
[ALL]
[ADD_REMOVE|NO_ADD_REMOVE])
The cpack_configure_downloads command configures installation-time
downloads of selected components. For each downloadable component,
CPack will create an archive containing the contents of that
component, which should be uploaded to the given site. When the
user selects that component for installation, the installer will
download and extract the component in place. This feature is
useful for creating small installers that only download the
requested components, saving bandwidth. Additionally, the
installers are small enough that they will be installed as part of
the normal installation process, and the "Change" button in
Windows Add/Remove Programs control panel will allow one to add or
remove parts of the application after the original
installation. On Windows, the downloaded-components functionality
requires the ZipDLL plug-in for NSIS, available at:
http://nsis.sourceforge.net/ZipDLL_plug-in
On Mac OS X, installers that download components on-the-fly can
only be built and installed on system using Mac OS X 10.5 or
later.
The site argument is a URL where the archives for downloadable
components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
All of the archives produced by CPack should be uploaded to that location.
UPLOAD_DIRECTORY is the local directory where CPack will create the
various archives for each of the components. The contents of this
directory should be uploaded to a location accessible by the URL given
in the site argument. If omitted, CPack will use the directory
CPackUploads inside the CMake binary directory to store the generated
archives.
The ALL flag indicates that all components be downloaded. Otherwise, only
those components explicitly marked as DOWNLOADED or that have a specified
ARCHIVE_FILE will be downloaded. Additionally, the ALL option implies
ADD_REMOVE (unless NO_ADD_REMOVE is specified).
ADD_REMOVE indicates that CPack should install a copy of the installer
that can be called from Windows' Add/Remove Programs dialog (via the
"Modify" button) to change the set of installed components. NO_ADD_REMOVE
turns off this behavior. This option is ignored on Mac OS X.
CPackCygwin: Cygwin CPack generator (Cygwin).The following variable is specific to installers build on and/or for Cygwin:
CPACK_CYGWIN_PATCH_NUMBER - The Cygwin patch number.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_PATCH_FILE - The Cygwin patch file.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_BUILD_SCRIPT - The Cygwin build script.
FIXME: This documentation is incomplete.
CPackDMG: DragNDrop CPack generator (Mac OS X).The following variables are specific to the DragNDrop installers built on Mac OS X:
CPACK_DMG_VOLUME_NAME - The volume name of the generated disk
image. Defaults to CPACK_PACKAGE_FILE_NAME.
CPACK_DMG_FORMAT - The disk image format. Common values are UDRO
(UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF
bzip2-compressed). Refer to hdiutil(1) for more information on
other available formats.
CPACK_DMG_DS_STORE - Path to a custom DS_Store file. This .DS_Store
file e.g. can be used to specify the Finder window
position/geometry and layout (such as hidden toolbars, placement of the
icons etc.). This file has to be generated by the Finder (either manually or
through OSA-script) using a normal folder from which the .DS_Store
file can then be extracted.
CPACK_DMG_BACKGROUND_IMAGE - Path to a background image file. This
file will be used as the background for the Finder Window when the disk
image is opened. By default no background image is set. The background
image is applied after applying the custom .DS_Store file.
CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to
operate on disk image files on Mac OS X. This variable can be used
to override the automatically detected command (or specify its
location if the auto-detection fails to find it.)
CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set
extended attributes on files and directories on Mac OS X. This
variable can be used to override the automatically detected
command (or specify its location if the auto-detection fails to
find it.)
CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile
resources on Mac OS X. This variable can be used to override the
automatically detected command (or specify its location if the
auto-detection fails to find it.)
CPackDeb: The builtin (binary) CPack Deb generator (Unix only)CPackDeb may be used to create Deb package using CPack. CPackDeb is a CPack generator thus it uses the CPACK_XXX variables used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration. CPackDeb generator should work on any linux host but it will SYSTEM_N user-friendly names and descriptions, inter-component dependencies, etc., and grouped in various ways to customize the resulting installer. See the cpack_add_* commands, described below, for more information about component-specific installations.
Component-specific installation allows users to select specific sets of components to install during the install process. Installation components are identified by the COMPONENT argument of CMake's INSTALL commands, and should be further described by the following CPack commands:
CPACK_COMPONENTS_ALL - The list of component to install.
The default value of this variable is computed by CPack
and contains all components defined by the project. The
user may set it to only include the specified components.
CPACK_<GENNAME>_COMPONENT_INSTALL - Enable/Disable component install for
CPack generator <GENNAME>.
Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
default behavior. e.g. RPM builds monolithic whereas NSIS builds component.
One can change the default behavior by setting this variable to 0/1 or OFF/ON.
CPACK_COMPONENTS_GROUPING - Specify how components are grouped for multi-package
component-aware CPack generators.
Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates several
packages files when asked for component packaging. They group the component
differently depending on the value of this variable:
- ONE_PER_GROUP (default): creates one package file per component group
- ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component
- IGNORE : creates one package per component, i.e. IGNORE component group
One can specify different grouping for different CPack generator by using
a CPACK_PROJECT_CONFIG_FILE.
CPACK_COMPONENT_<compName>_DISPLAY_NAME - The name to be displayed for a component.
CPACK_COMPONENT_<compName>_DESCRIPTION - The description of a component.
CPACK_COMPONENT_<compName>_GROUP - The group of a component.
CPACK_COMPONENT_<compName>_DEPENDS - The dependencies (list of components)
on which this component depends.
CPACK_COMPONENT_<compName>_REQUIRED - True is this component is required.
cpack_add_component - Describes a CPack installation component
named by the COMPONENT argument to a CMake INSTALL command.
cpack_add_component(compname
[DISPLAY_NAME name]
[DESCRIPTION description]
[HIDDEN | REQUIRED | DISABLED ]
[GROUP group]
[DEPENDS comp1 comp2 ... ]
[INSTALL_TYPES type1 type2 ... ]
[DOWNLOADED]
[ARCHIVE_FILE filename])
The cmake_add_component command describes an installation
component, which the user can opt to install or remove as part of
the graphical installation process. compname is the name of the
component, as provided to the COMPONENT argument of one or more
CMake INSTALL commands.
DISPLAY_NAME is the displayed name of the component, used in
graphical installers to display the component name. This value can
be any string.
DESCRIPTION is an extended description of the component, used in
graphical installers to give the user additional information about
the component. Descriptions can span multiple lines using "\n" as
the line separator. Typically, these descriptions should be no
more than a few lines long.
HIDDEN indicates that this component will be hidden in the
graphical installer, so that the user cannot directly change
whether it is installed or not.
REQUIRED indicates that this component is required, and therefore
will always be installed. It will be visible in the graphical
installer, but it cannot be unselected. (Typically, required
components are shown greyed out).
DISABLED indicates that this component should be disabled
(unselected) by default. The user is free to select this component
for installation, unless it is also HIDDEN.
DEPENDS lists the components on which this component depends. If
this component is selected, then each of the components listed
must also be selected. The dependency information is encoded
within the installer itself, so that users cannot install
inconsitent sets of components.
GROUP names the component group of which this component is a
part. If not provided, the component will be a standalone
component, not part of any component group. Component groups are
described with the cpack_add_component_group command, detailed
below.
INSTALL_TYPES lists the installation types of which this component
is a part. When one of these installations types is selected, this
component will automatically be selected. Installation types are
described with the cpack_add_install_type command, detailed below.
DOWNLOADED indicates that this component should be downloaded
on-the-fly by the installer, rather than packaged in with the
installer itself. For more information, see the cpack_configure_downloads
command.
ARCHIVE_FILE provides a name for the archive file created by CPack
to be used for downloaded components. If not supplied, CPack will
create a file with some name based on CPACK_PACKAGE_FILE_NAME and
the name of the component. See cpack_configure_downloads for more
information.
cpack_add_component_group - Describes a group of related CPack
installation components.
cpack_add_component_group(groupname
[DISPLAY_NAME name]
[DESCRIPTION description]
[PARENT_GROUP parent]
[EXPANDED]
[BOLD_TITLE])
The cpack_add_component_group describes a group of installation
components, which will be placed together within the listing of
options. Typically, component groups allow the user to
select/deselect all of the components within a single group via a
single group-level option. Use component groups to reduce the
complexity of installers with many options. groupname is an
arbitrary name used to identify the group in the GROUP argument of
the cpack_add_component command, which is used to place a
component in a group. The name of the group must not conflict with
the name of any component.
DISPLAY_NAME is the displayed name of the component group, used in
graphical installers to display the component group name. This
value can be any string.
DESCRIPTION is an extended description of the component group,
used in graphical installers to give the user additional
information about the components within that group. Descriptions
can span multiple lines using "\n" as the line
separator. Typically, these descriptions should be no more than a
few lines long.
PARENT_GROUP, if supplied, names the parent group of this group.
Parent groups are used to establish a hierarchy of groups,
providing an arbitrary hierarchy of groups.
EXPANDED indicates that, by default, the group should show up as
"expanded", so that the user immediately sees all of the
components within the group. Otherwise, the group will initially
show up as a single entry.
BOLD_TITLE indicates that the group title should appear in bold,
to call the user's attention to the group.
cpack_add_install_type - Add a new installation type containing a
set of predefined component selections to the graphical installer.
cpack_add_install_type(typename
[DISPLAY_NAME name])
The cpack_add_install_type command identifies a set of preselected
components that represents a common use case for an
application. For example, a "Developer" install type might include
an application along with its header and library files, while an
"End user" install type might just include the application's
executable. Each component identifies itself with one or more
install types via the INSTALL_TYPES argument to
cpack_add_component.
DISPLAY_NAME is the displayed name of the install type, which will
typically show up in a drop-down box within a graphical
installer. This value can be any string.
cpack_configure_downloads - Configure CPack to download selected
components on-the-fly as part of the installation process.
cpack_configure_downloads(site
[UPLOAD_DIRECTORY dirname]
[ALL]
[ADD_REMOVE|NO_ADD_REMOVE])
The cpack_configure_downloads command configures installation-time
downloads of selected components. For each downloadable component,
CPack will create an archive containing the contents of that
component, which should be uploaded to the given site. When the
user selects that component for installation, the installer will
download and extract the component in place. This feature is
useful for creating small installers that only download the
requested components, saving bandwidth. Additionally, the
installers are small enough that they will be installed as part of
the normal installation process, and the "Change" button in
Windows Add/Remove Programs control panel will allow one to add or
remove parts of the application after the original
installation. On Windows, the downloaded-components functionality
requires the ZipDLL plug-in for NSIS, available at:
http://nsis.sourceforge.net/ZipDLL_plug-in
On Mac OS X, installers that download components on-the-fly can
only be built and installed on system using Mac OS X 10.5 or
later.
The site argument is a URL where the archives for downloadable
components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
All of the archives produced by CPack should be uploaded to that location.
UPLOAD_DIRECTORY is the local directory where CPack will create the
various archives for each of the components. The contents of this
directory should be uploaded to a location accessible by the URL given
in the site argument. If omitted, CPack will use the directory
CPackUploads inside the CMake binary directory to store the generated
archives.
The ALL flag indicates that all components be downloaded. Otherwise, only
those components explicitly marked as DOWNLOADED or that have a specified
ARCHIVE_FILE will be downloaded. Additionally, the ALL option implies
ADD_REMOVE (unless NO_ADD_REMOVE is specified).
ADD_REMOVE indicates that CPack should install a copy of the installer
that can be called from Windows' Add/Remove Programs dialog (via the
"Modify" button) to change the set of installed components. NO_ADD_REMOVE
turns off this behavior. This option is ignored on Mac OS X.
CPackCygwin: Cygwin CPack generator (Cygwin).The following variable is specific to installers build on and/or for Cygwin:
CPACK_CYGWIN_PATCH_NUMBER - The Cygwin patch number.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_PATCH_FILE - The Cygwin patch file.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_BUILD_SCRIPT - The Cygwin build script.
FIXME: This documentation is incomplete.
CPackDMG: DragNDrop CPack generator (Mac OS X).The following variables are specific to the DragNDrop installers built on Mac OS X:
CPACK_DMG_VOLUME_NAME - The volume name of the generated disk
image. Defaults to CPACK_PACKAGE_FILE_NAME.
CPACK_DMG_FORMAT - The disk image format. Common values are UDRO
(UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF
bzip2-compressed). Refer to hdiutil(1) for more information on
other available formats.
CPACK_DMG_DS_STORE - Path to a custom DS_Store file. This .DS_Store
file e.g. can be used to specify the Finder window
position/geometry and layout (such as hidden toolbars, placement of the
icons etc.). This file has to be generated by the Finder (either manually or
through OSA-script) using a normal folder from which the .DS_Store
file can then be extracted.
CPACK_DMG_BACKGROUND_IMAGE - Path to a background image file. This
file will be used as the background for the Finder Window when the disk
image is opened. By default no background image is set. The background
image is applied after applying the custom .DS_Store file.
CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to
operate on disk image files on Mac OS X. This variable can be used
to override the automatically detected command (or specify its
location if the auto-detection fails to find it.)
CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set
extended attributes on files and directories on Mac OS X. This
variable can be used to override the automatically detected
command (or specify its location if the auto-detection fails to
find it.)
CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile
resources on Mac OS X. This variable can be used to override the
automatically detected command (or specify its location if the
auto-detection fails to find it.)
CPackDeb: The builtin (binary) CPack Deb generator (Unix only)CPackDeb may be used to create Deb package using CPack. CPackDeb is a CPack generator thus it uses the CPACK_XXX variables used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration. CPackDeb generator should work on any linux host but it will SYSTEM_N user-friendly names and descriptions, inter-component dependencies, etc., and grouped in various ways to customize the resulting installer. See the cpack_add_* commands, described below, for more information about component-specific installations.
Component-specific installation allows users to select specific sets of components to install during the install process. Installation components are identified by the COMPONENT argument of CMake's INSTALL commands, and should be further described by the following CPack commands:
CPACK_COMPONENTS_ALL - The list of component to install.
The default value of this variable is computed by CPack
and contains all components defined by the project. The
user may set it to only include the specified components.
CPACK_<GENNAME>_COMPONENT_INSTALL - Enable/Disable component install for
CPack generator <GENNAME>.
Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
default behavior. e.g. RPM builds monolithic whereas NSIS builds component.
One can change the default behavior by setting this variable to 0/1 or OFF/ON.
CPACK_COMPONENTS_GROUPING - Specify how components are grouped for multi-package
component-aware CPack generators.
Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates several
packages files when asked for component packaging. They group the component
differently depending on the value of this variable:
- ONE_PER_GROUP (default): creates one package file per component group
- ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component
- IGNORE : creates one package per component, i.e. IGNORE component group
One can specify different grouping for different CPack generator by using
a CPACK_PROJECT_CONFIG_FILE.
CPACK_COMPONENT_<compName>_DISPLAY_NAME - The name to be displayed for a component.
CPACK_COMPONENT_<compName>_DESCRIPTION - The description of a component.
CPACK_COMPONENT_<compName>_GROUP - The group of a component.
CPACK_COMPONENT_<compName>_DEPENDS - The dependencies (list of components)
on which this component depends.
CPACK_COMPONENT_<compName>_REQUIRED - True is this component is required.
cpack_add_component - Describes a CPack installation component
named by the COMPONENT argument to a CMake INSTALL command.
cpack_add_component(compname
[DISPLAY_NAME name]
[DESCRIPTION description]
[HIDDEN | REQUIRED | DISABLED ]
[GROUP group]
[DEPENDS comp1 comp2 ... ]
[INSTALL_TYPES type1 type2 ... ]
[DOWNLOADED]
[ARCHIVE_FILE filename])
The cmake_add_component command describes an installation
component, which the user can opt to install or remove as part of
the graphical installation process. compname is the name of the
component, as provided to the COMPONENT argument of one or more
CMake INSTALL commands.
DISPLAY_NAME is the displayed name of the component, used in
graphical installers to display the component name. This value can
be any string.
DESCRIPTION is an extended description of the component, used in
graphical installers to give the user additional information about
the component. Descriptions can span multiple lines using "\n" as
the line separator. Typically, these descriptions should be no
more than a few lines long.
HIDDEN indicates that this component will be hidden in the
graphical installer, so that the user cannot directly change
whether it is installed or not.
REQUIRED indicates that this component is required, and therefore
will always be installed. It will be visible in the graphical
installer, but it cannot be unselected. (Typically, required
components are shown greyed out).
DISABLED indicates that this component should be disabled
(unselected) by default. The user is free to select this component
for installation, unless it is also HIDDEN.
DEPENDS lists the components on which this component depends. If
this component is selected, then each of the components listed
must also be selected. The dependency information is encoded
within the installer itself, so that users cannot install
inconsitent sets of components.
GROUP names the component group of which this component is a
part. If not provided, the component will be a standalone
component, not part of any component group. Component groups are
described with the cpack_add_component_group command, detailed
below.
INSTALL_TYPES lists the installation types of which this component
is a part. When one of these installations types is selected, this
component will automatically be selected. Installation types are
described with the cpack_add_install_type command, detailed below.
DOWNLOADED indicates that this component should be downloaded
on-the-fly by the installer, rather than packaged in with the
installer itself. For more information, see the cpack_configure_downloads
command.
ARCHIVE_FILE provides a name for the archive file created by CPack
to be used for downloaded components. If not supplied, CPack will
create a file with some name based on CPACK_PACKAGE_FILE_NAME and
the name of the component. See cpack_configure_downloads for more
information.
cpack_add_component_group - Describes a group of related CPack
installation components.
cpack_add_component_group(groupname
[DISPLAY_NAME name]
[DESCRIPTION description]
[PARENT_GROUP parent]
[EXPANDED]
[BOLD_TITLE])
The cpack_add_component_group describes a group of installation
components, which will be placed together within the listing of
options. Typically, component groups allow the user to
select/deselect all of the components within a single group via a
single group-level option. Use component groups to reduce the
complexity of installers with many options. groupname is an
arbitrary name used to identify the group in the GROUP argument of
the cpack_add_component command, which is used to place a
component in a group. The name of the group must not conflict with
the name of any component.
DISPLAY_NAME is the displayed name of the component group, used in
graphical installers to display the component group name. This
value can be any string.
DESCRIPTION is an extended description of the component group,
used in graphical installers to give the user additional
information about the components within that group. Descriptions
can span multiple lines using "\n" as the line
separator. Typically, these descriptions should be no more than a
few lines long.
PARENT_GROUP, if supplied, names the parent group of this group.
Parent groups are used to establish a hierarchy of groups,
providing an arbitrary hierarchy of groups.
EXPANDED indicates that, by default, the group should show up as
"expanded", so that the user immediately sees all of the
components within the group. Otherwise, the group will initially
show up as a single entry.
BOLD_TITLE indicates that the group title should appear in bold,
to call the user's attention to the group.
cpack_add_install_type - Add a new installation type containing a
set of predefined component selections to the graphical installer.
cpack_add_install_type(typename
[DISPLAY_NAME name])
The cpack_add_install_type command identifies a set of preselected
components that represents a common use case for an
application. For example, a "Developer" install type might include
an application along with its header and library files, while an
"End user" install type might just include the application's
executable. Each component identifies itself with one or more
install types via the INSTALL_TYPES argument to
cpack_add_component.
DISPLAY_NAME is the displayed name of the install type, which will
typically show up in a drop-down box within a graphical
installer. This value can be any string.
cpack_configure_downloads - Configure CPack to download selected
components on-the-fly as part of the installation process.
cpack_configure_downloads(site
[UPLOAD_DIRECTORY dirname]
[ALL]
[ADD_REMOVE|NO_ADD_REMOVE])
The cpack_configure_downloads command configures installation-time
downloads of selected components. For each downloadable component,
CPack will create an archive containing the contents of that
component, which should be uploaded to the given site. When the
user selects that component for installation, the installer will
download and extract the component in place. This feature is
useful for creating small installers that only download the
requested components, saving bandwidth. Additionally, the
installers are small enough that they will be installed as part of
the normal installation process, and the "Change" button in
Windows Add/Remove Programs control panel will allow one to add or
remove parts of the application after the original
installation. On Windows, the downloaded-components functionality
requires the ZipDLL plug-in for NSIS, available at:
http://nsis.sourceforge.net/ZipDLL_plug-in
On Mac OS X, installers that download components on-the-fly can
only be built and installed on system using Mac OS X 10.5 or
later.
The site argument is a URL where the archives for downloadable
components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
All of the archives produced by CPack should be uploaded to that location.
UPLOAD_DIRECTORY is the local directory where CPack will create the
various archives for each of the components. The contents of this
directory should be uploaded to a location accessible by the URL given
in the site argument. If omitted, CPack will use the directory
CPackUploads inside the CMake binary directory to store the generated
archives.
The ALL flag indicates that all components be downloaded. Otherwise, only
those components explicitly marked as DOWNLOADED or that have a specified
ARCHIVE_FILE will be downloaded. Additionally, the ALL option implies
ADD_REMOVE (unless NO_ADD_REMOVE is specified).
ADD_REMOVE indicates that CPack should install a copy of the installer
that can be called from Windows' Add/Remove Programs dialog (via the
"Modify" button) to change the set of installed components. NO_ADD_REMOVE
turns off this behavior. This option is ignored on Mac OS X.
CPackCygwin: Cygwin CPack generator (Cygwin).The following variable is specific to installers build on and/or for Cygwin:
CPACK_CYGWIN_PATCH_NUMBER - The Cygwin patch number.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_PATCH_FILE - The Cygwin patch file.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_BUILD_SCRIPT - The Cygwin build script.
FIXME: This documentation is incomplete.
CPackDMG: DragNDrop CPack generator (Mac OS X).The following variables are specific to the DragNDrop installers built on Mac OS X:
CPACK_DMG_VOLUME_NAME - The volume name of the generated disk
image. Defaults to CPACK_PACKAGE_FILE_NAME.
CPACK_DMG_FORMAT - The disk image format. Common values are UDRO
(UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF
bzip2-compressed). Refer to hdiutil(1) for more information on
other available formats.
CPACK_DMG_DS_STORE - Path to a custom DS_Store file. This .DS_Store
file e.g. can be used to specify the Finder window
position/geometry and layout (such as hidden toolbars, placement of the
icons etc.). This file has to be generated by the Finder (either manually or
through OSA-script) using a normal folder from which the .DS_Store
file can then be extracted.
CPACK_DMG_BACKGROUND_IMAGE - Path to a background image file. This
file will be used as the background for the Finder Window when the disk
image is opened. By default no background image is set. The background
image is applied after applying the custom .DS_Store file.
CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to
operate on disk image files on Mac OS X. This variable can be used
to override the automatically detected command (or specify its
location if the auto-detection fails to find it.)
CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set
extended attributes on files and directories on Mac OS X. This
variable can be used to override the automatically detected
command (or specify its location if the auto-detection fails to
find it.)
CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile
resources on Mac OS X. This variable can be used to override the
automatically detected command (or specify its location if the
auto-detection fails to find it.)
CPackDeb: The builtin (binary) CPack Deb generator (Unix only)CPackDeb may be used to create Deb package using CPack. CPackDeb is a CPack generator thus it uses the CPACK_XXX variables used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration. CPackDeb generator should work on any linux host but it will SYSTEM_N user-friendly names and descriptions, inter-component dependencies, etc., and grouped in various ways to customize the resulting installer. See the cpack_add_* commands, described below, for more information about component-specific installations.
Component-specific installation allows users to select specific sets of components to install during the install process. Installation components are identified by the COMPONENT argument of CMake's INSTALL commands, and should be further described by the following CPack commands:
CPACK_COMPONENTS_ALL - The list of component to install.
The default value of this variable is computed by CPack
and contains all components defined by the project. The
user may set it to only include the specified components.
CPACK_<GENNAME>_COMPONENT_INSTALL - Enable/Disable component install for
CPack generator <GENNAME>.
Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
default behavior. e.g. RPM builds monolithic whereas NSIS builds component.
One can change the default behavior by setting this variable to 0/1 or OFF/ON.
CPACK_COMPONENTS_GROUPING - Specify how components are grouped for multi-package
component-aware CPack generators.
Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates several
packages files when asked for component packaging. They group the component
differently depending on the value of this variable:
- ONE_PER_GROUP (default): creates one package file per component group
- ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component
- IGNORE : creates one package per component, i.e. IGNORE component group
One can specify different grouping for different CPack generator by using
a CPACK_PROJECT_CONFIG_FILE.
CPACK_COMPONENT_<compName>_DISPLAY_NAME - The name to be displayed for a component.
CPACK_COMPONENT_<compName>_DESCRIPTION - The description of a component.
CPACK_COMPONENT_<compName>_GROUP - The group of a component.
CPACK_COMPONENT_<compName>_DEPENDS - The dependencies (list of components)
on which this component depends.
CPACK_COMPONENT_<compName>_REQUIRED - True is this component is required.
cpack_add_component - Describes a CPack installation component
named by the COMPONENT argument to a CMake INSTALL command.
cpack_add_component(compname
[DISPLAY_NAME name]
[DESCRIPTION description]
[HIDDEN | REQUIRED | DISABLED ]
[GROUP group]
[DEPENDS comp1 comp2 ... ]
[INSTALL_TYPES type1 type2 ... ]
[DOWNLOADED]
[ARCHIVE_FILE filename])
The cmake_add_component command describes an installation
component, which the user can opt to install or remove as part of
the graphical installation process. compname is the name of the
component, as provided to the COMPONENT argument of one or more
CMake INSTALL commands.
DISPLAY_NAME is the displayed name of the component, used in
graphical installers to display the component name. This value can
be any string.
DESCRIPTION is an extended description of the component, used in
graphical installers to give the user additional information about
the component. Descriptions can span multiple lines using "\n" as
the line separator. Typically, these descriptions should be no
more than a few lines long.
HIDDEN indicates that this component will be hidden in the
graphical installer, so that the user cannot directly change
whether it is installed or not.
REQUIRED indicates that this component is required, and therefore
will always be installed. It will be visible in the graphical
installer, but it cannot be unselected. (Typically, required
components are shown greyed out).
DISABLED indicates that this component should be disabled
(unselected) by default. The user is free to select this component
for installation, unless it is also HIDDEN.
DEPENDS lists the components on which this component depends. If
this component is selected, then each of the components listed
must also be selected. The dependency information is encoded
within the installer itself, so that users cannot install
inconsitent sets of components.
GROUP names the component group of which this component is a
part. If not provided, the component will be a standalone
component, not part of any component group. Component groups are
described with the cpack_add_component_group command, detailed
below.
INSTALL_TYPES lists the installation types of which this component
is a part. When one of these installations types is selected, this
component will automatically be selected. Installation types are
described with the cpack_add_install_type command, detailed below.
DOWNLOADED indicates that this component should be downloaded
on-the-fly by the installer, rather than packaged in with the
installer itself. For more information, see the cpack_configure_downloads
command.
ARCHIVE_FILE provides a name for the archive file created by CPack
to be used for downloaded components. If not supplied, CPack will
create a file with some name based on CPACK_PACKAGE_FILE_NAME and
the name of the component. See cpack_configure_downloads for more
information.
cpack_add_component_group - Describes a group of related CPack
installation components.
cpack_add_component_group(groupname
[DISPLAY_NAME name]
[DESCRIPTION description]
[PARENT_GROUP parent]
[EXPANDED]
[BOLD_TITLE])
The cpack_add_component_group describes a group of installation
components, which will be placed together within the listing of
options. Typically, component groups allow the user to
select/deselect all of the components within a single group via a
single group-level option. Use component groups to reduce the
complexity of installers with many options. groupname is an
arbitrary name used to identify the group in the GROUP argument of
the cpack_add_component command, which is used to place a
component in a group. The name of the group must not conflict with
the name of any component.
DISPLAY_NAME is the displayed name of the component group, used in
graphical installers to display the component group name. This
value can be any string.
DESCRIPTION is an extended description of the component group,
used in graphical installers to give the user additional
information about the components within that group. Descriptions
can span multiple lines using "\n" as the line
separator. Typically, these descriptions should be no more than a
few lines long.
PARENT_GROUP, if supplied, names the parent group of this group.
Parent groups are used to establish a hierarchy of groups,
providing an arbitrary hierarchy of groups.
EXPANDED indicates that, by default, the group should show up as
"expanded", so that the user immediately sees all of the
components within the group. Otherwise, the group will initially
show up as a single entry.
BOLD_TITLE indicates that the group title should appear in bold,
to call the user's attention to the group.
cpack_add_install_type - Add a new installation type containing a
set of predefined component selections to the graphical installer.
cpack_add_install_type(typename
[DISPLAY_NAME name])
The cpack_add_install_type command identifies a set of preselected
components that represents a common use case for an
application. For example, a "Developer" install type might include
an application along with its header and library files, while an
"End user" install type might just include the application's
executable. Each component identifies itself with one or more
install types via the INSTALL_TYPES argument to
cpack_add_component.
DISPLAY_NAME is the displayed name of the install type, which will
typically show up in a drop-down box within a graphical
installer. This value can be any string.
cpack_configure_downloads - Configure CPack to download selected
components on-the-fly as part of the installation process.
cpack_configure_downloads(site
[UPLOAD_DIRECTORY dirname]
[ALL]
[ADD_REMOVE|NO_ADD_REMOVE])
The cpack_configure_downloads command configures installation-time
downloads of selected components. For each downloadable component,
CPack will create an archive containing the contents of that
component, which should be uploaded to the given site. When the
user selects that component for installation, the installer will
download and extract the component in place. This feature is
useful for creating small installers that only download the
requested components, saving bandwidth. Additionally, the
installers are small enough that they will be installed as part of
the normal installation process, and the "Change" button in
Windows Add/Remove Programs control panel will allow one to add or
remove parts of the application after the original
installation. On Windows, the downloaded-components functionality
requires the ZipDLL plug-in for NSIS, available at:
http://nsis.sourceforge.net/ZipDLL_plug-in
On Mac OS X, installers that download components on-the-fly can
only be built and installed on system using Mac OS X 10.5 or
later.
The site argument is a URL where the archives for downloadable
components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
All of the archives produced by CPack should be uploaded to that location.
UPLOAD_DIRECTORY is the local directory where CPack will create the
various archives for each of the components. The contents of this
directory should be uploaded to a location accessible by the URL given
in the site argument. If omitted, CPack will use the directory
CPackUploads inside the CMake binary directory to store the generated
archives.
The ALL flag indicates that all components be downloaded. Otherwise, only
those components explicitly marked as DOWNLOADED or that have a specified
ARCHIVE_FILE will be downloaded. Additionally, the ALL option implies
ADD_REMOVE (unless NO_ADD_REMOVE is specified).
ADD_REMOVE indicates that CPack should install a copy of the installer
that can be called from Windows' Add/Remove Programs dialog (via the
"Modify" button) to change the set of installed components. NO_ADD_REMOVE
turns off this behavior. This option is ignored on Mac OS X.
CPackCygwin: Cygwin CPack generator (Cygwin).The following variable is specific to installers build on and/or for Cygwin:
CPACK_CYGWIN_PATCH_NUMBER - The Cygwin patch number.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_PATCH_FILE - The Cygwin patch file.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_BUILD_SCRIPT - The Cygwin build script.
FIXME: This documentation is incomplete.
CPackDMG: DragNDrop CPack generator (Mac OS X).The following variables are specific to the DragNDrop installers built on Mac OS X:
CPACK_DMG_VOLUME_NAME - The volume name of the generated disk
image. Defaults to CPACK_PACKAGE_FILE_NAME.
CPACK_DMG_FORMAT - The disk image format. Common values are UDRO
(UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF
bzip2-compressed). Refer to hdiutil(1) for more information on
other available formats.
CPACK_DMG_DS_STORE - Path to a custom DS_Store file. This .DS_Store
file e.g. can be used to specify the Finder window
position/geometry and layout (such as hidden toolbars, placement of the
icons etc.). This file has to be generated by the Finder (either manually or
through OSA-script) using a normal folder from which the .DS_Store
file can then be extracted.
CPACK_DMG_BACKGROUND_IMAGE - Path to a background image file. This
file will be used as the background for the Finder Window when the disk
image is opened. By default no background image is set. The background
image is applied after applying the custom .DS_Store file.
CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to
operate on disk image files on Mac OS X. This variable can be used
to override the automatically detected command (or specify its
location if the auto-detection fails to find it.)
CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set
extended attributes on files and directories on Mac OS X. This
variable can be used to override the automatically detected
command (or specify its location if the auto-detection fails to
find it.)
CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile
resources on Mac OS X. This variable can be used to override the
automatically detected command (or specify its location if the
auto-detection fails to find it.)
CPackDeb: The builtin (binary) CPack Deb generator (Unix only)CPackDeb may be used to create Deb package using CPack. CPackDeb is a CPack generator thus it uses the CPACK_XXX variables used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration. CPackDeb generator should work on any linux host but it will SYSTEM_N user-friendly names and descriptions, inter-component dependencies, etc., and grouped in various ways to customize the resulting installer. See the cpack_add_* commands, described below, for more information about component-specific installations.
Component-specific installation allows users to select specific sets of components to install during the install process. Installation components are identified by the COMPONENT argument of CMake's INSTALL commands, and should be further described by the following CPack commands:
CPACK_COMPONENTS_ALL - The list of component to install.
The default value of this variable is computed by CPack
and contains all components defined by the project. The
user may set it to only include the specified components.
CPACK_<GENNAME>_COMPONENT_INSTALL - Enable/Disable component install for
CPack generator <GENNAME>.
Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
default behavior. e.g. RPM builds monolithic whereas NSIS builds component.
One can change the default behavior by setting this variable to 0/1 or OFF/ON.
CPACK_COMPONENTS_GROUPING - Specify how components are grouped for multi-package
component-aware CPack generators.
Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates several
packages files when asked for component packaging. They group the component
differently depending on the value of this variable:
- ONE_PER_GROUP (default): creates one package file per component group
- ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component
- IGNORE : creates one package per component, i.e. IGNORE component group
One can specify different grouping for different CPack generator by using
a CPACK_PROJECT_CONFIG_FILE.
CPACK_COMPONENT_<compName>_DISPLAY_NAME - The name to be displayed for a component.
CPACK_COMPONENT_<compName>_DESCRIPTION - The description of a component.
CPACK_COMPONENT_<compName>_GROUP - The group of a component.
CPACK_COMPONENT_<compName>_DEPENDS - The dependencies (list of components)
on which this component depends.
CPACK_COMPONENT_<compName>_REQUIRED - True is this component is required.
cpack_add_component - Describes a CPack installation component
named by the COMPONENT argument to a CMake INSTALL command.
cpack_add_component(compname
[DISPLAY_NAME name]
[DESCRIPTION description]
[HIDDEN | REQUIRED | DISABLED ]
[GROUP group]
[DEPENDS comp1 comp2 ... ]
[INSTALL_TYPES type1 type2 ... ]
[DOWNLOADED]
[ARCHIVE_FILE filename])
The cmake_add_component command describes an installation
component, which the user can opt to install or remove as part of
the graphical installation process. compname is the name of the
component, as provided to the COMPONENT argument of one or more
CMake INSTALL commands.
DISPLAY_NAME is the displayed name of the component, used in
graphical installers to display the component name. This value can
be any string.
DESCRIPTION is an extended description of the component, used in
graphical installers to give the user additional information about
the component. Descriptions can span multiple lines using "\n" as
the line separator. Typically, these descriptions should be no
more than a few lines long.
HIDDEN indicates that this component will be hidden in the
graphical installer, so that the user cannot directly change
whether it is installed or not.
REQUIRED indicates that this component is required, and therefore
will always be installed. It will be visible in the graphical
installer, but it cannot be unselected. (Typically, required
components are shown greyed out).
DISABLED indicates that this component should be disabled
(unselected) by default. The user is free to select this component
for installation, unless it is also HIDDEN.
DEPENDS lists the components on which this component depends. If
this component is selected, then each of the components listed
must also be selected. The dependency information is encoded
within the installer itself, so that users cannot install
inconsitent sets of components.
GROUP names the component group of which this component is a
part. If not provided, the component will be a standalone
component, not part of any component group. Component groups are
described with the cpack_add_component_group command, detailed
below.
INSTALL_TYPES lists the installation types of which this component
is a part. When one of these installations types is selected, this
component will automatically be selected. Installation types are
described with the cpack_add_install_type command, detailed below.
DOWNLOADED indicates that this component should be downloaded
on-the-fly by the installer, rather than packaged in with the
installer itself. For more information, see the cpack_configure_downloads
command.
ARCHIVE_FILE provides a name for the archive file created by CPack
to be used for downloaded components. If not supplied, CPack will
create a file with some name based on CPACK_PACKAGE_FILE_NAME and
the name of the component. See cpack_configure_downloads for more
information.
cpack_add_component_group - Describes a group of related CPack
installation components.
cpack_add_component_group(groupname
[DISPLAY_NAME name]
[DESCRIPTION description]
[PARENT_GROUP parent]
[EXPANDED]
[BOLD_TITLE])
The cpack_add_component_group describes a group of installation
components, which will be placed together within the listing of
options. Typically, component groups allow the user to
select/deselect all of the components within a single group via a
single group-level option. Use component groups to reduce the
complexity of installers with many options. groupname is an
arbitrary name used to identify the group in the GROUP argument of
the cpack_add_component command, which is used to place a
component in a group. The name of the group must not conflict with
the name of any component.
DISPLAY_NAME is the displayed name of the component group, used in
graphical installers to display the component group name. This
value can be any string.
DESCRIPTION is an extended description of the component group,
used in graphical installers to give the user additional
information about the components within that group. Descriptions
can span multiple lines using "\n" as the line
separator. Typically, these descriptions should be no more than a
few lines long.
PARENT_GROUP, if supplied, names the parent group of this group.
Parent groups are used to establish a hierarchy of groups,
providing an arbitrary hierarchy of groups.
EXPANDED indicates that, by default, the group should show up as
"expanded", so that the user immediately sees all of the
components within the group. Otherwise, the group will initially
show up as a single entry.
BOLD_TITLE indicates that the group title should appear in bold,
to call the user's attention to the group.
cpack_add_install_type - Add a new installation type containing a
set of predefined component selections to the graphical installer.
cpack_add_install_type(typename
[DISPLAY_NAME name])
The cpack_add_install_type command identifies a set of preselected
components that represents a common use case for an
application. For example, a "Developer" install type might include
an application along with its header and library files, while an
"End user" install type might just include the application's
executable. Each component identifies itself with one or more
install types via the INSTALL_TYPES argument to
cpack_add_component.
DISPLAY_NAME is the displayed name of the install type, which will
typically show up in a drop-down box within a graphical
installer. This value can be any string.
cpack_configure_downloads - Configure CPack to download selected
components on-the-fly as part of the installation process.
cpack_configure_downloads(site
[UPLOAD_DIRECTORY dirname]
[ALL]
[ADD_REMOVE|NO_ADD_REMOVE])
The cpack_configure_downloads command configures installation-time
downloads of selected components. For each downloadable component,
CPack will create an archive containing the contents of that
component, which should be uploaded to the given site. When the
user selects that component for installation, the installer will
download and extract the component in place. This feature is
useful for creating small installers that only download the
requested components, saving bandwidth. Additionally, the
installers are small enough that they will be installed as part of
the normal installation process, and the "Change" button in
Windows Add/Remove Programs control panel will allow one to add or
remove parts of the application after the original
installation. On Windows, the downloaded-components functionality
requires the ZipDLL plug-in for NSIS, available at:
http://nsis.sourceforge.net/ZipDLL_plug-in
On Mac OS X, installers that download components on-the-fly can
only be built and installed on system using Mac OS X 10.5 or
later.
The site argument is a URL where the archives for downloadable
components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
All of the archives produced by CPack should be uploaded to that location.
UPLOAD_DIRECTORY is the local directory where CPack will create the
various archives for each of the components. The contents of this
directory should be uploaded to a location accessible by the URL given
in the site argument. If omitted, CPack will use the directory
CPackUploads inside the CMake binary directory to store the generated
archives.
The ALL flag indicates that all components be downloaded. Otherwise, only
those components explicitly marked as DOWNLOADED or that have a specified
ARCHIVE_FILE will be downloaded. Additionally, the ALL option implies
ADD_REMOVE (unless NO_ADD_REMOVE is specified).
ADD_REMOVE indicates that CPack should install a copy of the installer
that can be called from Windows' Add/Remove Programs dialog (via the
"Modify" button) to change the set of installed components. NO_ADD_REMOVE
turns off this behavior. This option is ignored on Mac OS X.
CPackCygwin: Cygwin CPack generator (Cygwin).The following variable is specific to installers build on and/or for Cygwin:
CPACK_CYGWIN_PATCH_NUMBER - The Cygwin patch number.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_PATCH_FILE - The Cygwin patch file.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_BUILD_SCRIPT - The Cygwin build script.
FIXME: This documentation is incomplete.
CPackDMG: DragNDrop CPack generator (Mac OS X).The following variables are specific to the DragNDrop installers built on Mac OS X:
CPACK_DMG_VOLUME_NAME - The volume name of the generated disk
image. Defaults to CPACK_PACKAGE_FILE_NAME.
CPACK_DMG_FORMAT - The disk image format. Common values are UDRO
(UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF
bzip2-compressed). Refer to hdiutil(1) for more information on
other available formats.
CPACK_DMG_DS_STORE - Path to a custom DS_Store file. This .DS_Store
file e.g. can be used to specify the Finder window
position/geometry and layout (such as hidden toolbars, placement of the
icons etc.). This file has to be generated by the Finder (either manually or
through OSA-script) using a normal folder from which the .DS_Store
file can then be extracted.
CPACK_DMG_BACKGROUND_IMAGE - Path to a background image file. This
file will be used as the background for the Finder Window when the disk
image is opened. By default no background image is set. The background
image is applied after applying the custom .DS_Store file.
CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to
operate on disk image files on Mac OS X. This variable can be used
to override the automatically detected command (or specify its
location if the auto-detection fails to find it.)
CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set
extended attributes on files and directories on Mac OS X. This
variable can be used to override the automatically detected
command (or specify its location if the auto-detection fails to
find it.)
CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile
resources on Mac OS X. This variable can be used to override the
automatically detected command (or specify its location if the
auto-detection fails to find it.)
CPackDeb: The builtin (binary) CPack Deb generator (Unix only)CPackDeb may be used to create Deb package using CPack. CPackDeb is a CPack generator thus it uses the CPACK_XXX variables used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration. CPackDeb generator should work on any linux host but it will SYSTEM_N user-friendly names and descriptions, inter-component dependencies, etc., and grouped in various ways to customize the resulting installer. See the cpack_add_* commands, described below, for more information about component-specific installations.
Component-specific installation allows users to select specific sets of components to install during the install process. Installation components are identified by the COMPONENT argument of CMake's INSTALL commands, and should be further described by the following CPack commands:
CPACK_COMPONENTS_ALL - The list of component to install.
The default value of this variable is computed by CPack
and contains all components defined by the project. The
user may set it to only include the specified components.
CPACK_<GENNAME>_COMPONENT_INSTALL - Enable/Disable component install for
CPack generator <GENNAME>.
Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
default behavior. e.g. RPM builds monolithic whereas NSIS builds component.
One can change the default behavior by setting this variable to 0/1 or OFF/ON.
CPACK_COMPONENTS_GROUPING - Specify how components are grouped for multi-package
component-aware CPack generators.
Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates several
packages files when asked for component packaging. They group the component
differently depending on the value of this variable:
- ONE_PER_GROUP (default): creates one package file per component group
- ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component
- IGNORE : creates one package per component, i.e. IGNORE component group
One can specify different grouping for different CPack generator by using
a CPACK_PROJECT_CONFIG_FILE.
CPACK_COMPONENT_<compName>_DISPLAY_NAME - The name to be displayed for a component.
CPACK_COMPONENT_<compName>_DESCRIPTION - The description of a component.
CPACK_COMPONENT_<compName>_GROUP - The group of a component.
CPACK_COMPONENT_<compName>_DEPENDS - The dependencies (list of components)
on which this component depends.
CPACK_COMPONENT_<compName>_REQUIRED - True is this component is required.
cpack_add_component - Describes a CPack installation component
named by the COMPONENT argument to a CMake INSTALL command.
cpack_add_component(compname
[DISPLAY_NAME name]
[DESCRIPTION description]
[HIDDEN | REQUIRED | DISABLED ]
[GROUP group]
[DEPENDS comp1 comp2 ... ]
[INSTALL_TYPES type1 type2 ... ]
[DOWNLOADED]
[ARCHIVE_FILE filename])
The cmake_add_component command describes an installation
component, which the user can opt to install or remove as part of
the graphical installation process. compname is the name of the
component, as provided to the COMPONENT argument of one or more
CMake INSTALL commands.
DISPLAY_NAME is the displayed name of the component, used in
graphical installers to display the component name. This value can
be any string.
DESCRIPTION is an extended description of the component, used in
graphical installers to give the user additional information about
the component. Descriptions can span multiple lines using "\n" as
the line separator. Typically, these descriptions should be no
more than a few lines long.
HIDDEN indicates that this component will be hidden in the
graphical installer, so that the user cannot directly change
whether it is installed or not.
REQUIRED indicates that this component is required, and therefore
will always be installed. It will be visible in the graphical
installer, but it cannot be unselected. (Typically, required
components are shown greyed out).
DISABLED indicates that this component should be disabled
(unselected) by default. The user is free to select this component
for installation, unless it is also HIDDEN.
DEPENDS lists the components on which this component depends. If
this component is selected, then each of the components listed
must also be selected. The dependency information is encoded
within the installer itself, so that users cannot install
inconsitent sets of components.
GROUP names the component group of which this component is a
part. If not provided, the component will be a standalone
component, not part of any component group. Component groups are
described with the cpack_add_component_group command, detailed
below.
INSTALL_TYPES lists the installation types of which this component
is a part. When one of these installations types is selected, this
component will automatically be selected. Installation types are
described with the cpack_add_install_type command, detailed below.
DOWNLOADED indicates that this component should be downloaded
on-the-fly by the installer, rather than packaged in with the
installer itself. For more information, see the cpack_configure_downloads
command.
ARCHIVE_FILE provides a name for the archive file created by CPack
to be used for downloaded components. If not supplied, CPack will
create a file with some name based on CPACK_PACKAGE_FILE_NAME and
the name of the component. See cpack_configure_downloads for more
information.
cpack_add_component_group - Describes a group of related CPack
installation components.
cpack_add_component_group(groupname
[DISPLAY_NAME name]
[DESCRIPTION description]
[PARENT_GROUP parent]
[EXPANDED]
[BOLD_TITLE])
The cpack_add_component_group describes a group of installation
components, which will be placed together within the listing of
options. Typically, component groups allow the user to
select/deselect all of the components within a single group via a
single group-level option. Use component groups to reduce the
complexity of installers with many options. groupname is an
arbitrary name used to identify the group in the GROUP argument of
the cpack_add_component command, which is used to place a
component in a group. The name of the group must not conflict with
the name of any component.
DISPLAY_NAME is the displayed name of the component group, used in
graphical installers to display the component group name. This
value can be any string.
DESCRIPTION is an extended description of the component group,
used in graphical installers to give the user additional
information about the components within that group. Descriptions
can span multiple lines using "\n" as the line
separator. Typically, these descriptions should be no more than a
few lines long.
PARENT_GROUP, if supplied, names the parent group of this group.
Parent groups are used to establish a hierarchy of groups,
providing an arbitrary hierarchy of groups.
EXPANDED indicates that, by default, the group should show up as
"expanded", so that the user immediately sees all of the
components within the group. Otherwise, the group will initially
show up as a single entry.
BOLD_TITLE indicates that the group title should appear in bold,
to call the user's attention to the group.
cpack_add_install_type - Add a new installation type containing a
set of predefined component selections to the graphical installer.
cpack_add_install_type(typename
[DISPLAY_NAME name])
The cpack_add_install_type command identifies a set of preselected
components that represents a common use case for an
application. For example, a "Developer" install type might include
an application along with its header and library files, while an
"End user" install type might just include the application's
executable. Each component identifies itself with one or more
install types via the INSTALL_TYPES argument to
cpack_add_component.
DISPLAY_NAME is the displayed name of the install type, which will
typically show up in a drop-down box within a graphical
installer. This value can be any string.
cpack_configure_downloads - Configure CPack to download selected
components on-the-fly as part of the installation process.
cpack_configure_downloads(site
[UPLOAD_DIRECTORY dirname]
[ALL]
[ADD_REMOVE|NO_ADD_REMOVE])
The cpack_configure_downloads command configures installation-time
downloads of selected components. For each downloadable component,
CPack will create an archive containing the contents of that
component, which should be uploaded to the given site. When the
user selects that component for installation, the installer will
download and extract the component in place. This feature is
useful for creating small installers that only download the
requested components, saving bandwidth. Additionally, the
installers are small enough that they will be installed as part of
the normal installation process, and the "Change" button in
Windows Add/Remove Programs control panel will allow one to add or
remove parts of the application after the original
installation. On Windows, the downloaded-components functionality
requires the ZipDLL plug-in for NSIS, available at:
http://nsis.sourceforge.net/ZipDLL_plug-in
On Mac OS X, installers that download components on-the-fly can
only be built and installed on system using Mac OS X 10.5 or
later.
The site argument is a URL where the archives for downloadable
components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
All of the archives produced by CPack should be uploaded to that location.
UPLOAD_DIRECTORY is the local directory where CPack will create the
various archives for each of the components. The contents of this
directory should be uploaded to a location accessible by the URL given
in the site argument. If omitted, CPack will use the directory
CPackUploads inside the CMake binary directory to store the generated
archives.
The ALL flag indicates that all components be downloaded. Otherwise, only
those components explicitly marked as DOWNLOADED or that have a specified
ARCHIVE_FILE will be downloaded. Additionally, the ALL option implies
ADD_REMOVE (unless NO_ADD_REMOVE is specified).
ADD_REMOVE indicates that CPack should install a copy of the installer
that can be called from Windows' Add/Remove Programs dialog (via the
"Modify" button) to change the set of installed components. NO_ADD_REMOVE
turns off this behavior. This option is ignored on Mac OS X.
CPackCygwin: Cygwin CPack generator (Cygwin).The following variable is specific to installers build on and/or for Cygwin:
CPACK_CYGWIN_PATCH_NUMBER - The Cygwin patch number.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_PATCH_FILE - The Cygwin patch file.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_BUILD_SCRIPT - The Cygwin build script.
FIXME: This documentation is incomplete.
CPackDMG: DragNDrop CPack generator (Mac OS X).The following variables are specific to the DragNDrop installers built on Mac OS X:
CPACK_DMG_VOLUME_NAME - The volume name of the generated disk
image. Defaults to CPACK_PACKAGE_FILE_NAME.
CPACK_DMG_FORMAT - The disk image format. Common values are UDRO
(UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF
bzip2-compressed). Refer to hdiutil(1) for more information on
other available formats.
CPACK_DMG_DS_STORE - Path to a custom DS_Store file. This .DS_Store
file e.g. can be used to specify the Finder window
position/geometry and layout (such as hidden toolbars, placement of the
icons etc.). This file has to be generated by the Finder (either manually or
through OSA-script) using a normal folder from which the .DS_Store
file can then be extracted.
CPACK_DMG_BACKGROUND_IMAGE - Path to a background image file. This
file will be used as the background for the Finder Window when the disk
image is opened. By default no background image is set. The background
image is applied after applying the custom .DS_Store file.
CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to
operate on disk image files on Mac OS X. This variable can be used
to override the automatically detected command (or specify its
location if the auto-detection fails to find it.)
CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set
extended attributes on files and directories on Mac OS X. This
variable can be used to override the automatically detected
command (or specify its location if the auto-detection fails to
find it.)
CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile
resources on Mac OS X. This variable can be used to override the
automatically detected command (or specify its location if the
auto-detection fails to find it.)
CPackDeb: The builtin (binary) CPack Deb generator (Unix only)CPackDeb may be used to create Deb package using CPack. CPackDeb is a CPack generator thus it uses the CPACK_XXX variables used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration. CPackDeb generator should work on any linux host but it will SYSTEM_N user-friendly names and descriptions, inter-component dependencies, etc., and grouped in various ways to customize the resulting installer. See the cpack_add_* commands, described below, for more information about component-specific installations.
Component-specific installation allows users to select specific sets of components to install during the install process. Installation components are identified by the COMPONENT argument of CMake's INSTALL commands, and should be further described by the following CPack commands:
CPACK_COMPONENTS_ALL - The list of component to install.
The default value of this variable is computed by CPack
and contains all components defined by the project. The
user may set it to only include the specified components.
CPACK_<GENNAME>_COMPONENT_INSTALL - Enable/Disable component install for
CPack generator <GENNAME>.
Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
default behavior. e.g. RPM builds monolithic whereas NSIS builds component.
One can change the default behavior by setting this variable to 0/1 or OFF/ON.
CPACK_COMPONENTS_GROUPING - Specify how components are grouped for multi-package
component-aware CPack generators.
Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates several
packages files when asked for component packaging. They group the component
differently depending on the value of this variable:
- ONE_PER_GROUP (default): creates one package file per component group
- ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component
- IGNORE : creates one package per component, i.e. IGNORE component group
One can specify different grouping for different CPack generator by using
a CPACK_PROJECT_CONFIG_FILE.
CPACK_COMPONENT_<compName>_DISPLAY_NAME - The name to be displayed for a component.
CPACK_COMPONENT_<compName>_DESCRIPTION - The description of a component.
CPACK_COMPONENT_<compName>_GROUP - The group of a component.
CPACK_COMPONENT_<compName>_DEPENDS - The dependencies (list of components)
on which this component depends.
CPACK_COMPONENT_<compName>_REQUIRED - True is this component is required.
cpack_add_component - Describes a CPack installation component
named by the COMPONENT argument to a CMake INSTALL command.
cpack_add_component(compname
[DISPLAY_NAME name]
[DESCRIPTION description]
[HIDDEN | REQUIRED | DISABLED ]
[GROUP group]
[DEPENDS comp1 comp2 ... ]
[INSTALL_TYPES type1 type2 ... ]
[DOWNLOADED]
[ARCHIVE_FILE filename])
The cmake_add_component command describes an installation
component, which the user can opt to install or remove as part of
the graphical installation process. compname is the name of the
component, as provided to the COMPONENT argument of one or more
CMake INSTALL commands.
DISPLAY_NAME is the displayed name of the component, used in
graphical installers to display the component name. This value can
be any string.
DESCRIPTION is an extended description of the component, used in
graphical installers to give the user additional information about
the component. Descriptions can span multiple lines using "\n" as
the line separator. Typically, these descriptions should be no
more than a few lines long.
HIDDEN indicates that this component will be hidden in the
graphical installer, so that the user cannot directly change
whether it is installed or not.
REQUIRED indicates that this component is required, and therefore
will always be installed. It will be visible in the graphical
installer, but it cannot be unselected. (Typically, required
components are shown greyed out).
DISABLED indicates that this component should be disabled
(unselected) by default. The user is free to select this component
for installation, unless it is also HIDDEN.
DEPENDS lists the components on which this component depends. If
this component is selected, then each of the components listed
must also be selected. The dependency information is encoded
within the installer itself, so that users cannot install
inconsitent sets of components.
GROUP names the component group of which this component is a
part. If not provided, the component will be a standalone
component, not part of any component group. Component groups are
described with the cpack_add_component_group command, detailed
below.
INSTALL_TYPES lists the installation types of which this component
is a part. When one of these installations types is selected, this
component will automatically be selected. Installation types are
described with the cpack_add_install_type command, detailed below.
DOWNLOADED indicates that this component should be downloaded
on-the-fly by the installer, rather than packaged in with the
installer itself. For more information, see the cpack_configure_downloads
command.
ARCHIVE_FILE provides a name for the archive file created by CPack
to be used for downloaded components. If not supplied, CPack will
create a file with some name based on CPACK_PACKAGE_FILE_NAME and
the name of the component. See cpack_configure_downloads for more
information.
cpack_add_component_group - Describes a group of related CPack
installation components.
cpack_add_component_group(groupname
[DISPLAY_NAME name]
[DESCRIPTION description]
[PARENT_GROUP parent]
[EXPANDED]
[BOLD_TITLE])
The cpack_add_component_group describes a group of installation
components, which will be placed together within the listing of
options. Typically, component groups allow the user to
select/deselect all of the components within a single group via a
single group-level option. Use component groups to reduce the
complexity of installers with many options. groupname is an
arbitrary name used to identify the group in the GROUP argument of
the cpack_add_component command, which is used to place a
component in a group. The name of the group must not conflict with
the name of any component.
DISPLAY_NAME is the displayed name of the component group, used in
graphical installers to display the component group name. This
value can be any string.
DESCRIPTION is an extended description of the component group,
used in graphical installers to give the user additional
information about the components within that group. Descriptions
can span multiple lines using "\n" as the line
separator. Typically, these descriptions should be no more than a
few lines long.
PARENT_GROUP, if supplied, names the parent group of this group.
Parent groups are used to establish a hierarchy of groups,
providing an arbitrary hierarchy of groups.
EXPANDED indicates that, by default, the group should show up as
"expanded", so that the user immediately sees all of the
components within the group. Otherwise, the group will initially
show up as a single entry.
BOLD_TITLE indicates that the group title should appear in bold,
to call the user's attention to the group.
cpack_add_install_type - Add a new installation type containing a
set of predefined component selections to the graphical installer.
cpack_add_install_type(typename
[DISPLAY_NAME name])
The cpack_add_install_type command identifies a set of preselected
components that represents a common use case for an
application. For example, a "Developer" install type might include
an application along with its header and library files, while an
"End user" install type might just include the application's
executable. Each component identifies itself with one or more
install types via the INSTALL_TYPES argument to
cpack_add_component.
DISPLAY_NAME is the displayed name of the install type, which will
typically show up in a drop-down box within a graphical
installer. This value can be any string.
cpack_configure_downloads - Configure CPack to download selected
components on-the-fly as part of the installation process.
cpack_configure_downloads(site
[UPLOAD_DIRECTORY dirname]
[ALL]
[ADD_REMOVE|NO_ADD_REMOVE])
The cpack_configure_downloads command configures installation-time
downloads of selected components. For each downloadable component,
CPack will create an archive containing the contents of that
component, which should be uploaded to the given site. When the
user selects that component for installation, the installer will
download and extract the component in place. This feature is
useful for creating small installers that only download the
requested components, saving bandwidth. Additionally, the
installers are small enough that they will be installed as part of
the normal installation process, and the "Change" button in
Windows Add/Remove Programs control panel will allow one to add or
remove parts of the application after the original
installation. On Windows, the downloaded-components functionality
requires the ZipDLL plug-in for NSIS, available at:
http://nsis.sourceforge.net/ZipDLL_plug-in
On Mac OS X, installers that download components on-the-fly can
only be built and installed on system using Mac OS X 10.5 or
later.
The site argument is a URL where the archives for downloadable
components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
All of the archives produced by CPack should be uploaded to that location.
UPLOAD_DIRECTORY is the local directory where CPack will create the
various archives for each of the components. The contents of this
directory should be uploaded to a location accessible by the URL given
in the site argument. If omitted, CPack will use the directory
CPackUploads inside the CMake binary directory to store the generated
archives.
The ALL flag indicates that all components be downloaded. Otherwise, only
those components explicitly marked as DOWNLOADED or that have a specified
ARCHIVE_FILE will be downloaded. Additionally, the ALL option implies
ADD_REMOVE (unless NO_ADD_REMOVE is specified).
ADD_REMOVE indicates that CPack should install a copy of the installer
that can be called from Windows' Add/Remove Programs dialog (via the
"Modify" button) to change the set of installed components. NO_ADD_REMOVE
turns off this behavior. This option is ignored on Mac OS X.
CPackCygwin: Cygwin CPack generator (Cygwin).The following variable is specific to installers build on and/or for Cygwin:
CPACK_CYGWIN_PATCH_NUMBER - The Cygwin patch number.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_PATCH_FILE - The Cygwin patch file.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_BUILD_SCRIPT - The Cygwin build script.
FIXME: This documentation is incomplete.
CPackDMG: DragNDrop CPack generator (Mac OS X).The following variables are specific to the DragNDrop installers built on Mac OS X:
CPACK_DMG_VOLUME_NAME - The volume name of the generated disk
image. Defaults to CPACK_PACKAGE_FILE_NAME.
CPACK_DMG_FORMAT - The disk image format. Common values are UDRO
(UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF
bzip2-compressed). Refer to hdiutil(1) for more information on
other available formats.
CPACK_DMG_DS_STORE - Path to a custom DS_Store file. This .DS_Store
file e.g. can be used to specify the Finder window
position/geometry and layout (such as hidden toolbars, placement of the
icons etc.). This file has to be generated by the Finder (either manually or
through OSA-script) using a normal folder from which the .DS_Store
file can then be extracted.
CPACK_DMG_BACKGROUND_IMAGE - Path to a background image file. This
file will be used as the background for the Finder Window when the disk
image is opened. By default no background image is set. The background
image is applied after applying the custom .DS_Store file.
CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to
operate on disk image files on Mac OS X. This variable can be used
to override the automatically detected command (or specify its
location if the auto-detection fails to find it.)
CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set
extended attributes on files and directories on Mac OS X. This
variable can be used to override the automatically detected
command (or specify its location if the auto-detection fails to
find it.)
CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile
resources on Mac OS X. This variable can be used to override the
automatically detected command (or specify its location if the
auto-detection fails to find it.)
CPackDeb: The builtin (binary) CPack Deb generator (Unix only)CPackDeb may be used to create Deb package using CPack. CPackDeb is a CPack generator thus it uses the CPACK_XXX variables used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration. CPackDeb generator should work on any linux host but it will SYSTEM_N user-friendly names and descriptions, inter-component dependencies, etc., and grouped in various ways to customize the resulting installer. See the cpack_add_* commands, described below, for more information about component-specific installations.
Component-specific installation allows users to select specific sets of components to install during the install process. Installation components are identified by the COMPONENT argument of CMake's INSTALL commands, and should be further described by the following CPack commands:
CPACK_COMPONENTS_ALL - The list of component to install.
The default value of this variable is computed by CPack
and contains all components defined by the project. The
user may set it to only include the specified components.
CPACK_<GENNAME>_COMPONENT_INSTALL - Enable/Disable component install for
CPack generator <GENNAME>.
Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
default behavior. e.g. RPM builds monolithic whereas NSIS builds component.
One can change the default behavior by setting this variable to 0/1 or OFF/ON.
CPACK_COMPONENTS_GROUPING - Specify how components are grouped for multi-package
component-aware CPack generators.
Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates several
packages files when asked for component packaging. They group the component
differently depending on the value of this variable:
- ONE_PER_GROUP (default): creates one package file per component group
- ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component
- IGNORE : creates one package per component, i.e. IGNORE component group
One can specify different grouping for different CPack generator by using
a CPACK_PROJECT_CONFIG_FILE.
CPACK_COMPONENT_<compName>_DISPLAY_NAME - The name to be displayed for a component.
CPACK_COMPONENT_<compName>_DESCRIPTION - The description of a component.
CPACK_COMPONENT_<compName>_GROUP - The group of a component.
CPACK_COMPONENT_<compName>_DEPENDS - The dependencies (list of components)
on which this component depends.
CPACK_COMPONENT_<compName>_REQUIRED - True is this component is required.
cpack_add_component - Describes a CPack installation component
named by the COMPONENT argument to a CMake INSTALL command.
cpack_add_component(compname
[DISPLAY_NAME name]
[DESCRIPTION description]
[HIDDEN | REQUIRED | DISABLED ]
[GROUP group]
[DEPENDS comp1 comp2 ... ]
[INSTALL_TYPES type1 type2 ... ]
[DOWNLOADED]
[ARCHIVE_FILE filename])
The cmake_add_component command describes an installation
component, which the user can opt to install or remove as part of
the graphical installation process. compname is the name of the
component, as provided to the COMPONENT argument of one or more
CMake INSTALL commands.
DISPLAY_NAME is the displayed name of the component, used in
graphical installers to display the component name. This value can
be any string.
DESCRIPTION is an extended description of the component, used in
graphical installers to give the user additional information about
the component. Descriptions can span multiple lines using "\n" as
the line separator. Typically, these descriptions should be no
more than a few lines long.
HIDDEN indicates that this component will be hidden in the
graphical installer, so that the user cannot directly change
whether it is installed or not.
REQUIRED indicates that this component is required, and therefore
will always be installed. It will be visible in the graphical
installer, but it cannot be unselected. (Typically, required
components are shown greyed out).
DISABLED indicates that this component should be disabled
(unselected) by default. The user is free to select this component
for installation, unless it is also HIDDEN.
DEPENDS lists the components on which this component depends. If
this component is selected, then each of the components listed
must also be selected. The dependency information is encoded
within the installer itself, so that users cannot install
inconsitent sets of components.
GROUP names the component group of which this component is a
part. If not provided, the component will be a standalone
component, not part of any component group. Component groups are
described with the cpack_add_component_group command, detailed
below.
INSTALL_TYPES lists the installation types of which this component
is a part. When one of these installations types is selected, this
component will automatically be selected. Installation types are
described with the cpack_add_install_type command, detailed below.
DOWNLOADED indicates that this component should be downloaded
on-the-fly by the installer, rather than packaged in with the
installer itself. For more information, see the cpack_configure_downloads
command.
ARCHIVE_FILE provides a name for the archive file created by CPack
to be used for downloaded components. If not supplied, CPack will
create a file with some name based on CPACK_PACKAGE_FILE_NAME and
the name of the component. See cpack_configure_downloads for more
information.
cpack_add_component_group - Describes a group of related CPack
installation components.
cpack_add_component_group(groupname
[DISPLAY_NAME name]
[DESCRIPTION description]
[PARENT_GROUP parent]
[EXPANDED]
[BOLD_TITLE])
The cpack_add_component_group describes a group of installation
components, which will be placed together within the listing of
options. Typically, component groups allow the user to
select/deselect all of the components within a single group via a
single group-level option. Use component groups to reduce the
complexity of installers with many options. groupname is an
arbitrary name used to identify the group in the GROUP argument of
the cpack_add_component command, which is used to place a
component in a group. The name of the group must not conflict with
the name of any component.
DISPLAY_NAME is the displayed name of the component group, used in
graphical installers to display the component group name. This
value can be any string.
DESCRIPTION is an extended description of the component group,
used in graphical installers to give the user additional
information about the components within that group. Descriptions
can span multiple lines using "\n" as the line
separator. Typically, these descriptions should be no more than a
few lines long.
PARENT_GROUP, if supplied, names the parent group of this group.
Parent groups are used to establish a hierarchy of groups,
providing an arbitrary hierarchy of groups.
EXPANDED indicates that, by default, the group should show up as
"expanded", so that the user immediately sees all of the
components within the group. Otherwise, the group will initially
show up as a single entry.
BOLD_TITLE indicates that the group title should appear in bold,
to call the user's attention to the group.
cpack_add_install_type - Add a new installation type containing a
set of predefined component selections to the graphical installer.
cpack_add_install_type(typename
[DISPLAY_NAME name])
The cpack_add_install_type command identifies a set of preselected
components that represents a common use case for an
application. For example, a "Developer" install type might include
an application along with its header and library files, while an
"End user" install type might just include the application's
executable. Each component identifies itself with one or more
install types via the INSTALL_TYPES argument to
cpack_add_component.
DISPLAY_NAME is the displayed name of the install type, which will
typically show up in a drop-down box within a graphical
installer. This value can be any string.
cpack_configure_downloads - Configure CPack to download selected
components on-the-fly as part of the installation process.
cpack_configure_downloads(site
[UPLOAD_DIRECTORY dirname]
[ALL]
[ADD_REMOVE|NO_ADD_REMOVE])
The cpack_configure_downloads command configures installation-time
downloads of selected components. For each downloadable component,
CPack will create an archive containing the contents of that
component, which should be uploaded to the given site. When the
user selects that component for installation, the installer will
download and extract the component in place. This feature is
useful for creating small installers that only download the
requested components, saving bandwidth. Additionally, the
installers are small enough that they will be installed as part of
the normal installation process, and the "Change" button in
Windows Add/Remove Programs control panel will allow one to add or
remove parts of the application after the original
installation. On Windows, the downloaded-components functionality
requires the ZipDLL plug-in for NSIS, available at:
http://nsis.sourceforge.net/ZipDLL_plug-in
On Mac OS X, installers that download components on-the-fly can
only be built and installed on system using Mac OS X 10.5 or
later.
The site argument is a URL where the archives for downloadable
components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
All of the archives produced by CPack should be uploaded to that location.
UPLOAD_DIRECTORY is the local directory where CPack will create the
various archives for each of the components. The contents of this
directory should be uploaded to a location accessible by the URL given
in the site argument. If omitted, CPack will use the directory
CPackUploads inside the CMake binary directory to store the generated
archives.
The ALL flag indicates that all components be downloaded. Otherwise, only
those components explicitly marked as DOWNLOADED or that have a specified
ARCHIVE_FILE will be downloaded. Additionally, the ALL option implies
ADD_REMOVE (unless NO_ADD_REMOVE is specified).
ADD_REMOVE indicates that CPack should install a copy of the installer
that can be called from Windows' Add/Remove Programs dialog (via the
"Modify" button) to change the set of installed components. NO_ADD_REMOVE
turns off this behavior. This option is ignored on Mac OS X.
CPackCygwin: Cygwin CPack generator (Cygwin).The following variable is specific to installers build on and/or for Cygwin:
CPACK_CYGWIN_PATCH_NUMBER - The Cygwin patch number.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_PATCH_FILE - The Cygwin patch file.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_BUILD_SCRIPT - The Cygwin build script.
FIXME: This documentation is incomplete.
CPackDMG: DragNDrop CPack generator (Mac OS X).The following variables are specific to the DragNDrop installers built on Mac OS X:
CPACK_DMG_VOLUME_NAME - The volume name of the generated disk
image. Defaults to CPACK_PACKAGE_FILE_NAME.
CPACK_DMG_FORMAT - The disk image format. Common values are UDRO
(UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF
bzip2-compressed). Refer to hdiutil(1) for more information on
other available formats.
CPACK_DMG_DS_STORE - Path to a custom DS_Store file. This .DS_Store
file e.g. can be used to specify the Finder window
position/geometry and layout (such as hidden toolbars, placement of the
icons etc.). This file has to be generated by the Finder (either manually or
through OSA-script) using a normal folder from which the .DS_Store
file can then be extracted.
CPACK_DMG_BACKGROUND_IMAGE - Path to a background image file. This
file will be used as the background for the Finder Window when the disk
image is opened. By default no background image is set. The background
image is applied after applying the custom .DS_Store file.
CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to
operate on disk image files on Mac OS X. This variable can be used
to override the automatically detected command (or specify its
location if the auto-detection fails to find it.)
CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set
extended attributes on files and directories on Mac OS X. This
variable can be used to override the automatically detected
command (or specify its location if the auto-detection fails to
find it.)
CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile
resources on Mac OS X. This variable can be used to override the
automatically detected command (or specify its location if the
auto-detection fails to find it.)
CPackDeb: The builtin (binary) CPack Deb generator (Unix only)CPackDeb may be used to create Deb package using CPack. CPackDeb is a CPack generator thus it uses the CPACK_XXX variables used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration. CPackDeb generator should work on any linux host but it will SYSTEM_N user-friendly names and descriptions, inter-component dependencies, etc., and grouped in various ways to customize the resulting installer. See the cpack_add_* commands, described below, for more information about component-specific installations.
Component-specific installation allows users to select specific sets of components to install during the install process. Installation components are identified by the COMPONENT argument of CMake's INSTALL commands, and should be further described by the following CPack commands:
CPACK_COMPONENTS_ALL - The list of component to install.
The default value of this variable is computed by CPack
and contains all components defined by the project. The
user may set it to only include the specified components.
CPACK_<GENNAME>_COMPONENT_INSTALL - Enable/Disable component install for
CPack generator <GENNAME>.
Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
default behavior. e.g. RPM builds monolithic whereas NSIS builds component.
One can change the default behavior by setting this variable to 0/1 or OFF/ON.
CPACK_COMPONENTS_GROUPING - Specify how components are grouped for multi-package
component-aware CPack generators.
Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates several
packages files when asked for component packaging. They group the component
differently depending on the value of this variable:
- ONE_PER_GROUP (default): creates one package file per component group
- ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component
- IGNORE : creates one package per component, i.e. IGNORE component group
One can specify different grouping for different CPack generator by using
a CPACK_PROJECT_CONFIG_FILE.
CPACK_COMPONENT_<compName>_DISPLAY_NAME - The name to be displayed for a component.
CPACK_COMPONENT_<compName>_DESCRIPTION - The description of a component.
CPACK_COMPONENT_<compName>_GROUP - The group of a component.
CPACK_COMPONENT_<compName>_DEPENDS - The dependencies (list of components)
on which this component depends.
CPACK_COMPONENT_<compName>_REQUIRED - True is this component is required.
cpack_add_component - Describes a CPack installation component
named by the COMPONENT argument to a CMake INSTALL command.
cpack_add_component(compname
[DISPLAY_NAME name]
[DESCRIPTION description]
[HIDDEN | REQUIRED | DISABLED ]
[GROUP group]
[DEPENDS comp1 comp2 ... ]
[INSTALL_TYPES type1 type2 ... ]
[DOWNLOADED]
[ARCHIVE_FILE filename])
The cmake_add_component command describes an installation
component, which the user can opt to install or remove as part of
the graphical installation process. compname is the name of the
component, as provided to the COMPONENT argument of one or more
CMake INSTALL commands.
DISPLAY_NAME is the displayed name of the component, used in
graphical installers to display the component name. This value can
be any string.
DESCRIPTION is an extended description of the component, used in
graphical installers to give the user additional information about
the component. Descriptions can span multiple lines using "\n" as
the line separator. Typically, these descriptions should be no
more than a few lines long.
HIDDEN indicates that this component will be hidden in the
graphical installer, so that the user cannot directly change
whether it is installed or not.
REQUIRED indicates that this component is required, and therefore
will always be installed. It will be visible in the graphical
installer, but it cannot be unselected. (Typically, required
components are shown greyed out).
DISABLED indicates that this component should be disabled
(unselected) by default. The user is free to select this component
for installation, unless it is also HIDDEN.
DEPENDS lists the components on which this component depends. If
this component is selected, then each of the components listed
must also be selected. The dependency information is encoded
within the installer itself, so that users cannot install
inconsitent sets of components.
GROUP names the component group of which this component is a
part. If not provided, the component will be a standalone
component, not part of any component group. Component groups are
described with the cpack_add_component_group command, detailed
below.
INSTALL_TYPES lists the installation types of which this component
is a part. When one of these installations types is selected, this
component will automatically be selected. Installation types are
described with the cpack_add_install_type command, detailed below.
DOWNLOADED indicates that this component should be downloaded
on-the-fly by the installer, rather than packaged in with the
installer itself. For more information, see the cpack_configure_downloads
command.
ARCHIVE_FILE provides a name for the archive file created by CPack
to be used for downloaded components. If not supplied, CPack will
create a file with some name based on CPACK_PACKAGE_FILE_NAME and
the name of the component. See cpack_configure_downloads for more
information.
cpack_add_component_group - Describes a group of related CPack
installation components.
cpack_add_component_group(groupname
[DISPLAY_NAME name]
[DESCRIPTION description]
[PARENT_GROUP parent]
[EXPANDED]
[BOLD_TITLE])
The cpack_add_component_group describes a group of installation
components, which will be placed together within the listing of
options. Typically, component groups allow the user to
select/deselect all of the components within a single group via a
single group-level option. Use component groups to reduce the
complexity of installers with many options. groupname is an
arbitrary name used to identify the group in the GROUP argument of
the cpack_add_component command, which is used to place a
component in a group. The name of the group must not conflict with
the name of any component.
DISPLAY_NAME is the displayed name of the component group, used in
graphical installers to display the component group name. This
value can be any string.
DESCRIPTION is an extended description of the component group,
used in graphical installers to give the user additional
information about the components within that group. Descriptions
can span multiple lines using "\n" as the line
separator. Typically, these descriptions should be no more than a
few lines long.
PARENT_GROUP, if supplied, names the parent group of this group.
Parent groups are used to establish a hierarchy of groups,
providing an arbitrary hierarchy of groups.
EXPANDED indicates that, by default, the group should show up as
"expanded", so that the user immediately sees all of the
components within the group. Otherwise, the group will initially
show up as a single entry.
BOLD_TITLE indicates that the group title should appear in bold,
to call the user's attention to the group.
cpack_add_install_type - Add a new installation type containing a
set of predefined component selections to the graphical installer.
cpack_add_install_type(typename
[DISPLAY_NAME name])
The cpack_add_install_type command identifies a set of preselected
components that represents a common use case for an
application. For example, a "Developer" install type might include
an application along with its header and library files, while an
"End user" install type might just include the application's
executable. Each component identifies itself with one or more
install types via the INSTALL_TYPES argument to
cpack_add_component.
DISPLAY_NAME is the displayed name of the install type, which will
typically show up in a drop-down box within a graphical
installer. This value can be any string.
cpack_configure_downloads - Configure CPack to download selected
components on-the-fly as part of the installation process.
cpack_configure_downloads(site
[UPLOAD_DIRECTORY dirname]
[ALL]
[ADD_REMOVE|NO_ADD_REMOVE])
The cpack_configure_downloads command configures installation-time
downloads of selected components. For each downloadable component,
CPack will create an archive containing the contents of that
component, which should be uploaded to the given site. When the
user selects that component for installation, the installer will
download and extract the component in place. This feature is
useful for creating small installers that only download the
requested components, saving bandwidth. Additionally, the
installers are small enough that they will be installed as part of
the normal installation process, and the "Change" button in
Windows Add/Remove Programs control panel will allow one to add or
remove parts of the application after the original
installation. On Windows, the downloaded-components functionality
requires the ZipDLL plug-in for NSIS, available at:
http://nsis.sourceforge.net/ZipDLL_plug-in
On Mac OS X, installers that download components on-the-fly can
only be built and installed on system using Mac OS X 10.5 or
later.
The site argument is a URL where the archives for downloadable
components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
All of the archives produced by CPack should be uploaded to that location.
UPLOAD_DIRECTORY is the local directory where CPack will create the
various archives for each of the components. The contents of this
directory should be uploaded to a location accessible by the URL given
in the site argument. If omitted, CPack will use the directory
CPackUploads inside the CMake binary directory to store the generated
archives.
The ALL flag indicates that all components be downloaded. Otherwise, only
those components explicitly marked as DOWNLOADED or that have a specified
ARCHIVE_FILE will be downloaded. Additionally, the ALL option implies
ADD_REMOVE (unless NO_ADD_REMOVE is specified).
ADD_REMOVE indicates that CPack should install a copy of the installer
that can be called from Windows' Add/Remove Programs dialog (via the
"Modify" button) to change the set of installed components. NO_ADD_REMOVE
turns off this behavior. This option is ignored on Mac OS X.
CPackCygwin: Cygwin CPack generator (Cygwin).The following variable is specific to installers build on and/or for Cygwin:
CPACK_CYGWIN_PATCH_NUMBER - The Cygwin patch number.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_PATCH_FILE - The Cygwin patch file.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_BUILD_SCRIPT - The Cygwin build script.
FIXME: This documentation is incomplete.
CPackDMG: DragNDrop CPack generator (Mac OS X).The following variables are specific to the DragNDrop installers built on Mac OS X:
CPACK_DMG_VOLUME_NAME - The volume name of the generated disk
image. Defaults to CPACK_PACKAGE_FILE_NAME.
CPACK_DMG_FORMAT - The disk image format. Common values are UDRO
(UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF
bzip2-compressed). Refer to hdiutil(1) for more information on
other available formats.
CPACK_DMG_DS_STORE - Path to a custom DS_Store file. This .DS_Store
file e.g. can be used to specify the Finder window
position/geometry and layout (such as hidden toolbars, placement of the
icons etc.). This file has to be generated by the Finder (either manually or
through OSA-script) using a normal folder from which the .DS_Store
file can then be extracted.
CPACK_DMG_BACKGROUND_IMAGE - Path to a background image file. This
file will be used as the background for the Finder Window when the disk
image is opened. By default no background image is set. The background
image is applied after applying the custom .DS_Store file.
CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to
operate on disk image files on Mac OS X. This variable can be used
to override the automatically detected command (or specify its
location if the auto-detection fails to find it.)
CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set
extended attributes on files and directories on Mac OS X. This
variable can be used to override the automatically detected
command (or specify its location if the auto-detection fails to
find it.)
CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile
resources on Mac OS X. This variable can be used to override the
automatically detected command (or specify its location if the
auto-detection fails to find it.)
CPackDeb: The builtin (binary) CPack Deb generator (Unix only)CPackDeb may be used to create Deb package using CPack. CPackDeb is a CPack generator thus it uses the CPACK_XXX variables used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration. CPackDeb generator should work on any linux host but it will SYSTEM_N user-friendly names and descriptions, inter-component dependencies, etc., and grouped in various ways to customize the resulting installer. See the cpack_add_* commands, described below, for more information about component-specific installations.
Component-specific installation allows users to select specific sets of components to install during the install process. Installation components are identified by the COMPONENT argument of CMake's INSTALL commands, and should be further described by the following CPack commands:
CPACK_COMPONENTS_ALL - The list of component to install.
The default value of this variable is computed by CPack
and contains all components defined by the project. The
user may set it to only include the specified components.
CPACK_<GENNAME>_COMPONENT_INSTALL - Enable/Disable component install for
CPack generator <GENNAME>.
Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
default behavior. e.g. RPM builds monolithic whereas NSIS builds component.
One can change the default behavior by setting this variable to 0/1 or OFF/ON.
CPACK_COMPONENTS_GROUPING - Specify how components are grouped for multi-package
component-aware CPack generators.
Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates several
packages files when asked for component packaging. They group the component
differently depending on the value of this variable:
- ONE_PER_GROUP (default): creates one package file per component group
- ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component
- IGNORE : creates one package per component, i.e. IGNORE component group
One can specify different grouping for different CPack generator by using
a CPACK_PROJECT_CONFIG_FILE.
CPACK_COMPONENT_<compName>_DISPLAY_NAME - The name to be displayed for a component.
CPACK_COMPONENT_<compName>_DESCRIPTION - The description of a component.
CPACK_COMPONENT_<compName>_GROUP - The group of a component.
CPACK_COMPONENT_<compName>_DEPENDS - The dependencies (list of components)
on which this component depends.
CPACK_COMPONENT_<compName>_REQUIRED - True is this component is required.
cpack_add_component - Describes a CPack installation component
named by the COMPONENT argument to a CMake INSTALL command.
cpack_add_component(compname
[DISPLAY_NAME name]
[DESCRIPTION description]
[HIDDEN | REQUIRED | DISABLED ]
[GROUP group]
[DEPENDS comp1 comp2 ... ]
[INSTALL_TYPES type1 type2 ... ]
[DOWNLOADED]
[ARCHIVE_FILE filename])
The cmake_add_component command describes an installation
component, which the user can opt to install or remove as part of
the graphical installation process. compname is the name of the
component, as provided to the COMPONENT argument of one or more
CMake INSTALL commands.
DISPLAY_NAME is the displayed name of the component, used in
graphical installers to display the component name. This value can
be any string.
DESCRIPTION is an extended description of the component, used in
graphical installers to give the user additional information about
the component. Descriptions can span multiple lines using "\n" as
the line separator. Typically, these descriptions should be no
more than a few lines long.
HIDDEN indicates that this component will be hidden in the
graphical installer, so that the user cannot directly change
whether it is installed or not.
REQUIRED indicates that this component is required, and therefore
will always be installed. It will be visible in the graphical
installer, but it cannot be unselected. (Typically, required
components are shown greyed out).
DISABLED indicates that this component should be disabled
(unselected) by default. The user is free to select this component
for installation, unless it is also HIDDEN.
DEPENDS lists the components on which this component depends. If
this component is selected, then each of the components listed
must also be selected. The dependency information is encoded
within the installer itself, so that users cannot install
inconsitent sets of components.
GROUP names the component group of which this component is a
part. If not provided, the component will be a standalone
component, not part of any component group. Component groups are
described with the cpack_add_component_group command, detailed
below.
INSTALL_TYPES lists the installation types of which this component
is a part. When one of these installations types is selected, this
component will automatically be selected. Installation types are
described with the cpack_add_install_type command, detailed below.
DOWNLOADED indicates that this component should be downloaded
on-the-fly by the installer, rather than packaged in with the
installer itself. For more information, see the cpack_configure_downloads
command.
ARCHIVE_FILE provides a name for the archive file created by CPack
to be used for downloaded components. If not supplied, CPack will
create a file with some name based on CPACK_PACKAGE_FILE_NAME and
the name of the component. See cpack_configure_downloads for more
information.
cpack_add_component_group - Describes a group of related CPack
installation components.
cpack_add_component_group(groupname
[DISPLAY_NAME name]
[DESCRIPTION description]
[PARENT_GROUP parent]
[EXPANDED]
[BOLD_TITLE])
The cpack_add_component_group describes a group of installation
components, which will be placed together within the listing of
options. Typically, component groups allow the user to
select/deselect all of the components within a single group via a
single group-level option. Use component groups to reduce the
complexity of installers with many options. groupname is an
arbitrary name used to identify the group in the GROUP argument of
the cpack_add_component command, which is used to place a
component in a group. The name of the group must not conflict with
the name of any component.
DISPLAY_NAME is the displayed name of the component group, used in
graphical installers to display the component group name. This
value can be any string.
DESCRIPTION is an extended description of the component group,
used in graphical installers to give the user additional
information about the components within that group. Descriptions
can span multiple lines using "\n" as the line
separator. Typically, these descriptions should be no more than a
few lines long.
PARENT_GROUP, if supplied, names the parent group of this group.
Parent groups are used to establish a hierarchy of groups,
providing an arbitrary hierarchy of groups.
EXPANDED indicates that, by default, the group should show up as
"expanded", so that the user immediately sees all of the
components within the group. Otherwise, the group will initially
show up as a single entry.
BOLD_TITLE indicates that the group title should appear in bold,
to call the user's attention to the group.
cpack_add_install_type - Add a new installation type containing a
set of predefined component selections to the graphical installer.
cpack_add_install_type(typename
[DISPLAY_NAME name])
The cpack_add_install_type command identifies a set of preselected
components that represents a common use case for an
application. For example, a "Developer" install type might include
an application along with its header and library files, while an
"End user" install type might just include the application's
executable. Each component identifies itself with one or more
install types via the INSTALL_TYPES argument to
cpack_add_component.
DISPLAY_NAME is the displayed name of the install type, which will
typically show up in a drop-down box within a graphical
installer. This value can be any string.
cpack_configure_downloads - Configure CPack to download selected
components on-the-fly as part of the installation process.
cpack_configure_downloads(site
[UPLOAD_DIRECTORY dirname]
[ALL]
[ADD_REMOVE|NO_ADD_REMOVE])
The cpack_configure_downloads command configures installation-time
downloads of selected components. For each downloadable component,
CPack will create an archive containing the contents of that
component, which should be uploaded to the given site. When the
user selects that component for installation, the installer will
download and extract the component in place. This feature is
useful for creating small installers that only download the
requested components, saving bandwidth. Additionally, the
installers are small enough that they will be installed as part of
the normal installation process, and the "Change" button in
Windows Add/Remove Programs control panel will allow one to add or
remove parts of the application after the original
installation. On Windows, the downloaded-components functionality
requires the ZipDLL plug-in for NSIS, available at:
http://nsis.sourceforge.net/ZipDLL_plug-in
On Mac OS X, installers that download components on-the-fly can
only be built and installed on system using Mac OS X 10.5 or
later.
The site argument is a URL where the archives for downloadable
components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
All of the archives produced by CPack should be uploaded to that location.
UPLOAD_DIRECTORY is the local directory where CPack will create the
various archives for each of the components. The contents of this
directory should be uploaded to a location accessible by the URL given
in the site argument. If omitted, CPack will use the directory
CPackUploads inside the CMake binary directory to store the generated
archives.
The ALL flag indicates that all components be downloaded. Otherwise, only
those components explicitly marked as DOWNLOADED or that have a specified
ARCHIVE_FILE will be downloaded. Additionally, the ALL option implies
ADD_REMOVE (unless NO_ADD_REMOVE is specified).
ADD_REMOVE indicates that CPack should install a copy of the installer
that can be called from Windows' Add/Remove Programs dialog (via the
"Modify" button) to change the set of installed components. NO_ADD_REMOVE
turns off this behavior. This option is ignored on Mac OS X.
CPackCygwin: Cygwin CPack generator (Cygwin).The following variable is specific to installers build on and/or for Cygwin:
CPACK_CYGWIN_PATCH_NUMBER - The Cygwin patch number.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_PATCH_FILE - The Cygwin patch file.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_BUILD_SCRIPT - The Cygwin build script.
FIXME: This documentation is incomplete.
CPackDMG: DragNDrop CPack generator (Mac OS X).The following variables are specific to the DragNDrop installers built on Mac OS X:
CPACK_DMG_VOLUME_NAME - The volume name of the generated disk
image. Defaults to CPACK_PACKAGE_FILE_NAME.
CPACK_DMG_FORMAT - The disk image format. Common values are UDRO
(UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF
bzip2-compressed). Refer to hdiutil(1) for more information on
other available formats.
CPACK_DMG_DS_STORE - Path to a custom DS_Store file. This .DS_Store
file e.g. can be used to specify the Finder window
position/geometry and layout (such as hidden toolbars, placement of the
icons etc.). This file has to be generated by the Finder (either manually or
through OSA-script) using a normal folder from which the .DS_Store
file can then be extracted.
CPACK_DMG_BACKGROUND_IMAGE - Path to a background image file. This
file will be used as the background for the Finder Window when the disk
image is opened. By default no background image is set. The background
image is applied after applying the custom .DS_Store file.
CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to
operate on disk image files on Mac OS X. This variable can be used
to override the automatically detected command (or specify its
location if the auto-detection fails to find it.)
CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set
extended attributes on files and directories on Mac OS X. This
variable can be used to override the automatically detected
command (or specify its location if the auto-detection fails to
find it.)
CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile
resources on Mac OS X. This variable can be used to override the
automatically detected command (or specify its location if the
auto-detection fails to find it.)
CPackDeb: The builtin (binary) CPack Deb generator (Unix only)CPackDeb may be used to create Deb package using CPack. CPackDeb is a CPack generator thus it uses the CPACK_XXX variables used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration. CPackDeb generator should work on any linux host but it will SYSTEM_N user-friendly names and descriptions, inter-component dependencies, etc., and grouped in various ways to customize the resulting installer. See the cpack_add_* commands, described below, for more information about component-specific installations.
Component-specific installation allows users to select specific sets of components to install during the install process. Installation components are identified by the COMPONENT argument of CMake's INSTALL commands, and should be further described by the following CPack commands:
CPACK_COMPONENTS_ALL - The list of component to install.
The default value of this variable is computed by CPack
and contains all components defined by the project. The
user may set it to only include the specified components.
CPACK_<GENNAME>_COMPONENT_INSTALL - Enable/Disable component install for
CPack generator <GENNAME>.
Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
default behavior. e.g. RPM builds monolithic whereas NSIS builds component.
One can change the default behavior by setting this variable to 0/1 or OFF/ON.
CPACK_COMPONENTS_GROUPING - Specify how components are grouped for multi-package
component-aware CPack generators.
Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates several
packages files when asked for component packaging. They group the component
differently depending on the value of this variable:
- ONE_PER_GROUP (default): creates one package file per component group
- ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component
- IGNORE : creates one package per component, i.e. IGNORE component group
One can specify different grouping for different CPack generator by using
a CPACK_PROJECT_CONFIG_FILE.
CPACK_COMPONENT_<compName>_DISPLAY_NAME - The name to be displayed for a component.
CPACK_COMPONENT_<compName>_DESCRIPTION - The description of a component.
CPACK_COMPONENT_<compName>_GROUP - The group of a component.
CPACK_COMPONENT_<compName>_DEPENDS - The dependencies (list of components)
on which this component depends.
CPACK_COMPONENT_<compName>_REQUIRED - True is this component is required.
cpack_add_component - Describes a CPack installation component
named by the COMPONENT argument to a CMake INSTALL command.
cpack_add_component(compname
[DISPLAY_NAME name]
[DESCRIPTION description]
[HIDDEN | REQUIRED | DISABLED ]
[GROUP group]
[DEPENDS comp1 comp2 ... ]
[INSTALL_TYPES type1 type2 ... ]
[DOWNLOADED]
[ARCHIVE_FILE filename])
The cmake_add_component command describes an installation
component, which the user can opt to install or remove as part of
the graphical installation process. compname is the name of the
component, as provided to the COMPONENT argument of one or more
CMake INSTALL commands.
DISPLAY_NAME is the displayed name of the component, used in
graphical installers to display the component name. This value can
be any string.
DESCRIPTION is an extended description of the component, used in
graphical installers to give the user additional information about
the component. Descriptions can span multiple lines using "\n" as
the line separator. Typically, these descriptions should be no
more than a few lines long.
HIDDEN indicates that this component will be hidden in the
graphical installer, so that the user cannot directly change
whether it is installed or not.
REQUIRED indicates that this component is required, and therefore
will always be installed. It will be visible in the graphical
installer, but it cannot be unselected. (Typically, required
components are shown greyed out).
DISABLED indicates that this component should be disabled
(unselected) by default. The user is free to select this component
for installation, unless it is also HIDDEN.
DEPENDS lists the components on which this component depends. If
this component is selected, then each of the components listed
must also be selected. The dependency information is encoded
within the installer itself, so that users cannot install
inconsitent sets of components.
GROUP names the component group of which this component is a
part. If not provided, the component will be a standalone
component, not part of any component group. Component groups are
described with the cpack_add_component_group command, detailed
below.
INSTALL_TYPES lists the installation types of which this component
is a part. When one of these installations types is selected, this
component will automatically be selected. Installation types are
described with the cpack_add_install_type command, detailed below.
DOWNLOADED indicates that this component should be downloaded
on-the-fly by the installer, rather than packaged in with the
installer itself. For more information, see the cpack_configure_downloads
command.
ARCHIVE_FILE provides a name for the archive file created by CPack
to be used for downloaded components. If not supplied, CPack will
create a file with some name based on CPACK_PACKAGE_FILE_NAME and
the name of the component. See cpack_configure_downloads for more
information.
cpack_add_component_group - Describes a group of related CPack
installation components.
cpack_add_component_group(groupname
[DISPLAY_NAME name]
[DESCRIPTION description]
[PARENT_GROUP parent]
[EXPANDED]
[BOLD_TITLE])
The cpack_add_component_group describes a group of installation
components, which will be placed together within the listing of
options. Typically, component groups allow the user to
select/deselect all of the components within a single group via a
single group-level option. Use component groups to reduce the
complexity of installers with many options. groupname is an
arbitrary name used to identify the group in the GROUP argument of
the cpack_add_component command, which is used to place a
component in a group. The name of the group must not conflict with
the name of any component.
DISPLAY_NAME is the displayed name of the component group, used in
graphical installers to display the component group name. This
value can be any string.
DESCRIPTION is an extended description of the component group,
used in graphical installers to give the user additional
information about the components within that group. Descriptions
can span multiple lines using "\n" as the line
separator. Typically, these descriptions should be no more than a
few lines long.
PARENT_GROUP, if supplied, names the parent group of this group.
Parent groups are used to establish a hierarchy of groups,
providing an arbitrary hierarchy of groups.
EXPANDED indicates that, by default, the group should show up as
"expanded", so that the user immediately sees all of the
components within the group. Otherwise, the group will initially
show up as a single entry.
BOLD_TITLE indicates that the group title should appear in bold,
to call the user's attention to the group.
cpack_add_install_type - Add a new installation type containing a
set of predefined component selections to the graphical installer.
cpack_add_install_type(typename
[DISPLAY_NAME name])
The cpack_add_install_type command identifies a set of preselected
components that represents a common use case for an
application. For example, a "Developer" install type might include
an application along with its header and library files, while an
"End user" install type might just include the application's
executable. Each component identifies itself with one or more
install types via the INSTALL_TYPES argument to
cpack_add_component.
DISPLAY_NAME is the displayed name of the install type, which will
typically show up in a drop-down box within a graphical
installer. This value can be any string.
cpack_configure_downloads - Configure CPack to download selected
components on-the-fly as part of the installation process.
cpack_configure_downloads(site
[UPLOAD_DIRECTORY dirname]
[ALL]
[ADD_REMOVE|NO_ADD_REMOVE])
The cpack_configure_downloads command configures installation-time
downloads of selected components. For each downloadable component,
CPack will create an archive containing the contents of that
component, which should be uploaded to the given site. When the
user selects that component for installation, the installer will
download and extract the component in place. This feature is
useful for creating small installers that only download the
requested components, saving bandwidth. Additionally, the
installers are small enough that they will be installed as part of
the normal installation process, and the "Change" button in
Windows Add/Remove Programs control panel will allow one to add or
remove parts of the application after the original
installation. On Windows, the downloaded-components functionality
requires the ZipDLL plug-in for NSIS, available at:
http://nsis.sourceforge.net/ZipDLL_plug-in
On Mac OS X, installers that download components on-the-fly can
only be built and installed on system using Mac OS X 10.5 or
later.
The site argument is a URL where the archives for downloadable
components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
All of the archives produced by CPack should be uploaded to that location.
UPLOAD_DIRECTORY is the local directory where CPack will create the
various archives for each of the components. The contents of this
directory should be uploaded to a location accessible by the URL given
in the site argument. If omitted, CPack will use the directory
CPackUploads inside the CMake binary directory to store the generated
archives.
The ALL flag indicates that all components be downloaded. Otherwise, only
those components explicitly marked as DOWNLOADED or that have a specified
ARCHIVE_FILE will be downloaded. Additionally, the ALL option implies
ADD_REMOVE (unless NO_ADD_REMOVE is specified).
ADD_REMOVE indicates that CPack should install a copy of the installer
that can be called from Windows' Add/Remove Programs dialog (via the
"Modify" button) to change the set of installed components. NO_ADD_REMOVE
turns off this behavior. This option is ignored on Mac OS X.
CPackCygwin: Cygwin CPack generator (Cygwin).The following variable is specific to installers build on and/or for Cygwin:
CPACK_CYGWIN_PATCH_NUMBER - The Cygwin patch number.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_PATCH_FILE - The Cygwin patch file.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_BUILD_SCRIPT - The Cygwin build script.
FIXME: This documentation is incomplete.
CPackDMG: DragNDrop CPack generator (Mac OS X).The following variables are specific to the DragNDrop installers built on Mac OS X:
CPACK_DMG_VOLUME_NAME - The volume name of the generated disk
image. Defaults to CPACK_PACKAGE_FILE_NAME.
CPACK_DMG_FORMAT - The disk image format. Common values are UDRO
(UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF
bzip2-compressed). Refer to hdiutil(1) for more information on
other available formats.
CPACK_DMG_DS_STORE - Path to a custom DS_Store file. This .DS_Store
file e.g. can be used to specify the Finder window
position/geometry and layout (such as hidden toolbars, placement of the
icons etc.). This file has to be generated by the Finder (either manually or
through OSA-script) using a normal folder from which the .DS_Store
file can then be extracted.
CPACK_DMG_BACKGROUND_IMAGE - Path to a background image file. This
file will be used as the background for the Finder Window when the disk
image is opened. By default no background image is set. The background
image is applied after applying the custom .DS_Store file.
CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to
operate on disk image files on Mac OS X. This variable can be used
to override the automatically detected command (or specify its
location if the auto-detection fails to find it.)
CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set
extended attributes on files and directories on Mac OS X. This
variable can be used to override the automatically detected
command (or specify its location if the auto-detection fails to
find it.)
CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile
resources on Mac OS X. This variable can be used to override the
automatically detected command (or specify its location if the
auto-detection fails to find it.)
CPackDeb: The builtin (binary) CPack Deb generator (Unix only)CPackDeb may be used to create Deb package using CPack. CPackDeb is a CPack generator thus it uses the CPACK_XXX variables used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration. CPackDeb generator should work on any linux host but it will SYSTEM_N user-friendly names and descriptions, inter-component dependencies, etc., and grouped in various ways to customize the resulting installer. See the cpack_add_* commands, described below, for more information about component-specific installations.
Component-specific installation allows users to select specific sets of components to install during the install process. Installation components are identified by the COMPONENT argument of CMake's INSTALL commands, and should be further described by the following CPack commands:
CPACK_COMPONENTS_ALL - The list of component to install.
The default value of this variable is computed by CPack
and contains all components defined by the project. The
user may set it to only include the specified components.
CPACK_<GENNAME>_COMPONENT_INSTALL - Enable/Disable component install for
CPack generator <GENNAME>.
Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
default behavior. e.g. RPM builds monolithic whereas NSIS builds component.
One can change the default behavior by setting this variable to 0/1 or OFF/ON.
CPACK_COMPONENTS_GROUPING - Specify how components are grouped for multi-package
component-aware CPack generators.
Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates several
packages files when asked for component packaging. They group the component
differently depending on the value of this variable:
- ONE_PER_GROUP (default): creates one package file per component group
- ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component
- IGNORE : creates one package per component, i.e. IGNORE component group
One can specify different grouping for different CPack generator by using
a CPACK_PROJECT_CONFIG_FILE.
CPACK_COMPONENT_<compName>_DISPLAY_NAME - The name to be displayed for a component.
CPACK_COMPONENT_<compName>_DESCRIPTION - The description of a component.
CPACK_COMPONENT_<compName>_GROUP - The group of a component.
CPACK_COMPONENT_<compName>_DEPENDS - The dependencies (list of components)
on which this component depends.
CPACK_COMPONENT_<compName>_REQUIRED - True is this component is required.
cpack_add_component - Describes a CPack installation component
named by the COMPONENT argument to a CMake INSTALL command.
cpack_add_component(compname
[DISPLAY_NAME name]
[DESCRIPTION description]
[HIDDEN | REQUIRED | DISABLED ]
[GROUP group]
[DEPENDS comp1 comp2 ... ]
[INSTALL_TYPES type1 type2 ... ]
[DOWNLOADED]
[ARCHIVE_FILE filename])
The cmake_add_component command describes an installation
component, which the user can opt to install or remove as part of
the graphical installation process. compname is the name of the
component, as provided to the COMPONENT argument of one or more
CMake INSTALL commands.
DISPLAY_NAME is the displayed name of the component, used in
graphical installers to display the component name. This value can
be any string.
DESCRIPTION is an extended description of the component, used in
graphical installers to give the user additional information about
the component. Descriptions can span multiple lines using "\n" as
the line separator. Typically, these descriptions should be no
more than a few lines long.
HIDDEN indicates that this component will be hidden in the
graphical installer, so that the user cannot directly change
whether it is installed or not.
REQUIRED indicates that this component is required, and therefore
will always be installed. It will be visible in the graphical
installer, but it cannot be unselected. (Typically, required
components are shown greyed out).
DISABLED indicates that this component should be disabled
(unselected) by default. The user is free to select this component
for installation, unless it is also HIDDEN.
DEPENDS lists the components on which this component depends. If
this component is selected, then each of the components listed
must also be selected. The dependency information is encoded
within the installer itself, so that users cannot install
inconsitent sets of components.
GROUP names the component group of which this component is a
part. If not provided, the component will be a standalone
component, not part of any component group. Component groups are
described with the cpack_add_component_group command, detailed
below.
INSTALL_TYPES lists the installation types of which this component
is a part. When one of these installations types is selected, this
component will automatically be selected. Installation types are
described with the cpack_add_install_type command, detailed below.
DOWNLOADED indicates that this component should be downloaded
on-the-fly by the installer, rather than packaged in with the
installer itself. For more information, see the cpack_configure_downloads
command.
ARCHIVE_FILE provides a name for the archive file created by CPack
to be used for downloaded components. If not supplied, CPack will
create a file with some name based on CPACK_PACKAGE_FILE_NAME and
the name of the component. See cpack_configure_downloads for more
information.
cpack_add_component_group - Describes a group of related CPack
installation components.
cpack_add_component_group(groupname
[DISPLAY_NAME name]
[DESCRIPTION description]
[PARENT_GROUP parent]
[EXPANDED]
[BOLD_TITLE])
The cpack_add_component_group describes a group of installation
components, which will be placed together within the listing of
options. Typically, component groups allow the user to
select/deselect all of the components within a single group via a
single group-level option. Use component groups to reduce the
complexity of installers with many options. groupname is an
arbitrary name used to identify the group in the GROUP argument of
the cpack_add_component command, which is used to place a
component in a group. The name of the group must not conflict with
the name of any component.
DISPLAY_NAME is the displayed name of the component group, used in
graphical installers to display the component group name. This
value can be any string.
DESCRIPTION is an extended description of the component group,
used in graphical installers to give the user additional
information about the components within that group. Descriptions
can span multiple lines using "\n" as the line
separator. Typically, these descriptions should be no more than a
few lines long.
PARENT_GROUP, if supplied, names the parent group of this group.
Parent groups are used to establish a hierarchy of groups,
providing an arbitrary hierarchy of groups.
EXPANDED indicates that, by default, the group should show up as
"expanded", so that the user immediately sees all of the
components within the group. Otherwise, the group will initially
show up as a single entry.
BOLD_TITLE indicates that the group title should appear in bold,
to call the user's attention to the group.
cpack_add_install_type - Add a new installation type containing a
set of predefined component selections to the graphical installer.
cpack_add_install_type(typename
[DISPLAY_NAME name])
The cpack_add_install_type command identifies a set of preselected
components that represents a common use case for an
application. For example, a "Developer" install type might include
an application along with its header and library files, while an
"End user" install type might just include the application's
executable. Each component identifies itself with one or more
install types via the INSTALL_TYPES argument to
cpack_add_component.
DISPLAY_NAME is the displayed name of the install type, which will
typically show up in a drop-down box within a graphical
installer. This value can be any string.
cpack_configure_downloads - Configure CPack to download selected
components on-the-fly as part of the installation process.
cpack_configure_downloads(site
[UPLOAD_DIRECTORY dirname]
[ALL]
[ADD_REMOVE|NO_ADD_REMOVE])
The cpack_configure_downloads command configures installation-time
downloads of selected components. For each downloadable component,
CPack will create an archive containing the contents of that
component, which should be uploaded to the given site. When the
user selects that component for installation, the installer will
download and extract the component in place. This feature is
useful for creating small installers that only download the
requested components, saving bandwidth. Additionally, the
installers are small enough that they will be installed as part of
the normal installation process, and the "Change" button in
Windows Add/Remove Programs control panel will allow one to add or
remove parts of the application after the original
installation. On Windows, the downloaded-components functionality
requires the ZipDLL plug-in for NSIS, available at:
http://nsis.sourceforge.net/ZipDLL_plug-in
On Mac OS X, installers that download components on-the-fly can
only be built and installed on system using Mac OS X 10.5 or
later.
The site argument is a URL where the archives for downloadable
components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
All of the archives produced by CPack should be uploaded to that location.
UPLOAD_DIRECTORY is the local directory where CPack will create the
various archives for each of the components. The contents of this
directory should be uploaded to a location accessible by the URL given
in the site argument. If omitted, CPack will use the directory
CPackUploads inside the CMake binary directory to store the generated
archives.
The ALL flag indicates that all components be downloaded. Otherwise, only
those components explicitly marked as DOWNLOADED or that have a specified
ARCHIVE_FILE will be downloaded. Additionally, the ALL option implies
ADD_REMOVE (unless NO_ADD_REMOVE is specified).
ADD_REMOVE indicates that CPack should install a copy of the installer
that can be called from Windows' Add/Remove Programs dialog (via the
"Modify" button) to change the set of installed components. NO_ADD_REMOVE
turns off this behavior. This option is ignored on Mac OS X.
CPackCygwin: Cygwin CPack generator (Cygwin).The following variable is specific to installers build on and/or for Cygwin:
CPACK_CYGWIN_PATCH_NUMBER - The Cygwin patch number.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_PATCH_FILE - The Cygwin patch file.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_BUILD_SCRIPT - The Cygwin build script.
FIXME: This documentation is incomplete.
CPackDMG: DragNDrop CPack generator (Mac OS X).The following variables are specific to the DragNDrop installers built on Mac OS X:
CPACK_DMG_VOLUME_NAME - The volume name of the generated disk
image. Defaults to CPACK_PACKAGE_FILE_NAME.
CPACK_DMG_FORMAT - The disk image format. Common values are UDRO
(UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF
bzip2-compressed). Refer to hdiutil(1) for more information on
other available formats.
CPACK_DMG_DS_STORE - Path to a custom DS_Store file. This .DS_Store
file e.g. can be used to specify the Finder window
position/geometry and layout (such as hidden toolbars, placement of the
icons etc.). This file has to be generated by the Finder (either manually or
through OSA-script) using a normal folder from which the .DS_Store
file can then be extracted.
CPACK_DMG_BACKGROUND_IMAGE - Path to a background image file. This
file will be used as the background for the Finder Window when the disk
image is opened. By default no background image is set. The background
image is applied after applying the custom .DS_Store file.
CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to
operate on disk image files on Mac OS X. This variable can be used
to override the automatically detected command (or specify its
location if the auto-detection fails to find it.)
CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set
extended attributes on files and directories on Mac OS X. This
variable can be used to override the automatically detected
command (or specify its location if the auto-detection fails to
find it.)
CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile
resources on Mac OS X. This variable can be used to override the
automatically detected command (or specify its location if the
auto-detection fails to find it.)
CPackDeb: The builtin (binary) CPack Deb generator (Unix only)CPackDeb may be used to create Deb package using CPack. CPackDeb is a CPack generator thus it uses the CPACK_XXX variables used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration. CPackDeb generator should work on any linux host but it will SYSTEM_N user-friendly names and descriptions, inter-component dependencies, etc., and grouped in various ways to customize the resulting installer. See the cpack_add_* commands, described below, for more information about component-specific installations.
Component-specific installation allows users to select specific sets of components to install during the install process. Installation components are identified by the COMPONENT argument of CMake's INSTALL commands, and should be further described by the following CPack commands:
CPACK_COMPONENTS_ALL - The list of component to install.
The default value of this variable is computed by CPack
and contains all components defined by the project. The
user may set it to only include the specified components.
CPACK_<GENNAME>_COMPONENT_INSTALL - Enable/Disable component install for
CPack generator <GENNAME>.
Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
default behavior. e.g. RPM builds monolithic whereas NSIS builds component.
One can change the default behavior by setting this variable to 0/1 or OFF/ON.
CPACK_COMPONENTS_GROUPING - Specify how components are grouped for multi-package
component-aware CPack generators.
Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates several
packages files when asked for component packaging. They group the component
differently depending on the value of this variable:
- ONE_PER_GROUP (default): creates one package file per component group
- ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component
- IGNORE : creates one package per component, i.e. IGNORE component group
One can specify different grouping for different CPack generator by using
a CPACK_PROJECT_CONFIG_FILE.
CPACK_COMPONENT_<compName>_DISPLAY_NAME - The name to be displayed for a component.
CPACK_COMPONENT_<compName>_DESCRIPTION - The description of a component.
CPACK_COMPONENT_<compName>_GROUP - The group of a component.
CPACK_COMPONENT_<compName>_DEPENDS - The dependencies (list of components)
on which this component depends.
CPACK_COMPONENT_<compName>_REQUIRED - True is this component is required.
cpack_add_component - Describes a CPack installation component
named by the COMPONENT argument to a CMake INSTALL command.
cpack_add_component(compname
[DISPLAY_NAME name]
[DESCRIPTION description]
[HIDDEN | REQUIRED | DISABLED ]
[GROUP group]
[DEPENDS comp1 comp2 ... ]
[INSTALL_TYPES type1 type2 ... ]
[DOWNLOADED]
[ARCHIVE_FILE filename])
The cmake_add_component command describes an installation
component, which the user can opt to install or remove as part of
the graphical installation process. compname is the name of the
component, as provided to the COMPONENT argument of one or more
CMake INSTALL commands.
DISPLAY_NAME is the displayed name of the component, used in
graphical installers to display the component name. This value can
be any string.
DESCRIPTION is an extended description of the component, used in
graphical installers to give the user additional information about
the component. Descriptions can span multiple lines using "\n" as
the line separator. Typically, these descriptions should be no
more than a few lines long.
HIDDEN indicates that this component will be hidden in the
graphical installer, so that the user cannot directly change
whether it is installed or not.
REQUIRED indicates that this component is required, and therefore
will always be installed. It will be visible in the graphical
installer, but it cannot be unselected. (Typically, required
components are shown greyed out).
DISABLED indicates that this component should be disabled
(unselected) by default. The user is free to select this component
for installation, unless it is also HIDDEN.
DEPENDS lists the components on which this component depends. If
this component is selected, then each of the components listed
must also be selected. The dependency information is encoded
within the installer itself, so that users cannot install
inconsitent sets of components.
GROUP names the component group of which this component is a
part. If not provided, the component will be a standalone
component, not part of any component group. Component groups are
described with the cpack_add_component_group command, detailed
below.
INSTALL_TYPES lists the installation types of which this component
is a part. When one of these installations types is selected, this
component will automatically be selected. Installation types are
described with the cpack_add_install_type command, detailed below.
DOWNLOADED indicates that this component should be downloaded
on-the-fly by the installer, rather than packaged in with the
installer itself. For more information, see the cpack_configure_downloads
command.
ARCHIVE_FILE provides a name for the archive file created by CPack
to be used for downloaded components. If not supplied, CPack will
create a file with some name based on CPACK_PACKAGE_FILE_NAME and
the name of the component. See cpack_configure_downloads for more
information.
cpack_add_component_group - Describes a group of related CPack
installation components.
cpack_add_component_group(groupname
[DISPLAY_NAME name]
[DESCRIPTION description]
[PARENT_GROUP parent]
[EXPANDED]
[BOLD_TITLE])
The cpack_add_component_group describes a group of installation
components, which will be placed together within the listing of
options. Typically, component groups allow the user to
select/deselect all of the components within a single group via a
single group-level option. Use component groups to reduce the
complexity of installers with many options. groupname is an
arbitrary name used to identify the group in the GROUP argument of
the cpack_add_component command, which is used to place a
component in a group. The name of the group must not conflict with
the name of any component.
DISPLAY_NAME is the displayed name of the component group, used in
graphical installers to display the component group name. This
value can be any string.
DESCRIPTION is an extended description of the component group,
used in graphical installers to give the user additional
information about the components within that group. Descriptions
can span multiple lines using "\n" as the line
separator. Typically, these descriptions should be no more than a
few lines long.
PARENT_GROUP, if supplied, names the parent group of this group.
Parent groups are used to establish a hierarchy of groups,
providing an arbitrary hierarchy of groups.
EXPANDED indicates that, by default, the group should show up as
"expanded", so that the user immediately sees all of the
components within the group. Otherwise, the group will initially
show up as a single entry.
BOLD_TITLE indicates that the group title should appear in bold,
to call the user's attention to the group.
cpack_add_install_type - Add a new installation type containing a
set of predefined component selections to the graphical installer.
cpack_add_install_type(typename
[DISPLAY_NAME name])
The cpack_add_install_type command identifies a set of preselected
components that represents a common use case for an
application. For example, a "Developer" install type might include
an application along with its header and library files, while an
"End user" install type might just include the application's
executable. Each component identifies itself with one or more
install types via the INSTALL_TYPES argument to
cpack_add_component.
DISPLAY_NAME is the displayed name of the install type, which will
typically show up in a drop-down box within a graphical
installer. This value can be any string.
cpack_configure_downloads - Configure CPack to download selected
components on-the-fly as part of the installation process.
cpack_configure_downloads(site
[UPLOAD_DIRECTORY dirname]
[ALL]
[ADD_REMOVE|NO_ADD_REMOVE])
The cpack_configure_downloads command configures installation-time
downloads of selected components. For each downloadable component,
CPack will create an archive containing the contents of that
component, which should be uploaded to the given site. When the
user selects that component for installation, the installer will
download and extract the component in place. This feature is
useful for creating small installers that only download the
requested components, saving bandwidth. Additionally, the
installers are small enough that they will be installed as part of
the normal installation process, and the "Change" button in
Windows Add/Remove Programs control panel will allow one to add or
remove parts of the application after the original
installation. On Windows, the downloaded-components functionality
requires the ZipDLL plug-in for NSIS, available at:
http://nsis.sourceforge.net/ZipDLL_plug-in
On Mac OS X, installers that download components on-the-fly can
only be built and installed on system using Mac OS X 10.5 or
later.
The site argument is a URL where the archives for downloadable
components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
All of the archives produced by CPack should be uploaded to that location.
UPLOAD_DIRECTORY is the local directory where CPack will create the
various archives for each of the components. The contents of this
directory should be uploaded to a location accessible by the URL given
in the site argument. If omitted, CPack will use the directory
CPackUploads inside the CMake binary directory to store the generated
archives.
The ALL flag indicates that all components be downloaded. Otherwise, only
those components explicitly marked as DOWNLOADED or that have a specified
ARCHIVE_FILE will be downloaded. Additionally, the ALL option implies
ADD_REMOVE (unless NO_ADD_REMOVE is specified).
ADD_REMOVE indicates that CPack should install a copy of the installer
that can be called from Windows' Add/Remove Programs dialog (via the
"Modify" button) to change the set of installed components. NO_ADD_REMOVE
turns off this behavior. This option is ignored on Mac OS X.
CPackCygwin: Cygwin CPack generator (Cygwin).The following variable is specific to installers build on and/or for Cygwin:
CPACK_CYGWIN_PATCH_NUMBER - The Cygwin patch number.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_PATCH_FILE - The Cygwin patch file.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_BUILD_SCRIPT - The Cygwin build script.
FIXME: This documentation is incomplete.
CPackDMG: DragNDrop CPack generator (Mac OS X).The following variables are specific to the DragNDrop installers built on Mac OS X:
CPACK_DMG_VOLUME_NAME - The volume name of the generated disk
image. Defaults to CPACK_PACKAGE_FILE_NAME.
CPACK_DMG_FORMAT - The disk image format. Common values are UDRO
(UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF
bzip2-compressed). Refer to hdiutil(1) for more information on
other available formats.
CPACK_DMG_DS_STORE - Path to a custom DS_Store file. This .DS_Store
file e.g. can be used to specify the Finder window
position/geometry and layout (such as hidden toolbars, placement of the
icons etc.). This file has to be generated by the Finder (either manually or
through OSA-script) using a normal folder from which the .DS_Store
file can then be extracted.
CPACK_DMG_BACKGROUND_IMAGE - Path to a background image file. This
file will be used as the background for the Finder Window when the disk
image is opened. By default no background image is set. The background
image is applied after applying the custom .DS_Store file.
CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to
operate on disk image files on Mac OS X. This variable can be used
to override the automatically detected command (or specify its
location if the auto-detection fails to find it.)
CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set
extended attributes on files and directories on Mac OS X. This
variable can be used to override the automatically detected
command (or specify its location if the auto-detection fails to
find it.)
CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile
resources on Mac OS X. This variable can be used to override the
automatically detected command (or specify its location if the
auto-detection fails to find it.)
CPackDeb: The builtin (binary) CPack Deb generator (Unix only)CPackDeb may be used to create Deb package using CPack. CPackDeb is a CPack generator thus it uses the CPACK_XXX variables used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration. CPackDeb generator should work on any linux host but it will SYSTEM_N user-friendly names and descriptions, inter-component dependencies, etc., and grouped in various ways to customize the resulting installer. See the cpack_add_* commands, described below, for more information about component-specific installations.
Component-specific installation allows users to select specific sets of components to install during the install process. Installation components are identified by the COMPONENT argument of CMake's INSTALL commands, and should be further described by the following CPack commands:
CPACK_COMPONENTS_ALL - The list of component to install.
The default value of this variable is computed by CPack
and contains all components defined by the project. The
user may set it to only include the specified components.
CPACK_<GENNAME>_COMPONENT_INSTALL - Enable/Disable component install for
CPack generator <GENNAME>.
Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
default behavior. e.g. RPM builds monolithic whereas NSIS builds component.
One can change the default behavior by setting this variable to 0/1 or OFF/ON.
CPACK_COMPONENTS_GROUPING - Specify how components are grouped for multi-package
component-aware CPack generators.
Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates several
packages files when asked for component packaging. They group the component
differently depending on the value of this variable:
- ONE_PER_GROUP (default): creates one package file per component group
- ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component
- IGNORE : creates one package per component, i.e. IGNORE component group
One can specify different grouping for different CPack generator by using
a CPACK_PROJECT_CONFIG_FILE.
CPACK_COMPONENT_<compName>_DISPLAY_NAME - The name to be displayed for a component.
CPACK_COMPONENT_<compName>_DESCRIPTION - The description of a component.
CPACK_COMPONENT_<compName>_GROUP - The group of a component.
CPACK_COMPONENT_<compName>_DEPENDS - The dependencies (list of components)
on which this component depends.
CPACK_COMPONENT_<compName>_REQUIRED - True is this component is required.
cpack_add_component - Describes a CPack installation component
named by the COMPONENT argument to a CMake INSTALL command.
cpack_add_component(compname
[DISPLAY_NAME name]
[DESCRIPTION description]
[HIDDEN | REQUIRED | DISABLED ]
[GROUP group]
[DEPENDS comp1 comp2 ... ]
[INSTALL_TYPES type1 type2 ... ]
[DOWNLOADED]
[ARCHIVE_FILE filename])
The cmake_add_component command describes an installation
component, which the user can opt to install or remove as part of
the graphical installation process. compname is the name of the
component, as provided to the COMPONENT argument of one or more
CMake INSTALL commands.
DISPLAY_NAME is the displayed name of the component, used in
graphical installers to display the component name. This value can
be any string.
DESCRIPTION is an extended description of the component, used in
graphical installers to give the user additional information about
the component. Descriptions can span multiple lines using "\n" as
the line separator. Typically, these descriptions should be no
more than a few lines long.
HIDDEN indicates that this component will be hidden in the
graphical installer, so that the user cannot directly change
whether it is installed or not.
REQUIRED indicates that this component is required, and therefore
will always be installed. It will be visible in the graphical
installer, but it cannot be unselected. (Typically, required
components are shown greyed out).
DISABLED indicates that this component should be disabled
(unselected) by default. The user is free to select this component
for installation, unless it is also HIDDEN.
DEPENDS lists the components on which this component depends. If
this component is selected, then each of the components listed
must also be selected. The dependency information is encoded
within the installer itself, so that users cannot install
inconsitent sets of components.
GROUP names the component group of which this component is a
part. If not provided, the component will be a standalone
component, not part of any component group. Component groups are
described with the cpack_add_component_group command, detailed
below.
INSTALL_TYPES lists the installation types of which this component
is a part. When one of these installations types is selected, this
component will automatically be selected. Installation types are
described with the cpack_add_install_type command, detailed below.
DOWNLOADED indicates that this component should be downloaded
on-the-fly by the installer, rather than packaged in with the
installer itself. For more information, see the cpack_configure_downloads
command.
ARCHIVE_FILE provides a name for the archive file created by CPack
to be used for downloaded components. If not supplied, CPack will
create a file with some name based on CPACK_PACKAGE_FILE_NAME and
the name of the component. See cpack_configure_downloads for more
information.
cpack_add_component_group - Describes a group of related CPack
installation components.
cpack_add_component_group(groupname
[DISPLAY_NAME name]
[DESCRIPTION description]
[PARENT_GROUP parent]
[EXPANDED]
[BOLD_TITLE])
The cpack_add_component_group describes a group of installation
components, which will be placed together within the listing of
options. Typically, component groups allow the user to
select/deselect all of the components within a single group via a
single group-level option. Use component groups to reduce the
complexity of installers with many options. groupname is an
arbitrary name used to identify the group in the GROUP argument of
the cpack_add_component command, which is used to place a
component in a group. The name of the group must not conflict with
the name of any component.
DISPLAY_NAME is the displayed name of the component group, used in
graphical installers to display the component group name. This
value can be any string.
DESCRIPTION is an extended description of the component group,
used in graphical installers to give the user additional
information about the components within that group. Descriptions
can span multiple lines using "\n" as the line
separator. Typically, these descriptions should be no more than a
few lines long.
PARENT_GROUP, if supplied, names the parent group of this group.
Parent groups are used to establish a hierarchy of groups,
providing an arbitrary hierarchy of groups.
EXPANDED indicates that, by default, the group should show up as
"expanded", so that the user immediately sees all of the
components within the group. Otherwise, the group will initially
show up as a single entry.
BOLD_TITLE indicates that the group title should appear in bold,
to call the user's attention to the group.
cpack_add_install_type - Add a new installation type containing a
set of predefined component selections to the graphical installer.
cpack_add_install_type(typename
[DISPLAY_NAME name])
The cpack_add_install_type command identifies a set of preselected
components that represents a common use case for an
application. For example, a "Developer" install type might include
an application along with its header and library files, while an
"End user" install type might just include the application's
executable. Each component identifies itself with one or more
install types via the INSTALL_TYPES argument to
cpack_add_component.
DISPLAY_NAME is the displayed name of the install type, which will
typically show up in a drop-down box within a graphical
installer. This value can be any string.
cpack_configure_downloads - Configure CPack to download selected
components on-the-fly as part of the installation process.
cpack_configure_downloads(site
[UPLOAD_DIRECTORY dirname]
[ALL]
[ADD_REMOVE|NO_ADD_REMOVE])
The cpack_configure_downloads command configures installation-time
downloads of selected components. For each downloadable component,
CPack will create an archive containing the contents of that
component, which should be uploaded to the given site. When the
user selects that component for installation, the installer will
download and extract the component in place. This feature is
useful for creating small installers that only download the
requested components, saving bandwidth. Additionally, the
installers are small enough that they will be installed as part of
the normal installation process, and the "Change" button in
Windows Add/Remove Programs control panel will allow one to add or
remove parts of the application after the original
installation. On Windows, the downloaded-components functionality
requires the ZipDLL plug-in for NSIS, available at:
http://nsis.sourceforge.net/ZipDLL_plug-in
On Mac OS X, installers that download components on-the-fly can
only be built and installed on system using Mac OS X 10.5 or
later.
The site argument is a URL where the archives for downloadable
components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
All of the archives produced by CPack should be uploaded to that location.
UPLOAD_DIRECTORY is the local directory where CPack will create the
various archives for each of the components. The contents of this
directory should be uploaded to a location accessible by the URL given
in the site argument. If omitted, CPack will use the directory
CPackUploads inside the CMake binary directory to store the generated
archives.
The ALL flag indicates that all components be downloaded. Otherwise, only
those components explicitly marked as DOWNLOADED or that have a specified
ARCHIVE_FILE will be downloaded. Additionally, the ALL option implies
ADD_REMOVE (unless NO_ADD_REMOVE is specified).
ADD_REMOVE indicates that CPack should install a copy of the installer
that can be called from Windows' Add/Remove Programs dialog (via the
"Modify" button) to change the set of installed components. NO_ADD_REMOVE
turns off this behavior. This option is ignored on Mac OS X.
CPackCygwin: Cygwin CPack generator (Cygwin).The following variable is specific to installers build on and/or for Cygwin:
CPACK_CYGWIN_PATCH_NUMBER - The Cygwin patch number.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_PATCH_FILE - The Cygwin patch file.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_BUILD_SCRIPT - The Cygwin build script.
FIXME: This documentation is incomplete.
CPackDMG: DragNDrop CPack generator (Mac OS X).The following variables are specific to the DragNDrop installers built on Mac OS X:
CPACK_DMG_VOLUME_NAME - The volume name of the generated disk
image. Defaults to CPACK_PACKAGE_FILE_NAME.
CPACK_DMG_FORMAT - The disk image format. Common values are UDRO
(UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF
bzip2-compressed). Refer to hdiutil(1) for more information on
other available formats.
CPACK_DMG_DS_STORE - Path to a custom DS_Store file. This .DS_Store
file e.g. can be used to specify the Finder window
position/geometry and layout (such as hidden toolbars, placement of the
icons etc.). This file has to be generated by the Finder (either manually or
through OSA-script) using a normal folder from which the .DS_Store
file can then be extracted.
CPACK_DMG_BACKGROUND_IMAGE - Path to a background image file. This
file will be used as the background for the Finder Window when the disk
image is opened. By default no background image is set. The background
image is applied after applying the custom .DS_Store file.
CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to
operate on disk image files on Mac OS X. This variable can be used
to override the automatically detected command (or specify its
location if the auto-detection fails to find it.)
CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set
extended attributes on files and directories on Mac OS X. This
variable can be used to override the automatically detected
command (or specify its location if the auto-detection fails to
find it.)
CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile
resources on Mac OS X. This variable can be used to override the
automatically detected command (or specify its location if the
auto-detection fails to find it.)
CPackDeb: The builtin (binary) CPack Deb generator (Unix only)CPackDeb may be used to create Deb package using CPack. CPackDeb is a CPack generator thus it uses the CPACK_XXX variables used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration. CPackDeb generator should work on any linux host but it will SYSTEM_N user-friendly names and descriptions, inter-component dependencies, etc., and grouped in various ways to customize the resulting installer. See the cpack_add_* commands, described below, for more information about component-specific installations.
Component-specific installation allows users to select specific sets of components to install during the install process. Installation components are identified by the COMPONENT argument of CMake's INSTALL commands, and should be further described by the following CPack commands:
CPACK_COMPONENTS_ALL - The list of component to install.
The default value of this variable is computed by CPack
and contains all components defined by the project. The
user may set it to only include the specified components.
CPACK_<GENNAME>_COMPONENT_INSTALL - Enable/Disable component install for
CPack generator <GENNAME>.
Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
default behavior. e.g. RPM builds monolithic whereas NSIS builds component.
One can change the default behavior by setting this variable to 0/1 or OFF/ON.
CPACK_COMPONENTS_GROUPING - Specify how components are grouped for multi-package
component-aware CPack generators.
Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates several
packages files when asked for component packaging. They group the component
differently depending on the value of this variable:
- ONE_PER_GROUP (default): creates one package file per component group
- ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component
- IGNORE : creates one package per component, i.e. IGNORE component group
One can specify different grouping for different CPack generator by using
a CPACK_PROJECT_CONFIG_FILE.
CPACK_COMPONENT_<compName>_DISPLAY_NAME - The name to be displayed for a component.
CPACK_COMPONENT_<compName>_DESCRIPTION - The description of a component.
CPACK_COMPONENT_<compName>_GROUP - The group of a component.
CPACK_COMPONENT_<compName>_DEPENDS - The dependencies (list of components)
on which this component depends.
CPACK_COMPONENT_<compName>_REQUIRED - True is this component is required.
cpack_add_component - Describes a CPack installation component
named by the COMPONENT argument to a CMake INSTALL command.
cpack_add_component(compname
[DISPLAY_NAME name]
[DESCRIPTION description]
[HIDDEN | REQUIRED | DISABLED ]
[GROUP group]
[DEPENDS comp1 comp2 ... ]
[INSTALL_TYPES type1 type2 ... ]
[DOWNLOADED]
[ARCHIVE_FILE filename])
The cmake_add_component command describes an installation
component, which the user can opt to install or remove as part of
the graphical installation process. compname is the name of the
component, as provided to the COMPONENT argument of one or more
CMake INSTALL commands.
DISPLAY_NAME is the displayed name of the component, used in
graphical installers to display the component name. This value can
be any string.
DESCRIPTION is an extended description of the component, used in
graphical installers to give the user additional information about
the component. Descriptions can span multiple lines using "\n" as
the line separator. Typically, these descriptions should be no
more than a few lines long.
HIDDEN indicates that this component will be hidden in the
graphical installer, so that the user cannot directly change
whether it is installed or not.
REQUIRED indicates that this component is required, and therefore
will always be installed. It will be visible in the graphical
installer, but it cannot be unselected. (Typically, required
components are shown greyed out).
DISABLED indicates that this component should be disabled
(unselected) by default. The user is free to select this component
for installation, unless it is also HIDDEN.
DEPENDS lists the components on which this component depends. If
this component is selected, then each of the components listed
must also be selected. The dependency information is encoded
within the installer itself, so that users cannot install
inconsitent sets of components.
GROUP names the component group of which this component is a
part. If not provided, the component will be a standalone
component, not part of any component group. Component groups are
described with the cpack_add_component_group command, detailed
below.
INSTALL_TYPES lists the installation types of which this component
is a part. When one of these installations types is selected, this
component will automatically be selected. Installation types are
described with the cpack_add_install_type command, detailed below.
DOWNLOADED indicates that this component should be downloaded
on-the-fly by the installer, rather than packaged in with the
installer itself. For more information, see the cpack_configure_downloads
command.
ARCHIVE_FILE provides a name for the archive file created by CPack
to be used for downloaded components. If not supplied, CPack will
create a file with some name based on CPACK_PACKAGE_FILE_NAME and
the name of the component. See cpack_configure_downloads for more
information.
cpack_add_component_group - Describes a group of related CPack
installation components.
cpack_add_component_group(groupname
[DISPLAY_NAME name]
[DESCRIPTION description]
[PARENT_GROUP parent]
[EXPANDED]
[BOLD_TITLE])
The cpack_add_component_group describes a group of installation
components, which will be placed together within the listing of
options. Typically, component groups allow the user to
select/deselect all of the components within a single group via a
single group-level option. Use component groups to reduce the
complexity of installers with many options. groupname is an
arbitrary name used to identify the group in the GROUP argument of
the cpack_add_component command, which is used to place a
component in a group. The name of the group must not conflict with
the name of any component.
DISPLAY_NAME is the displayed name of the component group, used in
graphical installers to display the component group name. This
value can be any string.
DESCRIPTION is an extended description of the component group,
used in graphical installers to give the user additional
information about the components within that group. Descriptions
can span multiple lines using "\n" as the line
separator. Typically, these descriptions should be no more than a
few lines long.
PARENT_GROUP, if supplied, names the parent group of this group.
Parent groups are used to establish a hierarchy of groups,
providing an arbitrary hierarchy of groups.
EXPANDED indicates that, by default, the group should show up as
"expanded", so that the user immediately sees all of the
components within the group. Otherwise, the group will initially
show up as a single entry.
BOLD_TITLE indicates that the group title should appear in bold,
to call the user's attention to the group.
cpack_add_install_type - Add a new installation type containing a
set of predefined component selections to the graphical installer.
cpack_add_install_type(typename
[DISPLAY_NAME name])
The cpack_add_install_type command identifies a set of preselected
components that represents a common use case for an
application. For example, a "Developer" install type might include
an application along with its header and library files, while an
"End user" install type might just include the application's
executable. Each component identifies itself with one or more
install types via the INSTALL_TYPES argument to
cpack_add_component.
DISPLAY_NAME is the displayed name of the install type, which will
typically show up in a drop-down box within a graphical
installer. This value can be any string.
cpack_configure_downloads - Configure CPack to download selected
components on-the-fly as part of the installation process.
cpack_configure_downloads(site
[UPLOAD_DIRECTORY dirname]
[ALL]
[ADD_REMOVE|NO_ADD_REMOVE])
The cpack_configure_downloads command configures installation-time
downloads of selected components. For each downloadable component,
CPack will create an archive containing the contents of that
component, which should be uploaded to the given site. When the
user selects that component for installation, the installer will
download and extract the component in place. This feature is
useful for creating small installers that only download the
requested components, saving bandwidth. Additionally, the
installers are small enough that they will be installed as part of
the normal installation process, and the "Change" button in
Windows Add/Remove Programs control panel will allow one to add or
remove parts of the application after the original
installation. On Windows, the downloaded-components functionality
requires the ZipDLL plug-in for NSIS, available at:
http://nsis.sourceforge.net/ZipDLL_plug-in
On Mac OS X, installers that download components on-the-fly can
only be built and installed on system using Mac OS X 10.5 or
later.
The site argument is a URL where the archives for downloadable
components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
All of the archives produced by CPack should be uploaded to that location.
UPLOAD_DIRECTORY is the local directory where CPack will create the
various archives for each of the components. The contents of this
directory should be uploaded to a location accessible by the URL given
in the site argument. If omitted, CPack will use the directory
CPackUploads inside the CMake binary directory to store the generated
archives.
The ALL flag indicates that all components be downloaded. Otherwise, only
those components explicitly marked as DOWNLOADED or that have a specified
ARCHIVE_FILE will be downloaded. Additionally, the ALL option implies
ADD_REMOVE (unless NO_ADD_REMOVE is specified).
ADD_REMOVE indicates that CPack should install a copy of the installer
that can be called from Windows' Add/Remove Programs dialog (via the
"Modify" button) to change the set of installed components. NO_ADD_REMOVE
turns off this behavior. This option is ignored on Mac OS X.
CPackCygwin: Cygwin CPack generator (Cygwin).The following variable is specific to installers build on and/or for Cygwin:
CPACK_CYGWIN_PATCH_NUMBER - The Cygwin patch number.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_PATCH_FILE - The Cygwin patch file.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_BUILD_SCRIPT - The Cygwin build script.
FIXME: This documentation is incomplete.
CPackDMG: DragNDrop CPack generator (Mac OS X).The following variables are specific to the DragNDrop installers built on Mac OS X:
CPACK_DMG_VOLUME_NAME - The volume name of the generated disk
image. Defaults to CPACK_PACKAGE_FILE_NAME.
CPACK_DMG_FORMAT - The disk image format. Common values are UDRO
(UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF
bzip2-compressed). Refer to hdiutil(1) for more information on
other available formats.
CPACK_DMG_DS_STORE - Path to a custom DS_Store file. This .DS_Store
file e.g. can be used to specify the Finder window
position/geometry and layout (such as hidden toolbars, placement of the
icons etc.). This file has to be generated by the Finder (either manually or
through OSA-script) using a normal folder from which the .DS_Store
file can then be extracted.
CPACK_DMG_BACKGROUND_IMAGE - Path to a background image file. This
file will be used as the background for the Finder Window when the disk
image is opened. By default no background image is set. The background
image is applied after applying the custom .DS_Store file.
CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to
operate on disk image files on Mac OS X. This variable can be used
to override the automatically detected command (or specify its
location if the auto-detection fails to find it.)
CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set
extended attributes on files and directories on Mac OS X. This
variable can be used to override the automatically detected
command (or specify its location if the auto-detection fails to
find it.)
CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile
resources on Mac OS X. This variable can be used to override the
automatically detected command (or specify its location if the
auto-detection fails to find it.)
CPackDeb: The builtin (binary) CPack Deb generator (Unix only)CPackDeb may be used to create Deb package using CPack. CPackDeb is a CPack generator thus it uses the CPACK_XXX variables used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration. CPackDeb generator should work on any linux host but it will SYSTEM_N user-friendly names and descriptions, inter-component dependencies, etc., and grouped in various ways to customize the resulting installer. See the cpack_add_* commands, described below, for more information about component-specific installations.
Component-specific installation allows users to select specific sets of components to install during the install process. Installation components are identified by the COMPONENT argument of CMake's INSTALL commands, and should be further described by the following CPack commands:
CPACK_COMPONENTS_ALL - The list of component to install.
The default value of this variable is computed by CPack
and contains all components defined by the project. The
user may set it to only include the specified components.
CPACK_<GENNAME>_COMPONENT_INSTALL - Enable/Disable component install for
CPack generator <GENNAME>.
Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
default behavior. e.g. RPM builds monolithic whereas NSIS builds component.
One can change the default behavior by setting this variable to 0/1 or OFF/ON.
CPACK_COMPONENTS_GROUPING - Specify how components are grouped for multi-package
component-aware CPack generators.
Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates several
packages files when asked for component packaging. They group the component
differently depending on the value of this variable:
- ONE_PER_GROUP (default): creates one package file per component group
- ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component
- IGNORE : creates one package per component, i.e. IGNORE component group
One can specify different grouping for different CPack generator by using
a CPACK_PROJECT_CONFIG_FILE.
CPACK_COMPONENT_<compName>_DISPLAY_NAME - The name to be displayed for a component.
CPACK_COMPONENT_<compName>_DESCRIPTION - The description of a component.
CPACK_COMPONENT_<compName>_GROUP - The group of a component.
CPACK_COMPONENT_<compName>_DEPENDS - The dependencies (list of components)
on which this component depends.
CPACK_COMPONENT_<compName>_REQUIRED - True is this component is required.
cpack_add_component - Describes a CPack installation component
named by the COMPONENT argument to a CMake INSTALL command.
cpack_add_component(compname
[DISPLAY_NAME name]
[DESCRIPTION description]
[HIDDEN | REQUIRED | DISABLED ]
[GROUP group]
[DEPENDS comp1 comp2 ... ]
[INSTALL_TYPES type1 type2 ... ]
[DOWNLOADED]
[ARCHIVE_FILE filename])
The cmake_add_component command describes an installation
component, which the user can opt to install or remove as part of
the graphical installation process. compname is the name of the
component, as provided to the COMPONENT argument of one or more
CMake INSTALL commands.
DISPLAY_NAME is the displayed name of the component, used in
graphical installers to display the component name. This value can
be any string.
DESCRIPTION is an extended description of the component, used in
graphical installers to give the user additional information about
the component. Descriptions can span multiple lines using "\n" as
the line separator. Typically, these descriptions should be no
more than a few lines long.
HIDDEN indicates that this component will be hidden in the
graphical installer, so that the user cannot directly change
whether it is installed or not.
REQUIRED indicates that this component is required, and therefore
will always be installed. It will be visible in the graphical
installer, but it cannot be unselected. (Typically, required
components are shown greyed out).
DISABLED indicates that this component should be disabled
(unselected) by default. The user is free to select this component
for installation, unless it is also HIDDEN.
DEPENDS lists the components on which this component depends. If
this component is selected, then each of the components listed
must also be selected. The dependency information is encoded
within the installer itself, so that users cannot install
inconsitent sets of components.
GROUP names the component group of which this component is a
part. If not provided, the component will be a standalone
component, not part of any component group. Component groups are
described with the cpack_add_component_group command, detailed
below.
INSTALL_TYPES lists the installation types of which this component
is a part. When one of these installations types is selected, this
component will automatically be selected. Installation types are
described with the cpack_add_install_type command, detailed below.
DOWNLOADED indicates that this component should be downloaded
on-the-fly by the installer, rather than packaged in with the
installer itself. For more information, see the cpack_configure_downloads
command.
ARCHIVE_FILE provides a name for the archive file created by CPack
to be used for downloaded components. If not supplied, CPack will
create a file with some name based on CPACK_PACKAGE_FILE_NAME and
the name of the component. See cpack_configure_downloads for more
information.
cpack_add_component_group - Describes a group of related CPack
installation components.
cpack_add_component_group(groupname
[DISPLAY_NAME name]
[DESCRIPTION description]
[PARENT_GROUP parent]
[EXPANDED]
[BOLD_TITLE])
The cpack_add_component_group describes a group of installation
components, which will be placed together within the listing of
options. Typically, component groups allow the user to
select/deselect all of the components within a single group via a
single group-level option. Use component groups to reduce the
complexity of installers with many options. groupname is an
arbitrary name used to identify the group in the GROUP argument of
the cpack_add_component command, which is used to place a
component in a group. The name of the group must not conflict with
the name of any component.
DISPLAY_NAME is the displayed name of the component group, used in
graphical installers to display the component group name. This
value can be any string.
DESCRIPTION is an extended description of the component group,
used in graphical installers to give the user additional
information about the components within that group. Descriptions
can span multiple lines using "\n" as the line
separator. Typically, these descriptions should be no more than a
few lines long.
PARENT_GROUP, if supplied, names the parent group of this group.
Parent groups are used to establish a hierarchy of groups,
providing an arbitrary hierarchy of groups.
EXPANDED indicates that, by default, the group should show up as
"expanded", so that the user immediately sees all of the
components within the group. Otherwise, the group will initially
show up as a single entry.
BOLD_TITLE indicates that the group title should appear in bold,
to call the user's attention to the group.
cpack_add_install_type - Add a new installation type containing a
set of predefined component selections to the graphical installer.
cpack_add_install_type(typename
[DISPLAY_NAME name])
The cpack_add_install_type command identifies a set of preselected
components that represents a common use case for an
application. For example, a "Developer" install type might include
an application along with its header and library files, while an
"End user" install type might just include the application's
executable. Each component identifies itself with one or more
install types via the INSTALL_TYPES argument to
cpack_add_component.
DISPLAY_NAME is the displayed name of the install type, which will
typically show up in a drop-down box within a graphical
installer. This value can be any string.
cpack_configure_downloads - Configure CPack to download selected
components on-the-fly as part of the installation process.
cpack_configure_downloads(site
[UPLOAD_DIRECTORY dirname]
[ALL]
[ADD_REMOVE|NO_ADD_REMOVE])
The cpack_configure_downloads command configures installation-time
downloads of selected components. For each downloadable component,
CPack will create an archive containing the contents of that
component, which should be uploaded to the given site. When the
user selects that component for installation, the installer will
download and extract the component in place. This feature is
useful for creating small installers that only download the
requested components, saving bandwidth. Additionally, the
installers are small enough that they will be installed as part of
the normal installation process, and the "Change" button in
Windows Add/Remove Programs control panel will allow one to add or
remove parts of the application after the original
installation. On Windows, the downloaded-components functionality
requires the ZipDLL plug-in for NSIS, available at:
http://nsis.sourceforge.net/ZipDLL_plug-in
On Mac OS X, installers that download components on-the-fly can
only be built and installed on system using Mac OS X 10.5 or
later.
The site argument is a URL where the archives for downloadable
components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
All of the archives produced by CPack should be uploaded to that location.
UPLOAD_DIRECTORY is the local directory where CPack will create the
various archives for each of the components. The contents of this
directory should be uploaded to a location accessible by the URL given
in the site argument. If omitted, CPack will use the directory
CPackUploads inside the CMake binary directory to store the generated
archives.
The ALL flag indicates that all components be downloaded. Otherwise, only
those components explicitly marked as DOWNLOADED or that have a specified
ARCHIVE_FILE will be downloaded. Additionally, the ALL option implies
ADD_REMOVE (unless NO_ADD_REMOVE is specified).
ADD_REMOVE indicates that CPack should install a copy of the installer
that can be called from Windows' Add/Remove Programs dialog (via the
"Modify" button) to change the set of installed components. NO_ADD_REMOVE
turns off this behavior. This option is ignored on Mac OS X.
CPackCygwin: Cygwin CPack generator (Cygwin).The following variable is specific to installers build on and/or for Cygwin:
CPACK_CYGWIN_PATCH_NUMBER - The Cygwin patch number.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_PATCH_FILE - The Cygwin patch file.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_BUILD_SCRIPT - The Cygwin build script.
FIXME: This documentation is incomplete.
CPackDMG: DragNDrop CPack generator (Mac OS X).The following variables are specific to the DragNDrop installers built on Mac OS X:
CPACK_DMG_VOLUME_NAME - The volume name of the generated disk
image. Defaults to CPACK_PACKAGE_FILE_NAME.
CPACK_DMG_FORMAT - The disk image format. Common values are UDRO
(UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF
bzip2-compressed). Refer to hdiutil(1) for more information on
other available formats.
CPACK_DMG_DS_STORE - Path to a custom DS_Store file. This .DS_Store
file e.g. can be used to specify the Finder window
position/geometry and layout (such as hidden toolbars, placement of the
icons etc.). This file has to be generated by the Finder (either manually or
through OSA-script) using a normal folder from which the .DS_Store
file can then be extracted.
CPACK_DMG_BACKGROUND_IMAGE - Path to a background image file. This
file will be used as the background for the Finder Window when the disk
image is opened. By default no background image is set. The background
image is applied after applying the custom .DS_Store file.
CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to
operate on disk image files on Mac OS X. This variable can be used
to override the automatically detected command (or specify its
location if the auto-detection fails to find it.)
CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set
extended attributes on files and directories on Mac OS X. This
variable can be used to override the automatically detected
command (or specify its location if the auto-detection fails to
find it.)
CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile
resources on Mac OS X. This variable can be used to override the
automatically detected command (or specify its location if the
auto-detection fails to find it.)
CPackDeb: The builtin (binary) CPack Deb generator (Unix only)CPackDeb may be used to create Deb package using CPack. CPackDeb is a CPack generator thus it uses the CPACK_XXX variables used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration. CPackDeb generator should work on any linux host but it will SYSTEM_N user-friendly names and descriptions, inter-component dependencies, etc., and grouped in various ways to customize the resulting installer. See the cpack_add_* commands, described below, for more information about component-specific installations.
Component-specific installation allows users to select specific sets of components to install during the install process. Installation components are identified by the COMPONENT argument of CMake's INSTALL commands, and should be further described by the following CPack commands:
CPACK_COMPONENTS_ALL - The list of component to install.
The default value of this variable is computed by CPack
and contains all components defined by the project. The
user may set it to only include the specified components.
CPACK_<GENNAME>_COMPONENT_INSTALL - Enable/Disable component install for
CPack generator <GENNAME>.
Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
default behavior. e.g. RPM builds monolithic whereas NSIS builds component.
One can change the default behavior by setting this variable to 0/1 or OFF/ON.
CPACK_COMPONENTS_GROUPING - Specify how components are grouped for multi-package
component-aware CPack generators.
Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates several
packages files when asked for component packaging. They group the component
differently depending on the value of this variable:
- ONE_PER_GROUP (default): creates one package file per component group
- ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component
- IGNORE : creates one package per component, i.e. IGNORE component group
One can specify different grouping for different CPack generator by using
a CPACK_PROJECT_CONFIG_FILE.
CPACK_COMPONENT_<compName>_DISPLAY_NAME - The name to be displayed for a component.
CPACK_COMPONENT_<compName>_DESCRIPTION - The description of a component.
CPACK_COMPONENT_<compName>_GROUP - The group of a component.
CPACK_COMPONENT_<compName>_DEPENDS - The dependencies (list of components)
on which this component depends.
CPACK_COMPONENT_<compName>_REQUIRED - True is this component is required.
cpack_add_component - Describes a CPack installation component
named by the COMPONENT argument to a CMake INSTALL command.
cpack_add_component(compname
[DISPLAY_NAME name]
[DESCRIPTION description]
[HIDDEN | REQUIRED | DISABLED ]
[GROUP group]
[DEPENDS comp1 comp2 ... ]
[INSTALL_TYPES type1 type2 ... ]
[DOWNLOADED]
[ARCHIVE_FILE filename])
The cmake_add_component command describes an installation
component, which the user can opt to install or remove as part of
the graphical installation process. compname is the name of the
component, as provided to the COMPONENT argument of one or more
CMake INSTALL commands.
DISPLAY_NAME is the displayed name of the component, used in
graphical installers to display the component name. This value can
be any string.
DESCRIPTION is an extended description of the component, used in
graphical installers to give the user additional information about
the component. Descriptions can span multiple lines using "\n" as
the line separator. Typically, these descriptions should be no
more than a few lines long.
HIDDEN indicates that this component will be hidden in the
graphical installer, so that the user cannot directly change
whether it is installed or not.
REQUIRED indicates that this component is required, and therefore
will always be installed. It will be visible in the graphical
installer, but it cannot be unselected. (Typically, required
components are shown greyed out).
DISABLED indicates that this component should be disabled
(unselected) by default. The user is free to select this component
for installation, unless it is also HIDDEN.
DEPENDS lists the components on which this component depends. If
this component is selected, then each of the components listed
must also be selected. The dependency information is encoded
within the installer itself, so that users cannot install
inconsitent sets of components.
GROUP names the component group of which this component is a
part. If not provided, the component will be a standalone
component, not part of any component group. Component groups are
described with the cpack_add_component_group command, detailed
below.
INSTALL_TYPES lists the installation types of which this component
is a part. When one of these installations types is selected, this
component will automatically be selected. Installation types are
described with the cpack_add_install_type command, detailed below.
DOWNLOADED indicates that this component should be downloaded
on-the-fly by the installer, rather than packaged in with the
installer itself. For more information, see the cpack_configure_downloads
command.
ARCHIVE_FILE provides a name for the archive file created by CPack
to be used for downloaded components. If not supplied, CPack will
create a file with some name based on CPACK_PACKAGE_FILE_NAME and
the name of the component. See cpack_configure_downloads for more
information.
cpack_add_component_group - Describes a group of related CPack
installation components.
cpack_add_component_group(groupname
[DISPLAY_NAME name]
[DESCRIPTION description]
[PARENT_GROUP parent]
[EXPANDED]
[BOLD_TITLE])
The cpack_add_component_group describes a group of installation
components, which will be placed together within the listing of
options. Typically, component groups allow the user to
select/deselect all of the components within a single group via a
single group-level option. Use component groups to reduce the
complexity of installers with many options. groupname is an
arbitrary name used to identify the group in the GROUP argument of
the cpack_add_component command, which is used to place a
component in a group. The name of the group must not conflict with
the name of any component.
DISPLAY_NAME is the displayed name of the component group, used in
graphical installers to display the component group name. This
value can be any string.
DESCRIPTION is an extended description of the component group,
used in graphical installers to give the user additional
information about the components within that group. Descriptions
can span multiple lines using "\n" as the line
separator. Typically, these descriptions should be no more than a
few lines long.
PARENT_GROUP, if supplied, names the parent group of this group.
Parent groups are used to establish a hierarchy of groups,
providing an arbitrary hierarchy of groups.
EXPANDED indicates that, by default, the group should show up as
"expanded", so that the user immediately sees all of the
components within the group. Otherwise, the group will initially
show up as a single entry.
BOLD_TITLE indicates that the group title should appear in bold,
to call the user's attention to the group.
cpack_add_install_type - Add a new installation type containing a
set of predefined component selections to the graphical installer.
cpack_add_install_type(typename
[DISPLAY_NAME name])
The cpack_add_install_type command identifies a set of preselected
components that represents a common use case for an
application. For example, a "Developer" install type might include
an application along with its header and library files, while an
"End user" install type might just include the application's
executable. Each component identifies itself with one or more
install types via the INSTALL_TYPES argument to
cpack_add_component.
DISPLAY_NAME is the displayed name of the install type, which will
typically show up in a drop-down box within a graphical
installer. This value can be any string.
cpack_configure_downloads - Configure CPack to download selected
components on-the-fly as part of the installation process.
cpack_configure_downloads(site
[UPLOAD_DIRECTORY dirname]
[ALL]
[ADD_REMOVE|NO_ADD_REMOVE])
The cpack_configure_downloads command configures installation-time
downloads of selected components. For each downloadable component,
CPack will create an archive containing the contents of that
component, which should be uploaded to the given site. When the
user selects that component for installation, the installer will
download and extract the component in place. This feature is
useful for creating small installers that only download the
requested components, saving bandwidth. Additionally, the
installers are small enough that they will be installed as part of
the normal installation process, and the "Change" button in
Windows Add/Remove Programs control panel will allow one to add or
remove parts of the application after the original
installation. On Windows, the downloaded-components functionality
requires the ZipDLL plug-in for NSIS, available at:
http://nsis.sourceforge.net/ZipDLL_plug-in
On Mac OS X, installers that download components on-the-fly can
only be built and installed on system using Mac OS X 10.5 or
later.
The site argument is a URL where the archives for downloadable
components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
All of the archives produced by CPack should be uploaded to that location.
UPLOAD_DIRECTORY is the local directory where CPack will create the
various archives for each of the components. The contents of this
directory should be uploaded to a location accessible by the URL given
in the site argument. If omitted, CPack will use the directory
CPackUploads inside the CMake binary directory to store the generated
archives.
The ALL flag indicates that all components be downloaded. Otherwise, only
those components explicitly marked as DOWNLOADED or that have a specified
ARCHIVE_FILE will be downloaded. Additionally, the ALL option implies
ADD_REMOVE (unless NO_ADD_REMOVE is specified).
ADD_REMOVE indicates that CPack should install a copy of the installer
that can be called from Windows' Add/Remove Programs dialog (via the
"Modify" button) to change the set of installed components. NO_ADD_REMOVE
turns off this behavior. This option is ignored on Mac OS X.
CPackCygwin: Cygwin CPack generator (Cygwin).The following variable is specific to installers build on and/or for Cygwin:
CPACK_CYGWIN_PATCH_NUMBER - The Cygwin patch number.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_PATCH_FILE - The Cygwin patch file.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_BUILD_SCRIPT - The Cygwin build script.
FIXME: This documentation is incomplete.
CPackDMG: DragNDrop CPack generator (Mac OS X).The following variables are specific to the DragNDrop installers built on Mac OS X:
CPACK_DMG_VOLUME_NAME - The volume name of the generated disk
image. Defaults to CPACK_PACKAGE_FILE_NAME.
CPACK_DMG_FORMAT - The disk image format. Common values are UDRO
(UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF
bzip2-compressed). Refer to hdiutil(1) for more information on
other available formats.
CPACK_DMG_DS_STORE - Path to a custom DS_Store file. This .DS_Store
file e.g. can be used to specify the Finder window
position/geometry and layout (such as hidden toolbars, placement of the
icons etc.). This file has to be generated by the Finder (either manually or
through OSA-script) using a normal folder from which the .DS_Store
file can then be extracted.
CPACK_DMG_BACKGROUND_IMAGE - Path to a background image file. This
file will be used as the background for the Finder Window when the disk
image is opened. By default no background image is set. The background
image is applied after applying the custom .DS_Store file.
CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to
operate on disk image files on Mac OS X. This variable can be used
to override the automatically detected command (or specify its
location if the auto-detection fails to find it.)
CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set
extended attributes on files and directories on Mac OS X. This
variable can be used to override the automatically detected
command (or specify its location if the auto-detection fails to
find it.)
CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile
resources on Mac OS X. This variable can be used to override the
automatically detected command (or specify its location if the
auto-detection fails to find it.)
CPackDeb: The builtin (binary) CPack Deb generator (Unix only)CPackDeb may be used to create Deb package using CPack. CPackDeb is a CPack generator thus it uses the CPACK_XXX variables used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration. CPackDeb generator should work on any linux host but it will SYSTEM_N user-friendly names and descriptions, inter-component dependencies, etc., and grouped in various ways to customize the resulting installer. See the cpack_add_* commands, described below, for more information about component-specific installations.
Component-specific installation allows users to select specific sets of components to install during the install process. Installation components are identified by the COMPONENT argument of CMake's INSTALL commands, and should be further described by the following CPack commands:
CPACK_COMPONENTS_ALL - The list of component to install.
The default value of this variable is computed by CPack
and contains all components defined by the project. The
user may set it to only include the specified components.
CPACK_<GENNAME>_COMPONENT_INSTALL - Enable/Disable component install for
CPack generator <GENNAME>.
Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
default behavior. e.g. RPM builds monolithic whereas NSIS builds component.
One can change the default behavior by setting this variable to 0/1 or OFF/ON.
CPACK_COMPONENTS_GROUPING - Specify how components are grouped for multi-package
component-aware CPack generators.
Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates several
packages files when asked for component packaging. They group the component
differently depending on the value of this variable:
- ONE_PER_GROUP (default): creates one package file per component group
- ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component
- IGNORE : creates one package per component, i.e. IGNORE component group
One can specify different grouping for different CPack generator by using
a CPACK_PROJECT_CONFIG_FILE.
CPACK_COMPONENT_<compName>_DISPLAY_NAME - The name to be displayed for a component.
CPACK_COMPONENT_<compName>_DESCRIPTION - The description of a component.
CPACK_COMPONENT_<compName>_GROUP - The group of a component.
CPACK_COMPONENT_<compName>_DEPENDS - The dependencies (list of components)
on which this component depends.
CPACK_COMPONENT_<compName>_REQUIRED - True is this component is required.
cpack_add_component - Describes a CPack installation component
named by the COMPONENT argument to a CMake INSTALL command.
cpack_add_component(compname
[DISPLAY_NAME name]
[DESCRIPTION description]
[HIDDEN | REQUIRED | DISABLED ]
[GROUP group]
[DEPENDS comp1 comp2 ... ]
[INSTALL_TYPES type1 type2 ... ]
[DOWNLOADED]
[ARCHIVE_FILE filename])
The cmake_add_component command describes an installation
component, which the user can opt to install or remove as part of
the graphical installation process. compname is the name of the
component, as provided to the COMPONENT argument of one or more
CMake INSTALL commands.
DISPLAY_NAME is the displayed name of the component, used in
graphical installers to display the component name. This value can
be any string.
DESCRIPTION is an extended description of the component, used in
graphical installers to give the user additional information about
the component. Descriptions can span multiple lines using "\n" as
the line separator. Typically, these descriptions should be no
more than a few lines long.
HIDDEN indicates that this component will be hidden in the
graphical installer, so that the user cannot directly change
whether it is installed or not.
REQUIRED indicates that this component is required, and therefore
will always be installed. It will be visible in the graphical
installer, but it cannot be unselected. (Typically, required
components are shown greyed out).
DISABLED indicates that this component should be disabled
(unselected) by default. The user is free to select this component
for installation, unless it is also HIDDEN.
DEPENDS lists the components on which this component depends. If
this component is selected, then each of the components listed
must also be selected. The dependency information is encoded
within the installer itself, so that users cannot install
inconsitent sets of components.
GROUP names the component group of which this component is a
part. If not provided, the component will be a standalone
component, not part of any component group. Component groups are
described with the cpack_add_component_group command, detailed
below.
INSTALL_TYPES lists the installation types of which this component
is a part. When one of these installations types is selected, this
component will automatically be selected. Installation types are
described with the cpack_add_install_type command, detailed below.
DOWNLOADED indicates that this component should be downloaded
on-the-fly by the installer, rather than packaged in with the
installer itself. For more information, see the cpack_configure_downloads
command.
ARCHIVE_FILE provides a name for the archive file created by CPack
to be used for downloaded components. If not supplied, CPack will
create a file with some name based on CPACK_PACKAGE_FILE_NAME and
the name of the component. See cpack_configure_downloads for more
information.
cpack_add_component_group - Describes a group of related CPack
installation components.
cpack_add_component_group(groupname
[DISPLAY_NAME name]
[DESCRIPTION description]
[PARENT_GROUP parent]
[EXPANDED]
[BOLD_TITLE])
The cpack_add_component_group describes a group of installation
components, which will be placed together within the listing of
options. Typically, component groups allow the user to
select/deselect all of the components within a single group via a
single group-level option. Use component groups to reduce the
complexity of installers with many options. groupname is an
arbitrary name used to identify the group in the GROUP argument of
the cpack_add_component command, which is used to place a
component in a group. The name of the group must not conflict with
the name of any component.
DISPLAY_NAME is the displayed name of the component group, used in
graphical installers to display the component group name. This
value can be any string.
DESCRIPTION is an extended description of the component group,
used in graphical installers to give the user additional
information about the components within that group. Descriptions
can span multiple lines using "\n" as the line
separator. Typically, these descriptions should be no more than a
few lines long.
PARENT_GROUP, if supplied, names the parent group of this group.
Parent groups are used to establish a hierarchy of groups,
providing an arbitrary hierarchy of groups.
EXPANDED indicates that, by default, the group should show up as
"expanded", so that the user immediately sees all of the
components within the group. Otherwise, the group will initially
show up as a single entry.
BOLD_TITLE indicates that the group title should appear in bold,
to call the user's attention to the group.
cpack_add_install_type - Add a new installation type containing a
set of predefined component selections to the graphical installer.
cpack_add_install_type(typename
[DISPLAY_NAME name])
The cpack_add_install_type command identifies a set of preselected
components that represents a common use case for an
application. For example, a "Developer" install type might include
an application along with its header and library files, while an
"End user" install type might just include the application's
executable. Each component identifies itself with one or more
install types via the INSTALL_TYPES argument to
cpack_add_component.
DISPLAY_NAME is the displayed name of the install type, which will
typically show up in a drop-down box within a graphical
installer. This value can be any string.
cpack_configure_downloads - Configure CPack to download selected
components on-the-fly as part of the installation process.
cpack_configure_downloads(site
[UPLOAD_DIRECTORY dirname]
[ALL]
[ADD_REMOVE|NO_ADD_REMOVE])
The cpack_configure_downloads command configures installation-time
downloads of selected components. For each downloadable component,
CPack will create an archive containing the contents of that
component, which should be uploaded to the given site. When the
user selects that component for installation, the installer will
download and extract the component in place. This feature is
useful for creating small installers that only download the
requested components, saving bandwidth. Additionally, the
installers are small enough that they will be installed as part of
the normal installation process, and the "Change" button in
Windows Add/Remove Programs control panel will allow one to add or
remove parts of the application after the original
installation. On Windows, the downloaded-components functionality
requires the ZipDLL plug-in for NSIS, available at:
http://nsis.sourceforge.net/ZipDLL_plug-in
On Mac OS X, installers that download components on-the-fly can
only be built and installed on system using Mac OS X 10.5 or
later.
The site argument is a URL where the archives for downloadable
components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
All of the archives produced by CPack should be uploaded to that location.
UPLOAD_DIRECTORY is the local directory where CPack will create the
various archives for each of the components. The contents of this
directory should be uploaded to a location accessible by the URL given
in the site argument. If omitted, CPack will use the directory
CPackUploads inside the CMake binary directory to store the generated
archives.
The ALL flag indicates that all components be downloaded. Otherwise, only
those components explicitly marked as DOWNLOADED or that have a specified
ARCHIVE_FILE will be downloaded. Additionally, the ALL option implies
ADD_REMOVE (unless NO_ADD_REMOVE is specified).
ADD_REMOVE indicates that CPack should install a copy of the installer
that can be called from Windows' Add/Remove Programs dialog (via the
"Modify" button) to change the set of installed components. NO_ADD_REMOVE
turns off this behavior. This option is ignored on Mac OS X.
CPackCygwin: Cygwin CPack generator (Cygwin).The following variable is specific to installers build on and/or for Cygwin:
CPACK_CYGWIN_PATCH_NUMBER - The Cygwin patch number.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_PATCH_FILE - The Cygwin patch file.
FIXME: This documentation is incomplete.
CPACK_CYGWIN_BUILD_SCRIPT - The Cygwin build script.
FIXME: This documentation is incomplete.
CPackDMG: DragNDrop CPack generator (Mac OS X).The following variables are specific to the DragNDrop installers built on Mac OS X:
CPACK_DMG_VOLUME_NAME - The volume name of the generated disk
image. Defaults to CPACK_PACKAGE_FILE_NAME.
CPACK_DMG_FORMAT - The disk image format. Common values are UDRO
(UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF
bzip2-compressed). Refer to hdiutil(1) for more information on
other available formats.
CPACK_DMG_DS_STORE - Path to a custom DS_Store file. This .DS_Store
file e.g. can be used to specify the Finder window
position/geometry and layout (such as hidden toolbars, placement of the
icons etc.). This file has to be generated by the Finder (either manually or
through OSA-script) using a normal folder from which the .DS_Store
file can then be extracted.
CPACK_DMG_BACKGROUND_IMAGE - Path to a background image file. This
file will be used as the background for the Finder Window when the disk
image is opened. By default no background image is set. The background
image is applied after applying the custom .DS_Store file.
CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to
operate on disk image files on Mac OS X. This variable can be used
to override the automatically detected command (or specify its
location if the auto-detection fails to find it.)
CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set
extended attributes on files and directories on Mac OS X. This
variable can be used to override the automatically detected
command (or specify its location if the auto-detection fails to
find it.)
CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile
resources on Mac OS X. This variable can be used to override the
automatically detected command (or specify its location if the
auto-detection fails to find it.)
CPackDeb: The builtin (binary) CPack Deb generator (Unix only)CPackDeb may be used to create Deb package using CPack. CPackDeb is a CPack generator thus it uses the CPACK_XXX variables used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration. CPackDeb generator should work on any linux host but it will SYSTEM_N user-friendly names and descriptions, inter-component dependencies, etc., and grouped in various ways to customize the resulting installer. See the cpack_add_* commands, described below, for more information about component-specific installations.
Component-specific installation allows users to select specific sets of components to install during the install process. Installation components are identified by the COMPONENT argument of CMake's INSTALL commands, and should be further described by the following CPack commands:
CPACK_COMPONENTS_ALL - The list of component to install.
The default value of this variable is computed by CPack
and contains all components defined by the project. The
user may set it to only include the specified components.
CPACK_<GENNAME>_COMPONENT_INSTALL - Enable/Disable component install for
CPack generator <GENNAME>.
Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
default behavior. e.g. RPM builds monolithic whereas NSIS builds component.
One can change the default behavior by setting this variable to 0/1 or OFF/ON.
CPACK_COMPONENTS_GROUPING - Specify how components are grouped for multi-package
component-aware CPack generators.
Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates several
packages files when asked for component packaging. They group the component
differently depending on the value of this variable:
- ONE_PER_GROUP (default): creates one package file per component group
- ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component