]> OCCT Git - occt.git/commitdiff
0033612: Configuration - Build configuration may fail to detect TBB
authordpasukhi <dpasukhi@opencascade.com>
Sun, 25 Aug 2024 08:35:49 +0000 (08:35 +0000)
committerdpasukhi <dpasukhi@opencascade.com>
Sun, 25 Aug 2024 08:35:49 +0000 (08:35 +0000)
Fixed TBB type to depends on package

adm/cmake/tbb.cmake

index 4e5f724ac23725ec9074d0f6b01e7f857c804630..fae9905ecf0c5b4599809c834681415608c3bb39 100644 (file)
@@ -56,13 +56,17 @@ if (WIN32)
       list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_INCLUDE_DIR)
     endif()
 
+    # Get installed configuration of tbb
+    get_target_property (TARGET_TBB_IMPORT_CONFS TBB::tbb IMPORTED_CONFIGURATIONS)
+    list (GET TARGET_TBB_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
+
     separate_arguments (CSF_TBB)
     foreach (LIB IN LISTS CSF_TBB)
       string(TOLOWER "${LIB}" LIB_LOWER)
       string(TOUPPER "${LIB}" LIB_UPPER)
 
       # Achive *.lib files and directory containing it.
-      get_target_property (TBB_LIB_FILE "TBB::${LIB_LOWER}" IMPORTED_IMPLIB_RELEASE)
+      get_target_property (TBB_LIB_FILE "TBB::${LIB_LOWER}" IMPORTED_IMPLIB_${CHOSEN_IMPORT_CONF})
       # Reserve cache variable for *.lib.
       if (NOT DEFINED 3RDPARTY_${LIB_UPPER}_LIBRARY)
         set (3RDPARTY_${LIB_UPPER}_LIBRARY "" CACHE FILEPATH "${LIB_UPPER} library (*.lib)")
@@ -89,7 +93,7 @@ if (WIN32)
       endif()
 
       # Achive *.dll files and directory containing it.
-      get_target_property (TBB_DLL_FILE "TBB::${LIB_LOWER}" IMPORTED_LOCATION_RELEASE)
+      get_target_property (TBB_DLL_FILE "TBB::${LIB_LOWER}" IMPORTED_LOCATION_${CHOSEN_IMPORT_CONF})
       # Reserve cache variable for *.dll.
       if (NOT DEFINED 3RDPARTY_${LIB_UPPER}_DLL)
         set (3RDPARTY_${LIB_UPPER}_DLL "" CACHE FILEPATH "${LIB_UPPER} library (*.dll)")
@@ -185,13 +189,17 @@ else ()
     list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_INCLUDE_DIR)
   endif()
 
+  # Get installed configuration of tbb
+  get_target_property (TARGET_TBB_IMPORT_CONFS TBB::tbb IMPORTED_CONFIGURATIONS)
+  list (GET TARGET_TBB_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
+
   separate_arguments (CSF_TBB)
   foreach (LIB IN LISTS CSF_TBB)
     string(TOLOWER "${LIB}" LIB_LOWER)
     string(TOUPPER "${LIB}" LIB_UPPER)
 
     # Achive *.so files and directory containing it.
-    get_target_property (TBB_SO_FILE "TBB::${LIB_LOWER}" IMPORTED_LOCATION_RELEASE)
+    get_target_property (TBB_SO_FILE "TBB::${LIB_LOWER}" IMPORTED_LOCATION_${CHOSEN_IMPORT_CONF})
     # Reserve cache variable for *.so.
     if (NOT DEFINED 3RDPARTY_${LIB_UPPER}_LIBRARY)
       set (3RDPARTY_${LIB_UPPER}_LIBRARY "" CACHE FILEPATH "${LIB_UPPER} library (*.so)")