blob: 84b2f9d5553a6f0f5c98ca122c0fcd0757330d94 [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>FindBISON &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="FindBLAS" href="FindBLAS.html" />
<link rel="prev" title="FindAVIFile" href="FindAVIFile.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="FindBLAS.html" title="FindBLAS"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="FindAVIFile.html" title="FindAVIFile"
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="findbison">
<span id="module:FindBISON"></span><h1>FindBISON<a class="headerlink" href="#findbison" title="Permalink to this headline">ΒΆ</a></h1>
<p>Find <code class="docutils literal"><span class="pre">bison</span></code> executable and provide a macro to generate custom build rules.</p>
<p>The module defines the following variables:</p>
<dl class="docutils">
<dt><code class="docutils literal"><span class="pre">BISON_EXECUTABLE</span></code></dt>
<dd>path to the <code class="docutils literal"><span class="pre">bison</span></code> program</dd>
<dt><code class="docutils literal"><span class="pre">BISON_VERSION</span></code></dt>
<dd>version of <code class="docutils literal"><span class="pre">bison</span></code></dd>
<dt><code class="docutils literal"><span class="pre">BISON_FOUND</span></code></dt>
<dd>true if the program was found</dd>
</dl>
<p>The minimum required version of <code class="docutils literal"><span class="pre">bison</span></code> can be specified using the
standard CMake syntax, e.g. <code class="docutils literal"><span class="pre">find_package(BISON</span> <span class="pre">2.1.3)</span></code>.</p>
<p>If <code class="docutils literal"><span class="pre">bison</span></code> is found, the module defines the macro:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">BISON_TARGET</span><span class="p">(</span><span class="o">&lt;</span><span class="n">Name</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">YaccInput</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">CodeOutput</span><span class="o">&gt;</span>
<span class="p">[</span><span class="n">COMPILE_FLAGS</span> <span class="o">&lt;</span><span class="n">flags</span><span class="o">&gt;</span><span class="p">]</span>
<span class="p">[</span><span class="n">DEFINES_FILE</span> <span class="o">&lt;</span><span class="n">file</span><span class="o">&gt;</span><span class="p">]</span>
<span class="p">[</span><span class="n">VERBOSE</span> <span class="p">[</span><span class="o">&lt;</span><span class="n">file</span><span class="o">&gt;</span><span class="p">]]</span>
<span class="p">[</span><span class="n">REPORT_FILE</span> <span class="o">&lt;</span><span class="n">file</span><span class="o">&gt;</span><span class="p">]</span>
<span class="p">)</span>
</pre></div>
</div>
<p>which will create a custom rule to generate a parser. <code class="docutils literal"><span class="pre">&lt;YaccInput&gt;</span></code> is
the path to a yacc file. <code class="docutils literal"><span class="pre">&lt;CodeOutput&gt;</span></code> is the name of the source file
generated by bison. A header file is also be generated, and contains
the token list.</p>
<p>The options are:</p>
<dl class="docutils">
<dt><code class="docutils literal"><span class="pre">COMPILE_FLAGS</span> <span class="pre">&lt;flags&gt;</span></code></dt>
<dd>Specify flags to be added to the <code class="docutils literal"><span class="pre">bison</span></code> command line.</dd>
<dt><code class="docutils literal"><span class="pre">DEFINES_FILE</span> <span class="pre">&lt;file&gt;</span></code></dt>
<dd>Specify a non-default header <code class="docutils literal"><span class="pre">&lt;file&gt;</span></code> to be generated by <code class="docutils literal"><span class="pre">bison</span></code>.</dd>
<dt><code class="docutils literal"><span class="pre">VERBOSE</span> <span class="pre">[&lt;file&gt;]</span></code></dt>
<dd>Tell <code class="docutils literal"><span class="pre">bison</span></code> to write a report file of the grammar and parser.
If <code class="docutils literal"><span class="pre">&lt;file&gt;</span></code> is given, it specifies path the report file is copied to.
<code class="docutils literal"><span class="pre">[&lt;file&gt;]</span></code> is left for backward compatibility of this module.
Use <code class="docutils literal"><span class="pre">VERBOSE</span> <span class="pre">REPORT_FILE</span> <span class="pre">&lt;file&gt;</span></code>.</dd>
<dt><code class="docutils literal"><span class="pre">REPORT_FILE</span> <span class="pre">&lt;file&gt;</span></code></dt>
<dd>Specify a non-default report <code class="docutils literal"><span class="pre">&lt;file&gt;</span></code>, if generated.</dd>
</dl>
<p>The macro defines the following variables:</p>
<dl class="docutils">
<dt><code class="docutils literal"><span class="pre">BISON_&lt;Name&gt;_DEFINED</span></code></dt>
<dd>true is the macro ran successfully</dd>
<dt><code class="docutils literal"><span class="pre">BISON_&lt;Name&gt;_INPUT</span></code></dt>
<dd>The input source file, an alias for &lt;YaccInput&gt;</dd>
<dt><code class="docutils literal"><span class="pre">BISON_&lt;Name&gt;_OUTPUT_SOURCE</span></code></dt>
<dd>The source file generated by bison</dd>
<dt><code class="docutils literal"><span class="pre">BISON_&lt;Name&gt;_OUTPUT_HEADER</span></code></dt>
<dd>The header file generated by bison</dd>
<dt><code class="docutils literal"><span class="pre">BISON_&lt;Name&gt;_OUTPUTS</span></code></dt>
<dd>All files generated by bison including the source, the header and the report</dd>
<dt><code class="docutils literal"><span class="pre">BISON_&lt;Name&gt;_COMPILE_FLAGS</span></code></dt>
<dd>Options used in the <code class="docutils literal"><span class="pre">bison</span></code> command line</dd>
</dl>
<p>Example usage:</p>
<div class="highlight-cmake"><div class="highlight"><pre><span></span><span class="nb">find_package</span><span class="p">(</span><span class="s">BISON</span><span class="p">)</span>
<span class="nb">BISON_TARGET</span><span class="p">(</span><span class="s">MyParser</span> <span class="s">parser.y</span> <span class="o">${</span><span class="nv">CMAKE_CURRENT_BINARY_DIR</span><span class="o">}</span><span class="s">/parser.cpp</span>
<span class="s">DEFINES_FILE</span> <span class="o">${</span><span class="nv">CMAKE_CURRENT_BINARY_DIR</span><span class="o">}</span><span class="s">/parser.h</span><span class="p">)</span>
<span class="nb">add_executable</span><span class="p">(</span><span class="s">Foo</span> <span class="s">main.cpp</span> <span class="o">${</span><span class="nv">BISON_MyParser_OUTPUTS</span><span class="o">}</span><span class="p">)</span>
</pre></div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="FindAVIFile.html"
title="previous chapter">FindAVIFile</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="FindBLAS.html"
title="next chapter">FindBLAS</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/module/FindBISON.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="FindBLAS.html" title="FindBLAS"
>next</a> |</li>
<li class="right" >
<a href="FindAVIFile.html" title="FindAVIFile"
>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>