Imported Upstream version 2.8.10.2
[platform/upstream/cmake.git] / Source / cmGeneratorTarget.h
1 /*============================================================================
2   CMake - Cross Platform Makefile Generator
3   Copyright 2000-2012 Kitware, Inc., Insight Software Consortium
4
5   Distributed under the OSI-approved BSD License (the "License");
6   see accompanying file Copyright.txt for details.
7
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 #ifndef cmGeneratorTarget_h
13 #define cmGeneratorTarget_h
14
15 #include "cmStandardIncludes.h"
16
17 class cmComputeLinkInformation;
18 class cmCustomCommand;
19 class cmGlobalGenerator;
20 class cmLocalGenerator;
21 class cmMakefile;
22 class cmSourceFile;
23 class cmTarget;
24
25 class cmGeneratorTarget
26 {
27 public:
28   cmGeneratorTarget(cmTarget*);
29   ~cmGeneratorTarget();
30
31   int GetType() const;
32   const char *GetName() const;
33   const char *GetProperty(const char *prop);
34   bool GetPropertyAsBool(const char *prop);
35   std::vector<cmSourceFile*> const& GetSourceFiles();
36
37   cmTarget* Target;
38   cmMakefile* Makefile;
39   cmLocalGenerator* LocalGenerator;
40   cmGlobalGenerator* GlobalGenerator;
41
42   /** Sources classified by purpose.  */
43   std::vector<cmSourceFile*> CustomCommands;
44   std::vector<cmSourceFile*> ExtraSources;
45   std::vector<cmSourceFile*> HeaderSources;
46   std::vector<cmSourceFile*> ObjectSources;
47   std::vector<cmSourceFile*> ExternalObjects;
48   std::vector<cmSourceFile*> IDLSources;
49   std::string ModuleDefinitionFile;
50
51   std::map<cmSourceFile const*, std::string> Objects;
52   std::set<cmSourceFile const*> ExplicitObjectName;
53
54   /** Full path with trailing slash to the top-level directory
55       holding object files for this target.  Includes the build
56       time config name placeholder if needed for the generator.  */
57   std::string ObjectDirectory;
58
59   std::vector<cmTarget*> ObjectLibraries;
60
61   void UseObjectLibraries(std::vector<std::string>& objs);
62
63   std::map<cmStdString, cmComputeLinkInformation*> LinkInformation;
64
65   cmComputeLinkInformation* GetLinkInformation(const char* config);
66
67   void GetAppleArchs(const char* config,
68                      std::vector<std::string>& archVec);
69
70   ///! Return the rule variable used to create this type of target,
71   //  need to add CMAKE_(LANG) for full name.
72   const char* GetCreateRuleVariable();
73
74   /** Get the include directories for this target.  */
75   std::vector<std::string> GetIncludeDirectories(const char *config);
76
77   std::string GetCompileDefinitions(const char *config = 0);
78
79 private:
80   void ClassifySources();
81   void LookupObjectLibraries();
82
83   cmGeneratorTarget(cmGeneratorTarget const&);
84   void operator=(cmGeneratorTarget const&);
85 };
86
87 typedef std::map<cmTarget*, cmGeneratorTarget*> cmGeneratorTargetsType;
88
89 #endif