[Cmake-commits] CMake branch, next, updated. v3.3.1-2730-gd26edfd

Brad King brad.king at kitware.com
Wed Sep 2 13:48:38 EDT 2015


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  d26edfde157b408fd74c195ed5191e1234dbdb76 (commit)
       via  369a8cde378ab97826cf4a6d9ef2053bd70ddc0f (commit)
      from  38a311861de628be8789a388377c3b2c0853ab7e (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=d26edfde157b408fd74c195ed5191e1234dbdb76
commit d26edfde157b408fd74c195ed5191e1234dbdb76
Merge: 38a3118 369a8cd
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Sep 2 13:48:37 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Sep 2 13:48:37 2015 -0400

    Merge topic 'FindOpenSSL-static-libs' into next
    
    369a8cde FindOpenSSL: Optionally search only for static libraries


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=369a8cde378ab97826cf4a6d9ef2053bd70ddc0f
commit 369a8cde378ab97826cf4a6d9ef2053bd70ddc0f
Author:     Thijs Wenker <me at thoys.nl>
AuthorDate: Tue Sep 1 14:56:36 2015 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Sep 2 13:47:57 2015 -0400

    FindOpenSSL: Optionally search only for static libraries
    
    Add an OPENSSL_USE_STATIC_LIBS option to enable it.  Adjust
    CMAKE_FIND_LIBRARY_SUFFIXES to only look for .a and .lib files.  Also
    adjust the search paths on Windows for installer locations of static
    libraries.

diff --git a/Help/release/dev/FindOpenSSL-static-libs.rst b/Help/release/dev/FindOpenSSL-static-libs.rst
new file mode 100644
index 0000000..69ec6f2
--- /dev/null
+++ b/Help/release/dev/FindOpenSSL-static-libs.rst
@@ -0,0 +1,5 @@
+FindOpenSSL-static-libs
+-----------------------
+
+* The :module:`FindOpenSSL` module learned a new ``OPENSSL_USE_STATIC_LIBS``
+  option to search only for static libraries.
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake
index 434ef58..d75e8ab 100644
--- a/Modules/FindOpenSSL.cmake
+++ b/Modules/FindOpenSSL.cmake
@@ -36,6 +36,7 @@
 # ^^^^^
 #
 # Set ``OPENSSL_ROOT_DIR`` to the root directory of an OpenSSL installation.
+# Set ``OPENSSL_USE_STATIC_LIBS`` to ``TRUE`` to look for static libraries.
 
 #=============================================================================
 # Copyright 2006-2009 Kitware, Inc.
@@ -57,6 +58,16 @@ if (UNIX)
   pkg_check_modules(_OPENSSL QUIET openssl)
 endif ()
 
+# Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES
+if(OPENSSL_USE_STATIC_LIBS)
+  set(_openssl_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
+  if(WIN32)
+    set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
+  else()
+    set(CMAKE_FIND_LIBRARY_SUFFIXES .a )
+  endif()
+endif()
+
 if (WIN32)
   # http://www.slproweb.com/products/Win32OpenSSL.html
   set(_OPENSSL_ROOT_HINTS
@@ -113,12 +124,21 @@ if(WIN32 AND NOT CYGWIN)
     # We are using the libraries located in the VC subdir instead of the parent directory eventhough :
     # libeay32MD.lib is identical to ../libeay32.lib, and
     # ssleay32MD.lib is identical to ../ssleay32.lib
+    # enable OPENSSL_USE_STATIC_LIBS to use the static libs located in lib/VC/static
 
-    set(_OPENSSL_PATH_SUFFIXES
-      "lib"
-      "VC"
-      "lib/VC"
-      )
+    if(OPENSSL_USE_STATIC_LIBS)
+      set(_OPENSSL_PATH_SUFFIXES
+        "lib"
+        "VC/static"
+        "lib/VC/static"
+        )
+    else()
+      set(_OPENSSL_PATH_SUFFIXES
+        "lib"
+        "VC"
+        "lib/VC"
+        )
+    endif ()
 
     find_library(LIB_EAY_DEBUG
       NAMES
@@ -414,3 +434,8 @@ if(OPENSSL_FOUND)
     endif()
   endif()
 endif()
+
+# Restore the original find library ordering
+if(OPENSSL_USE_STATIC_LIBS)
+  set(CMAKE_FIND_LIBRARY_SUFFIXES ${_openssl_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
+endif()

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

Summary of changes:
 Help/release/dev/FindOpenSSL-static-libs.rst |    5 ++++
 Modules/FindOpenSSL.cmake                    |   35 ++++++++++++++++++++++----
 2 files changed, 35 insertions(+), 5 deletions(-)
 create mode 100644 Help/release/dev/FindOpenSSL-static-libs.rst


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list