summaryrefslogtreecommitdiffstats
path: root/Source/cmake.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmake.h')
-rw-r--r--Source/cmake.h115
1 files changed, 33 insertions, 82 deletions
diff --git a/Source/cmake.h b/Source/cmake.h
index 60ffcd4..352850d 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -15,16 +15,14 @@
#include "cmListFileCache.h"
#include "cmSystemTools.h"
-#include "cmPropertyDefinitionMap.h"
-#include "cmPropertyMap.h"
#include "cmInstalledFile.h"
+#include "cmCacheManager.h"
+#include "cmState.h"
class cmGlobalGeneratorFactory;
class cmGlobalGenerator;
class cmLocalGenerator;
-class cmCacheManager;
class cmMakefile;
-class cmCommand;
class cmVariableWatch;
class cmFileTimeComparison;
class cmExternalMakefileProjectGenerator;
@@ -32,6 +30,7 @@ class cmDocumentationSection;
class cmPolicies;
class cmTarget;
class cmGeneratedFileStream;
+class cmState;
/** \brief Represents a cmake invocation.
*
@@ -92,7 +91,6 @@ class cmake
*/
FIND_PACKAGE_MODE
};
- typedef std::map<std::string, cmCommand*> RegisteredCommandsMap;
typedef std::map<std::string, cmInstalledFile> InstalledFilesMap;
/// Default constructor
@@ -113,15 +111,9 @@ class cmake
* and going up until it reaches the HomeDirectory.
*/
void SetHomeDirectory(const std::string& dir);
- const char* GetHomeDirectory() const
- {
- return this->cmHomeDirectory.c_str();
- }
- void SetHomeOutputDirectory(const std::string& lib);
- const char* GetHomeOutputDirectory() const
- {
- return this->HomeOutputDirectory.c_str();
- }
+ const char* GetHomeDirectory() const;
+ void SetHomeOutputDirectory(const std::string& dir);
+ const char* GetHomeOutputDirectory() const;
//@}
//@{
@@ -132,24 +124,10 @@ class cmake
* recursing up the tree starting at the StartDirectory and going up until
* it reaches the HomeDirectory.
*/
- void SetStartDirectory(const std::string& dir)
- {
- this->cmStartDirectory = dir;
- cmSystemTools::ConvertToUnixSlashes(this->cmStartDirectory);
- }
- const char* GetStartDirectory() const
- {
- return this->cmStartDirectory.c_str();
- }
- void SetStartOutputDirectory(const std::string& lib)
- {
- this->StartOutputDirectory = lib;
- cmSystemTools::ConvertToUnixSlashes(this->StartOutputDirectory);
- }
- const char* GetStartOutputDirectory() const
- {
- return this->StartOutputDirectory.c_str();
- }
+ void SetStartDirectory(const std::string& dir);
+ const char* GetStartDirectory() const;
+ void SetStartOutputDirectory(const std::string& dir);
+ const char* GetStartOutputDirectory() const;
//@}
/**
@@ -173,7 +151,19 @@ class cmake
int Configure();
int ActualConfigure();
+ ///! Break up a line like VAR:type="value" into var, type and value
+ static bool ParseCacheEntry(const std::string& entry,
+ std::string& var,
+ std::string& value,
+ cmState::CacheEntryType& type);
+
int LoadCache();
+ bool LoadCache(const std::string& path);
+ bool LoadCache(const std::string& path, bool internal,
+ std::set<std::string>& excludes,
+ std::set<std::string>& includes);
+ bool SaveCache(const std::string& path);
+ bool DeleteCache(const std::string& path);
void PreLoadCMakeFiles();
///! Create a GlobalGenerator
@@ -224,34 +214,13 @@ class cmake
*/
int GetSystemInformation(std::vector<std::string>&);
- /**
- * Add a command to this cmake instance
- */
- void AddCommand(cmCommand* );
- void RenameCommand(const std::string& oldName, const std::string& newName);
- void RemoveCommand(const std::string& name);
- void RemoveUnscriptableCommands();
-
- /**
- * Get a command by its name
- */
- cmCommand *GetCommand(const std::string& name);
-
- /** Get list of all commands */
- RegisteredCommandsMap* GetCommands() { return &this->Commands; }
-
- /** Check if a command exists. */
- bool CommandExists(const std::string& name) const;
-
///! Parse command line arguments
void SetArgs(const std::vector<std::string>&,
bool directoriesSetBefore = false);
///! Is this cmake running as a result of a TRY_COMPILE command
- bool GetIsInTryCompile() { return this->InTryCompile; }
-
- ///! Is this cmake running as a result of a TRY_COMPILE command
- void SetIsInTryCompile(bool i) { this->InTryCompile = i; }
+ bool GetIsInTryCompile() const;
+ void SetIsInTryCompile(bool b);
///! Parse command line arguments that might set cache values
bool SetCacheArgs(const std::vector<std::string>&);
@@ -283,13 +252,8 @@ class cmake
void AppendProperty(const std::string& prop,
const char *value,bool asString=false);
const char *GetProperty(const std::string& prop);
- const char *GetProperty(const std::string& prop,
- cmProperty::ScopeType scope);
bool GetPropertyAsBool(const std::string& prop);
- // Get the properties
- cmPropertyMap &GetProperties() { return this->Properties; }
-
///! Get or create an cmInstalledFile instance and return a pointer to it
cmInstalledFile *GetOrCreateInstalledFile(
cmMakefile* mf, const std::string& name);
@@ -337,23 +301,9 @@ class cmake
void MarkCliAsUsed(const std::string& variable);
- // Define a property
- void DefineProperty(const std::string& name, cmProperty::ScopeType scope,
- const char *ShortDescription,
- const char *FullDescription,
- bool chain = false);
-
- // get property definition
- cmPropertyDefinition *GetPropertyDefinition
- (const std::string& name, cmProperty::ScopeType scope);
-
- // Is a property defined?
- bool IsPropertyDefined(const std::string& name, cmProperty::ScopeType scope);
- bool IsPropertyChained(const std::string& name, cmProperty::ScopeType scope);
-
/** Get the list of configurations (in upper case) considered to be
debugging configurations.*/
- std::vector<std::string> const& GetDebugConfigs();
+ std::vector<std::string> GetDebugConfigs();
void SetCMakeEditCommand(std::string const& s)
{ this->CMakeEditCommand = s; }
@@ -378,22 +328,19 @@ class cmake
void UnwatchUnusedCli(const std::string& var);
void WatchUnusedCli(const std::string& var);
+
+ cmState* GetState() const { return this->State; }
+
protected:
void RunCheckForUnusedVariables();
void InitializeProperties();
int HandleDeleteCacheVariables(const std::string& var);
- cmPropertyMap Properties;
- std::set<std::pair<std::string,cmProperty::ScopeType> > AccessedProperties;
-
- std::map<cmProperty::ScopeType, cmPropertyDefinitionMap>
- PropertyDefinitions;
typedef
cmExternalMakefileProjectGenerator* (*CreateExtraGeneratorFunctionType)();
typedef std::map<std::string,
CreateExtraGeneratorFunctionType> RegisteredExtraGeneratorsMap;
typedef std::vector<cmGlobalGeneratorFactory*> RegisteredGeneratorsVector;
- RegisteredCommandsMap Commands;
RegisteredGeneratorsVector Generators;
RegisteredExtraGeneratorsMap ExtraGenerators;
void AddDefaultCommands();
@@ -464,10 +411,14 @@ private:
bool DebugTryCompile;
cmFileTimeComparison* FileComparison;
std::string GraphVizFile;
- std::vector<std::string> DebugConfigs;
InstalledFilesMap InstalledFiles;
+ cmState* State;
+
void UpdateConversionPathTable();
+
+ // Print a list of valid generators to stderr.
+ void PrintGeneratorList();
};
#define CMAKE_STANDARD_OPTIONS_TABLE \