From 08f88f09da1453f8e3c46627b1c71ffb2a5f1563 Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Mon, 13 Dec 2021 16:46:11 +0100 Subject: [PATCH] Fix error in previous commit --- cmake/modules/FindTBB.cmake | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmake/modules/FindTBB.cmake b/cmake/modules/FindTBB.cmake index 271015520..6aa89e312 100644 --- a/cmake/modules/FindTBB.cmake +++ b/cmake/modules/FindTBB.cmake @@ -8,9 +8,11 @@ if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY) set(_q QUIET) endif() -# Not building the static dependencies +# Only consider the config scripts if not building with the static dependencies +# and this call is not made from a static dependency build (e.g. dep_OpenVDB will use this module) +# BUILD_SHARED_LIBS will always be defined for dependency projects and will be OFF. # Newer versions of TBB also discourage from using TBB as a static library -if (NOT SLIC3R_STATIC AND NOT BUILD_SHARED_LIBS) +if (NOT SLIC3R_STATIC AND (NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS)) find_package(${CMAKE_FIND_PACKAGE_NAME} ${${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION} CONFIG ${_q}) if(NOT ${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY) @@ -25,4 +27,4 @@ endif () if (NOT ${CMAKE_FIND_PACKAGE_NAME}_FOUND) include(${CMAKE_CURRENT_LIST_DIR}/FindTBB.cmake.in) -endif () \ No newline at end of file +endif ()