CMake: Make it easier to get the expanded value of a CMake configuration

Change-Id: If289c48ef4ec2815e8bd12e08b990d1dc809c524
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
Tobias Hunger
2016-05-12 16:39:10 +02:00
parent a16bee8bc2
commit 5100454222
3 changed files with 13 additions and 1 deletions

View File

@@ -25,6 +25,9 @@
#include "cmakeconfigitem.h"
#include <projectexplorer/kit.h>
#include <utils/macroexpander.h>
#include <utils/qtcassert.h>
#include <QString>
@@ -60,6 +63,11 @@ QByteArray CMakeConfigItem::valueOf(const QByteArray &key, const QList<CMakeConf
return QByteArray();
}
QString CMakeConfigItem::expandedValue(const ProjectExplorer::Kit *k) const
{
return k->macroExpander()->expand(QString::fromUtf8(value));
}
std::function<bool (const CMakeConfigItem &a, const CMakeConfigItem &b)> CMakeConfigItem::sortOperator()
{
return [](const CMakeConfigItem &a, const CMakeConfigItem &b) { return a.key < b.key; };