Resync
[CMakeLuaTailorHgBridge.git] / CMakeLua / Source / cmMakefile.h
blob9a91e5f5e34d482bb6f51e61e82548f378d9d0b9
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmMakefile.h,v $
5 Language: C++
6 Date: $Date: 2008-03-31 17:33:09 $
7 Version: $Revision: 1.231 $
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.
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.
16 =========================================================================*/
17 #ifndef cmMakefile_h
18 #define cmMakefile_h
20 #include "cmCacheManager.h"
21 #include "cmData.h"
22 #include "cmExecutionStatus.h"
23 #include "cmListFileCache.h"
24 #include "cmPolicies.h"
25 #include "cmPropertyMap.h"
26 #include "cmSystemTools.h"
27 #include "cmTarget.h"
28 #include "cmake.h"
30 #if defined(CMAKE_BUILD_WITH_CMAKE)
31 #include "cmSourceGroup.h"
32 #endif
34 #include <cmsys/RegularExpression.hxx>
36 class cmFunctionBlocker;
37 class cmCommand;
38 class cmInstallGenerator;
39 class cmLocalGenerator;
40 class cmMakeDepend;
41 class cmSourceFile;
42 class cmTest;
43 class cmVariableWatch;
44 class cmake;
45 class cmMakefileCall;
47 /** \class cmMakefile
48 * \brief Process the input CMakeLists.txt file.
50 * Process and store into memory the input CMakeLists.txt file.
51 * Each CMakeLists.txt file is parsed and the commands found there
52 * are added into the build process.
54 class cmMakefile
56 public:
57 /**
58 * Return the major and minor version of the cmake that
59 * was used to write the currently loaded cache, note
60 * this method will not work before the cache is loaded.
62 unsigned int GetCacheMajorVersion();
63 unsigned int GetCacheMinorVersion();
65 /** Return whether compatibility features needed for a version of
66 the cache or lower should be enabled. */
67 bool NeedCacheCompatibility(int major, int minor);
69 /**
70 * Construct an empty makefile.
72 cmMakefile();
73 cmMakefile(const cmMakefile& mf);
75 /**
76 * Destructor.
78 ~cmMakefile();
80 /**
81 * Read and parse a CMakeLists.txt file.
83 bool ReadListFile(const char* listfile,
84 const char* external= 0,
85 std::string* fullPath= 0);
87 /**
88 * Add a function blocker to this makefile
90 void AddFunctionBlocker(cmFunctionBlocker *fb)
91 { this->FunctionBlockers.push_back(fb);}
92 void RemoveFunctionBlocker(cmFunctionBlocker *fb)
93 { this->FunctionBlockers.remove(fb);}
94 void RemoveFunctionBlocker(const cmListFileFunction& lff);
96 /**
97 * Add file to the written file list. These file should not be in the list
98 * of dependencies because they cause infinite loops.
100 void AddWrittenFile(const char* file);
101 bool HasWrittenFile(const char* file);
104 * Check if there are any infinite loops
106 bool CheckInfiniteLoops();
109 * Try running cmake and building a file. This is used for dynalically
110 * loaded commands, not as part of the usual build process.
112 int TryCompile(const char *srcdir, const char *bindir,
113 const char *projectName, const char *targetName,
114 const std::vector<std::string> *cmakeArgs,
115 std::string *output);
118 * Specify the makefile generator. This is platform/compiler
119 * dependent, although the interface is through a generic
120 * superclass.
122 void SetLocalGenerator(cmLocalGenerator*);
124 ///! Get the current makefile generator.
125 cmLocalGenerator* GetLocalGenerator()
126 { return this->LocalGenerator;}
129 * Test whether compatibility is set to a given version or lower.
131 bool NeedBackwardsCompatibility(unsigned int major,
132 unsigned int minor,
133 unsigned int patch = 0xFFu);
136 * Help enforce global target name uniqueness.
138 bool EnforceUniqueName(std::string const& name, std::string& msg,
139 bool isCustom = false);
142 * Perform FinalPass, Library dependency analysis etc before output of the
143 * makefile.
145 void ConfigureFinalPass();
148 * run the final pass on all commands.
150 void FinalPass();
153 * Print the object state to std::cout.
155 void Print();
157 /** Add a custom command to the build. */
158 void AddCustomCommandToTarget(const char* target,
159 const std::vector<std::string>& depends,
160 const cmCustomCommandLines& commandLines,
161 cmTarget::CustomCommandType type,
162 const char* comment, const char* workingDir,
163 bool escapeOldStyle = true);
164 void AddCustomCommandToOutput(const std::vector<std::string>& outputs,
165 const std::vector<std::string>& depends,
166 const char* main_dependency,
167 const cmCustomCommandLines& commandLines,
168 const char* comment, const char* workingDir,
169 bool replace = false,
170 bool escapeOldStyle = true);
171 void AddCustomCommandToOutput(const char* output,
172 const std::vector<std::string>& depends,
173 const char* main_dependency,
174 const cmCustomCommandLines& commandLines,
175 const char* comment, const char* workingDir,
176 bool replace = false,
177 bool escapeOldStyle = true);
178 void AddCustomCommandOldStyle(const char* target,
179 const std::vector<std::string>& outputs,
180 const std::vector<std::string>& depends,
181 const char* source,
182 const cmCustomCommandLines& commandLines,
183 const char* comment);
186 * Add a define flag to the build.
188 void AddDefineFlag(const char* definition);
189 void RemoveDefineFlag(const char* definition);
191 /** Create a new imported target with the name and type given. */
192 cmTarget* AddImportedTarget(const char* name, cmTarget::TargetType type);
194 cmTarget* AddNewTarget(cmTarget::TargetType type, const char* name);
197 * Add an executable to the build.
199 cmTarget* AddExecutable(const char *exename,
200 const std::vector<std::string> &srcs,
201 bool excludeFromAll = false);
204 * Add a utility to the build. A utiltity target is a command that
205 * is run every time the target is built.
207 void AddUtilityCommand(const char* utilityName, bool excludeFromAll,
208 const std::vector<std::string>& depends,
209 const char* workingDirectory,
210 const char* command,
211 const char* arg1=0,
212 const char* arg2=0,
213 const char* arg3=0,
214 const char* arg4=0);
215 void AddUtilityCommand(const char* utilityName, bool excludeFromAll,
216 const char* workingDirectory,
217 const std::vector<std::string>& depends,
218 const cmCustomCommandLines& commandLines,
219 bool escapeOldStyle = true,
220 const char* comment = 0);
223 * Add a link library to the build.
225 void AddLinkLibrary(const char*);
226 void AddLinkLibrary(const char*, cmTarget::LinkLibraryType type);
227 void AddLinkLibraryForTarget(const char *tgt, const char*,
228 cmTarget::LinkLibraryType type);
229 void AddLinkDirectoryForTarget(const char *tgt, const char* d);
232 * Add a link directory to the build.
234 void AddLinkDirectory(const char*);
237 * Get the list of link directories
239 std::vector<std::string>& GetLinkDirectories()
241 return this->LinkDirectories;
243 const std::vector<std::string>& GetLinkDirectories() const
245 return this->LinkDirectories;
247 void SetLinkDirectories(const std::vector<std::string>& vec)
249 this->LinkDirectories = vec;
253 * Add a subdirectory to the build.
255 void AddSubDirectory(const char*, bool excludeFromAll=false,
256 bool preorder = false);
257 void AddSubDirectory(const char* fullSrcDir,const char *fullBinDir,
258 bool excludeFromAll, bool preorder,
259 bool immediate);
262 * Configure a subdirectory
264 void ConfigureSubDirectory(cmLocalGenerator *);
267 * Add an include directory to the build.
269 void AddIncludeDirectory(const char*, bool before = false);
272 * Add a variable definition to the build. This variable
273 * can be used in CMake to refer to lists, directories, etc.
275 void AddDefinition(const char* name, const char* value);
276 ///! Add a definition to this makefile and the global cmake cache.
277 void AddCacheDefinition(const char* name, const char* value,
278 const char* doc,
279 cmCacheManager::CacheEntryType type);
282 * Add bool variable definition to the build.
284 void AddDefinition(const char* name, bool);
285 ///! Add a definition to this makefile and the global cmake cache.
286 void AddCacheDefinition(const char* name, bool, const char* doc);
289 * Remove a variable definition from the build. This is not valid
290 * for cache entries, and will only affect the current makefile.
292 void RemoveDefinition(const char* name);
295 * Specify the name of the project for this build.
297 void SetProjectName(const char*);
300 * Get the name of the project for this build.
302 const char* GetProjectName() const
304 return this->ProjectName.c_str();
308 * Set the name of the library.
310 void AddLibrary(const char *libname, cmTarget::TargetType type,
311 const std::vector<std::string> &srcs,
312 bool excludeFromAll = false);
314 #if defined(CMAKE_BUILD_WITH_CMAKE)
316 * Add a root source group for consideration when adding a new source.
318 void AddSourceGroup(const char* name, const char* regex=0);
321 * Add a source group for consideration when adding a new source.
322 * name is tokenized.
324 void AddSourceGroup(const std::vector<std::string>& name,
325 const char* regex=0);
327 #endif
329 //@{
331 * Set, Push, Pop policy values for CMake.
333 bool SetPolicy(cmPolicies::PolicyID id, cmPolicies::PolicyStatus status);
334 bool SetPolicy(const char *id, cmPolicies::PolicyStatus status);
335 cmPolicies::PolicyStatus GetPolicyStatus(cmPolicies::PolicyID id);
336 bool PushPolicy();
337 bool PopPolicy(bool reportError = true);
338 bool SetPolicyVersion(const char *version);
339 //@}
342 * Get the Policies Instance
344 cmPolicies *GetPolicies();
347 * Add an auxiliary directory to the build.
349 void AddExtraDirectory(const char* dir);
353 * Add an auxiliary directory to the build.
355 void MakeStartDirectoriesCurrent()
357 this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR",
358 this->cmStartDirectory.c_str());
359 this->AddDefinition("CMAKE_CURRENT_BINARY_DIR",
360 this->StartOutputDirectory.c_str());
363 //@{
365 * Set/Get the home directory (or output directory) in the project. The
366 * home directory is the top directory of the project. It is where
367 * CMakeSetup or configure was run. Remember that CMake processes
368 * CMakeLists files by recursing up the tree starting at the StartDirectory
369 * and going up until it reaches the HomeDirectory.
371 void SetHomeDirectory(const char* dir);
372 const char* GetHomeDirectory() const
374 return this->cmHomeDirectory.c_str();
376 void SetHomeOutputDirectory(const char* lib);
377 const char* GetHomeOutputDirectory() const
379 return this->HomeOutputDirectory.c_str();
381 //@}
383 //@{
385 * Set/Get the start directory (or output directory). The start directory
386 * is the directory of the CMakeLists.txt file that started the current
387 * round of processing. Remember that CMake processes CMakeLists files by
388 * recursing up the tree starting at the StartDirectory and going up until
389 * it reaches the HomeDirectory.
391 void SetStartDirectory(const char* dir)
393 this->cmStartDirectory = dir;
394 cmSystemTools::ConvertToUnixSlashes(this->cmStartDirectory);
395 this->cmStartDirectory =
396 cmSystemTools::CollapseFullPath(this->cmStartDirectory.c_str());
397 this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR",
398 this->cmStartDirectory.c_str());
400 const char* GetStartDirectory() const
402 return this->cmStartDirectory.c_str();
404 void SetStartOutputDirectory(const char* lib)
406 this->StartOutputDirectory = lib;
407 cmSystemTools::ConvertToUnixSlashes(this->StartOutputDirectory);
408 this->StartOutputDirectory =
409 cmSystemTools::CollapseFullPath(this->StartOutputDirectory.c_str());
410 cmSystemTools::MakeDirectory(this->StartOutputDirectory.c_str());
411 this->AddDefinition("CMAKE_CURRENT_BINARY_DIR",
412 this->StartOutputDirectory.c_str());
414 const char* GetStartOutputDirectory() const
416 return this->StartOutputDirectory.c_str();
418 //@}
420 const char* GetCurrentDirectory() const
422 return this->cmStartDirectory.c_str();
424 const char* GetCurrentOutputDirectory() const
426 return this->StartOutputDirectory.c_str();
429 /* Get the current CMakeLists.txt file that is being processed. This
430 * is just used in order to be able to 'branch' from one file to a second
431 * transparently */
432 const char* GetCurrentListFile() const
434 return this->cmCurrentListFile.c_str();
437 //@}
439 /**
440 * Set a regular expression that include files must match
441 * in order to be considered as part of the depend information.
443 void SetIncludeRegularExpression(const char* regex)
445 this->IncludeFileRegularExpression = regex;
447 const char* GetIncludeRegularExpression()
449 return this->IncludeFileRegularExpression.c_str();
452 /**
453 * Set a regular expression that include files that are not found
454 * must match in order to be considered a problem.
456 void SetComplainRegularExpression(const char* regex)
458 this->ComplainFileRegularExpression = regex;
460 const char* GetComplainRegularExpression()
462 return this->ComplainFileRegularExpression.c_str();
466 * Get the list of targets
468 cmTargets &GetTargets() { return this->Targets; }
470 * Get the list of targets, const version
472 const cmTargets &GetTargets() const { return this->Targets; }
474 cmTarget* FindTarget(const char* name);
476 /** Find a target to use in place of the given name. The target
477 returned may be imported or built within the project. */
478 cmTarget* FindTargetToUse(const char* name);
481 * Get a list of include directories in the build.
483 std::vector<std::string>& GetIncludeDirectories()
485 return this->IncludeDirectories;
487 const std::vector<std::string>& GetIncludeDirectories() const
489 return this->IncludeDirectories;
491 void SetIncludeDirectories(const std::vector<std::string>& vec)
493 this->IncludeDirectories = vec;
497 * Mark include directories as system directories.
499 void AddSystemIncludeDirectory(const char* dir);
500 bool IsSystemIncludeDirectory(const char* dir);
502 /** Expand out any arguements in the vector that have ; separated
503 * strings into multiple arguements. A new vector is created
504 * containing the expanded versions of all arguments in argsIn.
505 * This method differes from the one in cmSystemTools in that if
506 * the CmakeLists file is version 1.2 or earlier it will check for
507 * source lists being used without ${} around them
509 void ExpandSourceListArguments(std::vector<std::string> const& argsIn,
510 std::vector<std::string>& argsOut,
511 unsigned int startArgumentIndex);
513 /** Get a cmSourceFile pointer for a given source name, if the name is
514 * not found, then a null pointer is returned.
516 cmSourceFile* GetSource(const char* sourceName);
518 /** Get a cmSourceFile pointer for a given source name, if the name is
519 * not found, then create the source file and return it. generated
520 * indicates if it is a generated file, this is used in determining
521 * how to create the source file instance e.g. name
523 cmSourceFile* GetOrCreateSource(const char* sourceName,
524 bool generated = false);
527 * Obtain a list of auxiliary source directories.
529 std::vector<std::string>& GetAuxSourceDirectories()
530 {return this->AuxSourceDirectories;}
532 //@{
534 * Return a list of extensions associated with source and header
535 * files
537 const std::vector<std::string>& GetSourceExtensions() const
538 {return this->SourceFileExtensions;}
539 const std::vector<std::string>& GetHeaderExtensions() const
540 {return this->HeaderFileExtensions;}
541 //@}
544 * Given a variable name, return its value (as a string).
545 * If the variable is not found in this makefile instance, the
546 * cache is then queried.
548 const char* GetDefinition(const char*) const;
549 const char* GetSafeDefinition(const char*) const;
550 const char* GetRequiredDefinition(const char* name) const;
551 bool IsDefinitionSet(const char*) const;
553 * Get the list of all variables in the current space. If argument
554 * cacheonly is specified and is greater than 0, then only cache
555 * variables will be listed.
557 std::vector<std::string> GetDefinitions(int cacheonly=0) const;
559 /** Test a boolean cache entry to see if it is true or false,
560 * returns false if no entry defined.
562 bool IsOn(const char* name) const;
563 bool IsSet(const char* name) const;
566 * Get a list of preprocessor define flags.
568 const char* GetDefineFlags()
569 {return this->DefineFlags.c_str();}
572 * Make sure CMake can write this file
574 bool CanIWriteThisFile(const char* fileName);
577 * Get the vector of used command instances.
579 const std::vector<cmCommand*>& GetUsedCommands() const
580 {return this->UsedCommands;}
582 #if defined(CMAKE_BUILD_WITH_CMAKE)
584 * Get the vector source groups.
586 const std::vector<cmSourceGroup>& GetSourceGroups() const
587 { return this->SourceGroups; }
590 * Get the source group
592 cmSourceGroup* GetSourceGroup(const std::vector<std::string>&name);
593 #endif
596 * Get the vector of list files on which this makefile depends
598 const std::vector<std::string>& GetListFiles() const
599 { return this->ListFiles; }
600 ///! When the file changes cmake will be re-run from the build system.
601 void AddCMakeDependFile(const char* file)
602 { this->ListFiles.push_back(file);}
605 * Get the list file stack as a string
607 std::string GetListFileStack();
610 * Get the current context backtrace.
612 bool GetBacktrace(cmListFileBacktrace& backtrace) const;
615 * Get the vector of files created by this makefile
617 const std::vector<std::string>& GetOutputFiles() const
618 { return this->OutputFiles; }
619 void AddCMakeOutputFile(const char* file)
620 { this->OutputFiles.push_back(file);}
623 * Expand all defined variables in the string.
624 * Defined variables come from the this->Definitions map.
625 * They are expanded with ${var} where var is the
626 * entry in the this->Definitions map. Also @var@ is
627 * expanded to match autoconf style expansions.
629 const char *ExpandVariablesInString(std::string& source);
630 const char *ExpandVariablesInString(std::string& source, bool escapeQuotes,
631 bool noEscapes,
632 bool atOnly = false,
633 const char* filename = 0,
634 long line = -1,
635 bool removeEmpty = false,
636 bool replaceAt = true);
639 * Remove any remaining variables in the string. Anything with ${var} or
640 * @var@ will be removed.
642 void RemoveVariablesInString(std::string& source,
643 bool atOnly = false) const;
646 * Expand variables in the makefiles ivars such as link directories etc
648 void ExpandVariables();
651 * Replace variables and #cmakedefine lines in the given string.
652 * See cmConfigureFileCommand for details.
654 void ConfigureString(const std::string& input, std::string& output,
655 bool atOnly, bool escapeQuotes);
658 * Copy file but change lines acording to ConfigureString
660 int ConfigureFile(const char* infile, const char* outfile,
661 bool copyonly, bool atOnly, bool escapeQuotes);
663 #if defined(CMAKE_BUILD_WITH_CMAKE)
665 * find what source group this source is in
667 cmSourceGroup& FindSourceGroup(const char* source,
668 std::vector<cmSourceGroup> &groups);
669 #endif
671 void RegisterData(cmData*);
672 void RegisterData(const char*, cmData*);
673 cmData* LookupData(const char*) const;
676 * Execute a single CMake command. Returns true if the command
677 * succeeded or false if it failed.
679 bool ExecuteCommand(const cmListFileFunction& lff,
680 cmExecutionStatus &status);
682 /** Check if a command exists. */
683 bool CommandExists(const char* name) const;
686 * Add a command to this cmake instance
688 void AddCommand(cmCommand* );
690 ///! Enable support for named language, if nil then all languages are
691 ///enabled.
692 void EnableLanguage(std::vector<std::string>const& languages, bool optional);
695 * Set/Get the name of the parent directories CMakeLists file
696 * given a current CMakeLists file name
698 cmCacheManager *GetCacheManager() const;
701 * Get the variable watch. This is used to determine when certain variables
702 * are accessed.
704 #ifdef CMAKE_BUILD_WITH_CMAKE
705 cmVariableWatch* GetVariableWatch() const;
706 #endif
708 ///! Display progress or status message.
709 void DisplayStatus(const char*, float);
712 * Expand the given list file arguments into the full set after
713 * variable replacement and list expansion.
715 void ExpandArguments(std::vector<cmListFileArgument> const& inArgs,
716 std::vector<std::string>& outArgs);
718 * Get the instance
720 cmake *GetCMakeInstance() const;
723 * Get all the source files this makefile knows about
725 const std::vector<cmSourceFile*> &GetSourceFiles() const
726 {return this->SourceFiles;}
727 std::vector<cmSourceFile*> &GetSourceFiles() {return this->SourceFiles;}
730 * Is there a source file that has the provided source file as an output?
731 * if so then return it
733 cmSourceFile *GetSourceFileWithOutput(const char *outName);
736 * Add a macro to the list of macros. The arguments should be name of the
737 * macro and a documentation signature of it
739 void AddMacro(const char* name, const char* signature);
741 ///! Add a new cmTest to the list of tests for this makefile.
742 cmTest* CreateTest(const char* testName);
744 /** Get a cmTest pointer for a given test name, if the name is
745 * not found, then a null pointer is returned.
747 cmTest* GetTest(const char* testName) const;
748 const std::vector<cmTest*> *GetTests() const;
749 std::vector<cmTest*> *GetTests();
752 * Get a list of macros as a ; separated string
754 void GetListOfMacros(std::string& macros);
757 * Return a location of a file in cmake or custom modules directory
759 std::string GetModulesFile(const char* name);
761 ///! Set/Get a property of this directory
762 void SetProperty(const char *prop, const char *value);
763 void AppendProperty(const char *prop, const char *value);
764 const char *GetProperty(const char *prop);
765 const char *GetPropertyOrDefinition(const char *prop);
766 const char *GetProperty(const char *prop, cmProperty::ScopeType scope);
767 bool GetPropertyAsBool(const char *prop);
769 // Get the properties
770 cmPropertyMap &GetProperties() { return this->Properties; };
772 typedef std::map<cmStdString, cmStdString> DefinitionMap;
773 ///! Initialize a makefile from its parent
774 void InitializeFromParent();
776 ///! Set/Get the preorder flag
777 void SetPreOrder(bool p) { this->PreOrder = p; }
778 bool GetPreOrder() const { return this->PreOrder; }
780 void AddInstallGenerator(cmInstallGenerator* g)
781 { if(g) this->InstallGenerators.push_back(g); }
782 std::vector<cmInstallGenerator*>& GetInstallGenerators()
783 { return this->InstallGenerators; }
785 // Define the properties
786 static void DefineProperties(cmake *cm);
788 // push and pop variable scopes
789 void PushScope();
790 void PopScope();
791 void RaiseScope(const char *var, const char *value);
793 void IssueMessage(cmake::MessageType t,
794 std::string const& text) const;
796 /** Set whether or not to report a CMP0000 violation. */
797 void SetCheckCMP0000(bool b) { this->CheckCMP0000 = b; }
799 protected:
800 // add link libraries and directories to the target
801 void AddGlobalLinkInformation(const char* name, cmTarget& target);
803 std::string Prefix;
804 std::vector<std::string> AuxSourceDirectories; //
806 std::string cmStartDirectory;
807 std::string StartOutputDirectory;
808 std::string cmHomeDirectory;
809 std::string HomeOutputDirectory;
810 std::string cmCurrentListFile;
812 std::string ProjectName; // project name
814 // libraries, classes, and executables
815 cmTargets Targets;
816 std::vector<cmSourceFile*> SourceFiles;
818 // Tests
819 std::vector<cmTest*> Tests;
821 // The include and link-library paths. These may have order
822 // dependency, so they must be vectors (not set).
823 std::vector<std::string> IncludeDirectories;
824 std::vector<std::string> LinkDirectories;
826 // The set of include directories that are marked as system include
827 // directories.
828 std::set<cmStdString> SystemIncludeDirectories;
830 std::vector<std::string> ListFiles; // list of command files loaded
831 std::vector<std::string> OutputFiles; // list of command files loaded
834 cmTarget::LinkLibraryVectorType LinkLibraries;
836 std::vector<cmInstallGenerator*> InstallGenerators;
838 std::string IncludeFileRegularExpression;
839 std::string ComplainFileRegularExpression;
840 std::vector<std::string> SourceFileExtensions;
841 std::vector<std::string> HeaderFileExtensions;
842 std::string DefineFlags;
844 #if defined(CMAKE_BUILD_WITH_CMAKE)
845 std::vector<cmSourceGroup> SourceGroups;
846 #endif
848 std::vector<DefinitionMap> DefinitionStack;
849 std::vector<cmCommand*> UsedCommands;
850 cmLocalGenerator* LocalGenerator;
851 bool IsFunctionBlocked(const cmListFileFunction& lff,
852 cmExecutionStatus &status);
854 private:
855 void Initialize();
857 bool ParseDefineFlag(std::string const& definition, bool remove);
859 void ReadSources(std::ifstream& fin, bool t);
860 friend class cmMakeDepend; // make depend needs direct access
861 // to the Sources array
862 void PrintStringVector(const char* s, const
863 std::vector<std::pair<cmStdString, bool> >& v) const;
864 void PrintStringVector(const char* s,
865 const std::vector<std::string>& v) const;
867 void AddDefaultDefinitions();
868 std::list<cmFunctionBlocker *> FunctionBlockers;
870 typedef std::map<cmStdString, cmData*> DataMapType;
871 DataMapType DataMap;
873 typedef std::map<cmStdString, cmStdString> StringStringMap;
874 StringStringMap MacrosMap;
876 std::map<cmStdString, bool> SubDirectoryOrder;
877 // used in AddDefinition for performance improvement
878 DefinitionMap::key_type TemporaryDefinitionKey;
880 cmsys::RegularExpression cmDefineRegex;
881 cmsys::RegularExpression cmDefine01Regex;
882 cmsys::RegularExpression cmAtVarRegex;
884 cmPropertyMap Properties;
886 // should this makefile be processed before or after processing the parent
887 bool PreOrder;
889 // stack of list files being read
890 std::deque<cmStdString> ListFileStack;
892 // stack of commands being invoked.
893 struct CallStackEntry
895 cmListFileContext const* Context;
896 cmExecutionStatus* Status;
898 typedef std::deque<CallStackEntry> CallStackType;
899 CallStackType CallStack;
900 friend class cmMakefileCall;
902 cmTarget* FindBasicTarget(const char* name);
903 std::vector<cmTarget*> ImportedTargetsOwned;
904 std::map<cmStdString, cmTarget*> ImportedTargets;
906 // stack of policy settings
907 typedef std::map<cmPolicies::PolicyID,
908 cmPolicies::PolicyStatus> PolicyMap;
909 std::vector<PolicyMap> PolicyStack;
911 bool CheckCMP0000;
913 // Enforce rules about CMakeLists.txt files.
914 void EnforceDirectoryLevelRules(bool endScopeNicely);
918 #endif