Permalink
Browse files

Fix OpenSSLCrypto feature detection

  • Loading branch information...
hephooey committed Dec 3, 2016
1 parent 5ba6d9a commit fa28e0e48c5678456bfbaeebd3c57a95a1adb812
Showing with 31 additions and 31 deletions.
  1. +25 −25 cmake/FindOpenSSLCrypto.cmake
  2. +6 −6 src/CMakeLists.txt
@@ -14,9 +14,9 @@
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
IF(OPENSSL_CRYPTO_LIBRARIES)
SET(OpenSSL_CRYPTO_FIND_QUIETLY TRUE)
ENDIF(OPENSSL_CRYPTO_LIBRARIES)
IF(OPENSSLCRYPTO_LIBRARIES)
SET(OpenSSLCRYPTO_FIND_QUIETLY TRUE)
ENDIF(OPENSSLCRYPTO_LIBRARIES)
IF(LIB_EAY_DEBUG AND LIB_EAY_RELEASE)
SET(LIB_FOUND 1)
@@ -64,7 +64,7 @@ set(_OPENSSL_ROOT_HINTS_AND_PATHS
PATHS ${_OPENSSL_ROOT_PATHS}
)
find_path(OPENSSL_CRYPTO_INCLUDE_DIR
find_path(OPENSSLCRYPTO_INCLUDE_DIR
NAMES
openssl/ssl.h
${_OPENSSL_ROOT_HINTS_AND_PATHS}
@@ -74,7 +74,7 @@ find_path(OPENSSL_CRYPTO_INCLUDE_DIR
include
)
#FIND_PATH(OPENSSL_CRYPTO_INCLUDE_DIR openssl/ssl.h )
#FIND_PATH(OPENSSLCRYPTO_INCLUDE_DIR openssl/ssl.h )
IF(WIN32 AND MSVC)
# /MD and /MDd are the standard values - if someone wants to use
@@ -146,22 +146,22 @@ IF(WIN32 AND MSVC)
IF(MSVC_IDE)
IF(LIB_EAY_DEBUG AND LIB_EAY_RELEASE)
SET(OPENSSL_CRYPTO_LIBRARIES optimized ${LIB_EAY_RELEASE} debug ${LIB_EAY_DEBUG})
SET(OPENSSLCRYPTO_LIBRARIES optimized ${LIB_EAY_RELEASE} debug ${LIB_EAY_DEBUG})
ELSE(LIB_EAY_DEBUG AND LIB_EAY_RELEASE)
SET(OPENSSL_CRYPTO_LIBRARIES NOTFOUND)
SET(OPENSSLCRYPTO_LIBRARIES NOTFOUND)
MESSAGE(STATUS "Could not find the debug and release version of openssl")
ENDIF(LIB_EAY_DEBUG AND LIB_EAY_RELEASE)
ELSE(MSVC_IDE)
STRING(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER)
IF(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
SET(OPENSSL_CRYPTO_LIBRARIES ${LIB_EAY_DEBUG})
SET(OPENSSLCRYPTO_LIBRARIES ${LIB_EAY_DEBUG})
ELSE(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
SET(OPENSSL_CRYPTO_LIBRARIES ${LIB_EAY_RELEASE})
SET(OPENSSLCRYPTO_LIBRARIES ${LIB_EAY_RELEASE})
ENDIF(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
ENDIF(MSVC_IDE)
MARK_AS_ADVANCED(LIB_EAY_DEBUG LIB_EAY_RELEASE)
ELSE(WIN32 AND MSVC)
FIND_LIBRARY(OPENSSL_CRYPTO_LIBRARIES
FIND_LIBRARY(OPENSSLCRYPTO_LIBRARIES
NAMES
crypto
libeay32
@@ -172,21 +172,21 @@ ELSE(WIN32 AND MSVC)
)
ENDIF(WIN32 AND MSVC)
IF(OPENSSL_CRYPTO_INCLUDE_DIR AND OPENSSL_CRYPTO_LIBRARIES)
SET(OPENSSL_CRYPTO_FOUND TRUE)
ELSE(OPENSSL_CRYPTO_INCLUDE_DIR AND OPENSSL_CRYPTO_LIBRARIES)
SET(OPENSSL_CRYPTO_FOUND FALSE)
ENDIF (OPENSSL_CRYPTO_INCLUDE_DIR AND OPENSSL_CRYPTO_LIBRARIES)
IF (OPENSSL_CRYPTO_FOUND)
IF (NOT OpenSSL_CRYPTO_FIND_QUIETLY)
MESSAGE(STATUS "Found OpenSSL Crypto Library: ${OPENSSL_CRYPTO_LIBRARIES}")
ENDIF (NOT OpenSSL_CRYPTO_FIND_QUIETLY)
ELSE (OPENSSL_CRYPTO_FOUND)
IF (OpenSSL_CRYPTO_FIND_REQUIRED)
IF(OPENSSLCRYPTO_INCLUDE_DIR AND OPENSSLCRYPTO_LIBRARIES)
SET(OPENSSLCRYPTO_FOUND TRUE)
ELSE(OPENSSLCRYPTO_INCLUDE_DIR AND OPENSSLCRYPTO_LIBRARIES)
SET(OPENSSLCRYPTO_FOUND FALSE)
ENDIF (OPENSSLCRYPTO_INCLUDE_DIR AND OPENSSLCRYPTO_LIBRARIES)
IF (OPENSSLCRYPTO_FOUND)
IF (NOT OpenSSLCRYPTO_FIND_QUIETLY)
MESSAGE(STATUS "Found OpenSSL Crypto Library: ${OPENSSLCRYPTO_LIBRARIES}")
ENDIF (NOT OpenSSLCRYPTO_FIND_QUIETLY)
ELSE (OPENSSLCRYPTO_FOUND)
IF (OpenSSLCRYPTO_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could NOT find OpenSSL")
ENDIF (OpenSSL_CRYPTO_FIND_REQUIRED)
ENDIF (OPENSSL_CRYPTO_FOUND)
ENDIF (OpenSSLCRYPTO_FIND_REQUIRED)
ENDIF (OPENSSLCRYPTO_FOUND)
MARK_AS_ADVANCED(OPENSSL_CRYPTO_INCLUDE_DIR OPENSSL_CRYPTO_LIBRARIES)
MARK_AS_ADVANCED(OPENSSLCRYPTO_INCLUDE_DIR OPENSSLCRYPTO_LIBRARIES)
View
@@ -29,12 +29,12 @@ endif(NOT CMAKE_HAVE_GETHOSTBYNAME)
if(QTERM_ENABLE_SSH)
find_package(OpenSSLCrypto)
if(OPENSSL_CRYPTO_FOUND)
if(OPENSSLCRYPTO_FOUND)
message(STATUS "OpenSSL found, enable SSH support")
add_definitions(-DSSH_ENABLED)
include_directories(${OPENSSL_CRYPTO_INCLUDE_DIR})
get_filename_component(OPENSSL_CRYPTO_ROOT_DIR ${OPENSSL_CRYPTO_INCLUDE_DIR} PATH)
set(optionalLibs ${optionalLibs} ${OPENSSL_CRYPTO_LIBRARIES})
include_directories(${OPENSSLCRYPTO_INCLUDE_DIR})
get_filename_component(OPENSSLCRYPTO_ROOT_DIR ${OPENSSLCRYPTO_INCLUDE_DIR} PATH)
set(optionalLibs ${optionalLibs} ${OPENSSLCRYPTO_LIBRARIES})
set(optionalSources ${optionalSources}
ssh/libcrypto-compat.c
ssh/key.cpp
@@ -45,7 +45,7 @@ if(QTERM_ENABLE_SSH)
ssh/packet.cpp
ssh/socket.cpp
ssh/transport.cpp)
endif(OPENSSL_CRYPTO_FOUND)
endif(OPENSSLCRYPTO_FOUND)
endif(QTERM_ENABLE_SSH)
if(QTERM_ENABLE_DBUS)
if(QT_QTDBUS_FOUND)
@@ -382,7 +382,7 @@ else (APPLE)
install(CODE "
file(GLOB_RECURSE PLUGINS \${CMAKE_INSTALL_PREFIX}/bin/plugins/*${CMAKE_SHARED_LIBRARY_SUFFIX})
include(BundleUtilities)
set(DIRS ${QT_BINARY_DIR} ${QT_LIBRARY_DIR} ${OPENSSL_CRYPTO_ROOT_DIR})
set(DIRS ${QT_BINARY_DIR} ${QT_LIBRARY_DIR} ${OPENSSLCRYPTO_ROOT_DIR})
fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/bin/${PROGRAME}.exe\"
\"\${PLUGINS}\"
\"\${DIRS}\")

0 comments on commit fa28e0e

Please sign in to comment.