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

« back to all changes in this revision

Viewing changes to Source/cmMakefile.h

  • Committer: Bazaar Package Importer
  • Author(s): A. Maitland Bottoms
  • Date: 2005-03-02 09:22:44 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050302092244-y6o9j8wr27vqcqvx
Tags: 2.0.5-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*=========================================================================
2
2
 
3
 
  Program:   Insight Segmentation & Registration Toolkit
 
3
  Program:   CMake - Cross-Platform Makefile Generator
4
4
  Module:    $RCSfile: cmMakefile.h,v $
5
5
  Language:  C++
6
 
  Date:      $Date: 2002/01/15 20:46:34 $
7
 
  Version:   $Revision: 1.92 $
8
 
 
9
 
Copyright (c) 2001 Insight Consortium
10
 
All rights reserved.
11
 
 
12
 
Redistribution and use in source and binary forms, with or without
13
 
modification, are permitted provided that the following conditions are met:
14
 
 
15
 
 * Redistributions of source code must retain the above copyright notice,
16
 
   this list of conditions and the following disclaimer.
17
 
 
18
 
 * Redistributions in binary form must reproduce the above copyright notice,
19
 
   this list of conditions and the following disclaimer in the documentation
20
 
   and/or other materials provided with the distribution.
21
 
 
22
 
 * The name of the Insight Consortium, nor the names of any consortium members,
23
 
   nor of any contributors, may be used to endorse or promote products derived
24
 
   from this software without specific prior written permission.
25
 
 
26
 
  * Modified source versions must be plainly marked as such, and must not be
27
 
    misrepresented as being the original software.
28
 
 
29
 
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
30
 
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
31
 
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
32
 
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
33
 
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34
 
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
35
 
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
36
 
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
37
 
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38
 
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
6
  Date:      $Date: 2004/05/25 15:31:22 $
 
7
  Version:   $Revision: 1.147.2.1 $
 
8
 
 
9
  Copyright (c) 2002 Kitware, Inc., Insight Consortium.  All rights reserved.
 
10
  See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
 
11
 
 
12
     This software is distributed WITHOUT ANY WARRANTY; without even 
 
13
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
 
14
     PURPOSE.  See the above copyright notices for more information.
39
15
 
40
16
=========================================================================*/
41
17
#ifndef cmMakefile_h
42
18
#define cmMakefile_h
43
19
 
44
 
#include "cmStandardIncludes.h"
45
20
#include "cmData.h"
46
 
#include "cmSourceFile.h"
47
21
#include "cmSystemTools.h"
48
22
#include "cmSourceGroup.h"
49
23
#include "cmTarget.h"
 
24
#include "cmListFileCache.h"
50
25
#include "cmCacheManager.h"
51
26
 
 
27
#include <cmsys/RegularExpression.hxx>
 
28
 
52
29
class cmFunctionBlocker;
53
30
class cmCommand;
54
 
class cmMakefileGenerator;
 
31
class cmLocalGenerator;
 
32
class cmMakeDepend;
 
33
class cmSourceFile;
 
34
class cmVariableWatch;
 
35
class cmake;
55
36
 
56
37
/** \class cmMakefile
57
38
 * \brief Process the input CMakeLists.txt file.
66
47
  /**
67
48
   * Return major and minor version numbers for cmake.
68
49
   */
69
 
  static unsigned int GetMajorVersion() { return 1;}
70
 
  static unsigned int GetMinorVersion() { return 2;}
71
 
  static const char *GetReleaseVersion() { return "release";}
 
50
  static unsigned int GetMajorVersion() { return CMake_VERSION_MAJOR; }
 
51
  static unsigned int GetMinorVersion() { return CMake_VERSION_MINOR; }
 
52
  static const char* GetReleaseVersion();
72
53
  
73
54
  /**
74
55
   * Return the major and minor version of the cmake that
75
56
   * was used to write the currently loaded cache, note
76
57
   * this method will not work before the cache is loaded.
77
58
   */
78
 
  static unsigned int GetCacheMajorVersion();
