summaryrefslogtreecommitdiffstats
path: root/Source/cmMacroCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmMacroCommand.cxx')
-rw-r--r--Source/cmMacroCommand.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index dcf941a..9db5f16 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -173,6 +173,22 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf)
arg.Value = tmps;
arg.Quoted = k->Quoted;
+ const char* def =
+ mf.GetDefinition("CMAKE_MACRO_REPORT_DEFINITION_LOCATION");
+ if(def && !cmSystemTools::IsOff(def))
+ {
+ // Report the location of the argument where the macro was
+ // defined.
+ arg.FilePath = k->FilePath;
+ arg.Line = k->Line;
+ }
+ else
+ {
+ // Report the location of the argument where the macro was
+ // invoked.
+ arg.FilePath = lff.m_FilePath;
+ arg.Line = lff.m_Line;
+ }
newLFF.m_Arguments.push_back(arg);
}
if(!mf.ExecuteCommand(newLFF))