0028312: Configuration, genproj.tcl - support CSF_ZLIB and CSF_LIBLZMA within project...
authorkgv <kgv@opencascade.com>
Wed, 28 Dec 2016 16:10:24 +0000 (19:10 +0300)
committerapn <apn@opencascade.com>
Thu, 29 Dec 2016 15:36:25 +0000 (18:36 +0300)
Added CSF_ZLIB for searching zlib library, CSF_LIBLZMA for liblzma library
and CSF_FFmpeg for FFmpeg framework.
Unused CSF_AviLibs has been dropped.

adm/cmake/occt_csf.cmake
adm/genconf.tcl
adm/genconfdeps.tcl
adm/genproj.tcl
adm/templates/env.bat
adm/templates/env.sh
adm/templates/template.vc10
adm/templates/template.vc7
adm/templates/template.vc8
adm/templates/template.vc9
src/TKOpenGl/EXTERNLIB

index 315417a..e01957b 100644 (file)
@@ -34,7 +34,6 @@ if (WIN32)
   set (CSF_user32        "user32.lib")
   set (CSF_wsock32       "wsock32.lib")
   set (CSF_psapi         "Psapi.lib")
-  set (CSF_AviLibs       "ws2_32.lib vfw32.lib")
   if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore" OR USE_GLES2)
     set (CSF_OpenGlLibs  "libEGL.lib libGLESv2.lib")
   else()
