diff --git a/BUILD_ANDROID.md b/BUILD_ANDROID.md index 719aa8cfd9..6ff3160775 100644 --- a/BUILD_ANDROID.md +++ b/BUILD_ANDROID.md @@ -127,11 +127,6 @@ To put the Gear VR Service into developer mode you need an application with an O Once the application is on your device, go to `Settings->Application Manager->Gear VR Service->Manage Storage`. Tap on `VR Service Version` six times. It will scan your device to verify that you have an osig file in an application on your device, and then it will let you enable Developer mode. -####GLM - -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 diff --git a/BUILD_OSX.md b/BUILD_OSX.md index fce74cf678..2d5460d39d 100644 --- a/BUILD_OSX.md +++ b/BUILD_OSX.md @@ -4,7 +4,7 @@ Please read the [general build guide](BUILD.md) for information on dependencies [Homebrew](http://brew.sh/) is an excellent package manager for OS X. It makes install of all hifi dependencies very simple. brew tap highfidelity/homebrew-formulas - brew install cmake glm openssl tbb libsoxr + brew install cmake openssl tbb libsoxr brew install highfidelity/formulas/qt5 brew link qt5 --force diff --git a/BUILD_WIN.md b/BUILD_WIN.md index 8022fae5b8..ebc0b60f25 100644 --- a/BUILD_WIN.md +++ b/BUILD_WIN.md @@ -56,9 +56,6 @@ The recommended route for CMake to find the external dependencies is to place al -> bin -> include -> lib - -> glm - -> glm - -> glm.hpp -> openssl -> bin -> include @@ -129,12 +126,6 @@ Download the binary package: `glew-1.10.0-win32.zip`. Extract to %HIFI_LIB_DIR%\ Add to the PATH: `%HIFI_LIB_DIR%\glew\bin\Release\Win32` -###GLM - -This package contains only headers, so there's nothing to add to the PATH. - -Be careful with glm. For the folder other libraries would normally call 'include', the folder containing the headers, glm opts to use 'glm'. You will have a glm folder nested inside the top-level glm folder. - ###Gverb 1. Go to https://github.com/highfidelity/gverb diff --git a/cmake/externals/glm/CMakeLists.txt b/cmake/externals/glm/CMakeLists.txt index 0692b9573d..6246993df5 100644 --- a/cmake/externals/glm/CMakeLists.txt +++ b/cmake/externals/glm/CMakeLists.txt @@ -2,10 +2,9 @@ include(ExternalProject) ExternalProject_Add( glm URL https://github.com/g-truc/glm/archive/0.9.5.4.zip - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - INSTALL_COMMAND "" + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH= LOG_DOWNLOAD ON ) -ExternalProject_Get_Property(glm source_dir) -set(GLM_INCLUDE_DIRS ${source_dir}/glm) \ No newline at end of file +ExternalProject_Get_Property(glm install_dir) + +export(TARGETS glm FILE ${CMAKE_BINARY_DIR}/glm-config.cmake) \ No newline at end of file diff --git a/cmake/macros/AddDependencyExternalProject.cmake b/cmake/macros/AddDependencyExternalProject.cmake index 96b3ee44ab..c4c2c0d005 100644 --- a/cmake/macros/AddDependencyExternalProject.cmake +++ b/cmake/macros/AddDependencyExternalProject.cmake @@ -11,8 +11,18 @@ macro(ADD_DEPENDENCY_EXTERNAL_PROJECT _PROJ_NAME) if (NOT TARGET ${_PROJ_NAME}) - add_subdirectory(${EXTERNAL_PROJECT_DIR}/${_PROJ_NAME} ${CMAKE_BINARY_DIR}/externals/${_PROJ_NAME}) + + if (ANDROID) + set(_PROJ_BINARY_DIR ${EXTERNAL_PROJECT_DIR}/${_PROJ_NAME}/build/android) + else () + set(_PROJ_BINARY_DIR ${EXTERNAL_PROJECT_DIR}/${_PROJ_NAME}/build) + endif () + + add_subdirectory(${EXTERNAL_PROJECT_DIR}/${_PROJ_NAME} ${_PROJ_BINARY_DIR}) endif () + string(TOUPPER ${_PROJ_NAME} _PROJ_NAME_UPPER) + get_target_property(${_PROJ_NAME_UPPER}_INCLUDE_DIRS ${_PROJ_NAME} INCLUDE_DIRS) + add_dependencies(${TARGET_NAME} ${_PROJ_NAME}) endmacro() \ No newline at end of file