CMakePM: Proper handling of the extra generator

CMake fails if it has -DCMAKE_GENERATOR:STRING=CodeBlocks - Ninja

It expects separate values:
  -DCMAKE_EXTRA_GENERATOR:STRING=CodeBlocks
  -DCMAKE_GENERATOR:STRING=Ninja

Fixes: QTCREATORBUG-27060
Change-Id: Ia2b5bdc425e569118d689b7223fbef5f953d98a7
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Cristian Adam
2022-02-22 18:16:24 +01:00
parent 59d659b2ef
commit 2f77dc3415
2 changed files with 20 additions and 7 deletions

View File

@@ -668,11 +668,10 @@ CMakeConfig CMakeGeneratorKitAspect::generatorCMakeConfig(const ProjectExplorer:
if (info.generator.isEmpty())
return config;
if (info.extraGenerator.isEmpty())
config << CMakeConfigItem("CMAKE_GENERATOR", info.generator.toUtf8());
else
config << CMakeConfigItem("CMAKE_GENERATOR",
(info.extraGenerator + " - " + info.generator).toUtf8());
config << CMakeConfigItem("CMAKE_GENERATOR", info.generator.toUtf8());
if (!info.extraGenerator.isEmpty())
config << CMakeConfigItem("CMAKE_EXTRA_GENERATOR", info.extraGenerator.toUtf8());
if (!info.platform.isEmpty())
config << CMakeConfigItem("CMAKE_GENERATOR_PLATFORM", info.platform.toUtf8());