Files
android_openssl/android_openssl.cmake
T
AdamandGitHub 8df104940f Add a CMake function to include the OpenSSL libs for specific targets (#48)
Changes include:
* Rename CMakeLists.txt to android_openssl.cmake
* Move the CMake code into a function android_add_openssl_to_targets(), so that the caller can decide what targets get the OpenSSL libs
* update README
2023-06-20 19:56:20 +03:00

21 lines
813 B
CMake

function(add_android_openssl_libraries)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set (ssl_root_path ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/no-asm)
else()
set (ssl_root_path ${CMAKE_CURRENT_FUNCTION_LIST_DIR})
endif()
if (Qt6_VERSION VERSION_GREATER_EQUAL 6.5.0)
list(APPEND android_extra_libs
${ssl_root_path}/ssl_3/${CMAKE_ANDROID_ARCH_ABI}/libcrypto_3.so
${ssl_root_path}/ssl_3/${CMAKE_ANDROID_ARCH_ABI}/libssl_3.so)
else()
list(APPEND android_extra_libs
${ssl_root_path}/ssl_1.1/${CMAKE_ANDROID_ARCH_ABI}/libcrypto_1_1.so
${ssl_root_path}/ssl_1.1/${CMAKE_ANDROID_ARCH_ABI}/libssl_1_1.so)
endif()
set_target_properties(${ARGN} PROPERTIES
QT_ANDROID_EXTRA_LIBS "${android_extra_libs}")
endfunction()