FindTBB.cmake 1012 B

123456789101112131415161718192021222324
  1. # This is a wrapper of FindTBB which prefers the config scripts if available in the system
  2. # but only if building with dynamic dependencies. The config scripts potentially belong
  3. # to TBB >= 2020 which is incompatible with OpenVDB in our static dependency bundle.
  4. # This workaround is useful for package maintainers on Linux systems to use newer versions
  5. # of intel TBB (renamed to oneTBB from version 2021 up).
  6. set(_q "")
  7. if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)
  8. set(_q QUIET)
  9. endif()
  10. find_package(${CMAKE_FIND_PACKAGE_NAME} ${${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION} CONFIG ${_q})
  11. if(NOT ${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)
  12. if (NOT ${CMAKE_FIND_PACKAGE_NAME}_FOUND)
  13. message(STATUS "Falling back to MODULE search for ${CMAKE_FIND_PACKAGE_NAME}...")
  14. else()
  15. message(STATUS "${CMAKE_FIND_PACKAGE_NAME} found in ${${CMAKE_FIND_PACKAGE_NAME}_DIR}")
  16. endif()
  17. endif()
  18. if (NOT ${CMAKE_FIND_PACKAGE_NAME}_FOUND)
  19. include(${CMAKE_CURRENT_LIST_DIR}/FindTBB.cmake.in)
  20. endif ()