Find TBB if USE_TBB is not set

This commit is contained in:
Tom Lin 2022-07-27 00:16:29 +01:00
parent f5513cd69e
commit 5197a4e561

View File

@ -27,11 +27,12 @@ macro(setup)
if(ONE_TBB_DIR) if(ONE_TBB_DIR)
set(TBB_ROOT "${ONE_TBB_DIR}") # see https://github.com/Kitware/VTK/blob/0a31a9a3c1531ae238ac96a372fec4be42282863/CMake/FindTBB.cmake#L34 set(TBB_ROOT "${ONE_TBB_DIR}") # see https://github.com/Kitware/VTK/blob/0a31a9a3c1531ae238ac96a372fec4be42282863/CMake/FindTBB.cmake#L34
# docs on Intel's website refers to TBB_DIR which is not correct # docs on Intel's website refers to TBB_DIR which is not correct
endif()
if (NOT USE_TBB)
# Only find TBB when we're not building in-tree
find_package(TBB REQUIRED) find_package(TBB REQUIRED)
endif() endif()
# No need to handle USE_TBB as both ONE_TBB_DIR and USE_TBB will create the TBB::tbb target
# see https://github.com/oneapi-src/oneTBB/blob/master/cmake/README.md#tbbconfig---integration-of-binary-packages # see https://github.com/oneapi-src/oneTBB/blob/master/cmake/README.md#tbbconfig---integration-of-binary-packages
register_link_library(TBB::tbb) register_link_library(TBB::tbb)
register_definitions(PARTITIONER_${PARTITIONER}) register_definitions(PARTITIONER_${PARTITIONER})