79
 
  static unsigned int GetCacheMinorVersion();
 
59
  unsigned int GetCacheMajorVersion();
 
60
  unsigned int GetCacheMinorVersion();
80
61
  
81
62
  /**
82
63
   * Construct an empty makefile.
94
75
  bool ReadListFile(const char* listfile, const char* external= 0); 
95
76
 
96
77
  /**
97
 
   * Add a wrapper generator.
98
 
   */
99
 
  void AddCommand(cmCommand* );
100
 
 
101
 
  /**
102
78
   * Add a function blocker to this makefile
103
79
   */
104
80
  void AddFunctionBlocker(cmFunctionBlocker *fb)
105
 
    { m_FunctionBlockers.insert(fb);}
 
81
    { m_FunctionBlockers.push_back(fb);}
106
82
  void RemoveFunctionBlocker(cmFunctionBlocker *fb)
107
 
    { m_FunctionBlockers.erase(fb);}
108
 
  void RemoveFunctionBlocker(const char *name, const std::vector<std::string> &args);
 
83
    { m_FunctionBlockers.remove(fb);}
 
84
  void RemoveFunctionBlocker(const cmListFileFunction& lff);
 
85
 
 
86
  /**
 
87
   * Add file to the written file list. These file should not be in the list
 
88
   * of dependencies because they cause infinite loops.
 
89
   */
 
90
  void AddWrittenFile(const char* file);
 
91
  bool HasWrittenFile(const char* file);
 
92
 
 
93
  /**
 
94
   * Check if there are any infinite loops
 
95
   */
 
96
  bool CheckInfiniteLoops();
109
97
  
110
98
  /**
 
99
   * Try running cmake and building a file. This is used for dynalically
 
100
   * loaded commands, not as part of the usual build process.
 
101
   */
 
102
  int TryCompile(const char *srcdir, const char *bindir, 
 
103
                 const char *projectName, const char *targetName,
 
104
                 const std::vector<std::string> *cmakeArgs,
 
105
                 std::string *output);
 
106
    
 
107
  /**
111
108
   * Specify the makefile generator. This is platform/compiler
112
109
   * dependent, although the interface is through a generic
113
110
   * superclass.
114
111
   */
115
 
  void SetMakefileGenerator(cmMakefileGenerator*);
 
112
  void SetLocalGenerator(cmLocalGenerator*);
116
113
  
117
114
  ///! Get the current makefile generator.
118
 
  cmMakefileGenerator* GetMakefileGenerator() 
119
 
    { return m_MakefileGenerator;}
 
115
  cmLocalGenerator* GetLocalGenerator() 
 
116
    { return m_LocalGenerator;}
120
117
 
121
118
  /**
122
 
   * Produce the output makefile.
 
119
   * Perform FinalPass, Library dependency analysis etc before output of the
 
120
   * makefile.  
123
121
   */
124
 
  void GenerateMakefile();
 
122
  void ConfigureFinalPass();
125
123
  
126
124
  /**
127
125
   * run the final pass on all commands.
136
134
  /**
137
135
   * Add a custom command to the build.
138
136
   */
 
137
  void AddCustomCommandToOutput(const char* output,
 
138
                                const char* command,
 
139
                                const std::vector<std::string>& commandArgs,
 
140
                                const char *main_dependency,
 
141
                                const std::vector<std::string>& depends,
 
142
                                const char *comment = 0,
 
143
                                bool replace = false);
 
144
  void AddCustomCommandToTarget(const char* target,
 
145
                                const char* command,
 
146
                                const std::vector<std::string>& commandArgs,
 
147
                                cmTarget::CustomCommandType type,
 
148
                                const char *comment = 0);
 
149
  void AddCustomCommandToTarget(const char* target,
 
150
                                const char* command,
 
151
                                const std::vector<std::string>& commandArgs,
 
152
                                cmTarget::CustomCommandType type,
 
153
                                const char *comment,
 
154
                                const std::vector<std::string>& depends);
 
155
  
 
156
  /**
 
157
   * Add a custom command to the build.
 
158
   */
