diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmMakefile.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 1bd2115..1741b06 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1157,8 +1157,11 @@ cmSourceFile *cmMakefile::GetSourceFileWithOutput(const char *cname) { // is the output of the custom command match the source files name out = (*i)->GetCustomCommand()->GetOutput(); - if (out.rfind(name) != out.npos && - out.rfind(name) == out.size() - name.size()) + std::string::size_type pos = out.rfind(name); + // If the output matches exactly + if (pos != out.npos && + pos == out.size() - name.size() && + (pos ==0 || out[pos-1] == '/')) { return *i; } |