diff options
author | Brad King <brad.king@kitware.com> | 2004-08-04 14:45:11 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2004-08-04 14:45:11 (GMT) |
commit | b6da1d127196d82c58a3780432e9466b459d8543 (patch) | |
tree | 17a8359a57d7c1de7434c9f836d8e2eace470ca3 /Source/cmMacroCommand.cxx | |
parent | 743eed068cbd81747cac0184e7c4a43ce8aab8c3 (diff) | |
download | CMake-b6da1d127196d82c58a3780432e9466b459d8543.zip CMake-b6da1d127196d82c58a3780432e9466b459d8543.tar.gz CMake-b6da1d127196d82c58a3780432e9466b459d8543.tar.bz2 |
ENH: Added support for special variables CMAKE_CURRENT_LIST_FILE and CMAKE_CURRENT_LIST_LINE that evaluate to the file name and line number in which they appear. This implements the feature request from bug 1012.
Diffstat (limited to 'Source/cmMacroCommand.cxx')
-rw-r--r-- | Source/cmMacroCommand.cxx | 16 |
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)) |