aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/platforms/linux-wayland-build-qt-from-source.qdocinc
blob: 11040e8e1260346ab806658ca179d5132e7afe50 (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
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

//! [getting-the-sources]
Qt sources can be installed in \QOI. Source packages are also
available \l{Getting Qt Sources from the Git repository}{through Git}, as
archives in the \l{Qt Account} (commercial users), and on
\l{https://download.qt.io/official_releases/qt/}{download.qt.io}
(open-source users).

If you install the sources through \QOI, they will
be available in the Qt installation directory, for example
\tt{$HOME/Qt/\QtVersion/Src}.

If you downloaded the single source archive, extract it to a directory of
your choice:

\include snippets/code/doc_src_installation.qdoc 11
//! [getting-the-sources]

//! [install-build-requirements]
\table 80%
    \header \li Tool \li Supported Versions
    \row
        \li CMake
        \li Version 3.22 and newer.
    \row
        \li Ninja
        \li -
    \row
        \li Python
        \li Version 3
\endtable

\include use-ninja-note.qdocinc ninja-note
//! [install-build-requirements]

//! [build-the-qt-libraries-and-tools]
To configure your build, create a build directory and run the
\c{./configure} script in this directory:

\include snippets/code/doc_src_installation.qdoc 12

By default, Qt is configured for installation in the
\tt{/usr/local/Qt-\QtVersion} directory. This can be changed by using the
\c{-prefix} option. See the list of \l{Qt Configure Options}{configure options}
to tweak further.

Did \c{configure} run successfully? Then proceed with building the libraries
and tools:

\badcode
cmake --build . --parallel
\endcode

After building, you need to install the libraries and tools in the
appropriate place (unless you enabled a
\l{Developer Builds}{developer build}):

\badcode
cmake --install .
\endcode

Note that this might require root access.
//! [build-the-qt-libraries-and-tools]

//! [using-qt]
After Qt is installed, you can start building applications with it.

If you work from the command line, consider adding the Qt tools to your
default \c PATH. This is done as follows:

In \c{.profile} (if your shell is bash, ksh, zsh or sh), add the
following lines:

\badcode \QtVersion
PATH=/usr/local/Qt-\1/bin:$PATH
export PATH
\endcode

In \c{.login} (if your shell is csh or tcsh), add the following line:

\badcode \QtVersion
setenv PATH /usr/local/Qt-\1/bin:$PATH
\endcode
//! [using-qt]