diff options
author | David Cole <david.cole@kitware.com> | 2012-09-18 20:41:59 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2012-09-18 20:41:59 (GMT) |
commit | 3e7fe5a7a0db605d791921abf0b910f6b41e0359 (patch) | |
tree | 0e9438ee00efa4deffc7ca660edc63861969b3ca /Source | |
parent | a98881ac8ff9e12a690ebee381af17e475e3ab03 (diff) | |
parent | dfa0ebd646203e4cecc150ff7589392d899e13d4 (diff) | |
download | CMake-3e7fe5a7a0db605d791921abf0b910f6b41e0359.zip CMake-3e7fe5a7a0db605d791921abf0b910f6b41e0359.tar.gz CMake-3e7fe5a7a0db605d791921abf0b910f6b41e0359.tar.bz2 |
Merge topic 'if-version-depth'
dfa0ebd if: Compare up to 8 components in VERSION tests
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmIfCommand.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index ffc0f35..56d7170 100644 --- a/Source/cmIfCommand.cxx +++ b/Source/cmIfCommand.cxx @@ -409,14 +409,18 @@ namespace enum Op { OpLess, OpEqual, OpGreater }; bool HandleVersionCompare(Op op, const char* lhs_str, const char* rhs_str) { - // Parse out up to 4 components. - unsigned int lhs[4] = {0,0,0,0}; - unsigned int rhs[4] = {0,0,0,0}; - sscanf(lhs_str, "%u.%u.%u.%u", &lhs[0], &lhs[1], &lhs[2], &lhs[3]); - sscanf(rhs_str, "%u.%u.%u.%u", &rhs[0], &rhs[1], &rhs[2], &rhs[3]); + // Parse out up to 8 components. + unsigned int lhs[8] = {0,0,0,0,0,0,0,0}; + unsigned int rhs[8] = {0,0,0,0,0,0,0,0}; + sscanf(lhs_str, "%u.%u.%u.%u.%u.%u.%u.%u", + &lhs[0], &lhs[1], &lhs[2], &lhs[3], + &lhs[4], &lhs[5], &lhs[6], &lhs[7]); + sscanf(rhs_str, "%u.%u.%u.%u.%u.%u.%u.%u", + &rhs[0], &rhs[1], &rhs[2], &rhs[3], + &rhs[4], &rhs[5], &rhs[6], &rhs[7]); // Do component-wise comparison. - for(unsigned int i=0; i < 4; ++i) + for(unsigned int i=0; i < 8; ++i) { if(lhs[i] < rhs[i]) { |