Home

Awesome

FindTBB Module

FindTBB is a CMake find package module for Intel® Threading Building Blocks (TBB).

Usage

The signature of the TBB find module in CMake is:

find_package(TBB [major[.minor]] [EXACT] [QUIET] [REQUIRED]
             [COMPONENTS [tbbmalloc] [tbbmalloc_proxy] [tbb_preview]]
             [OPTIONAL_COMPONENTS [tbbmalloc] [tbbmalloc_proxy] [tbb_preview]]) 

where the allowed components are tbbmalloc and tbb_preview.

Example Project

With CMake 3.0 and later

cmake_minimum_required(VERSION 3.0)
project(MyProject)

list(APPEND CMAKE_MODULE_PATH "<path to FindTBB module>")

find_package(TBB COMPONENTS tbbmalloc tbbmalloc_proxy tbb_preview)

add_executable(myapp myapp.cc)
target_link_libraries(myapp tbb)

With CMake 2.8 and earlier

cmake_minimum_required(VERSION 2.8)
project(MyProject)

list(APPEND CMAKE_MODULE_PATH "<path to FindTBB module>")

find_package(TBB COMPONENTS tbbmalloc tbbmalloc_proxy tbb_preview)

add_executable(myapp myapp)
target_include_directories(myapp PRIVATE ${TBB_INCLUDE_DIRS})
target_compile_definitions(myapp PRIVATE ${TBB_DEFINITIONS})
target_link_libraries(myapp ${TBB_LIBRARIES})

User Variables

The following varibiles may be used by the user to specify the install, include, and/or library directories of TBB.

In addition, FindTBB uses the following environment variables to find the TBB install directory.

FindTBB Results

This module will set the following variables:

Output Variables

The following varibles should be used to link executables and libraries with TBB: