global tcl_platform
global OpenSource
if [info exists OpenSource] {
- unset OpenSource
+ unset OpenSource
}
+
set askplat $os
if { "$os" == "" } {
- set os $tcl_platform(os)
+ set os $tcl_platform(os)
}
+
if { [wokcd] == {} } {
- puts stderr " Pas de definition pour [wokcd]. Adm du wb courant "
- return {}
+ puts stderr " Pas de definition pour [wokcd]. Adm du wb courant "
+ return {}
}
+
;#
;# ou se trouve tout ce bordel.
;#
set OpenSource(box) [OS:defbox]
-
+
;# On utilise gtar si possible. =>
;#
+
set OpenSource(tar) tar
if { $tcl_platform(os) == "SunOS"} { set OpenSource(tar) [file join $env(WOK_LIBRARY) sun gtar] }
if { $tcl_platform(os) == "IRIX" } { set OpenSource(tar) [file join $env(WOK_LIBRARY) sil gtar] }
set OpenSource(gtar) yes
-
+
;#
;# Load list of OCCT modules and their definitions
;#
proc OS:casroot {} {
global env
if { [info exists env(CASROOT)] } {
- return $env(CASROOT)
+ return $env(CASROOT)
}
- return [lindex [wokinfo -R [lindex [w_info -A [wokcd]] end]] 0]
+ return [wokinfo -p HomeDir [lindex [w_info -A [wokcd]] end]]
}
;#
;#
puts stderr "WOK does not support generation of project files for the selected IDE: $theIDE\nSupported IDEs: [join ${aSupportedIDE} " "]"
return
}
-
+
set anOutRoot $theOutDir
if { $anOutRoot == "" } {
set anOutRoot [OS -box]
if { "$theIDE" == "cmake" } {
set anOutDir "${anOutRoot}/${theIDE}"
}
-
+
OS:mkdir $anOutDir
if { ! [file exists $anOutDir] } {
puts stderr "Error: Could not create output directory \"$anOutDir\""
# otherwise returns input value (assumed to be already a list of modules)
proc OS:listmodules {what {platforms {}}} {
OS:init
+
if { "$what" == "" } {
if { "$platforms" != "" } {
return [OS -lm -plat $platforms]
;# Author: yolanda_forbes@hotmail.com
;#
+# change station (and its environment) and return old station
+proc changeStationAndDependentEnvironment { theNewStation } {
+
+ # save old station
+ set anOldStation [wokparam -v %Station]
+
+ if { "$anOldStation" == "$theNewStation" } {
+ return $anOldStation
+ }
+
+ wokprofile -S $theNewStation
+
+ # change station
+ wokparam -s %Station=$theNewStation
+
+ # we should unset CSF_EDL variable due to it is necessary
+ # to update all CSF's variables after station change
+ wokparam -u %CSF_EDL
+ wokparam -u %CMPLRS_EDL
+
+ # unseting is require
+ wokparam -u %CSF_[string toupper $theNewStation]_EDL
+ wokparam -u %CSF_[string toupper $anOldStation]_EDL
+
+ # change env(WOKSTATION)
+ set ::env(WOKSTATION) $theNewStation
+
+ # redefine csf variables
+ wokparam -l CMPLRS
+
+ return $anOldStation
+}
+
# intersect3 - perform the intersecting of two lists, returning a list containing three lists.
# The first list is everything in the first list that wasn't in the second,
# the second list contains the intersection of the two lists, the third list contains everything
# Sort a list, returning the sorted version minus any duplicates
proc osutils:lrmdups list {
- if { [llength $list] == 0 } {
- return {}
- }
- set list [lsort $list]
- set last [lvarpop list]
- lappend result $last
- foreach element $list {
- if ![cequal $last $element] {
- lappend result $element
- set last $element
- }
- }
- return $result
+ return [lsort -unique $list]
}
# Return the logical union of two lists, removing any duplicates
regsub -all -- {vc[0-9]+} $aUsedToolKits $theVcVer aUsedToolKits
# and put this list to project file
- puts "$theToolKit requires $aUsedToolKits"
+ #puts "$theToolKit requires $aUsedToolKits"
if { "$theVcVer" == "vc10" || "$theVcVer" == "vc11" } { set aUsedToolKits [join $aUsedToolKits {;}] }
regsub -all -- {__TKDEP__} $theProjTmpl $aUsedToolKits theProjTmpl
if [array exists written] { unset written }
set fxloparamfcxx [lindex [osutils:intersect3 [split [lindex [wokparam -v %CMPLRS_CXX_Options [w_info -f]] 0]] [split [lindex [wokparam -v %CMPLRS_CXX_Options] 0]] ] 2]
set fxloparamfc [lindex [osutils:intersect3 [split [lindex [wokparam -v %CMPLRS_C_Options [w_info -f]] 0]] [split [lindex [wokparam -v %CMPLRS_C_Options] 0]] ] 2]
- set fxloparam "[osutils:union [split $fxloparamfcxx] [split $fxloparamfc]]"
+ set fxloparam ""
foreach fxlo $resultloc {
set xlo [wokinfo -n $fxlo]
set aSrcFiles [osutils:tk:files $xlo osutils:compilable 0]
puts "the \'$anTarget\' target has been applied"
+ source "$::env(WOKHOME)/lib/osutils.tcl"
+ source "$::env(WOKHOME)/lib/OS.tcl"
+
+ # change station if it is necessary
+ set anOldStation "$::env(WOKSTATION)"
+ if { [lsearch -exact {vc7 vc8 vc9 vc10 vc11} $anTarget] != -1 && "$anOldStation" != "wnt"} {
+ changeStationAndDependentEnvironment wnt
+ } elseif { "$anTarget" == "amk" && "$anOldStation" != "lin"} {
+ changeStationAndDependentEnvironment lin
+ }
+
# create the inc directory. The directory should be created by wprocess function.
wokcd -P Home
file mkdir [file join [pwd] inc]
} else {
puts "skip wprocess"
}
- source "$::env(WOKHOME)/lib/osutils.tcl"
- source "$::env(WOKHOME)/lib/OS.tcl"
+
set aWokCD [wokcd]
wadm [wokinfo -w]
set anAdmPath [pwd]
if { [wokinfo -x VAS] } {
OS:MKPRC "$anAdmPath" "VAS" "$anTarget"
}
+
wgenprojbat "$anAdmPath" "$anTarget"
+
+ # change back station if it is require
+ changeStationAndDependentEnvironment "$anOldStation"
}
# Function to prepare environment