139
159
  void AddCustomCommand(const char* source,
140
160
                        const char* command,
141
161
                        const std::vector<std::string>& commandArgs,
142
162
                        const std::vector<std::string>& depends,
143
163
                        const std::vector<std::string>& outputs,
144
 
                        const char *target);
 
164
                        const char *target,
 
165
                        const char *comment = 0);
145
166
 
146
167
  void AddCustomCommand(const char* source,
147
168
                        const char* command,
154
175
   * Add a define flag to the build.
155
176
   */
156
177
  void AddDefineFlag(const char* definition);
 
178
  void RemoveDefineFlag(const char* definition);
157
179
 
158
180
  /**
159
181
   * Add an executable to the build.
160
182
   */
161
 
  void AddExecutable(const char *exename, 
 
183
  cmTarget* AddExecutable(const char *exename, 
162
184
                     const std::vector<std::string> &srcs);
163
 
  void AddExecutable(const char *exename, 
164
 
                     const std::vector<std::string> &srcs, bool win32);
165
185
 
166
186
  /**
167
187
   * Add a utility to the build.  A utiltity target is
170
190
  void AddUtilityCommand(const char* utilityName,
171
191
                         const char* command,
172
192
                         const char* arguments,
173
 
                         bool all);
 
193
                         bool all,
 
194
                         const std::vector<std::string> &depends);
174
195
  void AddUtilityCommand(const char* utilityName,
175
196
                         const char* command,
176
197
                         const char* arguments,
179
200
                         const std::vector<std::string> &outputs);
180
201
 
181
202
  /**
182
 
   * Get a list of link libraries in the build.
183
 
   */
184
 
  cmTarget::LinkLibraries& GetLinkLibraries()
185
 
    { 
186
 
    return m_LinkLibraries;
187
 
    }
188
 
 
189
 
  /**
190
 
   * Get a list of link libraries in the build.
191
 
   */
192
 
  const cmTarget::LinkLibraries& GetLinkLibraries() const
193
 
    { 
194
 
    return m_LinkLibraries;
195
 
    }
196
 
 
197
 
  /**
198
203
   * Add a link library to the build.
199
204
   */
200
205
  void AddLinkLibrary(const char*);
201
206
  void AddLinkLibrary(const char*, cmTarget::LinkLibraryType type);
202
207
  void AddLinkLibraryForTarget(const char *tgt, const char*, 
203
208
                               cmTarget::LinkLibraryType type);
 
209
  void AddLinkDirectoryForTarget(const char *tgt, const char* d);
204
210
 
205
211
  /**
206
212
   * Add a link directory to the build.
208
214
  void AddLinkDirectory(const char*);
209
215
 
210
216
  /**
 
217
   * Get the list of link directories
 
218
   */
 
219
  std::vector<std::string>& GetLinkDirectories()
 
220
    {
 
221
    return m_LinkDirectories;
 
222
    }
 
223
  const std::vector<std::string>& GetLinkDirectories() const
 
224
    {
 
225
    return m_LinkDirectories;
 
226
    }
 
227
  void SetLinkDirectories(const std::vector<std::string>& vec)
 
228
    {
 
229
    m_LinkDirectories = vec;
 
230
    }
 
231
 
 
232
  /**
211
233
   * Add a subdirectory to the build.
212
234
   */
213
 
  void AddSubDirectory(const char*);
 
235
  void AddSubDirectory(const char*, bool includeTopLevel=true, bool preorder = false);
214
236
 
215
237
  /**
216
238
   * Add an include directory to the build.
218
240
  void AddIncludeDirectory(const char*, bool before = false);
219
241
 
220
242
  /**
 
243
   * Find a library (as in cmSystemTools) but add in compiler specific paths
 
244
   */
 
245
  std::string FindLibrary(const char* name,
 
246
                          const std::vector<std::string>& path);
 
247
 
 
248
  /**
221
249
   * Add a variable definition to the build. This variable
222
250
   * can be used in CMake to refer to lists, directories, etc.
223
251
   */
235
263
  void AddCacheDefinition(const char* name, bool, const char* doc);
236
264
 
237
265
  /**
 
266
   * Remove a variable definition from the build.  This is not valid
 
267
   * for cache entries, and will only affect the current makefile.
 
268
   */
 
269
  void RemoveDefinition(const char* name);
 
270
  
 
271
  /**
238
272
   * Specify the name of the project for this build.
239
273
   */
240
274
  void SetProjectName(const char*);
247
281
    return m_ProjectName.c_str();
248
282
    }
249
283
  
 
284
  std::vector<std::string> const& GetParentProjects()
 
285
    {
 
286
      return m_ParentProjects;
 
287
    }
250
288
  /**
251
289
   * Set the name of the library.
252
290
   */
254
292
                  const std::vector<std::string> &srcs);
