Welcome to mirror list, hosted at ThFree Co, Russian Federation.

FindTBB.cmake « modules « cmake - github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 271015520022c635452a3bb2933371f0f6051df3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# This is a wrapper of FindTBB which prefers the config scripts if available in the system
# but only if building with dynamic dependencies. The config scripts potentially belong
# to TBB >= 2020 which is incompatible with OpenVDB in our static dependency bundle.
# This workaround is useful for package maintainers on Linux systems to use newer versions
# of intel TBB (renamed to oneTBB from version 2021 up).
set(_q "")
if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)
    set(_q QUIET)
endif()

# Not building the static dependencies
# Newer versions of TBB also discourage from using TBB as a static library
if (NOT SLIC3R_STATIC AND NOT 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)
        if (NOT ${CMAKE_FIND_PACKAGE_NAME}_FOUND)
            message(STATUS "Falling back to MODULE search for ${CMAKE_FIND_PACKAGE_NAME}...")
        else()
            message(STATUS "${CMAKE_FIND_PACKAGE_NAME} found in ${${CMAKE_FIND_PACKAGE_NAME}_DIR}")
        endif()
    endif()

endif ()

if (NOT ${CMAKE_FIND_PACKAGE_NAME}_FOUND)
    include(${CMAKE_CURRENT_LIST_DIR}/FindTBB.cmake.in)
endif ()