0030682: Configuration, qmake - all warnings are suppressed on macOS target
[occt.git] / adm / genconf.tcl
index 703928e..2b46427 100644 (file)
@@ -30,47 +30,78 @@ set aRowIter 0
 set aCheckRowIter 0
 frame .myFrame -padx 5 -pady 5
 pack  .myFrame -fill both -expand 1
+frame .myFrame.myPrjFrame
 frame .myFrame.myVsFrame
 frame .myFrame.myHxxChecks
 frame .myFrame.myChecks
 
+# project file format
+set SYS_PRJFMT_LIST {}
+set SYS_PRJNAME_LIST {}
+if { "$::tcl_platform(platform)" == "windows" } {
+  lappend ::SYS_PRJFMT_LIST "vcxproj"
+  lappend ::SYS_PRJNAME_LIST "Visual Studio (.vcxproj)"
+}
+if { "$tcl_platform(os)" == "Darwin" } {
+  lappend ::SYS_PRJFMT_LIST "xcd"
+  lappend ::SYS_PRJNAME_LIST "XCode (.xcd)"
+}
+lappend ::SYS_PRJFMT_LIST "cbp"
+lappend ::SYS_PRJNAME_LIST "Code Blocks (.cbp)"
+lappend ::SYS_PRJFMT_LIST "pro"
+lappend ::SYS_PRJNAME_LIST "Qt Creator (.pro)"
+
+set aPrjIndex [lsearch $::SYS_PRJFMT_LIST $::PRJFMT]
+set ::PRJNAME [lindex $::SYS_PRJNAME_LIST $aPrjIndex]
+
 set SYS_VS_LIST {}
 set SYS_VC_LIST {}
 set SYS_VCVARS_LIST {}
 
