From 688480ed4fe51538443c2836ff5a21c9a03827d2 Mon Sep 17 00:00:00 2001
From: Stephen Birarda <commit@birarda.com>
Date: Wed, 28 Jan 2015 13:12:50 -0800
Subject: [PATCH 01/23] clarify Qt and OpenSSL steps in build guide

---
 BUILD_ANDROID.md | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/BUILD_ANDROID.md b/BUILD_ANDROID.md
index 9e3dc3b0be..7211fc69f4 100644
--- a/BUILD_ANDROID.md
+++ b/BUILD_ANDROID.md
@@ -26,13 +26,15 @@ This is most easily accomplished by installing all Android dependencies in the s
 
 ####Qt
 
-Install Qt 5.3 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.
+Install Qt 5.3 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. 
+
+The component required for the Android build is the `Android armv7` component.
 
 If you would like to install Qt to a different location, or attempt to build with a different Qt version, you can pass `ANDROID_QT_CMAKE_PREFIX_PATH` to CMake. Point to the `cmake` folder inside `$VERSION_NUMBER/android_armv7/lib`. Otherwise, our root CMakeLists will set it to `$ANDROID_LIB_DIR/Qt/5.3/android_armv7/lib/cmake`.
 
 ####OpenSSL
 
-Cross-compilation of OpenSSL has only been tested from an OS X machine running 10.10 compiling OpenSSL 1.0.1i. It is likely that the steps below will work for other OpenSSL versions than 1.0.1i.
+Cross-compilation of OpenSSL has been tested from an OS X machine running 10.10 compiling OpenSSL 1.0.2. It is likely that the steps below will work for other OpenSSL versions than 1.0.2.
 
 The original instructions to compile OpenSSL for Android from your host environment can be found [here](http://wiki.openssl.org/index.php/Android). We required some tweaks to get OpenSSL to successfully compile, those tweaks are explained below.
 

From f2caa7e278d6f19079967d8426c22b0944da61b1 Mon Sep 17 00:00:00 2001
From: Stephen Birarda <commit@birarda.com>
Date: Wed, 28 Jan 2015 13:17:40 -0800
Subject: [PATCH 02/23] add change for OpenSSL version

---
 BUILD_ANDROID.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/BUILD_ANDROID.md b/BUILD_ANDROID.md
index 7211fc69f4..75207030de 100644
--- a/BUILD_ANDROID.md
+++ b/BUILD_ANDROID.md
@@ -42,8 +42,8 @@ Download the [OpenSSL source](https://www.openssl.org/source/) and extract the t
 
 You will need the [setenv-android.sh script](http://wiki.openssl.org/index.php/File:Setenv-android.sh) from the OpenSSL wiki. 
 
-You must change two values at the top of the `setenv-android.sh` script - `_ANDROID_NDK` and `_ANDROID_EABI`.
-`_ANDROID_NDK` should be `android-ndk-r10` and `_ANDROID_EABI` should be `arm-linux-androidebi-4.9`.
+You must change three values at the top of the `setenv-android.sh` script - `_ANDROID_NDK`, `_ANDROID_EABI` and `_ANDROID_API`.
+`_ANDROID_NDK` should be `android-ndk-r10`, `_ANDROID_EABI` should be `arm-linux-androidebi-4.9` and `_ANDROID_API` should be `19`.
 
 First, make sure `ANDROID_NDK_ROOT` is set in your env. This should be the path to the root of your Android NDK install. `setenv-android.sh` needs `ANDROID_NDK_ROOT` to set the environment variables required for building OpenSSL.
 

From ddd9851f1777c41a7ccd25a92fdc94194fadbbe7 Mon Sep 17 00:00:00 2001
From: Stephen Birarda <commit@birarda.com>
Date: Wed, 28 Jan 2015 13:19:09 -0800
Subject: [PATCH 03/23] remove the AR step for OpenSSL, not required

---
 BUILD_ANDROID.md | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/BUILD_ANDROID.md b/BUILD_ANDROID.md
index 75207030de..588f148627 100644
--- a/BUILD_ANDROID.md
+++ b/BUILD_ANDROID.md
@@ -49,14 +49,9 @@ First, make sure `ANDROID_NDK_ROOT` is set in your env. This should be the path
 
 Source the `setenv-android.sh` script so it can set environment variables that OpenSSL will use while compiling. If you use zsh as your shell you may need to modify the `setenv-android.sh` for it to set the correct variables in your env.
 
-We have had issues with `setenv-android.sh` not helping the system use the Android archive tool during compilation. You may also need to set `AR` to point to the `ar` from your NDK AFTER running ./setenv-android.sh. 
-
-Note that your path to `arm-linux-androideabi-ar` will probably not be the same as the one below if you are not on OS X or are using a different EABI.
-
 ```
 export ANDROID_NDK_ROOT=YOUR_NDK_ROOT
 source setenv-android.sh
-export AR=$ANDROID_NDK_ROOT/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ar
 ```
 
 Then, from the OpenSSL directory, run the following commands.

From 6ba7bd817ca9107f2632ca4a48da744d52a24c6b Mon Sep 17 00:00:00 2001
From: Stephen Birarda <commit@birarda.com>
Date: Wed, 28 Jan 2015 13:26:20 -0800
Subject: [PATCH 04/23] use code style for ndk-build for libovr

---
 BUILD_ANDROID.md | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/BUILD_ANDROID.md b/BUILD_ANDROID.md
index 588f148627..64f093e772 100644
--- a/BUILD_ANDROID.md
+++ b/BUILD_ANDROID.md
@@ -105,7 +105,14 @@ The Oculus Mobile SDK is optional, for Gear VR support. It is not required to co
 
 Download the [Oculus Mobile SDK](https://developer.oculus.com/downloads/#sdk=mobile) and extract the archive inside your `ANDROID_LIB_DIR` folder. Rename the extracted folder to `libovr`.
 
-From the VrLib directory, use ndk-build to build VrLib. This will create the liboculus.a archive that our FindLibOVR module will look for when cmake is run.
+From the VrLib directory, use ndk-build to build VrLib. 
+
+```
+cd VrLib
+ndk-build
+```
+
+This will create the liboculus.a archive that our FindLibOVR module will look for when cmake is run.
 
 #####Hybrid testing
 

From 418551ddc5dd32ef4bcc80ee82741aaf3d4f694e Mon Sep 17 00:00:00 2001
From: Stephen Birarda <commit@birarda.com>
Date: Wed, 28 Jan 2015 13:31:39 -0800
Subject: [PATCH 05/23] clarify that ANDROID_NDK must be set for soxr

---
 BUILD_ANDROID.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BUILD_ANDROID.md b/BUILD_ANDROID.md
index 64f093e772..767d3d6d03 100644
--- a/BUILD_ANDROID.md
+++ b/BUILD_ANDROID.md
@@ -87,7 +87,7 @@ cp `find . -name "*.so"` lib/
 
 Download the [Soxr source](http://sourceforge.net/projects/soxr/) and extract the tarball inside your `ANDROID_LIB_DIR`. Rename the extracted folder to `soxr`.
 
-From the soxr directory, use cmake, along with the `android.toolchain.cmake` file (included in this repository under cmake/android) to cross-compile soxr for Android.
+From the soxr directory, use cmake, along with the `android.toolchain.cmake` file (included in this repository under cmake/android) to cross-compile soxr for Android. Note that you will need ANDROID_NDK set in your environment before using the toolchain file.
 
 The full set of commands to build soxr for Android is shown below
 

From f58462845a41cd46bfad671a6a3dbf2aa5a4ba05 Mon Sep 17 00:00:00 2001
From: Stephen Birarda <commit@birarda.com>
Date: Wed, 28 Jan 2015 13:36:20 -0800
Subject: [PATCH 06/23] make sure CMAKE_INSTALL_PREFIX is visible in soxr
 command

---
 BUILD_ANDROID.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BUILD_ANDROID.md b/BUILD_ANDROID.md
index 767d3d6d03..c4c4c27dd7 100644
--- a/BUILD_ANDROID.md
+++ b/BUILD_ANDROID.md
@@ -92,7 +92,7 @@ From the soxr directory, use cmake, along with the `android.toolchain.cmake` fil
 The full set of commands to build soxr for Android is shown below
 
 ```
-cmake -DCMAKE_TOOLCHAIN_FILE=$FULL_PATH_TO_TOOLCHAIN -DHAVE_WORDS_BIGENDIAN_EXITCODE=1 -DBUILD_TESTS=0 -DCMAKE_INSTALL_PREFIX=.
+cmake -DCMAKE_TOOLCHAIN_FILE=$FULL_PATH_TO_TOOLCHAIN -DCMAKE_INSTALL_PREFIX=. -DHAVE_WORDS_BIGENDIAN_EXITCODE=1 -DBUILD_TESTS=0
 make
 make install
 ```

From 2b0796eb7dececa2e8d236a4a4d4e723c75cb4eb Mon Sep 17 00:00:00 2001
From: Stephen Birarda <commit@birarda.com>
Date: Wed, 28 Jan 2015 13:40:47 -0800
Subject: [PATCH 07/23] simplify cmake call for android build

---
 BUILD_ANDROID.md | 3 +--
 CMakeLists.txt   | 5 +++++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/BUILD_ANDROID.md b/BUILD_ANDROID.md
index c4c4c27dd7..928f5dca36 100644
--- a/BUILD_ANDROID.md
+++ b/BUILD_ANDROID.md
@@ -138,5 +138,4 @@ The following must be set in your environment:
 
 The following must be passed to CMake when it is run:
 
-* CMAKE_TOOLCHAIN_FILE - full path to the android.toolchain.cmake file that is included in this repository (/cmake/android/android.toolchain.cmake)
-* ANDROID_NATIVE_API_LEVEL - the API level you want to use (this should be 19 for GearVR)
+* USE_ANDROID_TOOLCHAIN - set to true to build for Android
\ No newline at end of file
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 037f91c565..6544b11114 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,10 @@
 cmake_minimum_required(VERSION 2.8.12.2)
 
+if (USE_ANDROID_TOOLCHAIN)
+  set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/android/android.toolchain.cmake")
+  set(ANDROID_NATIVE_API_LEVEL 19)
+endif ()
+
 if (WIN32)
   cmake_policy(SET CMP0020 NEW)
 endif (WIN32)

From ce1e96e0347dd88873860d8e3ba6a04987663836 Mon Sep 17 00:00:00 2001
From: Stephen Birarda <commit@birarda.com>
Date: Wed, 28 Jan 2015 13:48:28 -0800
Subject: [PATCH 08/23] fix version find for 1.0.2 in OpenSSL

---
 cmake/modules/FindOpenSSL.cmake | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cmake/modules/FindOpenSSL.cmake b/cmake/modules/FindOpenSSL.cmake
index 6fb1c82efb..8298cc75b4 100644
--- a/cmake/modules/FindOpenSSL.cmake
+++ b/cmake/modules/FindOpenSSL.cmake
@@ -183,8 +183,8 @@ endfunction()
 if (OPENSSL_INCLUDE_DIR)
   if(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h")
     file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str
-         REGEX "^#define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*")
-
+         REGEX "^#[ ]?define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*")
+    
     # The version number is encoded as 0xMNNFFPPS: major minor fix patch status
     # The status gives if this is a developer or prerelease and is ignored here.
     # Major, minor, and fix directly translate into the version numbers shown in

From f75031c68810d42538fe345eafae0f1a7ba806d5 Mon Sep 17 00:00:00 2001
From: Stephen Birarda <commit@birarda.com>
Date: Wed, 28 Jan 2015 13:51:14 -0800
Subject: [PATCH 09/23] capitalize VRLib in libovr instructions

---
 BUILD_ANDROID.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/BUILD_ANDROID.md b/BUILD_ANDROID.md
index 928f5dca36..476563c954 100644
--- a/BUILD_ANDROID.md
+++ b/BUILD_ANDROID.md
@@ -105,10 +105,10 @@ The Oculus Mobile SDK is optional, for Gear VR support. It is not required to co
 
 Download the [Oculus Mobile SDK](https://developer.oculus.com/downloads/#sdk=mobile) and extract the archive inside your `ANDROID_LIB_DIR` folder. Rename the extracted folder to `libovr`.
 
-From the VrLib directory, use ndk-build to build VrLib. 
+From the VRLib directory, use ndk-build to build VrLib. 
 
 ```
-cd VrLib
+cd VRLib
 ndk-build
 ```
 

From 95f8347eada47158b4bb1e71c5977eb7bede608d Mon Sep 17 00:00:00 2001
From: Stephen Birarda <commit@birarda.com>
Date: Wed, 28 Jan 2015 13:59:57 -0800
Subject: [PATCH 10/23] add ant to requirements for android

---
 BUILD_ANDROID.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/BUILD_ANDROID.md b/BUILD_ANDROID.md
index 476563c954..b27e4a7593 100644
--- a/BUILD_ANDROID.md
+++ b/BUILD_ANDROID.md
@@ -4,6 +4,7 @@ Please read the [general build guide](BUILD.md) for information on dependencies
 
 You will need the following tools to build our Android targets.
 
+* [ant](http://ant.apache.org/bindownload.cgi) ~> 1.9.4
 * [Android NDK](https://developer.android.com/tools/sdk/ndk/index.html) = r10c
 * [Android SDK](http://developer.android.com/sdk/installing/index.html) ~> 24.0.2
   * Install the latest Platform-tools

From a9eaaaaac7e944ee73187bb9f2f27cb747798eab Mon Sep 17 00:00:00 2001
From: Stephen Birarda <commit@birarda.com>
Date: Wed, 28 Jan 2015 14:26:56 -0800
Subject: [PATCH 11/23] request static lib build of libsoxr

---
 BUILD_ANDROID.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/BUILD_ANDROID.md b/BUILD_ANDROID.md
index b27e4a7593..c1e0477f87 100644
--- a/BUILD_ANDROID.md
+++ b/BUILD_ANDROID.md
@@ -90,10 +90,10 @@ Download the [Soxr source](http://sourceforge.net/projects/soxr/) and extract th
 
 From the soxr directory, use cmake, along with the `android.toolchain.cmake` file (included in this repository under cmake/android) to cross-compile soxr for Android. Note that you will need ANDROID_NDK set in your environment before using the toolchain file.
 
-The full set of commands to build soxr for Android is shown below
+The full set of commands to build soxr for Android is shown below. It is a long command, make sure you copy the entire command (up to `-DBUILD_TESTS=0`).
 
 ```
-cmake -DCMAKE_TOOLCHAIN_FILE=$FULL_PATH_TO_TOOLCHAIN -DCMAKE_INSTALL_PREFIX=. -DHAVE_WORDS_BIGENDIAN_EXITCODE=1 -DBUILD_TESTS=0
+cmake -DCMAKE_TOOLCHAIN_FILE=$FULL_PATH_TO_TOOLCHAIN -DCMAKE_INSTALL_PREFIX=. -D-DBUILD_SHARED_LIBS=OFF -DHAVE_WORDS_BIGENDIAN_EXITCODE=1 -DBUILD_TESTS=0
 make
 make install
 ```

From bfc82524f76778367de6e4d77701d2a4d91d95e9 Mon Sep 17 00:00:00 2001
From: Stephen Birarda <commit@birarda.com>
Date: Wed, 28 Jan 2015 14:28:31 -0800
Subject: [PATCH 12/23] remove an extra D in cmake flag

---
 BUILD_ANDROID.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BUILD_ANDROID.md b/BUILD_ANDROID.md
index c1e0477f87..2bc8159914 100644
--- a/BUILD_ANDROID.md
+++ b/BUILD_ANDROID.md
@@ -93,7 +93,7 @@ From the soxr directory, use cmake, along with the `android.toolchain.cmake` fil
 The full set of commands to build soxr for Android is shown below. It is a long command, make sure you copy the entire command (up to `-DBUILD_TESTS=0`).
 
 ```
-cmake -DCMAKE_TOOLCHAIN_FILE=$FULL_PATH_TO_TOOLCHAIN -DCMAKE_INSTALL_PREFIX=. -D-DBUILD_SHARED_LIBS=OFF -DHAVE_WORDS_BIGENDIAN_EXITCODE=1 -DBUILD_TESTS=0
+cmake -DCMAKE_TOOLCHAIN_FILE=$FULL_PATH_TO_TOOLCHAIN -DCMAKE_INSTALL_PREFIX=. -DBUILD_SHARED_LIBS=OFF -DHAVE_WORDS_BIGENDIAN_EXITCODE=1 -DBUILD_TESTS=0
 make
 make install
 ```

From c06ba0307ecba727a664e948fb936ad397c7033f Mon Sep 17 00:00:00 2001
From: Stephen Birarda <commit@birarda.com>
Date: Wed, 28 Jan 2015 14:46:01 -0800
Subject: [PATCH 13/23] make sure we grab openmp for soxr on Android

---
 cmake/modules/FindSoxr.cmake | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/cmake/modules/FindSoxr.cmake b/cmake/modules/FindSoxr.cmake
index 088514e12d..ab5ba83796 100644
--- a/cmake/modules/FindSoxr.cmake
+++ b/cmake/modules/FindSoxr.cmake
@@ -22,9 +22,20 @@ include("${MACRO_DIR}/HifiLibrarySearchHints.cmake")
 hifi_library_search_hints("soxr")
 
 find_path(SOXR_INCLUDE_DIRS soxr.h PATH_SUFFIXES include HINTS ${SOXR_SEARCH_DIRS})
-find_library(SOXR_LIBRARIES NAMES soxr PATH_SUFFIXES lib HINTS ${SOXR_SEARCH_DIRS})
+
+if (ANDROID)
+  set(SOXR_NAMES "libsoxr.a")
+elseif ()
+  set(SOXR_NAMES "soxr")
+endif ()
+
+find_library(SOXR_LIBRARIES NAMES ${SOXR_NAMES} PATH_SUFFIXES lib HINTS ${SOXR_SEARCH_DIRS})
 
 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(soxr DEFAULT_MSG SOXR_INCLUDE_DIRS SOXR_LIBRARIES)
+find_package_handle_standard_args(SOXR DEFAULT_MSG SOXR_INCLUDE_DIRS SOXR_LIBRARIES)
+
+if (ANDROID)
+  set(SOXR_LIBRARIES ${SOXR_LIBRARIES} "-fopenmp")
+endif ()
 
 mark_as_advanced(SOXR_INCLUDE_DIRS SOXR_LIBRARIES SOXR_SEARCH_DIRS)
\ No newline at end of file

From ad0ae76b005897e5fa6bec732d1e60d871023af5 Mon Sep 17 00:00:00 2001
From: Stephen Birarda <commit@birarda.com>
Date: Wed, 28 Jan 2015 14:59:23 -0800
Subject: [PATCH 14/23] use shared soxr to avoid openmp link

---
 BUILD_ANDROID.md             |  2 +-
 cmake/modules/FindSoxr.cmake | 13 +------------
 2 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/BUILD_ANDROID.md b/BUILD_ANDROID.md
index 2bc8159914..ad4110b82a 100644
--- a/BUILD_ANDROID.md
+++ b/BUILD_ANDROID.md
@@ -93,7 +93,7 @@ From the soxr directory, use cmake, along with the `android.toolchain.cmake` fil
 The full set of commands to build soxr for Android is shown below. It is a long command, make sure you copy the entire command (up to `-DBUILD_TESTS=0`).
 
 ```
-cmake -DCMAKE_TOOLCHAIN_FILE=$FULL_PATH_TO_TOOLCHAIN -DCMAKE_INSTALL_PREFIX=. -DBUILD_SHARED_LIBS=OFF -DHAVE_WORDS_BIGENDIAN_EXITCODE=1 -DBUILD_TESTS=0
+cmake -DCMAKE_TOOLCHAIN_FILE=$FULL_PATH_TO_TOOLCHAIN -DCMAKE_INSTALL_PREFIX=. -DHAVE_WORDS_BIGENDIAN_EXITCODE=1 -DBUILD_TESTS=0
 make
 make install
 ```
diff --git a/cmake/modules/FindSoxr.cmake b/cmake/modules/FindSoxr.cmake
index ab5ba83796..367022e9ec 100644
--- a/cmake/modules/FindSoxr.cmake
+++ b/cmake/modules/FindSoxr.cmake
@@ -22,20 +22,9 @@ include("${MACRO_DIR}/HifiLibrarySearchHints.cmake")
 hifi_library_search_hints("soxr")
 
 find_path(SOXR_INCLUDE_DIRS soxr.h PATH_SUFFIXES include HINTS ${SOXR_SEARCH_DIRS})
-
-if (ANDROID)
-  set(SOXR_NAMES "libsoxr.a")
-elseif ()
-  set(SOXR_NAMES "soxr")
-endif ()
-
-find_library(SOXR_LIBRARIES NAMES ${SOXR_NAMES} PATH_SUFFIXES lib HINTS ${SOXR_SEARCH_DIRS})
+find_library(SOXR_LIBRARIES NAMES soxr PATH_SUFFIXES lib HINTS ${SOXR_SEARCH_DIRS})
 
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(SOXR DEFAULT_MSG SOXR_INCLUDE_DIRS SOXR_LIBRARIES)
 
-if (ANDROID)
-  set(SOXR_LIBRARIES ${SOXR_LIBRARIES} "-fopenmp")
-endif ()
-
 mark_as_advanced(SOXR_INCLUDE_DIRS SOXR_LIBRARIES SOXR_SEARCH_DIRS)
\ No newline at end of file

From 441bb99d7c10f8ce3dccb8723928b96712f2ea1d Mon Sep 17 00:00:00 2001
From: Stephen Birarda <commit@birarda.com>
Date: Wed, 28 Jan 2015 15:02:36 -0800
Subject: [PATCH 15/23] add min requirement for cmake for android

---
 BUILD_ANDROID.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/BUILD_ANDROID.md b/BUILD_ANDROID.md
index ad4110b82a..b5598fff5e 100644
--- a/BUILD_ANDROID.md
+++ b/BUILD_ANDROID.md
@@ -4,6 +4,8 @@ Please read the [general build guide](BUILD.md) for information on dependencies
 
 You will need the following tools to build our Android targets.
 
+* [cmake](http://www.cmake.org/download/) ~> 3.1.0
+  * Note that this is a newer version required than the minimum for hifi Desktop targets.
 * [ant](http://ant.apache.org/bindownload.cgi) ~> 1.9.4
 * [Android NDK](https://developer.android.com/tools/sdk/ndk/index.html) = r10c
 * [Android SDK](http://developer.android.com/sdk/installing/index.html) ~> 24.0.2

From 6e7dc0a44c21040a3b200475c47c595a98d20e4d Mon Sep 17 00:00:00 2001
From: Stephen Birarda <commit@birarda.com>
Date: Wed, 28 Jan 2015 15:03:01 -0800
Subject: [PATCH 16/23] remove an unecessary capitalization

---
 BUILD_ANDROID.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BUILD_ANDROID.md b/BUILD_ANDROID.md
index b5598fff5e..af28046412 100644
--- a/BUILD_ANDROID.md
+++ b/BUILD_ANDROID.md
@@ -5,7 +5,7 @@ Please read the [general build guide](BUILD.md) for information on dependencies
 You will need the following tools to build our Android targets.
 
 * [cmake](http://www.cmake.org/download/) ~> 3.1.0
-  * Note that this is a newer version required than the minimum for hifi Desktop targets.
+  * Note that this is a newer version required than the minimum for hifi desktop targets.
 * [ant](http://ant.apache.org/bindownload.cgi) ~> 1.9.4
 * [Android NDK](https://developer.android.com/tools/sdk/ndk/index.html) = r10c
 * [Android SDK](http://developer.android.com/sdk/installing/index.html) ~> 24.0.2

From 3dd0b85ca4feacc972d099f90ab71f242ca4cd0f Mon Sep 17 00:00:00 2001
From: Stephen Birarda <commit@birarda.com>
Date: Wed, 28 Jan 2015 15:26:03 -0800
Subject: [PATCH 17/23] use a QOpenGLWidget subclass for InterfaceView

---
 BUILD_ANDROID.md                    |  4 +++-
 CMakeLists.txt                      |  2 +-
 gvr-interface/src/GVRInterface.cpp  | 13 -------------
 gvr-interface/src/GVRMainWindow.cpp |  4 ++++
 gvr-interface/src/InterfaceView.cpp | 20 ++++++++++++++++++++
 gvr-interface/src/InterfaceView.h   | 23 +++++++++++++++++++++++
 6 files changed, 51 insertions(+), 15 deletions(-)
 create mode 100644 gvr-interface/src/InterfaceView.cpp
 create mode 100644 gvr-interface/src/InterfaceView.h

diff --git a/BUILD_ANDROID.md b/BUILD_ANDROID.md
index af28046412..42a54f45d4 100644
--- a/BUILD_ANDROID.md
+++ b/BUILD_ANDROID.md
@@ -6,6 +6,8 @@ You will need the following tools to build our Android targets.
 
 * [cmake](http://www.cmake.org/download/) ~> 3.1.0
   * Note that this is a newer version required than the minimum for hifi desktop targets.
+* [Qt](http://www.qt.io/download-open-source/#) ~> 5.4.0
+  * Note that this is a newer version required than the minimum for hifi desktop targets.
 * [ant](http://ant.apache.org/bindownload.cgi) ~> 1.9.4
 * [Android NDK](https://developer.android.com/tools/sdk/ndk/index.html) = r10c
 * [Android SDK](http://developer.android.com/sdk/installing/index.html) ~> 24.0.2
@@ -29,7 +31,7 @@ This is most easily accomplished by installing all Android dependencies in the s
 
 ####Qt
 
-Install Qt 5.3 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. 
+Install Qt 5.4 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. 
 
 The component required for the Android build is the `Android armv7` component.
 
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6544b11114..e008cecd2c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -69,7 +69,7 @@ endif ()
 
 if (ANDROID)  
   if (NOT ANDROID_QT_CMAKE_PREFIX_PATH)
-    set(QT_CMAKE_PREFIX_PATH ${ANDROID_LIB_DIR}/Qt/5.3/android_armv7/lib/cmake)
+    set(QT_CMAKE_PREFIX_PATH ${ANDROID_LIB_DIR}/Qt/5.4/android_armv7/lib/cmake)
   else ()
     set(QT_CMAKE_PREFIX_PATH ${ANDROID_QT_CMAKE_PREFIX_PATH})
   endif ()
diff --git a/gvr-interface/src/GVRInterface.cpp b/gvr-interface/src/GVRInterface.cpp
index 31ae20a0d3..ebedae1073 100644
--- a/gvr-interface/src/GVRInterface.cpp
+++ b/gvr-interface/src/GVRInterface.cpp
@@ -51,19 +51,6 @@ GVRInterface::GVRInterface(int argc, char* argv[]) :
     QTimer* idleTimer = new QTimer(this);
     connect(idleTimer, &QTimer::timeout, this, &GVRInterface::idle);
     idleTimer->start(0);
-    
-    // // setup our EGL context
-  //   const int windowDepth = 0;
-  //   const int windowSamples = 0;
-  //   const GLuint contextPriority = EGL_CONTEXT_PRIORITY_MEDIUM_IMG;
-  //   OVR::eglSetup_t egl = OVR::EglSetup(EGL_NO_CONTEXT, GL_ES_VERSION,
-  //       8, 8, 8, windowDepth, windowSamples, contextPriority);
-  //
-  //   if (egl.context == EGL_NO_CONTEXT) {
-  //       qDebug() << "WE HAD SOME DIFFICULTIES SETTING UP EGL!";
-  //   } else {
-  //       qDebug() << "EGL is good to go.";
-  //   }
 }
 
 void GVRInterface::idle() {
diff --git a/gvr-interface/src/GVRMainWindow.cpp b/gvr-interface/src/GVRMainWindow.cpp
index 04b29ad984..4ef55785f6 100644
--- a/gvr-interface/src/GVRMainWindow.cpp
+++ b/gvr-interface/src/GVRMainWindow.cpp
@@ -16,6 +16,7 @@
 
 #include <AddressManager.h>
 
+#include "InterfaceView.h"
 #include "RenderingClient.h"
 
 #include "GVRMainWindow.h"
@@ -48,6 +49,9 @@ GVRMainWindow::GVRMainWindow(QWidget* parent) :
     baseWidget->setLayout(_mainLayout);
     
     setCentralWidget(baseWidget);
+    
+    // add the interface view
+    InterfaceView* interfaceView = new InterfaceView(baseWidget);
 }
 
 void GVRMainWindow::showAddressBar() {
diff --git a/gvr-interface/src/InterfaceView.cpp b/gvr-interface/src/InterfaceView.cpp
new file mode 100644
index 0000000000..9f0645ccf9
--- /dev/null
+++ b/gvr-interface/src/InterfaceView.cpp
@@ -0,0 +1,20 @@
+//
+//  InterfaceView.cpp
+//  gvr-interface/src
+//
+//  Created by Stephen Birarda on 1/28/14.
+//  Copyright 2013 High Fidelity, Inc.
+//
+//  Distributed under the Apache License, Version 2.0.
+//  See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
+//
+
+#include <QtCore/QDebug>
+
+#include "InterfaceView.h"
+
+InterfaceView::InterfaceView(QWidget* parent,  Qt::WindowFlags flags) :
+    QOpenGLWidget(parent, flags)
+{
+    qDebug() << "The interface view is alive!";
+}
\ No newline at end of file
diff --git a/gvr-interface/src/InterfaceView.h b/gvr-interface/src/InterfaceView.h
new file mode 100644
index 0000000000..b1e1fae1d0
--- /dev/null
+++ b/gvr-interface/src/InterfaceView.h
@@ -0,0 +1,23 @@
+//
+//  InterfaceView.h
+//  gvr-interface/src
+//
+//  Created by Stephen Birarda on 1/28/14.
+//  Copyright 2013 High Fidelity, Inc.
+//
+//  Distributed under the Apache License, Version 2.0.
+//  See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
+//
+
+#ifndef hifi_InterfaceView_h
+#define hifi_InterfaceView_h
+
+#include <QtWidgets/QOpenGLWidget>
+
+class InterfaceView : public QOpenGLWidget {
+    Q_OBJECT
+public:
+    InterfaceView(QWidget* parent = 0,  Qt::WindowFlags flags = 0);
+};
+
+#endif // hifi_InterfaceView_h

From 8c1007f13155e0839c80264a6811a693add60d45 Mon Sep 17 00:00:00 2001
From: Stephen Birarda <commit@birarda.com>
Date: Wed, 28 Jan 2015 15:26:51 -0800
Subject: [PATCH 18/23] remove extra debug line in InterfaceView

---
 gvr-interface/src/InterfaceView.cpp | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/gvr-interface/src/InterfaceView.cpp b/gvr-interface/src/InterfaceView.cpp
index 9f0645ccf9..e7992d3921 100644
--- a/gvr-interface/src/InterfaceView.cpp
+++ b/gvr-interface/src/InterfaceView.cpp
@@ -9,12 +9,10 @@
 //  See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
 //
 
-#include <QtCore/QDebug>
-
 #include "InterfaceView.h"
 
 InterfaceView::InterfaceView(QWidget* parent,  Qt::WindowFlags flags) :
     QOpenGLWidget(parent, flags)
 {
-    qDebug() << "The interface view is alive!";
+    
 }
\ No newline at end of file

From d13e3c20c8dfdb611e50021d2fc50668f1bd3098 Mon Sep 17 00:00:00 2001
From: Stephen Birarda <commit@birarda.com>
Date: Wed, 28 Jan 2015 15:32:59 -0800
Subject: [PATCH 19/23] force GLM to not be found in path

---
 CMakeLists.txt              | 2 +-
 cmake/modules/FindGLM.cmake | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e008cecd2c..2df532229f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -74,7 +74,7 @@ if (ANDROID)
     set(QT_CMAKE_PREFIX_PATH ${ANDROID_QT_CMAKE_PREFIX_PATH})
   endif ()
   
-  set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
+  set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
   set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
   
   if (ANDROID_LIB_DIR)
diff --git a/cmake/modules/FindGLM.cmake b/cmake/modules/FindGLM.cmake
index 1c903f98d8..a75730b238 100644
--- a/cmake/modules/FindGLM.cmake
+++ b/cmake/modules/FindGLM.cmake
@@ -18,7 +18,7 @@ include("${MACRO_DIR}/HifiLibrarySearchHints.cmake")
 hifi_library_search_hints("glm")
 
 # locate header
-find_path(GLM_INCLUDE_DIR "glm/glm.hpp" HINTS ${GLM_SEARCH_DIRS} NO_CMAKE_FIND_ROOT_PATH)
+find_path(GLM_INCLUDE_DIR "glm/glm.hpp" HINTS ${GLM_SEARCH_DIRS})
 
 set(GLM_INCLUDE_DIRS "${GLM_INCLUDE_DIR}")
 

From 8460557135057c7157459060c8d67ddaf31adf8b Mon Sep 17 00:00:00 2001
From: Stephen Birarda <commit@birarda.com>
Date: Wed, 28 Jan 2015 16:04:17 -0800
Subject: [PATCH 20/23] clarify requirement to seperately download GLM

---
 BUILD_ANDROID.md | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/BUILD_ANDROID.md b/BUILD_ANDROID.md
index 42a54f45d4..719aa8cfd9 100644
--- a/BUILD_ANDROID.md
+++ b/BUILD_ANDROID.md
@@ -129,7 +129,9 @@ Once the application is on your device, go to `Settings->Application Manager->Ge
 
 ####GLM
 
-Since GLM is a header only library, assuming it is installed at a system path or a path where our FindGLM module will find it you do not need to do anything specific for the Android build.
+GLM is a header only library and technically the same GLM used for desktop builds of hifi could be used for the Android build. However, to avoid conflicts with system installations of Android dependencies, CMake will only look for Android headers and libraries in `ANDROID_LIB_DIR` or in your android-ndk install. 
+
+Download the [glm headers](http://sourceforge.net/projects/ogl-math/files/) from their sourceforge page. The version you download should match the requirement shown in the [general build guide](BUILD.md). Extract the archive into your `ANDROID_LIB_DIR` and rename the extracted folder to `glm`.
 
 ###CMake
 

From 1dd74c98312be605e517022f49e5c3904dcd3718 Mon Sep 17 00:00:00 2001
From: Stephen Birarda <commit@birarda.com>
Date: Wed, 28 Jan 2015 16:57:16 -0800
Subject: [PATCH 21/23] allow gvr-interface target to be compiled for desktop

---
 CMakeLists.txt                     |  6 +--
 gvr-interface/CMakeLists.txt       | 62 ++++++++++++++++++------------
 gvr-interface/src/GVRInterface.cpp |  4 +-
 3 files changed, 43 insertions(+), 29 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2df532229f..39d40350d7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -123,6 +123,6 @@ if (NOT ANDROID)
   add_subdirectory(interface)
   add_subdirectory(tests)
   add_subdirectory(tools)
-else ()
-  add_subdirectory(gvr-interface)
-endif()
\ No newline at end of file
+endif()
+
+add_subdirectory(gvr-interface)
\ No newline at end of file
diff --git a/gvr-interface/CMakeLists.txt b/gvr-interface/CMakeLists.txt
index f360e3416e..52c88a5c8b 100644
--- a/gvr-interface/CMakeLists.txt
+++ b/gvr-interface/CMakeLists.txt
@@ -1,12 +1,10 @@
 set(TARGET_NAME gvr-interface)
 
-set(ANDROID_APK_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/apk-build")
-set(ANDROID_APK_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/apk")
-
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${ANDROID_APK_OUTPUT_DIR}/libs/${ANDROID_ABI}")
-set(BUILD_SHARED_LIBS ON)
-
-setup_hifi_library(Gui Widgets AndroidExtras)
+if (ANDROID)
+  setup_hifi_library(Gui Widgets AndroidExtras)
+else ()
+  setup_hifi_project(Gui Widgets)
+endif ()
 
 include_directories(${Qt5Gui_PRIVATE_INCLUDE_DIRS})
 
@@ -15,30 +13,42 @@ include_glm()
 link_hifi_libraries(shared networking audio-client)
 include_dependency_includes()
 
-set(ANDROID_SDK_ROOT $ENV{ANDROID_HOME})
-set(ANDROID_APP_DISPLAY_NAME Interface)
-set(ANDROID_API_LEVEL 19)
-set(ANDROID_APK_PACKAGE io.highfidelity.gvrinterface)
-set(ANDROID_ACTIVITY_NAME io.highfidelity.gvrinterface.InterfaceActivity)
-set(ANDROID_APK_VERSION_NAME "0.1")
-set(ANDROID_APK_VERSION_CODE 1)
-set(ANDROID_DEPLOY_QT_INSTALL "--install")
+if (ANDROID)
+
+  set(ANDROID_APK_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/apk-build")
+  set(ANDROID_APK_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/apk")
+
+  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${ANDROID_APK_OUTPUT_DIR}/libs/${ANDROID_ABI}")
+  set(BUILD_SHARED_LIBS ON)
+  
+  set(ANDROID_SDK_ROOT $ENV{ANDROID_HOME})
+  set(ANDROID_APP_DISPLAY_NAME Interface)
+  set(ANDROID_API_LEVEL 19)
+  set(ANDROID_APK_PACKAGE io.highfidelity.gvrinterface)
+  set(ANDROID_ACTIVITY_NAME io.highfidelity.gvrinterface.InterfaceActivity)
+  set(ANDROID_APK_VERSION_NAME "0.1")
+  set(ANDROID_APK_VERSION_CODE 1)
+  set(ANDROID_DEPLOY_QT_INSTALL "--install")
+
+endif ()
 
 find_package(LibOVR)
 if (LIBOVR_FOUND)
   add_definitions(-DHAVE_LIBOVR)
   target_link_libraries(${TARGET_NAME} ${LIBOVR_LIBRARIES} ${LIBOVR_ANDROID_LIBRARIES})
   include_directories(SYSTEM ${LIBOVR_INCLUDE_DIRS})
-
-  # we need VRLib, so add a project.properties to our apk build folder that says that
-  file(RELATIVE_PATH RELATIVE_VRLIB_PATH ${ANDROID_APK_OUTPUT_DIR} "${LIBOVR_VRLIB_DIR}")
-  file(WRITE "${ANDROID_APK_BUILD_DIR}/project.properties" "android.library.reference.1=${RELATIVE_VRLIB_PATH}")
   
-  list(APPEND IGNORE_COPY_LIBS ${LIBOVR_ANDROID_LIBRARIES})
+  if (ANDROID)
+    # we need VRLib, so add a project.properties to our apk build folder that says that
+    file(RELATIVE_PATH RELATIVE_VRLIB_PATH ${ANDROID_APK_OUTPUT_DIR} "${LIBOVR_VRLIB_DIR}")
+    file(WRITE "${ANDROID_APK_BUILD_DIR}/project.properties" "android.library.reference.1=${RELATIVE_VRLIB_PATH}")
+  
+    list(APPEND IGNORE_COPY_LIBS ${LIBOVR_ANDROID_LIBRARIES})
+  endif (ANDROID)
 endif ()
 
 # the presence of a HOCKEY_APP_ID means we are making a beta build
-if (HOCKEY_APP_ID)
+if (ANDROID AND HOCKEY_APP_ID)
   set(HOCKEY_APP_ENABLED true)
   set(HOCKEY_APP_ACTIVITY "<activity android:name='net.hockeyapp.android.UpdateActivity' />")
   set(ANDROID_ACTIVITY_NAME io.highfidelity.gvrinterface.InterfaceBetaActivity)
@@ -56,10 +66,14 @@ if (HOCKEY_APP_ID)
   set(ANDROID_APK_VERSION_CODE ${GIT_COMMIT_COUNT})
   
   configure_file("${CMAKE_CURRENT_SOURCE_DIR}/templates/InterfaceBetaActivity.java.in" "${ANDROID_APK_BUILD_DIR}/src/io/highfidelity/gvrinterface/InterfaceBetaActivity.java")
-else ()
+elseif (ANDROID)
   set(HOCKEY_APP_ENABLED false)
 endif ()
 
-configure_file("${CMAKE_CURRENT_SOURCE_DIR}/templates/hockeyapp.xml.in" "${ANDROID_APK_BUILD_DIR}/res/values/hockeyapp.xml")
+if (ANDROID)
 
-qt_create_apk()
\ No newline at end of file
+  configure_file("${CMAKE_CURRENT_SOURCE_DIR}/templates/hockeyapp.xml.in" "${ANDROID_APK_BUILD_DIR}/res/values/hockeyapp.xml")
+
+  qt_create_apk()
+  
+endif (ANDROID)
\ No newline at end of file
diff --git a/gvr-interface/src/GVRInterface.cpp b/gvr-interface/src/GVRInterface.cpp
index ebedae1073..ef5a05099d 100644
--- a/gvr-interface/src/GVRInterface.cpp
+++ b/gvr-interface/src/GVRInterface.cpp
@@ -37,7 +37,7 @@ GVRInterface::GVRInterface(int argc, char* argv[]) :
     
     connect(this, &QGuiApplication::applicationStateChanged, this, &GVRInterface::handleApplicationStateChange);
 
-#ifdef HAVE_LIBOVR
+#ifdef Q_OS_ANDROID && HAVE_LIBOVR
     QAndroidJniEnvironment jniEnv;
     
     QPlatformNativeInterface* interface = QApplication::platformNativeInterface();
@@ -54,7 +54,7 @@ GVRInterface::GVRInterface(int argc, char* argv[]) :
 }
 
 void GVRInterface::idle() {
-#ifdef HAVE_LIBOVR
+#ifdef Q_OS_ANDROID && HAVE_LIBOVR
     if (!_inVRMode && ovr_IsHeadsetDocked()) {
         qDebug() << "The headset just got docked - assume we are in VR mode.";
         _inVRMode = true;

From c6b7353a171f33312a5a3ceeed65d42a01a05f34 Mon Sep 17 00:00:00 2001
From: Stephen Birarda <commit@birarda.com>
Date: Wed, 28 Jan 2015 16:57:30 -0800
Subject: [PATCH 22/23] remove an extra space

---
 gvr-interface/src/InterfaceView.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gvr-interface/src/InterfaceView.h b/gvr-interface/src/InterfaceView.h
index b1e1fae1d0..3d358a3e64 100644
--- a/gvr-interface/src/InterfaceView.h
+++ b/gvr-interface/src/InterfaceView.h
@@ -17,7 +17,7 @@
 class InterfaceView : public QOpenGLWidget {
     Q_OBJECT
 public:
-    InterfaceView(QWidget* parent = 0,  Qt::WindowFlags flags = 0);
+    InterfaceView(QWidget* parent = 0, Qt::WindowFlags flags = 0);
 };
 
 #endif // hifi_InterfaceView_h

From fa166f012f7d9cdcc2c1e3b6f0f65a4aea23c736 Mon Sep 17 00:00:00 2001
From: Stephen Birarda <commit@birarda.com>
Date: Thu, 29 Jan 2015 10:11:46 -0800
Subject: [PATCH 23/23] set size of GVRMainWindow to note 4 size

---
 gvr-interface/src/GVRInterface.cpp    |  9 +++++++--
 gvr-interface/src/GVRMainWindow.cpp   | 11 +++++++++++
 interface/CMakeLists.txt              |  4 +---
 libraries/audio-client/CMakeLists.txt |  6 ++++++
 4 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/gvr-interface/src/GVRInterface.cpp b/gvr-interface/src/GVRInterface.cpp
index ef5a05099d..57907ee752 100644
--- a/gvr-interface/src/GVRInterface.cpp
+++ b/gvr-interface/src/GVRInterface.cpp
@@ -9,8 +9,13 @@
 //  See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
 //
 
+#ifdef Q_OS_ANDROID
+
 #include <QtAndroidExtras/QAndroidJniEnvironment>
 #include <QtAndroidExtras/QAndroidJniObject>
+
+#endif
+
 #include <QtCore/QTimer>
 #include <qpa/qplatformnativeinterface.h>
 #include <QtWidgets/QMenuBar>
@@ -37,7 +42,7 @@ GVRInterface::GVRInterface(int argc, char* argv[]) :
     
     connect(this, &QGuiApplication::applicationStateChanged, this, &GVRInterface::handleApplicationStateChange);
 
-#ifdef Q_OS_ANDROID && HAVE_LIBOVR
+#if defined(Q_OS_ANDROID) && defined(HAVE_LIBOVR)
     QAndroidJniEnvironment jniEnv;
     
     QPlatformNativeInterface* interface = QApplication::platformNativeInterface();
@@ -54,7 +59,7 @@ GVRInterface::GVRInterface(int argc, char* argv[]) :
 }
 
 void GVRInterface::idle() {
-#ifdef Q_OS_ANDROID && HAVE_LIBOVR
+#if defined(Q_OS_ANDROID) && defined(HAVE_LIBOVR)
     if (!_inVRMode && ovr_IsHeadsetDocked()) {
         qDebug() << "The headset just got docked - assume we are in VR mode.";
         _inVRMode = true;
diff --git a/gvr-interface/src/GVRMainWindow.cpp b/gvr-interface/src/GVRMainWindow.cpp
index 4ef55785f6..310d24e5c5 100644
--- a/gvr-interface/src/GVRMainWindow.cpp
+++ b/gvr-interface/src/GVRMainWindow.cpp
@@ -14,6 +14,10 @@
 #include <QtWidgets/QInputDialog>
 #include <QtWidgets/QMenuBar>
 
+#ifndef Q_OS_ANDROID
+#include <QtWidgets/QDesktopWidget>
+#endif
+
 #include <AddressManager.h>
 
 #include "InterfaceView.h"
@@ -24,6 +28,13 @@
 GVRMainWindow::GVRMainWindow(QWidget* parent) :
     QMainWindow(parent)
 {
+    
+#ifndef Q_OS_ANDROID
+    const int NOTE_4_WIDTH = 2560;
+    const int NOTE_4_HEIGHT = 1440;
+    setFixedSize(NOTE_4_WIDTH / 2, NOTE_4_HEIGHT / 2);
+#endif
+    
     QMenu* fileMenu = new QMenu("File");
     QMenu* helpMenu = new QMenu("Help");
     
diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt
index 020adfbd61..406c06ccb3 100644
--- a/interface/CMakeLists.txt
+++ b/interface/CMakeLists.txt
@@ -183,12 +183,10 @@ add_definitions(-DQT_NO_BEARERMANAGEMENT)
 
 if (APPLE)
   # link in required OS X frameworks and include the right GL headers
-  find_library(CoreAudio CoreAudio)
-  find_library(CoreFoundation CoreFoundation)
   find_library(OpenGL OpenGL)
   find_library(AppKit AppKit)
 
-  target_link_libraries(${TARGET_NAME} ${CoreAudio} ${CoreFoundation} ${OpenGL} ${AppKit})
+  target_link_libraries(${TARGET_NAME} ${OpenGL} ${AppKit})
     
   # install command for OS X bundle
   INSTALL(TARGETS ${TARGET_NAME}
diff --git a/libraries/audio-client/CMakeLists.txt b/libraries/audio-client/CMakeLists.txt
index 6b24ebcb93..5477be3bc5 100644
--- a/libraries/audio-client/CMakeLists.txt
+++ b/libraries/audio-client/CMakeLists.txt
@@ -25,5 +25,11 @@ find_package(Soxr REQUIRED)
 target_link_libraries(${TARGET_NAME} ${SOXR_LIBRARIES})
 include_directories(SYSTEM ${SOXR_INCLUDE_DIRS})
 
+if (APPLE)
+  find_library(CoreAudio CoreAudio)
+  find_library(CoreFoundation CoreFoundation)
+  target_link_libraries(${TARGET_NAME} ${CoreAudio} ${CoreFoundation})
+endif ()
+
 # call macro to include our dependency includes and bubble them up via a property on our target
 include_dependency_includes()
\ No newline at end of file