From d48fa5b8d6c797fb2637ada5fbb0009fd9847355 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Thu, 26 Sep 2019 15:47:54 +0200 Subject: Doc: Update info about building with CMake Change-Id: I30813c51deec50043c0015aef5a672babe6b5608 Reviewed-by: Cristian Adam Reviewed-by: Eike Ziller --- .../cmake/creator-projects-cmake-building.qdocinc | 6 ++++- doc/src/cmake/creator-projects-cmake.qdoc | 11 +++++++- doc/src/editors/creator-locator.qdoc | 5 ++++ .../creator-only/creator-projects-building.qdoc | 31 +++++++++++++++------- 4 files changed, 42 insertions(+), 11 deletions(-) (limited to 'doc/src') diff --git a/doc/src/cmake/creator-projects-cmake-building.qdocinc b/doc/src/cmake/creator-projects-cmake-building.qdocinc index bca11658e4..a31449984c 100644 --- a/doc/src/cmake/creator-projects-cmake-building.qdocinc +++ b/doc/src/cmake/creator-projects-cmake-building.qdocinc @@ -57,6 +57,10 @@ 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] @@ -65,7 +69,7 @@ \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, + 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 diff --git a/doc/src/cmake/creator-projects-cmake.qdoc b/doc/src/cmake/creator-projects-cmake.qdoc index 585031ded7..a6d0ad6671 100644 --- a/doc/src/cmake/creator-projects-cmake.qdoc +++ b/doc/src/cmake/creator-projects-cmake.qdoc @@ -61,6 +61,10 @@ provide less information to the code model, which will then fail to resolve 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: \list 1 @@ -99,9 +103,14 @@ \section1 Editing CMake Configuration Files 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}. + 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: \list diff --git a/doc/src/editors/creator-locator.qdoc b/doc/src/editors/creator-locator.qdoc index e7c048f6d2..cd99ab139b 100644 --- a/doc/src/editors/creator-locator.qdoc +++ b/doc/src/editors/creator-locator.qdoc @@ -150,6 +150,11 @@ \if defined(qtcreator) \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 \endlist diff --git a/doc/src/projects/creator-only/creator-projects-building.qdoc b/doc/src/projects/creator-only/creator-projects-building.qdoc index c87557dc69..86b8b61748 100644 --- a/doc/src/projects/creator-only/creator-projects-building.qdoc +++ b/doc/src/projects/creator-only/creator-projects-building.qdoc @@ -84,16 +84,18 @@ 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. + 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}. + Select \uicontrol Build > \uicontrol {Build for Run Configuration} to + 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 \uicontrol {Clean Project}. To clean the build directory and then build the project, select \uicontrol Build > \uicontrol {Rebuild All} or - \uicontrol {Rebuild Project}. If you use qmake, rebuilding also runs qmake - to generate new Makefiles between cleaning and building. + \uicontrol {Rebuild Project}. To build and clean projects without dependencies, select the \uicontrol {Build Without Dependencies}, @@ -101,11 +103,22 @@ \uicontrol {Clean Without Dependencies} options in the context menu in the \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 > - \uicontrol qmake. To prevent failures on incremental builds, it might make - sense to always run qmake before building, even though it means that + \section2 Building with CMake + + \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 > \uicontrol Options > \uicontrol {Build & Run} > \uicontrol qmake > \uicontrol {Run qmake on every build}. -- cgit v1.2.1