From 9cefce09f63ebb19621e061a30fd5838ac834d0b Mon Sep 17 00:00:00 2001 From: Brad King Date: Sat, 15 Jan 2011 08:00:11 -0500 Subject: [PATCH] Report directory with missing source file (#11677) Previously the error message for code like add_executable(myexe does_not_exist/mysrc.c) mentioned only that "mysrc.c" is not found. Report the directory too. --- Source/cmSourceFile.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index 26328cfda..de7ff02ad 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -187,8 +187,13 @@ bool cmSourceFile::FindFullPath(std::string* error) } cmOStringStream e; - e << "Cannot find source file \"" << this->Location.GetName() << "\""; - e << ". Tried extensions"; + std::string missing = this->Location.GetDirectory(); + if(!missing.empty()) + { + missing += "/"; + } + missing += this->Location.GetName(); + e << "Cannot find source file:\n " << missing << "\nTried extensions"; for(std::vector::const_iterator ext = srcExts.begin(); ext != srcExts.end(); ++ext) {