if { "$theAllSolution" != "" } {
OS:vcsolution $theVcVer $theAllSolution $theModules $theOutDir ::THE_GUIDS_LIST
}
+
+ puts "The Visual Studio solution and project files are stored in the $theOutDir directory"
}
# Function to generate CMake meta file
fconfigure $aFile -translation crlf
puts $aFile [join $aFileBuff "\n"]
close $aFile
+
+ puts "The Cmake meta-files are stored in the $theOutDir directory"
}
# Generates Code Blocks workspace.
osutils:am:adm $theOutDir $theModules
osutils:am:root [wokinfo -p HomeDir] $theSubPath $theModules
+
+ puts "The automake files are stored in the $theOutDir directory"
}
# Function to generate Code Blocks workspace and project files
if { "$theAllSolution" != "" } {
OS:cworkspace $theAllSolution $theModules $theOutDir
}
+
+ puts "The Code Blocks workspace and project files are stored in the $theOutDir directory"
}
# Store global GUIDs map to reproduce same values on sequential calls
# Entry function to generate project files and solutions for IDE
proc OS:MKPRC { {theOutDir {}} {theProjectType {}} {theIDE ""} } {
- set aSupportedIDE { "vc7" "vc8" "vc9" "vc10" "vc11" "cbp" "cmk" "amk" }
+ set aSupportedIDE { "vc7" "vc8" "vc9" "vc10" "vc11" "cbp" "cmake" "amk" }
if { [lsearch $aSupportedIDE $theIDE] < 0 } {
puts stderr "WOK does not support generation of project files for the selected IDE: $theIDE\nSupported IDEs: [join ${aSupportedIDE} " "]"
"vc10" -
"vc11" { OS:MKVC $anOutDir $aModules $anAllSolution $theIDE }
"cbp" { OS:MKCBP $anOutDir $aModules $anAllSolution }
- "cmk" { OS:MKCMK $anOutDir $aModules $anAllSolution }
+ "cmake" { OS:MKCMK $anOutDir $aModules $anAllSolution }
"amk" { OS:MKAMK $anOutDir $aModules "adm/${aWokStation}/${theIDE}"}
}
}
}
+proc removeAllOccurrencesOf { theObject theList } {
+ set aSortIndices [lsort -decreasing [lsearch -all -nocase $theList $theObject]]
+ foreach anIndex $aSortIndices {
+ set theList [lreplace $theList $anIndex $anIndex]
+ }
+ return $theList
+}
+
# Wrapper-function to generate VS project files
proc wgenproj { args } {
-
- set aProcArgs $args
-
+ set aSupportedTargets { "vc7" "vc8" "vc9" "vc10" "vc11" "cbp" "cmake" "amk" }
+ set anArgs $args
+
# Setting default IDE.
- # For Windows - Visual Studio (vc), Linux - Code Blocks (cbp), Mac OS X - Xcode (cmk).
- set anIDE ""
+ # For Windows - Visual Studio (vc), Linux - Code Blocks (cbp), Mac OS X - Xcode (cmake).
+ set anTarget ""
switch -exact -- "$::env(WOKSTATION)" {
- "wnt" {set anIDE "$::VCVER"}
- "lin" {set anIDE "cbp"}
- "mac" {set anIDE "cmk"}
+ "wnt" {set anTarget "$::VCVER"}
+ "lin" {set anTarget "cbp"}
+ "mac" {set anTarget "cmake"}
}
- # Getting from arguments the name of IDE, for which we should generate project files.
- set anIndex [lsearch $aProcArgs -IDE=*]
- if {$anIndex >= 0} {
- set anIDE [lindex $aProcArgs $anIndex]
- set anIDE [string map {-IDE= ""} $anIDE]
- set aProcArgs [lreplace $aProcArgs $anIndex $anIndex]
+ set isTargetDefault true
+ set willWProcessStart true
+ if { [lsearch -nocase $anArgs -no_wprocess] != -1 } {
+ set anArgs [removeAllOccurrencesOf -no_wprocess $anArgs]
+ set willWProcessStart false
+ }
+
+ if { [set anIndex [lsearch -nocase $anArgs -ide=*]] != -1 } {
+ regsub -nocase "\\-ide=" [lindex $anArgs $anIndex] "" anTarget
+ set anArgs [removeAllOccurrencesOf -ide=* $anArgs]
+ set isTargetDefault false
}
+
+ if { [set anIndex [lsearch -nocase $anArgs -target=*]] != -1 } {
+ regsub -nocase "\\-target=" [lindex $anArgs $anIndex] "" anTarget
+ set anArgs [removeAllOccurrencesOf -target=* $anArgs]
+ set isTargetDefault false
+ }
+
+ if { [llength $anArgs] == 0 && $isTargetDefault == true } {
+ puts "the default \'$anTarget\' target has been applied"
+ }
+
+ set isHelpRequire false
+ if { [lsearch -nocase $anArgs -h] != -1} {
+ set anArgs [removeAllOccurrencesOf -h $anArgs]
+ set isHelpRequire true
+ }
+
+ if { [lsearch -nocase $aSupportedTargets $anTarget] == -1} {
+ puts "the \'$anTarget\' is wrong TARGET"
+ set isHelpRequire true
+ }
+
+ if {[llength $anArgs] > 0} {
+ set isHelpRequire true
+ foreach anArg $anArgs {
+ puts "wgenproj: unrecognized option \'$anArg\'"
+ }
+ }
+
+ if { $isHelpRequire == true } {
+ puts "usage: wgenproj \[ -target=<TARGET> \] \[ -no_wprocess \]
+ -no_wprocess - skip wprocess
+ TARGET:
+ vc8 - Visual Studio 2005
+ vc9 - Visual Studio 2008
+ vc10 - Visual Studio 2010
+ vc11 - Visual Studio 2012
+ cbp - CodeBlocks
+ cmake - CMake
+ amk - AutoMake"
+ return
+ }
+
+ puts "the \'$anTarget\' target has been applied"
+
# create the inc directory. The directory should be created by wprocess function.
wokcd -P Home
file mkdir [file join [pwd] inc]
#
-
- if { "$aProcArgs" != "" } {
- wprocess $aProcArgs -DGroups=Src,Xcpp
- } else {
+
+ if { $willWProcessStart == true } {
+ puts "run wprocess -DGroups=Src,Xcpp"
wprocess -DGroups=Src,Xcpp
+ } else {
+ puts "skip wprocess"
}
source "$::env(WOKHOME)/lib/osutils.tcl"
source "$::env(WOKHOME)/lib/OS.tcl"
wokcd $aWokCD
if { [wokinfo -x OS] } {
- OS:MKPRC "$anAdmPath" "OS" "$anIDE"
+ OS:MKPRC "$anAdmPath" "OS" "$anTarget"
}
if { [wokinfo -x VAS] } {
- OS:MKPRC "$anAdmPath" "VAS" "$anIDE"
+ OS:MKPRC "$anAdmPath" "VAS" "$anTarget"
}
- wgenprojbat "$anAdmPath" "$anIDE"
+ wgenprojbat "$anAdmPath" "$anTarget"
}
# Function to prepare environment