[Cmake-commits] CMake branch, next, updated. v2.8.9-493-gcb18477

Brad King brad.king at kitware.com
Tue Sep 11 16:00:24 EDT 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  cb1847728a3c9d7d9eb8396c7d0494f9c7088d5d (commit)
       via  dfa0ebd646203e4cecc150ff7589392d899e13d4 (commit)
      from  35bd47bd36b7baad3690804792982bc89226e40c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cb1847728a3c9d7d9eb8396c7d0494f9c7088d5d
commit cb1847728a3c9d7d9eb8396c7d0494f9c7088d5d
Merge: 35bd47b dfa0ebd
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Sep 11 16:00:22 2012 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Sep 11 16:00:22 2012 -0400

    Merge topic 'if-version-depth' into next
    
    dfa0ebd if: Compare up to 8 components in VERSION tests


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dfa0ebd646203e4cecc150ff7589392d899e13d4
commit dfa0ebd646203e4cecc150ff7589392d899e13d4
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Sep 11 15:52:21 2012 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Sep 11 15:59:16 2012 -0400

    if: Compare up to 8 components in VERSION tests
    
    Extend the number of components tested by
    
      if(... VERSION_LESS ...)
      if(... VERSION_EQUAL ...)
      if(... VERSION_GREATER ...)
    
    from 4 to 8.  The latter is a more extreme maximum.

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])
       {
diff --git a/Tests/CMakeTests/VersionTest.cmake.in b/Tests/CMakeTests/VersionTest.cmake.in
index 215bb2b..9e31cb4 100644
--- a/Tests/CMakeTests/VersionTest.cmake.in
+++ b/Tests/CMakeTests/VersionTest.cmake.in
@@ -7,3 +7,10 @@ if("${CMAKE_VERSION}" VERSION_LESS "${min_ver}")
 else()
   message("CMAKE_VERSION=[${CMAKE_VERSION}] is not less than [${min_ver}]")
 endif()
+
+set(v 1.2.3.4.5.6.7)
+if("${v}.8" VERSION_LESS "${v}.9")
+  message(STATUS "${v}.8 is less than ${v}.9")
+else()
+  message(FATAL_ERROR "${v}.8 is not less than ${v}.9?")
+endif()

-----------------------------------------------------------------------

Summary of changes:
 Source/cmIfCommand.cxx                |   16 ++++++++++------
 Tests/CMakeTests/VersionTest.cmake.in |    7 +++++++
 2 files changed, 17 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list