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
This commit is contained in:
Laurent Rineau 2021-06-02 17:18:44 +02:00
commit 9e7d8abd8a
1 changed files with 11 additions and 3 deletions

View File

@ -188,12 +188,20 @@ endmacro()
#=============================================================================
# Now to actually find TBB
#
#start with CONFIG Mode
find_package(TBB QUIET NO_MODULE)
#start with looking for TBB_DIR and TBB_ROOT
if((TBB_ROOT OR ENV{TBB_ROOT} OR ENV{TBB_DIR} ) AND NOT TBB_FOUND)
find_package(TBB QUIET NO_MODULE NO_CMAKE_SYSTEM_PATH NO_SYSTEM_ENVIRONMENT_PATH)
endif()
if(TBB_FOUND)
return()
endif()#TBB_FOUND
#try CONFIG Mode
find_package(TBB 2019.0.11005 QUIET NO_MODULE)
if(TBB_FOUND)
return()
endif()#TBB_FOUND
# Get path, convert backslashes as ${ENV_${var}}
getenv_path(TBB_ROOT)