CMake: Turn CMakeConfigItem into a CMake argument

Add a method to turn a CMakeConfigItem into a string suitable to be passed
to CMake.

Change-Id: Ia7834f1c2fad387dd6e6eaa3863f93385d48ca71
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Tobias Hunger
2016-10-17 14:29:40 +02:00
parent cc9090891c
commit 17977b3de7
3 changed files with 7 additions and 25 deletions

View File

@@ -245,6 +245,11 @@ QString CMakeConfigItem::toString(const Utils::MacroExpander *expander) const
return QString::fromUtf8(key) + QLatin1Char(':') + typeStr + QLatin1Char('=') + expandedValue;
}
QString CMakeConfigItem::toArgument(const Utils::MacroExpander *expander) const
{
return "-D" + toString(expander);
}
bool CMakeConfigItem::operator==(const CMakeConfigItem &o) const
{
// type, isAdvanced and documentation do not matter for a match!