aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/cmake/creator-projects-cmake-building.qdocinc
blob: bca11658e4a377044fbc7dd53413f11e3aece431 (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
/****************************************************************************
**
** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
**
****************************************************************************/

// **********************************************************************
// NOTE: the sections are not ordered by their logical order to avoid
// reshuffling the file each time the index order changes (i.e., often).
// Run the fixnavi.pl script to adjust the links to the index order.
// **********************************************************************

/*!
//! [cmake build configuration]

    \section2 CMake Build Configuration

    \image qtcreator-cmake-build-settings.png

    Setting names with a common prefix (up to the first underscore character)
    are grouped under the prefix. To view all settings, select the
    \uicontrol Advanced check box.

    To add build settings, select \uicontrol Add, and then select the type of
    the setting that you are adding: \uicontrol Boolean, \uicontrol String,
    \uicontrol Directory, or \uicontrol File.

    To change the type of the selected setting, select
    \uicontrol {Force to bool}, \uicontrol {Force to file},
    \uicontrol {Force to directory}, or \uicontrol {Force to string}.

    To modify the value of a build setting, double-click it, or select it,
    and then select \uicontrol Edit. To save the changes, select
    \uicontrol {Apply Configuration Changes}. Keep in mind that a
    configuration change might trigger a follow-up configuration change.

    To remove a setting, select \uicontrol Unset.

    To reset the changes that you made, select \uicontrol Reset.

//! [cmake build configuration]


//! [cmake build steps]

    \section2 CMake Build Steps

    \QC builds CMake projects by running \c {cmake . --build}, which then runs
    run whatever is needed based on how the project was configured: \c make,
    \c mingw32-make, \c nmake, or \c ninja, for example.

    You can add arguments and targets for the build command in
    \uicontrol {Build Steps}.

    \image qtcreator-cmake-build-steps.png

    \note While the other CMake generators are installed together with Qt,
    you usually need to install Ninja yourself. For more information, see
    \l {Using Ninja as a CMake Generator}.

//! [cmake build steps]


//! [cmake ninja]

    \section2 Using Ninja as a CMake Generator

    To use \l {https://ninja-build.org/}{Ninja} with CMake, you must install it
    and select it as the CMake generator in the build and run kit:

    \list 1
        \li Install Ninja.
        \li Add the path to the Ninja executable to the value of the PATH system
            variable.
        \li Select \uicontrol Tools > \uicontrol Options > \uicontrol Kits, and
            then select the build and run kit for the project.
        \li Select \uicontrol Change next to the \uicontrol {CMake generator}
            field to open the \uicontrol {CMake Generator} dialog.
            \image qtcreator-build-steps-cmake-ninja.png
        \li In the \uicontrol Generator field, select \uicontrol Ninja.
        \li Select \uicontrol OK to return to the \uicontrol Kits tab.
        \li Select \uicontrol OK or \uicontrol Apply to save your changes.
    \endlist

    \note To make sure that old build artifacts don't get in the way
    the first time you build the project after the change, select
    \uicontrol Build > \uicontrol {Rebuild Project}. This cleans up the
    build directory and performs a new build.

//! [cmake ninja]


//! [cmake clean steps]

    \section2 CMake Clean Steps

    When building with CMake, you can add arguments and targets for the clean
    command in \uicontrol {Clean Steps}.

    \image qtcreator-cmake-clean-steps.png

    The build errors and warnings are parsed and displayed in the
    \uicontrol Issues output pane.

//! [cmake clean steps]
*/