0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[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
231   if {"$::BUILD_Inspector" == "true" } {
232     set ::CHECK_QT "true"
233   }
234
235   if { "$::CHECK_QT" == "true" } {
236     wokdep:SearchQt     anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
237   }
238
239   if { "$::CHECK_JDK" == "true" } {
240     wokdep:SearchJDK     anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
241   }
242
243   .myFrame.myIncErrLbl   configure -text [join $anIncErrs   "\n"]
244   .myFrame.myLib32ErrLbl configure -text [join $anLib32Errs "\n"]
245   .myFrame.myLib64ErrLbl configure -text [join $anLib64Errs "\n"]
246   .myFrame.myBin32ErrLbl configure -text [join $anBin32Errs "\n"]
247   .myFrame.myBin64ErrLbl configure -text [join $anBin64Errs "\n"]
248 }
249
250 proc wokdep:gui:BrowseVcVars {} {
251   set aResult [tk_chooseDirectory -initialdir $::VCVARS -title "Choose a directory"]
252   if { "$aResult" != "" } {
253     set ::VCVARS $aResult
254   }
255 }
256
257 proc wokdep:gui:BrowsePartiesRoot {} {
258   set aResult [tk_chooseDirectory -initialdir $::PRODUCTS_PATH_INPUT -title "Choose a directory"]
259   if { "$aResult" != "" } {
260     set ::PRODUCTS_PATH_INPUT $aResult
261     wokdep:gui:UpdateList
262   }
263 }
264
265 proc wokdep:gui:AddIncPath {} {
266   set aResult [tk_chooseDirectory -title "Choose a directory"]
267   if { "$aResult" != "" } {
268     lappend ::CSF_OPT_INC "$aResult"
269     wokdep:gui:UpdateList
270   }
271 }
272
273 proc wokdep:gui:AddLib32Path {} {
274   set aResult [tk_chooseDirectory -title "Choose a directory"]
275   if { "$aResult" != "" } {
276     lappend ::CSF_OPT_LIB32 "$aResult"
277     wokdep:gui:UpdateList
278   }
279 }
280
281 proc wokdep:gui:AddLib64Path {} {
282   set aResult [tk_chooseDirectory -title "Choose a directory"]
283   if { "$aResult" != "" } {
284     lappend ::CSF_OPT_LIB64 "$aResult"
285     wokdep:gui:UpdateList
286   }
287 }
288
289 proc wokdep:gui:AddBin32Path {} {
290   set aResult [tk_chooseDirectory -title "Choose a directory"]
291   if { "$aResult" != "" } {
292     lappend ::CSF_OPT_BIN32 "$aResult"
293     wokdep:gui:UpdateList
294   }
295 }
296
297 proc wokdep:gui:AddBin64Path {} {
298   set aResult [tk_chooseDirectory -title "Choose a directory"]
299   if { "$aResult" != "" } {
300     lappend ::CSF_OPT_BIN64 "$aResult"
301     wokdep:gui:UpdateList
302   }
303 }
304
305 proc wokdep:gui:RemoveIncPath {} {
306   set aSelIndices [.myFrame.myIncList curselection]
307   if { [llength $aSelIndices] != 0 } {
308     .myFrame.myIncList delete [lindex $aSelIndices 0]
309   }
310   wokdep:gui:UpdateList
311 }
312
313 proc wokdep:gui:RemoveLib32Path {} {
314   set aSelIndices [.myFrame.myLib32List curselection]
315   if { [llength $aSelIndices] != 0 } {
316     .myFrame.myLib32List delete [lindex $aSelIndices 0]
317   }
318   wokdep:gui:UpdateList
319 }
320
321 proc wokdep:gui:RemoveLib64Path {} {
322   set aSelIndices [.myFrame.myLib64List curselection]
323   if { [llength $aSelIndices] != 0 } {
324     .myFrame.myLib64List delete [lindex $aSelIndices 0]
325   }
326   wokdep:gui:UpdateList
327 }
328
329 proc wokdep:gui:RemoveBin32Path {} {
330   set aSelIndices [.myFrame.myBin32List curselection]
331   if { [llength $aSelIndices] != 0 } {
332     .myFrame.myBin32List delete [lindex $aSelIndices 0]
333   }
334   wokdep:gui:UpdateList
335 }
336
337 proc wokdep:gui:RemoveBin64Path {} {
338   set aSelIndices [.myFrame.myBin64List curselection]
339   if { [llength $aSelIndices] != 0 } {
340     .myFrame.myBin64List delete [lindex $aSelIndices 0]
341   }
342   wokdep:gui:UpdateList
343 }
344
345 proc wokdep:gui:ResetIncPath {} {
346   set ::CSF_OPT_INC {}
347   wokdep:gui:UpdateList
348 }
349
350 proc wokdep:gui:ResetLib32Path {} {
351   set ::CSF_OPT_LIB32 {}
352   wokdep:gui:UpdateList
353 }
354
355 proc wokdep:gui:ResetLib64Path {} {
356   set ::CSF_OPT_LIB64 {}
357   wokdep:gui:UpdateList
358 }
359
360 proc wokdep:gui:ResetBin32Path {} {
361   set ::CSF_OPT_BIN32 {}
362   wokdep:gui:UpdateList
363 }
364
365 proc wokdep:gui:ResetBin64Path {} {
366   set ::CSF_OPT_BIN64 {}
367   wokdep:gui:UpdateList
368 }
369
370 proc wokdep:gui:Show32Bitness { theRowIter } {
371   upvar $theRowIter aRowIter
372
373   if { [llength [grid info .myFrame.myLib64Lbl]] != 0 } {
374     grid forget .myFrame.myLib64Lbl .myFrame.myLib64List   .myFrame.myLib64Scrl
375     grid forget .myFrame.myLib64Add .myFrame.myLib64Remove .myFrame.myLib64Clear .myFrame.myLib64ErrLbl
376     grid forget .myFrame.myBin64Lbl .myFrame.myBin64List   .myFrame.myBin64Scrl
377     grid forget .myFrame.myBin64Add .myFrame.myBin64Remove .myFrame.myBin64Clear .myFrame.myBin64ErrLbl
378   }
379
380   # Additional libraries (32-bit) search paths
381   grid .myFrame.myLib32Lbl    -row $aRowIter -column 0 -columnspan 10 -sticky w
382   incr aRowIter
383   grid .myFrame.myLib32List   -row $aRowIter -column 0 -rowspan 4 -columnspan 5
384   grid .myFrame.myLib32Scrl   -row $aRowIter -column 5 -rowspan 4
385   grid .myFrame.myLib32Add    -row $aRowIter -column 6
386   incr aRowIter
387   #grid .myFrame.myLib32Edit   -row $aRowIter -column 6
388   incr aRowIter
389   grid .myFrame.myLib32Remove -row $aRowIter -column 6
390   incr aRowIter
391   grid .myFrame.myLib32Clear  -row $aRowIter -column 6
392   incr aRowIter
393   grid .myFrame.myLib32ErrLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
394   incr aRowIter
395
396   # Additional executables (32-bit) search paths
397   grid .myFrame.myBin32Lbl    -row $aRowIter -column 0 -columnspan 10 -sticky w
398   incr aRowIter
399   grid .myFrame.myBin32List   -row $aRowIter -column 0 -rowspan 4 -columnspan 5
400   grid .myFrame.myBin32Scrl   -row $aRowIter -column 5 -rowspan 4
401   grid .myFrame.myBin32Add    -row $aRowIter -column 6
402   incr aRowIter
403   #grid .myFrame.myBin32Edit   -row $aRowIter -column 6
404   incr aRowIter
405   grid .myFrame.myBin32Remove -row $aRowIter -column 6
406   incr aRowIter
407   grid .myFrame.myBin32Clear  -row $aRowIter -column 6
408   incr aRowIter
409   grid .myFrame.myBin32ErrLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
410   incr aRowIter
411 }
412
413 proc wokdep:gui:Show64Bitness { theRowIter } {
414   upvar $theRowIter aRowIter
415
416   if { [llength [grid info .myFrame.myLib32Lbl]] != 0 } {
417     grid forget .myFrame.myLib32Lbl .myFrame.myLib32List   .myFrame.myLib32Scrl
418     grid forget .myFrame.myLib32Add .myFrame.myLib32Remove .myFrame.myLib32Clear .myFrame.myLib32ErrLbl
419     grid forget .myFrame.myBin32Lbl .myFrame.myBin32List   .myFrame.myBin32Scrl
420     grid forget .myFrame.myBin32Add .myFrame.myBin32Remove .myFrame.myBin32Clear .myFrame.myBin32ErrLbl
421   }
422
423   # Additional libraries (64-bit) search paths
424   grid .myFrame.myLib64Lbl    -row $aRowIter -column 0 -columnspan 10 -sticky w
425   incr aRowIter
426   grid .myFrame.myLib64List   -row $aRowIter -column 0 -rowspan 4 -columnspan 5
427   grid .myFrame.myLib64Scrl   -row $aRowIter -column 5 -rowspan 4
428   grid .myFrame.myLib64Add    -row $aRowIter -column 6
429   incr aRowIter
430   #grid .myFrame.myLib64Edit   -row $aRowIter -column 6
431   incr aRowIter
432   grid .myFrame.myLib64Remove -row $aRowIter -column 6
433   incr aRowIter
434   grid .myFrame.myLib64Clear  -row $aRowIter -column 6
435   incr aRowIter
436   grid .myFrame.myLib64ErrLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
437   incr aRowIter
438
439   # Additional executables (64-bit) search paths
440   grid .myFrame.myBin64Lbl    -row $aRowIter -column 0 -columnspan 10 -sticky w
441   incr aRowIter
442   grid .myFrame.myBin64List   -row $aRowIter -column 0 -rowspan 4 -columnspan 5
443   grid .myFrame.myBin64Scrl   -row $aRowIter -column 5 -rowspan 4
444   grid .myFrame.myBin64Add    -row $aRowIter -column 6
445   incr aRowIter
446   #grid .myFrame.myBin64Edit   -row $aRowIter -column 6
447   incr aRowIter
448   grid .myFrame.myBin64Remove -row $aRowIter -column 6
449   incr aRowIter
450   grid .myFrame.myBin64Clear  -row $aRowIter -column 6
451   incr aRowIter
452   grid .myFrame.myBin64ErrLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
453   incr aRowIter
454 }
455
456 # Header
457 ttk::label    .myFrame.myPrjFrame.myPrjLbl     -text "Project format:" -padding {5 5 20 5}
458 ttk::combobox .myFrame.myPrjFrame.myPrjCombo   -values $SYS_PRJNAME_LIST -state readonly -textvariable PRJNAME -width 40
459 ttk::label    .myFrame.myVsFrame.myVsLbl       -text "Visual Studio configuration:" -padding {5 5 20 5}
460 ttk::combobox .myFrame.myVsFrame.myVsCombo     -values $SYS_VS_LIST -state readonly -textvariable VSVER -width 40
461 ttk::combobox .myFrame.myVsFrame.myArchCombo   -values { {32} {64} } -textvariable ARCH -state readonly -width 6
462 entry         .myFrame.myVcEntry     -textvariable VCVER  -width 10
463 entry         .myFrame.myVcVarsEntry -textvariable VCVARS -width 70
464 ttk::button   .myFrame.myVcBrowseBtn -text "Browse" -command wokdep:gui:BrowseVcVars
465 ttk::label    .myFrame.myHxxChecks.myRelDebInfoLbl   -text "Release with Debug info"
466 checkbutton   .myFrame.myHxxChecks.myRelDebInfoCheck -offvalue "false" -onvalue "true" -variable HAVE_RelWithDebInfo
467
468 #
469 ttk::combobox .myFrame.myHxxChecks.myScutsCombo   -values { {ShortCut} {Copy} {HardLink} } -textvariable SHORTCUT_HEADERS -state readonly -width 12
470 ttk::label    .myFrame.myHxxChecks.myScutsLbl     -text "Strategy for filling headers folder inc:"
471
472 #
473 ttk::label    .myFrame.mySrchLbl       -text "3rd-parties search path:" -padding {5 5 80 5}
474 entry         .myFrame.mySrchEntry     -textvariable PRODUCTS_PATH_INPUT -width 80
475 ttk::button   .myFrame.mySrchBrowseBtn -text "Browse" -command wokdep:gui:BrowsePartiesRoot
476 checkbutton   .myFrame.myChecks.myFreeTypeCheck -offvalue "false" -onvalue "true" -variable HAVE_FREETYPE  -command wokdep:gui:UpdateList
477 ttk::label    .myFrame.myChecks.myFreeTypeLbl   -text "Use FreeType"
478 checkbutton   .myFrame.myChecks.myFImageCheck   -offvalue "false" -onvalue "true" -variable HAVE_FREEIMAGE -command wokdep:gui:UpdateList
479 ttk::label    .myFrame.myChecks.myFImageLbl     -text "Use FreeImage"
480 checkbutton   .myFrame.myChecks.myTbbCheck      -offvalue "false" -onvalue "true" -variable HAVE_TBB       -command wokdep:gui:UpdateList
481 ttk::label    .myFrame.myChecks.myTbbLbl        -text "Use Intel TBB"
482 checkbutton   .myFrame.myChecks.myOpenVrCheck   -offvalue "false" -onvalue "true" -variable HAVE_OPENVR    -command wokdep:gui:UpdateList
483 ttk::label    .myFrame.myChecks.myOpenVrLbl     -text "Use OpenVR"
484 if { "$::tcl_platform(os)" != "Darwin" } {
485   checkbutton .myFrame.myChecks.myGlesCheck     -offvalue "false" -onvalue "true" -variable HAVE_GLES2     -command wokdep:gui:UpdateList
486   ttk::label  .myFrame.myChecks.myGlesLbl       -text "Use OpenGL ES"
487 }
488 if { "$::tcl_platform(platform)" == "windows" } {
489   checkbutton .myFrame.myChecks.myD3dCheck      -offvalue "false" -onvalue "true" -variable HAVE_D3D       -command wokdep:gui:UpdateList
490   ttk::label  .myFrame.myChecks.myD3dLbl        -text "Use Direct3D"
491 }
492 checkbutton   .myFrame.myChecks.myFFmpegCheck   -offvalue "false" -onvalue "true" -variable HAVE_FFMPEG    -command wokdep:gui:UpdateList
493 ttk::label    .myFrame.myChecks.myFFmpegLbl     -text "Use FFmpeg"
494 #checkbutton   .myFrame.myChecks.myOpenClCheck   -offvalue "false" -onvalue "true" -variable HAVE_OPENCL    -command wokdep:gui:UpdateList
495 #ttk::label    .myFrame.myChecks.myOpenClLbl     -text "Use OpenCL"
496 checkbutton   .myFrame.myChecks.myRapidJsonCheck -offvalue "false" -onvalue "true" -variable HAVE_RAPIDJSON -command wokdep:gui:UpdateList
497 ttk::label    .myFrame.myChecks.myRapidJsonLbl   -text "Use RapidJSON"
498
499 checkbutton   .myFrame.myChecks.myXLibCheck     -offvalue "false" -onvalue "true" -variable HAVE_XLIB
500 ttk::label    .myFrame.myChecks.myXLibLbl       -text "Use X11 for windows drawing"
501 ttk::label    .myFrame.myChecks.myVtkLbl        -text "Use VTK"
502 checkbutton   .myFrame.myChecks.myVtkCheck      -offvalue "false" -onvalue "true" -variable HAVE_VTK       -command wokdep:gui:UpdateList
503
504 checkbutton   .myFrame.myChecks.myZLibCheck     -offvalue "false" -onvalue "true" -variable HAVE_ZLIB      -command wokdep:gui:UpdateList
505 ttk::label    .myFrame.myChecks.myZLibLbl       -text "Use zlib"
506 checkbutton   .myFrame.myChecks.myLzmaCheck     -offvalue "false" -onvalue "true" -variable HAVE_LIBLZMA   -command wokdep:gui:UpdateList
507 ttk::label    .myFrame.myChecks.myLzmaLbl       -text "Use liblzma"
508 checkbutton   .myFrame.myChecks.myE57Check      -offvalue "false" -onvalue "true" -variable HAVE_E57       -command wokdep:gui:UpdateList
509 ttk::label    .myFrame.myChecks.myE57Lbl        -text "Use E57"
510
511 checkbutton   .myFrame.myChecks.myQtCheck       -offvalue "false" -onvalue "true" -variable CHECK_QT       -command wokdep:gui:UpdateList
512 ttk::label    .myFrame.myChecks.myQtLbl         -text "Search Qt"
513 checkbutton   .myFrame.myChecks.myJDKCheck      -offvalue "false" -onvalue "true" -variable CHECK_JDK      -command wokdep:gui:UpdateList
514 ttk::label    .myFrame.myChecks.myJDKLbl        -text "Search JDK"
515
516 if { "$::tcl_platform(platform)" == "windows" } {
517   checkbutton   .myFrame.myChecks.myInspectorBuild -offvalue "false" -onvalue "true" -variable BUILD_Inspector      -command wokdep:gui:UpdateList
518   ttk::label    .myFrame.myChecks.myInspectorLbl   -text "Build Inspector"
519 }
520
521 # Additional headers search paths
522 ttk::label    .myFrame.myIncLbl    -text "Additional headers search paths:" -padding {5 5 80 5}
523 scrollbar     .myFrame.myIncScrl   -command ".myFrame.myIncList yview"
524 listbox       .myFrame.myIncList   -listvariable CSF_OPT_INC -width 80 -height 5 -yscrollcommand ".myFrame.myIncScrl set"
525 ttk::button   .myFrame.myIncAdd    -text "Add"     -command wokdep:gui:AddIncPath
526 ttk::button   .myFrame.myIncEdit   -text "Edit"
527 ttk::button   .myFrame.myIncRemove -text "Remove"  -command wokdep:gui:RemoveIncPath
528 ttk::button   .myFrame.myIncClear  -text "Reset"   -command wokdep:gui:ResetIncPath
529 ttk::label    .myFrame.myIncErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
530
531 # Additional libraries (32-bit) search paths
532 ttk::label    .myFrame.myLib32Lbl    -text "Additional libraries (32-bit) search paths:" -padding {5 5 80 5}
533 scrollbar     .myFrame.myLib32Scrl   -command ".myFrame.myLib32List yview"
534 listbox       .myFrame.myLib32List   -listvariable CSF_OPT_LIB32 -width 80 -height 5 -yscrollcommand ".myFrame.myLib32Scrl set"
535 ttk::button   .myFrame.myLib32Add    -text "Add"     -command wokdep:gui:AddLib32Path
536 ttk::button   .myFrame.myLib32Edit   -text "Edit"
537 ttk::button   .myFrame.myLib32Remove -text "Remove"  -command wokdep:gui:RemoveLib32Path
538 ttk::button   .myFrame.myLib32Clear  -text "Reset"   -command wokdep:gui:ResetLib32Path
539 ttk::label    .myFrame.myLib32ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
540
541 # Additional libraries (64-bit) search paths
542 ttk::label    .myFrame.myLib64Lbl    -text "Additional libraries (64-bit) search paths:" -padding {5 5 80 5}
543 scrollbar     .myFrame.myLib64Scrl   -command ".myFrame.myLib64List yview"
544 listbox       .myFrame.myLib64List   -listvariable CSF_OPT_LIB64 -width 80 -height 5 -yscrollcommand ".myFrame.myLib64Scrl set"
545 ttk::button   .myFrame.myLib64Add    -text "Add"     -command wokdep:gui:AddLib64Path
546 ttk::button   .myFrame.myLib64Edit   -text "Edit"
547 ttk::button   .myFrame.myLib64Remove -text "Remove"  -command wokdep:gui:RemoveLib64Path
548 ttk::button   .myFrame.myLib64Clear  -text "Reset"   -command wokdep:gui:ResetLib64Path
549 ttk::label    .myFrame.myLib64ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
550
551 # Additional executables (32-bit) search paths
552 ttk::label    .myFrame.myBin32Lbl    -text "Additional executables (32-bit) search paths:" -padding {5 5 80 5}
553 scrollbar     .myFrame.myBin32Scrl   -command ".myFrame.myBin32List yview"
554 listbox       .myFrame.myBin32List   -listvariable CSF_OPT_BIN32 -width 80 -height 5 -yscrollcommand ".myFrame.myBin32Scrl set"
555 ttk::button   .myFrame.myBin32Add    -text "Add"     -command wokdep:gui:AddBin32Path
556 ttk::button   .myFrame.myBin32Edit   -text "Edit"
557 ttk::button   .myFrame.myBin32Remove -text "Remove"  -command wokdep:gui:RemoveBin32Path
558 ttk::button   .myFrame.myBin32Clear  -text "Reset"   -command wokdep:gui:ResetBin32Path
559 ttk::label    .myFrame.myBin32ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
560
561 # Additional executables (64-bit) search paths
562 ttk::label    .myFrame.myBin64Lbl    -text "Additional executables (64-bit) search paths:" -padding {5 5 80 5}
563 scrollbar     .myFrame.myBin64Scrl   -command ".myFrame.myBin64List yview"
564 listbox       .myFrame.myBin64List   -listvariable CSF_OPT_BIN64 -width 80 -height 5 -yscrollcommand ".myFrame.myBin64Scrl set"
565 ttk::button   .myFrame.myBin64Add    -text "Add"     -command wokdep:gui:AddBin64Path
566 ttk::button   .myFrame.myBin64Edit   -text "Edit"
567 ttk::button   .myFrame.myBin64Remove -text "Remove"  -command wokdep:gui:RemoveBin64Path
568 ttk::button   .myFrame.myBin64Clear  -text "Reset"   -command wokdep:gui:ResetBin64Path
569 ttk::label    .myFrame.myBin64ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
570
571 # Bottom
572 ttk::button   .myFrame.mySave  -text "Save"  -command wokdep:SaveCustom
573 ttk::button   .myFrame.myClose -text "Close" -command wokdep:gui:Close
574
575 # Create grid
576 # Header
577 grid .myFrame.myPrjFrame            -row $aRowIter -column 0 -columnspan 10 -sticky w
578 grid .myFrame.myPrjFrame.myPrjLbl   -row 0 -column 0
579 grid .myFrame.myPrjFrame.myPrjCombo -row 0 -column 1
580 incr aRowIter
581 if { "$tcl_platform(platform)" == "windows" } {
582   grid .myFrame.myVsFrame               -row $aRowIter -column 0 -columnspan 10 -sticky w
583   grid .myFrame.myVsFrame.myVsLbl       -row 0 -column 0
584   grid .myFrame.myVsFrame.myVsCombo     -row 0 -column 1 -padx 5
585   grid .myFrame.myVsFrame.myArchCombo   -row 0 -column 2
586   incr aRowIter
587   grid .myFrame.myVcEntry     -row $aRowIter -column 0
588   grid .myFrame.myVcVarsEntry -row $aRowIter -column 1 -columnspan 4 -sticky w
589   grid .myFrame.myVcBrowseBtn -row $aRowIter -column 6
590   incr aRowIter
591 }
592
593 #
594 grid .myFrame.myHxxChecks -row $aRowIter -column 0 -columnspan 10 -sticky w
595 grid .myFrame.myHxxChecks.myScutsLbl     -row 0 -column 0
596 grid .myFrame.myHxxChecks.myScutsCombo   -row 0 -column 1
597 if { "$tcl_platform(platform)" == "windows" } {
598   grid .myFrame.myHxxChecks.myRelDebInfoCheck -row 0 -column 2
599   grid .myFrame.myHxxChecks.myRelDebInfoLbl   -row 0 -column 3
600 }
601 incr aRowIter
602 #
603 grid .myFrame.mySrchLbl       -row $aRowIter -column 0 -columnspan 10 -sticky w
604 incr aRowIter
605 grid .myFrame.mySrchEntry     -row $aRowIter -column 0 -columnspan 5
606 grid .myFrame.mySrchBrowseBtn -row $aRowIter -column 6
607 incr aRowIter
608
609 grid .myFrame.myChecks        -row $aRowIter -column 0 -columnspan 10 -sticky w
610 incr aRowIter
611 grid .myFrame.myChecks.myFreeTypeCheck  -row $aCheckRowIter -column 0 -sticky e
612 grid .myFrame.myChecks.myFreeTypeLbl    -row $aCheckRowIter -column 1 -sticky w
613 grid .myFrame.myChecks.myRapidJsonCheck -row $aCheckRowIter -column 2 -sticky e
614 grid .myFrame.myChecks.myRapidJsonLbl   -row $aCheckRowIter -column 3 -sticky w
615 if { "$::tcl_platform(os)" != "Darwin" } {
616   grid .myFrame.myChecks.myGlesCheck     -row $aCheckRowIter -column 4 -sticky e
617   grid .myFrame.myChecks.myGlesLbl       -row $aCheckRowIter -column 5 -sticky w
618 }
619 #grid .myFrame.myChecks.myOpenClCheck   -row $aCheckRowIter -column 6 -sticky e
620 #grid .myFrame.myChecks.myOpenClLbl     -row $aCheckRowIter -column 7 -sticky w
621 grid .myFrame.myChecks.myZLibCheck     -row $aCheckRowIter -column 6 -sticky e
622 grid .myFrame.myChecks.myZLibLbl       -row $aCheckRowIter -column 7 -sticky w
623
624 grid .myFrame.myChecks.myQtCheck      -row $aCheckRowIter -column 12 -sticky e
625 grid .myFrame.myChecks.myQtLbl        -row $aCheckRowIter -column 13 -sticky w
626
627 incr aCheckRowIter
628 grid .myFrame.myChecks.myFImageCheck   -row $aCheckRowIter -column 0 -sticky e
629 grid .myFrame.myChecks.myFImageLbl     -row $aCheckRowIter -column 1 -sticky w
630 grid .myFrame.myChecks.myTbbCheck      -row $aCheckRowIter -column 2 -sticky e
631 grid .myFrame.myChecks.myTbbLbl        -row $aCheckRowIter -column 3 -sticky w
632 if { "$::tcl_platform(platform)" == "windows" } {
633   grid .myFrame.myChecks.myD3dCheck    -row $aCheckRowIter -column 4 -sticky e
634   grid .myFrame.myChecks.myD3dLbl      -row $aCheckRowIter -column 5 -sticky w
635 } else {
636   grid .myFrame.myChecks.myXLibCheck   -row $aCheckRowIter -column 4 -sticky e
637   grid .myFrame.myChecks.myXLibLbl     -row $aCheckRowIter -column 5 -sticky w
638 }
639 grid .myFrame.myChecks.myLzmaCheck     -row $aCheckRowIter -column 6 -sticky e
640 grid .myFrame.myChecks.myLzmaLbl       -row $aCheckRowIter -column 7 -sticky w
641 grid .myFrame.myChecks.myJDKCheck      -row $aCheckRowIter -column 12 -sticky e
642 grid .myFrame.myChecks.myJDKLbl        -row $aCheckRowIter -column 13 -sticky w
643
644 incr aCheckRowIter
645 grid .myFrame.myChecks.myFFmpegCheck   -row $aCheckRowIter -column 0 -sticky e
646 grid .myFrame.myChecks.myFFmpegLbl     -row $aCheckRowIter -column 1 -sticky w
647 grid .myFrame.myChecks.myVtkCheck      -row $aCheckRowIter -column 2 -sticky e
648 grid .myFrame.myChecks.myVtkLbl        -row $aCheckRowIter -column 3 -sticky w
649 grid .myFrame.myChecks.myOpenVrCheck   -row $aCheckRowIter -column 4 -sticky e
650 grid .myFrame.myChecks.myOpenVrLbl     -row $aCheckRowIter -column 5 -sticky w
651 grid .myFrame.myChecks.myE57Check      -row $aCheckRowIter -column 6 -sticky e
652 grid .myFrame.myChecks.myE57Lbl        -row $aCheckRowIter -column 7 -sticky w
653
654 if { "$::tcl_platform(platform)" == "windows" } {
655   grid .myFrame.myChecks.myInspectorBuild      -row $aCheckRowIter -column 12 -sticky e
656   grid .myFrame.myChecks.myInspectorLbl        -row $aCheckRowIter -column 13 -sticky w
657 }
658
659 incr aCheckRowIter
660
661 # Additional headers search paths
662 grid .myFrame.myIncLbl    -row $aRowIter -column 0 -columnspan 10 -sticky w
663 incr aRowIter
664 grid .myFrame.myIncList   -row $aRowIter -column 0 -rowspan 4 -columnspan 5
665 grid .myFrame.myIncScrl   -row $aRowIter -column 5 -rowspan 4
666 grid .myFrame.myIncAdd    -row $aRowIter -column 6
667 incr aRowIter
668 #grid .myFrame.myIncEdit   -row $aRowIter -column 6
669 incr aRowIter
670 grid .myFrame.myIncRemove -row $aRowIter -column 6
671 incr aRowIter
672 grid .myFrame.myIncClear  -row $aRowIter -column 6
673 incr aRowIter
674 grid .myFrame.myIncErrLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
675 incr aRowIter
676
677 # Additional 32-bit search paths
678 if { "$ARCH" == "32" } {
679   wokdep:gui:Show32Bitness aRowIter
680 }
681
682 # Additional 64-bit search paths
683 if { "$ARCH" == "64" } {
684   wokdep:gui:Show64Bitness aRowIter
685 }
686
687 # Bottom section
688 grid .myFrame.mySave  -row $aRowIter -column 4 -columnspan 2
689 grid .myFrame.myClose -row $aRowIter -column 6 -columnspan 2
690
691 # Bind events
692 bind .myFrame.myPrjFrame.myPrjCombo <<ComboboxSelected>> {
693   wokdep:gui:SwitchConfig
694 }
695 bind .myFrame.myVsFrame.myVsCombo <<ComboboxSelected>> {
696   wokdep:gui:SwitchConfig
697 }
698 bind .myFrame.myVsFrame.myArchCombo <<ComboboxSelected>> {
699   wokdep:gui:SwitchArch
700 }
701
702 .myFrame.mySrchEntry configure -validate all -validatecommand {
703   set ::PRODUCTS_PATH [file normalize "$::PRODUCTS_PATH_INPUT"]
704   #return [file exists "$::PRODUCTS_PATH"]
705   wokdep:gui:UpdateList
706   return 1
707 }
708
709 wokdep:gui:UpdateList