summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@gmail.com>2020-02-27 19:20:22 (GMT)
committerBrad King <brad.king@kitware.com>2020-03-03 13:42:13 (GMT)
commit598b676b5e77540b366b01b3c10154c2a633d23c (patch)
treeeb3aaea48e3c1743835a74be111ca64ee4a9a4e5 /Source/cmMakefile.cxx
parentc58b9c5ab94d674c76a17e6154f05e0e8c5c37d1 (diff)
downloadCMake-598b676b5e77540b366b01b3c10154c2a633d23c.zip
CMake-598b676b5e77540b366b01b3c10154c2a633d23c.tar.gz
CMake-598b676b5e77540b366b01b3c10154c2a633d23c.tar.bz2
cmake_command: Add command to EVAL a CMake script as a string
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index ed627f8..94d99b7 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -684,6 +684,27 @@ bool cmMakefile::ReadListFile(const std::string& filename)
return true;
}
+bool cmMakefile::ReadListFileAsString(const std::string& content,
+ const std::string& virtualFileName)
+{
+ std::string filenametoread = cmSystemTools::CollapseFullPath(
+ virtualFileName, this->GetCurrentSourceDirectory());
+
+ ListFileScope scope(this, filenametoread);
+
+ cmListFile listFile;
+ if (!listFile.ParseString(content.c_str(), virtualFileName.c_str(),
+ this->GetMessenger(), this->Backtrace)) {
+ return false;
+ }
+
+ this->ReadListFile(listFile, filenametoread);
+ if (cmSystemTools::GetFatalErrorOccured()) {
+ scope.Quiet();
+ }
+ return true;
+}
+
void cmMakefile::ReadListFile(cmListFile const& listFile,
std::string const& filenametoread)
{