index 802ed49..235625e 100644 (file)
@@ -140,8 +140,11 @@ proc wokdep:gui:UpdateList {} {
   if { "$::HAVE_FREEIMAGE" == "true" } {
     wokdep:SearchFreeImage anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
   }
+  if { "$::HAVE_FFMPEG" == "true" } {
+    wokdep:SearchFFmpeg  anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
+  }
   if { "$::HAVE_GL2PS" == "true" } {
-    wokdep:SearchGL2PS   anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
+    wokdep:SearchStandardLibrary  anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs "gl2ps" "gl2ps.h" "gl2ps" {"gl2ps"}
   }
   if { "$::HAVE_TBB" == "true" } {
     wokdep:SearchTBB     anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
@@ -152,6 +155,18 @@ proc wokdep:gui:UpdateList {} {
   if { "$::HAVE_VTK" == "true" } {
     wokdep:SearchVTK  anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
   }
+
+  if { "$::HAVE_ZLIB" == "true" } {
+    wokdep:SearchStandardLibrary  anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs "zlib" "zlib.h" "zlib" {"zlib"}
+  }
+  if { "$::HAVE_LIBLZMA" == "true" } {
+    set aCheckLib "lzma"
+    if { "$::tcl_platform(platform)" == "windows" } {
+      set aCheckLib "liblzma"
+    }
+    wokdep:SearchStandardLibrary  anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs "liblzma" "lzma.h" "$aCheckLib" {"lzma" "xz"}
+  }
+
   if { "$::CHECK_QT4" == "true" } {
     wokdep:SearchQt4     anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
   }
@@ -402,12 +417,20 @@ if { "$::tcl_platform(platform)" == "windows" } {
   checkbutton .myFrame.myChecks.myD3dCheck      -offvalue "false" -onvalue "true" -variable HAVE_D3D       -command wokdep:gui:UpdateList
   ttk::label  .myFrame.myChecks.myD3dLbl        -text "Use Direct3D"
 }
+checkbutton   .myFrame.myChecks.myFFmpegCheck   -offvalue "false" -onvalue "true" -variable HAVE_FFMPEG    -command wokdep:gui:UpdateList
+ttk::label    .myFrame.myChecks.myFFmpegLbl     -text "Use FFmpeg"
 #checkbutton   .myFrame.myChecks.myOpenClCheck   -offvalue "false" -onvalue "true" -variable HAVE_OPENCL    -command wokdep:gui:UpdateList
 #ttk::label    .myFrame.myChecks.myOpenClLbl     -text "Use OpenCL"
 checkbutton   .myFrame.myChecks.myMacGLXCheck   -offvalue "false" -onvalue "true" -variable MACOSX_USE_GLX
 ttk::label    .myFrame.myChecks.myMacGLXLbl     -text "Use X11 for windows drawing"
 ttk::label    .myFrame.myChecks.myVtkLbl        -text "Use VTK"
 checkbutton   .myFrame.myChecks.myVtkCheck      -offvalue "false" -onvalue "true" -variable HAVE_VTK       -command wokdep:gui:UpdateList
+
+checkbutton   .myFrame.myChecks.myZLibCheck     -offvalue "false" -onvalue "true" -variable HAVE_ZLIB      -command wokdep:gui:UpdateList
+ttk::label    .myFrame.myChecks.myZLibLbl       -text "Use zlib"
+checkbutton   .myFrame.myChecks.myLzmaCheck     -offvalue "false" -onvalue "true" -variable HAVE_LIBLZMA   -command wokdep:gui:UpdateList
+ttk::label    .myFrame.myChecks.myLzmaLbl       -text "Use liblzma"
+
 checkbutton   .myFrame.myChecks.myQt4Check      -offvalue "false" -onvalue "true" -variable CHECK_QT4      -command wokdep:gui:UpdateList
 ttk::label    .myFrame.myChecks.myQt4Lbl        -text "Search Qt4"
 checkbutton   .myFrame.myChecks.myJDKCheck      -offvalue "false" -onvalue "true" -variable CHECK_JDK      -command wokdep:gui:UpdateList
@@ -499,23 +522,33 @@ grid .myFrame.myChecks.myFImageCheck   -row $aCheckRowIter -column 0 -sticky e
 grid .myFrame.myChecks.myFImageLbl     -row $aCheckRowIter -column 1 -sticky w
 grid .myFrame.myChecks.myTbbCheck      -row $aCheckRowIter -column 2 -sticky e
 grid .myFrame.myChecks.myTbbLbl        -row $aCheckRowIter -column 3 -sticky w
-grid .myFrame.myChecks.myQt4Check      -row $aCheckRowIter -column 4 -sticky e
-grid .myFrame.myChecks.myQt4Lbl        -row $aCheckRowIter -column 5 -sticky w
-grid .myFrame.myChecks.myGlesCheck     -row $aCheckRowIter -column 6 -sticky e
-grid .myFrame.myChecks.myGlesLbl       -row $aCheckRowIter -column 7 -sticky w
+grid .myFrame.myChecks.myGlesCheck     -row $aCheckRowIter -column 4 -sticky e
+grid .myFrame.myChecks.myGlesLbl       -row $aCheckRowIter -column 5 -sticky w
 #grid .myFrame.myChecks.myOpenClCheck   -row $aCheckRowIter -column 6 -sticky e
 #grid .myFrame.myChecks.myOpenClLbl     -row $aCheckRowIter -column 7 -sticky w
+grid .myFrame.myChecks.myZLibCheck     -row $aCheckRowIter -column 6 -sticky e
+grid .myFrame.myChecks.myZLibLbl       -row $aCheckRowIter -column 7 -sticky w
+
+grid .myFrame.myChecks.myGl2psCheck    -row $aCheckRowIter -column 8 -sticky e
+grid .myFrame.myChecks.myGl2psLbl      -row $aCheckRowIter -column 9 -sticky w
+
+grid .myFrame.myChecks.myQt4Check      -row $aCheckRowIter -column 10 -sticky e
+grid .myFrame.myChecks.myQt4Lbl        -row $aCheckRowIter -column 11 -sticky w
+
 incr aCheckRowIter
-grid .myFrame.myChecks.myGl2psCheck    -row $aCheckRowIter -column 0 -sticky e
-grid .myFrame.myChecks.myGl2psLbl      -row $aCheckRowIter -column 1 -sticky w
+grid .myFrame.myChecks.myFFmpegCheck   -row $aCheckRowIter -column 0 -sticky e
+grid .myFrame.myChecks.myFFmpegLbl     -row $aCheckRowIter -column 1 -sticky w
 grid .myFrame.myChecks.myVtkCheck      -row $aCheckRowIter -column 2 -sticky e
 grid .myFrame.myChecks.myVtkLbl        -row $aCheckRowIter -column 3 -sticky w
-grid .myFrame.myChecks.myJDKCheck      -row $aCheckRowIter -column 4 -sticky e
-grid .myFrame.myChecks.myJDKLbl        -row $aCheckRowIter -column 5 -sticky w
 if { "$::tcl_platform(platform)" == "windows" } {
-  grid .myFrame.myChecks.myD3dCheck    -row $aCheckRowIter -column 6 -sticky e
-  grid .myFrame.myChecks.myD3dLbl      -row $aCheckRowIter -column 7 -sticky w
+  grid .myFrame.myChecks.myD3dCheck    -row $aCheckRowIter -column 4 -sticky e
+  grid .myFrame.myChecks.myD3dLbl      -row $aCheckRowIter -column 5 -sticky w
 }
+grid .myFrame.myChecks.myLzmaCheck     -row $aCheckRowIter -column 6 -sticky e
+grid .myFrame.myChecks.myLzmaLbl       -row $aCheckRowIter -column 7 -sticky w
+grid .myFrame.myChecks.myJDKCheck      -row $aCheckRowIter -column 10 -sticky e
+grid .myFrame.myChecks.myJDKLbl        -row $aCheckRowIter -column 11 -sticky w
+
 incr aCheckRowIter
 if { "$::tcl_platform(os)" == "Darwin" } {
   grid .myFrame.myChecks.myMacGLXCheck -row $aCheckRowIter -column 0 -sticky e
index d6f40f8..3f3766a 100644 (file)
@@ -43,16 +43,6 @@ if { "$tcl_platform(platform)" == "unix" } {
 
 set SHORTCUT_HEADERS "ShortCut"
 
-set HAVE_FREEIMAGE "false"
-set HAVE_GL2PS     "false"
-set HAVE_TBB       "false"
-set HAVE_D3D       "false"
-set HAVE_GLES2     "false"
-set HAVE_OPENCL    "false"
-set HAVE_VTK       "false"
-set MACOSX_USE_GLX "false"
-set CHECK_QT4      "false"
-set CHECK_JDK      "false"
 set PRODUCTS_PATH ""
 set CSF_OPT_INC   [list]
 set CSF_OPT_LIB32 [list]
@@ -66,51 +56,37 @@ if { "$tcl_platform(pointerSize)" == "4" } {
 if { [info exists ::env(ARCH)] } {
   set ARCH "$::env(ARCH)"
 }
-if { [info exists ::env(VCVER)] } {
-  set VCVER "$::env(VCVER)"
-}
-if { [info exists ::env(VCVARS)] } {
-  set VCVARS "$::env(VCVARS)"
-}
+
 if { [info exists ::env(SHORTCUT_HEADERS)] } {
   set SHORTCUT_HEADERS "$::env(SHORTCUT_HEADERS)"
   if { $SHORTCUT_HEADERS == "true" } {
     set SHORTCUT_HEADERS "ShortCut"
   }
 }
-if { [info exists ::env(HAVE_FREEIMAGE)] } {
-  set HAVE_FREEIMAGE "$::env(HAVE_FREEIMAGE)"
-}
-if { [info exists ::env(HAVE_GL2PS)] } {
-  set HAVE_GL2PS "$::env(HAVE_GL2PS)"
-}
-if { [info exists ::env(HAVE_TBB)] } {
-  set HAVE_TBB "$::env(HAVE_TBB)"
-}
-if { [info exists ::env(HAVE_D3D)] } {
-  set HAVE_D3D "$::env(HAVE_D3D)"
-}
-if { [info exists ::env(HAVE_GLES2)] } {
-  set HAVE_GLES2 "$::env(HAVE_GLES2)"
-}
-if { [info exists ::env(HAVE_OPENCL)] } {
-  set HAVE_OPENCL "$::env(HAVE_OPENCL)"
-}
-if { [info exists ::env(HAVE_VTK)] } {
-  set HAVE_VTK "$::env(HAVE_VTK)"
-}
-if { [info exists ::env(MACOSX_USE_GLX)] } {
-  set MACOSX_USE_GLX "$::env(MACOSX_USE_GLX)"
-}
-if { [info exists ::env(CHECK_QT4)] } {
-  set CHECK_QT4 "$::env(CHECK_QT4)"
+
+# fetch environment variables (e.g. set by custom.sh or custom.bat) and set them as tcl variables with the same name
+set THE_ENV_VARIABLES {HAVE_FREEIMAGE HAVE_FFMPEG HAVE_TBB HAVE_GLES2 HAVE_D3D HAVE_VTK HAVE_GL2PS HAVE_ZLIB HAVE_LIBLZMA HAVE_OPENCL CHECK_QT4 CHECK_JDK MACOSX_USE_GLX}
+foreach anEnvIter $THE_ENV_VARIABLES {
+  set ${anEnvIter} "false"
+  if { [info exists ::env(${anEnvIter})] } {
+    set ${anEnvIter} "$::env(${anEnvIter})"
+  }
 }
-if { [info exists ::env(CHECK_JDK)] } {
-  set CHECK_JDK "$::env(CHECK_JDK)"
+# do not export platform-specific variables
+if { "$::tcl_platform(os)" == "Darwin" } {
+  set HAVE_GLES2 ""
+} else {
+  set MACOSX_USE_GLX ""
+  if { "$tcl_platform(platform)" != "windows" } {
+    set HAVE_D3D ""
+  }
 }
-if { [info exists ::env(PRODUCTS_PATH)] } {
-  set PRODUCTS_PATH "$::env(PRODUCTS_PATH)"
+foreach anEnvIter {ARCH VCVER VCVARS PRODUCTS_PATH} {
+  if { [info exists ::env(${anEnvIter})] } {
+    set ${anEnvIter} "$::env(${anEnvIter})"
+  }
 }
+
 if { [info exists ::env(CSF_OPT_INC)] } {
   set CSF_OPT_INC [split "$::env(CSF_OPT_INC)" $::SYS_PATH_SPLITTER]
 }
@@ -252,6 +228,83 @@ proc wokdep:Preferred {theList theCmpl theArch} {
   return [lindex [lsort -decreasing $aVeryShortList] 0]
 }
 
+# Search library placement
+proc wokdep:SearchStandardLibrary {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64 theName theCheckHeader theCheckLib theCheckFolders} {
+  upvar $theErrInc   anErrInc
+  upvar $theErrLib32 anErrLib32
+  upvar $theErrLib64 anErrLib64
+  upvar $theErrBin32 anErrBin32
+  upvar $theErrBin64 anErrBin64
+
+  set isFound "true"
+  set aHeaderPath [wokdep:SearchHeader "$theCheckHeader"]
+  if { "$aHeaderPath"  == "" } {
+    set hasHeader false
+    foreach aFolderIter $theCheckFolders {
+      set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{$aFolderIter}*] "$::VCVER" "$::ARCH" ]
+      if { "$aPath" != "" && [file exists "$aPath/include/$theCheckHeader"] } {
+        lappend ::CSF_OPT_INC "$aPath/include"
+        set hasHeader true
+        break
+      }
+    }
+    if { !$hasHeader } {
+      lappend anErrInc "Error: '$theCheckHeader' not found ($theName)"
+      set isFound "false"
+    }
+  }
+
+  foreach anArchIter {64 32} {
+    set aLibPath [wokdep:SearchLib "$theCheckLib" "$anArchIter"]
+    if { "$aLibPath" == "" } {
+      set hasLib false
+      foreach aFolderIter $theCheckFolders {
+        set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{$aFolderIter}*] "$::VCVER" "$anArchIter" ]
+        set aLibPath [wokdep:SearchLib "$theCheckLib" "$anArchIter" "$aPath/lib"]
+        if { "$aLibPath" != "" } {
+          lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
+          lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
+          set hasLib true
+          break
+        }
+      }
+      if { !$hasLib } {
+        lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}$theCheckLib.${::SYS_LIB_SUFFIX}' not found ($theName)"
+        if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
+      }
+    }
+
+    if { "$::tcl_platform(platform)" == "windows" } {
+      set aDllPath [wokdep:SearchBin "$theCheckLib.dll" "$anArchIter"]
+      if { "$aDllPath" == "" } {
+        set hasDll false
+        foreach aFolderIter $theCheckFolders {
+          set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{$aFolderIter}*] "$::VCVER" "$anArchIter" ]
+          set aDllPath [wokdep:SearchBin "$theCheckLib.dll" "$anArchIter" "$aPath/bin"]
+          if { "$aDllPath" != "" } {
+            lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
+            set hasDll true
+            break
+          } else {
+            set aDllPath [wokdep:SearchBin "$theCheckLib.dll" "$anArchIter" "$aPath/lib"]
+            if { "$aDllPath" != "" } {
+              lappend ::CSF_OPT_BIN$anArchIter "$aPath/lib"
+              set hasDll true
+              break
+            }
+          }
+        }
+        if { !$hasDll } {
+          lappend anErrBin$anArchIter "Error: '$theCheckLib.dll' not found ($theName)"
+          if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
+        }
+      }
+    }
+  }
+
+  return "$isFound"
+}
+
 # Search Tcl/Tk libraries placement
 proc wokdep:SearchTclTk {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
   upvar $theErrInc   anErrInc
@@ -489,8 +542,8 @@ proc wokdep:SearchFreeImage {theErrInc theErrLib32 theErrLib64 theErrBin32 theEr
   return "$isFound"
 }
 
-# Search GL2PS library placement
-proc wokdep:SearchGL2PS {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
+# Search FFmpeg framework placement
+proc wokdep:SearchFFmpeg {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
   upvar $theErrInc   anErrInc
   upvar $theErrLib32 anErrLib32
   upvar $theErrLib64 anErrLib64
@@ -498,47 +551,30 @@ proc wokdep:SearchGL2PS {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin
   upvar $theErrBin64 anErrBin64
 
   set isFound "true"
-  set aGl2psHPath [wokdep:SearchHeader "gl2ps.h"]
-  if { "$aGl2psHPath"  == "" } {
-    set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{gl2ps}*] "$::VCVER" "$::ARCH" ]
-    if { "$aPath" != "" && [file exists "$aPath/include/gl2ps.h"] } {
+  set aFFmpegHPath [wokdep:SearchHeader "libavutil/avutil.h"]
+  if { "$aFFmpegHPath"  == "" } {
+    set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{ffmpeg}*] "$::VCVER" "$::ARCH" ]
+    if { "$aPath" != "" && [file exists "$aPath/include/libavutil/avutil.h"] } {
       lappend ::CSF_OPT_INC "$aPath/include"
     } else {
-      lappend anErrInc "Error: 'gl2ps.h' not found (GL2PS)"
+      lappend anErrInc "Error: 'libavutil/avutil.h' not found (FFmpeg)"
       set isFound "false"
     }
   }
 
   foreach anArchIter {64 32} {
-    set aGl2psLibPath [wokdep:SearchLib "gl2ps" "$anArchIter"]
-    if { "$aGl2psLibPath" == "" } {
-      set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{gl2ps}*] "$::VCVER" "$anArchIter" ]
-      set aGl2psLibPath [wokdep:SearchLib "gl2ps" "$anArchIter" "$aPath/lib"]
-      if { "$aGl2psLibPath" != "" } {
+    set aFFmpegLibPath [wokdep:SearchLib "avutil" "$anArchIter"]
+    if { "$aFFmpegLibPath" == "" } {
+      set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{ffmpeg}*] "$::VCVER" "$anArchIter" ]
+      set aFFmpegLibPath [wokdep:SearchLib "avutil" "$anArchIter" "$aPath/lib"]
+      if { "$aFFmpegLibPath" != "" } {
         lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
+        lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
       } else {
-        lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}gl2ps.${::SYS_LIB_SUFFIX}' not found (GL2PS)"
+        lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}avutil.${::SYS_LIB_SUFFIX}' not found (FFmpeg)"
         if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
       }
     }
-    if { "$::tcl_platform(platform)" == "windows" } {
-      set aGl2psDllPath [wokdep:SearchBin "gl2ps.dll" "$anArchIter"]
-      if { "$aGl2psDllPath" == "" } {
-        set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{gl2ps}*] "$::VCVER" "$anArchIter" ]
-        set aGl2psDllPath [wokdep:SearchBin "gl2ps.dll" "$anArchIter" "$aPath/bin"]
-        if { "$aGl2psDllPath" != "" } {
-          lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
-        } else {
-          set aGl2psDllPath [wokdep:SearchBin "gl2ps.dll" "$anArchIter" "$aPath/lib"]
-          if { "$aGl2psDllPath" != "" } {
-            lappend ::CSF_OPT_BIN$anArchIter "$aPath/lib"
-          } else {
-            lappend anErrBin$anArchIter "Error: 'gl2ps.dll' not found (GL2PS)"
-            if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
-          }
-        }
-      }
-    }
   }
 
   return "$isFound"
