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. # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
IF(OPENSSL_CRYPTO_LIBRARIES) IF(OPENSSLCRYPTO_LIBRARIES)
SET(OpenSSL_CRYPTO_FIND_QUIETLY TRUE) SET(OpenSSLCRYPTO_FIND_QUIETLY TRUE)
ENDIF(OPENSSL_CRYPTO_LIBRARIES) ENDIF(OPENSSLCRYPTO_LIBRARIES)
IF(LIB_EAY_DEBUG AND LIB_EAY_RELEASE) IF(LIB_EAY_DEBUG AND LIB_EAY_RELEASE)
SET(LIB_FOUND 1) SET(LIB_FOUND 1)
@@ -64,7 +64,7 @@ set(_OPENSSL_ROOT_HINTS_AND_PATHS
PATHS ${_OPENSSL_ROOT_PATHS} PATHS ${_OPENSSL_ROOT_PATHS}
) )
find_path(OPENSSL_CRYPTO_INCLUDE_DIR find_path(OPENSSLCRYPTO_INCLUDE_DIR
NAMES NAMES
openssl/ssl.h openssl/ssl.h
${_OPENSSL_ROOT_HINTS_AND_PATHS} ${_OPENSSL_ROOT_HINTS_AND_PATHS}
@@ -74,7 +74,7 @@ find_path(OPENSSL_CRYPTO_INCLUDE_DIR
include include
) )
#FIND_PATH(OPENSSL_CRYPTO_INCLUDE_DIR openssl/ssl.h ) #FIND_PATH(OPENSSLCRYPTO_INCLUDE_DIR openssl/ssl.h )
IF(WIN32 AND MSVC) IF(WIN32 AND MSVC)
# /MD and /MDd are the standard values - if someone wants to use # /MD and /MDd are the standard values - if someone wants to use
@@ -146,22 +146,22 @@ IF(WIN32 AND MSVC)
IF(MSVC_IDE) IF(MSVC_IDE)
IF(LIB_EAY_DEBUG AND LIB_EAY_RELEASE) 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) 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") MESSAGE(STATUS "Could not find the debug and release version of openssl")
ENDIF(LIB_EAY_DEBUG AND LIB_EAY_RELEASE) ENDIF(LIB_EAY_DEBUG AND LIB_EAY_RELEASE)
ELSE(MSVC_IDE) ELSE(MSVC_IDE)
STRING(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER) STRING(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER)
IF(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug) 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) 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(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
ENDIF(MSVC_IDE) ENDIF(MSVC_IDE)
MARK_AS_ADVANCED(LIB_EAY_DEBUG LIB_EAY_RELEASE) MARK_AS_ADVANCED(LIB_EAY_DEBUG LIB_EAY_RELEASE)
ELSE(WIN32 AND MSVC) ELSE(WIN32 AND MSVC)
FIND_LIBRARY(OPENSSL_CRYPTO_LIBRARIES FIND_LIBRARY(OPENSSLCRYPTO_LIBRARIES
NAMES NAMES
crypto crypto
libeay32 libeay32
@@ -172,21 +172,21 @@ ELSE(WIN32 AND MSVC)
) )
ENDIF(WIN32 AND MSVC) ENDIF(WIN32 AND MSVC)
IF(OPENSSL_CRYPTO_INCLUDE_DIR AND OPENSSL_CRYPTO_LIBRARIES) IF(OPENSSLCRYPTO_INCLUDE_DIR AND OPENSSLCRYPTO_LIBRARIES)
SET(OPENSSL_CRYPTO_FOUND TRUE) SET(OPENSSLCRYPTO_FOUND TRUE)
ELSE(OPENSSL_CRYPTO_INCLUDE_DIR AND OPENSSL_CRYPTO_LIBRARIES) ELSE(OPENSSLCRYPTO_INCLUDE_DIR AND OPENSSLCRYPTO_LIBRARIES)
SET(OPENSSL_CRYPTO_FOUND FALSE) SET(OPENSSLCRYPTO_FOUND FALSE)
ENDIF (OPENSSL_CRYPTO_INCLUDE_DIR AND OPENSSL_CRYPTO_LIBRARIES) ENDIF (OPENSSLCRYPTO_INCLUDE_DIR AND OPENSSLCRYPTO_LIBRARIES)
IF (OPENSSL_CRYPTO_FOUND) IF (OPENSSLCRYPTO_FOUND)
IF (NOT OpenSSL_CRYPTO_FIND_QUIETLY) IF (NOT OpenSSLCRYPTO_FIND_QUIETLY)
MESSAGE(STATUS "Found OpenSSL Crypto Library: ${OPENSSL_CRYPTO_LIBRARIES}") MESSAGE(STATUS "Found OpenSSL Crypto Library: ${OPENSSLCRYPTO_LIBRARIES}")
ENDIF (NOT OpenSSL_CRYPTO_FIND_QUIETLY) ENDIF (NOT OpenSSLCRYPTO_FIND_QUIETLY)
ELSE (OPENSSL_CRYPTO_FOUND) ELSE (OPENSSLCRYPTO_FOUND)
IF (OpenSSL_CRYPTO_FIND_REQUIRED) IF (OpenSSLCRYPTO_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could NOT find OpenSSL") MESSAGE(FATAL_ERROR "Could NOT find OpenSSL")
ENDIF (OpenSSL_CRYPTO_FIND_REQUIRED) ENDIF (OpenSSLCRYPTO_FIND_REQUIRED)
ENDIF (OPENSSL_CRYPTO_FOUND) 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) if(QTERM_ENABLE_SSH)
find_package(OpenSSLCrypto) find_package(OpenSSLCrypto)
if(OPENSSL_CRYPTO_FOUND) if(OPENSSLCRYPTO_FOUND)
message(STATUS "OpenSSL found, enable SSH support") message(STATUS "OpenSSL found, enable SSH support")
add_definitions(-DSSH_ENABLED) add_definitions(-DSSH_ENABLED)
include_directories(${OPENSSL_CRYPTO_INCLUDE_DIR}) include_directories(${OPENSSLCRYPTO_INCLUDE_DIR})
get_filename_component(OPENSSL_CRYPTO_ROOT_DIR ${OPENSSL_CRYPTO_INCLUDE_DIR} PATH) get_filename_component(OPENSSLCRYPTO_ROOT_DIR ${OPENSSLCRYPTO_INCLUDE_DIR} PATH)
set(optionalLibs ${optionalLibs} ${OPENSSL_CRYPTO_LIBRARIES}) set(optionalLibs ${optionalLibs} ${OPENSSLCRYPTO_LIBRARIES})
set(optionalSources ${optionalSources} set(optionalSources ${optionalSources}
ssh/libcrypto-compat.c ssh/libcrypto-compat.c
ssh/key.cpp ssh/key.cpp
@@ -45,7 +45,7 @@ if(QTERM_ENABLE_SSH)
ssh/packet.cpp ssh/packet.cpp
ssh/socket.cpp ssh/socket.cpp
ssh/transport.cpp) ssh/transport.cpp)
endif(OPENSSL_CRYPTO_FOUND) endif(OPENSSLCRYPTO_FOUND)
endif(QTERM_ENABLE_SSH) endif(QTERM_ENABLE_SSH)
if(QTERM_ENABLE_DBUS) if(QTERM_ENABLE_DBUS)
if(QT_QTDBUS_FOUND) if(QT_QTDBUS_FOUND)
@@ -382,7 +382,7 @@ else (APPLE)
install(CODE " install(CODE "
file(GLOB_RECURSE PLUGINS \${CMAKE_INSTALL_PREFIX}/bin/plugins/*${CMAKE_SHARED_LIBRARY_SUFFIX}) file(GLOB_RECURSE PLUGINS \${CMAKE_INSTALL_PREFIX}/bin/plugins/*${CMAKE_SHARED_LIBRARY_SUFFIX})
include(BundleUtilities) 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\" fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/bin/${PROGRAME}.exe\"
\"\${PLUGINS}\" \"\${PLUGINS}\"
\"\${DIRS}\") \"\${DIRS}\")

0 comments on commit fa28e0e

Please sign in to comment.