2023-08-16 00:20:26 +10:00
|
|
|
# SPDX-FileCopyrightText: 2016 Blender Authors
|
2023-06-14 22:49:59 +10:00
|
|
|
#
|
2022-02-11 14:23:56 +11:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
|
|
2016-01-27 11:26:26 +00:00
|
|
|
# - Find TBB library
|
|
|
|
|
# Find the native TBB includes and library
|
|
|
|
|
# This module defines
|
|
|
|
|
# TBB_INCLUDE_DIRS, where to find tbb.h, Set when
|
|
|
|
|
# TBB is found.
|
|
|
|
|
# TBB_LIBRARIES, libraries to link against to use TBB.
|
|
|
|
|
# TBB_ROOT_DIR, The base directory to search for TBB.
|
|
|
|
|
# This can also be an environment variable.
|
|
|
|
|
# TBB_FOUND, If false, do not try to use TBB.
|
|
|
|
|
#
|
|
|
|
|
# also defined, but not for general use are
|
|
|
|
|
# TBB_LIBRARY, where to find the TBB library.
|
|
|
|
|
|
2023-07-29 13:47:55 +10:00
|
|
|
# If `TBB_ROOT_DIR` was defined in the environment, use it.
|
2023-08-17 13:15:56 +10:00
|
|
|
if(DEFINED TBB_ROOT_DIR)
|
2023-07-29 13:47:55 +10:00
|
|
|
# Pass.
|
2023-08-17 13:15:56 +10:00
|
|
|
elseif(DEFINED ENV{TBB_ROOT_DIR})
|
|
|
|
|
set(TBB_ROOT_DIR $ENV{TBB_ROOT_DIR})
|
|
|
|
|
else()
|
|
|
|
|
set(TBB_ROOT_DIR "")
|
|
|
|
|
endif()
|
2016-01-27 11:26:26 +00:00
|
|
|
|
2023-08-17 13:15:56 +10:00
|
|
|
set(_tbb_SEARCH_DIRS
|
2016-01-27 11:26:26 +00:00
|
|
|
${TBB_ROOT_DIR}
|
|
|
|
|
/opt/lib/tbb
|
|
|
|
|
)
|
|
|
|
|
|
2023-08-17 13:15:56 +10:00
|
|
|
find_path(TBB_INCLUDE_DIR
|
2016-01-27 11:26:26 +00:00
|
|
|
NAMES
|
|
|
|
|
tbb/tbb.h
|
|
|
|
|
HINTS
|
|
|
|
|
${_tbb_SEARCH_DIRS}
|
|
|
|
|
PATH_SUFFIXES
|
|
|
|
|
include
|
|
|
|
|
)
|
|
|
|
|
|
2023-08-17 13:15:56 +10:00
|
|
|
find_library(TBB_LIBRARY
|
2016-01-27 11:26:26 +00:00
|
|
|
NAMES
|
|
|
|
|
tbb
|
|
|
|
|
HINTS
|
|
|
|
|
${_tbb_SEARCH_DIRS}
|
|
|
|
|
PATH_SUFFIXES
|
|
|
|
|
lib64 lib
|
2025-01-03 13:23:38 +11:00
|
|
|
)
|
2016-01-27 11:26:26 +00:00
|
|
|
|
|
|
|
|
# handle the QUIETLY and REQUIRED arguments and set TBB_FOUND to TRUE if
|
|
|
|
|
# all listed variables are TRUE
|
2023-08-17 13:15:56 +10:00
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
|
find_package_handle_standard_args(TBB DEFAULT_MSG
|
2025-01-03 13:23:38 +11:00
|
|
|
TBB_LIBRARY TBB_INCLUDE_DIR)
|
2016-01-27 11:26:26 +00:00
|
|
|
|
2023-08-17 13:15:56 +10:00
|
|
|
if(TBB_FOUND)
|
|
|
|
|
set(TBB_LIBRARIES ${TBB_LIBRARY})
|
|
|
|
|
set(TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR})
|
|
|
|
|
else()
|
|
|
|
|
set(TBB_TBB_FOUND FALSE)
|
|
|
|
|
endif()
|
2016-01-27 11:26:26 +00:00
|
|
|
|
2023-08-17 13:15:56 +10:00
|
|
|
mark_as_advanced(
|
2016-01-27 11:26:26 +00:00
|
|
|
TBB_INCLUDE_DIR
|
|
|
|
|
TBB_LIBRARY
|
|
|
|
|
)
|
2024-03-08 10:53:03 +11:00
|
|
|
|
|
|
|
|
unset(_tbb_SEARCH_DIRS)
|