@@ -1075,15 +1111,13 @@ proc wokdep:SaveCustom {} {
 
     puts $aFile ""
     puts $aFile "rem Optional 3rd-parties switches"
-    puts $aFile "set HAVE_FREEIMAGE=$::HAVE_FREEIMAGE"
-    puts $aFile "set HAVE_GL2PS=$::HAVE_GL2PS"
-    puts $aFile "set HAVE_TBB=$::HAVE_TBB"
-    puts $aFile "set HAVE_GLES2=$::HAVE_GLES2"
-    puts $aFile "set HAVE_D3D=$::HAVE_D3D"
-    puts $aFile "set HAVE_OPENCL=$::HAVE_OPENCL"
-    puts $aFile "set HAVE_VTK=$::HAVE_VTK"
-    puts $aFile "set CHECK_QT4=$::CHECK_QT4"
-    puts $aFile "set CHECK_JDK=$::CHECK_JDK"
+    foreach anEnvIter $::THE_ENV_VARIABLES {
+      set aName ${anEnvIter}
+      set aValue [set ::${anEnvIter}]
+      if { "$aValue" != "" } {
+        puts $aFile "set ${aName}=$aValue"
+      }
+    }
 
     set aStringInc [join $::CSF_OPT_INC $::SYS_PATH_SPLITTER]
     puts $aFile ""
@@ -1126,17 +1160,13 @@ proc wokdep:SaveCustom {} {
 
     puts $aFile ""
     puts $aFile "# Optional 3rd-parties switches"
-    puts $aFile "export HAVE_FREEIMAGE=$::HAVE_FREEIMAGE"
-    puts $aFile "export HAVE_GL2PS=$::HAVE_GL2PS"
-    puts $aFile "export HAVE_TBB=$::HAVE_TBB"
-    puts $aFile "export HAVE_GLES2=$::HAVE_GLES2"
-    puts $aFile "export HAVE_OPENCL=$::HAVE_OPENCL"
-    puts $aFile "export HAVE_VTK=$::HAVE_VTK"
-    if { "$::tcl_platform(os)" == "Darwin" } {
-      puts $aFile "export MACOSX_USE_GLX=$::MACOSX_USE_GLX"
+    foreach anEnvIter $::THE_ENV_VARIABLES {
+      set aName ${anEnvIter}
+      set aValue [set ::${anEnvIter}]
+      if { "$aValue" != "" } {
+        puts $aFile "export ${aName}=${aValue}"
+      }
     }
-    puts $aFile "export CHECK_QT4=$::CHECK_QT4"
-    puts $aFile "export CHECK_JDK=$::CHECK_JDK"
 
     set aStringInc [join $::CSF_OPT_INC $::SYS_PATH_SPLITTER]
     puts $aFile ""
index 3a97b31..0e51974 100644 (file)
@@ -1275,6 +1275,9 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap } {
       set aLibsMap(CSF_FreeImagePlus) "freeimage"
     }
   }
+  if { "$::HAVE_FFMPEG" == "true" } {
+    set aLibsMap(CSF_FFmpeg) "avcodec avformat swscale avutil"
+  }
   if { "$::HAVE_GL2PS" == "true" } {
     set aLibsMap(CSF_GL2PS) "gl2ps"
   }
@@ -1288,6 +1291,12 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap } {
       set aLibsMap(CSF_VTK) [osutils:vtkCsf "unix"]
     }
   }
