Explicit addition of Tcl libraries to MSVC projects is avoided, they should be linked by #pragma.
WOK configuration script improved to recognize version of Tcl.
Warning level used for MSVC compiler in WOK increased to -W4.
-- Visual Studio compilers and tools should be set in PATH
@set %CSF_CXX_COMPILER = "cl.exe ";
- @set %CSF_CXX_SysOptions = " -nologo -arch:SSE2 -W3 ";
+ @set %CSF_CXX_SysOptions = " -nologo -arch:SSE2 -W4 ";
@string %CSF_CXX_Options = " -DWNT -D_WINDOWS -D_CRT_SECURE_NO_DEPRECATE " %CSF_PRODUCTS_DEFINES " ";
@set %CSF_CXX_ModeOpt = " -MD -EHa -O2 -Gy -DNDEBUG -DNo_Exception ";
@set %CSF_CXX_ModeOptDeb = " -MDd -EHa -Od -Gm -Zi -DDEB -D_DEBUG ";
-- C compiler
@set %CSF_C_COMPILER = "cl.exe ";
- @set %CSF_C_SysOptions = " -nologo -arch:SSE2 -W3 ";
+ @set %CSF_C_SysOptions = " -nologo -arch:SSE2 -W4 ";
@string %CSF_C_Options = " -DWNT -D_WINDOWS -D_CRT_SECURE_NO_DEPRECATE " %CSF_PRODUCTS_DEFINES " ";
@set %CSF_C_ModeOpt = " -MD -EHa -O2 -Gy -DNDEBUG -DNo_Exception ";
@set %CSF_C_ModeOptDeb = " -MDd -EHa -Od -Gm -Zi -DDEB -D_DEBUG ";
@string %CSF_TclLibs = "tcl86.lib";
@string %CSF_TclTkLibs = "tk86.lib";
- -- Qt4 framework, doesn't required for OCCT itself
+ -- Qt4 framework, not required for OCCT itself
@string %CSF_QT_INCLUDES = " ";
@string %CSF_QT = "QtCore4.lib QtGui4.lib";
set aCsfMap(CSF_OpenGlLibs) "opengl32.lib glu32.lib"
# -- 3rd-parties precompiled libraries
- set aCsfMap(CSF_TclLibs) "tcl86.lib"
- set aCsfMap(CSF_TclTkLibs) "tk86.lib"
+ # Note: Tcl library name depends on version and is chosen by #pragma
+# set aCsfMap(CSF_TclLibs) "tcl86.lib"
+# set aCsfMap(CSF_TclTkLibs) "tk86.lib"
set aCsfMap(CSF_QT) "QtCore4.lib QtGui4.lib"
} else {
upvar $theErrBin32 anErrBin32
upvar $theErrBin64 anErrBin64
+ set tclver_maj 8
+ set tclver_min 6
+
set isFound "true"
set aTclHPath [wokdep:SearchHeader "tcl.h"]
- set aTkHPath [wokdep:SearchHeader "tcl.h"]
+ set aTkHPath [wokdep:SearchHeader "tk.h"]
if { "$aTclHPath" == "" || "$aTkHPath" == "" } {
if { [file exists "/usr/include/tcl8.6/tcl.h"]
&& [file exists "/usr/include/tcl8.6/tk.h" ] } {
set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{tcl}*] "$::VCVER" "$::ARCH" ]
if { "$aPath" != "" && [file exists "$aPath/include/tcl.h"] && [file exists "$aPath/include/tk.h"] } {
lappend ::CSF_OPT_INC "$aPath/include"
+ set aTclHPath "$aPath/include/tcl.h"
} else {
lappend anErrInc "Error: 'tcl.h' or 'tk.h' not found (Tcl/Tk)"
set isFound "false"
}
}
+ # detect tcl version by parsing header file
+ if { $isFound } {
+ set fh [open $aTclHPath]
+ set tcl_h [read $fh]
+ close $fh
+ regexp {define\s+TCL_MAJOR_VERSION\s+([0-9]+)} $tcl_h dummy tclver_maj
+ regexp {define\s+TCL_MINOR_VERSION\s+([0-9]+)} $tcl_h dummy tclver_min
+ }
+
if { "$::tcl_platform(platform)" == "windows" } {
- set aTclLibName "tcl86"
- set aTkLibName "tk86"
+ set aTclLibName "tcl${tclver_maj}${tclver_min}"
+ set aTkLibName "tk${tclver_maj}${tclver_min}"
} else {
- set aTclLibName "tcl8.6"
- set aTkLibName "tk8.6"
+ set aTclLibName "tcl${tclver_maj}.${tclver_min}"
+ set aTkLibName "tk${tclver_maj}.${tclver_min}"
}
foreach anArchIter {64 32} {