Merge pull request #3989 from birarda/master

fix luckily linked dependencies in prep for shared hifi libraries
This commit is contained in:
Brad Hefta-Gaub 2014-12-21 11:34:43 -08:00
commit 483155f246
34 changed files with 66 additions and 117 deletions

View file

@ -12,6 +12,10 @@ if (POLICY CMP0043)
cmake_policy(SET CMP0043 OLD) cmake_policy(SET CMP0043 OLD)
endif () endif ()
if (POLICY CMP0042)
cmake_policy(SET CMP0042 OLD)
endif ()
project(hifi) project(hifi)
add_definitions(-DGLM_FORCE_RADIANS) add_definitions(-DGLM_FORCE_RADIANS)

View file

@ -15,4 +15,4 @@ if (UNIX)
target_link_libraries(${TARGET_NAME} ${CMAKE_DL_LIBS}) target_link_libraries(${TARGET_NAME} ${CMAKE_DL_LIBS})
endif (UNIX) endif (UNIX)
link_shared_dependencies() include_dependency_includes()

View file

@ -1,5 +1,5 @@
# #
# LinkSharedDependencies.cmake # IncludeDependencyIncludes.cmake
# cmake/macros # cmake/macros
# #
# Copyright 2014 High Fidelity, Inc. # Copyright 2014 High Fidelity, Inc.
@ -9,7 +9,7 @@
# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html # See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
# #
macro(LINK_SHARED_DEPENDENCIES) macro(INCLUDE_DEPENDENCY_INCLUDES)
if (${TARGET_NAME}_DEPENDENCY_INCLUDES) if (${TARGET_NAME}_DEPENDENCY_INCLUDES)
list(REMOVE_DUPLICATES ${TARGET_NAME}_DEPENDENCY_INCLUDES) list(REMOVE_DUPLICATES ${TARGET_NAME}_DEPENDENCY_INCLUDES)
@ -19,4 +19,4 @@ macro(LINK_SHARED_DEPENDENCIES)
# set the property on this target so it can be retreived by targets linking to us # set the property on this target so it can be retreived by targets linking to us
set_target_properties(${TARGET_NAME} PROPERTIES DEPENDENCY_INCLUDES "${${TARGET_NAME}_DEPENDENCY_INCLUDES}") set_target_properties(${TARGET_NAME} PROPERTIES DEPENDENCY_INCLUDES "${${TARGET_NAME}_DEPENDENCY_INCLUDES}")
endmacro(LINK_SHARED_DEPENDENCIES) endmacro(INCLUDE_DEPENDENCY_INCLUDES)

View file

@ -1,47 +0,0 @@
#
# FindGLUT.cmake
#
# Try to find GLUT library and include path.
# Once done this will define
#
# GLUT_FOUND
# GLUT_INCLUDE_DIRS
# GLUT_LIBRARIES
#
# Created on 2/6/2014 by Stephen Birarda
# Copyright 2014 High Fidelity, Inc.
#
# Adapted from FindGLUT.cmake available in tlorach's OpenGLText Repository
# https://raw.github.com/tlorach/OpenGLText/master/cmake/FindGLUT.cmake
#
# Distributed under the Apache License, Version 2.0.
# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
#
include("${MACRO_DIR}/HifiLibrarySearchHints.cmake")
hifi_library_search_hints("freeglut")
if (WIN32)
set(GLUT_HINT_DIRS "${FREEGLUT_SEARCH_DIRS} ${OPENGL_INCLUDE_DIR}")
find_path(GLUT_INCLUDE_DIRS GL/glut.h PATH_SUFFIXES include HINTS ${FREEGLUT_SEARCH_DIRS})
find_library(GLUT_LIBRARY freeglut PATH_SUFFIXES lib HINTS ${FREEGLUT_SEARCH_DIRS})
else ()
find_path(GLUT_INCLUDE_DIRS GL/glut.h PATH_SUFFIXES include HINTS ${FREEGLUT_SEARCH_DIRS})
find_library(GLUT_LIBRARY glut PATH_SUFFIXES lib HINTS ${FREEGLUT_SEARCH_DIRS})
endif ()
include(FindPackageHandleStandardArgs)
set(GLUT_LIBRARIES "${GLUT_LIBRARY}" "${XMU_LIBRARY}" "${XI_LIBRARY}")
if (UNIX)
find_library(XI_LIBRARY Xi PATH_SUFFIXES lib HINTS ${FREEGLUT_SEARCH_DIRS})
find_library(XMU_LIBRARY Xmu PATH_SUFFIXES lib HINTS ${FREEGLUT_SEARCH_DIRS})
find_package_handle_standard_args(GLUT DEFAULT_MSG GLUT_INCLUDE_DIRS GLUT_LIBRARIES XI_LIBRARY XMU_LIBRARY)
else ()
find_package_handle_standard_args(GLUT DEFAULT_MSG GLUT_INCLUDE_DIRS GLUT_LIBRARIES)
endif ()
mark_as_advanced(GLUT_INCLUDE_DIRS GLUT_LIBRARIES GLUT_LIBRARY XI_LIBRARY XMU_LIBRARY FREEGLUT_SEARCH_DIRS)

