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