~ubuntu-branches/ubuntu/precise/cmake/precise-updates

« back to all changes in this revision

Viewing changes to Source/cmLocalGenerator.h

  • Committer: Package Import Robot
  • Author(s): Rohan Garg
  • Date: 2012-01-17 23:04:07 UTC
  • mfrom: (1.13.6)
  • Revision ID: package-import@ubuntu.com-20120117230407-14cdb6g0mxmh29bl
Tags: 2.8.7-0ubuntu1
* New upstream release
  - Add increase_ctest_test_timeout.diff to increase timeout period
    of a test

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 * \brief Create required build files for a directory.
26
26
 *
27
27
 * Subclasses of this abstract class generate makefiles, DSP, etc for various
28
 
 * platforms. This class should never be constructued directly. A
 
28
 * platforms. This class should never be constructed directly. A
29
29
 * GlobalGenerator will create it and invoke the appropriate commands on it.
30
30
 */
31
31
class cmLocalGenerator
33
33
public:
34
34
  cmLocalGenerator();
35
35
  virtual ~cmLocalGenerator();
36
 
  
 
36
 
37
37
  /**
38
 
   * Generate the makefile for this directory. 
 
38
   * Generate the makefile for this directory.
39
39
   */
40
40
  virtual void Generate() {}
41
41
 
42
42
  /**
43
43
   * Process the CMakeLists files for this directory to fill in the
44
 
   * Makefile ivar 
 
44
   * Makefile ivar
45
45
   */
46
46
  virtual void Configure();
47
47
 
48
 
  /** 
 
48
  /**
49
49
   * Calls TraceVSDependencies() on all targets of this generator.
50
50
   */
51
51
  virtual void TraceDependencies();
75
75
  ///! Get the makefile for this generator
76
76
  cmMakefile *GetMakefile() {
77
77
    return this->Makefile; };
78
 
  
 
78
 
79
79
  ///! Get the makefile for this generator, const version
80
80
    const cmMakefile *GetMakefile() const {
81
81
      return this->Makefile; };
82
 
  
 
82
 
83
83
  ///! Get the GlobalGenerator this is associated with
84
84
  cmGlobalGenerator *GetGlobalGenerator() {
85
85
    return this->GlobalGenerator; };
 
86
  const cmGlobalGenerator *GetGlobalGenerator() const {
 
87
    return this->GlobalGenerator; };
86
88
 
87
89
  ///! Set the Global Generator, done on creation by the GlobalGenerator
88
90
  void SetGlobalGenerator(cmGlobalGenerator *gg);
89
91
 
90
 
  /** 
91
 
   * Convert something to something else. This is a centralized coversion
 
92
  /**
 
93
   * Convert something to something else. This is a centralized conversion
92
94
   * routine used by the generators to handle relative paths and the like.
93
 
   * The flags determine what is actually done. 
 
95
   * The flags determine what is actually done.
94
96
   *
95
97
   * relative: treat the argument as a directory and convert it to make it
96
98
   * relative or full or unchanged. If relative (HOME, START etc) then that
115
117
    * Get path for the specified relative root.
116
118
    */
117
119
  const char* GetRelativeRootPath(RelativeRoot relroot);
118
 
  
 
120
 
119
121
  /**
120
122
   * Convert the given path to an output path that is optionally
121
123
   * relative based on the cache option CMAKE_USE_RELATIVE_PATHS.  The
124
126
   */
125
127
  std::string ConvertToOptionallyRelativeOutputPath(const char* remote);
126
128
 
127
 
  ///! set/get the parent generator 
 
129
  ///! set/get the parent generator
128
130
  cmLocalGenerator* GetParent(){return this->Parent;}
129
131
  void SetParent(cmLocalGenerator* g) { this->Parent = g; g->AddChild(this); }
130
132
 
131
133
  ///! set/get the children
132
134
  void AddChild(cmLocalGenerator* g) { this->Children.push_back(g); }
133
135
  std::vector<cmLocalGenerator*>& GetChildren() { return this->Children; };
