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