Doc: Update info about building with CMake

Change-Id: I30813c51deec50043c0015aef5a672babe6b5608
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Leena Miettinen
2019-09-26 15:47:54 +02:00
parent 3228d2626f
commit d48fa5b8d6
9 changed files with 42 additions and 11 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

@@ -57,6 +57,10 @@
To reset the changes that you made, select \uicontrol Reset. To reset the changes that you made, select \uicontrol Reset.
To reconfigure CMake, select \uicontrol Build >
\uicontrol {Clear CMake Configuration}, and then
select \uicontrol Build > \uicontrol {Rescan Project}.
//! [cmake build configuration] //! [cmake build configuration]
@@ -65,7 +69,7 @@
\section2 CMake Build Steps \section2 CMake Build Steps
\QC builds CMake projects by running \c {cmake . --build}, which then runs \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, whatever is needed based on how the project was configured: \c make,
\c mingw32-make, \c nmake, or \c ninja, for example. \c mingw32-make, \c nmake, or \c ninja, for example.
You can add arguments and targets for the build command in You can add arguments and targets for the build command in

View File

@@ -61,6 +61,10 @@
provide less information to the code model, which will then fail to resolve provide less information to the code model, which will then fail to resolve
includes and defines. includes and defines.
For CMake version 3.14, or later, \QC supports the
\l {https://cmake.org/cmake/help/latest/manual/cmake-file-api.7.html}
{file-based API}.
To specify paths to CMake executables: To specify paths to CMake executables:
\list 1 \list 1
@@ -99,9 +103,14 @@
\section1 Editing CMake Configuration Files \section1 Editing CMake Configuration Files
To open a CMakeLists.txt file for editing, right-click it in the To open a CMakeLists.txt file for editing, right-click it in the
\uicontrol Projects view and select \uicontrol {Open with} > \uicontrol Projects view and select \uicontrol {Open With} >
\uicontrol {CMake Editor}. \uicontrol {CMake Editor}.
You can also use the \c cmo filter in the \l {Searching with the Locator}
{locator} to open the CMakeLists.txt file for the current run configuration
in the editor. This is the same build target as when you select
\uicontrol Build > \uicontrol {Build for Run Configuration}.
The following features are supported: The following features are supported:
\list \list

View File

@@ -150,6 +150,11 @@
\if defined(qtcreator) \if defined(qtcreator)
\li Running external tools (\c x) \li Running external tools (\c x)
\li Using CMake to build the project for the current run configuration
(\c {cm}). For more information, see \l {Setting up CMake}.
\li Opening the CMakeLists.txt file for the current run configuration in
the editor (\c {cmo}). This is the same build target as when you
select \uicontrol Build > \uicontrol {Build for Run Configuration}.
\endif \endif
\endlist \endlist

View File

@@ -84,16 +84,18 @@
To quickly check the compile output for changes that you made in one file or To quickly check the compile output for changes that you made in one file or
subproject, you can use the \uicontrol Build menu commands to build a file or subproject, you can use the \uicontrol Build menu commands to build a file or
subproject. subproject. The available build menu commands depend on the build system
you selected for the project: CMake, qmake, or Qbs.
To build the executable that corresponds to the selected run configuration, Select \uicontrol Build > \uicontrol {Build for Run Configuration} to
select \uicontrol Build > \uicontrol {Build for Run Configuration}. build the executable that corresponds to the selected run configuration.
You can also use the \c cm filter in the \l {Searching with the Locator}
{locator}.
To remove all build artifacts, select \uicontrol Build > \uicontrol {Clean All} or To remove all build artifacts, select \uicontrol Build > \uicontrol {Clean All} or
\uicontrol {Clean Project}. To clean the build directory and then build \uicontrol {Clean Project}. To clean the build directory and then build
the project, select \uicontrol Build > \uicontrol {Rebuild All} or the project, select \uicontrol Build > \uicontrol {Rebuild All} or
\uicontrol {Rebuild Project}. If you use qmake, rebuilding also runs qmake \uicontrol {Rebuild Project}.
to generate new Makefiles between cleaning and building.
To build and clean projects without dependencies, select the To build and clean projects without dependencies, select the
\uicontrol {Build Without Dependencies}, \uicontrol {Build Without Dependencies},
@@ -101,11 +103,22 @@
\uicontrol {Clean Without Dependencies} options in the context menu in the \uicontrol {Clean Without Dependencies} options in the context menu in the
\uicontrol Projects view. \uicontrol Projects view.
\section1 Additional qmake Commands To run qmake or CMake to regenerate build system files, select
\uicontrol Build > \uicontrol {Run qmake} or \uicontrol {Run CMake}.
To run qmake to generate new Makefiles, select \uicontrol Build > \section2 Building with CMake
\uicontrol qmake. To prevent failures on incremental builds, it might make
sense to always run qmake before building, even though it means that \QC automatically runs CMake when you make changes to \c {CMakeLists.txt}
files. To disable this feature, select \uicontrol Tools >
\uicontrol Options > \uicontrol Kits > \uicontrol CMake >
\uicontrol {Autorun CMake}.
For more information, see \l {Setting Up CMake}.
\section2 Building with qmake
To prevent failures on incremental builds, it might make sense
to always run qmake before building, even though it means that
building will take more time. To enable this option, select \uicontrol Tools building will take more time. To enable this option, select \uicontrol Tools
> \uicontrol Options > \uicontrol {Build & Run} > \uicontrol qmake > > \uicontrol Options > \uicontrol {Build & Run} > \uicontrol qmake >
\uicontrol {Run qmake on every build}. \uicontrol {Run qmake on every build}.