summaryrefslogtreecommitdiffstats
path: root/Source/cmJsonObjects.cxx
diff options
context:
space:
mode:
authorDaniel Eiband <daniel.eiband@brainlab.com>2019-09-22 07:53:44 (GMT)
committerDaniel Eiband <daniel.eiband@brainlab.com>2019-09-23 19:19:15 (GMT)
commit7dcf9cb83c2082168f218be8f21b95b77cc95a86 (patch)
treeee1435acc933654c5d643e3ca5777670407f2cb1 /Source/cmJsonObjects.cxx
parentc7c59dae82594557dc2fddc4ef881dafeaad076a (diff)
downloadCMake-7dcf9cb83c2082168f218be8f21b95b77cc95a86.zip
CMake-7dcf9cb83c2082168f218be8f21b95b77cc95a86.tar.gz
CMake-7dcf9cb83c2082168f218be8f21b95b77cc95a86.tar.bz2
cmGeneratorExpression: Add cmGeneratorExpression::Evaluate utility
cmGeneratorExpression::Evaluate is a shortcut when only the evaluated string is needed or an instance of cmCompiledGeneratorExpression cannot be cached. Fixes: #19686
Diffstat (limited to 'Source/cmJsonObjects.cxx')
-rw-r--r--Source/cmJsonObjects.cxx12
1 files changed, 4 insertions, 8 deletions
diff --git a/Source/cmJsonObjects.cxx b/Source/cmJsonObjects.cxx
index 52e28d3..79180cb 100644
--- a/Source/cmJsonObjects.cxx
+++ b/Source/cmJsonObjects.cxx
@@ -32,7 +32,6 @@
#include <functional>
#include <limits>
#include <map>
-#include <memory>
#include <set>
#include <string>
#include <unordered_map>
@@ -357,10 +356,8 @@ static Json::Value DumpCTestInfo(cmLocalGenerator* lg, cmTest* testInfo,
}
// Remove any config specific variables from the output.
- cmGeneratorExpression ge;
- auto cge = ge.Parse(command);
- const std::string& processed = cge->Evaluate(lg, config);
- result[kCTEST_COMMAND] = processed;
+ result[kCTEST_COMMAND] =
+ cmGeneratorExpression::Evaluate(command, lg, config);
// Build up the list of properties that may have been specified
Json::Value properties = Json::arrayValue;
@@ -369,9 +366,8 @@ static Json::Value DumpCTestInfo(cmLocalGenerator* lg, cmTest* testInfo,
entry[kKEY_KEY] = prop.first;
// Remove config variables from the value too.
- auto cge_value = ge.Parse(prop.second);
- const std::string& processed_value = cge_value->Evaluate(lg, config);
- entry[kVALUE_KEY] = processed_value;
+ entry[kVALUE_KEY] =
+ cmGeneratorExpression::Evaluate(prop.second, lg, config);
properties.append(entry);
}
result[kPROPERTIES_KEY] = properties;