-
Notifications
You must be signed in to change notification settings - Fork 0
/
help.html
232 lines (216 loc) · 14.3 KB
/
help.html
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
<!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" />
<meta content="Report any issues with BASIS or request new features on GitHub." name="description" />
<title>Support — BASIS</title>
<link rel="stylesheet" href="_static/cmake-basis.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: 'v3.3 (fb18c98)',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</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/favicon.ico"/>
<link rel="author" title="About these documents" href="about.html" />
<link rel="top" title="BASIS" href="index.html" />
<link rel="next" title="About CMake BASIS" href="about.html" />
<link rel="prev" title="Installation" href="install.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="about.html" title="About CMake BASIS"
accesskey="N">next</a></li>
<li class="right" >
<a href="install.html" title="Installation"
accesskey="P">previous</a> |</li>
<li><a href="sidebar.html">BASIS</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="support">
<h1>Support<a class="headerlink" href="#support" title="Permalink to this headline">¶</a></h1>
<div class="section" id="report-issue">
<h2>Report Issue<a class="headerlink" href="#report-issue" title="Permalink to this headline">¶</a></h2>
<p>Please report any issues with BASIS, including bug reports, feature requests, or support questions, on GitHub.
Before opening a new issue, we recommend a look at the frequently asked questions below and a search of the
already reported <a class="reference external" href="https://github.com/cmake-basis/BASIS/issues">open issues</a>.</p>
</div>
<div class="section" id="frequently-asked-questions">
<h2>Frequently Asked Questions<a class="headerlink" href="#frequently-asked-questions" title="Permalink to this headline">¶</a></h2>
<div class="section" id="standard-cmake-commands">
<h3>Standard CMake Commands<a class="headerlink" href="#standard-cmake-commands" title="Permalink to this headline">¶</a></h3>
<p><strong>Can I still use standard CMake calls such as add_library, or is some BASIS functionality lost?</strong></p>
<p>Probably. However, you will definitely lose much of the useful functionality
that BASIS was created to provide. This kind of usage has also not been heavily
tested so it is not recommended. The BASIS philosophy is definitely that a
project that switches to BASIS uses the basis_* CMake commands wherever possible.
Consider BASIS an extension to CMake, but if you run into issues you can
file a ticket and we will attempt to address the problem.</p>
</div>
<div class="section" id="cmake-package-configuration">
<h3>CMake Package Configuration<a class="headerlink" href="#cmake-package-configuration" title="Permalink to this headline">¶</a></h3>
<p><strong>Can I use the <Package>Config.cmake files of projects that do not use BASIS?</strong></p>
<p>In <Package>Config.cmake files of other projects, it is fine that there will
be standard CMake commands add include/library directories or import targets.
BASIS is “smart” enough to extract this information properly by overriding
the standard CMake commands.</p>
</div>
<div class="section" id="export-of-build-targets">
<h3>Export of Build Targets<a class="headerlink" href="#export-of-build-targets" title="Permalink to this headline">¶</a></h3>
<p><strong>Do library targets have to be manually exported?</strong></p>
<p>No. This is taken care of by the functions found in the internal <a class="reference external" href="https://cmake-basis.github.io/apidoc/latest/ExportTools_8cmake.html">ExportTools.cmake</a> module,
including executable targets which correspond to executable Python, Perl, BASH scripts,
or executable binaries generated by the MATLAB Compiler.</p>
<p><strong>Does the BASISConfig.cmake file define all of the exported library targets?</strong></p>
<p>As typical for CMake, import statements for exported targets are written to “export files”.
These are included by the BASISUse.cmake file which should be included by
other packages which use BASIS as follows:</p>
<div class="highlight-cmake"><div class="highlight"><pre><span></span><span class="nb">find_package</span><span class="p">(</span><span class="s">BASIS</span> <span class="s">REQUIRED</span><span class="p">)</span>
<span class="nb">include</span><span class="p">(</span><span class="o">${</span><span class="nv">BASIS_USE_FILE</span><span class="o">}</span><span class="p">)</span>
</pre></div>
</div>
<p>This is done already by the <a class="reference external" href="https://cmake-basis.github.io/apidoc/latest/group__CMakeAPI.html#ga176bd65473e5cb933055d56592cc7357">basis_use_package()</a> function which in turn
is called by <a class="reference external" href="https://cmake-basis.github.io/apidoc/latest/group__CMakeUtilities.html#ga86649325bef31a56d74a6b3aa57e9c7b">basis_find_packages()</a> for all project dependencies right after
the respective <a class="reference external" href="https://cmake-basis.github.io/apidoc/latest/group__CMakeAPI.html#gac9a1326ff8b06b17aebbb6b852ca73af">basis_find_package()</a> call. In case of BASIS itself,
the <code class="docutils literal"><span class="pre">basis_use_package(BASIS)</span></code> is called by the <a class="reference external" href="https://cmake-basis.github.io/apidoc/latest/group__CMakeAPI.html#ga2a64dd1aba417c5c92513027ed901bd7">basis_project_begin()</a> command
which also calls <a class="reference external" href="https://cmake-basis.github.io/apidoc/latest/group__CMakeUtilities.html#ga86649325bef31a56d74a6b3aa57e9c7b">basis_find_packages()</a>.</p>
<p>Thus, all you need to do is add a call to <a class="reference external" href="https://cmake-basis.github.io/apidoc/latest/group__CMakeAPI.html#ga2a64dd1aba417c5c92513027ed901bd7">basis_project_begin()</a> to the
root CMakeLists.txt file of your project. See the root CMakeLists.txt of the default
<a class="reference internal" href="howto/use-and-customize-templates.html#availabletemplates"><span class="std std-ref">project template</span></a> included with BASIS for an example.</p>
<p><strong>Is there an easy way for users to get a list of the exported targets in a module?</strong></p>
<p>No. This should probably be part of the documentation of each respective package/module.
Generally with CMake, you would have a look at the exports file of a package that
can usually be found right next to the CMake package configuration file (<code class="docutils literal"><span class="pre"><Package>Config.cmake</span></code>).</p>
<p>Look into the build directory of your BASIS build for an example. There you find the following files:</p>
<table border="1" class="docutils">
<colgroup>
<col width="26%" />
<col width="74%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">File name</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><strong>BASISConfig.cmake</strong></td>
<td>Package configuration file which is included by CMake’s <code class="docutils literal"><span class="pre">find_package</span></code> command.</td>
</tr>
<tr class="row-odd"><td><strong>BASISExports.cmake</strong></td>
<td>Import statements for exported targets.</td>
</tr>
<tr class="row-even"><td><strong>BASISCustomExports.cmake</strong></td>
<td>Import statements for exported custom targets.</td>
</tr>
<tr class="row-odd"><td><strong>BASISUse.cmake</strong></td>
<td>File to be included by users. Imports the exported targets.</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">These file are generated by BASIS for every project that uses it,
where <code class="docutils literal"><span class="pre">BASIS</span></code> is replaced by package name.</p>
</div>
<p>Note that these files contain the paths to the libraries and executables in the build tree.
For each of these, BASIS configures also a second version which contains then the paths for
the installation tree which are all relative to the location of the <code class="docutils literal"><span class="pre"><Package>Config.cmake</span></code>
file and made absolute upon inclusion of these files.</p>
<p>The export files are generated by the internal CMake function <a class="reference external" href="https://cmake-basis.github.io/apidoc/latest/group__CMakeUtilities.html#ga966c3d2d40cf32e3fd0dce2c6929e733">basis_export_targets()</a>.
This function not only exports the custom targets of a project, but also calls
CMake’s <a class="reference external" href="http://www.cmake.org/cmake/help/v2.8.12/cmake.html#command:export">export</a> and
<a class="reference external" href="http://www.cmake.org/cmake/help/v2.8.12/cmake.html#command:install">install(EXPORT)</a>
commands for built-in targets, i.e., C/C++ executables and libraries.
This happens upon project “finalization”, i.e., <a class="reference external" href="https://cmake-basis.github.io/apidoc/latest/group__CMakeAPI.html#gac399906502062e3885bcf1a00cf623f6">basis_project_end()</a>,
which must be called at the end of each root CMakeLists.txt, including the CMakeLists.txt
file in the top-level directory of each <a class="reference internal" href="standard/modules.html#projectmoduledefinition"><span class="std std-ref">project module</span></a>.</p>
<p>The exported target names are all the “fully qualified target UIDs” as used internally
by BASIS to avoid target name conflicts between packages. The target name specified
as argument to the <code class="docutils literal"><span class="pre">basis_add_*</span></code> target commands is prepended by the name of the package
(i.e., top-level project name in case of modules, respectively, the <code class="docutils literal"><span class="pre">PACKAGE_NAME</span></code>
specified in the <code class="docutils literal"><span class="pre">BasisProject.cmake</span></code> file) and separated by a dot (<code class="docutils literal"><span class="pre">.</span></code>).
For example, the BASIS Utilities library of the CMake BASIS package has the exported
target name <code class="docutils literal"><span class="pre">basis.utilities</span></code>.</p>
<p>When two modules belong to the same package, the package name prefix of the target
names can be omitted when calling <a class="reference external" href="https://cmake-basis.github.io/apidoc/latest/group__CMakeAPI.html#gab2594b3327126ac531ef4ed806501406">basis_target_link_libraries()</a>, for example.</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="index.html">
<img class="logo" src="_static/logo_title.svg" alt="Logo"/>
</a></p>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
<h3><a href="contents.html">Table Of Contents</a></h3>
<ul>
<li class="toctree-l1"><a class="reference internal" href="index.html">Overview</a></li>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html">Quick Start</a></li>
<li class="toctree-l1"><a class="reference internal" href="howto.html">How-to Guides</a></li>
<li class="toctree-l1"><a class="reference internal" href="standard.html">Standards</a></li>
<li class="toctree-l1"><a class="reference internal" href="guideline.html">Guidelines</a></li>
<li class="toctree-l1"><a class="reference internal" href="reference.html">Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="apidoc.html">API</a></li>
</ul>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="changelog.html">News</a></li>
<li class="toctree-l1"><a class="reference internal" href="download.html">Download</a></li>
<li class="toctree-l1"><a class="reference internal" href="install.html">Installation</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Support</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#report-issue">Report Issue</a></li>
<li class="toctree-l2"><a class="reference internal" href="#frequently-asked-questions">Frequently Asked Questions</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#standard-cmake-commands">Standard CMake Commands</a></li>
<li class="toctree-l3"><a class="reference internal" href="#cmake-package-configuration">CMake Package Configuration</a></li>
<li class="toctree-l3"><a class="reference internal" href="#export-of-build-targets">Export of Build Targets</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="about.html">About</a></li>
</ul>
<h3>External Links</h3>
<ul>
<li><a href="https://github.com/cmake-basis/BASIS">Repository</a></ li>
<li><a href="https://github.com/cmake-basis/BASIS/issues">Issues</a></ li>
</ul>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
© Copyright 2011-12 University of Pennsylvania, 2013-14 Carnegie Mellon University, 2013-16 Andreas Schuh.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.1.
</div>
</body>
</html>