]> OCCT Git - occt.git/commitdiff
0032399: Configuration - correct search of VTK bin path by genconf
authorosa <osa@opencascade.com>
Thu, 27 May 2021 15:15:36 +0000 (18:15 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 27 May 2021 18:09:36 +0000 (21:09 +0300)
adm/genconfdeps.tcl

index b53f900cd4daaec824088da317621b814833f215..644a18948b5354ae63cb576204d1cf43030813dc 100644 (file)
@@ -1044,36 +1044,45 @@ proc wokdep:SearchVTK {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64
         }
       }
     }
-  }
   
     # Search binary path
     if { "$::tcl_platform(platform)" == "windows" } {
-      foreach anArchIter {64 32} {
-        set aVtkBinPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter"]
-        if { "$aVtkBinPath" == "" } {
-          set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{VTK}*] "$::VCVER" "$anArchIter" ]
-          set aVtkBinPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$aPath/bin"]
-          if { "$aVtkBinPath" != "" } { lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
-          } else {
-            set aVtkBinPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$aPath/lib"]
-            if { "$aVtkBinPath" != "" } { lappend ::CSF_OPT_BIN$anArchIter "$aPath/lib" } 
-          }
-        }
-      }
-      
-      # We didn't find preferred binary path => search through inc path or among all available VTK directories
+      set aVtkBinPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter"]
       if { "$aVtkBinPath" == "" } {
-        # Try to find in lib path
-        set aPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$aVtkLibPath/bin"]
-        if { "$aPath" != "" } { lappend ::CSF_OPT_BIN$anArchIter "$aVtkLibPath/bin"
-        } elseif { [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$aVtkLibPath/lib"] != "" } {
-          lappend ::CSF_OPT_BIN$anArchIter "$aVtkLibPath/lib"
+        set aPathList [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{VTK}*]
+        set aPath [wokdep:Preferred $aPathList "$::VCVER" "$anArchIter" ]
+        set aVtkBinPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$aPath/bin"]
+        if { "$aVtkBinPath" != "" } {
+          lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
         } else {
-           lappend anErrBin$anArchIter "Error: 'vtkCommonCore-${aVtkVer}.dll' not found (VTK)"
-           set isFound "false"
+          # Try to find in lib path
+          set aVtkBinPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$aPath/lib"]
+          if { "$aVtkBinPath" != "" } {
+            lappend ::CSF_OPT_BIN$anArchIter "$aPath/lib"
+          } else {
+            # We didn't find preferred binary path => search through all available VTK directories
+            foreach anIt $aPathList {
+              set aVtkBinPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$anIt/bin"]
+              if { "$aVtkBinPath" != "" } {
+                lappend ::CSF_OPT_BIN$anArchIter "$anIt/bin"
+                break
+              } else {
+                # Try to find in lib path
+                set aVtkBinPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$anIt/lib"]
+                if { "$aVtkBinPath" != "" } {
+                  lappend ::CSF_OPT_BIN$anArchIter "$anIt/lib"
+                }
+              }
+            }
+            if { "$aVtkBinPath" == "" } {
+              lappend anErrBin$anArchIter "Error: 'vtkCommonCore-${aVtkVer}.dll' not found (VTK)"
+              set isFound "false"
+            }
+          }
         }
       }
     }
+  }
 
   return "$isFound"
 }