diff options
author | Leena Miettinen <riitta-leena.miettinen@qt.io> | 2023-03-09 15:05:01 +0100 |
---|---|---|
committer | Leena Miettinen <riitta-leena.miettinen@qt.io> | 2023-03-09 14:40:40 +0000 |
commit | d299edfe0528489e8453d18941a85c91c9b59686 (patch) | |
tree | f3cc14fc880281256362ee58e00d8ed73ac0d2c3 | |
parent | c7a67ab9e99ed6c363e391d47f10f3b7817b60b2 (diff) | |
download | qt-creator-d299edfe0528489e8453d18941a85c91c9b59686.tar.gz |
Doc: Add MSVC example for CMake presets using 'external' strategy
... for the architecture and toolset fields.
Task-number: QTCREATORBUG-28721
Change-Id: Ieac6c4bc1553204a1e34ea0ea05028e6e4975adc
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
-rw-r--r-- | doc/qtcreator/src/cmake/creator-projects-cmake-building.qdoc | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/doc/qtcreator/src/cmake/creator-projects-cmake-building.qdoc b/doc/qtcreator/src/cmake/creator-projects-cmake-building.qdoc index 1359eceda1..5d7d2fc6e8 100644 --- a/doc/qtcreator/src/cmake/creator-projects-cmake-building.qdoc +++ b/doc/qtcreator/src/cmake/creator-projects-cmake-building.qdoc @@ -189,6 +189,47 @@ \uicontrol Edit > \uicontrol Preferences > \uicontrol CMake > \uicontrol Tools. + \section2 MSVC Example + + When using MSVC compilers with NMAKE Makefiles, Ninja, or Ninja + Multi-Config generators, you can use the \c external strategy for + the \c architecture and \c toolset fields. This lets \QC set up + the Visual C++ environment before invoking CMake. + + For example: + + \badcode + "generator": "Ninja Multi-Config", + "toolset": { + "value": "v142,host=x64", + "strategy": "external" + }, + "architecture": { + "value": "x64", + "strategy": "external" + }, + \endcode + + If you use MSVC compilers with non-VS generators and have several compilers + in the \c PATH, you might also have to specify the compiler to use in + \c cacheVariables or \c environmentVariables: + + \badcode + "generator": "Ninja Multi-Config", + "toolset": { + "value": "v142,host=x64", + "strategy": "external" + }, + "architecture": { + "value": "x64", + "strategy": "external" + }, + "cacheVariables": { + "CMAKE_C_COMPILER": "cl.exe", + "CMAKE_CXX_COMPILER": "cl.exe" + } + \endcode + \section2 Using Conditions The following configure presets are used if they match \c condition. That is, |