diff --git a/doc/images/qtcreator-cmake-build-settings.png b/doc/images/qtcreator-cmake-build-settings.png index 512d002df90..2c2af74c6d0 100644 Binary files a/doc/images/qtcreator-cmake-build-settings.png and b/doc/images/qtcreator-cmake-build-settings.png differ diff --git a/doc/images/qtcreator-cmake-build-steps.png b/doc/images/qtcreator-cmake-build-steps.png new file mode 100644 index 00000000000..1679217c51e Binary files /dev/null and b/doc/images/qtcreator-cmake-build-steps.png differ diff --git a/doc/images/qtcreator-cmake-clean-steps.png b/doc/images/qtcreator-cmake-clean-steps.png new file mode 100644 index 00000000000..9ecfbc74f11 Binary files /dev/null and b/doc/images/qtcreator-cmake-clean-steps.png differ diff --git a/doc/images/qtcreator-cmake-import-wizard1.png b/doc/images/qtcreator-cmake-import-wizard1.png deleted file mode 100644 index 9749ed9ffa6..00000000000 Binary files a/doc/images/qtcreator-cmake-import-wizard1.png and /dev/null differ diff --git a/doc/images/qtcreator-cmake-import-wizard2.png b/doc/images/qtcreator-cmake-import-wizard2.png deleted file mode 100644 index 574bb9a0553..00000000000 Binary files a/doc/images/qtcreator-cmake-import-wizard2.png and /dev/null differ diff --git a/doc/images/qtcreator-cmake-run-cmake.png b/doc/images/qtcreator-cmake-run-cmake.png new file mode 100644 index 00000000000..c778ea45116 Binary files /dev/null and b/doc/images/qtcreator-cmake-run-cmake.png differ diff --git a/doc/images/qtcreator-cmake-run-settings.png b/doc/images/qtcreator-cmake-run-settings.png new file mode 100644 index 00000000000..229bdae6dd1 Binary files /dev/null and b/doc/images/qtcreator-cmake-run-settings.png differ diff --git a/doc/images/qtcreator-cmakeexecutable.png b/doc/images/qtcreator-cmakeexecutable.png index 711c2f708ce..c50c05a20bb 100644 Binary files a/doc/images/qtcreator-cmakeexecutable.png and b/doc/images/qtcreator-cmakeexecutable.png differ diff --git a/doc/images/qtcreator-kits.png b/doc/images/qtcreator-kits.png index 13bc784a763..1a3d5e1336c 100644 Binary files a/doc/images/qtcreator-kits.png and b/doc/images/qtcreator-kits.png differ diff --git a/doc/src/overview/creator-issues.qdoc b/doc/src/overview/creator-issues.qdoc index 48b8e29cd0a..06212266fad 100644 --- a/doc/src/overview/creator-issues.qdoc +++ b/doc/src/overview/creator-issues.qdoc @@ -109,8 +109,6 @@ items with names consisting of plain characters, numbers, underscores, and hyphens. - \li Creating new CMake projects with \QC is not supported. - \li If error messages displayed in the \uicontrol {Compile Output} pane contain paths where slashes are missing (for example, C:QtSDK), check your PATH variable. For more information, see diff --git a/doc/src/projects/creator-projects-cmake.qdoc b/doc/src/projects/creator-projects-cmake.qdoc index 8f406a69ee3..74ea95c0e27 100644 --- a/doc/src/projects/creator-projects-cmake.qdoc +++ b/doc/src/projects/creator-projects-cmake.qdoc @@ -43,38 +43,81 @@ native build configurations and workspaces that you can use in the compiler environment of your choice. - Since \QC 1.1, CMake configuration files are supported. Since \QC 1.3, the - Microsoft tool chain is supported if the CMake version is at least 2.8. - \QC automatically detects the CMake executable specified in the \c PATH. You can add paths to other CMake executables and use them in different build and run \l{glossary-buildandrun-kit}{kits}. \section1 Adding CMake Tools - To specify paths to CMake executables, select \uicontrol Tools > - \uicontrol Options > \uicontrol {Build & Run} > \uicontrol CMake > - \uicontrol Add. + \QC supports CMake version 2.9, or later. - \image qtcreator-cmakeexecutable.png + To specify paths to CMake executables and to add them to kits: + + \list 1 + + \li Select \uicontrol Tools > \uicontrol Options > + \uicontrol {Build & Run} > \uicontrol CMake > \uicontrol Add. + + \image qtcreator-cmakeexecutable.png + + \li In the \uicontrol Name field, specify a name for the tool. + + \li In the \uicontrol Path field, specify the path to the CMake + executable. + + \li Select \uicontrol Apply to save your changes. + + \li Select the \uicontrol Kits tab to add the CMake tool to a build and + run kit. The kit also specifies the CMake Generator that is used for + producing project files for \QC and the configuration variables that + are used: + + \image qtcreator-kits.png + + For more information, see \l {Adding Kits}. + + \endlist + + \section1 Creating CMake Projects + + To create a CMake project: + + \list 1 + + \li Select \uicontrol File > \uicontrol {New File or Project} > + \uicontrol {Non-Qt Project} > \uicontrol {Plain C Application} or + \uicontrol {Plain C++ Application} > \uicontrol Choose. + + \li In the \uicontrol Name field, enter a name for the project. + + \li In the \uicontrol {Create in} field, enter the path for the project + files, and then select \uicontrol Next (or \uicontrol Continue on + OS X). + + \li In the \uicontrol {Build system} field, select \uicontrol CMake, and + then select \uicontrol Next. + + \li Select CMake kits for the platforms that you want to build the + application for, and then select \uicontrol Next. + + \li Review the project settings, and click \uicontrol{Finish} (or + \uicontrol Done on OS X). + + \li Select \uicontrol {Run CMake} to generate a .cbp file. + + \image qtcreator-cmake-run-cmake.png + + Some projects require command line arguments to the initial CMake + call. CMake will remember the arguments during subsequent calls. + + \endlist + + \QC generates a \c {main.cpp} and \c {CMakeLists.txt} file that you can + modify in the \uicontrol Edit mode. \section1 Opening CMake Projects - \note Before you open a CMake project, you must modify the \c {PATH} - environment variable to include the bin folders of \c mingw and Qt. - - For instance, if Qt 5.5 is installed in \c {C:\Qt}, you would use the - following command to set the environment variables in the command line - prompt: - \code - set PATH=C:\Qt\Tools\mingw\bin;C:\Qt\5.5\\bin; - \endcode - Then start \QC by typing: - \code - C:\Qt\Tools\QtCreator\qtcreator.exe - \endcode - - To open a CMake project: + To open an existing CMake project: \list 1 @@ -82,28 +125,22 @@ \li Select the \c {CMakeLists.txt} file from your CMake project. + \li Select a kit that is configured to use CMake for building the + project. + + \li In \uicontrol Projects, right-click the project name to open the + context menu, and then select \uicontrol {Run CMake} to have the + project contents listed in the view. + \endlist - A wizard guides you through the rest of the process. - - \note If the CMake project does not have an in-place build, \QC - lets you specify the directory in which the project is built - (\l{glossary-shadow-build}{shadow build}). - - \image qtcreator-cmake-import-wizard1.png - - The screenshot below shows how you can specify command line arguments to - CMake for your project. - - \image qtcreator-cmake-import-wizard2.png - - Normally, there is no need to pass any command line arguments for projects - that are already built, as CMake caches that information. - \section1 Editing CMake Configuration Files - You can open CMake configuration files in \QC for editing. The following - features are supported: + To open a CMakeLists.txt file for editing, right-click it in the + \uicontrol Projects view and select \uicontrol {Open with} > + \uicontrol {CMake Editor}. + + The following features are supported: \list @@ -119,31 +156,55 @@ \section1 Building CMake Projects - \QC builds CMake projects by running \c make, \c mingw32-make, - \c nmake, or \c ninja depending on your platform. The build errors and - warnings are parsed and displayed in the \uicontrol Issues output pane. + To build CMake projects, select \uicontrol {Build Project} or press + \key Ctrl+B (or \key Cmd+B on OS X). - By default, \QC uses the \uicontrol All \l{glossary-build-config} + \QC builds CMake projects by running \c make, \c mingw32-make, \c nmake, or + \c ninja depending on the selected kit. + + By default, \QC uses the \uicontrol Default \l{glossary-build-config} {build configuration}. You can select another build configuration in - \uicontrol Projects > \uicontrol {Edit build configuration}. In addition to + \uicontrol Projects > \uicontrol {Build Settings} > + \uicontrol {Edit build configuration}. In addition to debug and release build configurations, you can create a release build that contains debug information or a release build with the smallest possible size. \image qtcreator-cmake-build-settings.png - You can change the build directory after the initial import. + In the \uicontrol {Build directory} field, you can specify the directory in + which the project is built (\l{glossary-shadow-build}{shadow build}). - The build and run kit that you select determines which CMake tool is used - for building. For more information, see \l {Adding Kits}. + To view all settings, select the \uicontrol Advanced check box. + + To modify the value of a build setting, select it, and then select + \uicontrol Edit. The new value is displayed in italics until you save the + changes by selecting \uicontrol {Apply Configuration Changes}. Any + configuration change might trigger a follow-up configuration change, so keep + saving until no more values are displayed in italics. + + You can add arguments and targets for the build command in + \uicontrol {Build Steps}. + + \image qtcreator-cmake-build-steps.png + + 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. \section1 Running CMake Projects \QC automatically adds \uicontrol {Run Configurations} for all targets specified in the CMake project file. - For more information about known issues for the current version, see - \l{Known Issues}. + \image qtcreator-cmake-run-settings.png + + To run CMake projects, select \uicontrol Run or press \key Ctrl+R (or + \key Cmd+R on OS X). \section1 Deploying CMake Projects to Embedded Linux Devices diff --git a/doc/src/projects/creator-projects-targets.qdoc b/doc/src/projects/creator-projects-targets.qdoc index 2a34e6df341..d332355e5a7 100644 --- a/doc/src/projects/creator-projects-targets.qdoc +++ b/doc/src/projects/creator-projects-targets.qdoc @@ -126,6 +126,16 @@ CMake tools to the list. For more information, see \l{Adding CMake Tools}. + \li In the \uicontrol {CMake Generator} field, select the CMake + Generator to use for producing project files. Only the generators + with names beginning with the string \uicontrol CodeBlocks produce + all the necessary data for the \QC code model. \QC displays a + warning if you select a generator that is not supported. + + \li In the \uicontrol {CMake configuration} field, select + \uicontrol Change to edit the variables of the CMake configuration + for the kit. + \endlist */