View file

@ -52,4 +52,4 @@ include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}")
# append OpenSSL to our list of libraries to link # append OpenSSL to our list of libraries to link
target_link_libraries(${TARGET_NAME} ${OPENSSL_LIBRARIES}) target_link_libraries(${TARGET_NAME} ${OPENSSL_LIBRARIES})
link_shared_dependencies() include_dependency_includes()

View file

@ -6,4 +6,4 @@ setup_hifi_project(Network)
# link the shared hifi libraries # link the shared hifi libraries
link_hifi_libraries(networking shared) link_hifi_libraries(networking shared)
link_shared_dependencies() include_dependency_includes()

View file

@ -194,11 +194,10 @@ if (APPLE)
# link in required OS X frameworks and include the right GL headers # link in required OS X frameworks and include the right GL headers
find_library(CoreAudio CoreAudio) find_library(CoreAudio CoreAudio)
find_library(CoreFoundation CoreFoundation) find_library(CoreFoundation CoreFoundation)
find_library(GLUT GLUT)
find_library(OpenGL OpenGL) find_library(OpenGL OpenGL)
find_library(AppKit AppKit) find_library(AppKit AppKit)
target_link_libraries(${TARGET_NAME} ${CoreAudio} ${CoreFoundation} ${GLUT} ${OpenGL} ${AppKit}) target_link_libraries(${TARGET_NAME} ${CoreAudio} ${CoreFoundation} ${OpenGL} ${AppKit})
# install command for OS X bundle # install command for OS X bundle
INSTALL(TARGETS ${TARGET_NAME} INSTALL(TARGETS ${TARGET_NAME}
@ -214,15 +213,12 @@ else (APPLE)
) )
find_package(OpenGL REQUIRED) find_package(OpenGL REQUIRED)
find_package(GLUT REQUIRED)
include_directories(SYSTEM "${GLUT_INCLUDE_DIRS}")
if (${OPENGL_INCLUDE_DIR}) if (${OPENGL_INCLUDE_DIR})
include_directories(SYSTEM "${OPENGL_INCLUDE_DIR}") include_directories(SYSTEM "${OPENGL_INCLUDE_DIR}")
endif () endif ()
target_link_libraries(${TARGET_NAME} "${OPENGL_LIBRARY}" "${GLUT_LIBRARIES}") target_link_libraries(${TARGET_NAME} "${OPENGL_LIBRARY}")
# link target to external libraries # link target to external libraries
if (WIN32) if (WIN32)
@ -246,4 +242,4 @@ else (APPLE)
endif (APPLE) endif (APPLE)
# link any dependencies bubbled up from our linked dependencies # link any dependencies bubbled up from our linked dependencies
link_shared_dependencies() include_dependency_includes()

