Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / thirdparty / mkl-dnn / cmake / TBB.cmake
1 #===============================================================================
2 # Copyright 2018 Intel Corporation
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #===============================================================================
16
17 # Manage TBB-related compiler flags
18 #===============================================================================
19
20 if(TBB_cmake_included)
21     return()
22 endif()
23 set(TBB_cmake_included true)
24 include("cmake/Threading.cmake")
25
26 if(NOT MKLDNN_THREADING STREQUAL "TBB")
27     return()
28 endif()
29
30 if (NOT TBBROOT)
31     if(DEFINED ENV{TBBROOT})
32         set (TBBROOT $ENV{TBBROOT})
33     else()
34         message("FATAL_ERROR" "TBBROOT is unset")
35     endif()
36 endif()
37
38 if(WIN32)
39     find_package(TBB REQUIRED tbb HINTS cmake/win)
40 elseif(APPLE)
41     find_package(TBB REQUIRED tbb HINTS cmake/mac)
42 elseif(UNIX)
43     find_package(TBB REQUIRED tbb HINTS cmake/lnx)
44 endif()
45
46 set_threading("TBB")
47 list(APPEND EXTRA_SHARED_LIBS ${TBB_IMPORTED_TARGETS})
48
49 message(STATUS "Intel(R) TBB: ${TBBROOT}")