255
293
 
256
294
  /**
257
 
   * Add a class/source file to the build.
258
 
   */
259
 
  void AddSource(cmSourceFile& ,const char *srcListName);
260
 
 
261
 
  /**
262
 
   * Remove a class/source file from the build.
263
 
   */
264
 
  void RemoveSource(cmSourceFile& ,const char *srcListName);
265
 
 
266
 
  /**
267
295
   * Add a source group for consideration when adding a new source.
268
296
   */
269
 
  void AddSourceGroup(const char* name, const char* regex);
 
297
  void AddSourceGroup(const char* name, const char* regex=0);
270
298
  
271
299
  /**
272
300
   * Add an auxiliary directory to the build.
281
309
    {
282
310
      m_cmCurrentDirectory = m_cmStartDirectory;
283
311
      m_CurrentOutputDirectory = m_StartOutputDirectory;
 
312
      this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR", m_cmCurrentDirectory.c_str());
 
313
      this->AddDefinition("CMAKE_CURRENT_BINARY_DIR", m_CurrentOutputDirectory.c_str());
284
314
    }
285
315
  
286
316
  //@{
344
374
    {
345
375
      m_cmCurrentDirectory = dir;
346
376
      cmSystemTools::ConvertToUnixSlashes(m_cmCurrentDirectory);
 
377
      this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR", m_cmCurrentDirectory.c_str());
347
378
    }
348
379
  const char* GetCurrentDirectory() const 
349
380
    {
353
384
    {
354
385
      m_CurrentOutputDirectory = lib;
355
386
      cmSystemTools::ConvertToUnixSlashes(m_CurrentOutputDirectory);
 
387
      this->AddDefinition("CMAKE_CURRENT_BINARY_DIR", m_CurrentOutputDirectory.c_str());
356
388
    }
357
389
  const char* GetCurrentOutputDirectory() const
358
390
    {
377
409
    {
378
410
      m_IncludeFileRegularExpression = regex;
379
411
    }
 
412
  const char* GetIncludeRegularExpression()
 
413
    { 
 
414
      return m_IncludeFileRegularExpression.c_str();
 
415
    }
380
416
 
381
417
  /** 
382
418
   * Set a regular expression that include files that are not found
396
432
  /**
397
433
   * Get a list of the build subdirectories.
398
434
   */
399
 
  const std::vector<std::string>& GetSubDirectories()
 
435
  const std::vector<std::pair<cmStdString, bool> >& GetSubDirectories()
400
436
    { 
401
437
    return m_SubDirectories;
402
438
    }
412
448
    { 
413
449
    return m_IncludeDirectories;
414
450
    }
415
 
 
416
 
  /**
417
 
   * Get a list of link directories in the build.
418
 
   */
419
 
  std::vector<std::string>& GetLinkDirectories()
