Doc: Update CMake information
- Add and remove screen shots - Remove info about an obsolete wizard - Add information about using wizards to create CMake projects - Describe new fields in the Kits tab - Describe the new build settings Change-Id: I156e3b1a6cb35a284da5e25eabb134cc52b4d84e Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 24 KiB |
BIN
doc/images/qtcreator-cmake-build-steps.png
Normal file
After Width: | Height: | Size: 7.8 KiB |
BIN
doc/images/qtcreator-cmake-clean-steps.png
Normal file
After Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 19 KiB |
BIN
doc/images/qtcreator-cmake-run-cmake.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
doc/images/qtcreator-cmake-run-settings.png
Normal file
After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 22 KiB |
@@ -109,8 +109,6 @@
|
|||||||
items with names consisting of plain characters, numbers,
|
items with names consisting of plain characters, numbers,
|
||||||
underscores, and hyphens.
|
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
|
\li If error messages displayed in the \uicontrol {Compile Output} pane contain
|
||||||
paths where slashes are missing (for example, C:QtSDK),
|
paths where slashes are missing (for example, C:QtSDK),
|
||||||
check your PATH variable. For more information, see
|
check your PATH variable. For more information, see
|
||||||
|
@@ -43,38 +43,81 @@
|
|||||||
native build configurations and workspaces that you can use in the compiler
|
native build configurations and workspaces that you can use in the compiler
|
||||||
environment of your choice.
|
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.
|
\QC automatically detects the CMake executable specified in the \c PATH.
|
||||||
You can add paths to other CMake executables and use them in different
|
You can add paths to other CMake executables and use them in different
|
||||||
build and run \l{glossary-buildandrun-kit}{kits}.
|
build and run \l{glossary-buildandrun-kit}{kits}.
|
||||||
|
|
||||||
\section1 Adding CMake Tools
|
\section1 Adding CMake Tools
|
||||||
|
|
||||||
To specify paths to CMake executables, select \uicontrol Tools >
|
\QC supports CMake version 2.9, or later.
|
||||||
\uicontrol Options > \uicontrol {Build & Run} > \uicontrol CMake >
|
|
||||||
\uicontrol Add.
|
|
||||||
|
|
||||||
\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
|
\section1 Opening CMake Projects
|
||||||
|
|
||||||
\note Before you open a CMake project, you must modify the \c {PATH}
|
To open an existing CMake project:
|
||||||
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<VERSION>\bin;C:\Qt\5.5\<TARGET>\bin;
|
|
||||||
\endcode
|
|
||||||
Then start \QC by typing:
|
|
||||||
\code
|
|
||||||
C:\Qt\Tools\QtCreator\qtcreator.exe
|
|
||||||
\endcode
|
|
||||||
|
|
||||||
To open a CMake project:
|
|
||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
|
|
||||||
@@ -82,28 +125,22 @@
|
|||||||
|
|
||||||
\li Select the \c {CMakeLists.txt} file from your CMake project.
|
\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
|
\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
|
\section1 Editing CMake Configuration Files
|
||||||
|
|
||||||
You can open CMake configuration files in \QC for editing. The following
|
To open a CMakeLists.txt file for editing, right-click it in the
|
||||||
features are supported:
|
\uicontrol Projects view and select \uicontrol {Open with} >
|
||||||
|
\uicontrol {CMake Editor}.
|
||||||
|
|
||||||
|
The following features are supported:
|
||||||
|
|
||||||
\list
|
\list
|
||||||
|
|
||||||
@@ -119,31 +156,55 @@
|
|||||||
|
|
||||||
\section1 Building CMake Projects
|
\section1 Building CMake Projects
|
||||||
|
|
||||||
\QC builds CMake projects by running \c make, \c mingw32-make,
|
To build CMake projects, select \uicontrol {Build Project} or press
|
||||||
\c nmake, or \c ninja depending on your platform. The build errors and
|
\key Ctrl+B (or \key Cmd+B on OS X).
|
||||||
warnings are parsed and displayed in the \uicontrol Issues output pane.
|
|
||||||
|
|
||||||
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
|
{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
|
debug and release build configurations, you can create a release build that
|
||||||
contains debug information or a release build with the smallest possible
|
contains debug information or a release build with the smallest possible
|
||||||
size.
|
size.
|
||||||
|
|
||||||
\image qtcreator-cmake-build-settings.png
|
\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
|
To view all settings, select the \uicontrol Advanced check box.
|
||||||
for building. For more information, see \l {Adding Kits}.
|
|
||||||
|
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
|
\section1 Running CMake Projects
|
||||||
|
|
||||||
\QC automatically adds \uicontrol {Run Configurations} for all targets
|
\QC automatically adds \uicontrol {Run Configurations} for all targets
|
||||||
specified in the CMake project file.
|
specified in the CMake project file.
|
||||||
|
|
||||||
For more information about known issues for the current version, see
|
\image qtcreator-cmake-run-settings.png
|
||||||
\l{Known Issues}.
|
|
||||||
|
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
|
\section1 Deploying CMake Projects to Embedded Linux Devices
|
||||||
|
|
||||||
|
@@ -126,6 +126,16 @@
|
|||||||
CMake tools to the list. For more information, see
|
CMake tools to the list. For more information, see
|
||||||
\l{Adding CMake Tools}.
|
\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
|
\endlist
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|