mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-16 22:26:01 +08:00
Fix FindTBB version detection with TBB >= 2021.1.1
Copied from 941ea13475
This commit is contained in:
parent
d6d5939b28
commit
10ce4c862a
@ -455,10 +455,23 @@ findpkg_finish(TBB_MALLOC_PROXY tbbmalloc_proxy)
|
|||||||
#=============================================================================
|
#=============================================================================
|
||||||
#parse all the version numbers from tbb
|
#parse all the version numbers from tbb
|
||||||
if(NOT TBB_VERSION)
|
if(NOT TBB_VERSION)
|
||||||
|
set(TBB_VERSION_FILE_PRIOR_TO_TBB_2021_1
|
||||||
|
"${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h")
|
||||||
|
set(TBB_VERSION_FILE_AFTER_TBB_2021_1
|
||||||
|
"${TBB_INCLUDE_DIR}/oneapi/tbb/version.h")
|
||||||
|
|
||||||
|
if (EXISTS "${TBB_VERSION_FILE_PRIOR_TO_TBB_2021_1}")
|
||||||
|
set(TBB_VERSION_FILE "${TBB_VERSION_FILE_PRIOR_TO_TBB_2021_1}")
|
||||||
|
elseif (EXISTS "${TBB_VERSION_FILE_AFTER_TBB_2021_1}")
|
||||||
|
set(TBB_VERSION_FILE "${TBB_VERSION_FILE_AFTER_TBB_2021_1}")
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Found TBB installation: ${TBB_INCLUDE_DIR} "
|
||||||
|
"missing version header.")
|
||||||
|
endif()
|
||||||
|
|
||||||
#only read the start of the file
|
#only read the start of the file
|
||||||
file(STRINGS
|
file(STRINGS
|
||||||
"${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h"
|
"${TBB_VERSION_FILE}"
|
||||||
TBB_VERSION_CONTENTS
|
TBB_VERSION_CONTENTS
|
||||||
REGEX "VERSION")
|
REGEX "VERSION")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user