Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions 3rdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
add_subdirectory(googletest)

set(DNNL_CPU_RUNTIME "TBB" CACHE STRING "oneDNN CPU threading runtime")

add_subdirectory(oneDNN)

# Unified TBB Configuration
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ enable_testing()

include_directories("include")

list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

add_subdirectory(3rdparty)

include(cmake/opencv_config.cmake)
Expand Down
27 changes: 27 additions & 0 deletions cmake/FindTBB.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Lightweight FindTBB to reuse vendored TBB target from this project

if(TARGET TBB::tbb)
set(_vendor_tbb_include "${CMAKE_SOURCE_DIR}/3rdparty/TBB/include")
if(EXISTS "${_vendor_tbb_include}/oneapi/tbb/version.h")
# TBB::tbb is an ALIAS; set properties on the real target 'tbb'
if(TARGET tbb)
set_target_properties(tbb PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${_vendor_tbb_include}")
endif()
endif()
set(TBB_FOUND TRUE)
# Provide minimal compatibility variables
set(TBB_IMPORTED_TARGETS TBB::tbb)
mark_as_advanced(TBB_FOUND)
unset(_vendor_tbb_include)
return()
endif()

# Create an imported INTERFACE target that links to our vendored TBB build target
add_library(TBB::tbb INTERFACE IMPORTED)
set_target_properties(TBB::tbb PROPERTIES
INTERFACE_LINK_LIBRARIES tbb
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/3rdparty/TBB/include"
)
set(TBB_FOUND TRUE)
set(TBB_IMPORTED_TARGETS TBB::tbb)
Loading