1 /*============================================================================
2 CMake - Cross Platform Makefile Generator
3 Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
5 Distributed under the OSI-approved BSD License (the "License");
6 see accompanying file Copyright.txt for details.
8 This software is distributed WITHOUT ANY WARRANTY; without even the
9 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the License for more information.
11 ============================================================================*/
12 #include "cmStandardIncludes.h"
16 #include <cmsys/RegularExpression.hxx>
20 class cmListFileBacktrace;
22 /** \class cmGeneratorExpression
23 * \brief Evaluate generate-time query expression syntax.
25 * cmGeneratorExpression instances are used by build system generator
26 * implementations to evaluate the $<> generator expression syntax.
27 * Generator expressions are evaluated just before the generate step
28 * writes strings into the build system. They have knowledge of the
29 * build configuration which is not available at configure time.
31 class cmGeneratorExpression
34 /** Construct with an evaluation context and configuration. */
35 cmGeneratorExpression(cmMakefile* mf, const char* config,
36 cmListFileBacktrace const& backtrace,
39 /** Evaluate generator expressions in a string. */
40 const char* Process(std::string const& input);
41 const char* Process(const char* input);
43 /** Get set of targets found during evaluations. */
44 std::set<cmTarget*> const& GetTargets() const
45 { return this->Targets; }
49 cmListFileBacktrace const& Backtrace;
51 std::vector<char> Data;
52 std::stack<size_t> Barriers;
53 cmsys::RegularExpression TargetInfo;
54 std::set<cmTarget*> Targets;
56 bool Evaluate(const char* expr, std::string& result);
57 bool EvaluateTargetInfo(std::string& result);