mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-03 12:49:50 -05:00
FIX: apply patch from bug# 1965
This commit is contained in:
@@ -81,3 +81,88 @@ std::vector<const cmSourceFile*>& cmSourceGroup::GetSourceFiles()
|
||||
{
|
||||
return m_SourceFiles;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void cmSourceGroup::AddChild(cmSourceGroup child)
|
||||
{
|
||||
m_GroupChildren.push_back(child);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
cmSourceGroup *cmSourceGroup::lookupChild(const char* name)
|
||||
{
|
||||
// initializing iterators
|
||||
std::vector<cmSourceGroup>::iterator iter = m_GroupChildren.begin();
|
||||
std::vector<cmSourceGroup>::iterator end = m_GroupChildren.end();
|
||||
|
||||
// st
|
||||
for(;iter!=end; ++iter)
|
||||
{
|
||||
std::string sgName = iter->GetName();
|
||||
|
||||
// look if descenened is the one were looking for
|
||||
if(sgName == name)
|
||||
{
|
||||
return &(*iter); // if it so return it
|
||||
}
|
||||
// if the descendend isn't the one where looking for ask it's traverse
|
||||
cmSourceGroup *result = iter->lookupChild(name);
|
||||
|
||||
// if one of it's descendeds is the one we're looking for return it
|
||||
if(result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
// if no child with this name was found return NULL
|
||||
return NULL;
|
||||
}
|
||||
|
||||
cmSourceGroup *cmSourceGroup::MatchChildrenFiles(const char *name)
|
||||
{
|
||||
// initializing iterators
|
||||
std::vector<cmSourceGroup>::iterator iter = m_GroupChildren.begin();
|
||||
std::vector<cmSourceGroup>::iterator end = m_GroupChildren.end();
|
||||
|
||||
if(this->MatchesFiles(name))
|
||||
{
|
||||
return this;
|
||||
}
|
||||
for(;iter!=end;++iter)
|
||||
{
|
||||
cmSourceGroup *result = iter->MatchChildrenFiles(name);
|
||||
if(result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
cmSourceGroup *cmSourceGroup::MatchChildrenRegex(const char *name)
|
||||
{
|
||||
// initializing iterators
|
||||
std::vector<cmSourceGroup>::iterator iter = m_GroupChildren.begin();
|
||||
std::vector<cmSourceGroup>::iterator end = m_GroupChildren.end();
|
||||
|
||||
if(this->MatchesRegex(name))
|
||||
{
|
||||
return this;
|
||||
}
|
||||
for(;iter!=end; ++iter)
|
||||
{
|
||||
cmSourceGroup *result = iter->MatchChildrenRegex(name);
|
||||
if(result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::vector<cmSourceGroup> cmSourceGroup::GetGroupChildren() const
|
||||
{
|
||||
return m_GroupChildren;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user