Browse Source

Fix the missing link dependencies for tbb on Linux

tamasmeszaros 5 years ago
parent
commit
a7c843d213
1 changed files with 5 additions and 0 deletions
  1. 5 0
      cmake/modules/FindTBB.cmake

+ 5 - 0
cmake/modules/FindTBB.cmake

@@ -290,6 +290,11 @@ if(NOT TBB_FOUND)
           IMPORTED_LOCATION_MINSIZEREL     ${TBB_LIBRARIES_RELEASE}
           )
     endif()
+
+    if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+       find_package(Threads QUIET REQUIRED)
+       set_target_properties(TBB::tbb PROPERTIES INTERFACE_LINK_LIBRARIES "${CMAKE_DL_LIBS};Threads::Threads")
+    endif()
   endif()
 
   mark_as_advanced(TBB_INCLUDE_DIRS TBB_LIBRARIES)