View file

@ -12,11 +12,12 @@
#include <gpu/GPUConfig.h> #include <gpu/GPUConfig.h>
#include "Hair.h"
#include "Util.h" #include "Util.h"
#include "world.h" #include "world.h"
#include "Hair.h"
const float HAIR_DAMPING = 0.99f; const float HAIR_DAMPING = 0.99f;
const float CONSTRAINT_RELAXATION = 10.0f; const float CONSTRAINT_RELAXATION = 10.0f;
const float HAIR_ACCELERATION_COUPLING = 0.045f; const float HAIR_ACCELERATION_COUPLING = 0.045f;

View file

@ -5,5 +5,5 @@ setup_hifi_library(Network Script)
link_hifi_libraries(shared fbx) link_hifi_libraries(shared fbx)
# call macro to link our dependencies and bubble them up via a property on our target # call macro to include our dependency includes and bubble them up via a property on our target
link_shared_dependencies() include_dependency_includes()

View file

@ -7,5 +7,5 @@ include_glm()
link_hifi_libraries(networking shared) link_hifi_libraries(networking shared)
# call macro to link our dependencies and bubble them up via a property on our target # call macro to include our dependency includes and bubble them up via a property on our target
link_shared_dependencies() include_dependency_includes()

View file

@ -5,8 +5,7 @@ setup_hifi_library(Network Script)
include_glm() include_glm()
link_hifi_libraries(shared octree voxels networking physics) link_hifi_libraries(audio shared octree voxels networking physics fbx)
include_hifi_library_headers(fbx)
# call macro to link our dependencies and bubble them up via a property on our target # call macro to include our dependency includes and bubble them up via a property on our target
link_shared_dependencies() include_dependency_includes()

View file

@ -3,5 +3,5 @@ set(TARGET_NAME embedded-webserver)
# use setup_hifi_library macro to setup our project and link appropriate Qt modules # use setup_hifi_library macro to setup our project and link appropriate Qt modules
setup_hifi_library(Network) setup_hifi_library(Network)
# call macro to link our dependencies and bubble them up via a property on our target # call macro to include our dependency includes and bubble them up via a property on our target
link_shared_dependencies() include_dependency_includes()

View file

@ -5,7 +5,7 @@ setup_hifi_library(Widgets OpenGL Network Script)
include_glm() include_glm()
link_hifi_libraries(shared gpu script-engine) link_hifi_libraries(shared gpu script-engine render-utils)
# call macro to link our dependencies and bubble them up via a property on our target # call macro to include our dependency includes and bubble them up via a property on our target
link_shared_dependencies() include_dependency_includes()

View file

@ -5,7 +5,7 @@ setup_hifi_library(Network Script)
include_glm() include_glm()
link_hifi_libraries(shared octree fbx networking animation physics) link_hifi_libraries(avatars shared octree fbx networking animation physics)
# call macro to link our dependencies and bubble them up via a property on our target # call macro to include our dependency includes and bubble them up via a property on our target
link_shared_dependencies() include_dependency_includes()

View file

@ -11,5 +11,5 @@ find_package(ZLIB REQUIRED)
include_directories(SYSTEM "${ZLIB_INCLUDE_DIRS}") include_directories(SYSTEM "${ZLIB_INCLUDE_DIRS}")
target_link_libraries(${TARGET_NAME} ${ZLIB_LIBRARIES}) target_link_libraries(${TARGET_NAME} ${ZLIB_LIBRARIES})
# call macro to link our dependencies and bubble them up via a property on our target # call macro to include our dependency includes and bubble them up via a property on our target
link_shared_dependencies() include_dependency_includes()

View file

