diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2020-10-22 15:04:40 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-10-22 15:05:09 (GMT) |
commit | 609122007dc074739b394d2f70f674bbccca6073 (patch) | |
tree | 066983f69d1ac1a43b1da6750cdca6fe5f5446b0 /Source/QtDialog | |
parent | 6af1185bb4a4cdc826763ea38db0e59e5ed3ffd7 (diff) | |
parent | 638557cbfe0618d5a0fc6f9088e34aac708f5519 (diff) | |
download | CMake-609122007dc074739b394d2f70f674bbccca6073.zip CMake-609122007dc074739b394d2f70f674bbccca6073.tar.gz CMake-609122007dc074739b394d2f70f674bbccca6073.tar.bz2 |
Merge topic 'cmake-presets-invalid-macro' into release-3.19
638557cbfe CMakePresets.json: Properly report macro expansion errors
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5397
Diffstat (limited to 'Source/QtDialog')
-rw-r--r-- | Source/QtDialog/QCMake.cxx | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 9017a63..3789e93 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -157,8 +157,8 @@ void QCMake::setPreset(const QString& name, bool setBinary) if (!name.isNull()) { std::string presetName(name.toLocal8Bit()); - auto const& preset = this->CMakePresetsFile.Presets[presetName]; - auto expandedPreset = this->CMakePresetsFile.ExpandMacros(preset); + auto const& expandedPreset = + this->CMakePresetsFile.Presets[presetName].Expanded; if (expandedPreset) { if (setBinary) { QString binaryDir = @@ -420,8 +420,7 @@ QCMakePropertyList QCMake::properties() const if (!this->PresetName.isNull()) { std::string presetName(this->PresetName.toLocal8Bit()); - auto p = this->CMakePresetsFile.ExpandMacros( - this->CMakePresetsFile.Presets.at(presetName)); + auto const& p = this->CMakePresetsFile.Presets.at(presetName).Expanded; if (p) { for (auto const& v : p->CacheVariables) { if (!v.second) { @@ -537,7 +536,8 @@ void QCMake::loadPresets() QVector<QCMakePreset> presets; for (auto const& name : this->CMakePresetsFile.PresetOrder) { - auto const& p = this->CMakePresetsFile.Presets[name]; + auto const& it = this->CMakePresetsFile.Presets[name]; + auto const& p = it.Unexpanded; if (p.Hidden) { continue; } @@ -554,12 +554,12 @@ void QCMake::loadPresets() preset.toolset = std::move(QString::fromLocal8Bit(p.Toolset.data())); preset.setGenConfig = !p.GeneratorConfig || p.GeneratorConfig == cmCMakePresetsFile::CMakeGeneratorConfig::Default; - preset.enabled = std::find_if(this->AvailableGenerators.begin(), - this->AvailableGenerators.end(), - [&p](const cmake::GeneratorInfo& g) { - return g.name == p.Generator; - }) != this->AvailableGenerators.end() && - this->CMakePresetsFile.ExpandMacros(p); + preset.enabled = it.Expanded && + std::find_if(this->AvailableGenerators.begin(), + this->AvailableGenerators.end(), + [&p](const cmake::GeneratorInfo& g) { + return g.name == p.Generator; + }) != this->AvailableGenerators.end(); presets.push_back(preset); } emit this->presetsChanged(presets); |