cmake: Remove the happy global property scope pattern.
Global properties are already global in scope, so remove the overload for specifying it and port users of the API. The call from cmMakefile::GetProperty can be simplified because the scope is only used during chaining, and there is no further chaining after processing global properties.
This commit is contained in:
parent
24b7f31d3a
commit
0076b5d834
|
@ -1132,7 +1132,7 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
|
||||||
cmCTestScriptHandler* ch =
|
cmCTestScriptHandler* ch =
|
||||||
static_cast<cmCTestScriptHandler*>(this->CTest->GetHandler("script"));
|
static_cast<cmCTestScriptHandler*>(this->CTest->GetHandler("script"));
|
||||||
cmake* cm = ch->GetCMake();
|
cmake* cm = ch->GetCMake();
|
||||||
const char* subproject = cm->GetProperty("SubProject", cmProperty::GLOBAL);
|
const char* subproject = cm->GetProperty("SubProject");
|
||||||
// TODO: Encode values for a URL instead of trusting caller.
|
// TODO: Encode values for a URL instead of trusting caller.
|
||||||
std::ostringstream str;
|
std::ostringstream str;
|
||||||
str << "project="
|
str << "project="
|
||||||
|
|
|
@ -1558,12 +1558,12 @@ void cmCTest::AddSiteProperties(std::ostream& ostr)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// This code should go when cdash is changed to use labels only
|
// This code should go when cdash is changed to use labels only
|
||||||
const char* subproject = cm->GetProperty("SubProject", cmProperty::GLOBAL);
|
const char* subproject = cm->GetProperty("SubProject");
|
||||||
if(subproject)
|
if(subproject)
|
||||||
{
|
{
|
||||||
ostr << "<Subproject name=\"" << subproject << "\">\n";
|
ostr << "<Subproject name=\"" << subproject << "\">\n";
|
||||||
const char* labels =
|
const char* labels =
|
||||||
ch->GetCMake()->GetProperty("SubProjectLabels", cmProperty::GLOBAL);
|
ch->GetCMake()->GetProperty("SubProjectLabels");
|
||||||
if(labels)
|
if(labels)
|
||||||
{
|
{
|
||||||
ostr << " <Labels>\n";
|
ostr << " <Labels>\n";
|
||||||
|
@ -1581,7 +1581,7 @@ void cmCTest::AddSiteProperties(std::ostream& ostr)
|
||||||
}
|
}
|
||||||
|
|
||||||
// This code should stay when cdash only does label based sub-projects
|
// This code should stay when cdash only does label based sub-projects
|
||||||
const char* label = cm->GetProperty("Label", cmProperty::GLOBAL);
|
const char* label = cm->GetProperty("Label");
|
||||||
if(label)
|
if(label)
|
||||||
{
|
{
|
||||||
ostr << "<Labels>\n";
|
ostr << "<Labels>\n";
|
||||||
|
|
|
@ -470,7 +470,7 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (const char *extraNaturesProp = mf->GetCMakeInstance()->
|
if (const char *extraNaturesProp = mf->GetCMakeInstance()->
|
||||||
GetProperty("ECLIPSE_EXTRA_NATURES", cmProperty::GLOBAL))
|
GetProperty("ECLIPSE_EXTRA_NATURES"))
|
||||||
{
|
{
|
||||||
std::vector<std::string> extraNatures;
|
std::vector<std::string> extraNatures;
|
||||||
cmSystemTools::ExpandListArgument(extraNaturesProp, extraNatures);
|
cmSystemTools::ExpandListArgument(extraNaturesProp, extraNatures);
|
||||||
|
|
|
@ -234,8 +234,7 @@ void cmLocalNinjaGenerator::WritePools(std::ostream& os)
|
||||||
{
|
{
|
||||||
cmGlobalNinjaGenerator::WriteDivider(os);
|
cmGlobalNinjaGenerator::WriteDivider(os);
|
||||||
|
|
||||||
const char* jobpools = this->GetCMakeInstance()
|
const char* jobpools = this->GetCMakeInstance()->GetProperty("JOB_POOLS");
|
||||||
->GetProperty("JOB_POOLS", cmProperty::GLOBAL);
|
|
||||||
if (jobpools)
|
if (jobpools)
|
||||||
{
|
{
|
||||||
cmGlobalNinjaGenerator::WriteComment(os,
|
cmGlobalNinjaGenerator::WriteComment(os,
|
||||||
|
|
|
@ -4239,7 +4239,7 @@ const char *cmMakefile::GetProperty(const std::string& prop,
|
||||||
return this->LocalGenerator->GetParent()->GetMakefile()->
|
return this->LocalGenerator->GetParent()->GetMakefile()->
|
||||||
GetProperty(prop, scope);
|
GetProperty(prop, scope);
|
||||||
}
|
}
|
||||||
return this->GetCMakeInstance()->GetProperty(prop,scope);
|
return this->GetCMakeInstance()->GetProperty(prop);
|
||||||
}
|
}
|
||||||
|
|
||||||
return retVal;
|
return retVal;
|
||||||
|
|
|
@ -1514,7 +1514,7 @@ int cmake::ActualConfigure()
|
||||||
|
|
||||||
cmMakefile* mf=this->GlobalGenerator->GetLocalGenerators()[0]->GetMakefile();
|
cmMakefile* mf=this->GlobalGenerator->GetLocalGenerators()[0]->GetMakefile();
|
||||||
if (mf->IsOn("CTEST_USE_LAUNCHERS")
|
if (mf->IsOn("CTEST_USE_LAUNCHERS")
|
||||||
&& !this->GetProperty("RULE_LAUNCH_COMPILE", cmProperty::GLOBAL))
|
&& !this->GetProperty("RULE_LAUNCH_COMPILE"))
|
||||||
{
|
{
|
||||||
cmSystemTools::Error("CTEST_USE_LAUNCHERS is enabled, but the "
|
cmSystemTools::Error("CTEST_USE_LAUNCHERS is enabled, but the "
|
||||||
"RULE_LAUNCH_COMPILE global property is not defined.\n"
|
"RULE_LAUNCH_COMPILE global property is not defined.\n"
|
||||||
|
@ -2197,12 +2197,6 @@ void cmake::AppendProperty(const std::string& prop,
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *cmake::GetProperty(const std::string& prop)
|
const char *cmake::GetProperty(const std::string& prop)
|
||||||
{
|
|
||||||
return this->GetProperty(prop, cmProperty::GLOBAL);
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *cmake::GetProperty(const std::string& prop,
|
|
||||||
cmProperty::ScopeType scope)
|
|
||||||
{
|
{
|
||||||
// watch for special properties
|
// watch for special properties
|
||||||
std::string output = "";
|
std::string output = "";
|
||||||
|
@ -2238,7 +2232,7 @@ const char *cmake::GetProperty(const std::string& prop,
|
||||||
}
|
}
|
||||||
#undef STRING_LIST_ELEMENT
|
#undef STRING_LIST_ELEMENT
|
||||||
bool dummy = false;
|
bool dummy = false;
|
||||||
return this->Properties.GetPropertyValue(prop, scope, dummy);
|
return this->Properties.GetPropertyValue(prop, cmProperty::GLOBAL, dummy);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmake::GetPropertyAsBool(const std::string& prop)
|
bool cmake::GetPropertyAsBool(const std::string& prop)
|
||||||
|
|
|
@ -253,8 +253,6 @@ class cmake
|
||||||
void AppendProperty(const std::string& prop,
|
void AppendProperty(const std::string& prop,
|
||||||
const char *value,bool asString=false);
|
const char *value,bool asString=false);
|
||||||
const char *GetProperty(const std::string& prop);
|
const char *GetProperty(const std::string& prop);
|
||||||
const char *GetProperty(const std::string& prop,
|
|
||||||
cmProperty::ScopeType scope);
|
|
||||||
bool GetPropertyAsBool(const std::string& prop);
|
bool GetPropertyAsBool(const std::string& prop);
|
||||||
|
|
||||||
///! Get or create an cmInstalledFile instance and return a pointer to it
|
///! Get or create an cmInstalledFile instance and return a pointer to it
|
||||||
|
|
Loading…
Reference in New Issue