mirror of
https://github.com/lubosz/overte.git
synced 2025-04-08 06:04:06 +02:00
use the glm find_package and check externals
This commit is contained in:
parent
50c9bb2ae5
commit
8c998a65ee
18 changed files with 50 additions and 5 deletions
|
@ -3,6 +3,7 @@ set(TARGET_NAME assignment-client)
|
|||
setup_hifi_project(Core Gui Network Script Widgets)
|
||||
|
||||
add_dependency_external_project(glm)
|
||||
find_package(GLM REQUIRED)
|
||||
target_include_directories(${TARGET_NAME} PRIVATE ${GLM_INCLUDE_DIRS})
|
||||
|
||||
# link in the shared libraries
|
||||
|
|
1
cmake/externals/glm/CMakeLists.txt
vendored
1
cmake/externals/glm/CMakeLists.txt
vendored
|
@ -1,6 +1,7 @@
|
|||
include(ExternalProject)
|
||||
ExternalProject_Add(
|
||||
glm
|
||||
PREFIX glm
|
||||
URL https://github.com/g-truc/glm/archive/0.9.5.4.zip
|
||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
|
||||
LOG_DOWNLOAD ON
|
||||
|
|
|
@ -10,22 +10,23 @@
|
|||
|
||||
macro(HIFI_LIBRARY_SEARCH_HINTS LIBRARY_FOLDER)
|
||||
string(TOUPPER ${LIBRARY_FOLDER} LIBRARY_PREFIX)
|
||||
set(${LIBRARY_PREFIX}_SEARCH_DIRS "")
|
||||
|
||||
set(${LIBRARY_PREFIX}_SEARCH_DIRS "${EXTERNAL_PROJECT_DIR}/${LIBRARY_FOLDER}/build/${LIBRARY_FOLDER}")
|
||||
|
||||
if (${LIBRARY_PREFIX}_ROOT_DIR)
|
||||
set(${LIBRARY_PREFIX}_SEARCH_DIRS "${${LIBRARY_PREFIX}_ROOT_DIR}")
|
||||
list(APPEND ${LIBRARY_PREFIX}_SEARCH_DIRS "${${LIBRARY_PREFIX}_ROOT_DIR}")
|
||||
endif ()
|
||||
|
||||
if (ANDROID)
|
||||
set(${LIBRARY_PREFIX}_SEARCH_DIRS "${${LIBRARY_PREFIX}_SEARCH_DIRS}" "/${LIBRARY_FOLDER}")
|
||||
list(APPEND ${LIBRARY_PREFIX}_SEARCH_DIRS "/${LIBRARY_FOLDER}")
|
||||
endif ()
|
||||
|
||||
if (DEFINED ENV{${LIBRARY_PREFIX}_ROOT_DIR})
|
||||
set(${LIBRARY_PREFIX}_SEARCH_DIRS "${${LIBRARY_PREFIX}_SEARCH_DIRS}" "$ENV{${LIBRARY_PREFIX}_ROOT_DIR}")
|
||||
list(APPEND ${LIBRARY_PREFIX}_SEARCH_DIRS "$ENV{${LIBRARY_PREFIX}_ROOT_DIR}")
|
||||
endif ()
|
||||
|
||||
if (DEFINED ENV{HIFI_LIB_DIR})
|
||||
set(${LIBRARY_PREFIX}_SEARCH_DIRS "${${LIBRARY_PREFIX}_SEARCH_DIRS}" "$ENV{HIFI_LIB_DIR}/${LIBRARY_FOLDER}")
|
||||
list(APPEND ${LIBRARY_PREFIX}_SEARCH_DIRS "$ENV{HIFI_LIB_DIR}/${LIBRARY_FOLDER}")
|
||||
endif ()
|
||||
|
||||
endmacro(HIFI_LIBRARY_SEARCH_HINTS _library_folder)
|
28
cmake/modules/FindGLM.cmake
Normal file
28
cmake/modules/FindGLM.cmake
Normal file
|
@ -0,0 +1,28 @@
|
|||
#
|
||||
# FindGLM.cmake
|
||||
#
|
||||
# Try to find GLM include path.
|
||||
# Once done this will define
|
||||
#
|
||||
# GLM_INCLUDE_DIRS
|
||||
#
|
||||
# Created on 7/17/2014 by Stephen Birarda
|
||||
# Copyright 2014 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
|
||||
#
|
||||
|
||||
# setup hints for GLM search
|
||||
include("${MACRO_DIR}/HifiLibrarySearchHints.cmake")
|
||||
hifi_library_search_hints("glm")
|
||||
|
||||
# locate header
|
||||
find_path(GLM_INCLUDE_DIR "glm/glm.hpp" HINTS ${GLM_SEARCH_DIRS})
|
||||
|
||||
set(GLM_INCLUDE_DIRS "${GLM_INCLUDE_DIR}")
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(GLM DEFAULT_MSG GLM_INCLUDE_DIRS)
|
||||
|
||||
mark_as_advanced(GLM_INCLUDE_DIRS GLM_SEARCH_DIRS)
|
|
@ -109,6 +109,7 @@ add_executable(${TARGET_NAME} MACOSX_BUNDLE ${INTERFACE_SRCS} ${QM})
|
|||
|
||||
# set up the external glm library
|
||||
add_dependency_external_project(glm)
|
||||
find_package(GLM REQUIRED)
|
||||
target_include_directories(${TARGET_NAME} PRIVATE ${GLM_INCLUDE_DIRS})
|
||||
|
||||
# link required hifi libraries
|
||||
|
|
|
@ -4,6 +4,7 @@ set(TARGET_NAME audio)
|
|||
setup_hifi_library(Network)
|
||||
|
||||
add_dependency_external_project(glm)
|
||||
find_package(GLM REQUIRED)
|
||||
target_include_directories(${TARGET_NAME} PUBLIC ${GLM_INCLUDE_DIRS})
|
||||
|
||||
link_hifi_libraries(networking shared)
|
||||
|
|
|
@ -4,6 +4,7 @@ set(TARGET_NAME avatars)
|
|||
setup_hifi_library(Network Script)
|
||||
|
||||
add_dependency_external_project(glm)
|
||||
find_package(GLM REQUIRED)
|
||||
target_include_directories(${TARGET_NAME} PUBLIC ${GLM_INCLUDE_DIRS})
|
||||
|
||||
link_hifi_libraries(audio shared networking)
|
||||
|
|
|
@ -4,6 +4,7 @@ set(TARGET_NAME entities-renderer)
|
|||
setup_hifi_library(Widgets OpenGL Network Script)
|
||||
|
||||
add_dependency_external_project(glm)
|
||||
find_package(GLM REQUIRED)
|
||||
target_include_directories(${TARGET_NAME} PUBLIC ${GLM_INCLUDE_DIRS})
|
||||
|
||||
link_hifi_libraries(shared gpu script-engine render-utils)
|
||||
|
|
|
@ -4,6 +4,7 @@ set(TARGET_NAME entities)
|
|||
setup_hifi_library(Network Script)
|
||||
|
||||
add_dependency_external_project(glm)
|
||||
find_package(GLM REQUIRED)
|
||||
target_include_directories(${TARGET_NAME} PUBLIC ${GLM_INCLUDE_DIRS})
|
||||
|
||||
include_bullet()
|
||||
|
|
|
@ -4,6 +4,7 @@ set(TARGET_NAME environment)
|
|||
setup_hifi_library()
|
||||
|
||||
add_dependency_external_project(glm)
|
||||
find_package(GLM REQUIRED)
|
||||
target_include_directories(${TARGET_NAME} PUBLIC ${GLM_INCLUDE_DIRS})
|
||||
|
||||
link_hifi_libraries(shared networking)
|
||||
|
|
|
@ -4,6 +4,7 @@ set(TARGET_NAME fbx)
|
|||
setup_hifi_library()
|
||||
|
||||
add_dependency_external_project(glm)
|
||||
find_package(GLM REQUIRED)
|
||||
target_include_directories(${TARGET_NAME} PUBLIC ${GLM_INCLUDE_DIRS})
|
||||
|
||||
link_hifi_libraries(shared gpu model networking octree)
|
||||
|
|
|
@ -9,6 +9,7 @@ setup_hifi_library(Network Script Widgets)
|
|||
link_hifi_libraries(shared networking)
|
||||
|
||||
add_dependency_external_project(glm)
|
||||
find_package(GLM REQUIRED)
|
||||
target_include_directories(${TARGET_NAME} PUBLIC ${GLM_INCLUDE_DIRS})
|
||||
|
||||
# call macro to include our dependency includes and bubble them up via a property on our target
|
||||
|
|
|
@ -4,6 +4,7 @@ set(TARGET_NAME model)
|
|||
setup_hifi_library()
|
||||
|
||||
add_dependency_external_project(glm)
|
||||
find_package(GLM REQUIRED)
|
||||
target_include_directories(${TARGET_NAME} PUBLIC ${GLM_INCLUDE_DIRS})
|
||||
|
||||
link_hifi_libraries(shared gpu)
|
||||
|
|
|
@ -4,6 +4,7 @@ set(TARGET_NAME octree)
|
|||
setup_hifi_library()
|
||||
|
||||
add_dependency_external_project(glm)
|
||||
find_package(GLM REQUIRED)
|
||||
target_include_directories(${TARGET_NAME} PUBLIC ${GLM_INCLUDE_DIRS})
|
||||
|
||||
link_hifi_libraries(shared networking)
|
||||
|
|
|
@ -4,6 +4,7 @@ set(TARGET_NAME physics)
|
|||
setup_hifi_library()
|
||||
|
||||
add_dependency_external_project(glm)
|
||||
find_package(GLM REQUIRED)
|
||||
target_include_directories(${TARGET_NAME} PUBLIC ${GLM_INCLUDE_DIRS})
|
||||
|
||||
include_bullet()
|
||||
|
|
|
@ -9,6 +9,7 @@ qt5_add_resources(QT_RESOURCES_FILE "${CMAKE_CURRENT_SOURCE_DIR}/res/fonts/fonts
|
|||
setup_hifi_library(Widgets OpenGL Network Script)
|
||||
|
||||
add_dependency_external_project(glm)
|
||||
find_package(GLM REQUIRED)
|
||||
target_include_directories(${TARGET_NAME} PUBLIC ${GLM_INCLUDE_DIRS})
|
||||
|
||||
link_hifi_libraries(animation fbx shared gpu)
|
||||
|
|
|
@ -4,6 +4,7 @@ set(TARGET_NAME script-engine)
|
|||
setup_hifi_library(Gui Network Script Widgets)
|
||||
|
||||
add_dependency_external_project(glm)
|
||||
find_package(GLM REQUIRED)
|
||||
target_include_directories(${TARGET_NAME} PUBLIC ${GLM_INCLUDE_DIRS})
|
||||
|
||||
link_hifi_libraries(shared octree gpu model fbx entities animation audio physics metavoxels)
|
||||
|
|
|
@ -3,6 +3,7 @@ set(TARGET_NAME physics-tests)
|
|||
setup_hifi_project()
|
||||
|
||||
add_dependency_external_project(glm)
|
||||
find_package(GLM REQUIRED)
|
||||
target_include_directories(${TARGET_NAME} PUBLIC ${GLM_INCLUDE_DIRS})
|
||||
|
||||
include_bullet()
|
||||
|
|
Loading…
Reference in a new issue