1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
5 | %general-entities;
|
---|
6 |
|
---|
7 | <!ENTITY cmake-download-http "https://cmake.org/files/v&cmake-major-version;/cmake-&cmake-version;.tar.gz">
|
---|
8 | <!ENTITY cmake-download-ftp " ">
|
---|
9 | <!ENTITY cmake-md5sum "fd4bc3f35bf7e5ae9f96b9b51f835432">
|
---|
10 | <!ENTITY cmake-size "11 MB">
|
---|
11 | <!ENTITY cmake-buildsize "462 MB (add 1.3 GB for tests)">
|
---|
12 | <!ENTITY cmake-time "2.0 SBU (add 4.0 SBU for tests, both using parallelism=4)">
|
---|
13 | ]>
|
---|
14 |
|
---|
15 | <sect1 id="cmake" xreflabel="CMake-&cmake-version;">
|
---|
16 | <?dbhtml filename="cmake.html"?>
|
---|
17 |
|
---|
18 |
|
---|
19 | <title>CMake-&cmake-version;</title>
|
---|
20 |
|
---|
21 | <indexterm zone="cmake">
|
---|
22 | <primary sortas="a-CMake">CMake</primary>
|
---|
23 | </indexterm>
|
---|
24 |
|
---|
25 | <sect2 role="package">
|
---|
26 | <title>Introduction to CMake</title>
|
---|
27 |
|
---|
28 | <para>
|
---|
29 | The <application>CMake</application> package contains a modern
|
---|
30 | toolset used for generating Makefiles. It is a successor of the
|
---|
31 | auto-generated <command>configure</command> script and aims to
|
---|
32 | be platform- and compiler-independent. A significant user of
|
---|
33 | <application>CMake</application> is <application>KDE</application>
|
---|
34 | since version 4.
|
---|
35 | </para>
|
---|
36 |
|
---|
37 | &lfs122_checked;
|
---|
38 |
|
---|
39 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
40 | <itemizedlist spacing="compact">
|
---|
41 | <listitem>
|
---|
42 | <para>
|
---|
43 | Download (HTTP): <ulink url="&cmake-download-http;"/>
|
---|
44 | </para>
|
---|
45 | </listitem>
|
---|
46 | <listitem>
|
---|
47 | <para>
|
---|
48 | Download (FTP): <ulink url="&cmake-download-ftp;"/>
|
---|
49 | </para>
|
---|
50 | </listitem>
|
---|
51 | <listitem>
|
---|
52 | <para>
|
---|
53 | Download MD5 sum: &cmake-md5sum;
|
---|
54 | </para>
|
---|
55 | </listitem>
|
---|
56 | <listitem>
|
---|
57 | <para>
|
---|
58 | Download size: &cmake-size;
|
---|
59 | </para>
|
---|
60 | </listitem>
|
---|
61 | <listitem>
|
---|
62 | <para>
|
---|
63 | Estimated disk space required: &cmake-buildsize;
|
---|
64 | </para>
|
---|
65 | </listitem>
|
---|
66 | <listitem>
|
---|
67 | <para>
|
---|
68 | Estimated build time: &cmake-time;
|
---|
69 | </para>
|
---|
70 | </listitem>
|
---|
71 | </itemizedlist>
|
---|
72 |
|
---|
73 | <!--
|
---|
74 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
75 | <itemizedlist spacing="compact">
|
---|
76 | <listitem>
|
---|
77 | <para>
|
---|
78 | Required patch:
|
---|
79 | <ulink url="&patch-root;/cmake-&cmake-version;-upstream_fix-1.patch"/>
|
---|
80 | </para>
|
---|
81 | </listitem>
|
---|
82 | </itemizedlist>
|
---|
83 | -->
|
---|
84 |
|
---|
85 | <bridgehead renderas="sect3">CMake Dependencies</bridgehead>
|
---|
86 |
|
---|
87 | <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
88 | <para role="recommended">
|
---|
89 | <xref linkend="curl"/>,
|
---|
90 | <xref linkend="libarchive"/>,
|
---|
91 | <xref linkend="libuv"/>, and
|
---|
92 | <xref linkend="nghttp2"/>
|
---|
93 | </para>
|
---|
94 |
|
---|
95 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
96 | <para role="optional">
|
---|
97 | <xref linkend="gcc"/> (for gfortran),
|
---|
98 | <xref linkend="git"/> (for use during tests),
|
---|
99 | <xref linkend="mercurial"/> (for use during tests),
|
---|
100 | <xref linkend="openjdk"/> (for use during tests),
|
---|
101 | <xref linkend="qt6"/> (for the Qt-based GUI),
|
---|
102 | <xref linkend="sphinx"/> (for building documents),
|
---|
103 | <xref linkend="subversion"/> (for testing),
|
---|
104 | <ulink url="https://github.com/google/cppdap/">cppdap</ulink>,
|
---|
105 | <ulink url="https://github.com/open-source-parsers/jsoncpp/">jsoncpp</ulink>, and
|
---|
106 | <ulink url="https://rhash.sourceforge.net/">rhash</ulink>
|
---|
107 | </para>
|
---|
108 |
|
---|
109 | </sect2>
|
---|
110 |
|
---|
111 | <sect2 role="installation">
|
---|
112 | <title>Installation of CMake</title>
|
---|
113 |
|
---|
114 | <!--
|
---|
115 | <para>
|
---|
116 | First, adapt the FindBoost module to use Boost-1.80.0:
|
---|
117 | </para>
|
---|
118 |
|
---|
119 | <screen><userinput remap="pre">patch -Np1 -i ../cmake-&cmake-version;-upstream_fix-1.patch</userinput></screen>
|
---|
120 | -->
|
---|
121 |
|
---|
122 | <para>
|
---|
123 | Install <application>CMake</application> by running the following
|
---|
124 | commands:
|
---|
125 | </para>
|
---|
126 |
|
---|
127 | <screen><userinput>sed -i '/"lib64"/s/64//' Modules/GNUInstallDirs.cmake &&
|
---|
128 |
|
---|
129 | ./bootstrap --prefix=/usr \
|
---|
130 | --system-libs \
|
---|
131 | --mandir=/share/man \
|
---|
132 | --no-system-jsoncpp \
|
---|
133 | --no-system-cppdap \
|
---|
134 | --no-system-librhash \
|
---|
135 | --docdir=/share/doc/cmake-&cmake-version; &&
|
---|
136 | make</userinput></screen>
|
---|
137 |
|
---|
138 | <para>
|
---|
139 | To test the results, issue: <command>LC_ALL=en_US.UTF-8 bin/ctest
|
---|
140 | -j<replaceable><N></replaceable> -O
|
---|
141 | cmake-&cmake-version;-test.log</command>, where
|
---|
142 | <replaceable><N></replaceable> is an integer between 1 and the
|
---|
143 | number of system cores. Setting <envar>LC_ALL</envar> is needed to
|
---|
144 | prevent some test failures when some of the locale variables are
|
---|
145 | set to non English locales.
|
---|
146 | <!--
|
---|
147 | One test, RunCMake.FindBoost, is known to fail.
|
---|
148 | Now cmake-3.27.0. All tests pass.
|
---|
149 | -->
|
---|
150 | </para>
|
---|
151 |
|
---|
152 | <para>
|
---|
153 | If you want to investigate a problem with a given "problem1-test",
|
---|
154 | use <command>bin/ctest -R "problem1-test"</command> and, to omit it, use
|
---|
155 | <command>bin/ctest -E "problem1-test"</command>. These options can be
|
---|
156 | used together:
|
---|
157 | <command>bin/ctest -R "problem1-test" -E "problem2-test"</command>.
|
---|
158 | Option <option>-N</option> can be used to display all
|
---|
159 | available tests, and you can run <command>bin/ctest</command> for a
|
---|
160 | sub-set of tests by using separated by spaces names or numbers as
|
---|
161 | options. Option <option>--help</option> can be used to show all options.
|
---|
162 | </para>
|
---|
163 |
|
---|
164 | <para>
|
---|
165 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
166 | </para>
|
---|
167 |
|
---|
168 | <screen role="root"><userinput>make install</userinput></screen>
|
---|
169 |
|
---|
170 | </sect2>
|
---|
171 |
|
---|
172 | <sect2 role="commands">
|
---|
173 | <title>Command Explanations</title>
|
---|
174 |
|
---|
175 | <para>
|
---|
176 | <command>sed ... Modules/GNUInstallDirs.cmake</command>:
|
---|
177 | This command disables applications using cmake from attempting to
|
---|
178 | install files in /usr/lib64/.
|
---|
179 | </para>
|
---|
180 |
|
---|
181 | <para>
|
---|
182 | <parameter>--system-libs</parameter>: This switch forces the build
|
---|
183 | system to link against the system installed version for all needed
|
---|
184 | libraries but those explicitly specified via a
|
---|
185 | <option>--no-system-*</option> option.
|
---|
186 | </para>
|
---|
187 |
|
---|
188 | <para>
|
---|
189 | <parameter>--no-system-jsoncpp</parameter> and
|
---|
190 | <parameter>--no-system-cppdap</parameter>: These switches remove the
|
---|
191 | <application>JSON-C++</application> library from the list of system
|
---|
192 | libraries. A bundled version of that library is used instead.
|
---|
193 | </para>
|
---|
194 |
|
---|
195 | <para>
|
---|
196 | <parameter>--no-system-librhash</parameter>: This switch removes the
|
---|
197 | <application>librhash</application> library from the list of system
|
---|
198 | libraries used. A bundled version of that library is used instead.
|
---|
199 | </para>
|
---|
200 |
|
---|
201 | <para>
|
---|
202 | <option>--no-system-{curl,libarchive,libuv,nghttp2}</option>: Use
|
---|
203 | the corresponding option in the list for the
|
---|
204 | <command>bootstrap</command> if one of the recommended dependencies is
|
---|
205 | not installed. A bundled version of the dependency will be used instead.
|
---|
206 | </para>
|
---|
207 |
|
---|
208 | <para>
|
---|
209 | <option>--qt-gui</option>: This switch enables building the
|
---|
210 | <application>Qt</application>-based GUI for
|
---|
211 | <application>CMake</application>.
|
---|
212 | </para>
|
---|
213 |
|
---|
214 | <para>
|
---|
215 | <option>--parallel=</option>: This switch enables performing the
|
---|
216 | <application>CMake</application> bootstrap with multiple jobs
|
---|
217 | at one time. It's not needed if the <envar>MAKEFLAGS</envar> variable
|
---|
218 | has been already set for using multiple processors following
|
---|
219 | <xref linkend='parallel-builds'/>.
|
---|
220 | </para>
|
---|
221 |
|
---|
222 | </sect2>
|
---|
223 |
|
---|
224 | <sect2 role="content">
|
---|
225 | <title>Contents</title>
|
---|
226 |
|
---|
227 | <segmentedlist>
|
---|
228 | <segtitle>Installed Programs</segtitle>
|
---|
229 | <segtitle>Installed Libraries</segtitle>
|
---|
230 | <segtitle>Installed Directories</segtitle>
|
---|
231 |
|
---|
232 | <seglistitem>
|
---|
233 | <seg>
|
---|
234 | ccmake, cmake, cmake-gui (optional), cpack, and ctest
|
---|
235 | </seg>
|
---|
236 | <seg>
|
---|
237 | None
|
---|
238 | </seg>
|
---|
239 | <seg>
|
---|
240 | /usr/share/cmake-&cmake-major-version; and
|
---|
241 | /usr/share/doc/cmake-&cmake-version;
|
---|
242 | </seg>
|
---|
243 | </seglistitem>
|
---|
244 | </segmentedlist>
|
---|
245 |
|
---|
246 |
|
---|
247 | <variablelist>
|
---|
248 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
249 | <?dbfo list-presentation="list"?>
|
---|
250 | <?dbhtml list-presentation="table"?>
|
---|
251 |
|
---|
252 | <varlistentry id="ccmake">
|
---|
253 | <term><command>ccmake</command></term>
|
---|
254 | <listitem>
|
---|
255 | <para>
|
---|
256 | is a curses based interactive frontend to
|
---|
257 | <command>cmake</command>
|
---|
258 | </para>
|
---|
259 | <indexterm zone="cmake ccmake">
|
---|
260 | <primary sortas="b-ccmake">ccmake</primary>
|
---|
261 | </indexterm>
|
---|
262 | </listitem>
|
---|
263 | </varlistentry>
|
---|
264 |
|
---|
265 | <varlistentry id="cmake-prog">
|
---|
266 | <term><command>cmake</command></term>
|
---|
267 | <listitem>
|
---|
268 | <para>
|
---|
269 | is the makefile generator
|
---|
270 | </para>
|
---|
271 | <indexterm zone="cmake cmake-prog">
|
---|
272 | <primary sortas="b-cmake">cmake</primary>
|
---|
273 | </indexterm>
|
---|
274 | </listitem>
|
---|
275 | </varlistentry>
|
---|
276 |
|
---|
277 | <varlistentry id="cmake-gui">
|
---|
278 | <term><command>cmake-gui</command></term>
|
---|
279 | <listitem>
|
---|
280 | <para>
|
---|
281 | (optional) is the <application>Qt</application>-based frontend to
|
---|
282 | <command>cmake</command>
|
---|
283 | </para>
|
---|
284 | <indexterm zone="cmake cmake-gui">
|
---|
285 | <primary sortas="b-cmake-gui">cmake-gui</primary>
|
---|
286 | </indexterm>
|
---|
287 | </listitem>
|
---|
288 | </varlistentry>
|
---|
289 |
|
---|
290 | <varlistentry id="cpack">
|
---|
291 | <term><command>cpack</command></term>
|
---|
292 | <listitem>
|
---|
293 | <para>
|
---|
294 | is the <application>CMake</application> packaging program
|
---|
295 | </para>
|
---|
296 | <indexterm zone="cmake cpack">
|
---|
297 | <primary sortas="b-cpack">cpack</primary>
|
---|
298 | </indexterm>
|
---|
299 | </listitem>
|
---|
300 | </varlistentry>
|
---|
301 |
|
---|
302 | <varlistentry id="ctest">
|
---|
303 | <term><command>ctest</command></term>
|
---|
304 | <listitem>
|
---|
305 | <para>
|
---|
306 | is a testing utility for cmake-generated build trees
|
---|
307 | </para>
|
---|
308 | <indexterm zone="cmake ctest">
|
---|
309 | <primary sortas="b-ctest">ctest</primary>
|
---|
310 | </indexterm>
|
---|
311 | </listitem>
|
---|
312 | </varlistentry>
|
---|
313 |
|
---|
314 | </variablelist>
|
---|
315 |
|
---|
316 | </sect2>
|
---|
317 |
|
---|
318 | </sect1>
|
---|