| |
| <!DOCTYPE html> |
| |
| <html lang="en"> |
| <head> |
| <meta charset="utf-8" /> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
| <title>CMake Tutorial — 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="Step 1: A Basic Starting Point" href="A%20Basic%20Starting%20Point.html" /> |
| <link rel="prev" title="CPack WIX Generator" href="../../cpack_gen/wix.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="A%20Basic%20Starting%20Point.html" title="Step 1: A Basic Starting Point" |
| accesskey="N">next</a> |</li> |
| <li class="right" > |
| <a href="../../cpack_gen/wix.html" title="CPack WIX Generator" |
| 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> » |
| </li> |
| <li> |
| <a href="../../index.html">3.23.1 Documentation</a> » |
| </li> |
| |
| <li class="nav-item nav-item-this"><a href="">CMake Tutorial</a></li> |
| </ul> |
| </div> |
| |
| <div class="document"> |
| <div class="documentwrapper"> |
| <div class="bodywrapper"> |
| <div class="body" role="main"> |
| |
| <div class="section" id="cmake-tutorial"> |
| <span id="guide:CMake Tutorial"></span><h1>CMake Tutorial<a class="headerlink" href="#cmake-tutorial" title="Permalink to this headline">¶</a></h1> |
| <div class="section" id="introduction"> |
| <h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2> |
| <p>The CMake tutorial provides a step-by-step guide that covers common build |
| system issues that CMake helps address. Seeing how various topics all |
| work together in an example project can be very helpful.</p> |
| </div> |
| <div class="section" id="steps"> |
| <h2>Steps<a class="headerlink" href="#steps" title="Permalink to this headline">¶</a></h2> |
| <p>The tutorial documentation and source code for examples can be found in |
| the <code class="docutils literal notranslate"><span class="pre">Help/guide/tutorial</span></code> directory of the CMake source code tree. |
| Each step has its own subdirectory containing code that may be used as a |
| starting point. The tutorial examples are progressive so that each step |
| provides the complete solution for the previous step.</p> |
| <div class="toctree-wrapper compound"> |
| <ul> |
| <li class="toctree-l1"><a class="reference internal" href="A%20Basic%20Starting%20Point.html">Step 1: A Basic Starting Point</a><ul> |
| <li class="toctree-l2"><a class="reference internal" href="A%20Basic%20Starting%20Point.html#build-and-run">Build and Run</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="A%20Basic%20Starting%20Point.html#adding-a-version-number-and-configured-header-file">Adding a Version Number and Configured Header File</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="A%20Basic%20Starting%20Point.html#specify-the-c-standard">Specify the C++ Standard</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="A%20Basic%20Starting%20Point.html#rebuild">Rebuild</a></li> |
| </ul> |
| </li> |
| <li class="toctree-l1"><a class="reference internal" href="Adding%20a%20Library.html">Step 2: Adding a Library</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="Adding%20Usage%20Requirements%20for%20a%20Library.html">Step 3: Adding Usage Requirements for a Library</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="Installing%20and%20Testing.html">Step 4: Installing and Testing</a><ul> |
| <li class="toctree-l2"><a class="reference internal" href="Installing%20and%20Testing.html#install-rules">Install Rules</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="Installing%20and%20Testing.html#testing-support">Testing Support</a></li> |
| </ul> |
| </li> |
| <li class="toctree-l1"><a class="reference internal" href="Adding%20System%20Introspection.html">Step 5: Adding System Introspection</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="Adding%20a%20Custom%20Command%20and%20Generated%20File.html">Step 6: Adding a Custom Command and Generated File</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="Packaging%20an%20Installer.html">Step 7: Packaging an Installer</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="Adding%20Support%20for%20a%20Testing%20Dashboard.html">Step 8: Adding Support for a Testing Dashboard</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="Selecting%20Static%20or%20Shared%20Libraries.html">Step 9: Selecting Static or Shared Libraries</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="Adding%20Generator%20Expressions.html">Step 10: Adding Generator Expressions</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="Adding%20Export%20Configuration.html">Step 11: Adding Export Configuration</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="Packaging%20Debug%20and%20Release.html">Step 12: Packaging Debug and Release</a></li> |
| </ul> |
| </div> |
| <div class="toctree-wrapper compound"> |
| </div> |
| </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 Tutorial</a><ul> |
| <li><a class="reference internal" href="#introduction">Introduction</a></li> |
| <li><a class="reference internal" href="#steps">Steps</a><ul> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| |
| <h4>Previous topic</h4> |
| <p class="topless"><a href="../../cpack_gen/wix.html" |
| title="previous chapter">CPack WIX Generator</a></p> |
| <h4>Next topic</h4> |
| <p class="topless"><a href="A%20Basic%20Starting%20Point.html" |
| title="next chapter">Step 1: A Basic Starting Point</a></p> |
| <div role="note" aria-label="source link"> |
| <h3>This Page</h3> |
| <ul class="this-page-menu"> |
| <li><a href="../../_sources/guide/tutorial/index.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="A%20Basic%20Starting%20Point.html" title="Step 1: A Basic Starting Point" |
| >next</a> |</li> |
| <li class="right" > |
| <a href="../../cpack_gen/wix.html" title="CPack WIX Generator" |
| >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> » |
| </li> |
| <li> |
| <a href="../../index.html">3.23.1 Documentation</a> » |
| </li> |
| |
| <li class="nav-item nav-item-this"><a href="">CMake Tutorial</a></li> |
| </ul> |
| </div> |
| |
| <div class="footer" role="contentinfo"> |
| © Copyright 2000-2022 Kitware, Inc. and Contributors. |
| Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.1.2. |
| </div> |
| </body> |
| </html> |