Skip to content

Commit

Permalink
Turn TBB into publicly linked library
Browse files Browse the repository at this point in the history
  • Loading branch information
dbs4261 committed Oct 2, 2024
1 parent 23ce717 commit 86a474d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions 3rdparty/find_dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1568,7 +1568,7 @@ if(OPEN3D_USE_ONEAPI_PACKAGES)
PACKAGE TBB
TARGETS TBB::tbb
)
list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM Open3D::3rdparty_tbb)
list(APPEND Open3D_3RDPARTY_PUBLIC_TARGETS_FROM_SYSTEM Open3D::3rdparty_tbb)

else(OPEN3D_USE_ONEAPI_PACKAGES)
# MKL/BLAS
Expand Down Expand Up @@ -1687,7 +1687,7 @@ else(OPEN3D_USE_ONEAPI_PACKAGES)
INCLUDE_DIRS ${STATIC_MKL_INCLUDE_DIR}
LIB_DIR ${STATIC_MKL_LIB_DIR}
LIBRARIES ${STATIC_MKL_LIBRARIES}
DEPENDS ext_tbb ext_mkl_include ext_mkl
DEPENDS Open3D::3rdparty_tbb ext_mkl_include ext_mkl
)
if(UNIX)
target_compile_options(3rdparty_blas INTERFACE "$<$<COMPILE_LANGUAGE:CXX>:-m64>")
Expand All @@ -1709,9 +1709,13 @@ else(OPEN3D_USE_ONEAPI_PACKAGES)
endif()
if(NOT USE_SYSTEM_TBB)
include(${Open3D_3RDPARTY_DIR}/mkl/tbb.cmake)
list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_CUSTOM TBB::tbb)
add_library(3rdparty_tbb INTERFACE)
add_library(Open3D::3rdparty_tbb ALIAS 3rdparty_tbb)
target_link_libraries(3rdparty_tbb INTERFACE TBB::tbb)
install(TARGETS 3rdparty_tbb EXPORT ${PROJECT_NAME}Targets)
list(APPEND Open3D_3RDPARTY_PUBLIC_TARGETS_FROM_CUSTOM Open3D::3rdparty_tbb)
else()
list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM Open3D::3rdparty_tbb)
list(APPEND Open3D_3RDPARTY_PUBLIC_TARGETS_FROM_SYSTEM Open3D::3rdparty_tbb)
endif()

endif(OPEN3D_USE_ONEAPI_PACKAGES)
Expand Down

0 comments on commit 86a474d

Please sign in to comment.