blob: abcf57bd7986b08a57fb78d944c1ab9aa4103f46 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CPackComponent &mdash; CMake 3.8.2 Documentation</title>
<link rel="stylesheet" href="../_static/cmake.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '3.8.2',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="shortcut icon" href="../_static/cmake-favicon.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="CPackCygwin" href="CPackCygwin.html" />
<link rel="prev" title="CPackBundle" href="CPackBundle.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="CPackCygwin.html" title="CPackCygwin"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="CPackBundle.html" title="CPackBundle"
accesskey="P">previous</a> |</li>
<li>
<img src="../_static/cmake-logo-16.png" alt=""
style="vertical-align: middle; margin-top: -2px" />
</li>
<li>
<a href="https://cmake.org/">CMake</a> &#187;
</li>
<li>
<a href="../index.html">3.8.2 Documentation</a> &#187;
</li>
<li class="nav-item nav-item-1"><a href="../manual/cmake-modules.7.html" accesskey="U">cmake-modules(7)</a> &#187;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="cpackcomponent">
<span id="module:CPackComponent"></span><h1>CPackComponent<a class="headerlink" href="#cpackcomponent" title="Permalink to this headline"></a></h1>
<p>Build binary and source package installers</p>
<div class="section" id="variables-concerning-cpack-components">
<h2>Variables concerning CPack Components<a class="headerlink" href="#variables-concerning-cpack-components" title="Permalink to this headline"></a></h2>
<p>The CPackComponent module is the module which handles the component
part of CPack. See CPack module for general information about CPack.</p>
<p>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&#8217;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.</p>
<p>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&#8217;s INSTALL
commands, and should be further described by the following CPack
commands:</p>
<dl class="variable">
<dt id="variable:CPACK_COMPONENTS_ALL">
<code class="descname">CPACK_COMPONENTS_ALL</code><a class="headerlink" href="#variable:CPACK_COMPONENTS_ALL" title="Permalink to this definition"></a></dt>
<dd><p>The list of component to install.</p>
<p>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.</p>
</dd></dl>
<dl class="variable">
<dt id="variable:CPACK_&lt;GENNAME&gt;_COMPONENT_INSTALL">
<code class="descname">CPACK_&lt;GENNAME&gt;_COMPONENT_INSTALL</code><a class="headerlink" href="#variable:CPACK_<GENNAME>_COMPONENT_INSTALL" title="Permalink to this definition">¶</a></dt>
<dd><p>Enable/Disable component install for CPack generator &lt;GENNAME&gt;.</p>
<p>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.</p>
</dd></dl>
<dl class="variable">
<dt id="variable:CPACK_COMPONENTS_GROUPING">
<code class="descname">CPACK_COMPONENTS_GROUPING</code><a class="headerlink" href="#variable:CPACK_COMPONENTS_GROUPING" title="Permalink to this definition"></a></dt>
<dd><p>Specify how components are grouped for multi-package component-aware CPack
generators.</p>
<p>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:</p>
<ul class="simple">
<li>ONE_PER_GROUP (default): creates one package file per component group</li>
<li>ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component</li>
<li>IGNORE : creates one package per component, i.e. IGNORE component group</li>
</ul>
<p>One can specify different grouping for different CPack generator by
using a CPACK_PROJECT_CONFIG_FILE.</p>
</dd></dl>
<dl class="variable">
<dt id="variable:CPACK_COMPONENT_&lt;compName&gt;_DISPLAY_NAME">
<code class="descname">CPACK_COMPONENT_&lt;compName&gt;_DISPLAY_NAME</code><a class="headerlink" href="#variable:CPACK_COMPONENT_<compName>_DISPLAY_NAME" title="Permalink to this definition">¶</a></dt>
<dd><p>The name to be displayed for a component.</p>
</dd></dl>
<dl class="variable">
<dt id="variable:CPACK_COMPONENT_&lt;compName&gt;_DESCRIPTION">
<code class="descname">CPACK_COMPONENT_&lt;compName&gt;_DESCRIPTION</code><a class="headerlink" href="#variable:CPACK_COMPONENT_<compName>_DESCRIPTION" title="Permalink to this definition">¶</a></dt>
<dd><p>The description of a component.</p>
</dd></dl>
<dl class="variable">
<dt id="variable:CPACK_COMPONENT_&lt;compName&gt;_GROUP">
<code class="descname">CPACK_COMPONENT_&lt;compName&gt;_GROUP</code><a class="headerlink" href="#variable:CPACK_COMPONENT_<compName>_GROUP" title="Permalink to this definition">¶</a></dt>
<dd><p>The group of a component.</p>
</dd></dl>
<dl class="variable">
<dt id="variable:CPACK_COMPONENT_&lt;compName&gt;_DEPENDS">
<code class="descname">CPACK_COMPONENT_&lt;compName&gt;_DEPENDS</code><a class="headerlink" href="#variable:CPACK_COMPONENT_<compName>_DEPENDS" title="Permalink to this definition">¶</a></dt>
<dd><p>The dependencies (list of components) on which this component depends.</p>
</dd></dl>
<dl class="variable">
<dt id="variable:CPACK_COMPONENT_&lt;compName&gt;_HIDDEN">
<code class="descname">CPACK_COMPONENT_&lt;compName&gt;_HIDDEN</code><a class="headerlink" href="#variable:CPACK_COMPONENT_<compName>_HIDDEN" title="Permalink to this definition">¶</a></dt>
<dd><p>True if this component is hidden from the user.</p>
</dd></dl>
<dl class="variable">
<dt id="variable:CPACK_COMPONENT_&lt;compName&gt;_REQUIRED">
<code class="descname">CPACK_COMPONENT_&lt;compName&gt;_REQUIRED</code><a class="headerlink" href="#variable:CPACK_COMPONENT_<compName>_REQUIRED" title="Permalink to this definition">¶</a></dt>
<dd><p>True if this component is required.</p>
</dd></dl>
<dl class="variable">
<dt id="variable:CPACK_COMPONENT_&lt;compName&gt;_DISABLED">
<code class="descname">CPACK_COMPONENT_&lt;compName&gt;_DISABLED</code><a class="headerlink" href="#variable:CPACK_COMPONENT_<compName>_DISABLED" title="Permalink to this definition">¶</a></dt>
<dd><p>True if this component is not selected to be installed by default.</p>
</dd></dl>
<dl class="command">
<dt id="command:cpack_add_component">
<code class="descname">cpack_add_component</code><a class="headerlink" href="#command:cpack_add_component" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<p>Describes a CPack installation
component named by the COMPONENT argument to a CMake INSTALL command.</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">cpack_add_component</span><span class="p">(</span><span class="n">compname</span>
<span class="p">[</span><span class="n">DISPLAY_NAME</span> <span class="n">name</span><span class="p">]</span>
<span class="p">[</span><span class="n">DESCRIPTION</span> <span class="n">description</span><span class="p">]</span>
<span class="p">[</span><span class="n">HIDDEN</span> <span class="o">|</span> <span class="n">REQUIRED</span> <span class="o">|</span> <span class="n">DISABLED</span> <span class="p">]</span>
<span class="p">[</span><span class="n">GROUP</span> <span class="n">group</span><span class="p">]</span>
<span class="p">[</span><span class="n">DEPENDS</span> <span class="n">comp1</span> <span class="n">comp2</span> <span class="o">...</span> <span class="p">]</span>
<span class="p">[</span><span class="n">INSTALL_TYPES</span> <span class="n">type1</span> <span class="n">type2</span> <span class="o">...</span> <span class="p">]</span>
<span class="p">[</span><span class="n">DOWNLOADED</span><span class="p">]</span>
<span class="p">[</span><span class="n">ARCHIVE_FILE</span> <span class="n">filename</span><span class="p">])</span>
</pre></div>
</div>
<p>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.</p>
<p>DISPLAY_NAME is the displayed name of the component, used in graphical
installers to display the component name. This value can be any
string.</p>
<p>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 <code class="docutils literal"><span class="pre">\n</span></code> as the
line separator. Typically, these descriptions should be no more than
a few lines long.</p>
<p>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.</p>
<p>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).</p>
<p>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.</p>
<p>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 inconsistent sets of components.</p>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<dl class="command">
<dt id="command:cpack_add_component_group">
<code class="descname">cpack_add_component_group</code><a class="headerlink" href="#command:cpack_add_component_group" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<p>Describes a group of related CPack installation components.</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">cpack_add_component_group</span><span class="p">(</span><span class="n">groupname</span>
<span class="p">[</span><span class="n">DISPLAY_NAME</span> <span class="n">name</span><span class="p">]</span>
<span class="p">[</span><span class="n">DESCRIPTION</span> <span class="n">description</span><span class="p">]</span>
<span class="p">[</span><span class="n">PARENT_GROUP</span> <span class="n">parent</span><span class="p">]</span>
<span class="p">[</span><span class="n">EXPANDED</span><span class="p">]</span>
<span class="p">[</span><span class="n">BOLD_TITLE</span><span class="p">])</span>
</pre></div>
</div>
<p>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.</p>
<p>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.</p>
<p>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 <code class="docutils literal"><span class="pre">\n</span></code> as the line separator. Typically, these descriptions
should be no more than a few lines long.</p>
<p>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.</p>
<p>EXPANDED indicates that, by default, the group should show up as
&#8220;expanded&#8221;, so that the user immediately sees all of the components
within the group. Otherwise, the group will initially show up as a
single entry.</p>
<p>BOLD_TITLE indicates that the group title should appear in bold, to
call the user&#8217;s attention to the group.</p>
<dl class="command">
<dt id="command:cpack_add_install_type">
<code class="descname">cpack_add_install_type</code><a class="headerlink" href="#command:cpack_add_install_type" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<p>Add a new installation type containing
a set of predefined component selections to the graphical installer.</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">cpack_add_install_type</span><span class="p">(</span><span class="n">typename</span>
<span class="p">[</span><span class="n">DISPLAY_NAME</span> <span class="n">name</span><span class="p">])</span>
</pre></div>
</div>
<p>The cpack_add_install_type command identifies a set of preselected
components that represents a common use case for an application. For
example, a &#8220;Developer&#8221; install type might include an application along
with its header and library files, while an &#8220;End user&#8221; install type
might just include the application&#8217;s executable. Each component
identifies itself with one or more install types via the INSTALL_TYPES
argument to cpack_add_component.</p>
<p>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.</p>
<dl class="command">
<dt id="command:cpack_configure_downloads">
<code class="descname">cpack_configure_downloads</code><a class="headerlink" href="#command:cpack_configure_downloads" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<p>Configure CPack to download
selected components on-the-fly as part of the installation process.</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">cpack_configure_downloads</span><span class="p">(</span><span class="n">site</span>
<span class="p">[</span><span class="n">UPLOAD_DIRECTORY</span> <span class="n">dirname</span><span class="p">]</span>
<span class="p">[</span><span class="n">ALL</span><span class="p">]</span>
<span class="p">[</span><span class="n">ADD_REMOVE</span><span class="o">|</span><span class="n">NO_ADD_REMOVE</span><span class="p">])</span>
</pre></div>
</div>
<p>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 &#8220;Change&#8221; 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:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">nsis</span><span class="o">.</span><span class="n">sourceforge</span><span class="o">.</span><span class="n">net</span><span class="o">/</span><span class="n">ZipDLL_plug</span><span class="o">-</span><span class="ow">in</span>
</pre></div>
</div>
<p>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.</p>
<p>The site argument is a URL where the archives for downloadable
components will reside, e.g.,
<a class="reference external" href="https://cmake.org/files/2.6.1/installer/">https://cmake.org/files/2.6.1/installer/</a> All of the archives
produced by CPack should be uploaded to that location.</p>
<p>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.</p>
<p>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).</p>
<p>ADD_REMOVE indicates that CPack should install a copy of the installer
that can be called from Windows&#8217; Add/Remove Programs dialog (via the
&#8220;Modify&#8221; button) to change the set of installed components.
NO_ADD_REMOVE turns off this behavior. This option is ignored on Mac
OS X.</p>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">CPackComponent</a><ul>
<li><a class="reference internal" href="#variables-concerning-cpack-components">Variables concerning CPack Components</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="CPackBundle.html"
title="previous chapter">CPackBundle</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="CPackCygwin.html"
title="next chapter">CPackCygwin</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/module/CPackComponent.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="CPackCygwin.html" title="CPackCygwin"
>next</a> |</li>
<li class="right" >
<a href="CPackBundle.html" title="CPackBundle"
>previous</a> |</li>
<li>
<img src="../_static/cmake-logo-16.png" alt=""
style="vertical-align: middle; margin-top: -2px" />
</li>
<li>
<a href="https://cmake.org/">CMake</a> &#187;
</li>
<li>
<a href="../index.html">3.8.2 Documentation</a> &#187;
</li>
<li class="nav-item nav-item-1"><a href="../manual/cmake-modules.7.html" >cmake-modules(7)</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2000-2017 Kitware, Inc. and Contributors.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.5.2.
</div>
</body>
</html>