blob: 1e3dada3a6dc0ca86c8d152dadf0b4267ed340f9 [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>GNUInstallDirs &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="InstallRequiredSystemLibraries" href="InstallRequiredSystemLibraries.html" />
<link rel="prev" title="GetPrerequisites" href="GetPrerequisites.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="InstallRequiredSystemLibraries.html" title="InstallRequiredSystemLibraries"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="GetPrerequisites.html" title="GetPrerequisites"
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="gnuinstalldirs">
<span id="module:GNUInstallDirs"></span><h1>GNUInstallDirs<a class="headerlink" href="#gnuinstalldirs" title="Permalink to this headline"></a></h1>
<p>Define GNU standard installation directories</p>
<p>Provides install directory variables as defined by the
<a class="reference external" href="https://www.gnu.org/prep/standards/html_node/Directory-Variables.html">GNU Coding Standards</a>.</p>
<div class="section" id="result-variables">
<h2>Result Variables<a class="headerlink" href="#result-variables" title="Permalink to this headline"></a></h2>
<p>Inclusion of this module defines the following variables:</p>
<p><code class="docutils literal"><span class="pre">CMAKE_INSTALL_&lt;dir&gt;</span></code></p>
<blockquote>
<div>Destination for files of a given type. This value may be passed to
the <code class="docutils literal"><span class="pre">DESTINATION</span></code> options of <span class="target" id="index-0-command:install"></span><a class="reference internal" href="../command/install.html#command:install" title="install"><code class="xref cmake cmake-command docutils literal"><span class="pre">install()</span></code></a> commands for the
corresponding file type.</div></blockquote>
<p><code class="docutils literal"><span class="pre">CMAKE_INSTALL_FULL_&lt;dir&gt;</span></code></p>
<blockquote>
<div>The absolute path generated from the corresponding <code class="docutils literal"><span class="pre">CMAKE_INSTALL_&lt;dir&gt;</span></code>
value. If the value is not already an absolute path, an absolute path
is constructed typically by prepending the value of the
<span class="target" id="index-0-variable:CMAKE_INSTALL_PREFIX"></span><a class="reference internal" href="../variable/CMAKE_INSTALL_PREFIX.html#variable:CMAKE_INSTALL_PREFIX" title="CMAKE_INSTALL_PREFIX"><code class="xref cmake cmake-variable docutils literal"><span class="pre">CMAKE_INSTALL_PREFIX</span></code></a> variable. However, there are some
<a class="reference internal" href="#special-cases">special cases</a> as documented below.</div></blockquote>
<p>where <code class="docutils literal"><span class="pre">&lt;dir&gt;</span></code> is one of:</p>
<dl class="docutils">
<dt><code class="docutils literal"><span class="pre">BINDIR</span></code></dt>
<dd>user executables (<code class="docutils literal"><span class="pre">bin</span></code>)</dd>
<dt><code class="docutils literal"><span class="pre">SBINDIR</span></code></dt>
<dd>system admin executables (<code class="docutils literal"><span class="pre">sbin</span></code>)</dd>
<dt><code class="docutils literal"><span class="pre">LIBEXECDIR</span></code></dt>
<dd>program executables (<code class="docutils literal"><span class="pre">libexec</span></code>)</dd>
<dt><code class="docutils literal"><span class="pre">SYSCONFDIR</span></code></dt>
<dd>read-only single-machine data (<code class="docutils literal"><span class="pre">etc</span></code>)</dd>
<dt><code class="docutils literal"><span class="pre">SHAREDSTATEDIR</span></code></dt>
<dd>modifiable architecture-independent data (<code class="docutils literal"><span class="pre">com</span></code>)</dd>
<dt><code class="docutils literal"><span class="pre">LOCALSTATEDIR</span></code></dt>
<dd>modifiable single-machine data (<code class="docutils literal"><span class="pre">var</span></code>)</dd>
<dt><code class="docutils literal"><span class="pre">LIBDIR</span></code></dt>
<dd>object code libraries (<code class="docutils literal"><span class="pre">lib</span></code> or <code class="docutils literal"><span class="pre">lib64</span></code>
or <code class="docutils literal"><span class="pre">lib/&lt;multiarch-tuple&gt;</span></code> on Debian)</dd>
<dt><code class="docutils literal"><span class="pre">INCLUDEDIR</span></code></dt>
<dd>C header files (<code class="docutils literal"><span class="pre">include</span></code>)</dd>
<dt><code class="docutils literal"><span class="pre">OLDINCLUDEDIR</span></code></dt>
<dd>C header files for non-gcc (<code class="docutils literal"><span class="pre">/usr/include</span></code>)</dd>
<dt><code class="docutils literal"><span class="pre">DATAROOTDIR</span></code></dt>
<dd>read-only architecture-independent data root (<code class="docutils literal"><span class="pre">share</span></code>)</dd>
<dt><code class="docutils literal"><span class="pre">DATADIR</span></code></dt>
<dd>read-only architecture-independent data (<code class="docutils literal"><span class="pre">DATAROOTDIR</span></code>)</dd>
<dt><code class="docutils literal"><span class="pre">INFODIR</span></code></dt>
<dd>info documentation (<code class="docutils literal"><span class="pre">DATAROOTDIR/info</span></code>)</dd>
<dt><code class="docutils literal"><span class="pre">LOCALEDIR</span></code></dt>
<dd>locale-dependent data (<code class="docutils literal"><span class="pre">DATAROOTDIR/locale</span></code>)</dd>
<dt><code class="docutils literal"><span class="pre">MANDIR</span></code></dt>
<dd>man documentation (<code class="docutils literal"><span class="pre">DATAROOTDIR/man</span></code>)</dd>
<dt><code class="docutils literal"><span class="pre">DOCDIR</span></code></dt>
<dd>documentation root (<code class="docutils literal"><span class="pre">DATAROOTDIR/doc/PROJECT_NAME</span></code>)</dd>
</dl>
<p>If the includer does not define a value the above-shown default will be
used and the value will appear in the cache for editing by the user.</p>
</div>
<div class="section" id="special-cases">
<h2>Special Cases<a class="headerlink" href="#special-cases" title="Permalink to this headline"></a></h2>
<p>The following values of <span class="target" id="index-1-variable:CMAKE_INSTALL_PREFIX"></span><a class="reference internal" href="../variable/CMAKE_INSTALL_PREFIX.html#variable:CMAKE_INSTALL_PREFIX" title="CMAKE_INSTALL_PREFIX"><code class="xref cmake cmake-variable docutils literal"><span class="pre">CMAKE_INSTALL_PREFIX</span></code></a> are special:</p>
<p><code class="docutils literal"><span class="pre">/</span></code></p>
<blockquote>
<div><p>For <code class="docutils literal"><span class="pre">&lt;dir&gt;</span></code> other than the <code class="docutils literal"><span class="pre">SYSCONFDIR</span></code> and <code class="docutils literal"><span class="pre">LOCALSTATEDIR</span></code>,
the value of <code class="docutils literal"><span class="pre">CMAKE_INSTALL_&lt;dir&gt;</span></code> is prefixed with <code class="docutils literal"><span class="pre">usr/</span></code> if
it is not user-specified as an absolute path. For example, the
<code class="docutils literal"><span class="pre">INCLUDEDIR</span></code> value <code class="docutils literal"><span class="pre">include</span></code> becomes <code class="docutils literal"><span class="pre">usr/include</span></code>.
This is required by the <a class="reference external" href="https://www.gnu.org/prep/standards/html_node/Directory-Variables.html">GNU Coding Standards</a>, which state:</p>
<blockquote>
<div>When building the complete GNU system, the prefix will be empty
and <code class="docutils literal"><span class="pre">/usr</span></code> will be a symbolic link to <code class="docutils literal"><span class="pre">/</span></code>.</div></blockquote>
</div></blockquote>
<p><code class="docutils literal"><span class="pre">/usr</span></code></p>
<blockquote>
<div>For <code class="docutils literal"><span class="pre">&lt;dir&gt;</span></code> equal to <code class="docutils literal"><span class="pre">SYSCONFDIR</span></code> or <code class="docutils literal"><span class="pre">LOCALSTATEDIR</span></code>, the
<code class="docutils literal"><span class="pre">CMAKE_INSTALL_FULL_&lt;dir&gt;</span></code> is computed by prepending just <code class="docutils literal"><span class="pre">/</span></code>
to the value of <code class="docutils literal"><span class="pre">CMAKE_INSTALL_&lt;dir&gt;</span></code> if it is not user-specified
as an absolute path. For example, the <code class="docutils literal"><span class="pre">SYSCONFDIR</span></code> value <code class="docutils literal"><span class="pre">etc</span></code>
becomes <code class="docutils literal"><span class="pre">/etc</span></code>. This is required by the <a class="reference external" href="https://www.gnu.org/prep/standards/html_node/Directory-Variables.html">GNU Coding Standards</a>.</div></blockquote>
<p><code class="docutils literal"><span class="pre">/opt/...</span></code></p>
<blockquote>
<div>For <code class="docutils literal"><span class="pre">&lt;dir&gt;</span></code> equal to <code class="docutils literal"><span class="pre">SYSCONFDIR</span></code> or <code class="docutils literal"><span class="pre">LOCALSTATEDIR</span></code>, the
<code class="docutils literal"><span class="pre">CMAKE_INSTALL_FULL_&lt;dir&gt;</span></code> is computed by <em>appending</em> the prefix
to the value of <code class="docutils literal"><span class="pre">CMAKE_INSTALL_&lt;dir&gt;</span></code> if it is not user-specified
as an absolute path. For example, the <code class="docutils literal"><span class="pre">SYSCONFDIR</span></code> value <code class="docutils literal"><span class="pre">etc</span></code>
becomes <code class="docutils literal"><span class="pre">/etc/opt/...</span></code>. This is defined by the
<a class="reference external" href="https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html">Filesystem Hierarchy Standard</a>.</div></blockquote>
</div>
<div class="section" id="macros">
<h2>Macros<a class="headerlink" href="#macros" title="Permalink to this headline"></a></h2>
<dl class="command">
<dt id="command:gnuinstalldirs_get_absolute_install_dir">
<code class="descname">GNUInstallDirs_get_absolute_install_dir</code><a class="headerlink" href="#command:gnuinstalldirs_get_absolute_install_dir" title="Permalink to this definition"></a></dt>
<dd><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">GNUInstallDirs_get_absolute_install_dir</span><span class="p">(</span><span class="n">absvar</span> <span class="n">var</span><span class="p">)</span>
</pre></div>
</div>
<p>Set the given variable <code class="docutils literal"><span class="pre">absvar</span></code> to the absolute path contained
within the variable <code class="docutils literal"><span class="pre">var</span></code>. This is to allow the computation of an
absolute path, accounting for all the special cases documented
above. While this macro is used to compute the various
<code class="docutils literal"><span class="pre">CMAKE_INSTALL_FULL_&lt;dir&gt;</span></code> variables, it is exposed publicly to
allow users who create additional path variables to also compute
absolute paths where necessary, using the same logic.</p>
</dd></dl>
</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="#">GNUInstallDirs</a><ul>
<li><a class="reference internal" href="#result-variables">Result Variables</a></li>
<li><a class="reference internal" href="#special-cases">Special Cases</a></li>
<li><a class="reference internal" href="#macros">Macros</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="GetPrerequisites.html"
title="previous chapter">GetPrerequisites</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="InstallRequiredSystemLibraries.html"
title="next chapter">InstallRequiredSystemLibraries</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/module/GNUInstallDirs.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="InstallRequiredSystemLibraries.html" title="InstallRequiredSystemLibraries"
>next</a> |</li>
<li class="right" >
<a href="GetPrerequisites.html" title="GetPrerequisites"
>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>