summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx17
1 files changed, 10 insertions, 7 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 6d196f8..8d4bb1e 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1535,17 +1535,21 @@ cmSourceGroup&
cmMakefile::FindSourceGroup(const char* source,
std::vector<cmSourceGroup> &groups)
{
- std::string file = source;
- std::string::size_type pos = file.rfind('/');
- if(pos != std::string::npos)
+ // First search for a group that lists the file explicitly.
+ for(std::vector<cmSourceGroup>::reverse_iterator sg = groups.rbegin();
+ sg != groups.rend(); ++sg)
{
- file = file.substr(pos+1);
+ if(sg->MatchesFiles(source))
+ {
+ return *sg;
+ }
}
-
+
+ // Now search for a group whose regex matches the file.
for(std::vector<cmSourceGroup>::reverse_iterator sg = groups.rbegin();
sg != groups.rend(); ++sg)
{
- if(sg->Matches(file.c_str()))
+ if(sg->MatchesRegex(source))
{
return *sg;
}
@@ -1840,7 +1844,6 @@ cmSourceFile* cmMakefile::GetOrCreateSource(const char* sourceName,
return ret;
}
-
cmSourceFile* cmMakefile::AddSource(cmSourceFile const&sf)
{
// check to see if it exists