diff options
author | gregory guy <gregory-tde@laposte.net> | 2020-06-05 15:35:30 +0200 |
---|---|---|
committer | gregory guy <gregory-tde@laposte.net> | 2020-06-05 15:47:19 +0200 |
commit | 11c5062539a42b939727a3f0f8a6fbacc1b238be (patch) | |
tree | 6f0464aab1d36ee7aa8f17cdea20c14b7ed41c40 /ConfigureChecks.cmake | |
parent | de741fb836ee6836ce2beb0a369f03ddcbdef036 (diff) | |
download | kasablanca-11c5062539a42b939727a3f0f8a6fbacc1b238be.tar.gz kasablanca-11c5062539a42b939727a3f0f8a6fbacc1b238be.zip |
Drop automake build support.
Add basic cmake build instructions.
Delete empty file NEWS and rpm spec files.
Better detection for OpenSSL headers and libraries.
Write a README file.
Rework of the help page.
Some cosmetics.
Signed-off-by: gregory guy <gregory-tde@laposte.net>
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r-- | ConfigureChecks.cmake | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 09af851..213e8ba 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -27,7 +27,28 @@ endif( WITH_GCC_VISIBILITY ) ##### check for OpenSSL -find_package( OpenSSL ) -if( NOT OPENSSL_FOUND ) - tde_message_fatal( "SSL support is required but OpenSSL was not found on your system" ) -endif( NOT OPENSSL_FOUND ) +pkg_search_module( SSL openssl ) + +if( NOT SSL_FOUND ) + check_include_file( openssl/ssl.h HAVE_OPENSSL_H ) + check_library_exists( ssl OPENSSL_init_ssl "" HAVE_LIBSSL_11 ) + check_library_exists( crypto EVP_EncryptInit_ex "" HAVE_LIBCRYPTO ) + + if( NOT HAVE_LIBSSL_11 ) + check_library_exists( ssl SSL_library_init "" HAVE_LIBSSL ) + endif() + + if( HAVE_OPENSSL_H AND HAVE_LIBCRYPTO AND (HAVE_LIBSSL_11 OR HAVE_LIBSSL) ) + set( SSL_FOUND 1 CACHE INTERNAL "" FORCE ) + find_file( OPENSSLV_H openssl/opensslv.h ) + file( STRINGS "${OPENSSLV_H}" SSL_VERSION REGEX "#[ \t]*define[ \t]*OPENSSL_VERSION_TEXT" ) + string( REGEX REPLACE "# *define[ \t]*OPENSSL_VERSION_TEXT[ \t]*\"[^0-9 ]* *([^ ]*).*" "\\1" SSL_VERSION "${SSL_VERSION}" ) + set( SSL_VERSION "${SSL_VERSION}" CACHE INTERNAL "" FORCE ) + message( STATUS "Found OpenSSL: version ${SSL_VERSION}" ) + set( SSL_LIBRARIES "ssl;crypto" CACHE INTERNAL "ssl and crypto libs" FORCE ) + endif() +endif( NOT SSL_FOUND ) + +if( NOT SSL_FOUND ) + tde_message_fatal( "SSL support is required but OpenSSL was not found on your system" ) +endif( NOT SSL_FOUND ) |