[Cmake-commits] CMake branch, next, updated. v2.8.7-2305-g0d7524a
Rolf Eike Beer
eike at sf-mail.de
Fri Jan 27 11:56:14 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 0d7524a2fb7107227187d218c68db16409bb6409 (commit)
via 0bee3d95397497cb85a689d8f463b63858d50ebd (commit)
from 94620fd608bfd43eefca720deddb7725e5c8e47b (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=0d7524a2fb7107227187d218c68db16409bb6409
commit 0d7524a2fb7107227187d218c68db16409bb6409
Merge: 94620fd 0bee3d9
Author: Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Fri Jan 27 11:56:12 2012 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Jan 27 11:56:12 2012 -0500
Merge topic 'fix-openssl-version' into next
0bee3d9 FindOpenSSL: properly parse the hex version components
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0bee3d95397497cb85a689d8f463b63858d50ebd
commit 0bee3d95397497cb85a689d8f463b63858d50ebd
Author: Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Fri Jan 27 17:35:12 2012 +0100
Commit: Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Fri Jan 27 17:51:29 2012 +0100
FindOpenSSL: properly parse the hex version components
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake
index 59efe4b..d1fc2d2 100644
--- a/Modules/FindOpenSSL.cmake
+++ b/Modules/FindOpenSSL.cmake
@@ -213,6 +213,37 @@ ELSE(WIN32 AND NOT CYGWIN)
ENDIF(WIN32 AND NOT CYGWIN)
+function(from_hex HEX DEC)
+ string(TOUPPER "${HEX}" HEX)
+ set(_res 0)
+ string(LENGTH "${HEX}" _strlen)
+
+ while (_strlen GREATER 0)
+ math(EXPR _res "${_res} * 16")
+ string(SUBSTRING "${HEX}" 0 1 NIBBLE)
+ string(SUBSTRING "${HEX}" 1 -1 HEX)
+ if (NIBBLE STREQUAL "A")
+ math(EXPR _res "${_res} + 10")
+ elseif (NIBBLE STREQUAL "B")
+ math(EXPR _res "${_res} + 11")
+ elseif (NIBBLE STREQUAL "C")
+ math(EXPR _res "${_res} + 12")
+ elseif (NIBBLE STREQUAL "D")
+ math(EXPR _res "${_res} + 13")
+ elseif (NIBBLE STREQUAL "E")
+ math(EXPR _res "${_res} + 14")
+ elseif (NIBBLE STREQUAL "F")
+ math(EXPR _res "${_res} + 15")
+ else()
+ math(EXPR _res "${_res} + ${NIBBLE}")
+ endif()
+
+ string(LENGTH "${HEX}" _strlen)
+ endwhile()
+
+ set(${DEC} ${_res} PARENT_SCOPE)
+endfunction(from_hex)
+
if (OPENSSL_INCLUDE_DIR)
if (_OPENSSL_VERSION)
set(OPENSSL_VERSION "${_OPENSSL_VERSION}")
@@ -231,15 +262,16 @@ if (OPENSSL_INCLUDE_DIR)
"\\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)
+ from_hex("${OPENSSL_VERSION_MINOR}" OPENSSL_VERSION_MINOR)
list(GET OPENSSL_VERSION_LIST 2 OPENSSL_VERSION_FIX)
+ from_hex("${OPENSSL_VERSION_FIX}" OPENSSL_VERSION_FIX)
list(GET OPENSSL_VERSION_LIST 3 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")
+ from_hex("${OPENSSL_VERSION_PATCH}" _tmp)
# 96 is the ASCII code of 'a' minus 1
- math(EXPR OPENSSL_VERSION_PATCH_ASCII "${OPENSSL_VERSION_PATCH} + 96")
+ math(EXPR OPENSSL_VERSION_PATCH_ASCII "${_tmp} + 96")
+ unset(_tmp)
# 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.
-----------------------------------------------------------------------
Summary of changes:
Modules/FindOpenSSL.cmake | 40 ++++++++++++++++++++++++++++++++++++----
1 files changed, 36 insertions(+), 4 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list