~ubuntu-branches/ubuntu/jaunty/cmake/jaunty-security

« back to all changes in this revision

Viewing changes to Source/cmGlobalGenerator.h

  • Committer: Bazaar Package Importer
  • Author(s): A. Maitland Bottoms
  • Date: 2006-06-18 16:34:11 UTC
  • mfrom: (1.4.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060618163411-pi234s3v6jwlcmof
Tags: 2.4.2-1
* New upstream release (Closes: #338324)
* Put cmake .vim files into /usr/share/vim/addons/plugin/
  where they can be used. (Closes: #366663)
* Install cmake-mode.el so it can be used. (Closes: #366664)
* Ensure cmake FindKDE locates KDE libraries on Debian
  based distributions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
  Program:   CMake - Cross-Platform Makefile Generator
4
4
  Module:    $RCSfile: cmGlobalGenerator.h,v $
5
5
  Language:  C++
6
 
  Date:      $Date: 2005/09/15 20:38:36 $
7
 
  Version:   $Revision: 1.37.2.1 $
 
6
  Date:      $Date: 2006/05/11 20:05:57 $
 
7
  Version:   $Revision: 1.58.2.2 $
8
8
 
9
9
  Copyright (c) 2002 Kitware, Inc., Insight Consortium.  All rights reserved.
10
10
  See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
20
20
 
21
21
#include "cmStandardIncludes.h"
22
22
 
 
23
#include "cmTarget.h" // For cmTargets
 
24
 
23
25
class cmake;
24
26
class cmMakefile;
25
27
class cmLocalGenerator;
71
73
   * Try to determine system infomation such as shared library
72
74
   * extension, pthreads, byte order etc.  
73
75
   */
74
 
  virtual void EnableLanguage(std::vector<std::string>const& languages, cmMakefile *);
 
76
  virtual void EnableLanguage(std::vector<std::string>const& languages,
 
77
                              cmMakefile *);
75
78
 
76
79
  /**
77
80
   * Try to determine system infomation, get it from another generator
98
101
                    std::string *output, 
99
102
                    const char *makeProgram, const char *config,
100
103
                    bool clean);
101
 
  virtual std::string GenerateBuildCommand(const char* makeProgram,
102
 
    const char *projectName, const char *targetName,
103
 
    const char* config, bool ignoreErrors);
 
104
  virtual std::string GenerateBuildCommand
 
105
  (const char* makeProgram,
 
106
   const char *projectName, const char* additionalOptions, 
 
107
   const char *targetName,
 
108
   const char* config, bool ignoreErrors);
 
109
 
104
110
 
105
111
  ///! Set the CMake instance
106
 
  void SetCMakeInstance(cmake *cm) {
107
 
    this->m_CMakeInstance = cm; };
 
112
  void SetCMakeInstance(cmake *cm) { this->CMakeInstance = cm; };
108
113
  
109
114
  ///! Get the CMake instance
110
 
  cmake *GetCMakeInstance() {
111
 
    return this->m_CMakeInstance; };
112
 
 
113
 
  void SetConfiguredFilesPath(const char* s){m_ConfiguredFilesPath = s;}
114
 
  void GetLocalGenerators(std::vector<cmLocalGenerator *>&g) { g = m_LocalGenerators;}
 
115
  cmake *GetCMakeInstance() { return this->CMakeInstance; };
 
116
 
 
117
  void SetConfiguredFilesPath(const char* s){this->ConfiguredFilesPath = s;}
 
118
  cmLocalGenerator* GetLocalGenerator(int p) { 
 
119
    return this->LocalGenerators[p];}
 
120
  void GetLocalGenerators(std::vector<cmLocalGenerator *>&g) { 
 
121
    g = this->LocalGenerators;}
 
122
 
115
123
  void AddLocalGenerator(cmLocalGenerator *lg);
 
124
 
 
125
  void AddInstallComponent(const char* component);
116
126
  
117
127
  static int s_TryCompileTimeout;
118
128
  
119
 
  bool GetForceUnixPaths() {return m_ForceUnixPaths;}
 
129
  bool GetForceUnixPaths() {return this->ForceUnixPaths;}
 
130
  bool GetToolSupportsColor() { return this->ToolSupportsColor; }
120
131
  ///! return the language for the given extension
121
132
  const char* GetLanguageFromExtension(const char* ext);
122
133
  ///! is an extension to be ignored
128
139
  ///! What is the output extension for a given source file extension.
129
140
  const char* GetLanguageOutputExtensionFromExtension(const char* lang);
130
141
 
 
142
  ///! What is the configurations directory variable called?
 
143
  virtual const char* GetCMakeCFGInitDirectory()  { return "."; }
 
144
 
131
145
  /**
132
146
   * Convert the given remote path to a relative path with respect to
133
147
   * the given local path.  The local path must be given in component
149
163
  ///! Find a local generator by its startdirectory
150
164
  cmLocalGenerator* FindLocalGenerator(const char* start_dir);
151
165
 
 
166
  /** Append the subdirectory for the given configuration.  If anything is
 
167
      appended the given prefix and suffix will be appended around it, which
 
168
      is useful for leading or trailing slashes.  */
 
169
  virtual void AppendDirectoryForConfig(const char* prefix,
 
170
                                        const char* config,
 
171
                                        const char* suffix,
 
172
                                        std::string& dir);
 
173
 
 
174
  /** Get the manifest of all targets that will be built for each
 
175
      configuration.  This is valid during generation only.  */
 
176
  cmTargetManifest const& GetTargetManifest() { return this->TargetManifest; }
 
177
 
 
178
  void AddTarget(cmTargets::value_type &v) { 
 
179
    this->TotalTargets[v.first] = &v.second;};
 
180
  
 
181
  /** Support for multiple custom command outputs.  */
 
182
  virtual void CheckMultipleOutputs(cmMakefile* mf, bool verbose);
 
183
 
 
184
  virtual const char* GetAllTargetName()          { return "ALL_BUILD"; }
 
185
  virtual const char* GetInstallTargetName()      { return "INSTALL"; }
 
186
  virtual const char* GetPreinstallTargetName()   { return 0; }
 
187
  virtual const char* GetTestTargetName()         { return "RUN_TESTS"; }
 
188
  virtual const char* GetPackageTargetName()      { return "PACKAGE"; }
 
189
  virtual const char* GetPackageSourceTargetName(){ return 0; }
 
190
  virtual const char* GetEditCacheTargetName()    { return 0; }
 
191
  virtual const char* GetRebuildCacheTargetName() { return 0; }
 
192
 
152
193
protected:
153
 
  // Fill the m_ProjectMap, this must be called after m_LocalGenerators has been populated.
 
194
  // Fill the ProjectMap, this must be called after LocalGenerators 
 
195
  // has been populated.
154
196
  void FillProjectMap();
155
197
  bool IsExcluded(cmLocalGenerator* root, cmLocalGenerator* gen);
156
198
 
157
199
  void ConfigureRelativePaths();
158
200
  void SetupTests();
159
 
  
160
 
  bool m_ForceUnixPaths;
161
 
  cmStdString m_FindMakeProgramFile;
162
 
  cmStdString m_ConfiguredFilesPath;
163
 
  cmake *m_CMakeInstance;
164
 
  std::vector<cmLocalGenerator *> m_LocalGenerators;
 
201
 
 
202
  void CreateDefaultGlobalTargets(cmTargets* targets);
 
203
  cmTarget CreateGlobalTarget(const char* name, const char* message,
 
204
    const cmCustomCommandLines* commandLines,
 
205
    std::vector<std::string> depends, bool depends_on_all = false);
 
206
 
 
207
  bool ForceUnixPaths;
 
208
  bool ToolSupportsColor;
 
209
  cmStdString FindMakeProgramFile;
 
210
  cmStdString ConfiguredFilesPath;
 
211
  cmake *CMakeInstance;
 
212
  std::vector<cmLocalGenerator *> LocalGenerators;
165
213
  // map from project name to vector of local generators in that project
166
 
  std::map<cmStdString, std::vector<cmLocalGenerator*> > m_ProjectMap;
 
214
  std::map<cmStdString, std::vector<cmLocalGenerator*> > ProjectMap;
 
215
 
 
216
  // Set of named installation components requested by the project.
 
217
  std::set<cmStdString> InstallComponents;
 
218
 
 
219
  // Manifest of all targets that will be built for each configuration.
 
220
  // This is computed just before local generators generate.
 
221
  cmTargetManifest TargetManifest;
167
222
 
168
223
private:
169
224
  // If you add a new map here, make sure it is copied
170
225
  // in EnableLanguagesFromGenerator 
171
 
  std::map<cmStdString, bool> m_IgnoreExtensions;
172
 
  std::map<cmStdString, bool> m_LanguageEnabled;
173
 
  std::map<cmStdString, cmStdString> m_OutputExtensions;
174
 
  std::map<cmStdString, cmStdString> m_LanguageToOutputExtension;
175
 
  std::map<cmStdString, cmStdString> m_ExtensionToLanguage;
176
 
  std::map<cmStdString, cmStdString> m_LanguageToLinkerPreference; 
 
226
  std::map<cmStdString, bool> IgnoreExtensions;
 
227
  std::map<cmStdString, bool> LanguageEnabled;
 
228
  std::map<cmStdString, cmStdString> OutputExtensions;
 
229
  std::map<cmStdString, cmStdString> LanguageToOutputExtension;
 
230
  std::map<cmStdString, cmStdString> ExtensionToLanguage;
 
231
  std::map<cmStdString, cmStdString> LanguageToLinkerPreference; 
177
232
 
178
233
  // The paths to the tops of the source and binary trees used for
179
234
  // relative path computation.  A path must be either in the source
180
235
  // tree or the build tree to be converted to a relative path.  The
181
236
  // ConfigureRelativePaths method may set these to be empty when
182
237
  // using relative paths is unsafe.
183
 
  std::string m_RelativePathTopSource;
184
 
  std::string m_RelativePathTopBinary;
 
238
  std::string RelativePathTopSource;
 
239
  std::string RelativePathTopBinary;
 
240
 
 
241
  // this is used to improve performance 
 
242
  std::map<cmStdString,cmTarget *> TotalTargets;
185
243
};
186
244
 
187
245
#endif