From c4378784ae2caec57634f9f04bcb3dcddc673f36 Mon Sep 17 00:00:00 2001 From: Rick Lei Date: Wed, 14 Jan 2015 22:11:43 +0800 Subject: Add Android 4.1+ support. See doc/README-Android.md for build HOWTO. * Update CMake files to work with android-cmake * Use unix domain socket for communicating with Android GUI * May also run standalone but requires rooted Android device --- cmake/UseDoxygen.cmake | 14 +++++++++++++- cmake/config.cmake | 4 ++-- cmake/deps.cmake | 9 +++++++-- 3 files changed, 22 insertions(+), 5 deletions(-) (limited to 'cmake') diff --git a/cmake/UseDoxygen.cmake b/cmake/UseDoxygen.cmake index ae7c8d7..66978fc 100644 --- a/cmake/UseDoxygen.cmake +++ b/cmake/UseDoxygen.cmake @@ -57,13 +57,25 @@ macro(usedoxygen_set_default name value type docstring) endif() endmacro() -find_package(Doxygen) +if(ANDROID) + find_host_package(Doxygen) +else(ANDROID) + find_package(Doxygen) +endif(ANDROID) if(DOXYGEN_FOUND) + if(ANDROID) + # android-cmake doesn't provide a find_host_file and here's the workaround + set(_save_root_path ${CMAKE_FIND_ROOT_PATH}) + set(CMAKE_FIND_ROOT_PATH) + endif(ANDROID) find_file(DOXYFILE_IN "Doxyfile.in" PATHS "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_ROOT}/Modules/" NO_DEFAULT_PATH DOC "Path to the doxygen configuration template file") + if(ANDROID) + set(CMAKE_FIND_ROOT_PATH $_save_root_path) + endif(ANDROID) set(DOXYFILE "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile") include(FindPackageHandleStandardArgs) find_package_handle_standard_args(DOXYFILE_IN DEFAULT_MSG "DOXYFILE_IN") diff --git a/cmake/config.cmake b/cmake/config.cmake index 8aa6549..e6b70a2 100644 --- a/cmake/config.cmake +++ b/cmake/config.cmake @@ -34,9 +34,9 @@ set(ENABLE_OPENSSL FALSE CACHE BOOL "Enable crypto implementations using OpenSSL set(ENABLE_LTO FALSE CACHE BOOL "Enable link-time optimization") -if(LINUX) +if(LINUX AND NOT ANDROID) set(ENABLE_SYSTEMD TRUE CACHE BOOL "Enable systemd support") -endif(LINUX) +endif(LINUX AND NOT ANDROID) set(WITH_CMDLINE_USER TRUE CACHE BOOL "Include support for setting user/group related options on the command line") set(WITH_CMDLINE_LOGGING TRUE CACHE BOOL "Include support for setting logging related options on the command line") diff --git a/cmake/deps.cmake b/cmake/deps.cmake index 7f48854..0d06bee 100644 --- a/cmake/deps.cmake +++ b/cmake/deps.cmake @@ -4,9 +4,14 @@ if(NOT DARWIN) set(PTHREAD_LDFLAGS -pthread) endif(NOT DARWIN) +if(ANDROID) + find_host_package(BISON 2.5 REQUIRED) + find_host_package(PkgConfig REQUIRED) +else(ANDROID) + find_package(BISON 2.5 REQUIRED) + find_package(PkgConfig REQUIRED) +endif(ANDROID) -find_package(BISON 2.5 REQUIRED) -find_package(PkgConfig REQUIRED) pkg_check_modules(UECC REQUIRED libuecc>=3) -- cgit v1.2.3