summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-09-13 15:56:06 -0400
committerBrad King <brad.king@kitware.com>2010-09-13 16:17:20 -0400
commita6b5ead62fb4e69c053d752570f4c8af24e41857 (patch)
tree293eb05765da0e3feaafe4611bb1741f9fb85fed /Source
parentf3bc219adbbf10f3a75af1ac1db1f47b90102e19 (diff)
downloadcmake-a6b5ead62fb4e69c053d752570f4c8af24e41857.tar.gz
Report missing source files with context of target
Previously we reported only the CMakeLists.txt file in the directory that adds the target.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmSourceFile.cxx15
-rw-r--r--Source/cmSourceFile.h4
-rw-r--r--Source/cmTarget.cxx9
3 files changed, 21 insertions, 7 deletions
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx
index bc52d7fd2f..b793cd5fbb 100644
--- a/Source/cmSourceFile.cxx
+++ b/Source/cmSourceFile.cxx
@@ -101,11 +101,11 @@ cmSourceFileLocation const& cmSourceFile::GetLocation() const
}
//----------------------------------------------------------------------------
-std::string const& cmSourceFile::GetFullPath()
+std::string const& cmSourceFile::GetFullPath(std::string* error)
{
if(this->FullPath.empty())
{
- if(this->FindFullPath())
+ if(this->FindFullPath(error))
{
this->CheckExtension();
}
@@ -120,7 +120,7 @@ std::string const& cmSourceFile::GetFullPath() const
}
//----------------------------------------------------------------------------
-bool cmSourceFile::FindFullPath()
+bool cmSourceFile::FindFullPath(std::string* error)
{
// If thie method has already failed once do not try again.
if(this->FindFullPathFailed)
@@ -199,7 +199,14 @@ bool cmSourceFile::FindFullPath()
{
e << " ." << *ext;
}
- this->Location.GetMakefile()->IssueMessage(cmake::FATAL_ERROR, e.str());
+ if(error)
+ {
+ *error = e.str();
+ }
+ else
+ {
+ this->Location.GetMakefile()->IssueMessage(cmake::FATAL_ERROR, e.str());
+ }
this->FindFullPathFailed = true;
return false;
}
diff --git a/Source/cmSourceFile.h b/Source/cmSourceFile.h
index 937e4b7365..2dc8488152 100644
--- a/Source/cmSourceFile.h
+++ b/Source/cmSourceFile.h
@@ -60,7 +60,7 @@ public:
* horrible interface, but is necessary for backwards
* compatibility).
*/
- std::string const& GetFullPath();
+ std::string const& GetFullPath(std::string* error = 0);
std::string const& GetFullPath() const;
/**
@@ -108,7 +108,7 @@ private:
std::string FullPath;
bool FindFullPathFailed;
- bool FindFullPath();
+ bool FindFullPath(std::string* error);
bool TryFullPath(const char* tryPath, const char* ext);
void CheckExtension();
void CheckLanguage(std::string const& ext);
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 9611912691..042371ab16 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1439,8 +1439,15 @@ bool cmTarget::FindSourceFiles()
si = this->SourceFiles.begin();
si != this->SourceFiles.end(); ++si)
{
- if((*si)->GetFullPath().empty())
+ std::string e;
+ if((*si)->GetFullPath(&e).empty())
{
+ if(!e.empty())
+ {
+ cmake* cm = this->Makefile->GetCMakeInstance();
+ cm->IssueMessage(cmake::FATAL_ERROR, e,
+ this->GetBacktrace());
+ }
return false;
}
}