TLS plugin for the TQt Cryptographic Architecture
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

74 lines
2.2 KiB

  1. ###########################################
  2. # #
  3. # Improvements and feedback are welcome #
  4. # #
  5. # This file is released under GPL >= 3 #
  6. # #
  7. ###########################################
  8. # required stuff
  9. find_package( TQt )
  10. tde_setup_architecture_flags( )
  11. include(TestBigEndian)
  12. test_big_endian(WORDS_BIGENDIAN)
  13. tde_setup_largefiles( )
  14. ##### check for gcc visibility support
  15. if( WITH_GCC_VISIBILITY )
  16. tde_setup_gcc_visibility( )
  17. endif( WITH_GCC_VISIBILITY )
  18. ##### check for openssl
  19. find_package( OpenSSL )
  20. if( NOT SSL_FOUND )
  21. check_include_file( openssl/ssl.h HAVE_OPENSSL_H )
  22. check_library_exists( ssl OPENSSL_init_ssl "" HAVE_LIBSSL_11 )
  23. if( NOT HAVE_LIBSSL_11 )
  24. check_library_exists( ssl SSL_library_init "" HAVE_LIBSSL )
  25. endif( )
  26. check_library_exists( crypto EVP_EncryptInit_ex "" HAVE_LIBCRYPTO )
  27. if( HAVE_OPENSSL_H AND (HAVE_LIBSSL_11 OR HAVEL_LIBSSL) AND HAVE_LIBCRYPTO )
  28. set( SSL_FOUND 1 CACHE INTERNAL "" FORCE )
  29. find_file( OPENSSLV_H openssl/opensslv.h )
  30. file( STRINGS "${OPENSSLV_H}" SSL_VERSION REGEX "#[ \t]*define[ \t]*OPENSSL_VERSION_TEXT" )
  31. string( REGEX REPLACE "# *define[ \t]*OPENSSL_VERSION_TEXT[ \t]*\"[^0-9 ]* *([^ ]*).*" "\\1"
  32. SSL_VERSION "${SSL_VERSION}" )
  33. set( SSL_VERSION "${SSL_VERSION}" CACHE INTERNAL "" FORCE )
  34. message( STATUS "Found OpenSSL: version ${SSL_VERSION}" )
  35. endif( HAVE_OPENSSL_H AND (HAVE_LIBSSL_11 OR HAVEL_LIBSSL) AND HAVE_LIBCRYPTO )
  36. endif( NOT SSL_FOUND )
  37. if( NOT OPENSSL_FOUND )
  38. tde_message_fatal( "OpenSSL is required but was not found on your system" )
  39. endif()
  40. ##### look for tqt3 plugins path
  41. execute_process(
  42. COMMAND ${PKG_CONFIG_EXECUTABLE}
  43. --variable=pluginsdir tqt-mt
  44. OUTPUT_VARIABLE TQT_PLUGINS_DIR
  45. OUTPUT_STRIP_TRAILING_WHITESPACE
  46. )
  47. if( TQT_PLUGINS_DIR )
  48. set( TQT_PLUGINS_CRYPTO_DIR "${TQT_PLUGINS_DIR}/crypto" )
  49. endif()
  50. ###### check for tqca
  51. pkg_search_module( TQCA tqca )
  52. if( TQCA_FOUND )
  53. set( HAVE_TQCA 1 )
  54. else()
  55. message( STATUS " tqca was not found, built-in copy will be used" )
  56. endif( )