cmTarget: Sort special property checks

The LINK_LIBRARIES property is by *far* the most popular. Move it to the
top. TYPE is second, but with more generator expression usage, that may
change in the future.
This commit is contained in:
Ben Boeckel 2014-02-08 12:11:32 -05:00 committed by Ben Boeckel
parent 97ce676e75
commit cebefa71fa
1 changed files with 50 additions and 50 deletions

View File

@ -3100,51 +3100,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
}
if(specialProps.count(prop))
{
if(prop == "INCLUDE_DIRECTORIES")
{
if (this->Internal->IncludeDirectoriesEntries.empty())
{
return 0;
}
static std::string output;
MakePropertyList(output, this->Internal->IncludeDirectoriesEntries);
return output.c_str();
}
else if(prop == "COMPILE_OPTIONS")
{
if (this->Internal->CompileOptionsEntries.empty())
{
return 0;
}
static std::string output;
MakePropertyList(output, this->Internal->CompileOptionsEntries);
return output.c_str();
}
else if(prop == "COMPILE_FEATURES")
{
if (this->Internal->CompileFeaturesEntries.empty())
{
return 0;
}
static std::string output;
MakePropertyList(output, this->Internal->CompileFeaturesEntries);
return output.c_str();
}
else if(prop == "COMPILE_DEFINITIONS")
{
if (this->Internal->CompileDefinitionsEntries.empty())
{
return 0;
}
static std::string output;
MakePropertyList(output, this->Internal->CompileDefinitionsEntries);
return output.c_str();
}
else if(prop == "LINK_LIBRARIES")
if(prop == "LINK_LIBRARIES")
{
if (this->Internal->LinkImplementationPropertyEntries.empty())
{
@ -3165,6 +3121,55 @@ const char *cmTarget::GetProperty(const std::string& prop,
}
return output.c_str();
}
// the type property returns what type the target is
else if (prop == "TYPE")
{
return cmTarget::GetTargetTypeName(this->GetType());
}
else if(prop == "INCLUDE_DIRECTORIES")
{
if (this->Internal->IncludeDirectoriesEntries.empty())
{
return 0;
}
static std::string output;
MakePropertyList(output, this->Internal->IncludeDirectoriesEntries);
return output.c_str();
}
else if(prop == "COMPILE_FEATURES")
{
if (this->Internal->CompileFeaturesEntries.empty())
{
return 0;
}
static std::string output;
MakePropertyList(output, this->Internal->CompileFeaturesEntries);
return output.c_str();
}
else if(prop == "COMPILE_OPTIONS")
{
if (this->Internal->CompileOptionsEntries.empty())
{
return 0;
}
static std::string output;
MakePropertyList(output, this->Internal->CompileOptionsEntries);
return output.c_str();
}
else if(prop == "COMPILE_DEFINITIONS")
{
if (this->Internal->CompileDefinitionsEntries.empty())
{
return 0;
}
static std::string output;
MakePropertyList(output, this->Internal->CompileDefinitionsEntries);
return output.c_str();
}
else if (prop == "IMPORTED")
{
return this->IsImported()?"TRUE":"FALSE";
@ -3270,11 +3275,6 @@ const char *cmTarget::GetProperty(const std::string& prop,
this->Properties.SetProperty("SOURCES", ss.str().c_str(),
cmProperty::TARGET);
}
// the type property returns what type the target is
else if (prop == "TYPE")
{
return cmTarget::GetTargetTypeName(this->GetType());
}
}
bool chain = false;