Commit 2fe3e55d authored by Stephen Kelly's avatar Stephen Kelly

cmState: Move CacheEntryType enum to separate namespace

Port dependent code to the change.
parent a49751fb
Pipeline #31627 passed with stage
......@@ -11,7 +11,7 @@ cmCursesBoolWidget::cmCursesBoolWidget(int width, int height, int left,
int top)
: cmCursesWidget(width, height, left, top)
{
this->Type = cmState::BOOL;
this->Type = cmStateEnums::BOOL;
set_field_fore(this->Field, A_NORMAL);
set_field_back(this->Field, A_STANDOUT);
field_opts_off(this->Field, O_STATIC);
......
......@@ -47,7 +47,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
const char* value = cm->GetState()->GetCacheEntryValue(key);
assert(value);
switch (cm->GetState()->GetCacheEntryType(key)) {
case cmState::BOOL:
case cmStateEnums::BOOL:
this->Entry = new cmCursesBoolWidget(this->EntryWidth, 1, 1, 1);
if (cmSystemTools::IsOn(value)) {
static_cast<cmCursesBoolWidget*>(this->Entry)->SetValueAsBool(true);
......@@ -55,15 +55,15 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
static_cast<cmCursesBoolWidget*>(this->Entry)->SetValueAsBool(false);
}
break;
case cmState::PATH:
case cmStateEnums::PATH:
this->Entry = new cmCursesPathWidget(this->EntryWidth, 1, 1, 1);
static_cast<cmCursesPathWidget*>(this->Entry)->SetString(value);
break;
case cmState::FILEPATH:
case cmStateEnums::FILEPATH:
this->Entry = new cmCursesFilePathWidget(this->EntryWidth, 1, 1, 1);
static_cast<cmCursesFilePathWidget*>(this->Entry)->SetString(value);
break;
case cmState::STRING: {
case cmStateEnums::STRING: {
const char* stringsProp =
cm->GetState()->GetCacheEntryProperty(key, "STRINGS");
if (stringsProp) {
......@@ -83,7 +83,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
}
break;
}
case cmState::UNINITIALIZED:
case cmStateEnums::UNINITIALIZED:
cmSystemTools::Error("Found an undefined variable: ", key.c_str());
break;
default:
......
......@@ -9,7 +9,7 @@ cmCursesDummyWidget::cmCursesDummyWidget(int width, int height, int left,
int top)
: cmCursesWidget(width, height, left, top)
{
this->Type = cmState::INTERNAL;
this->Type = cmStateEnums::INTERNAL;
}
bool cmCursesDummyWidget::HandleInput(int& /*key*/, cmCursesMainForm* /*fm*/,
......
......@@ -9,5 +9,5 @@ cmCursesFilePathWidget::cmCursesFilePathWidget(int width, int height, int left,
int top)
: cmCursesPathWidget(width, height, left, top)
{
this->Type = cmState::FILEPATH;
this->Type = cmStateEnums::FILEPATH;
}
......@@ -106,10 +106,10 @@ void cmCursesMainForm::InitializeUI()
for (std::vector<std::string>::const_iterator it = cacheKeys.begin();
it != cacheKeys.end(); ++it) {
cmState::CacheEntryType t =
cmStateEnums::CacheEntryType t =
this->CMakeInstance->GetState()->GetCacheEntryType(*it);
if (t != cmState::INTERNAL && t != cmState::STATIC &&
t != cmState::UNINITIALIZED) {
if (t != cmStateEnums::INTERNAL && t != cmStateEnums::STATIC &&
t != cmStateEnums::UNINITIALIZED) {
++count;
}
}
......@@ -130,10 +130,10 @@ void cmCursesMainForm::InitializeUI()
for (std::vector<std::string>::const_iterator it = cacheKeys.begin();
it != cacheKeys.end(); ++it) {
std::string key = *it;
cmState::CacheEntryType t =
cmStateEnums::CacheEntryType t =
this->CMakeInstance->GetState()->GetCacheEntryType(*it);
if (t == cmState::INTERNAL || t == cmState::STATIC ||
t == cmState::UNINITIALIZED) {
if (t == cmStateEnums::INTERNAL || t == cmStateEnums::STATIC ||
t == cmStateEnums::UNINITIALIZED) {
continue;
}
......@@ -148,10 +148,10 @@ void cmCursesMainForm::InitializeUI()
for (std::vector<std::string>::const_iterator it = cacheKeys.begin();
it != cacheKeys.end(); ++it) {
std::string key = *it;
cmState::CacheEntryType t =
cmStateEnums::CacheEntryType t =
this->CMakeInstance->GetState()->GetCacheEntryType(*it);
if (t == cmState::INTERNAL || t == cmState::STATIC ||
t == cmState::UNINITIALIZED) {
if (t == cmStateEnums::INTERNAL || t == cmStateEnums::STATIC ||
t == cmStateEnums::UNINITIALIZED) {
continue;
}
......@@ -249,8 +249,9 @@ void cmCursesMainForm::Render(int left, int top, int width, int height)
cmCursesWidget* cw =
reinterpret_cast<cmCursesWidget*>(field_userptr(currentField));
// If in edit mode, get out of it
if (cw->GetType() == cmState::STRING || cw->GetType() == cmState::PATH ||
cw->GetType() == cmState::FILEPATH) {
if (cw->GetType() == cmStateEnums::STRING ||
cw->GetType() == cmStateEnums::PATH ||
cw->GetType() == cmStateEnums::FILEPATH) {
cmCursesStringWidget* sw = static_cast<cmCursesStringWidget*>(cw);
sw->SetInEdit(false);
}
......@@ -704,7 +705,7 @@ void cmCursesMainForm::FillCacheManagerFromUI()
std::string newValue = (*this->Entries)[i]->Entry->GetValue();
std::string fixedOldValue;
std::string fixedNewValue;
cmState::CacheEntryType t =
cmStateEnums::CacheEntryType t =
this->CMakeInstance->GetState()->GetCacheEntryType(cacheKey);
this->FixValue(t, oldValue, fixedOldValue);
this->FixValue(t, newValue, fixedNewValue);
......@@ -720,14 +721,14 @@ void cmCursesMainForm::FillCacheManagerFromUI()
}
}
void cmCursesMainForm::FixValue(cmState::CacheEntryType type,
void cmCursesMainForm::FixValue(cmStateEnums::CacheEntryType type,
const std::string& in, std::string& out) const
{
out = in.substr(0, in.find_last_not_of(' ') + 1);
if (type == cmState::PATH || type == cmState::FILEPATH) {
if (type == cmStateEnums::PATH || type == cmStateEnums::FILEPATH) {
cmSystemTools::ConvertToUnixSlashes(out);
}
if (type == cmState::BOOL) {
if (type == cmStateEnums::BOOL) {
if (cmSystemTools::IsOff(out.c_str())) {
out = "OFF";
} else {
......
......@@ -110,7 +110,7 @@ protected:
// cache.
void FillCacheManagerFromUI();
// Fix formatting of values to a consistent form.
void FixValue(cmState::CacheEntryType type, const std::string& in,
void FixValue(cmStateEnums::CacheEntryType type, const std::string& in,
std::string& out) const;
// Re-post the existing fields. Used to toggle between
// normal and advanced modes. Render() should be called
......
......@@ -11,7 +11,7 @@ cmCursesOptionsWidget::cmCursesOptionsWidget(int width, int height, int left,
int top)
: cmCursesWidget(width, height, left, top)
{
this->Type = cmState::BOOL; // this is a bit of a hack
this->Type = cmStateEnums::BOOL; // this is a bit of a hack
// there is no option type, and string type causes ccmake to cast
// the widget into a string widget at some point. BOOL is safe for
// now.
......
......@@ -13,7 +13,7 @@ cmCursesPathWidget::cmCursesPathWidget(int width, int height, int left,
int top)
: cmCursesStringWidget(width, height, left, top)
{
this->Type = cmState::PATH;
this->Type = cmStateEnums::PATH;
this->Cycle = false;
this->CurrentIndex = 0;
}
......@@ -50,7 +50,7 @@ void cmCursesPathWidget::OnTab(cmCursesMainForm* fm, WINDOW* w)
std::vector<std::string> dirs;
cmSystemTools::SimpleGlob(glob, dirs,
(this->Type == cmState::PATH ? -1 : 0));
(this->Type == cmStateEnums::PATH ? -1 : 0));
if (this->CurrentIndex < dirs.size()) {
cstr = dirs[this->CurrentIndex];
}
......
......@@ -21,7 +21,7 @@ cmCursesStringWidget::cmCursesStringWidget(int width, int height, int left,
: cmCursesWidget(width, height, left, top)
{
this->InEdit = false;
this->Type = cmState::STRING;
this->Type = cmStateEnums::STRING;
set_field_fore(this->Field, A_NORMAL);
set_field_back(this->Field, A_STANDOUT);
field_opts_off(this->Field, O_STATIC);
......
......@@ -41,7 +41,7 @@ public:
/**
* Get the type of the widget (STRING, PATH etc...)
*/
cmState::CacheEntryType GetType() { return this->Type; }
cmStateEnums::CacheEntryType GetType() { return this->Type; }
/**
* If there are any, print the widget specific commands
......@@ -62,7 +62,7 @@ protected:
cmCursesWidget(const cmCursesWidget& from);
void operator=(const cmCursesWidget&);
cmState::CacheEntryType Type;
cmStateEnums::CacheEntryType Type;
std::string Value;
FIELD* Field;
// The page in the main form this widget is in
......
......@@ -196,8 +196,8 @@ void QCMake::setProperties(const QCMakePropertyList& newProps)
std::vector<std::string> cacheKeys = state->GetCacheEntryKeys();
for (std::vector<std::string>::const_iterator it = cacheKeys.begin();
it != cacheKeys.end(); ++it) {
cmState::CacheEntryType t = state->GetCacheEntryType(*it);
if (t == cmState::INTERNAL || t == cmState::STATIC) {
cmStateEnums::CacheEntryType t = state->GetCacheEntryType(*it);
if (t == cmStateEnums::INTERNAL || t == cmStateEnums::STATIC) {
continue;
}
......@@ -232,19 +232,19 @@ void QCMake::setProperties(const QCMakePropertyList& newProps)
if (s.Type == QCMakeProperty::BOOL) {
this->CMakeInstance->AddCacheEntry(
s.Key.toLocal8Bit().data(), s.Value.toBool() ? "ON" : "OFF",
s.Help.toLocal8Bit().data(), cmState::BOOL);
s.Help.toLocal8Bit().data(), cmStateEnums::BOOL);
} else if (s.Type == QCMakeProperty::STRING) {
this->CMakeInstance->AddCacheEntry(
s.Key.toLocal8Bit().data(), s.Value.toString().toLocal8Bit().data(),
s.Help.toLocal8Bit().data(), cmState::STRING);
s.Help.toLocal8Bit().data(), cmStateEnums::STRING);
} else if (s.Type == QCMakeProperty::PATH) {
this->CMakeInstance->AddCacheEntry(
s.Key.toLocal8Bit().data(), s.Value.toString().toLocal8Bit().data(),
s.Help.toLocal8Bit().data(), cmState::PATH);
s.Help.toLocal8Bit().data(), cmStateEnums::PATH);
} else if (s.Type == QCMakeProperty::FILEPATH) {
this->CMakeInstance->AddCacheEntry(
s.Key.toLocal8Bit().data(), s.Value.toString().toLocal8Bit().data(),
s.Help.toLocal8Bit().data(), cmState::FILEPATH);
s.Help.toLocal8Bit().data(), cmStateEnums::FILEPATH);
}
}
......@@ -259,9 +259,9 @@ QCMakePropertyList QCMake::properties() const
std::vector<std::string> cacheKeys = state->GetCacheEntryKeys();
for (std::vector<std::string>::const_iterator i = cacheKeys.begin();
i != cacheKeys.end(); ++i) {
cmState::CacheEntryType t = state->GetCacheEntryType(*i);
if (t == cmState::INTERNAL || t == cmState::STATIC ||
t == cmState::UNINITIALIZED) {
cmStateEnums::CacheEntryType t = state->GetCacheEntryType(*i);
if (t == cmStateEnums::INTERNAL || t == cmStateEnums::STATIC ||
t == cmStateEnums::UNINITIALIZED) {
continue;
}
......@@ -273,14 +273,14 @@ QCMakePropertyList QCMake::properties() const
QString::fromLocal8Bit(state->GetCacheEntryProperty(*i, "HELPSTRING"));
prop.Value = QString::fromLocal8Bit(cachedValue);
prop.Advanced = state->GetCacheEntryPropertyAsBool(*i, "ADVANCED");
if (t == cmState::BOOL) {
if (t == cmStateEnums::BOOL) {
prop.Type = QCMakeProperty::BOOL;
prop.Value = cmSystemTools::IsOn(cachedValue);
} else if (t == cmState::PATH) {
} else if (t == cmStateEnums::PATH) {
prop.Type = QCMakeProperty::PATH;
} else if (t == cmState::FILEPATH) {
} else if (t == cmStateEnums::FILEPATH) {
prop.Type = QCMakeProperty::FILEPATH;
} else if (t == cmState::STRING) {
} else if (t == cmStateEnums::STRING) {
prop.Type = QCMakeProperty::STRING;
const char* stringsProperty =
state->GetCacheEntryProperty(*i, "STRINGS");
......
......@@ -116,6 +116,6 @@ bool cmBuildCommand::TwoArgsSignature(std::vector<std::string> const& args)
this->Makefile->AddCacheDefinition(define, makecommand.c_str(),
"Command used to build entire project "
"from the command line.",
cmState::STRING);
cmStateEnums::STRING);
return true;
}
......@@ -27,7 +27,7 @@ bool cmBuildNameCommand::InitialPass(std::vector<std::string> const& args,
std::replace(cv.begin(), cv.end(), '(', '_');
std::replace(cv.begin(), cv.end(), ')', '_');
this->Makefile->AddCacheDefinition(args[0], cv.c_str(), "Name of build.",
cmState::STRING);
cmStateEnums::STRING);
}
return true;
}
......@@ -53,6 +53,6 @@ bool cmBuildNameCommand::InitialPass(std::vector<std::string> const& args,
std::replace(buildname.begin(), buildname.end(), ')', '_');
this->Makefile->AddCacheDefinition(args[0], buildname.c_str(),
"Name of build.", cmState::STRING);
"Name of build.", cmStateEnums::STRING);
return true;
}
......@@ -79,7 +79,7 @@ bool cmCMakePolicyCommand::HandleSetMode(std::vector<std::string> const& args)
"For backwards compatibility, what version of CMake "
"commands and "
"syntax should this version of CMake try to support.",
cmState::STRING);
cmStateEnums::STRING);
}
}
return true;
......
......@@ -75,22 +75,22 @@ void CCONV cmAddCacheDefinition(void* arg, const char* name, const char* value,
switch (type) {
case CM_CACHE_BOOL:
mf->AddCacheDefinition(name, value, doc, cmState::BOOL);
mf->AddCacheDefinition(name, value, doc, cmStateEnums::BOOL);
break;
case CM_CACHE_PATH:
mf->AddCacheDefinition(name, value, doc, cmState::PATH);
mf->AddCacheDefinition(name, value, doc, cmStateEnums::PATH);
break;
case CM_CACHE_FILEPATH:
mf->AddCacheDefinition(name, value, doc, cmState::FILEPATH);
mf->AddCacheDefinition(name, value, doc, cmStateEnums::FILEPATH);
break;
case CM_CACHE_STRING:
mf->AddCacheDefinition(name, value, doc, cmState::STRING);
mf->AddCacheDefinition(name, value, doc, cmStateEnums::STRING);
break;
case CM_CACHE_INTERNAL:
mf->AddCacheDefinition(name, value, doc, cmState::INTERNAL);
mf->AddCacheDefinition(name, value, doc, cmStateEnums::INTERNAL);
break;
case CM_CACHE_STATIC:
mf->AddCacheDefinition(name, value, doc, cmState::STATIC);
mf->AddCacheDefinition(name, value, doc, cmStateEnums::STATIC);
break;
}
}
......
......@@ -1969,7 +1969,7 @@ bool cmCTest::AddVariableDefinition(const std::string& arg)
{
std::string name;
std::string value;
cmState::CacheEntryType type = cmState::UNINITIALIZED;
cmStateEnums::CacheEntryType type = cmStateEnums::UNINITIALIZED;
if (cmake::ParseCacheEntry(arg, name, value, type)) {
this->Definitions[name] = value;
......
......@@ -94,13 +94,13 @@ bool cmCacheManager::LoadCache(const std::string& path, bool internal,
// If the entry is not internal to the cache being loaded
// or if it is in the list of internal entries to be
// imported, load it.
if (internal || (e.Type != cmState::INTERNAL) ||
if (internal || (e.Type != cmStateEnums::INTERNAL) ||
(includes.find(entryKey) != includes.end())) {
// If we are loading the cache from another project,
// make all loaded entries internal so that it is
// not visible in the gui
if (!internal) {
e.Type = cmState::INTERNAL;
e.Type = cmStateEnums::INTERNAL;
helpString = "DO NOT EDIT, ";
helpString += entryKey;
helpString += " loaded from external file. "
......@@ -142,11 +142,11 @@ bool cmCacheManager::LoadCache(const std::string& path, bool internal,
this->AddCacheEntry("CMAKE_CACHE_MINOR_VERSION", "0",
"Minor version of cmake used to create the "
"current loaded cache",
cmState::INTERNAL);
cmStateEnums::INTERNAL);
this->AddCacheEntry("CMAKE_CACHE_MAJOR_VERSION", "0",
"Major version of cmake used to create the "
"current loaded cache",
cmState::INTERNAL);
cmStateEnums::INTERNAL);
}
// check to make sure the cache directory has not
// been moved
......@@ -178,7 +178,7 @@ bool cmCacheManager::ReadPropertyEntry(std::string const& entryKey,
CacheEntry& e)
{
// All property entries are internal.
if (e.Type != cmState::INTERNAL) {
if (e.Type != cmStateEnums::INTERNAL) {
return false;
}
......@@ -192,7 +192,7 @@ bool cmCacheManager::ReadPropertyEntry(std::string const& entryKey,
if (it.IsAtEnd()) {
// Create an entry and store the property.
CacheEntry& ne = this->Cache[key];
ne.Type = cmState::UNINITIALIZED;
ne.Type = cmStateEnums::UNINITIALIZED;
ne.SetProperty(*p, e.Value.c_str());
} else {
// Store this property on its entry.
......@@ -244,17 +244,17 @@ bool cmCacheManager::SaveCache(const std::string& path)
this->AddCacheEntry("CMAKE_CACHE_MINOR_VERSION", temp,
"Minor version of cmake used to create the "
"current loaded cache",
cmState::INTERNAL);
cmStateEnums::INTERNAL);
sprintf(temp, "%d", cmVersion::GetMajorVersion());
this->AddCacheEntry("CMAKE_CACHE_MAJOR_VERSION", temp,
"Major version of cmake used to create the "
"current loaded cache",
cmState::INTERNAL);
cmStateEnums::INTERNAL);
sprintf(temp, "%d", cmVersion::GetPatchVersion());
this->AddCacheEntry("CMAKE_CACHE_PATCH_VERSION", temp,
"Patch version of cmake used to create the "
"current loaded cache",
cmState::INTERNAL);
cmStateEnums::INTERNAL);
// Let us store the current working directory so that if somebody
// Copies it, he will not be surprised
......@@ -268,7 +268,7 @@ bool cmCacheManager::SaveCache(const std::string& path)
this->AddCacheEntry("CMAKE_CACHEFILE_DIR", currentcwd.c_str(),
"This is the directory where this CMakeCache.txt"
" was created",
cmState::INTERNAL);
cmStateEnums::INTERNAL);
/* clang-format off */
fout << "# This is the CMakeCache file.\n"
......@@ -301,14 +301,14 @@ bool cmCacheManager::SaveCache(const std::string& path)
this->Cache.begin();
i != this->Cache.end(); ++i) {
const CacheEntry& ce = (*i).second;
cmState::CacheEntryType t = ce.Type;
cmStateEnums::CacheEntryType t = ce.Type;
if (!ce.Initialized) {
/*
// This should be added in, but is not for now.
cmSystemTools::Error("Cache entry \"", (*i).first.c_str(),
"\" is uninitialized");
*/
} else if (t != cmState::INTERNAL) {
} else if (t != cmStateEnums::INTERNAL) {
// Format is key:type=value
if (const char* help = ce.GetProperty("HELPSTRING")) {
cmCacheManager::OutputHelpString(fout, help);
......@@ -334,9 +334,9 @@ bool cmCacheManager::SaveCache(const std::string& path)
continue;
}
cmState::CacheEntryType t = i.GetType();
cmStateEnums::CacheEntryType t = i.GetType();
this->WritePropertyEntries(fout, i);
if (t == cmState::INTERNAL) {
if (t == cmStateEnums::INTERNAL) {
// Format is key:type=value
if (const char* help = i.GetProperty("HELPSTRING")) {
this->OutputHelpString(fout, help);
......@@ -465,7 +465,7 @@ void cmCacheManager::PrintCache(std::ostream& out) const
for (std::map<std::string, CacheEntry>::const_iterator i =
this->Cache.begin();
i != this->Cache.end(); ++i) {
if ((*i).second.Type != cmState::INTERNAL) {
if ((*i).second.Type != cmStateEnums::INTERNAL) {
out << (*i).first << " = " << (*i).second.Value << std::endl;
}
}
......@@ -477,7 +477,7 @@ void cmCacheManager::PrintCache(std::ostream& out) const
void cmCacheManager::AddCacheEntry(const std::string& key, const char* value,
const char* helpString,
cmState::CacheEntryType type)
cmStateEnums::CacheEntryType type)
{
CacheEntry& e = this->Cache[key];
if (value) {
......@@ -488,7 +488,7 @@ void cmCacheManager::AddCacheEntry(const std::string& key, const char* value,
}
e.Type = type;
// make sure we only use unix style paths
if (type == cmState::FILEPATH || type == cmState::PATH) {
if (type == cmStateEnums::FILEPATH || type == cmStateEnums::PATH) {
if (e.Value.find(';') != e.Value.npos) {
std::vector<std::string> paths;
cmSystemTools::ExpandListArgument(e.Value, paths);
......
......@@ -34,7 +34,7 @@ private:
struct CacheEntry
{
std::string Value;
cmState::CacheEntryType Type;
cmStateEnums::CacheEntryType Type;
cmPropertyMap Properties;
std::vector<std::string> GetPropertyList() const;
const char* GetProperty(const std::string&) const;
......@@ -44,7 +44,7 @@ private:
bool Initialized;
CacheEntry()
: Value("")
, Type(cmState::UNINITIALIZED)
, Type(cmStateEnums::UNINITIALIZED)
, Initialized(false)
{
}
......@@ -70,8 +70,14 @@ public:
const char* GetValue() const { return this->GetEntry().Value.c_str(); }
bool GetValueAsBool() const;
void SetValue(const char*);
cmState::CacheEntryType GetType() const { return this->GetEntry().Type; }
void SetType(cmState::CacheEntryType ty) { this->GetEntry().Type = ty; }
cmStateEnums::CacheEntryType GetType() const
{
return this->GetEntry().Type;
}
void SetType(cmStateEnums::CacheEntryType ty)
{
this->GetEntry().Type = ty;
}
bool Initialized() { return this->GetEntry().Initialized; }
cmCacheManager& Container;
std::map<std::string, CacheEntry>::iterator Position;
......@@ -137,7 +143,7 @@ public:
return this->GetCacheIterator(key.c_str()).GetProperty(propName);
}
cmState::CacheEntryType GetCacheEntryType(std::string const& key)
cmStateEnums::CacheEntryType GetCacheEntryType(std::string const& key)
{
return this->GetCacheIterator(key.c_str()).GetType();
}
......@@ -200,7 +206,8 @@ public:
protected:
///! Add an entry into the cache
void AddCacheEntry(const std::string& key, const char* value,
const char* helpString, cmState::CacheEntryType type);
const char* helpString,
cmStateEnums::CacheEntryType type);
///! Get a cache entry object for a key
CacheEntry* GetCacheEntry(const std::string& key);
......
......@@ -531,7 +531,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
// set the result var to the return value to indicate success or failure
this->Makefile->AddCacheDefinition(argv[0], (res == 0 ? "TRUE" : "FALSE"),
"Result of TRY_COMPILE",
cmState::INTERNAL);
cmStateEnums::INTERNAL);
if (!outputVariable.empty()) {
this->Makefile->AddDefinition(outputVariable, output.c_str());
......
......@@ -230,7 +230,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(std::ostream& out,
// in the cache
valueToUse = envVarValue;
mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(),
cacheEntryName.c_str(), cmState::STRING, true);
cacheEntryName.c_str(), cmStateEnums::STRING, true);
mf->GetCMakeInstance()->SaveCache(lg->GetBinaryDirectory());
} else if (!envVarSet && cacheValue != CM_NULLPTR) {
// It is already in the cache, but not in the env, so use it from the cache
......@@ -245,7 +245,8 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(std::ostream& out,
if (valueToUse.find(envVarValue) == std::string::npos) {
valueToUse = envVarValue;
mf->AddCacheDefinition(cacheEntryName, valueToUse.c_str(),
cacheEntryName.c_str(), cmState::STRING, true);
cacheEntryName.c_str(), cmStateEnums::STRING,
true);
mf->GetCMakeInstance()->SaveCache(lg->GetBinaryDirectory());
}
}
......
......@@ -308,7 +308,7 @@ bool cmFindBase::CheckForVariableInCache()
// this.
if (cached &&
state->GetCacheEntryType(this->VariableName) ==
cmState::UNINITIALIZED) {
cmStateEnums::UNINITIALIZED) {
this->AlreadyInCacheWithoutMetaInfo = true;
}
return true;
......
......@@ -26,7 +26,7 @@ bool cmFindLibraryCommand::InitialPass(std::vector<std::string> const& argsIn,
if (this->AlreadyInCacheWithoutMetaInfo) {
this->Makefile->AddCacheDefinition(this->VariableName, "",
this->VariableDocumentation.c_str(),
cmState::FILEPATH);
cmStateEnums::FILEPATH);
}
return true;
}
......@@ -52,13 +52,13 @@ bool cmFindLibraryCommand::InitialPass(std::vector<std::string> const& argsIn,
// Save the value in the cache
this->Makefile->AddCacheDefinition(this->VariableName, library.c_str(),
this->VariableDocumentation.c_str(),
cmState::FILEPATH);
cmStateEnums::FILEPATH);
return true;
}
std::string notfound = this->VariableName + "-NOTFOUND";
this->Makefile->AddCacheDefinition(this->VariableName, notfound.c_str(),
this->VariableDocumentation.c_str(),
cmState::FILEPATH);
cmStateEnums::FILEPATH);
return true;
}
......
......@@ -890,7 +890,7 @@ bool cmFindPackageCommand::FindConfig()
help += ".";
// We force the value since we do not get here if it was already set.
this->Makefile->AddCacheDefinition(this->Variable, init.c_str(),
help.c_str(), cmState::PATH, true);
help.c_str(), cmStateEnums::PATH, true);
return found;
}
......
......@@ -26,7 +26,8 @@ bool cmFindPathCommand::InitialPass(std::vector<std::string> const& argsIn,
if (this->AlreadyInCacheWithoutMetaInfo) {
this->Makefile->AddCacheDefinition(
this->VariableName, "", this->VariableDocumentation.c_str(),
(this->IncludeFileInPath ? cmState::FILEPATH : cmState::PATH));
(this->IncludeFileInPath ? cmStateEnums::FILEPATH
: cmStateEnums::PATH));
}
return true;
}
......@@ -35,13 +36,13 @@ bool cmFindPathCommand::InitialPass(std::vector<std::string> const& argsIn,
if (!result.empty()) {
this->Makefile->AddCacheDefinition(
this->VariableName, result.c_str(), this->VariableDocumentation.c_str(),
(this->IncludeFileInPath) ? cmState::FILEPATH : cmState::PATH);
(this->IncludeFileInPath) ? cmStateEnums::FILEPATH : cmStateEnums::PATH);
return true;
}
this->Makefile->AddCacheDefinition(
this->VariableName, (this->VariableName + "-NOTFOUND").c_str(),
this->VariableDocumentation.c_str(),
(this->IncludeFileInPath) ? cmState::FILEPATH : cmState::PATH);
(this->IncludeFileInPath) ? cmStateEnums::FILEPATH : cmStateEnums::PATH);
return true;
}
......
......@@ -90,7 +90,7 @@ bool cmFindProgramCommand::InitialPass(std::vector<std::string> const& argsIn,
if (this->AlreadyInCacheWithoutMetaInfo) {
this->Makefile->AddCacheDefinition(this->VariableName, "",
this->VariableDocumentation.c_str(),
cmState::FILEPATH);
cmStateEnums::FILEPATH);
}
return true;
}
......@@ -100,13 +100,13 @@ bool cmFindProgramCommand::InitialPass(std::vector<std::string> const& argsIn,
// Save the value in the cache
this->Makefile->AddCacheDefinition(this->VariableName, result.c_str(),
this->VariableDocumentation.c_str(),
cmState::FILEPATH);
cmStateEnums::FILEPATH);
return true;
}
this->Makefile->AddCacheDefinition(
this->VariableName, (this->VariableName + "-NOTFOUND").c_str(),
this->VariableDocumentation.c_str(), cmState::FILEPATH);
this->VariableDocumentation.c_str(), cmStateEnums::FILEPATH);
return true;
}
......
......@@ -88,13 +88,13 @@ bool cmGetFilenameComponentCommand::InitialPass(
if (args.size() >= 4 && args[args.size() - 1] == "CACHE") {
if (!programArgs.empty() && !storeArgs.empty()) {
this->Makefile->AddCacheDefinition(storeArgs, programArgs.c_str(), "",
args[2] == "PATH" ? cmState::FILEPATH
: cmState::STRING);
this->Makefile->AddCacheDefinition(
storeArgs, programArgs.c_str(), "",
args[2] == "PATH" ? cmStateEnums::FILEPATH : cmStateEnums::STRING);
}
this->Makefile->AddCacheDefinition(args[0], result.c_str(), "",
args[2] == "PATH" ? cmState::FILEPATH
: cmState::STRING);
this->Makefile->AddCacheDefinition(
args[0], result.c_str(), "",
args[2] == "PATH" ? cmStateEnums::FILEPATH : cmStateEnums::STRING);
} else {
if (!programArgs.empty() && !storeArgs.empty()) {
this->Makefile->AddDefinition(storeArgs, programArgs.c_str());
......
......@@ -308,7 +308,7 @@ void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf)
makeProgram += "/";
makeProgram += saveFile;