From 4749e4cb76cc1e23cb23f37ceec2e856a18218ce Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 8 Dec 2010 13:34:05 -0500 Subject: [PATCH] Record set of targets used in cmGeneratorExpression --- Source/cmGeneratorExpression.cxx | 1 + Source/cmGeneratorExpression.h | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index 971cad27d..8710dfc93 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 9bed780d4..1a9d4c6e9 100644 --- a/Source/cmGeneratorExpression.h +++ b/Source/cmGeneratorExpression.h @@ -15,6 +15,7 @@ #include +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 const& GetTargets() const + { return this->Targets; } private: cmMakefile* Makefile; const char* Config; @@ -46,6 +51,7 @@ private: std::vector Data; std::stack Barriers; cmsys::RegularExpression TargetInfo; + std::set Targets; bool Evaluate(); bool Evaluate(const char* expr, std::string& result); bool EvaluateTargetInfo(std::string& result);