summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmGeneratorExpression.cxx1
-rw-r--r--Source/cmGeneratorExpression.h6
2 files changed, 7 insertions, 0 deletions
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index 971cad2..8710dfc 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -141,6 +141,7 @@ bool cmGeneratorExpression::EvaluateTargetInfo(std::string& result)
result = "Target \"" + name + "\" is not an executable or library.";
return false;
}
+ this->Targets.insert(target);
// Lookup the target file with the given purpose.
std::string purpose = this->TargetInfo.match(1);
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index 9bed780..1a9d4c6 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -15,6 +15,7 @@
#include <cmsys/RegularExpression.hxx>
+class cmTarget;
class cmMakefile;
class cmListFileBacktrace;
@@ -38,6 +39,10 @@ public:
/** Evaluate generator expressions in a string. */
const char* Process(std::string const& input);
const char* Process(const char* input);
+
+ /** Get set of targets found during evaluations. */
+ std::set<cmTarget*> const& GetTargets() const
+ { return this->Targets; }
private:
cmMakefile* Makefile;
const char* Config;
@@ -46,6 +51,7 @@ private:
std::vector<char> Data;
std::stack<size_t> Barriers;
cmsys::RegularExpression TargetInfo;
+ std::set<cmTarget*> Targets;
bool Evaluate();
bool Evaluate(const char* expr, std::string& result);
bool EvaluateTargetInfo(std::string& result);