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