summaryrefslogtreecommitdiffstats
path: root/Source/cmMacroCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2002-12-12 16:36:28 (GMT)
committerBrad King <brad.king@kitware.com>2002-12-12 16:36:28 (GMT)
commit54541bd40a6083b3969c2e2dc53292d1a67b69c2 (patch)
treeaf5a806a88d11cc4cf8e6779d0ad7a8610d442e8 /Source/cmMacroCommand.cxx
parentfe26cf51f575b30299f1ecfff112cf095a5c6f48 (diff)
downloadCMake-54541bd40a6083b3969c2e2dc53292d1a67b69c2.zip
CMake-54541bd40a6083b3969c2e2dc53292d1a67b69c2.tar.gz
CMake-54541bd40a6083b3969c2e2dc53292d1a67b69c2.tar.bz2
ENH: Improved filename/line number reporting in error message. Macro invocations now chain up the error message.
Diffstat (limited to 'Source/cmMacroCommand.cxx')
-rw-r--r--Source/cmMacroCommand.cxx14
1 files changed, 11 insertions, 3 deletions
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index 58871a2..f8746d0 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -59,6 +59,8 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf)
// Replace the formal arguments and then invoke the command.
cmListFileFunction newLFF;
newLFF.m_Name = m_Functions[c].m_Name;
+ newLFF.m_FilePath = m_Functions[c].m_FilePath;
+ newLFF.m_Line = m_Functions[c].m_Line;
for (std::vector<cmListFileArgument>::const_iterator k =
m_Functions[c].m_Arguments.begin();
k != m_Functions[c].m_Arguments.end(); ++k)
@@ -74,10 +76,16 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf)
}
cmListFileArgument arg(tmps, k->Quoted);
newLFF.m_Arguments.push_back(arg);
- newLFF.m_FilePath = m_Functions[c].m_FilePath;
- newLFF.m_Line = m_Functions[c].m_Line;
}
- mf.ExecuteCommand(newLFF);
+ if(!mf.ExecuteCommand(newLFF))
+ {
+ cmOStringStream error;
+ error << "Error in cmake code at\n"
+ << lff.m_FilePath << ":" << lff.m_Line << ":\n"
+ << "A command failed during the invocation of macro \""
+ << lff.m_Name.c_str() << "\".";
+ cmSystemTools::Error(error.str().c_str());
+ }
}
return true;
}