From 14e48791546123bbe20f6b6dbf8f15f0e15cf166 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 19 Jan 2015 10:53:17 -0800 Subject: [PATCH] add a BUILD_ANDROID guide, reference ANDROID_LIB_DIR --- BUILD_ANDROID.md | 15 +++++++++++++++ CMakeLists.txt | 8 ++++---- 2 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 BUILD_ANDROID.md diff --git a/BUILD_ANDROID.md b/BUILD_ANDROID.md new file mode 100644 index 0000000000..34950dfbd2 --- /dev/null +++ b/BUILD_ANDROID.md @@ -0,0 +1,15 @@ +Please read the [general build guide](BUILD.md) for information on dependencies required for all platforms. Only Android specific instructions are found in this file. + +###Android Dependencies + +There are no Android specific dependencies to build hifi. However, you will need to compile the dependencies required for all platforms for Android, and help CMake find these compiled libraries on your machine. + +####ANDROID_LIB_DIR +Since you won't be installing Android dependencies to system paths on your development machine, CMake will need a little help tracking down your Android dependencies. + +This is most easily accomplished by installing all Android dependencies in the same folder. You can place this folder wherever you like on your machine. In this build guide and across our CMakeLists files this folder is referred to as ANDROID_LIB_DIR. You can set ANDROID_LIB_DIR in your environment or by passing when you run CMake. + +####Qt +While the current build guide states we are using Qt 5.3.0, the Android build uses 5.4.0. This is because Qt Android support is newer and more likely to be receiving important bug fixes between versions. + +Install Qt 5.4.0 for Android for your host environment from the [Qt downloads page](http://www.qt.io/download/). Install Qt to $ANDROID_LIB_DIR/Qt. This is required so that our root CMakeLists file can help CMake find your Android Qt installation. diff --git a/CMakeLists.txt b/CMakeLists.txt index b7787940ce..2b3cf41af8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,8 +58,8 @@ if (APPLE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --stdlib=libc++") endif () -if (NOT HIFI_ANDROID) - set(HIFI_ANDROID $ENV{HIFI_ANDROID}) +if (NOT ANDROID_LIB_DIR) + set(ANDROID_LIB_DIR $ENV{ANDROID_LIB_DIR}) endif () if (ANDROID) @@ -69,8 +69,8 @@ if (ANDROID) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH) - if (HIFI_ANDROID) - list(APPEND CMAKE_FIND_ROOT_PATH ${HIFI_ANDROID}) + if (ANDROID_LIB_DIR) + list(APPEND CMAKE_FIND_ROOT_PATH ${ANDROID_LIB_DIR}) endif () else () if (NOT QT_CMAKE_PREFIX_PATH)