Skip to content

Commit

Permalink
link to TBB in cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
BachiLi committed Jan 8, 2024
1 parent a4f599c commit 37b91dc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ endif()

find_package(Embree REQUIRED)
include_directories(${EMBREE_INCLUDE_PATH})
link_libraries(${EMBREE_LIBRARY})
link_libraries(${EMBREE_LIBRARY} ${TBB_LIBRARY})

include_directories(${CMAKE_SOURCE_DIR}/src)

Expand Down
14 changes: 13 additions & 1 deletion cmake/FindEmbree.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,29 @@ find_library(EMBREE_LIBRARY NAMES embree4 PATHS
/usr/lib
/usr/local/lib
/opt/local/lib)
find_library(TBB_LIBRARY NAMES tbb PATHS
${CMAKE_SOURCE_DIR}/embree/lib-macos
/usr/lib
/usr/local/lib
/opt/local/lib)
elseif (WIN32)
find_library(EMBREE_LIBRARY NAMES embree4 PATHS
${CMAKE_SOURCE_DIR}/embree/lib-win32)
else ()
find_library(TBB_LIBRARY NAMES tbb PATHS
${CMAKE_SOURCE_DIR}/embree/lib-win32)
find_library(EMBREE_LIBRARY NAMES embree4 PATHS
${CMAKE_SOURCE_DIR}/embree/lib-linux
/usr/lib
/usr/local/lib
/opt/local/lib)
find_library(TBB_LIBRARY NAMES tbb PATHS
${CMAKE_SOURCE_DIR}/embree/lib-linux
/usr/lib
/usr/local/lib
/opt/local/lib)
endif ()

if (EMBREE_INCLUDE_PATH AND EMBREE_LIBRARY)
if (EMBREE_INCLUDE_PATH AND EMBREE_LIBRARY AND TBB_LIBRARY)
set(EMBREE_FOUND TRUE)
endif ()

0 comments on commit 37b91dc

Please sign in to comment.