Imported Upstream version 2.8.11.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 cmCustomCommand;
18 class cmGlobalGenerator;
19 class cmLocalGenerator;
20 class cmMakefile;
21 class cmSourceFile;
22 class cmTarget;
23
24 class cmGeneratorTarget
25 {
26 public:
27   cmGeneratorTarget(cmTarget*);
28
29   int GetType() const;
30   const char *GetName() const;
31   const char *GetProperty(const char *prop);
32   bool GetPropertyAsBool(const char *prop);
33   std::vector<cmSourceFile*> const& GetSourceFiles();
34
35   cmTarget* Target;
36   cmMakefile* Makefile;
37   cmLocalGenerator* LocalGenerator;
38   cmGlobalGenerator* GlobalGenerator;
39
40   /** Sources classified by purpose.  */
41   std::vector<cmSourceFile*> CustomCommands;
42   std::vector<cmSourceFile*> ExtraSources;
43   std::vector<cmSourceFile*> HeaderSources;
44   std::vector<cmSourceFile*> ObjectSources;
45   std::vector<cmSourceFile*> ExternalObjects;
46   std::vector<cmSourceFile*> IDLSources;
47   std::string ModuleDefinitionFile;
48
49   std::map<cmSourceFile const*, std::string> Objects;
50   std::set<cmSourceFile const*> ExplicitObjectName;
51
52   /** Full path with trailing slash to the top-level directory
53       holding object files for this target.  Includes the build
54       time config name placeholder if needed for the generator.  */
55   std::string ObjectDirectory;
56
57   std::vector<cmTarget*> ObjectLibraries;
58
59   void UseObjectLibraries(std::vector<std::string>& objs);
60
61   void GetAppleArchs(const char* config,
62                      std::vector<std::string>& archVec);
63
64   ///! Return the rule variable used to create this type of target,
65   //  need to add CMAKE_(LANG) for full name.
66   const char* GetCreateRuleVariable();
67
68   /** Get the include directories for this target.  */
69   std::vector<std::string> GetIncludeDirectories(const char *config);
70
71 private:
72   void ClassifySources();
73   void LookupObjectLibraries();
74
75   cmGeneratorTarget(cmGeneratorTarget const&);
76   void operator=(cmGeneratorTarget const&);
77 };
78
79 typedef std::map<cmTarget*, cmGeneratorTarget*> cmGeneratorTargetsType;
80
81 #endif