@ -19,7 +19,7 @@ elseif (WIN32)
# we're using static GLEW, so define GLEW_STATIC # we're using static GLEW, so define GLEW_STATIC
add_definitions(-DGLEW_STATIC) add_definitions(-DGLEW_STATIC)
target_link_libraries(${TARGET_NAME} opengl32.lib) target_link_libraries(${TARGET_NAME} ${GLEW_LIBRARIES} opengl32.lib)
# need to bubble up the GLEW_INCLUDE_DIRS # need to bubble up the GLEW_INCLUDE_DIRS
list(APPEND ${TARGET_NAME}_DEPENDENCY_INCLUDES "${GLEW_INCLUDE_DIRS}") list(APPEND ${TARGET_NAME}_DEPENDENCY_INCLUDES "${GLEW_INCLUDE_DIRS}")
@ -44,5 +44,5 @@ else ()
list(APPEND ${TARGET_NAME}_DEPENDENCY_INCLUDES "${OPENGL_INCLUDE_DIR}") list(APPEND ${TARGET_NAME}_DEPENDENCY_INCLUDES "${OPENGL_INCLUDE_DIR}")
endif (APPLE) endif (APPLE)
# call macro to link our dependencies and bubble them up via a property on our target # call macro to include our dependency includes and bubble them up via a property on our target
link_shared_dependencies() include_dependency_includes()

View file

@ -10,5 +10,5 @@ link_hifi_libraries(shared networking)
include_glm() include_glm()
# call macro to link our dependencies and bubble them up via a property on our target # call macro to include our dependency includes and bubble them up via a property on our target
link_shared_dependencies() include_dependency_includes()

View file

@ -28,5 +28,5 @@ target_link_libraries(${TARGET_NAME} ${OPENSSL_LIBRARIES} ${TBB_LIBRARIES})
# append libcuckoo includes to our list of includes to bubble # append libcuckoo includes to our list of includes to bubble
list(APPEND ${TARGET_NAME}_DEPENDENCY_INCLUDES "${TBB_INCLUDE_DIRS}") list(APPEND ${TARGET_NAME}_DEPENDENCY_INCLUDES "${TBB_INCLUDE_DIRS}")
# call macro to link our dependencies and bubble them up via a property on our target # call macro to include our dependency includes and bubble them up via a property on our target
link_shared_dependencies() include_dependency_includes()

View file

@ -15,5 +15,5 @@ include_directories(SYSTEM "${ZLIB_INCLUDE_DIRS}")
# append ZLIB and OpenSSL to our list of libraries to link # append ZLIB and OpenSSL to our list of libraries to link
target_link_libraries(${TARGET_NAME} ${ZLIB_LIBRARIES}) target_link_libraries(${TARGET_NAME} ${ZLIB_LIBRARIES})
# call macro to link our dependencies and bubble them up via a property on our target # call macro to include our dependency includes and bubble them up via a property on our target
link_shared_dependencies() include_dependency_includes()

View file

@ -15,5 +15,5 @@ link_hifi_libraries(shared)
## append BULLET to our list of libraries to link ## append BULLET to our list of libraries to link
#list(APPEND ${TARGET_NAME}_LIBRARIES_TO_LINK "${BULLET_LIBRARIES}") #list(APPEND ${TARGET_NAME}_LIBRARIES_TO_LINK "${BULLET_LIBRARIES}")
# call macro to link our dependencies and bubble them up via a property on our target # call macro to include our dependency includes and bubble them up via a property on our target
link_shared_dependencies() include_dependency_includes()

View file

@ -5,12 +5,7 @@ setup_hifi_library(Widgets OpenGL Network Script)
include_glm() include_glm()
link_hifi_libraries(shared gpu) link_hifi_libraries(animation fbx shared gpu)
if (WIN32) # call macro to include our dependency includes and bubble them up via a property on our target
find_package(GLUT REQUIRED) include_dependency_includes()
include_directories(SYSTEM "${GLUT_INCLUDE_DIRS}")
endif ()
# call macro to link our dependencies and bubble them up via a property on our target
link_shared_dependencies()

View file

