|
|
|
@ -2,6 +2,9 @@ cmake_minimum_required(VERSION 3.9) |
|
|
|
|
|
|
|
|
|
find_package(OpenCV REQUIRED COMPONENTS opencv_core) |
|
|
|
|
|
|
|
|
|
if(NOT OPENCV_EXAMPLES_SKIP_PARALLEL_BACKEND_OPENMP |
|
|
|
|
AND NOT OPENCV_EXAMPLES_SKIP_OPENMP |
|
|
|
|
) |
|
|
|
|
find_package(OpenMP) |
|
|
|
|
if(OpenMP_FOUND) |
|
|
|
|
project(opencv_example_openmp_backend) |
|
|
|
@ -11,11 +14,18 @@ if(OpenMP_FOUND) |
|
|
|
|
OpenMP::OpenMP_CXX |
|
|
|
|
) |
|
|
|
|
endif() |
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
# TODO: find_package(TBB) |
|
|
|
|
if(NOT OPENCV_EXAMPLES_SKIP_PARALLEL_BACKEND_TBB |
|
|
|
|
AND NOT OPENCV_EXAMPLES_SKIP_TBB |
|
|
|
|
AND NOT OPENCV_EXAMPLE_SKIP_TBB # deprecated (to be removed in OpenCV 5.0) |
|
|
|
|
) |
|
|
|
|
find_package(TBB) |
|
|
|
|
if(NOT TBB_FOUND) |
|
|
|
|
find_path(TBB_INCLUDE_DIR NAMES "tbb/tbb.h") |
|
|
|
|
find_library(TBB_LIBRARY NAMES "tbb") |
|
|
|
|
if(TBB_INCLUDE_DIR AND TBB_LIBRARY AND NOT OPENCV_EXAMPLE_SKIP_TBB) |
|
|
|
|
endif() |
|
|
|
|
if(TBB_INCLUDE_DIR AND TBB_LIBRARY) |
|
|
|
|
project(opencv_example_tbb_backend) |
|
|
|
|
add_executable(opencv_example_tbb_backend example-tbb.cpp) |
|
|
|
|
target_include_directories(opencv_example_tbb_backend SYSTEM PRIVATE ${TBB_INCLUDE_DIR}) |
|
|
|
@ -24,3 +34,4 @@ if(TBB_INCLUDE_DIR AND TBB_LIBRARY AND NOT OPENCV_EXAMPLE_SKIP_TBB) |
|
|
|
|
${TBB_LIBRARY} |
|
|
|
|
) |
|
|
|
|
endif() |
|
|
|
|
endif() |
|
|
|
|