Skip to content
Snippets Groups Projects
Commit ce61237b authored by Hadrien Grasland's avatar Hadrien Grasland Committed by MarkusFrankATcernch
Browse files

Use TBB_IMPORTED_TARGETS for TBB CMake configuration

Ever since TBB has started providing built-in CMake support in 2017 U7,
TBB_IMPORTED_TARGETS has been the only supported way to link to TBB
using CMake. In particular, the official TBB CMake files do not export
TBB_INCLUDE_DIR and TBB_LIBRARY variables.

See https://github.com/intel/tbb/blob/tbb_2020/cmake/README.rst for
more details about TBB's official CMake support.
parent 2e60f0dc
No related branches found
No related tags found
No related merge requests found
......@@ -34,12 +34,10 @@ target_include_directories(DDDigi
FIND_PACKAGE(TBB QUIET)
if(TBB_FOUND)
dd4hep_print( "|++> TBB_INCLUDE_DIR --> ${TBB_INCLUDE_DIR}")
dd4hep_print( "|++> TBB_LIBRARY --> ${TBB_LIBRARY}")
dd4hep_print( "|++> TBB_IMPORTED_TARGETS --> ${TBB_IMPORTED_TARGETS}")
dd4hep_print( "|++> TBB found. DDDigi will run multi threaded.")
target_compile_definitions(DDDigi PUBLIC DD4HEP_USE_TBB)
target_link_libraries(DDDigi ${TBB_LIBRARY})
target_include_directories(DDDigi ${TBB_INCLUDE_DIRS})
target_link_libraries(DDDigi PUBLIC ${TBB_IMPORTED_TARGETS})
else()
dd4hep_print( "|++> TBB not found. DDDigi will only work single threaded.")
endif()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment