summaryrefslogtreecommitdiff
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorArtur Ryt <artur.ryt@gmail.com>2018-11-30 23:50:37 +0100
committerBrad King <brad.king@kitware.com>2018-12-12 08:29:01 -0500
commitdda4755b467db297b04cc1678e0d7c6035ad4c2f (patch)
treebc35dcc0b1c7aff6381862d2028daf71b16a94ae /Source/cmMakefile.cxx
parent654fdd8374a4447dc65589eb55b39323384fbc60 (diff)
downloadcmake-dda4755b467db297b04cc1678e0d7c6035ad4c2f.tar.gz
cmMakefile: Fix ConfigureString not passing filename and line
It enables to use CMAKE_CURRENT_LIST_LINE in string(CONFIGURE) Added tests for it for ${} and @@ notattion for old CMP0053 and ${} for new
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 5ad8ef6e40..9ed0dc36ad 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -3648,8 +3648,15 @@ void cmMakefile::ConfigureString(const std::string& input, std::string& output,
}
// Perform variable replacements.
- this->ExpandVariablesInString(output, escapeQuotes, true, atOnly, nullptr,
- -1, true, true);
+ const char* filename = nullptr;
+ long lineNumber = -1;
+ if (!this->Backtrace.Empty()) {
+ const auto& currentTrace = this->Backtrace.Top();
+ filename = currentTrace.FilePath.c_str();
+ lineNumber = currentTrace.Line;
+ }
+ this->ExpandVariablesInString(output, escapeQuotes, true, atOnly, filename,
+ lineNumber, true, true);
}
int cmMakefile::ConfigureFile(const char* infile, const char* outfile,