CMake: Handle STATIC types in CMakeCache.txt

Read STATIC types, but never write them out to the user. They are
still useful for Creator-internal sanity checks.

Change-Id: I8a13820291378de2370761be537f78fba1e45a0f
Reviewed-by: Vikas Pachdha <vikas.pachdha@theqtcompany.com>
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
Tobias Hunger
2016-04-08 14:14:03 +02:00
committed by Tobias Hunger
parent 12708d9b25
commit 42385146c7
3 changed files with 8 additions and 3 deletions

View File

@@ -207,7 +207,10 @@ QList<ConfigModel::DataItem> CMakeBuildConfiguration::completeCMakeConfiguration
m_completeConfigurationCache = m_buildDirManager->parsedConfiguration();
CMakeConfig cache = Utils::filtered(m_completeConfigurationCache,
[](const CMakeConfigItem &i) { return i.type != CMakeConfigItem::INTERNAL; });
[](const CMakeConfigItem &i) {
return i.type != CMakeConfigItem::INTERNAL
&& i.type != CMakeConfigItem::STATIC;
});
return Utils::transform(cache, [](const CMakeConfigItem &i) {
ConfigModel::DataItem j;
j.key = QString::fromUtf8(i.key);

View File

@@ -120,6 +120,8 @@ CMakeConfigItem CMakeConfigItem::fromString(const QString &s)
t = CMakeConfigItem::BOOL;
else if (type == QLatin1String("INTERNAL"))
t = CMakeConfigItem::INTERNAL;
else if (type == QLatin1String("STATIC"))
t = CMakeConfigItem::STATIC;
item.key = key.toUtf8();
item.type = t;
@@ -130,7 +132,7 @@ CMakeConfigItem CMakeConfigItem::fromString(const QString &s)
QString CMakeConfigItem::toString() const
{
if (key.isEmpty())
if (key.isEmpty() || type == CMakeProjectManager::CMakeConfigItem::STATIC)
return QString();
QString typeStr;

View File

@@ -34,7 +34,7 @@ namespace CMakeProjectManager {
class CMakeConfigItem {
public:
enum Type { FILEPATH, PATH, BOOL, STRING, INTERNAL };
enum Type { FILEPATH, PATH, BOOL, STRING, INTERNAL, STATIC };
CMakeConfigItem();
CMakeConfigItem(const CMakeConfigItem &other);
CMakeConfigItem(const QByteArray &k, Type t, const QByteArray &d, const QByteArray &v);