diff options
author | Artur Ryt <artur.ryt@gmail.com> | 2018-11-30 22:50:37 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-12-12 13:29:01 (GMT) |
commit | dda4755b467db297b04cc1678e0d7c6035ad4c2f (patch) | |
tree | bc35dcc0b1c7aff6381862d2028daf71b16a94ae /Source/cmMakefile.cxx | |
parent | 654fdd8374a4447dc65589eb55b39323384fbc60 (diff) | |
download | CMake-dda4755b467db297b04cc1678e0d7c6035ad4c2f.zip CMake-dda4755b467db297b04cc1678e0d7c6035ad4c2f.tar.gz CMake-dda4755b467db297b04cc1678e0d7c6035ad4c2f.tar.bz2 |
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.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 5ad8ef6..9ed0dc3 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, |