diff --git a/Source/cmSourceFileLocation.cxx b/Source/cmSourceFileLocation.cxx index 274c0ed156..6388977ee9 100644 --- a/Source/cmSourceFileLocation.cxx +++ b/Source/cmSourceFileLocation.cxx @@ -113,8 +113,11 @@ void cmSourceFileLocation::UpdateExtension(const char* name) tryPath = this->Makefile->GetCurrentDirectory(); tryPath += "/"; } - tryPath += this->Directory; - tryPath += "/"; + if(!this->Directory.empty()) + { + tryPath += this->Directory; + tryPath += "/"; + } tryPath += this->Name; if(cmSystemTools::FileExists(tryPath.c_str(), true)) {