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