summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmMakefile.h')
-rw-r--r--Source/cmMakefile.h103
1 files changed, 46 insertions, 57 deletions
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index dadf7ff..66a33bb 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -63,8 +63,8 @@ public:
* was used to write the currently loaded cache, note
* this method will not work before the cache is loaded.
*/
- unsigned int GetCacheMajorVersion();
- unsigned int GetCacheMinorVersion();
+ unsigned int GetCacheMajorVersion() const;
+ unsigned int GetCacheMinorVersion() const;
/* Check for unused variables in this scope */
void CheckForUnusedVariables() const;
@@ -76,7 +76,7 @@ public:
bool VariableUsed(const char* ) const;
/** Return whether compatibility features needed for a version of
the cache or lower should be enabled. */
- bool NeedCacheCompatibility(int major, int minor);
+ bool NeedCacheCompatibility(int major, int minor) const;
/**
* Construct an empty makefile.
@@ -142,14 +142,14 @@ public:
void SetLocalGenerator(cmLocalGenerator*);
///! Get the current makefile generator.
- cmLocalGenerator* GetLocalGenerator()
+ cmLocalGenerator* GetLocalGenerator() const
{ return this->LocalGenerator;}
/**
* Help enforce global target name uniqueness.
*/
bool EnforceUniqueName(std::string const& name, std::string& msg,
- bool isCustom = false);
+ bool isCustom = false) const;
/**
* Perform FinalPass, Library dependency analysis etc before output of the
@@ -165,7 +165,7 @@ public:
/**
* Print the object state to std::cout.
*/
- void Print();
+ void Print() const;
/** Add a custom command to the build. */
void AddCustomCommandToTarget(const char* target,
@@ -173,7 +173,7 @@ public:
const cmCustomCommandLines& commandLines,
cmTarget::CustomCommandType type,
const char* comment, const char* workingDir,
- bool escapeOldStyle = true);
+ bool escapeOldStyle = true) const;
cmSourceFile* AddCustomCommandToOutput(
const std::vector<std::string>& outputs,
const std::vector<std::string>& depends,
@@ -250,13 +250,6 @@ public:
*/
void AddLinkDirectory(const char*);
- /**
- * Get the list of link directories
- */
- std::vector<std::string>& GetLinkDirectories()
- {
- return this->LinkDirectories;
- }
const std::vector<std::string>& GetLinkDirectories() const
{
return this->LinkDirectories;
@@ -356,7 +349,7 @@ public:
*/
bool SetPolicy(cmPolicies::PolicyID id, cmPolicies::PolicyStatus status);
bool SetPolicy(const char *id, cmPolicies::PolicyStatus status);
- cmPolicies::PolicyStatus GetPolicyStatus(cmPolicies::PolicyID id);
+ cmPolicies::PolicyStatus GetPolicyStatus(cmPolicies::PolicyID id) const;
bool SetPolicyVersion(const char *version);
void RecordPolicies(cmPolicies::PolicyMap& pm);
//@}
@@ -379,7 +372,7 @@ public:
/**
* Get the Policies Instance
*/
- cmPolicies *GetPolicies();
+ cmPolicies *GetPolicies() const;
/**
* Add an auxiliary directory to the build.
@@ -492,7 +485,7 @@ public:
{
this->IncludeFileRegularExpression = regex;
}
- const char* GetIncludeRegularExpression()
+ const char* GetIncludeRegularExpression() const
{
return this->IncludeFileRegularExpression.c_str();
}
@@ -505,7 +498,7 @@ public:
{
this->ComplainFileRegularExpression = regex;
}
- const char* GetComplainRegularExpression()
+ const char* GetComplainRegularExpression() const
{
return this->ComplainFileRegularExpression.c_str();
}
@@ -539,15 +532,14 @@ public:
/** Find a target to use in place of the given name. The target
returned may be imported or built within the project. */
cmTarget* FindTargetToUse(const std::string& name,
- bool excludeAliases = false);
- bool IsAlias(const std::string& name);
- cmGeneratorTarget* FindGeneratorTargetToUse(const char* name);
+ bool excludeAliases = false) const;
+ bool IsAlias(const std::string& name) const;
+ cmGeneratorTarget* FindGeneratorTargetToUse(const char* name) const;
/**
* Mark include directories as system directories.
*/
void AddSystemIncludeDirectories(const std::set<cmStdString> &incs);
- bool IsSystemIncludeDirectory(const char* dir, const char *config);
/** Expand out any arguements in the vector that have ; separated
* strings into multiple arguements. A new vector is created
@@ -558,12 +550,12 @@ public:
*/
void ExpandSourceListArguments(std::vector<std::string> const& argsIn,
std::vector<std::string>& argsOut,
- unsigned int startArgumentIndex);
+ unsigned int startArgumentIndex) const;
/** Get a cmSourceFile pointer for a given source name, if the name is
* not found, then a null pointer is returned.
*/
- cmSourceFile* GetSource(const char* sourceName);
+ cmSourceFile* GetSource(const char* sourceName) const;
/** Get a cmSourceFile pointer for a given source name, if the name is
* not found, then create the source file and return it. generated
@@ -576,7 +568,7 @@ public:
/**
* Obtain a list of auxiliary source directories.
*/
- std::vector<std::string>& GetAuxSourceDirectories()
+ const std::vector<std::string>& GetAuxSourceDirectories() const
{return this->AuxSourceDirectories;}
//@{
@@ -621,13 +613,13 @@ public:
/**
* Get a list of preprocessor define flags.
*/
- const char* GetDefineFlags()
+ const char* GetDefineFlags() const
{return this->DefineFlags.c_str();}
/**
* Make sure CMake can write this file
*/
- bool CanIWriteThisFile(const char* fileName);
+ bool CanIWriteThisFile(const char* fileName) const;
#if defined(CMAKE_BUILD_WITH_CMAKE)
/**
@@ -639,7 +631,7 @@ public:
/**
* Get the source group
*/
- cmSourceGroup* GetSourceGroup(const std::vector<std::string>&name);
+ cmSourceGroup* GetSourceGroup(const std::vector<std::string>&name) const;
#endif
/**
@@ -652,10 +644,7 @@ public:
{ this->ListFiles.push_back(file);}
void AddCMakeDependFilesFromUser();
- /**
- * Get the list file stack as a string
- */
- std::string GetListFileStack();
+ std::string GetListFileStack() const;
/**
* Get the current context backtrace.
@@ -677,14 +666,14 @@ public:
* entry in the this->Definitions map. Also \@var\@ is
* expanded to match autoconf style expansions.
*/
- const char *ExpandVariablesInString(std::string& source);
+ const char *ExpandVariablesInString(std::string& source) const;
const char *ExpandVariablesInString(std::string& source, bool escapeQuotes,
bool noEscapes,
bool atOnly = false,
const char* filename = 0,
long line = -1,
bool removeEmpty = false,
- bool replaceAt = true);
+ bool replaceAt = true) const;
/**
* Remove any remaining variables in the string. Anything with ${var} or
@@ -703,7 +692,7 @@ public:
* See cmConfigureFileCommand for details.
*/
void ConfigureString(const std::string& input, std::string& output,
- bool atOnly, bool escapeQuotes);
+ bool atOnly, bool escapeQuotes) const;
/**
* Copy file but change lines acording to ConfigureString
@@ -717,14 +706,14 @@ public:
/**
* find what source group this source is in
*/
- cmSourceGroup& FindSourceGroup(const char* source,
- std::vector<cmSourceGroup> &groups);
+ cmSourceGroup* FindSourceGroup(const char* source,
+ std::vector<cmSourceGroup> &groups) const;
#endif
/**
* Print a command's invocation
*/
- void PrintCommandTrace(const cmListFileFunction& lff);
+ void PrintCommandTrace(const cmListFileFunction& lff) const;
/**
* Execute a single CMake command. Returns true if the command
@@ -760,14 +749,14 @@ public:
#endif
///! Display progress or status message.
- void DisplayStatus(const char*, float);
+ void DisplayStatus(const char*, float) const;
/**
* Expand the given list file arguments into the full set after
* variable replacement and list expansion.
*/
bool ExpandArguments(std::vector<cmListFileArgument> const& inArgs,
- std::vector<std::string>& outArgs);
+ std::vector<std::string>& outArgs) const;
/**
* Get the instance
*/
@@ -784,7 +773,7 @@ public:
* Is there a source file that has the provided source file as an output?
* if so then return it
*/
- cmSourceFile *GetSourceFileWithOutput(const char *outName);
+ cmSourceFile *GetSourceFileWithOutput(const char *outName) const;
/**
* Add a macro to the list of macros. The arguments should be name of the
@@ -803,20 +792,20 @@ public:
/**
* Get a list of macros as a ; separated string
*/
- void GetListOfMacros(std::string& macros);
+ void GetListOfMacros(std::string& macros) const;
/**
* Return a location of a file in cmake or custom modules directory
*/
- std::string GetModulesFile(const char* name);
+ std::string GetModulesFile(const char* name) const;
///! Set/Get a property of this directory
void SetProperty(const char *prop, const char *value);
void AppendProperty(const char *prop, const char *value,bool asString=false);
- const char *GetProperty(const char *prop);
- const char *GetPropertyOrDefinition(const char *prop);
- const char *GetProperty(const char *prop, cmProperty::ScopeType scope);
- bool GetPropertyAsBool(const char *prop);
+ const char *GetProperty(const char *prop) const;
+ const char *GetPropertyOrDefinition(const char *prop) const;
+ const char *GetProperty(const char *prop, cmProperty::ScopeType scope) const;
+ bool GetPropertyAsBool(const char *prop) const;
const char* GetFeature(const char* feature, const char* config);
@@ -837,7 +826,7 @@ public:
void AddTestGenerator(cmTestGenerator* g)
{ if(g) this->TestGenerators.push_back(g); }
- std::vector<cmTestGenerator*>& GetTestGenerators()
+ const std::vector<cmTestGenerator*>& GetTestGenerators() const
{ return this->TestGenerators; }
// Define the properties
@@ -877,7 +866,7 @@ public:
return this->CompileDefinitionsEntries;
}
- bool IsGeneratingBuildSystem(){ return this->GeneratingBuildSystem; }
+ bool IsGeneratingBuildSystem() const { return this->GeneratingBuildSystem; }
void SetGeneratingBuildSystem(){ this->GeneratingBuildSystem = true; }
void AddQtUiFileWithOptions(cmSourceFile *sf);
@@ -958,7 +947,7 @@ private:
bool ParseDefineFlag(std::string const& definition, bool remove);
- bool EnforceUniqueDir(const char* srcPath, const char* binPath);
+ bool EnforceUniqueDir(const char* srcPath, const char* binPath) const;
friend class cmMakeDepend; // make depend needs direct access
// to the Sources array
@@ -979,9 +968,9 @@ private:
std::map<cmStdString, bool> SubDirectoryOrder;
- cmsys::RegularExpression cmDefineRegex;
- cmsys::RegularExpression cmDefine01Regex;
- cmsys::RegularExpression cmAtVarRegex;
+ mutable cmsys::RegularExpression cmDefineRegex;
+ mutable cmsys::RegularExpression cmDefine01Regex;
+ mutable cmsys::RegularExpression cmAtVarRegex;
cmPropertyMap Properties;
@@ -1005,7 +994,6 @@ private:
CallStackType CallStack;
friend class cmMakefileCall;
- cmTarget* FindBasicTarget(const char* name);
std::vector<cmTarget*> ImportedTargetsOwned;
std::map<cmStdString, cmTarget*> ImportedTargets;
@@ -1031,12 +1019,13 @@ private:
typedef std::vector<PolicyStackEntry> PolicyStackType;
PolicyStackType PolicyStack;
std::vector<PolicyStackType::size_type> PolicyBarriers;
- cmPolicies::PolicyStatus GetPolicyStatusInternal(cmPolicies::PolicyID id);
+ cmPolicies::PolicyStatus
+ GetPolicyStatusInternal(cmPolicies::PolicyID id) const;
bool CheckCMP0000;
// Enforce rules about CMakeLists.txt files.
- void EnforceDirectoryLevelRules();
+ void EnforceDirectoryLevelRules() const;
bool GeneratingBuildSystem;
/**
@@ -1045,7 +1034,7 @@ private:
* relative file paths. It is used as a fall back by
* GetSourceFileWithOutput(const char*).
*/
- cmSourceFile *LinearGetSourceFileWithOutput(const char *cname);
+ cmSourceFile *LinearGetSourceFileWithOutput(const char *cname) const;
// A map for fast output to input look up.
#if defined(CMAKE_BUILD_WITH_CMAKE)