mirror of
https://github.com/lubosz/overte.git
synced 2025-04-08 08:22:19 +02:00
use cmake ExternalProject for glm in Interface
This commit is contained in:
parent
13fc0b1fcd
commit
2c7e225ef7
4 changed files with 31 additions and 2 deletions
|
@ -104,6 +104,7 @@ set(HIFI_LIBRARY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libraries")
|
|||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/")
|
||||
|
||||
set(MACRO_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake/macros")
|
||||
set(EXTERNAL_PROJECT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake/externals")
|
||||
|
||||
file(GLOB HIFI_CUSTOM_MACROS "cmake/macros/*.cmake")
|
||||
foreach(CUSTOM_MACRO ${HIFI_CUSTOM_MACROS})
|
||||
|
|
11
cmake/externals/glm/CMakeLists.txt
vendored
Normal file
11
cmake/externals/glm/CMakeLists.txt
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
include(ExternalProject)
|
||||
ExternalProject_Add(
|
||||
glm
|
||||
URL https://github.com/g-truc/glm/archive/0.9.5.4.zip
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND ""
|
||||
LOG_DOWNLOAD ON
|
||||
)
|
||||
ExternalProject_Get_Property(glm source_dir)
|
||||
set(GLM_INCLUDE_DIRS ${source_dir}/glm)
|
15
cmake/macros/AddDependencyExternalProject.cmake
Normal file
15
cmake/macros/AddDependencyExternalProject.cmake
Normal file
|
@ -0,0 +1,15 @@
|
|||
#
|
||||
# SetupExternalProject.cmake
|
||||
# cmake/macros
|
||||
#
|
||||
# Copyright 2015 High Fidelity, Inc.
|
||||
# Created by Stephen Birarda on February 13, 2014
|
||||
#
|
||||
# Distributed under the Apache License, Version 2.0.
|
||||
# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
#
|
||||
|
||||
macro(ADD_DEPENDENCY_EXTERNAL_PROJECT _PROJ_NAME)
|
||||
add_subdirectory(${EXTERNAL_PROJECT_DIR}/${_PROJ_NAME} ${EXTERNAL_PROJECT_DIR}/${_PROJ_NAME}/build)
|
||||
add_dependencies(${TARGET_NAME} ${_PROJ_NAME})
|
||||
endmacro()
|
|
@ -32,8 +32,6 @@ elseif (WIN32)
|
|||
set(GL_HEADERS "#include <windowshacks.h>\n#include <GL/glew.h>\n#include <GL/wglew.h>")
|
||||
endif ()
|
||||
|
||||
# set up the external glm library
|
||||
include_glm()
|
||||
include_bullet()
|
||||
|
||||
# create the InterfaceConfig.h file based on GL_HEADERS above
|
||||
|
@ -109,6 +107,10 @@ endif()
|
|||
# create the executable, make it a bundle on OS X
|
||||
add_executable(${TARGET_NAME} MACOSX_BUNDLE ${INTERFACE_SRCS} ${QM})
|
||||
|
||||
# set up the external glm library
|
||||
add_dependency_external_project(glm)
|
||||
target_include_directories(${TARGET_NAME} PUBLIC ${GLM_INCLUDE_DIRS})
|
||||
|
||||
# link required hifi libraries
|
||||
link_hifi_libraries(shared octree environment gpu model fbx metavoxels networking entities avatars
|
||||
audio audio-client animation script-engine physics
|
||||
|
|
Loading…
Reference in a new issue