blob: b8158b4e50e85fa8d7e79df08f0d08445873e6bc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<title>CMake parser — Universal Ctags 0.3.0 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/classic.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="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="The new C/C++ parser" href="parser-cxx.html" />
<link rel="prev" title="Asm parser" href="parser-asm.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="parser-cxx.html" title="The new C/C++ parser"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="parser-asm.html" title="Asm parser"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">Universal Ctags 0.3.0 documentation</a> »</li>
<li class="nav-item nav-item-1"><a href="parsers.html" accesskey="U">Parsers</a> »</li>
<li class="nav-item nav-item-this"><a href="">CMake parser</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="cmake-parser">
<span id="cmake"></span><h1>CMake parser<a class="headerlink" href="#cmake-parser" title="Permalink to this headline">¶</a></h1>
<p>The CMake parser is used for <code class="docutils literal notranslate"><span class="pre">.cmake</span></code> and <code class="docutils literal notranslate"><span class="pre">CMakeLists.txt</span></code> files.
It generates tags for the following items:</p>
<ul class="simple">
<li><p>User-defined functions</p></li>
<li><p>User-defined macros</p></li>
<li><p>User-defined options created by <code class="docutils literal notranslate"><span class="pre">option()</span></code></p></li>
<li><p>Variables defined by <code class="docutils literal notranslate"><span class="pre">set()</span></code></p></li>
<li><p>Targets created by <code class="docutils literal notranslate"><span class="pre">add_custom_target()</span></code>, <code class="docutils literal notranslate"><span class="pre">add_executable()</span></code> and <code class="docutils literal notranslate"><span class="pre">add_library()</span></code></p></li>
</ul>
<p>The parser uses the experimental multi-table regex <code class="docutils literal notranslate"><span class="pre">ctags</span></code> options to
perform the parsing and tag generation.</p>
<p>Caveats:</p>
<blockquote>
<div><p>Names that are <code class="docutils literal notranslate"><span class="pre">${}</span></code> references to variables are not tagged.</p>
<p>For example, given the following:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>set(PROJECT_NAME_STR ${PROJECT_NAME})
add_executable( ${PROJECT_NAME_STR} ... )
add_custom_target( ${PROJECT_NAME_STR}_tests ... )
add_library( sharedlib ... )
</pre></div>
</div>
<p>…the variable <code class="docutils literal notranslate"><span class="pre">PROJECT_NAME_STR</span></code> and target <code class="docutils literal notranslate"><span class="pre">sharedlib</span></code> will both be tagged,
but the other targets will not be.</p>
</div></blockquote>
<p>References:</p>
<blockquote>
<div><p><a class="reference external" href="https://cmake.org/cmake/help/latest/manual/cmake-language.7.html">https://cmake.org/cmake/help/latest/manual/cmake-language.7.html</a></p>
</div></blockquote>
</section>
<div class="clearer"></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="parser-asm.html"
title="previous chapter">Asm parser</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="parser-cxx.html"
title="next chapter">The new C/C++ parser</a></p>
<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" />
<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="parser-cxx.html" title="The new C/C++ parser"
>next</a> |</li>
<li class="right" >
<a href="parser-asm.html" title="Asm parser"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">Universal Ctags 0.3.0 documentation</a> »</li>
<li class="nav-item nav-item-1"><a href="parsers.html" >Parsers</a> »</li>
<li class="nav-item nav-item-this"><a href="">CMake parser</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2015, Universal Ctags Team.
Last updated on 11 Jun 2021.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.0.2.
</div>
</body>
</html>
|