Skip to content
Open
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
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ option(NO_PTEX "Disable Ptex example viewers" OFF)
option(NO_DOC "Disable documentation build" OFF)
option(NO_OMP "Disable OpenMP backend" OFF)
option(NO_TBB "Disable TBB backend" OFF)
option(REQUIRE_TBB "Make TBB mandatory" OFF)
option(NO_CUDA "Disable CUDA backend" OFF)
option(NO_OPENCL "Disable OpenCL backend" OFF)
option(NO_CLEW "Disable CLEW wrapper library" OFF)
Expand Down Expand Up @@ -366,7 +367,16 @@ if(NOT NO_OMP)
find_package(OpenMP)
endif()
if(NOT NO_TBB)
find_package(TBB 2018 COMPONENTS tbb)
# Prefer the TBB CMake config if available
find_package(TBB COMPONENTS tbb CONFIG)
if (NOT TBB_FOUND)
# Fallback to FindTBB.cmake
if (REQUIRE_TBB)
find_package(TBB 2018 COMPONENTS tbb REQUIRED)
else()
find_package(TBB 2018 COMPONENTS tbb)
endif()
endif()
endif()
if (NOT NO_OPENGL)
find_package(OpenGL)
Expand Down
Loading