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