@ -5,7 +5,7 @@ setup_hifi_library(Gui Network Script Widgets)
include_glm() include_glm()
link_hifi_libraries(shared octree voxels fbx entities animation audio physics) link_hifi_libraries(shared octree voxels fbx entities animation audio physics metavoxels)
# call macro to link our dependencies and bubble them up via a property on our target # call macro to include our dependency includes and bubble them up via a property on our target
link_shared_dependencies() include_dependency_includes()

View file

@ -1,7 +1,8 @@
set(TARGET_NAME shared) set(TARGET_NAME shared)
# use setup_hifi_library macro to setup our project and link appropriate Qt modules # use setup_hifi_library macro to setup our project and link appropriate Qt modules
setup_hifi_library(Network Widgets) # TODO: there isn't really a good reason to have Script linked here - let's get what is requiring it out (RegisteredMetaTypes.cpp)
setup_hifi_library(Network Script Widgets)
# call macro to link our dependencies and bubble them up via a property on our target # call macro to include our dependency includes and bubble them up via a property on our target
link_shared_dependencies() include_dependency_includes()

View file

@ -14,5 +14,5 @@ include_directories(SYSTEM "${ZLIB_INCLUDE_DIRS}")
# add it to our list of libraries to link # add it to our list of libraries to link
target_link_libraries(${TARGET_NAME} ${ZLIB_LIBRARIES}) target_link_libraries(${TARGET_NAME} ${ZLIB_LIBRARIES})
# call macro to link our dependencies and bubble them up via a property on our target # call macro to include our dependency includes and bubble them up via a property on our target
link_shared_dependencies() include_dependency_includes()

View file

@ -7,4 +7,4 @@ include_glm()
# link in the shared libraries # link in the shared libraries
link_hifi_libraries(shared audio networking) link_hifi_libraries(shared audio networking)
link_shared_dependencies() include_dependency_includes()

View file

@ -5,4 +5,4 @@ setup_hifi_project()
# link in the shared libraries # link in the shared libraries
link_hifi_libraries(shared networking) link_hifi_libraries(shared networking)
link_shared_dependencies() include_dependency_includes()

View file

@ -9,4 +9,4 @@ setup_hifi_project(Network Script Widgets)
# link in the shared libraries # link in the shared libraries
link_hifi_libraries(metavoxels networking shared) link_hifi_libraries(metavoxels networking shared)
link_shared_dependencies() include_dependency_includes()

View file

@ -5,4 +5,4 @@ setup_hifi_project()
# link in the shared libraries # link in the shared libraries
link_hifi_libraries(shared networking) link_hifi_libraries(shared networking)
link_shared_dependencies() include_dependency_includes()

View file

@ -7,4 +7,4 @@ include_glm()
# link in the shared libraries # link in the shared libraries
link_hifi_libraries(shared octree voxels fbx metavoxels networking entities avatars audio animation script-engine physics) link_hifi_libraries(shared octree voxels fbx metavoxels networking entities avatars audio animation script-engine physics)
link_shared_dependencies() include_dependency_includes()

View file

@ -7,4 +7,4 @@ include_glm()
# link in the shared libraries # link in the shared libraries
link_hifi_libraries(shared physics) link_hifi_libraries(shared physics)
link_shared_dependencies() include_dependency_includes()

View file

@ -7,4 +7,4 @@ include_glm()
# link in the shared libraries # link in the shared libraries
link_hifi_libraries(shared) link_hifi_libraries(shared)
link_shared_dependencies() include_dependency_includes()

View file

@ -5,4 +5,4 @@ include_glm()
link_hifi_libraries(metavoxels) link_hifi_libraries(metavoxels)
link_shared_dependencies() include_dependency_includes()

View file

@ -5,4 +5,4 @@ include_glm()
link_hifi_libraries(metavoxels) link_hifi_libraries(metavoxels)
link_shared_dependencies() include_dependency_includes()

View file

@ -1,4 +1,4 @@
set(TARGET_NAME mtc) set(TARGET_NAME mtc)
setup_hifi_project() setup_hifi_project()
link_shared_dependencies() include_dependency_includes()