Open sadeghhosseini opened 5 years ago
You have to use the cmake project provided with it by the following: I.e if you have copied this project into your source dir (CMAKE_CURRENT_SOURCE_DIR) with the path name "openssl":
# Provides dependency openssl
find_package(OpenSSL QUIET)
if(NOT OPENSSL_FOUND)
add_subdirectory(
${CMAKE_CURRENT_SOURCE_DIR}/openssl
${CMAKE_CURRENT_BINARY_DIR}/openssl
EXCLUDE_FROM_ALL
)
set(OPENSSL_SSL_LIBRARY ssl)
set(OPENSSL_CRYPTO_LIBRARY crypto)
set(OPENSSL_INCLUDE_DIR "${openssl_BINARY_DIR}/include" "${openssl_BINARY_DIR}")
set(OPENSSL_FOUND ON)
message(STATUS "Build OpenSSL: ${openssl_BINARY_DIR}")
endif()
set (HAVE_OPENSSL 1)
include_directories (${OPENSSL_INCLUDE_DIR})
...
target_link_libraries (native-lib ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})
I build success for android with the latest version.
I am trying to build and use this library in android. This is my cp/CMakeLists.txt's content:
When I try to build this, I get this error: C:/Users/admin/AndroidStudioProjects/CPR/app/src/main/cpp/openssl/crypto/bn/bn_depr.c:15:10: fatal error: 'openssl/opensslconf.h' file not found
What is the problem? Thanks in advance.