619e78cb650848fdebb679f2e789a7b1af00b0d9
[occt.git] / adm / genconf.tcl
1 #!/usr/bin/tclsh
2
3 # =======================================================================
4 # Created on: 2012-01-26
5 # Created by: Kirill GAVRILOV
6 # Copyright (c) 2012 OPEN CASCADE SAS
7 #
8 # This file is part of Open CASCADE Technology software library.
9 #
10 # This library is free software; you can redistribute it and/or modify it under
11 # the terms of the GNU Lesser General Public License version 2.1 as published
12 # by the Free Software Foundation, with special exception defined in the file
13 # OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
14 # distribution for complete text of the license and disclaimer of any warranty.
15 #
16 # Alternatively, this file may be used under the terms of Open CASCADE
17 # commercial license or contractual agreement.
18
19 # =======================================================================
20 # GUI procedure for search of third-party tools and generation of environment
21 # customization script
22 # =======================================================================
23
24 # load tools
25 source [file join [file dirname [info script]] genconfdeps.tcl]
26
27 package require Tk
28
29 set aRowIter 0
30 set aCheckRowIter 0
31 frame .myFrame -padx 5 -pady 5
32 pack  .myFrame -fill both -expand 1
33 frame .myFrame.myPrjFrame
34 frame .myFrame.myVsFrame
35 frame .myFrame.myHxxChecks
36 frame .myFrame.myChecks
37
38 # project file format
39 set SYS_PRJFMT_LIST {}
40 set SYS_PRJNAME_LIST {}
41 if { "$::tcl_platform(platform)" == "windows" } {
42   lappend ::SYS_PRJFMT_LIST "vcxproj"
43   lappend ::SYS_PRJNAME_LIST "Visual Studio (.vcxproj)"
44 }
45 if { "$tcl_platform(os)" == "Darwin" } {
46   lappend ::SYS_PRJFMT_LIST "xcd"
47   lappend ::SYS_PRJNAME_LIST "XCode (.xcd)"
48 }
49 lappend ::SYS_PRJFMT_LIST "cbp"
50 lappend ::SYS_PRJNAME_LIST "Code Blocks (.cbp)"
51 lappend ::SYS_PRJFMT_LIST "pro"
52 lappend ::SYS_PRJNAME_LIST "Qt Creator (.pro)"
53
54 set aPrjIndex [lsearch $::SYS_PRJFMT_LIST $::PRJFMT]
55 set ::PRJNAME [lindex $::SYS_PRJNAME_LIST $aPrjIndex]
56
57 set SYS_VS_LIST {}
58 set SYS_VC_LIST {}
59 set SYS_VCVARS_LIST {}
60
61 # detect installed Visual Studio 2017 instances by running vswhere.exe
62 if { ! [catch {exec vswhere.exe -version "\[15.0,15.99\]" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath} res] } {
63   lappend ::SYS_VS_LIST "Visual Studio 2017 (15, toolset v141)"
64   lappend ::SYS_VC_LIST "vc141"
65   lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
66 }
67 if { ! [catch {exec vswhere.exe -version "\[15.0,15.99\]" -latest -requires Microsoft.VisualStudio.Workload.Universal -property installationPath} res] } {
68   lappend ::SYS_VS_LIST "Visual Studio 2017 (15, toolset v141) UWP"
69   lappend ::SYS_VC_LIST "vc141-uwp"
70   lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
71 }
72
73 # detect installed Visual Studio instances from global environment
74 if { [info exists ::env(VS140COMNTOOLS)] } {
75   lappend ::SYS_VS_LIST "Visual Studio 2015 (14, toolset v140)"
76   lappend ::SYS_VC_LIST "vc14"
77   lappend ::SYS_VCVARS_LIST "%VS140COMNTOOLS%..\\..\\VC\\vcvarsall.bat"
78
79   lappend ::SYS_VS_LIST "Visual Studio 2015 (14, toolset v140) UWP"
80   lappend ::SYS_VC_LIST "vc14-uwp"
81   lappend ::SYS_VCVARS_LIST "%VS140COMNTOOLS%..\\..\\VC\\vcvarsall.bat"
82 }
83 if { [info exists ::env(VS120COMNTOOLS)] } {
84   lappend ::SYS_VS_LIST "Visual Studio 2013 (12, toolset v120)"
85   lappend ::SYS_VC_LIST "vc12"
86   lappend ::SYS_VCVARS_LIST "%VS120COMNTOOLS%..\\..\\VC\\vcvarsall.bat"
87 }
88 if { [info exists ::env(VS110COMNTOOLS)] } {
89   lappend ::SYS_VS_LIST "Visual Studio 2012 (11, toolset v110)"
90   lappend ::SYS_VC_LIST "vc11"
91   lappend ::SYS_VCVARS_LIST "%VS110COMNTOOLS%..\\..\\VC\\vcvarsall.bat"
92 }
93 if { [info exists ::env(VS100COMNTOOLS)] } {
94   lappend ::SYS_VS_LIST "Visual Studio 2010 (10, toolset v100)"
95   lappend ::SYS_VC_LIST "vc10"
96   lappend ::SYS_VCVARS_LIST "%VS100COMNTOOLS%..\\..\\VC\\vcvarsall.bat"
97 }
98 if { [info exists ::env(VS90COMNTOOLS)] } {
99   lappend ::SYS_VS_LIST "Visual Studio 2008 (9, toolset v90)"
100   lappend ::SYS_VC_LIST "vc9"
101   lappend ::SYS_VCVARS_LIST "%VS90COMNTOOLS%..\\..\\VC\\vcvarsall.bat"
102 }
103 if { [info exists ::env(VS80COMNTOOLS)] } {
104   lappend ::SYS_VS_LIST "Visual Studio 2005 (8, toolset v80)"
105   lappend ::SYS_VC_LIST "vc8"
106   lappend ::SYS_VCVARS_LIST "%VS80COMNTOOLS%..\\..\\VC\\vcvarsall.bat"
107 }
108 lappend ::SYS_VS_LIST "Custom"
109 lappend ::SYS_VC_LIST "vcX"
110 lappend ::SYS_VCVARS_LIST "%VSXXCOMNTOOLS%..\\..\\VC\\vcvarsall.bat"
111
112 set aVcVerIndex [lsearch $::SYS_VC_LIST $::VCVER]
113 set ::VSVER  [lindex $::SYS_VS_LIST     $aVcVerIndex]
114 if { "$::VCVARS" == "" } {
115   set ::VCVARS [lindex $::SYS_VCVARS_LIST $aVcVerIndex]
116 }
117
118 proc wokdep:gui:Close {} {
119   # if changed ask
120   exit
121 }
122
123 proc wokdep:gui:SwitchConfig {} {
124   set ::PRJFMT [lindex $::SYS_PRJFMT_LIST [.myFrame.myPrjFrame.myPrjCombo current]]
125   set ::VCVER  [lindex $::SYS_VC_LIST     [.myFrame.myVsFrame.myVsCombo current]]
126   set ::VCVARS [lindex $::SYS_VCVARS_LIST [.myFrame.myVsFrame.myVsCombo current]]
127
128   set ::CSF_OPT_INC {}
129   set ::CSF_OPT_LIB32 {}
130   set ::CSF_OPT_LIB64 {}
131   set ::CSF_OPT_BIN32 {}
132   set ::CSF_OPT_BIN64 {}
133   wokdep:gui:UpdateList
134 }
135
136 proc wokdep:gui:SwitchArch {} {
137   if { "$::ARCH" == "32" } {
138     wokdep:gui:Show32Bitness ::aRowIter
139   }
140   if { "$::ARCH" == "64" } {
141     wokdep:gui:Show64Bitness ::aRowIter
142   }
143
144   if { [llength [grid info .myFrame.mySave]] != 0 } {
145     grid forget .myFrame.mySave .myFrame.myClose
146   }
147
148   # Bottom section
149   grid .myFrame.mySave  -row $::aRowIter -column 4 -columnspan 2
150   grid .myFrame.myClose -row $::aRowIter -column 6 -columnspan 2
151 }
152
153 proc wokdep:gui:UpdateList {} {
154   set anIncErrs   {}
155   set anLib32Errs {}
156   set anLib64Errs {}
157   set anBin32Errs {}
158   set anBin64Errs {}
159   wokdep:SearchTclTk     anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
160   wokdep:SearchFreeType  anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
161   wokdep:SearchX11       anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
162   if { "$::HAVE_GLES2" == "true" } {
163     wokdep:SearchEGL     anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
164     wokdep:SearchGLES    anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
165   }
166   if { "$::HAVE_FREEIMAGE" == "true" } {
167     wokdep:SearchFreeImage anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
168   }
169   if { "$::HAVE_FFMPEG" == "true" } {
170     wokdep:SearchFFmpeg  anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
171   }
172   if { "$::HAVE_TBB" == "true" } {
173     wokdep:SearchTBB     anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
174   }
175 #  if { "$::HAVE_OPENCL" == "true" } {
176 #    wokdep:SearchOpenCL  anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
177 #  }
178   if { "$::HAVE_VTK" == "true" } {
179     wokdep:SearchVTK  anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
180   }
181
182   if { "$::HAVE_ZLIB" == "true" } {
183     wokdep:SearchStandardLibrary  anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs "zlib" "zlib.h" "zlib" {"zlib"}
184   }
185   if { "$::HAVE_LIBLZMA" == "true" } {
186     set aCheckLib "lzma"
187     if { "$::tcl_platform(platform)" == "windows" } {
188       set aCheckLib "liblzma"
189     }
190     wokdep:SearchStandardLibrary  anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs "liblzma" "lzma.h" "$aCheckLib" {"lzma" "xz"}
191   }
192   if { "$::HAVE_RAPIDJSON" == "true" } {
193     wokdep:SearchRapidJson anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
194   }
195
196   if { "$::CHECK_QT4" == "true" } {
197     wokdep:SearchQt4     anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
198   }
199   if { "$::CHECK_JDK" == "true" } {
200     wokdep:SearchJDK     anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
201   }
202
203   .myFrame.myIncErrLbl   configure -text [join $anIncErrs   "\n"]
204   .myFrame.myLib32ErrLbl configure -text [join $anLib32Errs "\n"]
205   .myFrame.myLib64ErrLbl configure -text [join $anLib64Errs "\n"]
206   .myFrame.myBin32ErrLbl configure -text [join $anBin32Errs "\n"]
207   .myFrame.myBin64ErrLbl configure -text [join $anBin64Errs "\n"]
208 }
209
210 proc wokdep:gui:BrowseVcVars {} {
211   set aResult [tk_chooseDirectory -initialdir $::VCVARS -title "Choose a directory"]
212   if { "$aResult" != "" } {
213     set ::VCVARS $aResult
214   }
215 }
216
217 proc wokdep:gui:BrowsePartiesRoot {} {
218   set aResult [tk_chooseDirectory -initialdir $::PRODUCTS_PATH -title "Choose a directory"]
219   if { "$aResult" != "" } {
220     set ::PRODUCTS_PATH $aResult
221     wokdep:gui:UpdateList
222   }
223 }
224
225 proc wokdep:gui:AddIncPath {} {
226   set aResult [tk_chooseDirectory -title "Choose a directory"]
227   if { "$aResult" != "" } {
228     lappend ::CSF_OPT_INC "$aResult"
229     wokdep:gui:UpdateList
230   }
231 }
232
233 proc wokdep:gui:AddLib32Path {} {
234   set aResult [tk_chooseDirectory -title "Choose a directory"]
235   if { "$aResult" != "" } {
236     lappend ::CSF_OPT_LIB32 "$aResult"
237     wokdep:gui:UpdateList
238   }
239 }
240
241 proc wokdep:gui:AddLib64Path {} {
242   set aResult [tk_chooseDirectory -title "Choose a directory"]
243   if { "$aResult" != "" } {
244     lappend ::CSF_OPT_LIB64 "$aResult"
245     wokdep:gui:UpdateList
246   }
247 }
248
249 proc wokdep:gui:AddBin32Path {} {
250   set aResult [tk_chooseDirectory -title "Choose a directory"]
251   if { "$aResult" != "" } {
252     lappend ::CSF_OPT_BIN32 "$aResult"
253     wokdep:gui:UpdateList
254   }
255 }
256
257 proc wokdep:gui:AddBin64Path {} {
258   set aResult [tk_chooseDirectory -title "Choose a directory"]
259   if { "$aResult" != "" } {
260     lappend ::CSF_OPT_BIN64 "$aResult"
261     wokdep:gui:UpdateList
262   }
263 }
264
265 proc wokdep:gui:RemoveIncPath {} {
266   set aSelIndices [.myFrame.myIncList curselection]
267   if { [llength $aSelIndices] != 0 } {
268     .myFrame.myIncList delete [lindex $aSelIndices 0]
269   }
270   wokdep:gui:UpdateList
271 }
272
273 proc wokdep:gui:RemoveLib32Path {} {
274   set aSelIndices [.myFrame.myLib32List curselection]
275   if { [llength $aSelIndices] != 0 } {
276     .myFrame.myLib32List delete [lindex $aSelIndices 0]
277   }
278   wokdep:gui:UpdateList
279 }
280
281 proc wokdep:gui:RemoveLib64Path {} {
282   set aSelIndices [.myFrame.myLib64List curselection]
283   if { [llength $aSelIndices] != 0 } {
284     .myFrame.myLib64List delete [lindex $aSelIndices 0]
285   }
286   wokdep:gui:UpdateList
287 }
288
289 proc wokdep:gui:RemoveBin32Path {} {
290   set aSelIndices [.myFrame.myBin32List curselection]
291   if { [llength $aSelIndices] != 0 } {
292     .myFrame.myBin32List delete [lindex $aSelIndices 0]
293   }
294   wokdep:gui:UpdateList
295 }
296
297 proc wokdep:gui:RemoveBin64Path {} {
298   set aSelIndices [.myFrame.myBin64List curselection]
299   if { [llength $aSelIndices] != 0 } {
300     .myFrame.myBin64List delete [lindex $aSelIndices 0]
301   }
302   wokdep:gui:UpdateList
303 }
304
305 proc wokdep:gui:ResetIncPath {} {
306   set ::CSF_OPT_INC {}
307   wokdep:gui:UpdateList
308 }
309
310 proc wokdep:gui:ResetLib32Path {} {
311   set ::CSF_OPT_LIB32 {}
312   wokdep:gui:UpdateList
313 }
314
315 proc wokdep:gui:ResetLib64Path {} {
316   set ::CSF_OPT_LIB64 {}
317   wokdep:gui:UpdateList
318 }
319
320 proc wokdep:gui:ResetBin32Path {} {
321   set ::CSF_OPT_BIN32 {}
322   wokdep:gui:UpdateList
323 }
324
325 proc wokdep:gui:ResetBin64Path {} {
326   set ::CSF_OPT_BIN64 {}
327   wokdep:gui:UpdateList
328 }
329
330 proc wokdep:gui:Show32Bitness { theRowIter } {
331   upvar $theRowIter aRowIter
332
333   if { [llength [grid info .myFrame.myLib64Lbl]] != 0 } {
334     grid forget .myFrame.myLib64Lbl .myFrame.myLib64List   .myFrame.myLib64Scrl
335     grid forget .myFrame.myLib64Add .myFrame.myLib64Remove .myFrame.myLib64Clear .myFrame.myLib64ErrLbl
336     grid forget .myFrame.myBin64Lbl .myFrame.myBin64List   .myFrame.myBin64Scrl
337     grid forget .myFrame.myBin64Add .myFrame.myBin64Remove .myFrame.myBin64Clear .myFrame.myBin64ErrLbl
338   }
339
340   # Additional libraries (32-bit) search paths
341   grid .myFrame.myLib32Lbl    -row $aRowIter -column 0 -columnspan 10 -sticky w
342   incr aRowIter
343   grid .myFrame.myLib32List   -row $aRowIter -column 0 -rowspan 4 -columnspan 5
344   grid .myFrame.myLib32Scrl   -row $aRowIter -column 5 -rowspan 4
345   grid .myFrame.myLib32Add    -row $aRowIter -column 6
346   incr aRowIter
347   #grid .myFrame.myLib32Edit   -row $aRowIter -column 6
348   incr aRowIter
349   grid .myFrame.myLib32Remove -row $aRowIter -column 6
350   incr aRowIter
351   grid .myFrame.myLib32Clear  -row $aRowIter -column 6
352   incr aRowIter
353   grid .myFrame.myLib32ErrLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
354   incr aRowIter
355
356   # Additional executables (32-bit) search paths
357   grid .myFrame.myBin32Lbl    -row $aRowIter -column 0 -columnspan 10 -sticky w
358   incr aRowIter
359   grid .myFrame.myBin32List   -row $aRowIter -column 0 -rowspan 4 -columnspan 5
360   grid .myFrame.myBin32Scrl   -row $aRowIter -column 5 -rowspan 4
361   grid .myFrame.myBin32Add    -row $aRowIter -column 6
362   incr aRowIter
363   #grid .myFrame.myBin32Edit   -row $aRowIter -column 6
364   incr aRowIter
365   grid .myFrame.myBin32Remove -row $aRowIter -column 6
366   incr aRowIter
367   grid .myFrame.myBin32Clear  -row $aRowIter -column 6
368   incr aRowIter
369   grid .myFrame.myBin32ErrLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
370   incr aRowIter
371 }
372
373 proc wokdep:gui:Show64Bitness { theRowIter } {
374   upvar $theRowIter aRowIter
375
376   if { [llength [grid info .myFrame.myLib32Lbl]] != 0 } {
377     grid forget .myFrame.myLib32Lbl .myFrame.myLib32List   .myFrame.myLib32Scrl
378     grid forget .myFrame.myLib32Add .myFrame.myLib32Remove .myFrame.myLib32Clear .myFrame.myLib32ErrLbl
379     grid forget .myFrame.myBin32Lbl .myFrame.myBin32List   .myFrame.myBin32Scrl
380     grid forget .myFrame.myBin32Add .myFrame.myBin32Remove .myFrame.myBin32Clear .myFrame.myBin32ErrLbl
381   }
382
383   # Additional libraries (64-bit) search paths
384   grid .myFrame.myLib64Lbl    -row $aRowIter -column 0 -columnspan 10 -sticky w
385   incr aRowIter
386   grid .myFrame.myLib64List   -row $aRowIter -column 0 -rowspan 4 -columnspan 5
387   grid .myFrame.myLib64Scrl   -row $aRowIter -column 5 -rowspan 4
388   grid .myFrame.myLib64Add    -row $aRowIter -column 6
389   incr aRowIter
390   #grid .myFrame.myLib64Edit   -row $aRowIter -column 6
391   incr aRowIter
392   grid .myFrame.myLib64Remove -row $aRowIter -column 6
393   incr aRowIter
394   grid .myFrame.myLib64Clear  -row $aRowIter -column 6
395   incr aRowIter
396   grid .myFrame.myLib64ErrLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
397   incr aRowIter
398
399   # Additional executables (64-bit) search paths
400   grid .myFrame.myBin64Lbl    -row $aRowIter -column 0 -columnspan 10 -sticky w
401   incr aRowIter
402   grid .myFrame.myBin64List   -row $aRowIter -column 0 -rowspan 4 -columnspan 5
403   grid .myFrame.myBin64Scrl   -row $aRowIter -column 5 -rowspan 4
404   grid .myFrame.myBin64Add    -row $aRowIter -column 6
405   incr aRowIter
406   #grid .myFrame.myBin64Edit   -row $aRowIter -column 6
407   incr aRowIter
408   grid .myFrame.myBin64Remove -row $aRowIter -column 6
409   incr aRowIter
410   grid .myFrame.myBin64Clear  -row $aRowIter -column 6
411   incr aRowIter
412   grid .myFrame.myBin64ErrLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
413   incr aRowIter
414 }
415
416 # Header
417 ttk::label    .myFrame.myPrjFrame.myPrjLbl     -text "Project format:" -padding {5 5 20 5}
418 ttk::combobox .myFrame.myPrjFrame.myPrjCombo   -values $SYS_PRJNAME_LIST -state readonly -textvariable PRJNAME -width 40
419 ttk::label    .myFrame.myVsFrame.myVsLbl       -text "Visual Studio configuration:" -padding {5 5 20 5}
420 ttk::combobox .myFrame.myVsFrame.myVsCombo     -values $SYS_VS_LIST -state readonly -textvariable VSVER -width 40
421 ttk::combobox .myFrame.myVsFrame.myArchCombo   -values { {32} {64} } -textvariable ARCH -state readonly -width 6
422 entry         .myFrame.myVcEntry     -textvariable VCVER  -width 10
423 entry         .myFrame.myVcVarsEntry -textvariable VCVARS -width 70
424 ttk::button   .myFrame.myVcBrowseBtn -text "Browse" -command wokdep:gui:BrowseVcVars
425 ttk::label    .myFrame.myHxxChecks.myRelDebInfoLbl   -text "Release with Debug info"
426 checkbutton   .myFrame.myHxxChecks.myRelDebInfoCheck -offvalue "false" -onvalue "true" -variable HAVE_RelWithDebInfo
427
428 #
429 ttk::combobox .myFrame.myHxxChecks.myScutsCombo   -values { {ShortCut} {Copy} {HardLink} } -textvariable SHORTCUT_HEADERS -state readonly -width 12
430 ttk::label    .myFrame.myHxxChecks.myScutsLbl     -text "Strategy for filling headers folder inc:"
431
432 #
433 ttk::label    .myFrame.mySrchLbl       -text "3rd-parties search path:" -padding {5 5 80 5}
434 entry         .myFrame.mySrchEntry     -textvariable PRODUCTS_PATH -width 80
435 ttk::button   .myFrame.mySrchBrowseBtn -text "Browse" -command wokdep:gui:BrowsePartiesRoot
436 checkbutton   .myFrame.myChecks.myFImageCheck   -offvalue "false" -onvalue "true" -variable HAVE_FREEIMAGE -command wokdep:gui:UpdateList
437 ttk::label    .myFrame.myChecks.myFImageLbl     -text "Use FreeImage"
438 checkbutton   .myFrame.myChecks.myTbbCheck      -offvalue "false" -onvalue "true" -variable HAVE_TBB       -command wokdep:gui:UpdateList
439 ttk::label    .myFrame.myChecks.myTbbLbl        -text "Use Intel TBB"
440 if { "$::tcl_platform(os)" != "Darwin" } {
441   checkbutton .myFrame.myChecks.myGlesCheck     -offvalue "false" -onvalue "true" -variable HAVE_GLES2     -command wokdep:gui:UpdateList
442   ttk::label  .myFrame.myChecks.myGlesLbl       -text "Use OpenGL ES"
443 }
444 if { "$::tcl_platform(platform)" == "windows" } {
445   checkbutton .myFrame.myChecks.myD3dCheck      -offvalue "false" -onvalue "true" -variable HAVE_D3D       -command wokdep:gui:UpdateList
446   ttk::label  .myFrame.myChecks.myD3dLbl        -text "Use Direct3D"
447 }
448 checkbutton   .myFrame.myChecks.myFFmpegCheck   -offvalue "false" -onvalue "true" -variable HAVE_FFMPEG    -command wokdep:gui:UpdateList
449 ttk::label    .myFrame.myChecks.myFFmpegLbl     -text "Use FFmpeg"
450 #checkbutton   .myFrame.myChecks.myOpenClCheck   -offvalue "false" -onvalue "true" -variable HAVE_OPENCL    -command wokdep:gui:UpdateList
451 #ttk::label    .myFrame.myChecks.myOpenClLbl     -text "Use OpenCL"
452 checkbutton   .myFrame.myChecks.myMacGLXCheck   -offvalue "false" -onvalue "true" -variable MACOSX_USE_GLX
453 ttk::label    .myFrame.myChecks.myMacGLXLbl     -text "Use X11 for windows drawing"
454 ttk::label    .myFrame.myChecks.myVtkLbl        -text "Use VTK"
455 checkbutton   .myFrame.myChecks.myVtkCheck      -offvalue "false" -onvalue "true" -variable HAVE_VTK       -command wokdep:gui:UpdateList
456
457 checkbutton   .myFrame.myChecks.myZLibCheck     -offvalue "false" -onvalue "true" -variable HAVE_ZLIB      -command wokdep:gui:UpdateList
458 ttk::label    .myFrame.myChecks.myZLibLbl       -text "Use zlib"
459 checkbutton   .myFrame.myChecks.myLzmaCheck     -offvalue "false" -onvalue "true" -variable HAVE_LIBLZMA   -command wokdep:gui:UpdateList
460 ttk::label    .myFrame.myChecks.myLzmaLbl       -text "Use liblzma"
461
462 checkbutton   .myFrame.myChecks.myRapidJsonCheck -offvalue "false" -onvalue "true" -variable HAVE_RAPIDJSON -command wokdep:gui:UpdateList
463 ttk::label    .myFrame.myChecks.myRapidJsonLbl   -text "Use RapidJSON"
464
465 checkbutton   .myFrame.myChecks.myQt4Check      -offvalue "false" -onvalue "true" -variable CHECK_QT4      -command wokdep:gui:UpdateList
466 ttk::label    .myFrame.myChecks.myQt4Lbl        -text "Search Qt4"
467 checkbutton   .myFrame.myChecks.myJDKCheck      -offvalue "false" -onvalue "true" -variable CHECK_JDK      -command wokdep:gui:UpdateList
468 ttk::label    .myFrame.myChecks.myJDKLbl        -text "Search JDK"
469
470 # Additional headers search paths
471 ttk::label    .myFrame.myIncLbl    -text "Additional headers search paths:" -padding {5 5 80 5}
472 scrollbar     .myFrame.myIncScrl   -command ".myFrame.myIncList yview"
473 listbox       .myFrame.myIncList   -listvariable CSF_OPT_INC -width 80 -height 5 -yscrollcommand ".myFrame.myIncScrl set"
474 ttk::button   .myFrame.myIncAdd    -text "Add"     -command wokdep:gui:AddIncPath
475 ttk::button   .myFrame.myIncEdit   -text "Edit"
476 ttk::button   .myFrame.myIncRemove -text "Remove"  -command wokdep:gui:RemoveIncPath
477 ttk::button   .myFrame.myIncClear  -text "Reset"   -command wokdep:gui:ResetIncPath
478 ttk::label    .myFrame.myIncErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
479
480 # Additional libraries (32-bit) search paths
481 ttk::label    .myFrame.myLib32Lbl    -text "Additional libraries (32-bit) search paths:" -padding {5 5 80 5}
482 scrollbar     .myFrame.myLib32Scrl   -command ".myFrame.myLib32List yview"
483 listbox       .myFrame.myLib32List   -listvariable CSF_OPT_LIB32 -width 80 -height 5 -yscrollcommand ".myFrame.myLib32Scrl set"
484 ttk::button   .myFrame.myLib32Add    -text "Add"     -command wokdep:gui:AddLib32Path
485 ttk::button   .myFrame.myLib32Edit   -text "Edit"
486 ttk::button   .myFrame.myLib32Remove -text "Remove"  -command wokdep:gui:RemoveLib32Path
487 ttk::button   .myFrame.myLib32Clear  -text "Reset"   -command wokdep:gui:ResetLib32Path
488 ttk::label    .myFrame.myLib32ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
489
490 # Additional libraries (64-bit) search paths
491 ttk::label    .myFrame.myLib64Lbl    -text "Additional libraries (64-bit) search paths:" -padding {5 5 80 5}
492 scrollbar     .myFrame.myLib64Scrl   -command ".myFrame.myLib64List yview"
493 listbox       .myFrame.myLib64List   -listvariable CSF_OPT_LIB64 -width 80 -height 5 -yscrollcommand ".myFrame.myLib64Scrl set"
494 ttk::button   .myFrame.myLib64Add    -text "Add"     -command wokdep:gui:AddLib64Path
495 ttk::button   .myFrame.myLib64Edit   -text "Edit"
496 ttk::button   .myFrame.myLib64Remove -text "Remove"  -command wokdep:gui:RemoveLib64Path
497 ttk::button   .myFrame.myLib64Clear  -text "Reset"   -command wokdep:gui:ResetLib64Path
498 ttk::label    .myFrame.myLib64ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
499
500 # Additional executables (32-bit) search paths
501 ttk::label    .myFrame.myBin32Lbl    -text "Additional executables (32-bit) search paths:" -padding {5 5 80 5}
502 scrollbar     .myFrame.myBin32Scrl   -command ".myFrame.myBin32List yview"
503 listbox       .myFrame.myBin32List   -listvariable CSF_OPT_BIN32 -width 80 -height 5 -yscrollcommand ".myFrame.myBin32Scrl set"
504 ttk::button   .myFrame.myBin32Add    -text "Add"     -command wokdep:gui:AddBin32Path
505 ttk::button   .myFrame.myBin32Edit   -text "Edit"
506 ttk::button   .myFrame.myBin32Remove -text "Remove"  -command wokdep:gui:RemoveBin32Path
507 ttk::button   .myFrame.myBin32Clear  -text "Reset"   -command wokdep:gui:ResetBin32Path
508 ttk::label    .myFrame.myBin32ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
509
510 # Additional executables (64-bit) search paths
511 ttk::label    .myFrame.myBin64Lbl    -text "Additional executables (64-bit) search paths:" -padding {5 5 80 5}
512 scrollbar     .myFrame.myBin64Scrl   -command ".myFrame.myBin64List yview"
513 listbox       .myFrame.myBin64List   -listvariable CSF_OPT_BIN64 -width 80 -height 5 -yscrollcommand ".myFrame.myBin64Scrl set"
514 ttk::button   .myFrame.myBin64Add    -text "Add"     -command wokdep:gui:AddBin64Path
515 ttk::button   .myFrame.myBin64Edit   -text "Edit"
516 ttk::button   .myFrame.myBin64Remove -text "Remove"  -command wokdep:gui:RemoveBin64Path
517 ttk::button   .myFrame.myBin64Clear  -text "Reset"   -command wokdep:gui:ResetBin64Path
518 ttk::label    .myFrame.myBin64ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
519
520 # Bottom
521 ttk::button   .myFrame.mySave  -text "Save"  -command wokdep:SaveCustom
522 ttk::button   .myFrame.myClose -text "Close" -command wokdep:gui:Close
523
524 # Create grid
525 # Header
526 grid .myFrame.myPrjFrame            -row $aRowIter -column 0 -columnspan 10 -sticky w
527 grid .myFrame.myPrjFrame.myPrjLbl   -row 0 -column 0
528 grid .myFrame.myPrjFrame.myPrjCombo -row 0 -column 1
529 incr aRowIter
530 if { "$tcl_platform(platform)" == "windows" } {
531   grid .myFrame.myVsFrame               -row $aRowIter -column 0 -columnspan 10 -sticky w
532   grid .myFrame.myVsFrame.myVsLbl       -row 0 -column 0
533   grid .myFrame.myVsFrame.myVsCombo     -row 0 -column 1 -padx 5
534   grid .myFrame.myVsFrame.myArchCombo   -row 0 -column 2
535   incr aRowIter
536   grid .myFrame.myVcEntry     -row $aRowIter -column 0
537   grid .myFrame.myVcVarsEntry -row $aRowIter -column 1 -columnspan 4 -sticky w
538   grid .myFrame.myVcBrowseBtn -row $aRowIter -column 6
539   incr aRowIter
540 }
541
542 #
543 grid .myFrame.myHxxChecks -row $aRowIter -column 0 -columnspan 10 -sticky w
544 grid .myFrame.myHxxChecks.myScutsLbl     -row 0 -column 0
545 grid .myFrame.myHxxChecks.myScutsCombo   -row 0 -column 1
546 if { "$tcl_platform(platform)" == "windows" } {
547   grid .myFrame.myHxxChecks.myRelDebInfoCheck -row 0 -column 2
548   grid .myFrame.myHxxChecks.myRelDebInfoLbl   -row 0 -column 3
549 }
550 incr aRowIter
551 #
552 grid .myFrame.mySrchLbl       -row $aRowIter -column 0 -columnspan 10 -sticky w
553 incr aRowIter
554 grid .myFrame.mySrchEntry     -row $aRowIter -column 0 -columnspan 5
555 grid .myFrame.mySrchBrowseBtn -row $aRowIter -column 6
556 incr aRowIter
557
558 grid .myFrame.myChecks        -row $aRowIter -column 0 -columnspan 10 -sticky w
559 incr aRowIter
560 grid .myFrame.myChecks.myFImageCheck   -row $aCheckRowIter -column 0 -sticky e
561 grid .myFrame.myChecks.myFImageLbl     -row $aCheckRowIter -column 1 -sticky w
562 grid .myFrame.myChecks.myTbbCheck      -row $aCheckRowIter -column 2 -sticky e
563 grid .myFrame.myChecks.myTbbLbl        -row $aCheckRowIter -column 3 -sticky w
564 if { "$::tcl_platform(os)" != "Darwin" } {
565   grid .myFrame.myChecks.myGlesCheck     -row $aCheckRowIter -column 4 -sticky e
566   grid .myFrame.myChecks.myGlesLbl       -row $aCheckRowIter -column 5 -sticky w
567 }
568 #grid .myFrame.myChecks.myOpenClCheck   -row $aCheckRowIter -column 6 -sticky e
569 #grid .myFrame.myChecks.myOpenClLbl     -row $aCheckRowIter -column 7 -sticky w
570 grid .myFrame.myChecks.myZLibCheck     -row $aCheckRowIter -column 6 -sticky e
571 grid .myFrame.myChecks.myZLibLbl       -row $aCheckRowIter -column 7 -sticky w
572
573 grid .myFrame.myChecks.myQt4Check      -row $aCheckRowIter -column 12 -sticky e
574 grid .myFrame.myChecks.myQt4Lbl        -row $aCheckRowIter -column 13 -sticky w
575
576 incr aCheckRowIter
577 grid .myFrame.myChecks.myFFmpegCheck   -row $aCheckRowIter -column 0 -sticky e
578 grid .myFrame.myChecks.myFFmpegLbl     -row $aCheckRowIter -column 1 -sticky w
579 grid .myFrame.myChecks.myVtkCheck      -row $aCheckRowIter -column 2 -sticky e
580 grid .myFrame.myChecks.myVtkLbl        -row $aCheckRowIter -column 3 -sticky w
581 if { "$::tcl_platform(platform)" == "windows" } {
582   grid .myFrame.myChecks.myD3dCheck    -row $aCheckRowIter -column 4 -sticky e
583   grid .myFrame.myChecks.myD3dLbl      -row $aCheckRowIter -column 5 -sticky w
584 }
585 grid .myFrame.myChecks.myLzmaCheck     -row $aCheckRowIter -column 6 -sticky e
586 grid .myFrame.myChecks.myLzmaLbl       -row $aCheckRowIter -column 7 -sticky w
587 grid .myFrame.myChecks.myJDKCheck      -row $aCheckRowIter -column 12 -sticky e
588 grid .myFrame.myChecks.myJDKLbl        -row $aCheckRowIter -column 13 -sticky w
589
590 incr aCheckRowIter
591 if { "$::tcl_platform(os)" == "Darwin" } {
592   grid .myFrame.myChecks.myMacGLXCheck -row $aCheckRowIter -column 0 -sticky e
593   grid .myFrame.myChecks.myMacGLXLbl   -row $aCheckRowIter -column 1 -sticky w
594   incr aCheckRowIter
595 }
596
597 grid .myFrame.myChecks.myRapidJsonCheck -row $aCheckRowIter -column 6 -sticky e
598 grid .myFrame.myChecks.myRapidJsonLbl   -row $aCheckRowIter -column 7 -sticky w
599 incr aCheckRowIter
600
601 # Additional headers search paths
602 grid .myFrame.myIncLbl    -row $aRowIter -column 0 -columnspan 10 -sticky w
603 incr aRowIter
604 grid .myFrame.myIncList   -row $aRowIter -column 0 -rowspan 4 -columnspan 5
605 grid .myFrame.myIncScrl   -row $aRowIter -column 5 -rowspan 4
606 grid .myFrame.myIncAdd    -row $aRowIter -column 6
607 incr aRowIter
608 #grid .myFrame.myIncEdit   -row $aRowIter -column 6
609 incr aRowIter
610 grid .myFrame.myIncRemove -row $aRowIter -column 6
611 incr aRowIter
612 grid .myFrame.myIncClear  -row $aRowIter -column 6
613 incr aRowIter
614 grid .myFrame.myIncErrLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
615 incr aRowIter
616
617 # Additional 32-bit search paths
618 if { "$ARCH" == "32" } {
619   wokdep:gui:Show32Bitness aRowIter
620 }
621
622 # Additional 64-bit search paths
623 if { "$ARCH" == "64" } {
624   wokdep:gui:Show64Bitness aRowIter
625 }
626
627 # Bottom section
628 grid .myFrame.mySave  -row $aRowIter -column 4 -columnspan 2
629 grid .myFrame.myClose -row $aRowIter -column 6 -columnspan 2
630
631 # Bind events
632 bind .myFrame.myPrjFrame.myPrjCombo <<ComboboxSelected>> {
633   wokdep:gui:SwitchConfig
634 }
635 bind .myFrame.myVsFrame.myVsCombo <<ComboboxSelected>> {
636   wokdep:gui:SwitchConfig
637 }
638 bind .myFrame.myVsFrame.myArchCombo <<ComboboxSelected>> {
639   wokdep:gui:SwitchArch
640 }
641
642 .myFrame.mySrchEntry configure -validate all -validatecommand {
643   #return [file exists "$::PRODUCTS_PATH"]
644   wokdep:gui:UpdateList
645   return 1
646 }
647
648 wokdep:gui:UpdateList