+  if { "$::HAVE_ZLIB" == "true" } {
+    set aLibsMap(CSF_ZLIB) "zlib"
+  }
+  if { "$::HAVE_LIBLZMA" == "true" } {
+    set aLibsMap(CSF_LIBLZMA) "liblzma"
+  }
 
   if { "$theOS" == "wnt" } {
     #  WinAPI libraries
@@ -1298,7 +1307,6 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap } {
     set aLibsMap(CSF_opengl32)     "opengl32"
     set aLibsMap(CSF_wsock32)      "wsock32"
     set aLibsMap(CSF_netapi32)     "netapi32"
-    set aLibsMap(CSF_AviLibs)      "ws2_32 vfw32"
     set aLibsMap(CSF_OpenGlLibs)   "opengl32"
     if { "$::HAVE_GLES2" == "true" } {
       set aLibsMap(CSF_OpenGlLibs) "libEGL libGLESv2"
index a841314..ac7a4a6 100644 (file)
@@ -18,10 +18,13 @@ set "VCVARS="
 set "HAVE_TBB=false"
 set "HAVE_OPENCL=false"
 set "HAVE_FREEIMAGE=false"
+set "HAVE_FFMPEG=false"
 set "HAVE_GL2PS=false"
 set "HAVE_VTK=false"
 set "HAVE_GLES2=false"
 set "HAVE_D3D=false"
+set "HAVE_ZLIB=false"
+set "HAVE_LIBLZMA=false"
 set "CSF_OPT_INC="
 set "CSF_OPT_LIB32="
 set "CSF_OPT_LIB64="
@@ -58,20 +61,16 @@ set "CSF_OPT_BIN64I=%CSF_OPT_BIN64%"
 rem ----- Optional 3rd-parties should be enabled by HAVE macros -----
 set "CSF_OPT_CMPL="
 set "PRODUCTS_DEFINES="
-if ["%HAVE_TBB%"]       == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_TBB"
-if ["%HAVE_OPENCL%"]    == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_OPENCL"
-if ["%HAVE_GL2PS%"]     == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_GL2PS"
-if ["%HAVE_FREEIMAGE%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_FREEIMAGE"
-if ["%HAVE_VTK%"]       == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_VTK"
-if ["%HAVE_GLES2%"]     == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_GLES2"
-if ["%HAVE_D3D%"]       == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_D3D"
-if ["%HAVE_TBB%"]       == ["true"] set "CSF_DEFINES=HAVE_TBB;%CSF_DEFINES%"
-if ["%HAVE_OPENCL%"]    == ["true"] set "CSF_DEFINES=HAVE_OPENCL;%CSF_DEFINES%"
-if ["%HAVE_GL2PS%"]     == ["true"] set "CSF_DEFINES=HAVE_GL2PS;%CSF_DEFINES%"
-if ["%HAVE_FREEIMAGE%"] == ["true"] set "CSF_DEFINES=HAVE_FREEIMAGE;%CSF_DEFINES%"
-if ["%HAVE_VTK%"]       == ["true"] set "CSF_DEFINES=HAVE_VTK;%CSF_DEFINES%"
-if ["%HAVE_GLES2%"]     == ["true"] set "CSF_DEFINES=HAVE_GLES2;%CSF_DEFINES%"
-if ["%HAVE_D3D%"]       == ["true"] set "CSF_DEFINES=HAVE_D3D;%CSF_DEFINES%"
+if ["%HAVE_TBB%"]       == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_TBB"       & set "CSF_DEFINES=HAVE_TBB;%CSF_DEFINES%"
+if ["%HAVE_OPENCL%"]    == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_OPENCL"    & set "CSF_DEFINES=HAVE_OPENCL;%CSF_DEFINES%"
+if ["%HAVE_GL2PS%"]     == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_GL2PS"     & set "CSF_DEFINES=HAVE_GL2PS;%CSF_DEFINES%"
+if ["%HAVE_FREEIMAGE%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_FREEIMAGE" & set "CSF_DEFINES=HAVE_FREEIMAGE;%CSF_DEFINES%"
+if ["%HAVE_FFMPEG%"]    == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_FFMPEG"    & set "CSF_DEFINES=HAVE_FFMPEG;%CSF_DEFINES%"
+if ["%HAVE_VTK%"]       == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_VTK"       & set "CSF_DEFINES=HAVE_VTK;%CSF_DEFINES%"
+if ["%HAVE_GLES2%"]     == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_GLES2"     & set "CSF_DEFINES=HAVE_GLES2;%CSF_DEFINES%"
+if ["%HAVE_D3D%"]       == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_D3D"       & set "CSF_DEFINES=HAVE_D3D;%CSF_DEFINES%"
+if ["%HAVE_ZLIB%"]      == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_ZLIB"      & set "CSF_DEFINES=HAVE_ZLIB;%CSF_DEFINES%"
+if ["%HAVE_LIBLZMA%"]   == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_LIBLZMA"   & set "CSF_DEFINES=HAVE_LIBLZMA;%CSF_DEFINES%"
 
 rem Eliminate VS warning
 if ["%CSF_DEFINES%"]  == [""] set "CSF_DEFINES=;"
index 4298dec..fc9c360 100644 (file)
@@ -10,9 +10,12 @@ export TARGET="";
 export HAVE_TBB="false";
 export HAVE_OPENCL="false";
 export HAVE_FREEIMAGE="false";
+export HAVE_FFMPEG="false";
 export HAVE_GL2PS="false";
 export HAVE_VTK="false";
 export HAVE_GLES2="false";
+export HAVE_ZLIB="false";
+export HAVE_LIBLZMA="false";
 export MACOSX_USE_GLX="false";
 export CSF_OPT_INC=""
 export CSF_OPT_LIB32=""
@@ -91,28 +94,17 @@ fi
 export CSF_OPT_CMPL=""
 
 # Optiona 3rd-parties should be enabled by HAVE macros
-if [ "$HAVE_TBB" == "true" ]; then
-  export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_TBB"
-fi
-if [ "$HAVE_OPENCL" == "true" ]; then
-  export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_OPENCL"
-fi
-if [ "$HAVE_FREEIMAGE" == "true" ]; then
-  export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_FREEIMAGE"
-fi
-if [ "$HAVE_GL2PS" == "true" ]; then
-  export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_GL2PS"
-fi
-if [ "$HAVE_GLES2" == "true" ]; then
-  export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_GLES2"
-fi
-if [ "$HAVE_VTK" == "true" ]; then
-  export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_VTK"
-fi
+if [ "$HAVE_TBB"       == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_TBB"; fi
+if [ "$HAVE_OPENCL"    == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_OPENCL"; fi
+if [ "$HAVE_FREEIMAGE" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_FREEIMAGE"; fi
+if [ "$HAVE_FFMPEG"    == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_FFMPEG"; fi
+if [ "$HAVE_GL2PS"     == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_GL2PS"; fi
+if [ "$HAVE_GLES2"     == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_GLES2"; fi
+if [ "$HAVE_VTK"       == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_VTK"; fi
+if [ "$HAVE_ZLIB"      == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_ZLIB"; fi
+if [ "$HAVE_LIBLZMA"   == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_LIBLZMA"; fi
 # Option to compile OCCT with X11 libs on Mac OS X
-if [ "$MACOSX_USE_GLX" == "true" ]; then
-  export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DMACOSX_USE_GLX"
-fi
+if [ "$MACOSX_USE_GLX" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DMACOSX_USE_GLX"; fi
 
 # To split string into array
 aDelimBack=$IFS
index 9c14b9c..2b007aa 100644 (file)
       <PreprocessorDefinitions>NDEBUG;No_Exception;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ResourceCompile>
     <Link>
-      <AdditionalDependencies>__TKDEP__;ws2_32.lib;vfw32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>__TKDEP__;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>.\..\..\..\win32\__VCVER__\bin\__TKNAM__.dll</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <AdditionalLibraryDirectories>..\..\..\win32\__VCVER__\lib;$(CSF_OPT_LIB32);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <PreprocessorDefinitions>_DEBUG;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ResourceCompile>
     <Link>
-      <AdditionalDependencies>__TKDEP__;ws2_32.lib;vfw32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>__TKDEP__;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>.\..\..\..\win32\__VCVER__\bind\__TKNAM__.dll</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <AdditionalLibraryDirectories>..\..\..\win32\__VCVER__\libd;$(CSF_OPT_LIB32D);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <PreprocessorDefinitions>NDEBUG;No_Exception;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ResourceCompile>
     <Link>
-      <AdditionalDependencies>__TKDEP__;ws2_32.lib;vfw32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>__TKDEP__;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>.\..\..\..\win64\__VCVER__\bin\__TKNAM__.dll</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <AdditionalLibraryDirectories>..\..\..\win64\__VCVER__\lib;$(CSF_OPT_LIB64);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <PreprocessorDefinitions>_DEBUG;$(CSF_DEFINES)__TKDEFS__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ResourceCompile>
     <Link>
-      <AdditionalDependencies>__TKDEP__;ws2_32.lib;vfw32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>__TKDEP__;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>.\..\..\..\win64\__VCVER__\bind\__TKNAM__.dll</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <AdditionalLibraryDirectories>..\..\..\win64\__VCVER__\libd;$(CSF_OPT_LIB64D);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
index cde2c13..87f2c89 100644 (file)
@@ -36,7 +36,7 @@
                                Name="VCCustomBuildTool"/>
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="__TKDEP__ opengl32.lib ws2_32.lib vfw32.lib odbc32.lib odbccp32.lib"
+                               AdditionalDependencies="__TKDEP__ opengl32.lib ws2_32.lib odbc32.lib odbccp32.lib"
                                OutputFile=".\..\..\..\win32\vc7\bin\__TKNAM__.dll"
                                LinkIncremental="1"
                                SuppressStartupBanner="TRUE"
                                Name="VCCustomBuildTool"/>
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="__TKDEP__ opengl32.lib ws2_32.lib vfw32.lib odbc32.lib odbccp32.lib"
+                               AdditionalDependencies="__TKDEP__ opengl32.lib ws2_32.lib odbc32.lib odbccp32.lib"
                                OutputFile=".\..\..\..\win32\vc7\bind\__TKNAM__.dll"
                                LinkIncremental="1"
                                SuppressStartupBanner="TRUE"
index 448a5d2..1346382 100644 (file)
@@ -78,7 +78,7 @@
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="__TKDEP__ opengl32.lib ws2_32.lib vfw32.lib odbc32.lib odbccp32.lib"
+                               AdditionalDependencies="__TKDEP__ opengl32.lib ws2_32.lib odbc32.lib odbccp32.lib"
                                OutputFile=".\..\..\..\win32\vc8\bin\__TKNAM__.dll"
                                LinkIncremental="1"
                                SuppressStartupBanner="true"
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="__TKDEP__ opengl32.lib ws2_32.lib vfw32.lib odbc32.lib odbccp32.lib"
+                               AdditionalDependencies="__TKDEP__ opengl32.lib ws2_32.lib odbc32.lib odbccp32.lib"
                                OutputFile=".\..\..\..\win32\vc8\bind\__TKNAM__.dll"
                                LinkIncremental="1"
                                SuppressStartupBanner="true"
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="__TKDEP__ opengl32.lib ws2_32.lib vfw32.lib odbc32.lib odbccp32.lib"
+                               AdditionalDependencies="__TKDEP__ opengl32.lib ws2_32.lib odbc32.lib odbccp32.lib"
                                OutputFile=".\..\..\..\win64\vc8\bin\__TKNAM__.dll"
                                LinkIncremental="1"
                                SuppressStartupBanner="true"
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="__TKDEP__ opengl32.lib ws2_32.lib vfw32.lib odbc32.lib odbccp32.lib"
+                               AdditionalDependencies="__TKDEP__ opengl32.lib ws2_32.lib odbc32.lib odbccp32.lib"
                                OutputFile=".\..\..\..\win64\vc8\bind\__TKNAM__.dll"
                                LinkIncremental="1"
                                SuppressStartupBanner="true"
index a0e1351..8dc5ba5 100644 (file)
@@ -79,7 +79,7 @@
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="__TKDEP__ ws2_32.lib vfw32.lib"
+                               AdditionalDependencies="__TKDEP__ ws2_32.lib"
                                OutputFile=".\..\..\..\win32\vc9\bin\__TKNAM__.dll"
                                LinkIncremental="1"
                                SuppressStartupBanner="true"
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="__TKDEP__ ws2_32.lib vfw32.lib"
+                               AdditionalDependencies="__TKDEP__ ws2_32.lib"
                                OutputFile=".\..\..\..\win32\vc9\bind\__TKNAM__.dll"
                                LinkIncremental="1"
                                SuppressStartupBanner="true"
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="__TKDEP__ ws2_32.lib vfw32.lib"
+                               AdditionalDependencies="__TKDEP__ ws2_32.lib"
                                OutputFile=".\..\..\..\win64\vc9\bin\__TKNAM__.dll"
                                LinkIncremental="1"
                                SuppressStartupBanner="true"
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="__TKDEP__ ws2_32.lib vfw32.lib"
+                               AdditionalDependencies="__TKDEP__ ws2_32.lib"
                                OutputFile=".\..\..\..\win64\vc9\bind\__TKNAM__.dll"
                                LinkIncremental="1"
                                SuppressStartupBanner="true"
index 6247595..7808f17 100755 (executable)
@@ -11,5 +11,4 @@ CSF_FREETYPE
 CSF_GL2PS
 CSF_user32
 CSF_gdi32
-CSF_AviLibs
 CSF_TBB