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