FindOpenSSL.cmake - ours vs. the cmake one

Alexander Neundorf neundorf at kde.org
Tue Oct 25 21:22:29 UTC 2011


Hi,

I'm still in the process of merging our stuff, e.g. Find-modules from kdelibs,  
into cmake.
Now, attached are the current FindOpenSSL.cmake from CMake and the one from 
kdelibs.
Especially under Windows they do quite different things.

Can somebody else please have a look at the two files and let me know whether 
anything from our version has to be merged into the one from cmake or whether 
the one from CMake is good enough as it is ?

Alex
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FindOpenSSL.cmake
Type: text/x-cmake
Size: 7355 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-buildsystem/attachments/20111025/cfc39512/attachment.bin>
-------------- next part --------------
# - Try to find the OpenSSL encryption library
# Once done this will define
#
#  OPENSSL_FOUND - system has the OpenSSL library
#  OPENSSL_INCLUDE_DIR - the OpenSSL include directory
#  OPENSSL_LIBRARIES - The libraries needed to use OpenSSL
#  OPENSSL_EAY_LIBRARIES - The additional libraries needed to use OpenSSL on windows

# Copyright (c) 2006, Alexander Neundorf, <neundorf at kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.

INCLUDE(FindLibraryWithDebug)

# on win32 we additional need to link to libeay32.lib
MACRO(OPENSSL_ADD_LIB_EAY_LIBS)
   FIND_LIBRARY_WITH_DEBUG(OPENSSL_EAY_LIBRARIES
                   WIN32_DEBUG_POSTFIX d
                   NAMES eay libeay libeay32 libeay32MD)
ENDMACRO(OPENSSL_ADD_LIB_EAY_LIBS)

IF(OPENSSL_LIBRARIES)
   SET(OpenSSL_FIND_QUIETLY TRUE)
ENDIF(OPENSSL_LIBRARIES)

IF(SSL_EAY_DEBUG AND SSL_EAY_RELEASE)
   SET(LIB_FOUND 1)
ENDIF(SSL_EAY_DEBUG AND SSL_EAY_RELEASE)

FIND_PATH(OPENSSL_INCLUDE_DIR openssl/ssl.h )

FIND_LIBRARY_WITH_DEBUG(OPENSSL_LIBRARIES
                WIN32_DEBUG_POSTFIX d
                NAMES ssl ssleay ssleay32 libssleay32 ssleay32MD)

IF(WIN32)
   OPENSSL_ADD_LIB_EAY_LIBS()
   IF(OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES AND OPENSSL_EAY_LIBRARIES)
      SET(OPENSSL_FOUND TRUE)
   ELSE(OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES AND OPENSSL_EAY_LIBRARIES)
      SET(OPENSSL_FOUND FALSE)
   ENDIF (OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES AND OPENSSL_EAY_LIBRARIES)
ELSE(WIN32)
   IF(OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES)
      SET(OPENSSL_FOUND TRUE)
   ELSE(OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES)
      SET(OPENSSL_FOUND FALSE)
   ENDIF (OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES)
ENDIF(WIN32)

IF (OPENSSL_FOUND)
   IF (NOT OpenSSL_FIND_QUIETLY)
      MESSAGE(STATUS "Found OpenSSL: ${OPENSSL_LIBRARIES}")
   ENDIF (NOT OpenSSL_FIND_QUIETLY)
ELSE (OPENSSL_FOUND)
   IF (OpenSSL_FIND_REQUIRED)
      MESSAGE(FATAL_ERROR "Could NOT find OpenSSL")
   ENDIF (OpenSSL_FIND_REQUIRED)
ENDIF (OPENSSL_FOUND)

MARK_AS_ADVANCED(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES)



More information about the Kde-buildsystem mailing list