add TBB as external_project, handle on OS X

This commit is contained in:
Stephen Birarda 2015-02-18 13:24:59 -08:00
parent 84e82f045d
commit 0a01a6f566
3 changed files with 46 additions and 3 deletions

View file

@ -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 openssl tbb
brew install cmake openssl
brew install highfidelity/formulas/qt5
brew link qt5 --force

41
cmake/externals/tbb/CMakeLists.txt vendored Normal file
View file

@ -0,0 +1,41 @@
set(EXTERNAL_NAME tbb)
if (APPLE)
set(DOWNLOAD_URL https://www.threadingbuildingblocks.org/sites/default/files/software_releases/mac/tbb43_20150209oss_osx.tgz)
elseif (WIN32)
elseif (UNIX)
elseif (ANDROID)
endif ()
include(ExternalProject)
ExternalProject_Add(
${EXTERNAL_NAME}
PREFIX ${EXTERNAL_NAME}
URL ${DOWNLOAD_URL}
BUILD_COMMAND ""
CONFIGURE_COMMAND ""
INSTALL_COMMAND ""
UPDATE_COMMAND ""
LOG_DOWNLOAD ON
)
ExternalProject_Get_Property(${EXTERNAL_NAME} SOURCE_DIR)
string(TOUPPER ${EXTERNAL_NAME} EXTERNAL_NAME_UPPER)
set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/include CACHE TYPE "List of tbb include directories")
if (APPLE)
set(${EXTERNAL_NAME_UPPER}_LIBRARY_DEBUG ${SOURCE_DIR}/lib/libc++/libtbb_debug.dylib CACHE TYPE "TBB debug library location")
set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${SOURCE_DIR}/lib/libc++/libtbb.dylib CACHE TYPE "TBB release library location")
set(${EXTERNAL_NAME_UPPER}_MALLOC_LIBRARY_DEBUG ${SOURCE_DIR}/lib/libc++/libtbbmalloc_debug.dylib CACHE TYPE "TBB malloc debug library location")
set(${EXTERNAL_NAME_UPPER}_MALLOC_LIBRARY_RELEASE ${SOURCE_DIR}/lib/libc++/libtbbmalloc.dylib CACHE TYPE "TBB malloc release library location")
elseif (WIN32)
# set(${EXTERNAL_NAME_UPPER}_LIBRARIES ${INSTALL_DIR}/lib/soxr.lib CACHE TYPE "List of soxr libraries")
# set(${EXTERNAL_NAME_UPPER}_DLL_PATH ${INSTALL_DIR}/bin CACHE TYPE "Path to soxr dll")
else ()
# set(${EXTERNAL_NAME_UPPER}_LIBRARIES ${INSTALL_DIR}/lib/libsoxr.so CACHE TYPE "List of soxr libraries")
endif ()

View file

@ -10,6 +10,8 @@ if (WIN32)
target_link_libraries(${TARGET_NAME} ws2_32.lib)
endif ()
add_dependency_external_projects(tbb)
# find required dependencies
find_package(OpenSSL REQUIRED)
find_package(TBB REQUIRED)
@ -25,8 +27,8 @@ include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}")
# append OpenSSL to our list of libraries to link
target_link_libraries(${TARGET_NAME} ${OPENSSL_LIBRARIES} ${TBB_LIBRARIES})
# append libcuckoo includes to our list of includes to bubble
list(APPEND ${TARGET_NAME}_DEPENDENCY_INCLUDES "${TBB_INCLUDE_DIRS}")
# append tbb includes to our list of includes to bubble
target_include_directories(${TARGET_NAME} PUBLIC ${TBB_INCLUDE_DIRS})
# call macro to include our dependency includes and bubble them up via a property on our target
include_dependency_includes()