-# detect installed Visual Studio instances from global environment
-if { [info exists ::env(VS150COMNTOOLS)] } {
-  lappend ::SYS_VS_LIST "Visual Studio 201x (vc15)"
-  lappend ::SYS_VC_LIST "vc15"
-  lappend ::SYS_VCVARS_LIST "%VS150COMNTOOLS%..\\..\\VC\\vcvarsall.bat"
+# detect installed Visual Studio 2017 instances by running vswhere.exe
+if { ! [catch {exec vswhere.exe -version "\[15.0,15.99\]" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath} res] } {
+  lappend ::SYS_VS_LIST "Visual Studio 2017 (15, toolset v141)"
+  lappend ::SYS_VC_LIST "vc141"
+  lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
+}
+if { ! [catch {exec vswhere.exe -version "\[15.0,15.99\]" -latest -requires Microsoft.VisualStudio.Workload.Universal -property installationPath} res] } {
+  lappend ::SYS_VS_LIST "Visual Studio 2017 (15, toolset v141) UWP"
+  lappend ::SYS_VC_LIST "vc141-uwp"
+  lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
 }
+
+# detect installed Visual Studio instances from global environment
 if { [info exists ::env(VS140COMNTOOLS)] } {
-  lappend ::SYS_VS_LIST "Visual Studio 2015 (vc14)"
+  lappend ::SYS_VS_LIST "Visual Studio 2015 (14, toolset v140)"
   lappend ::SYS_VC_LIST "vc14"
   lappend ::SYS_VCVARS_LIST "%VS140COMNTOOLS%..\\..\\VC\\vcvarsall.bat"
+
+  lappend ::SYS_VS_LIST "Visual Studio 2015 (14, toolset v140) UWP"
+  lappend ::SYS_VC_LIST "vc14-uwp"
+  lappend ::SYS_VCVARS_LIST "%VS140COMNTOOLS%..\\..\\VC\\vcvarsall.bat"
 }
 if { [info exists ::env(VS120COMNTOOLS)] } {
-  lappend ::SYS_VS_LIST "Visual Studio 2013 (vc12)"
+  lappend ::SYS_VS_LIST "Visual Studio 2013 (12, toolset v120)"
   lappend ::SYS_VC_LIST "vc12"
   lappend ::SYS_VCVARS_LIST "%VS120COMNTOOLS%..\\..\\VC\\vcvarsall.bat"
 }
 if { [info exists ::env(VS110COMNTOOLS)] } {
-  lappend ::SYS_VS_LIST "Visual Studio 2012 (vc11)"
+  lappend ::SYS_VS_LIST "Visual Studio 2012 (11, toolset v110)"
   lappend ::SYS_VC_LIST "vc11"
   lappend ::SYS_VCVARS_LIST "%VS110COMNTOOLS%..\\..\\VC\\vcvarsall.bat"
 }
 if { [info exists ::env(VS100COMNTOOLS)] } {
-  lappend ::SYS_VS_LIST "Visual Studio 2010 (vc10)"
+  lappend ::SYS_VS_LIST "Visual Studio 2010 (10, toolset v100)"
   lappend ::SYS_VC_LIST "vc10"
   lappend ::SYS_VCVARS_LIST "%VS100COMNTOOLS%..\\..\\VC\\vcvarsall.bat"
 }
 if { [info exists ::env(VS90COMNTOOLS)] } {
-  lappend ::SYS_VS_LIST "Visual Studio 2008 (vc9)"
+  lappend ::SYS_VS_LIST "Visual Studio 2008 (9, toolset v90)"
   lappend ::SYS_VC_LIST "vc9"
   lappend ::SYS_VCVARS_LIST "%VS90COMNTOOLS%..\\..\\VC\\vcvarsall.bat"
 }
 if { [info exists ::env(VS80COMNTOOLS)] } {
-  lappend ::SYS_VS_LIST "Visual Studio 2005 (vc8)"
+  lappend ::SYS_VS_LIST "Visual Studio 2005 (8, toolset v80)"
   lappend ::SYS_VC_LIST "vc8"
   lappend ::SYS_VCVARS_LIST "%VS80COMNTOOLS%..\\..\\VC\\vcvarsall.bat"
 }
@@ -90,6 +121,7 @@ proc wokdep:gui:Close {} {
 }
 
 proc wokdep:gui:SwitchConfig {} {
+  set ::PRJFMT [lindex $::SYS_PRJFMT_LIST [.myFrame.myPrjFrame.myPrjCombo current]]
   set ::VCVER  [lindex $::SYS_VC_LIST     [.myFrame.myVsFrame.myVsCombo current]]
   set ::VCVARS [lindex $::SYS_VCVARS_LIST [.myFrame.myVsFrame.myVsCombo current]]
 
@@ -128,12 +160,6 @@ proc wokdep:gui:UpdateList {} {
   wokdep:SearchFreeType  anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
   wokdep:SearchX11       anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
   if { "$::HAVE_GLES2" == "true" } {
-    if { "$::HAVE_GL2PS" == "true" } {
-      lappend anIncErrs "Error: gl2ps can not be used within OpenGL ES"
-    }
-    if { "$::HAVE_D3D" == "true" } {
-      lappend anIncErrs "Error: Direct3D can not be used within OpenGL ES"
-    }
     wokdep:SearchEGL     anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
     wokdep:SearchGLES    anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
   }
@@ -143,9 +169,6 @@ proc wokdep:gui:UpdateList {} {
   if { "$::HAVE_FFMPEG" == "true" } {
     wokdep:SearchFFmpeg  anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
   }
-  if { "$::HAVE_GL2PS" == "true" } {
-    wokdep:SearchStandardLibrary  anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs "gl2ps" "gl2ps.h" "gl2ps" {"gl2ps"}
-  }
   if { "$::HAVE_TBB" == "true" } {
     wokdep:SearchTBB     anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
   }
@@ -388,10 +411,12 @@ proc wokdep:gui:Show64Bitness { theRowIter } {
 }
 
 # Header
-ttk::label    .myFrame.myVsFrame.myVsLbl       -text "Visual Studio configuration:" -padding {5 5 80 5}
-ttk::combobox .myFrame.myVsFrame.myVsCombo     -values $SYS_VS_LIST -state readonly -textvariable VSVER -width 30
+ttk::label    .myFrame.myPrjFrame.myPrjLbl     -text "Project format:" -padding {5 5 20 5}
+ttk::combobox .myFrame.myPrjFrame.myPrjCombo   -values $SYS_PRJNAME_LIST -state readonly -textvariable PRJNAME -width 40
+ttk::label    .myFrame.myVsFrame.myVsLbl       -text "Visual Studio configuration:" -padding {5 5 20 5}
+ttk::combobox .myFrame.myVsFrame.myVsCombo     -values $SYS_VS_LIST -state readonly -textvariable VSVER -width 40
 ttk::combobox .myFrame.myVsFrame.myArchCombo   -values { {32} {64} } -textvariable ARCH -state readonly -width 6
-entry         .myFrame.myVcEntry     -textvariable VCVER  -width 6
+entry         .myFrame.myVcEntry     -textvariable VCVER  -width 10
 entry         .myFrame.myVcVarsEntry -textvariable VCVARS -width 70
 ttk::button   .myFrame.myVcBrowseBtn -text "Browse" -command wokdep:gui:BrowseVcVars
 ttk::label    .myFrame.myHxxChecks.myRelDebInfoLbl   -text "Release with Debug info"
@@ -407,8 +432,6 @@ entry         .myFrame.mySrchEntry     -textvariable PRODUCTS_PATH -width 80
 ttk::button   .myFrame.mySrchBrowseBtn -text "Browse" -command wokdep:gui:BrowsePartiesRoot
 checkbutton   .myFrame.myChecks.myFImageCheck   -offvalue "false" -onvalue "true" -variable HAVE_FREEIMAGE -command wokdep:gui:UpdateList
 ttk::label    .myFrame.myChecks.myFImageLbl     -text "Use FreeImage"
-checkbutton   .myFrame.myChecks.myGl2psCheck    -offvalue "false" -onvalue "true" -variable HAVE_GL2PS     -command wokdep:gui:UpdateList
-ttk::label    .myFrame.myChecks.myGl2psLbl      -text "Use GL2PS"
 checkbutton   .myFrame.myChecks.myTbbCheck      -offvalue "false" -onvalue "true" -variable HAVE_TBB       -command wokdep:gui:UpdateList
 ttk::label    .myFrame.myChecks.myTbbLbl        -text "Use Intel TBB"
 if { "$::tcl_platform(os)" != "Darwin" } {
@@ -494,6 +517,10 @@ ttk::button   .myFrame.myClose -text "Close" -command wokdep:gui:Close
 
 # Create grid
 # Header
+grid .myFrame.myPrjFrame            -row $aRowIter -column 0 -columnspan 10 -sticky w
+grid .myFrame.myPrjFrame.myPrjLbl   -row 0 -column 0
+grid .myFrame.myPrjFrame.myPrjCombo -row 0 -column 1
+incr aRowIter
 if { "$tcl_platform(platform)" == "windows" } {
   grid .myFrame.myVsFrame               -row $aRowIter -column 0 -columnspan 10 -sticky w
   grid .myFrame.myVsFrame.myVsLbl       -row 0 -column 0
@@ -537,9 +564,6 @@ if { "$::tcl_platform(os)" != "Darwin" } {
 grid .myFrame.myChecks.myZLibCheck     -row $aCheckRowIter -column 6 -sticky e
 grid .myFrame.myChecks.myZLibLbl       -row $aCheckRowIter -column 7 -sticky w
 
-grid .myFrame.myChecks.myGl2psCheck    -row $aCheckRowIter -column 8 -sticky e
-grid .myFrame.myChecks.myGl2psLbl      -row $aCheckRowIter -column 9 -sticky w
-
 grid .myFrame.myChecks.myQt4Check      -row $aCheckRowIter -column 10 -sticky e
 grid .myFrame.myChecks.myQt4Lbl        -row $aCheckRowIter -column 11 -sticky w
 
@@ -595,6 +619,9 @@ grid .myFrame.mySave  -row $aRowIter -column 4 -columnspan 2
 grid .myFrame.myClose -row $aRowIter -column 6 -columnspan 2
 
 # Bind events
+bind .myFrame.myPrjFrame.myPrjCombo <<ComboboxSelected>> {
+  wokdep:gui:SwitchConfig
+}
 bind .myFrame.myVsFrame.myVsCombo <<ComboboxSelected>> {
   wokdep:gui:SwitchConfig
 }