[Cmake-commits] CMake branch, next, updated. v2.8.7-2082-g4992dfa

Rolf Eike Beer eike at sf-mail.de
Fri Jan 13 11:25:34 EST 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  4992dfa97dadfba618992a4c57270fb6b5d501e9 (commit)
       via  8e8672ccdbd6ddc9e0847cbab5b6d1dc6e95c5f7 (commit)
       via  50edbf0f224e81cb85a0588d2495676efc3101f2 (commit)
       via  c89ee4a10f4de32bdffaa1f08f5455f0fc454731 (commit)
      from  317fc87718745b28c78df1852b2b04c7b0800544 (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=4992dfa97dadfba618992a4c57270fb6b5d501e9
commit 4992dfa97dadfba618992a4c57270fb6b5d501e9
Merge: 317fc87 8e8672c
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Fri Jan 13 11:25:32 2012 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Jan 13 11:25:32 2012 -0500

    Merge topic 'openssl-version' into next
    
    8e8672c FindOpenSSL: improve version number handling
    50edbf0 KWSys Nightly Date Stamp
    c89ee4a KWSys Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8e8672ccdbd6ddc9e0847cbab5b6d1dc6e95c5f7
commit 8e8672ccdbd6ddc9e0847cbab5b6d1dc6e95c5f7
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Thu Jan 12 19:29:39 2012 +0100
Commit:     Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Fri Jan 13 17:24:50 2012 +0100

    FindOpenSSL: improve version number handling
    
    First this fixes the bug that e.g. version "1.0.0" was shown as "1..". When
    pkg-config was used to find OpenSSL the header file was parsed for the version
    number even if pkg-config returned it already. Finally we also include the
    patch level (i.e. the letter after the version number) in OPENSSL_VERSION.

diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake
index af799d6..bff5af6 100644
--- a/Modules/FindOpenSSL.cmake
+++ b/Modules/FindOpenSSL.cmake
@@ -7,7 +7,7 @@
 #  OPENSSL_FOUND - system has the OpenSSL library
 #  OPENSSL_INCLUDE_DIR - the OpenSSL include directory
 #  OPENSSL_LIBRARIES - The libraries needed to use OpenSSL
-#  OPENSSL_VERSION - This is set to $major.$minor.$revision (eg. 0.9.8)
+#  OPENSSL_VERSION - This is set to $major.$minor.$revision$path (eg. 0.9.8s)
 
 #=============================================================================
 # Copyright 2006-2009 Kitware, Inc.
@@ -216,16 +216,40 @@ ELSE(WIN32 AND NOT CYGWIN)
 ENDIF(WIN32 AND NOT CYGWIN)
 
 if (OPENSSL_INCLUDE_DIR)
-  file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str REGEX "^#define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x[0-9][0-9][0-9][0-9][0-9][0-9].*")
+  if (_OPENSSL_VERSION)
+    set(OPENSSL_VERSION "${_OPENSSL_VERSION}")
+  else (_OPENSSL_VERSION)
+    file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str
+         REGEX "^#define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x[0-9][0-9][0-9][0-9][0-9][0-9].*")
 
-  string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9]).*$" "\\1" OPENSSL_VERSION_MAJOR "${openssl_version_str}")
-  string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x[0-9]([0-9][0-9]).*$" "\\1" OPENSSL_VERSION_MINOR  "${openssl_version_str}")
-  string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x[0-9][0-9][0-9]([0-9][0-9]).*$" "\\1" OPENSSL_VERSION_PATCH "${openssl_version_str}")
+    # The version number is encoded as 0xMNNFFPPS: major minor fix patch status
+    # The status gives if this is a developer or prerelease and is ignored here.
+    # Major, minor, and fix directly translate into the version numbers shown in
+    # the string. The patch field translates to the single character suffix that
+    # indicates the bug fix state, which 00 -> nothing, 01 -> a, 02 -> b and so
+    # on.
 
-  string(REGEX REPLACE "^0" "" OPENSSL_VERSION_MINOR "${OPENSSL_VERSION_MINOR}")
-  string(REGEX REPLACE "^0" "" OPENSSL_VERSION_PATCH "${OPENSSL_VERSION_PATCH}")
+    string(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]).*$"
+           "\\1;\\2;\\3;\\4;\\5" OPENSSL_VERSION_LIST "${openssl_version_str}")
+    list(GET OPENSSL_VERSION_LIST 0 OPENSSL_VERSION_MAJOR)
+    list(GET OPENSSL_VERSION_LIST 1 OPENSSL_VERSION_MINOR)
+    list(GET OPENSSL_VERSION_LIST 2 OPENSSL_VERSION_FIX)
+    list(GET OPENSSL_VERSION_LIST 3 OPENSSL_VERSION_PATCH)
 
-  set(OPENSSL_VERSION "${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_PATCH}")
+    string(REGEX REPLACE "^0(.)" "\\1" OPENSSL_VERSION_MINOR "${OPENSSL_VERSION_MINOR}")
+    string(REGEX REPLACE "^0(.)" "\\1" OPENSSL_VERSION_FIX "${OPENSSL_VERSION_FIX}")
+
+    if (NOT OPENSSL_VERSION_PATCH STREQUAL "00")
+      # 96 is the ASCII code of 'a' minus 1
+      math(EXPR OPENSSL_VERSION_PATCH_ASCII "${OPENSSL_VERSION_PATCH} + 96")
+      # Once anyone knows how OpenSSL would call the patch versions beyond 'z'
+      # this should be updated to handle that, too. This has not happened yet
+      # so it is simply ignored here for now.
+      string(ASCII "${OPENSSL_VERSION_PATCH_ASCII}" OPENSSL_VERSION_PATCH_STRING)
+    endif (NOT OPENSSL_VERSION_PATCH STREQUAL "00")
+
+    set(OPENSSL_VERSION "${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_FIX}${OPENSSL_VERSION_PATCH_STRING}")
+  endif (_OPENSSL_VERSION)
 endif (OPENSSL_INCLUDE_DIR)
 
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)

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

Summary of changes:
 Modules/FindOpenSSL.cmake         |   40 +++++++++++++++++++++++++++++-------
 Source/kwsys/kwsysDateStamp.cmake |    2 +-
 2 files changed, 33 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list