# Wrapper-function to generate VS project files
proc genproj {theFormat args} {
- set aSupportedFormats { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "vc14" "vc141" "vc142" "cbp" "xcd" "pro"}
+ set aSupportedFormats { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "vc14" "vc141" "vc142" "vclang" "cbp" "xcd" "pro"}
set aSupportedPlatforms { "wnt" "uwp" "lin" "mac" "ios" "qnx" }
set isHelpRequire false
# Check optional arguments
set aLibType "dynamic"
- foreach arg $args {
- if { $arg == "-h" || $arg == "-help" || $arg == "--help" } {
+ set aSolution "OCCT"
+ for {set anArgIter 0} {$anArgIter < [llength args]} {incr anArgIter} {
+ set arg [lindex $args $anArgIter]
+ if { $arg == "" } {
+ continue
+ } elseif { $arg == "-h" || $arg == "-help" || $arg == "--help" } {
set isHelpRequire true
} elseif { [lsearch -exact $aSupportedPlatforms $arg] >= 0 } {
set aPlatform $arg
} elseif { $arg == "-dynamic" } {
set aLibType "dynamic"
puts "Dynamic build has been selected"
+ } elseif { $arg == "-solution" } {
+ incr anArgIter
+ set aSolution [lindex $args $anArgIter]
} else {
puts "Error: genproj: unrecognized option \"$arg\""
set isHelpRequire true
vc14 - Visual Studio 2015
vc141 - Visual Studio 2017
vc142 - Visual Studio 2019
+ vclang - Visual Studio with ClangCL toolset
cbp - CodeBlocks
xcd - XCode
pro - Qt Creator
# base path to where to generate projects, hardcoded from current dir
set anAdmPath [file normalize "${::path}/adm"]
- OS:MKPRC "$anAdmPath" "$theFormat" "$aLibType" "$aPlatform" "$aCmpl"
+ OS:MKPRC "$anAdmPath" "$theFormat" "$aLibType" "$aPlatform" "$aCmpl" "$aSolution"
- genprojbat "$theFormat" "$aPlatform"
+ genprojbat "$theFormat" "$aPlatform" "$aSolution"
genAllResources
}
file copy -force -- "$from" "$to"
}
-proc genprojbat {theFormat thePlatform} {
+# Generate auxiliary scripts for launching IDE.
+proc genprojbat {theFormat thePlatform theSolution} {
set aTargetPlatformExt sh
if { $thePlatform == "wnt" || $thePlatform == "uwp" } {
set aTargetPlatformExt bat
copy_with_warning "$::THE_CASROOT/adm/templates/draw.${aTargetPlatformExt}" "$::path/draw.${aTargetPlatformExt}"
}
+ set aSolShList ""
if { [regexp {^vc} $theFormat] } {
- copy_with_warning "$::THE_CASROOT/adm/templates/msvc.bat" "$::path/msvc.bat"
+ set aSolShList "msvc.bat"
} else {
switch -exact -- "$theFormat" {
- "cbp" {
- file copy -force -- "$::THE_CASROOT/adm/templates/codeblocks.sh" "$::path/codeblocks.sh"
- file copy -force -- "$::THE_CASROOT/adm/templates/codeblocks.bat" "$::path/codeblocks.bat"
-
+ "cbp" {
+ set aSolShList { "codeblocks.sh" "codeblocks.bat" }
# Code::Blocks 16.01 does not create directory for import libs, help him
set aPlatformAndCompiler "${thePlatform}/gcc"
if { "$thePlatform" == "mac" || "$thePlatform" == "ios" } {
file mkdir "$::path/${aPlatformAndCompiler}/lib"
file mkdir "$::path/${aPlatformAndCompiler}/libd"
}
- "xcd" { file copy -force -- "$::THE_CASROOT/adm/templates/xcode.sh" "$::path/xcode.sh" }
+ "xcd" { set aSolShList "xcode.sh" }
}
}
+
+ foreach aSolSh $aSolShList {
+ set anShFile [open "$::THE_CASROOT/adm/templates/${aSolSh}" "r"]
+ set anShTmpl [read $anShFile]
+ close $anShFile
+
+ regsub -all -- {__SOLUTION__} $anShTmpl "$theSolution" anShTmpl
+
+ set anShFile [open "$::path/${aSolSh}" "w"]
+ puts $anShFile $anShTmpl
+ close $anShFile
+ }
}
###### MSVC #############################################################33
# @param theLibType Library type - dynamic or static
# @param thePlatform Optional target platform for cross-compiling, e.g. ios for iOS
# @param theCmpl Compiler option (msvc or gcc)
-proc OS:MKPRC { theOutDir theFormat theLibType thePlatform theCmpl } {
+# @param theSolution Solution name
+proc OS:MKPRC { theOutDir theFormat theLibType thePlatform theCmpl theSolution } {
global path
set anOutRoot $theOutDir
if { $anOutRoot == "" } {
return
}
- # generate one solution for all projects if complete OS or VAS is processed
- set anAllSolution "OCCT"
-
wokUtils:FILES:mkdir $anOutDir
if { ![file exists $anOutDir] } {
puts stderr "Error: Could not create output directory \"$anOutDir\""
"vc12" -
"vc14" -
"vc141" -
- "vc142" { OS:MKVC $anOutDir $aModules $anAllSolution $theFormat $isUWP}
- "cbp" { OS:MKCBP $anOutDir $aModules $anAllSolution $thePlatform $theCmpl }
+ "vc142" -
+ "vclang" { OS:MKVC $anOutDir $aModules $theSolution $theFormat $isUWP}
+ "cbp" { OS:MKCBP $anOutDir $aModules $theSolution $thePlatform $theCmpl }
"xcd" {
set ::THE_GUIDS_LIST($::aTKNullKey) "000000000000000000000000"
- OS:MKXCD $anOutDir $aModules $anAllSolution $theLibType $thePlatform
+ OS:MKXCD $anOutDir $aModules $theSolution $theLibType $thePlatform
}
}
append var \
"Microsoft Visual Studio Solution File, Format Version 12.00\n" \
"# Visual Studio 2013\n"
- } elseif { "$vcversion" == "vc14" || "$vcversion" == "vc141" || "$vcversion" == "vc142" } {
+ } elseif { "$vcversion" == "vc14" || "$vcversion" == "vc141" ||
+ "$vcversion" == "vc142" || "$vcversion" == "vclang" } {
append var \
"Microsoft Visual Studio Solution File, Format Version 12.00\n" \
"# Visual Studio 14\n"
} elseif { $theVcVer == "vc142" } {
set aVCRTVer "vc14"
set aToolset "v142"
+ } elseif { $theVcVer == "vclang" } {
+ set aVCRTVer "vc14"
+ set aToolset "ClangCL"
}
set what "$theVcVer"
}
}
if { "$::HAVE_ZLIB" == "true" } {
- set aLibsMap(CSF_ZLIB) "zlib"
+ set aLibsMap(CSF_ZLIB) "z"
}
if { "$::HAVE_LIBLZMA" == "true" } {
set aLibsMap(CSF_LIBLZMA) "liblzma"
}
+ if { "$::HAVE_E57" == "true" && "$theOS" != "wnt" } {
+ # exclude wnt, as there are different pragma lib depending on debug/release
+ set aLibsMap(CSF_E57) "E57RefImpl"
+ set aLibsMap(CSF_xerces) "xerces-c"
+ }
if { "$theOS" == "wnt" } {
# WinAPI libraries
# tbb headers define different pragma lib depending on debug/release
set aLibsMap(CSF_TBB) ""
+
+ if { "$::HAVE_ZLIB" == "true" } {
+ set aLibsMap(CSF_ZLIB) "zlib"
+ }
} else {
set aLibsMap(CSF_dl) "dl"
if { "$theOS" == "mac" || "$theOS" == "ios" } {
set aFrmsMap(CSF_TclTkLibs) "Tk"
set aLibsMap(CSF_TclTkLibs) ""
set aLibsMap(CSF_QT) "QtCore QtGui"
+ } elseif { "$theOS" == "android" } {
+ set aLibsMap(CSF_OpenGlLibs) "EGL GLESv2"
+ set aLibsMap(CSF_androidlog) "log"
} else {
set aLibsMap(CSF_fontconfig) "fontconfig"
if { "$theOS" == "qnx" } {