420
 
    { 
421
 
    return m_LinkDirectories;
 
451
  void SetIncludeDirectories(const std::vector<std::string>& vec)
 
452
    {
 
453
    m_IncludeDirectories = vec;
422
454
    }
423
 
  
424
 
  /**
425
 
   * Return a list of source files in this makefile.
426
 
   */
427
 
  typedef std::map<cmStdString,std::vector<cmSourceFile> > SourceMap;
428
 
  const SourceMap &GetSources() const {return  m_Sources;}
429
 
  SourceMap &GetSources() {return  m_Sources;}
430
 
  cmSourceFile *GetSource(const char *srclist, const char *sourceName);
 
455
 
 
456
  /** Expand out any arguements in the vector that have ; separated
 
457
   *  strings into multiple arguements.  A new vector is created 
 
458
   *  containing the expanded versions of all arguments in argsIn.
 
459
   * This method differes from the one in cmSystemTools in that if
 
460
   * the CmakeLists file is version 1.2 or earlier it will check for
 
461
   * source lists being used without ${} around them
 
462
   */
 
463
  void ExpandSourceListArguments(std::vector<std::string> const& argsIn,
 
464
                                 std::vector<std::string>& argsOut,
 
465
                                 unsigned int startArgumentIndex);
 
466
 
 
467
  /** Get a cmSourceFile pointer for a given source name, if the name is
 
468
   *  not found, then a null pointer is returned.
 
469
   */
 
470
  cmSourceFile* GetSource(const char* sourceName) const;
 
471
  ///! Add a new cmSourceFile to the list of sources for this makefile.
 
472
  cmSourceFile* AddSource(cmSourceFile const&);
 
473
 
 
474
  /** Get a cmSourceFile pointer for a given source name, if the name is
 
475
   *  not found, then create the source file and return it. generated 
 
476
   * indicates if it is a generated file, this is used in determining
 
477
   * how to create the source file instance e.g. name
 
478
   */
 
479
  cmSourceFile* GetOrCreateSource(const char* sourceName, 
 
480
                                  bool generated = false);
431
481
  
432
482
  /**
433
483
   * Obtain a list of auxiliary source directories.
452
502
   * cache is then queried.
453
503
   */
454
504
  const char* GetDefinition(const char*) const;
 
505
  const char* GetSafeDefinition(const char*) const;
 
506
 
 
507
  /**
 
508
   * Get the list of all variables in the current space. If argument
 
509
   * cacheonly is specified and is greater than 0, then only cache
 
510
   * variables will be listed.
 
511
   */
 
512
  std::vector<std::string> GetDefinitions(int cacheonly=0) const;
455
513
  
456
514
  /** Test a boolean cache entry to see if it is true or false, 
457
515
   *  returns false if no entry defined.
458
516
   */
459
 
  bool IsOn(const char* name);
 
517
  bool IsOn(const char* name) const;
460
518
 
461
519
  /**
462
520
   * Get a list of preprocessor define flags.
477
535
    { return m_SourceGroups; }
478
536
 
479
537
  /**
 
538
   * Get the source group
 
539
   */
 
540
  cmSourceGroup* GetSourceGroup(const char* name); 
 
541
 
 
542
  /**
480
543
   * Get the vector of list files on which this makefile depends
481
544
   */
482
545
  const std::vector<std::string>& GetListFiles() const
487
550
    { m_ListFiles.push_back(file);}
488
551
  
489
552
  /**
490
 
   * Dump documentation to a file. If 0 is returned, the
491
 
   * operation failed.
492
 
   */
493
 
  int DumpDocumentationToFile(std::ostream&);
494
 
 
495
 
  /**
496
 
   * Expand all defined varibles in the string.  
497
 
   * Defined varibles come from the m_Definitions map.
 
553
   * Expand all defined variables in the string.  
 
554
   * Defined variables come from the m_Definitions map.
498
555
   * They are expanded with ${var} where var is the
499
556
   * entry in the m_Definitions map.  Also @var@ is
500
557
   * expanded to match autoconf style expansions.
513
570
   * Expand variables in the makefiles ivars such as link directories etc
514
571
   */
515
572
  void ExpandVariables();  
516
 
 
517
 
  /** Recursivly read and create a cmMakefile object for
518
 
   *  all CMakeLists.txt files in the GetSubDirectories list.
519
 
   *  Once the file is found, it ReadListFile is called on
520
 
   *  the cmMakefile created for it.
521
 
   */
522
 
  void FindSubDirectoryCMakeListsFiles(std::vector<cmMakefile*>& makefiles);
523
 
  
 
573
  void ExpandVariablesInCustomCommands();
 
574
 
 
575
  /**
 
576
   * Replace variables and #cmakedefine lines in the given string.
 
577
   * See cmConfigureFileCommand for details.
 
578
   */
 
579
  void ConfigureString(const std::string& input, std::string& output,
 
580
                       bool atOnly, bool escapeQuotes);
 
581
 
 
582
  /**
 
583
   * Copy file but change lines acording to ConfigureString
 
584
   */
 
585
  int ConfigureFile(const char* infile, const char* outfile, 
 
586
    bool copyonly, bool atOnly, bool escapeQuotes);
 
587
 
524
588
  /**
525
589
   * find what source group this source is in
526
590
   */
527
591
  cmSourceGroup& FindSourceGroup(const char* source,
528
592
                                 std::vector<cmSourceGroup> &groups);
529
 
 
530
593
  void RegisterData(cmData*);
531
594
  void RegisterData(const char*, cmData*);
532
595
  cmData* LookupData(const char*) const;
533
596
  
534
597
  /**
535
 
   * execute a single CMake command
 
598
   * Execute a single CMake command.  Returns true if the command
 
599
   * succeeded or false if it failed.
536
600
   */
537
 
  void ExecuteCommand(std::string &name, std::vector<std::string> const& args);
 
601
  bool ExecuteCommand(const cmListFileFunction& lff);
538
602
  
539
603
  /** Check if a command exists. */
540
604
  bool CommandExists(const char* name) const;
541
605
    
 
606
  /**
 
607
   * Add a command to this cmake instance
 
608
   */
 
609
  void AddCommand(cmCommand* );
 
610
 
 
611
  ///! Enable support for the named language, if null then all languages are enabled.
 
612
  void EnableLanguage(const char* );
 
613
 
 
614
  /**
 
615
   * Set/Get the name of the parent directories CMakeLists file
 
616
   * given a current CMakeLists file name
 
617
   */
 
618
  cmCacheManager *GetCacheManager() const;
 
619
  cmVariableWatch* GetVariableWatch() const;
 
620
 
 
621
  //! Determine wether this is a local or global build.
 
622
  bool GetLocal() const;
 
623
 
 
624
  ///! Display progress or status message.
 
625
  void DisplayStatus(const char*, float);
 
626
  
 
627
  /**
 
628
   * Expand the given list file arguments into the full set after
 
629
   * variable replacement and list expansion.
 
630
   */
 
631
  void ExpandArguments(std::vector<cmListFileArgument> const& inArgs,
 
632
                       std::vector<std::string>& outArgs);
 
633
  /**
 
634
   * Get the instance
 
635
   */ 
 
636
  cmake *GetCMakeInstance() const;
 
637
 
 
638
  /**
 
639
   * Get all the source files this makefile knows about
 
640
   */
 
641
  const std::vector<cmSourceFile*> &GetSourceFiles() const 
 
642
    {return m_SourceFiles;}
 
643
  std::vector<cmSourceFile*> &GetSourceFiles() {return m_SourceFiles;}
 
644
 
 
645
  /**
 
646
   * Is there a source file that has the provided source file as an output?
 
647
   * if so then return it
 
648
   */
 
649
  cmSourceFile *GetSourceFileWithOutput(const char *outName);
 
650
 
 
651
  /**
 
652
   * Add a macro to the list of macros. The arguments should be name of the
 
653
   * macro and a documentation signature of it 
 
654
   */
 
655
  void AddMacro(const char* name, const char* signature);
 
656
 
 
657
  /**
 
658
   * Get a list of macros as a ; separated string
 
659
   */
 
660
  void GetListOfMacros(std::string& macros);
 
661
 
 
662
  /**
 
663
   * Return a location of a file in cmake or custom modules directory
 
664
   */
 
665
  std::string GetModulesFile(const char* name);
 
666
 
 
667
  ///! Return true if the directory is preorder.
 
668
  bool IsDirectoryPreOrder(const char* dir);
 
669
  
 
670
  ///! Set/Get a property of this directory 
 
671
  void SetProperty(const char *prop, const char *value);
 
672
  const char *GetProperty(const char *prop) const;
 
673
  bool GetPropertyAsBool(const char *prop) const;
 
674
 
542
675
protected:
 
676
  // add link libraries and directories to the target
 
677
  void AddGlobalLinkInformation(const char* name, cmTarget& target);
 
678
  
543
679
  std::string m_Prefix;
544
680
  std::vector<std::string> m_AuxSourceDirectories; // 
545
681
 
551
687
  std::string m_HomeOutputDirectory;
552
688
  std::string m_cmCurrentListFile;
553
689
 
554
 
  std::string m_ProjectName;    // project name
 
690
  std::string m_ProjectName;    // project name
 
691
  std::vector<std::string> m_ParentProjects;
555
692
 
556
693
  // libraries, classes, and executables
557
694
  cmTargets m_Targets;
558
 
  SourceMap m_Sources; 
 
695
  std::vector<cmSourceFile*> m_SourceFiles;
559
696
 
560
 
  std::vector<std::string> m_SubDirectories; // list of sub directories
 
697
  std::vector<std::pair<cmStdString, bool> > m_SubDirectories; // list of sub directories
561
698
  struct StringSet : public std::set<cmStdString>
562
699
  {
563
700
  };
578
715
  std::vector<std::string> m_HeaderFileExtensions;
579
716
  std::string m_DefineFlags;
580
717
  std::vector<cmSourceGroup> m_SourceGroups;
581
 
  typedef std::map<cmStdString, cmCommand*> RegisteredCommandsMap;
582
718
  typedef std::map<cmStdString, cmStdString> DefinitionMap;
583
719
  DefinitionMap m_Definitions;
584
 
  RegisteredCommandsMap m_Commands;
585
720
  std::vector<cmCommand*> m_UsedCommands;
586
 
  cmMakefileGenerator* m_MakefileGenerator;
587
 
  bool IsFunctionBlocked(const char *name, std::vector<std::string> const& args);
 
721
  cmLocalGenerator* m_LocalGenerator;
 
722
  bool IsFunctionBlocked(const cmListFileFunction& lff);
588
723
  
589
724
private:
590
725
  /**
594
729
  std::string GetParentListFileName(const char *listFileName);
595
730
 
596
731
  void ReadSources(std::ifstream& fin, bool t);
597
 
  friend class cmMakeDepend;    // make depend needs direct access 
598
 
                                // to the m_Sources array 
 
732
  friend class cmMakeDepend;    // make depend needs direct access 
 
733
                                // to the m_Sources array 
 
734
  void PrintStringVector(const char* s, const std::vector<std::pair<cmStdString, bool> >& v) const;
599
735
  void PrintStringVector(const char* s, const std::vector<std::string>& v) const;
600
 
  void AddDefaultCommands();
601
736
  void AddDefaultDefinitions();
602
 
  std::set<cmFunctionBlocker *> m_FunctionBlockers;
603
 
  
 
737
  std::list<cmFunctionBlocker *> m_FunctionBlockers;
 
738
 
604
739
  typedef std::map<cmStdString, cmData*> DataMap;
605
740
  DataMap m_DataMap;
606
741
  bool m_Inheriting;
 
742
 
 
743
  typedef std::map<cmStdString, cmStdString> StringStringMap;
 
744
  StringStringMap m_MacrosMap;
 
745
 
 
746
  std::map<cmStdString, bool> m_SubDirectoryOrder;
 
747
  // used in AddDefinition for performance improvement
 
748
  DefinitionMap::key_type  m_TemporaryDefinitionKey;
 
749
 
 
750
  cmsys::RegularExpression m_cmDefineRegex;
 
751
 
 
752
  std::map<cmStdString,cmStdString> m_Properties;
607
753
};
608
754
 
609
755