Warning, /libraries/qca/plugins/qca-ossl/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 # QCA OSSL
0002 
0003 if(WITH_ossl_PLUGIN STREQUAL "yes")
0004   find_package(OpenSSL 1.1.1 REQUIRED)
0005 else()
0006   find_package(OpenSSL 1.1.1)
0007 endif()
0008 
0009 if(OPENSSL_FOUND)
0010   enable_plugin("ossl")
0011 
0012   include(CheckFunctionExists)
0013   set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES})
0014   check_function_exists(EVP_md2 HAVE_OPENSSL_MD2)
0015   if(HAVE_OPENSSL_MD2)
0016     add_definitions(-DHAVE_OPENSSL_MD2)
0017   else()
0018     message(WARNING "qca-ossl will be compiled without MD2 digest algorithm support")
0019   endif()
0020 
0021   check_function_exists(EVP_aes_128_ctr HAVE_OPENSSL_AES_CTR)
0022   if(HAVE_OPENSSL_AES_CTR)
0023     add_definitions(-DHAVE_OPENSSL_AES_CTR)
0024   else()
0025     message(WARNING "qca-ossl will be compiled without AES CTR mode encryption support")
0026   endif()
0027 
0028   check_function_exists(EVP_aes_128_gcm HAVE_OPENSSL_AES_GCM)
0029   if(HAVE_OPENSSL_AES_GCM)
0030     add_definitions(-DHAVE_OPENSSL_AES_GCM)
0031   else()
0032     message(WARNING "qca-ossl will be compiled without AES GCM mode encryption support")
0033   endif()
0034 
0035   check_function_exists(EVP_aes_128_ccm HAVE_OPENSSL_AES_CCM)
0036   if(HAVE_OPENSSL_AES_CCM)
0037     add_definitions(-DHAVE_OPENSSL_AES_CCM)
0038   else()
0039     message(WARNING "qca-ossl will be compiled without AES CCM mode encryption support")
0040   endif()
0041 
0042   check_function_exists(EVP_sha HAVE_OPENSSL_SHA0)
0043   if(HAVE_OPENSSL_SHA0)
0044     add_definitions(-DHAVE_OPENSSL_SHA0)
0045   else()
0046     message(WARNING "qca-ossl will be compiled without SHA-0 digest algorithm support")
0047   endif()
0048 
0049   set(QCA_OSSL_SOURCES
0050       qca-ossl.cpp)
0051 
0052   add_library(qca-ossl ${PLUGIN_TYPE} ${QCA_OSSL_SOURCES})
0053 
0054   if(APPLE AND ${PLUGIN_TYPE} STREQUAL "MODULE")
0055     set_property(TARGET qca-ossl PROPERTY SUFFIX ".dylib")
0056   endif()
0057 
0058 
0059   target_link_libraries(qca-ossl Qt${QT_MAJOR_VERSION}::Core)
0060   target_link_libraries(qca-ossl ${QCA_LIB_NAME})
0061   target_link_libraries(qca-ossl OpenSSL::SSL OpenSSL::Crypto)
0062 
0063   if(NOT DEVELOPER_MODE)
0064     install(TARGETS qca-ossl
0065             LIBRARY DESTINATION "${QCA_CRYPTO_INSTALL_DIR}"
0066             ARCHIVE DESTINATION "${QCA_CRYPTO_INSTALL_DIR}"
0067             RUNTIME DESTINATION "${QCA_CRYPTO_INSTALL_DIR}")
0068 
0069     install_pdb(qca-ossl ${QCA_CRYPTO_INSTALL_DIR})
0070   endif()
0071 
0072 else()
0073   disable_plugin("ossl")
0074 endif()