diff --git a/BUILD.md b/BUILD.md index 82cbf6628c..3065254529 100644 --- a/BUILD.md +++ b/BUILD.md @@ -2,7 +2,6 @@ * [cmake](http://www.cmake.org/cmake/resources/software.html) ~> 2.8.12.2 * [Qt](http://qt-project.org/downloads) ~> 5.3.2 -* [glm](http://glm.g-truc.net/0.9.5/index.html) ~> 0.9.5.4 * [OpenSSL](https://www.openssl.org/related/binaries.html) ~> 1.0.1g * IMPORTANT: OpenSSL 1.0.1g is critical to avoid a security vulnerability. * [Intel Threading Building Blocks](https://www.threadingbuildingblocks.org/) ~> 4.3 @@ -10,6 +9,12 @@ * [Bullet Physics Engine](https://code.google.com/p/bullet/downloads/list) ~> 2.82 * [Gverb](https://github.com/highfidelity/gverb/archive/master.zip) (direct download to latest version) +#### CMake External Project Dependencies + +The following dependencies will be downloaded, built, linked and included automatically by CMake where we require them. The CMakeLists files that handle grabbing each of the following external dependencies can be found in the [cmake/externals folder](cmake/externals). The resulting downloads, source files and binaries will be placed in the `build` directory in each of the subfolders for each external project. These are not placed in your normal build tree when doing an out of source build so that they do not need to be re-downloaded and re-compiled every time the CMake build folder is cleared. + +* [glm](http://glm.g-truc.net/0.9.5/index.html) ~> 0.9.5.4 + ### OS Specific Build Guides * [BUILD_OSX.md](BUILD_OSX.md) - additional instructions for OS X. * [BUILD_LINUX.md](BUILD_LINUX.md) - additional instructions for Linux. diff --git a/assignment-client/CMakeLists.txt b/assignment-client/CMakeLists.txt index c2203316f9..d8d2d44090 100644 --- a/assignment-client/CMakeLists.txt +++ b/assignment-client/CMakeLists.txt @@ -3,7 +3,7 @@ set(TARGET_NAME assignment-client) setup_hifi_project(Core Gui Network Script Widgets) add_dependency_external_project(glm) -target_link_directories(${TARGET_NAME} PRIVATE ${GLM_INCLUDE_DIRS}) +target_include_directories(${TARGET_NAME} PRIVATE ${GLM_INCLUDE_DIRS}) # link in the shared libraries link_hifi_libraries( diff --git a/cmake/macros/AddDependencyExternalProject.cmake b/cmake/macros/AddDependencyExternalProject.cmake index 56cf6d71be..96b3ee44ab 100644 --- a/cmake/macros/AddDependencyExternalProject.cmake +++ b/cmake/macros/AddDependencyExternalProject.cmake @@ -10,6 +10,9 @@ # macro(ADD_DEPENDENCY_EXTERNAL_PROJECT _PROJ_NAME) - add_subdirectory(${EXTERNAL_PROJECT_DIR}/${_PROJ_NAME} ${EXTERNAL_PROJECT_DIR}/${_PROJ_NAME}/build) + if (NOT TARGET ${_PROJ_NAME}) + add_subdirectory(${EXTERNAL_PROJECT_DIR}/${_PROJ_NAME} ${CMAKE_BINARY_DIR}/externals/${_PROJ_NAME}) + endif () + add_dependencies(${TARGET_NAME} ${_PROJ_NAME}) endmacro() \ No newline at end of file