Skip to content

Commit b935f4d

Browse files
committed
Merge pull request #5732 from janetournois/Polyhedron_demo-fix_cmakelists_find_tbb-jtournois
FindTBB.cmake: only search TBB in Config mode if version >= 2019 update 5
2 parents 5cbadbe + 321e829 commit b935f4d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Installation/cmake/modules/FindTBB.cmake

+10-2
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,20 @@ endmacro()
188188
#=============================================================================
189189
# Now to actually find TBB
190190
#
191+
#start with looking for TBB_DIR and TBB_ROOT
192+
if((TBB_ROOT OR ENV{TBB_ROOT} OR ENV{TBB_DIR} ) AND NOT TBB_FOUND)
193+
find_package(TBB QUIET NO_MODULE NO_CMAKE_SYSTEM_PATH NO_SYSTEM_ENVIRONMENT_PATH)
194+
endif()
195+
if(TBB_FOUND)
196+
return()
197+
endif()#TBB_FOUND
191198

192-
#start with CONFIG Mode
193-
find_package(TBB QUIET NO_MODULE)
199+
#try CONFIG Mode
200+
find_package(TBB 2019.0.11005 QUIET NO_MODULE)
194201
if(TBB_FOUND)
195202
return()
196203
endif()#TBB_FOUND
204+
197205
# Get path, convert backslashes as ${ENV_${var}}
198206
getenv_path(TBB_ROOT)
199207

0 commit comments

Comments
 (0)