summaryrefslogtreecommitdiff
path: root/Source/cmSystemTools.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-01-28 16:48:20 -0500
committerBrad King <brad.king@kitware.com>2010-01-28 16:48:20 -0500
commitdc1d2189ae922be9d6e7f5fde698532db47e46aa (patch)
tree28ef61aac78f0bdc190a760d53b6cb89b24262cd /Source/cmSystemTools.h
parent612409e5b01a7e4823bb379ee9e002177793eb75 (diff)
downloadcmake-dc1d2189ae922be9d6e7f5fde698532db47e46aa.tar.gz
CMake 2.8.1-rc1
Diffstat (limited to 'Source/cmSystemTools.h')
-rw-r--r--Source/cmSystemTools.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index 679884e877..70d1462cd4 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -268,6 +268,17 @@ public:
UNKNOWN_FILE_FORMAT
};
+ enum CompareOp {
+ OP_LESS,
+ OP_GREATER,
+ OP_EQUAL
+ };
+
+ /**
+ * Compare versions
+ */
+ static bool VersionCompare(CompareOp op, const char* lhs, const char* rhs);
+
/**
* Determine the file type based on the extension
*/
@@ -347,6 +358,20 @@ public:
AppendEnv to put the environment back to the way it
was. */
static void RestoreEnv(const std::vector<std::string>& env);
+
+ /** Helper class to save and restore the environment.
+ Instantiate this class as an automatic variable on
+ the stack. Its constructor saves a copy of the current
+ environment and then its destructor restores the
+ original environment. */
+ class SaveRestoreEnvironment
+ {
+ public:
+ SaveRestoreEnvironment();
+ virtual ~SaveRestoreEnvironment();
+ private:
+ std::vector<std::string> Env;
+ };
#endif
/** Setup the environment to enable VS 8 IDE output. */