Skip to content

Commit fcff767

Browse files
committed
cmake(tbb): fix target_compile_definitions() with "UNKNOWN" target
- https://gitlab.kitware.com/cmake/cmake/-/issues/19434
1 parent eced4dd commit fcff767

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cmake/OpenCVDetectTBB.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ function(ocv_tbb_env_guess _found)
8585
if(NOT (TBB_INTERFACE_VERSION LESS 12000)) # >= 12000, oneTBB 2021+
8686
# avoid "defaultlib" requirement of tbb12.lib (we are using absolute path to 'tbb.lib' only)
8787
# https://github.com/oneapi-src/oneTBB/blame/2dba2072869a189b9fdab3ffa431d3ea49059a19/include/oneapi/tbb/detail/_config.h#L334
88-
target_compile_definitions(tbb INTERFACE "__TBB_NO_IMPLICIT_LINKAGE=1")
88+
if(NOT (CMAKE_VERSION VERSION_LESS "3.16.0")) # https://gitlab.kitware.com/cmake/cmake/-/issues/19434
89+
target_compile_definitions(tbb INTERFACE "__TBB_NO_IMPLICIT_LINKAGE=1")
90+
else()
91+
set_target_properties(tbb PROPERTIES INTERFACE_COMPILE_OPTIONS "__TBB_NO_IMPLICIT_LINKAGE=1")
92+
endif()
8993
endif()
9094
message(STATUS "Found TBB (env): ${TBB_ENV_LIB}")
9195
set(${_found} TRUE PARENT_SCOPE)

0 commit comments

Comments
 (0)