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