diff options
author | Georg Lutz <georg@georglutz.de> | 2022-05-02 19:19:04 (GMT) |
---|---|---|
committer | Georg Lutz <georg@georglutz.de> | 2022-05-06 20:07:07 (GMT) |
commit | e6656381aa7e97af4bafca2c959f01e491a4c621 (patch) | |
tree | 4df738bb71c9eb901824e397f766a4118ec51e45 | |
parent | 8dbf38eaaf0d465a7b44e337204c3b763915ebb5 (diff) | |
download | CMake-e6656381aa7e97af4bafca2c959f01e491a4c621.zip CMake-e6656381aa7e97af4bafca2c959f01e491a4c621.tar.gz CMake-e6656381aa7e97af4bafca2c959f01e491a4c621.tar.bz2 |
FindOpenSSL: Support version 1.1.1 under QNX 7.0
QNX 7.0 allows parallel installation of OpenSSL 1.0.2 and OpenSSL 1.1.1. The
1.1.1 version has "1_1" appended to the include dir and library names.
-rw-r--r-- | Modules/FindOpenSSL.cmake | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake index 5a8bfef..d6a3a88 100644 --- a/Modules/FindOpenSSL.cmake +++ b/Modules/FindOpenSSL.cmake @@ -148,6 +148,19 @@ if(OPENSSL_USE_STATIC_LIBS) endif() endif() +if(CMAKE_SYSTEM_NAME STREQUAL "QNX" AND + CMAKE_SYSTEM_VERSION VERSION_GREATER_EQUAL "7.0" AND CMAKE_SYSTEM_VERSION VERSION_LESS "7.1" AND + OpenSSL_FIND_VERSION VERSION_GREATER_EQUAL "1.1" AND OpenSSL_FIND_VERSION VERSION_LESS "1.2") + # QNX 7.0.x provides openssl 1.0.2 and 1.1.1 in parallel: + # * openssl 1.0.2: libcrypto.so.2 and libssl.so.2, headers under usr/include/openssl + # * openssl 1.1.1: libcrypto1_1.so.2.1 and libssl1_1.so.2.1, header under usr/include/openssl1_1 + # See http://www.qnx.com/developers/articles/rel_6726_0.html + set(_OPENSSL_FIND_PATH_SUFFIX "openssl1_1") + set(_OPENSSL_NAME_POSTFIX "1_1") +else() + set(_OPENSSL_FIND_PATH_SUFFIX "include") +endif() + if (WIN32) # http://www.slproweb.com/products/Win32OpenSSL.html set(_OPENSSL_ROOT_HINTS @@ -200,7 +213,7 @@ find_path(OPENSSL_INCLUDE_DIR ${_OPENSSL_INCLUDEDIR} ${_OPENSSL_INCLUDE_DIRS} PATH_SUFFIXES - include + ${_OPENSSL_FIND_PATH_SUFFIX} ) if(WIN32 AND NOT CYGWIN) @@ -430,7 +443,7 @@ else() find_library(OPENSSL_SSL_LIBRARY NAMES - ssl + ssl${_OPENSSL_NAME_POSTFIX} ssleay32 ssleay32MD NAMES_PER_DIR @@ -444,7 +457,7 @@ else() find_library(OPENSSL_CRYPTO_LIBRARY NAMES - crypto + crypto${_OPENSSL_NAME_POSTFIX} NAMES_PER_DIR ${_OPENSSL_ROOT_HINTS_AND_PATHS} HINTS @@ -681,3 +694,6 @@ endif() if(OPENSSL_USE_STATIC_LIBS) set(CMAKE_FIND_LIBRARY_SUFFIXES ${_openssl_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) endif() + +unset(_OPENSSL_FIND_PATH_SUFFIX) +unset(_OPENSSL_NAME_POSTFIX) |