summaryrefslogtreecommitdiff
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorZach Mullen <zach.mullen@kitware.com>2009-12-21 12:27:04 -0500
committerZach Mullen <zach.mullen@kitware.com>2009-12-21 12:27:04 -0500
commit7af553188ec50c976a5d0c8174d2f47cac68d71d (patch)
tree65158f6a94f6707bbdb60060c9d8f1fd5b779b7e /Source/cmSystemTools.cxx
parentcb27cfb1cc6d8a273f69506414c2991b6c989621 (diff)
downloadcmake-7af553188ec50c976a5d0c8174d2f47cac68d71d.tar.gz
Added support for CTest awareness of the CDash version. This will help forward compatibility for both tools. Note that this changeset effectively makes the default to disable output compression. Now, to enable output compression, the CDASH_CTEST_VERSION must be explicity set to >= 1.6. Automated detection of the CDash version is the next step.
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx27
1 files changed, 27 insertions, 0 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index f5fba5c269..89a241ded2 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -2691,6 +2691,33 @@ bool cmSystemTools::ChangeRPath(std::string const& file,
}
//----------------------------------------------------------------------------
+bool cmSystemTools::VersionCompare(cmSystemTools::CompareOp op,
+ const char* lhss, const char* rhss)
+{
+ unsigned int lhs[4] = {0,0,0,0};
+ unsigned int rhs[4] = {0,0,0,0};
+ sscanf(lhss, "%u.%u.%u.%u", &lhs[0], &lhs[1], &lhs[2], &lhs[3]);
+ sscanf(rhss, "%u.%u.%u.%u", &rhs[0], &rhs[1], &rhs[2], &rhs[3]);
+
+ // Do component-wise comparison.
+ for(unsigned int i=0; i < 4; ++i)
+ {
+ if(lhs[i] < rhs[i])
+ {
+ // lhs < rhs, so true if operation is LESS
+ return op == cmSystemTools::OP_LESS;
+ }
+ else if(lhs[i] > rhs[i])
+ {
+ // lhs > rhs, so true if operation is GREATER
+ return op == cmSystemTools::OP_GREATER;
+ }
+ }
+ // lhs == rhs, so true if operation is EQUAL
+ return op == cmSystemTools::OP_EQUAL;
+}
+
+//----------------------------------------------------------------------------
bool cmSystemTools::RemoveRPath(std::string const& file, std::string* emsg,
bool* removed)
{