Skip to content

Commit da71394

Browse files
committed
0033612: Configuration - Build configuration may fail to detect TBB
Fixed TBB type to depends on package
1 parent 2736652 commit da71394

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

adm/cmake/tbb.cmake

+11-3
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,17 @@ if (WIN32)
5656
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_INCLUDE_DIR)
5757
endif()
5858

59+
# Get installed configuration of tbb
60+
get_target_property (TARGET_TBB_IMPORT_CONFS TBB::tbb IMPORTED_CONFIGURATIONS)
61+
list (GET TARGET_TBB_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
62+
5963
separate_arguments (CSF_TBB)
6064
foreach (LIB IN LISTS CSF_TBB)
6165
string(TOLOWER "${LIB}" LIB_LOWER)
6266
string(TOUPPER "${LIB}" LIB_UPPER)
6367

6468
# Achive *.lib files and directory containing it.
65-
get_target_property (TBB_LIB_FILE "TBB::${LIB_LOWER}" IMPORTED_IMPLIB_RELEASE)
69+
get_target_property (TBB_LIB_FILE "TBB::${LIB_LOWER}" IMPORTED_IMPLIB_${CHOSEN_IMPORT_CONF})
6670
# Reserve cache variable for *.lib.
6771
if (NOT DEFINED 3RDPARTY_${LIB_UPPER}_LIBRARY)
6872
set (3RDPARTY_${LIB_UPPER}_LIBRARY "" CACHE FILEPATH "${LIB_UPPER} library (*.lib)")
@@ -89,7 +93,7 @@ if (WIN32)
8993
endif()
9094

9195
# Achive *.dll files and directory containing it.
92-
get_target_property (TBB_DLL_FILE "TBB::${LIB_LOWER}" IMPORTED_LOCATION_RELEASE)
96+
get_target_property (TBB_DLL_FILE "TBB::${LIB_LOWER}" IMPORTED_LOCATION_${CHOSEN_IMPORT_CONF})
9397
# Reserve cache variable for *.dll.
9498
if (NOT DEFINED 3RDPARTY_${LIB_UPPER}_DLL)
9599
set (3RDPARTY_${LIB_UPPER}_DLL "" CACHE FILEPATH "${LIB_UPPER} library (*.dll)")
@@ -185,13 +189,17 @@ else ()
185189
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_INCLUDE_DIR)
186190
endif()
187191

192+
# Get installed configuration of tbb
193+
get_target_property (TARGET_TBB_IMPORT_CONFS TBB::tbb IMPORTED_CONFIGURATIONS)
194+
list (GET TARGET_TBB_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
195+
188196
separate_arguments (CSF_TBB)
189197
foreach (LIB IN LISTS CSF_TBB)
190198
string(TOLOWER "${LIB}" LIB_LOWER)
191199
string(TOUPPER "${LIB}" LIB_UPPER)
192200

193201
# Achive *.so files and directory containing it.
194-
get_target_property (TBB_SO_FILE "TBB::${LIB_LOWER}" IMPORTED_LOCATION_RELEASE)
202+
get_target_property (TBB_SO_FILE "TBB::${LIB_LOWER}" IMPORTED_LOCATION_${CHOSEN_IMPORT_CONF})
195203
# Reserve cache variable for *.so.
196204
if (NOT DEFINED 3RDPARTY_${LIB_UPPER}_LIBRARY)
197205
set (3RDPARTY_${LIB_UPPER}_LIBRARY "" CACHE FILEPATH "${LIB_UPPER} library (*.so)")

0 commit comments

Comments
 (0)