134
 
    
 
136
 
135
137
 
136
138
  void AddArchitectureFlags(std::string& flags, cmTarget* target,
137
139
                            const char *lang, const char* config);
141
143
  void AddSharedFlags(std::string& flags, const char* lang, bool shared);
142
144
  void AddConfigVariableFlags(std::string& flags, const char* var,
143
145
                              const char* config);
 
146
  ///! Append flags to a string.
144
147
  virtual void AppendFlags(std::string& flags, const char* newFlags);
145
148
  ///! Get the include flags for the current makefile and language
146
149
  const char* GetIncludeFlags(const char* lang,
177
180
      path and short path if spaces.  */
178
181
  std::string ConvertToOutputForExisting(RelativeRoot remote,
179
182
                                         const char* local = 0);
180
 
  
 
183
 
 
184
  virtual std::string ConvertToIncludeReference(std::string const& path);
 
185
 
181
186
  /** Called from command-line hook to clear dependencies.  */
182
 
  virtual void ClearDependencies(cmMakefile* /* mf */, 
 
187
  virtual void ClearDependencies(cmMakefile* /* mf */,
183
188
                                 bool /* verbose */) {}
184
 
  
 
189
 
185
190
  /** Called from command-line hook to update dependencies.  */
186
191
  virtual bool UpdateDependencies(const char* /* tgtInfo */,
187
192
                                  bool /*verbose*/,
255
260
  /** Return the directories into which object files will be put.
256
261
   *  There maybe more than one for fat binary systems like OSX.
257
262
   */
258
 
  virtual void 
 
263
  virtual void
259
264
  GetTargetObjectFileDirectories(cmTarget* target,
260
 
                                 std::vector<std::string>& 
 
265
                                 std::vector<std::string>&
261
266
                                 dirs);
262
 
  
 
267
 
263
268
  /**
264
269
   * Convert the given remote path to a relative path with respect to
265
270
   * the given local path.  The local path must be given in component
317
322
 
318
323
  /** Fill out these strings for the given target.  Libraries to link,
319
324
   *  flags, and linkflags. */
320
 
  void GetTargetFlags(std::string& linkLibs, 
 
325
  void GetTargetFlags(std::string& linkLibs,
321
326
                      std::string& flags,
322
327
                      std::string& linkFlags,
323
328
                      cmTarget&target);
324
 
  
 
329
 
325
330
protected:
326
331
  ///! put all the libraries for a target on into the given stream
327
332
  virtual void OutputLinkLibraries(std::ostream&, cmTarget&, bool relink);
328
 
  
 
333
 
329
334
  // Expand rule variables in CMake of the type found in language rules
330
335
  void ExpandRuleVariables(std::string& string,
331
336
                           const RuleVariables& replaceValues);
337
342
  void InsertRuleLauncher(std::string& s, cmTarget* target,
338
343
                          const char* prop);
339
344
 
340
 
  
341
 
  /** Convert a target to a utility target for unsupported 
 
345
 
 
346
  /** Convert a target to a utility target for unsupported
342
347
   *  languages of a generator */
343
348
  void AddBuildTargetRule(const char* llang, cmTarget& target);
344
 
  ///! add a custom command to build a .o file that is part of a target 
345
 
  void AddCustomCommandToCreateObject(const char* ofname, 
346
 
                                      const char* lang, 
 
349
  ///! add a custom command to build a .o file that is part of a target
 
350
  void AddCustomCommandToCreateObject(const char* ofname,
 
351
                                      const char* lang,
347
352
                                      cmSourceFile& source,
348
353
                                      cmTarget& target);
349
354
  // Create Custom Targets and commands for unsupported languages
367
372
  std::string FindRelativePathTopBinary();
368
373
  void SetupPathConversions();
369
374
 
370
 
  std::string ConvertToLinkReference(std::string const& lib);
 
375
  virtual std::string ConvertToLinkReference(std::string const& lib);
371
376
 
372
377
  /** Check whether the native build system supports the given
373
378
      definition.  Issues a warning.  */