From 37b91dc2c6eef2fe45229e5969d59daae02564e8 Mon Sep 17 00:00:00 2001 From: Tzu-Mao Li Date: Mon, 8 Jan 2024 12:33:37 -0800 Subject: [PATCH] link to TBB in cmake --- CMakeLists.txt | 2 +- cmake/FindEmbree.cmake | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 913ca36..af55c0b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/cmake/FindEmbree.cmake b/cmake/FindEmbree.cmake index f9c9f7a..4f23fff 100644 --- a/cmake/FindEmbree.cmake +++ b/cmake/FindEmbree.cmake @@ -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 () \ No newline at end of file