Fix FindEmbree.cmake

When EMBREE_INCLUDE_DIR was cached, it ended up wrongly assuming it
was Embree 4.
This commit is contained in:
Xavier Hallade 2023-04-05 15:33:14 +02:00
parent 8f0829f2a0
commit d17b1da572
1 changed files with 3 additions and 9 deletions

View File

@ -24,23 +24,17 @@ SET(_embree_SEARCH_DIRS
FIND_PATH(EMBREE_INCLUDE_DIR
NAMES
embree4/rtcore.h
embree3/rtcore.h
HINTS
${_embree_SEARCH_DIRS}
PATH_SUFFIXES
include
)
IF(EMBREE_INCLUDE_DIR)
IF(EXISTS ${EMBREE_INCLUDE_DIR}/embree4/rtcore_config.h)
SET(EMBREE_MAJOR_VERSION 4)
ELSE()
SET(EMBREE_MAJOR_VERSION 3)
FIND_PATH(EMBREE_INCLUDE_DIR
NAMES
embree3/rtcore.h
HINTS
${_embree_SEARCH_DIRS}
PATH_SUFFIXES
include
)
ENDIF()
IF(EMBREE_INCLUDE_DIR)