vcpkg/ports/tbb/CMakeLists.txt
tarcila 84bafa656b tbb: Fix compilation on OSX (#8744)
* tbb: Fix compilation on OSX

Make sure CMake detected sysroot is correctly forwarded to TBB build
system so system headers files will be found later on.

* tbb: Version bump
2019-11-01 13:46:49 -07:00

26 lines
875 B
CMake

project(tbb CXX)
file(GLOB SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*)
file(COPY ${SOURCES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/src)
include(${CMAKE_CURRENT_BINARY_DIR}/src/cmake/TBBBuild.cmake REQUIRED)
if(NOT BUILD_SHARED_LIBS)
set(TBB_STATIC_INCLUDE extra_inc=big_iron.inc)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(FORWARD_SDK_ROOT "SDKROOT=${CMAKE_OSX_SYSROOT}")
endif()
tbb_build(TBB_ROOT ${CMAKE_CURRENT_BINARY_DIR}/src MAKE_ARGS ${TBB_STATIC_INCLUDE} ${FORWARD_SDK_ROOT})
set(SUBDIR ${CMAKE_CURRENT_BINARY_DIR}/tbb_cmake_build/tbb_cmake_build_subdir)
if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(SUBDIR "${SUBDIR}_release")
else()
set(SUBDIR "${SUBDIR}_debug")
endif()
file(GLOB OUTPUTS ${SUBDIR}/*.so.* ${SUBDIR}/*.so ${SUBDIR}/*.a ${SUBDIR}/*.dylib ${SUBDIR}/*.dylib.*)
install(FILES ${OUTPUTS} DESTINATION lib)