Support OneTBB in CMake file

This commit is contained in:
Stephen Hurd 2021-12-25 14:04:06 -05:00 committed by supermerill
parent 498c9add66
commit bee8247cb2

View File

@ -195,7 +195,11 @@ if(NOT TBB_FOUND)
##################################
if(TBB_INCLUDE_DIRS)
file(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _tbb_version_file)
if (EXISTS "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h")
file(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _tbb_version_file)
else()
file(READ "${TBB_INCLUDE_DIRS}/tbb/version.h" _tbb_version_file)
endif()
string(REGEX REPLACE ".*#define TBB_VERSION_MAJOR ([0-9]+).*" "\\1"
TBB_VERSION_MAJOR "${_tbb_version_file}")
string(REGEX REPLACE ".*#define TBB_VERSION_MINOR ([0-9]+).*" "\\1"