Skip to content

Commit 74620b3

Browse files
committed
Download a pre-built tbb
1 parent e46ba54 commit 74620b3

File tree

1 file changed

+34
-7
lines changed

1 file changed

+34
-7
lines changed

CMakeLists.txt

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,40 @@ endif()
133133
set(TBB_TEST
134134
OFF
135135
CACHE BOOL "Disable TBB tests" FORCE)
136-
FetchContent_Declare(
137-
tbb
138-
GIT_REPOSITORY https://github.com/uxlfoundation/oneTBB
139-
GIT_TAG v2022.3.0)
140-
FetchContent_GetProperties(tbb)
141-
if(NOT tbb_POPULATED)
142-
FetchContent_MakeAvailable(tbb)
136+
137+
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
138+
FetchContent_Declare(
139+
tbb
140+
URL https://github.com/uxlfoundation/oneTBB/releases/download/v2022.3.0/oneapi-tbb-2022.3.0-lin.tgz
141+
DOWNLOAD_EXTRACT_TIMESTAMP true)
142+
FetchContent_GetProperties(tbb)
143+
if(NOT tbb_POPULATED)
144+
FetchContent_Populate(tbb)
145+
set(TBB_DIR ${tbb_SOURCE_DIR}/lib/cmake/tbb)
146+
find_package(TBB REQUIRED)
147+
endif()
148+
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
149+
FetchContent_Declare(
150+
tbb
151+
URL https://github.com/uxlfoundation/oneTBB/releases/download/v2022.3.0/oneapi-tbb-2022.3.0-mac.tgz
152+
DOWNLOAD_EXTRACT_TIMESTAMP true)
153+
FetchContent_GetProperties(tbb)
154+
if(NOT tbb_POPULATED)
155+
FetchContent_Populate(tbb)
156+
set(TBB_DIR ${tbb_SOURCE_DIR}/lib/cmake/tbb)
157+
find_package(TBB REQUIRED)
158+
endif()
159+
elseif(WIN32)
160+
FetchContent_Declare(
161+
tbb
162+
URL https://github.com/uxlfoundation/oneTBB/releases/download/v2022.3.0/oneapi-tbb-2022.3.0-win.tgz
163+
DOWNLOAD_EXTRACT_TIMESTAMP true)
164+
FetchContent_GetProperties(tbb)
165+
if(NOT tbb_POPULATED)
166+
FetchContent_Populate(tbb)
167+
set(TBB_DIR ${tbb_SOURCE_DIR}/lib/cmake/tbb)
168+
find_package(TBB REQUIRED)
169+
endif()
143170
endif()
144171

145172
add_library(dsf STATIC ${SOURCES})

0 commit comments

Comments
 (0)