Extend the cmTargetPropCommandBase interface property handling.
This can be used to handle INTERFACE SYSTEM include directories in particular.
This commit is contained in:
parent
83498d4135
commit
286f227709
|
@ -126,19 +126,27 @@ void cmTargetPropCommandBase
|
||||||
}
|
}
|
||||||
if (scope == "INTERFACE" || scope == "PUBLIC")
|
if (scope == "INTERFACE" || scope == "PUBLIC")
|
||||||
{
|
{
|
||||||
|
this->HandleInterfaceContent(this->Target, content, prepend);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
void cmTargetPropCommandBase::HandleInterfaceContent(cmTarget *tgt,
|
||||||
|
const std::vector<std::string> &content,
|
||||||
|
bool prepend)
|
||||||
|
{
|
||||||
if (prepend)
|
if (prepend)
|
||||||
{
|
{
|
||||||
const std::string propName = std::string("INTERFACE_") + this->Property;
|
const std::string propName = std::string("INTERFACE_") + this->Property;
|
||||||
const char *propValue = this->Target->GetProperty(propName.c_str());
|
const char *propValue = tgt->GetProperty(propName.c_str());
|
||||||
const std::string totalContent = this->Join(content) + (propValue
|
const std::string totalContent = this->Join(content) + (propValue
|
||||||
? std::string(";") + propValue
|
? std::string(";") + propValue
|
||||||
: std::string());
|
: std::string());
|
||||||
this->Target->SetProperty(propName.c_str(), totalContent.c_str());
|
tgt->SetProperty(propName.c_str(), totalContent.c_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this->Target->AppendProperty(("INTERFACE_" + this->Property).c_str(),
|
tgt->AppendProperty(("INTERFACE_" + this->Property).c_str(),
|
||||||
this->Join(content).c_str());
|
this->Join(content).c_str());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,9 @@ protected:
|
||||||
std::string Property;
|
std::string Property;
|
||||||
cmTarget *Target;
|
cmTarget *Target;
|
||||||
|
|
||||||
|
virtual void HandleInterfaceContent(cmTarget *tgt,
|
||||||
|
const std::vector<std::string> &content,
|
||||||
|
bool prepend);
|
||||||
private:
|
private:
|
||||||
virtual void HandleImportedTarget(const std::string &tgt) = 0;
|
virtual void HandleImportedTarget(const std::string &tgt) = 0;
|
||||||
virtual void HandleMissingTarget(const std::string &name) = 0;
|
virtual void HandleMissingTarget(const std::string &name) = 0;
|
||||||
|
|
Loading…
Reference in New Issue