blob: 8e4671b4f36716ad99c5d137ec2a8ea46b68bec9 [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>CMAKE_GENERATOR_PLATFORM &mdash; CMake 3.23.1 Documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="../_static/cmake.css" />
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script 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="CMAKE_GENERATOR_TOOLSET" href="CMAKE_GENERATOR_TOOLSET.html" />
<link rel="prev" title="CMAKE_GENERATOR_INSTANCE" href="CMAKE_GENERATOR_INSTANCE.html" />
</head><body>
<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="CMAKE_GENERATOR_TOOLSET.html" title="CMAKE_GENERATOR_TOOLSET"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="CMAKE_GENERATOR_INSTANCE.html" title="CMAKE_GENERATOR_INSTANCE"
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.23.1 Documentation</a> &#187;
</li>
<li class="nav-item nav-item-1"><a href="../manual/cmake-variables.7.html" accesskey="U">cmake-variables(7)</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">CMAKE_GENERATOR_PLATFORM</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="cmake-generator-platform">
<span id="variable:CMAKE_GENERATOR_PLATFORM"></span><h1>CMAKE_GENERATOR_PLATFORM<a class="headerlink" href="#cmake-generator-platform" title="Permalink to this headline"></a></h1>
<div class="versionadded">
<p><span class="versionmodified added">New in version 3.1.</span></p>
</div>
<p>Generator-specific target platform specification provided by user.</p>
<p>Some CMake generators support a target platform name to be given
to the native build system to choose a compiler toolchain.
If the user specifies a platform name (e.g. via the <span class="target" id="index-0-manual:cmake(1)"></span><a class="reference internal" href="../manual/cmake.1.html#manual:cmake(1)" title="cmake(1)"><code class="xref cmake cmake-manual docutils literal notranslate"><span class="pre">cmake(1)</span></code></a> <code class="docutils literal notranslate"><span class="pre">-A</span></code>
option or via the <span class="target" id="index-0-envvar:CMAKE_GENERATOR_PLATFORM"></span><a class="reference internal" href="../envvar/CMAKE_GENERATOR_PLATFORM.html#envvar:CMAKE_GENERATOR_PLATFORM" title="CMAKE_GENERATOR_PLATFORM"><code class="xref cmake cmake-envvar docutils literal notranslate"><span class="pre">CMAKE_GENERATOR_PLATFORM</span></code></a> environment variable)
the value will be available in this variable.</p>
<p>The value of this variable should never be modified by project code.
A toolchain file specified by the <span class="target" id="index-0-variable:CMAKE_TOOLCHAIN_FILE"></span><a class="reference internal" href="CMAKE_TOOLCHAIN_FILE.html#variable:CMAKE_TOOLCHAIN_FILE" title="CMAKE_TOOLCHAIN_FILE"><code class="xref cmake cmake-variable docutils literal notranslate"><span class="pre">CMAKE_TOOLCHAIN_FILE</span></code></a>
variable may initialize <code class="docutils literal notranslate"><span class="pre">CMAKE_GENERATOR_PLATFORM</span></code>. Once a given
build tree has been initialized with a particular value for this
variable, changing the value has undefined behavior.</p>
<p>Platform specification is supported only on specific generators:</p>
<ul class="simple">
<li><p>For <a class="reference internal" href="../manual/cmake-generators.7.html#visual-studio-generators"><span class="std std-ref">Visual Studio Generators</span></a> with VS 2005 and above this
specifies the target architecture.</p></li>
<li><p>For <span class="target" id="index-0-generator:Green Hills MULTI"></span><a class="reference internal" href="../generator/Green%20Hills%20MULTI.html#generator:Green Hills MULTI" title="Green Hills MULTI"><code class="xref cmake cmake-generator docutils literal notranslate"><span class="pre">Green</span> <span class="pre">Hills</span> <span class="pre">MULTI</span></code></a> this specifies the target architecture.</p></li>
</ul>
<p>See native build system documentation for allowed platform names.</p>
<div class="section" id="visual-studio-platform-selection">
<h2>Visual Studio Platform Selection<a class="headerlink" href="#visual-studio-platform-selection" title="Permalink to this headline"></a></h2>
<p>On <a class="reference internal" href="../manual/cmake-generators.7.html#visual-studio-generators"><span class="std std-ref">Visual Studio Generators</span></a> the selected platform name
is provided in the <span class="target" id="index-0-variable:CMAKE_VS_PLATFORM_NAME"></span><a class="reference internal" href="CMAKE_VS_PLATFORM_NAME.html#variable:CMAKE_VS_PLATFORM_NAME" title="CMAKE_VS_PLATFORM_NAME"><code class="xref cmake cmake-variable docutils literal notranslate"><span class="pre">CMAKE_VS_PLATFORM_NAME</span></code></a> variable.</p>
</div>
</div>
<div class="clearer"></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="#">CMAKE_GENERATOR_PLATFORM</a><ul>
<li><a class="reference internal" href="#visual-studio-platform-selection">Visual Studio Platform Selection</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="CMAKE_GENERATOR_INSTANCE.html"
title="previous chapter">CMAKE_GENERATOR_INSTANCE</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="CMAKE_GENERATOR_TOOLSET.html"
title="next chapter">CMAKE_GENERATOR_TOOLSET</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/variable/CMAKE_GENERATOR_PLATFORM.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#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="CMAKE_GENERATOR_TOOLSET.html" title="CMAKE_GENERATOR_TOOLSET"
>next</a> |</li>
<li class="right" >
<a href="CMAKE_GENERATOR_INSTANCE.html" title="CMAKE_GENERATOR_INSTANCE"
>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.23.1 Documentation</a> &#187;
</li>
<li class="nav-item nav-item-1"><a href="../manual/cmake-variables.7.html" >cmake-variables(7)</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">CMAKE_GENERATOR_PLATFORM</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2000-2022 Kitware, Inc. and Contributors.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.1.2.
</div>
</body>
</html>