Improve cmake files for building on Android

Signed-off-by: William Brawner <me@wbrawner.com>
This commit is contained in:
William Brawner 2020-01-11 15:32:49 -07:00
parent 05e8690fb0
commit 3e67cd240b

View file

@ -25,42 +25,46 @@ set(PIHELPER_SOURCES
)
include_directories(/usr/local/include)
if (NOT TARGET CURL)
find_library(
CURL
NAMES curl libcurl
HINTS /usr/local/lib /usr/local/lib64 /usr/lib /usr/lib64
)
if (NOT CURL)
message(SEND_ERROR "Did not find curl")
endif()
endif()
if (NOT TARGET JSONC)
find_library(
JSONC
NAMES json-c libjson-c
HINTS /usr/local/lib /usr/local/lib64 /usr/lib /usr/lib64
)
if (NOT JSONC)
message(SEND_ERROR "Did not find json-c")
endif()
endif()
if (NOT TARGET CRYPTO)
find_library(
CRYPTO
NAMES crypto libcrypto
HINTS /usr/local/lib /usr/local/lib64 /usr/lib /usr/lib64
)
if (NOT CRYPTO)
message(SEND_ERROR "Did not find OpenSSL")
endif()
endif()
if (NOT TARGET OPENSSL)
find_library(
OPENSSL
NAMES ssl libssl
HINTS /usr/local/lib /usr/local/lib64 /usr/lib /usr/lib64
)
if (NOT CURL)
message(SEND_ERROR "Did not find curl")
endif()
if (NOT JSONC)
message(SEND_ERROR "Did not find json-c")
endif()
if (NOT CRYPTO)
message(SEND_ERROR "Did not find OpenSSL")
endif()
if (NOT OPENSSL)
message(SEND_ERROR "Did not find OpenSSL")
endif()
endif()
option(PIHELPER_STATIC "Build Pi-Helper as a static library" ON)
option(PIHELPER_SHARED "Build Pi-Helper as a shared library" OFF)
@ -85,7 +89,7 @@ if (PIHELPER_STATIC)
)
install(TARGETS libpihelperstatic
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endif()