diff --git a/adm/CMPLRS b/adm/CMPLRS
index e62e1b3870..745205e433 100644
--- a/adm/CMPLRS
+++ b/adm/CMPLRS
@@ -10,21 +10,6 @@ wnt cmplrs_c f -DWNT -D_WINDOWS -D_CRT_SECURE_NO_DEPRECATE -DHAVE_FREEIMAGE -DHA
wnt cmplrs_c b -DWNT -D_WINDOWS -D_CRT_SECURE_NO_DEPRECATE -DHAVE_FREEIMAGE -DHAVE_GL2PS -DHAVE_TBB -DHAVE_OPENCL
wnt cmplrs_c NIS (wnt cmplrs_c b) -DSILGL -DSILGL_VRS=50
-win csf CSF_TclLibs tcl86.lib
-win csf CSF_TclTkLibs tk86.lib
-win csf CSF_gdi32 gdi32.lib
-win csf CSF_advapi32 advapi32.lib
-win csf CSF_user32 user32.lib
-win csf CSF_advapi32 advapi32.lib
-win csf CSF_gdi32 gdi32.lib
-win csf CSF_user32 user32.lib
-win csf CSF_kernel32 kernel32.lib
-win csf CSF_OpenGlLibs opengl32.lib glu32.lib
-win csf CSF_wsock32 wsock32.lib
-win csf CSF_AviLibs ws2_32.lib vfw32.lib
-
-
-
lin cmplrs_cxx f -DLIN -DLININTEL -DOCC_CONVERT_SIGNALS -D_GNU_SOURCE=1 -DHAVE_FREEIMAGE -DHAVE_GL2PS -DHAVE_TBB -DHAVE_OPENCL
lin cmplrs_cxx b -DLIN -DLININTEL -DOCC_CONVERT_SIGNALS -D_GNU_SOURCE=1 -DHAVE_FREEIMAGE -DHAVE_GL2PS -DHAVE_TBB -DHAVE_OPENCL
diff --git a/adm/genconfdeps.tcl b/adm/genconfdeps.tcl
index 34705307c0..2263a2928b 100644
--- a/adm/genconfdeps.tcl
+++ b/adm/genconfdeps.tcl
@@ -1,6 +1,6 @@
#!/usr/bin/tclsh
-set ARCH "32"
+set ARCH "64"
if { "$tcl_platform(platform)" == "unix" } {
set SYS_PATH_SPLITTER ":"
@@ -39,6 +39,9 @@ set CSF_OPT_LIB64 [list]
set CSF_OPT_BIN32 [list]
set CSF_OPT_BIN64 [list]
+if { "$tcl_platform(pointerSize)" == "4" } {
+ set ARCH "32"
+}
if { [info exists ::env(ARCH)] } {
set ARCH "$::env(ARCH)"
}
@@ -139,7 +142,8 @@ proc wokdep:SearchLib {theLib theBitness {theSearchPath ""}} {
}
}
- if { "$::tcl_platform(platform)" == "linux" } {
+
+ if { "$::tcl_platform(os)" == "Linux" } {
if { "$theBitness" == "64" } {
set aPath "/usr/lib/x86_64-linux-gnu/lib${theLib}.so"
if { [file exists "$aPath"] } {
@@ -312,15 +316,10 @@ proc wokdep:SearchFreeType {theErrInc theErrLib32 theErrLib64 theErrBin32 theErr
set isFound "true"
set aFtBuildPath [wokdep:SearchHeader "ft2build.h"]
- # new layout of headers in Freetype 2.5.x
- if { "$aFtBuildPath" == "" } {
- set aFtBuildPath [wokdep:SearchHeader "freetype2/ft2build.h"]
- }
-
if { "$aFtBuildPath" == "" } {
# TODO - use `freetype-config --cflags` instead
set aSysFreeType "/usr/include/freetype2"
- if { [file exists "$aSysFreeType/ftbuild.h"] } {
+ if { [file exists "$aSysFreeType/ft2build.h"] } {
lappend ::CSF_OPT_INC "$aSysFreeType"
} elseif { [file exists "$aSysFreeType/freetype2/ft2build.h"] } {
lappend ::CSF_OPT_INC "$aSysFreeType/freetype2"
@@ -955,8 +954,9 @@ proc wokdep:SaveCustom {} {
puts $aFile "#!/bin/bash"
puts $aFile "# This environment file was generated by wok_depsgui.tcl script at [clock format [clock seconds] -format "%Y.%m.%d %H:%M"]"
- #puts $aFile ""
- #puts $aFile "export ARCH=$::ARCH"
+ puts $aFile ""
+ puts $aFile "export ARCH=$::ARCH"
+ puts $aFile "export SHORTCUT_HEADERS=$::SHORTCUT_HEADERS"
puts $aFile ""
puts $aFile "export PRODUCTS_PATH=\"$::PRODUCTS_PATH\""
diff --git a/adm/genproj.tcl b/adm/genproj.tcl
index 06e187d124..df352bc394 100644
--- a/adm/genproj.tcl
+++ b/adm/genproj.tcl
@@ -1,19 +1,25 @@
# =======================================================================
# This script generates project files for different IDEs:
-# "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "cbp" "amk"
+# "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "cbp" "amk" "xcd"
#
# Example:
# genproj -path=D:/occt -target=vc10
+# genproj -target=xcd -ios -static
# =======================================================================
set path ""
set fBranch ""
switch -exact -- "$tcl_platform(platform)" {
- "windows" {set targetStation "wnt"}
- "unix" {set targetStation "lin"}
- #"macos" {set targetStation "wnt"}
+ "windows" {set targetStation "wnt"}
+ "unix" {set targetStation "lin"}
}
+switch -exact -- "$tcl_platform(os)" {
+ "Darwin" {set targetStation "mac"}
+}
+
+source "./adm/genconfdeps.tcl"
+
proc _get_options { platform type branch } {
global path
set res ""
@@ -83,7 +89,7 @@ proc _get_used_files { pk {inc true} {src true} } {
# Wrapper-function to generate VS project files
proc genproj { args } {
global path targetStation
- set aSupportedTargets { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "cbp" "amk" }
+ set aSupportedTargets { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "cbp" "amk" "xcd" }
set anArgs $args
# Setting default IDE.
@@ -91,11 +97,10 @@ proc genproj { args } {
switch -exact -- "$targetStation" {
"wnt" {set anTarget "$::env(VCVER)"}
"lin" {set anTarget "amk"}
- "mac" {set anTarget "cbp"}
+ "mac" {set anTarget "xcd"}
}
set isTargetDefault true
-
if { [set anIndex [lsearch -nocase $anArgs -target=*]] != -1 } {
regsub -nocase "\\-target=" [lindex $anArgs $anIndex] "" anTarget
set anArgs [removeAllOccurrencesOf -target=* $anArgs]
@@ -122,6 +127,23 @@ proc genproj { args } {
set isHelpRequire true
}
+ set aLibType "dynamic"
+ if { [lsearch -nocase $anArgs "-static"] != -1} {
+ set anArgs [removeAllOccurrencesOf "-static" $anArgs]
+ set aLibType "static"
+ puts "static build has been selected"
+ } elseif { [lsearch -nocase $anArgs "-dynamic"] != -1} {
+ set anArgs [removeAllOccurrencesOf "-dynamic" $anArgs]
+ set aLibType "dynamic"
+ puts "dynamic build has been selected"
+ }
+
+ set aPlatform ""
+ if { [lsearch -nocase $anArgs "-ios"] != -1} {
+ set anArgs [removeAllOccurrencesOf "-ios" $anArgs]
+ set aPlatform "ios"
+ }
+
if { [lsearch -nocase $aSupportedTargets $anTarget] == -1} {
puts "the \'$anTarget\' is wrong TARGET"
set isHelpRequire true
@@ -148,6 +170,7 @@ proc genproj { args } {
vc11 - Visual Studio 2012
vc12 - Visual Studio 2013
cbp - CodeBlocks
+ xcd - XCode
amk - AutoMake"
return
}
@@ -161,7 +184,7 @@ proc genproj { args } {
}
set anAdmPath "$path/adm"
- OS:MKPRC "$anAdmPath" "$anTarget"
+ OS:MKPRC "$anAdmPath" "$anTarget" "$aLibType" "$aPlatform"
genprojbat "$anAdmPath" "$anTarget"
}
@@ -181,6 +204,8 @@ proc genprojbat {thePath theIDE} {
set aTargetPlatform wnt
} elseif {"$theIDE" == "amk"} {
set aTargetPlatform lin
+ } elseif {"$theIDE" == "xcd"} {
+ set aTargetPlatform mac
}
set aTargetPlatformExt sh
@@ -190,10 +215,6 @@ proc genprojbat {thePath theIDE} {
set aBox [file normalize "$thePath/.."]
- if { "$aTargetPlatform" != "wnt" } {
- file copy -force -- "$path/adm/templates/config.h" "$aBox/src/config.h"
- }
-
if {"$theIDE" != "cmake"} {
set anEnvTmplFile [open "$path/adm/templates/env.${aTargetPlatformExt}" "r"]
set anEnvTmpl [read $anEnvTmplFile]
@@ -219,6 +240,7 @@ proc genprojbat {thePath theIDE} {
} else {
switch -exact -- "$theIDE" {
"cbp" { file copy -force -- "$path/adm/templates/codeblocks.sh" "$aBox/codeblocks.sh" }
+ "xcd" { file copy -force -- "$path/adm/templates/xcode.sh" "$aBox/xcode.sh" }
}
}
}
@@ -232,28 +254,13 @@ proc removeAllOccurrencesOf { theObject theList } {
return $theList
}
-proc OS:mkdir { d } {
- global tcl_version
- if ![file exists $d] {
- if { "$tcl_version" == "7.5" } {
- mkdir -path $d
- } else {
- file mkdir $d
- }
- if [file exists $d] {
- return $d
- } else {
- return {}
- }
- } else {
- return $d
- }
-}
+set aTKNullKey "TKNull"
+set THE_GUIDS_LIST($aTKNullKey) "{00000000-0000-0000-0000-000000000000}"
# Entry function to generate project files and solutions for IDE
-proc OS:MKPRC { {theOutDir {}} {theIDE ""} } {
+proc OS:MKPRC { {theOutDir {}} {theIDE ""} {theLibType "dynamic"} {thePlatform ""} } {
global path targetStation
- set aSupportedIDE { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "cbp" "amk" }
+ set aSupportedIDE { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "cbp" "amk" "xcd" }
if { [lsearch $aSupportedIDE $theIDE] < 0 } {
puts stderr "WOK does not support generation of project files for the selected IDE: $theIDE\nSupported IDEs: [join ${aSupportedIDE} " "]"
@@ -291,11 +298,15 @@ proc OS:MKPRC { {theOutDir {}} {theIDE ""} } {
# make list of modules and platforms
set aModules [OS:init]
+ if { "$thePlatform" == "ios" } {
+ set goaway [list Draw]
+ set aModules [osutils:juststation $goaway $aModules]
+ }
# generate one solution for all projects if complete OS or VAS is processed
set anAllSolution "OCCT"
- OS:mkdir $anOutDir
+ wokUtils:FILES:mkdir $anOutDir
if { ![file exists $anOutDir] } {
puts stderr "Error: Could not create output directory \"$anOutDir\""
return
@@ -321,11 +332,11 @@ proc OS:MKPRC { {theOutDir {}} {theIDE ""} } {
"vc12" { OS:MKVC $anOutDir $aModules $anAllSolution $theIDE }
"cbp" { OS:MKCBP $anOutDir $aModules $anAllSolution }
"amk" { OS:MKAMK $anOutDir $aModules "adm/${aWokStation}/${theIDE}"}
+ "xcd" {
+ set ::THE_GUIDS_LIST($::aTKNullKey) "000000000000000000000000"
+ OS:MKXCD $anOutDir $aModules $anAllSolution $theLibType $thePlatform
+ }
}
- # generate config.txt file
- #if { ${anAllSolution} == "Products" && "$targetStation" == "wnt" } {
- # osutils:mkCollectScript "collect_binary.cfg" "$anOutRoot/../" ${theIDE} $::env(ARCH) "release"
- #}
# Store generated GUIDs map
set anOutFile [open "$aGuidsFilePath" "w"]
@@ -1031,9 +1042,9 @@ proc osutils:commonUsedTK { theToolKit } {
}
return $anUsedToolKits
}
-# Return the list of name *CSF_ in a EXTERNLIB description of a toolkit
-proc osutils:tk:hascsf { EXTERNLIB } {
+# Return the list of name *CSF_ in a EXTERNLIB description of a toolkit
+proc osutils:tk:csfInExternlib { EXTERNLIB } {
set l [wokUtils:FILES:FileToList $EXTERNLIB]
set lret {STLPort}
foreach str $l {
@@ -1044,74 +1055,63 @@ proc osutils:tk:hascsf { EXTERNLIB } {
return $lret
}
-proc osutils:csfList { theOS theCsfMap } {
- upvar $theCsfMap aCsfMap
+# @param theCsfLibsMap - libraries map
+# @param theCsfFrmsMap - frameworks map, OS X specific
+proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap } {
+ upvar $theCsfLibsMap aLibsMap
+ upvar $theCsfFrmsMap aFrmsMap
- unset theCsfMap
+ unset theCsfLibsMap
+ unset theCsfFrmsMap
if { "$theOS" == "wnt" } {
- # -- WinAPI libraries
- set aCsfMap(CSF_kernel32) "kernel32.lib"
- set aCsfMap(CSF_advapi32) "advapi32.lib"
- set aCsfMap(CSF_gdi32) "gdi32.lib"
- set aCsfMap(CSF_user32) "user32.lib"
- set aCsfMap(CSF_glu32) "glu32.lib"
- set aCsfMap(CSF_opengl32) "opengl32.lib"
- set aCsfMap(CSF_wsock32) "wsock32.lib"
- set aCsfMap(CSF_netapi32) "netapi32.lib"
- set aCsfMap(CSF_AviLibs) "ws2_32.lib vfw32.lib"
- set aCsfMap(CSF_OpenGlLibs) "opengl32.lib glu32.lib"
+ # WinAPI libraries
+ set aLibsMap(CSF_kernel32) "kernel32.lib"
+ set aLibsMap(CSF_advapi32) "advapi32.lib"
+ set aLibsMap(CSF_gdi32) "gdi32.lib"
+ set aLibsMap(CSF_user32) "user32.lib"
+ set aLibsMap(CSF_glu32) "glu32.lib"
+ set aLibsMap(CSF_opengl32) "opengl32.lib"
+ set aLibsMap(CSF_wsock32) "wsock32.lib"
+ set aLibsMap(CSF_netapi32) "netapi32.lib"
+ set aLibsMap(CSF_AviLibs) "ws2_32.lib vfw32.lib"
+ set aLibsMap(CSF_OpenGlLibs) "opengl32.lib glu32.lib"
- # -- 3rd-parties precompiled libraries
- # Note: Tcl library name depends on version and is chosen by #pragma
- set aCsfMap(CSF_QT) "QtCore4.lib QtGui4.lib"
+ set aLibsMap(CSF_QT) "QtCore4.lib QtGui4.lib"
- #-- VTK
+ # VTK
set aCsfMap(CSF_VTK) [osutils:vtkCsf "wnt"]
-
} else {
-
- #-- Tcl/Tk configuration
- set aCsfMap(CSF_TclLibs) "tcl8.6"
- set aCsfMap(CSF_TclTkLibs) "X11 tk8.6"
-
- if { "$theOS" == "lin" } {
- set aCsfMap(CSF_ThreadLibs) "pthread rt"
- set aCsfMap(CSF_OpenGlLibs) "GLU GL"
-
- } elseif { "$theOS" == "mac" } {
- set aCsfMap(CSF_objc) "objc"
-
- # frameworks
- set aCsfMap(CSF_Appkit) "Appkit"
- set aCsfMap(CSF_IOKit) "IOKit"
- set aCsfMap(CSF_OpenGlLibs) "OpenGL"
- set aCsfMap(CSF_TclLibs) "Tcl"
- set aCsfMap(CSF_TclTkLibs) "Tk"
+ set aLibsMap(CSF_FREETYPE) "freetype"
+ if { "$theOS" == "mac" } {
+ set aLibsMap(CSF_objc) "objc"
+ set aFrmsMap(CSF_Appkit) "Appkit"
+ set aFrmsMap(CSF_IOKit) "IOKit"
+ set aFrmsMap(CSF_OpenGlLibs) "OpenGL"
+ set aFrmsMap(CSF_TclLibs) "Tcl"
+ set aFrmsMap(CSF_TclTkLibs) "Tk"
+ } else {
+ set aLibsMap(CSF_ThreadLibs) "pthread rt"
+ set aLibsMap(CSF_OpenGlLibs) "GLU GL"
+ set aLibsMap(CSF_TclLibs) "tcl8.6"
+ set aLibsMap(CSF_TclTkLibs) "X11 tk8.6"
+ set aLibsMap(CSF_XwLibs) "X11 Xext Xmu Xi"
+ set aLibsMap(CSF_MotifLibs) "X11"
}
- set aCsfMap(CSF_XwLibs) "X11 Xext Xmu Xi"
- set aCsfMap(CSF_MotifLibs) "X11"
-
- # variable is required for support for OCCT version that use fgtl
- #-- FTGL (font renderer for OpenGL)
- set aCsfMap(CSF_FTGL) "ftgl"
-
- #-- FreeType
- set aCsfMap(CSF_FREETYPE) "freetype"
-
- #-- optional 3rd-parties
- #-- TBB
- set aCsfMap(CSF_TBB) "tbb tbbmalloc"
-
- #-- FreeImage
- set aCsfMap(CSF_FreeImagePlus) "freeimage"
-
- #-- GL2PS
- set aCsfMap(CSF_GL2PS) "gl2ps"
-
- #-- VTK
- set aCsfMap(CSF_VTK) [osutils:vtkCsf "unix"]
+ # optional 3rd-parties
+ if { "$::HAVE_TBB" == "true" } {
+ set aLibsMap(CSF_TBB) "tbb tbbmalloc"
+ }
+ if { "$::HAVE_FREEIMAGE" == "true" } {
+ set aLibsMap(CSF_FreeImagePlus) "freeimage"
+ }
+ if { "$::HAVE_GL2PS" == "true" } {
+ set aLibsMap(CSF_GL2PS) "gl2ps"
+ }
+ if { "$::HAVE_VTK" == "true" } {
+ set aCsfMap(CSF_VTK) [osutils:vtkCsf "unix"]
+ }
}
}
@@ -1147,26 +1147,33 @@ proc osutils:vtkCsf {{theOS ""}} {
return [join $aLibArray " "]
}
-proc osutils:usedOsLibs { theToolKit theOS } {
+# @param theLibsList - dependencies (libraries list)
+# @param theFrameworks - dependencies (frameworks list, OS X specific)
+proc osutils:usedOsLibs { theToolKit theOS theLibsList theFrameworks } {
global path
- set aUsedLibs [list]
+ upvar $theLibsList aLibsList
+ upvar $theFrameworks aFrameworks
+ set aLibsList [list]
+ set aFrameworks [list]
- osutils:csfList $theOS anOsCsfList
+ osutils:csfList $theOS aLibsMap aFrmsMap
- foreach element [osutils:tk:hascsf "$path/src/${theToolKit}/EXTERNLIB"] {
- # test if variable is not setted - continue
- if ![info exists anOsCsfList($element)] {
- continue
+ foreach aCsfElem [osutils:tk:csfInExternlib "$path/src/${theToolKit}/EXTERNLIB"] {
+ if [info exists aLibsMap($aCsfElem)] {
+ foreach aLib [split "$aLibsMap($aCsfElem)"] {
+ if { [lsearch $aLibsList $aLib] == "-1" } {
+ lappend aLibsList $aLib
+ }
+ }
}
-
- foreach aLib [split "$anOsCsfList($element)"] {
- if { [lsearch $aUsedLibs $aLib] == "-1"} {
- lappend aUsedLibs $aLib
+ if [info exists aFrmsMap($aCsfElem)] {
+ foreach aFrm [split "$aFrmsMap($aCsfElem)"] {
+ if { [lsearch $aFrameworks $aFrm] == "-1" } {
+ lappend aFrameworks $aFrm
+ }
}
}
}
-
- return $aUsedLibs
}
# Returns liste of UD in a toolkit. tkloc is a full path wok.
@@ -1421,7 +1428,8 @@ proc osutils:vcproj { theVcVer theOutDir theToolKit theGuidsMap {theProjTmpl {}
lappend aCommonUsedTK "${tkx}.lib"
}
- set aUsedToolKits [concat $aCommonUsedTK [osutils:usedOsLibs $theToolKit "wnt"]]
+ osutils:usedOsLibs $theToolKit "wnt" aLibs aFrameworks
+ set aUsedToolKits [concat $aCommonUsedTK $aLibs]
# correct names of referred third-party libraries that are named with suffix
# depending on VC version
@@ -1637,7 +1645,8 @@ proc osutils:vcprojx { theVcVer theOutDir theToolKit theGuidsMap {theProjTmpl {}
lappend aCommonUsedTK "${tkx}.lib"
}
- set aUsedToolKits [concat $aCommonUsedTK [osutils:usedOsLibs $theToolKit "wnt"]]
+ osutils:usedOsLibs $theToolKit "wnt" aLibs aFrameworks
+ set aUsedToolKits [concat $aCommonUsedTK $aLibs]
# correct names of referred third-party libraries that are named with suffix
# depending on VC version
@@ -1883,7 +1892,7 @@ proc wokUtils:LIST:sanspoint { l } {
# remove from listloc OpenCascade units indesirables on Unix
proc osutils:justunix { listloc } {
- if { "$::tcl_platform(os)" == "Darwin" && "$::MACOSX_USE_GLX" != "true" } {
+ if { "$::tcl_platform(os)" == "Darwin" } {
set goaway [list Xw WNT]
} else {
set goaway [list WNT]
@@ -2016,7 +2025,7 @@ proc osutils:tk:mkam { dir tkloc } {
set lsrc [lsort [osutils:tk:files $tkloc osutils:compilable 1 osutils:justunix]]
set lobj [wokUtils:LIST:sanspoint $lsrc]
- set lcsf [osutils:tk:hascsf $path/src/${tkloc}/EXTERNLIB]
+ set lcsf [osutils:tk:csfInExternlib $path/src/${tkloc}/EXTERNLIB]
set final 0
set externinc ""
@@ -2094,11 +2103,11 @@ proc osutils:tk:mkamx { dir tkloc } {
set pkgs [LibToLinkX $tkloc [lindex $CXXList 0]]
set lpkgs [osutils:justunix [wokUtils:FILES:FileToList $pkgs]]
puts "pkgs $pkgs"
- #set lcsf [osutils:tk:hascsf [woklocate -p ${tkloc}:source:EXTERNLIB [wokcd]]]
+ #set lcsf [osutils:tk:csfInExternlib [woklocate -p ${tkloc}:source:EXTERNLIB [wokcd]]]
set lcsf {}
foreach tk $pkgs {
- foreach element [osutils:tk:hascsf "$path/src/${tk}/EXTERNLIB"] {
+ foreach element [osutils:tk:csfInExternlib "$path/src/${tk}/EXTERNLIB"] {
if {[lsearch $lcsf $element] == "-1"} {
set lcsf [concat $lcsf $element]
}
@@ -2161,11 +2170,11 @@ proc osutils:tk:mkamx { dir tkloc } {
}
set pkgs [LibToLinkX $tkloc [lindex $CXXList 0]]
set lpkgs [osutils:justunix [wokUtils:FILES:FileToList $pkgs]]
- set lcsf [osutils:tk:hascsf "$path/src/${tkloc}/EXTERNLIB"]
+ set lcsf [osutils:tk:csfInExternlib "$path/src/${tkloc}/EXTERNLIB"]
set lcsf {}
foreach tk $pkgs {
- foreach element [osutils:tk:hascsf "$path/src/${tk}/EXTERNLIB"] {
+ foreach element [osutils:tk:csfInExternlib "$path/src/${tk}/EXTERNLIB"] {
if {[lsearch $lcsf $element] == "-1"} {
set lcsf [concat $lcsf $element]
}
@@ -2670,6 +2679,7 @@ proc osutils:cbpx { theOutDir theToolKit } {
set aTKSrcFiles [list]
set aProjName [file rootname [file tail $aSrcFile]]
+ osutils:usedOsLibs $theToolKit "$aWokStation" aUsedToolKits aFrameworks
set aDepToolkits [LibToLinkX $theToolKit $aProjName]
foreach tkx $aDepToolkits {
if {[_get_type $tkx] == "t"} {
@@ -2680,40 +2690,6 @@ proc osutils:cbpx { theOutDir theToolKit } {
}
}
- #wokparam -l CSF
-
- foreach tk $aDepToolkits {
- foreach element [osutils:tk:hascsf $path/src/${tk}/EXTERNLIB] {
- if {[_get_options lin csf $element] == ""} {
- continue
- }
- set isFrameworkNext 0
- foreach fl [split [_get_options lin csf $element]] {
- if {[string first "-libpath" $fl] != "-1"} {
- # this is library search path, not the library name
- continue
- } elseif {[string first "-framework" $fl] != "-1"} {
- set isFrameworkNext 1
- continue
- }
-
- set felem [file tail $fl]
- if {$isFrameworkNext == 1} {
- if {[lsearch $aFrameworks $felem] == "-1"} {
- lappend aFrameworks "${felem}"
- }
- set isFrameworkNext 0
- } elseif {[lsearch $aUsedToolKits $felem] == "-1"} {
- if {$felem != "\{\}" & $felem != "lib"} {
- if {[lsearch -nocase [osutils:optinal_libs] $felem] == -1} {
- lappend aUsedToolKits [string trimleft "${felem}" "-l"]
- }
- }
- }
- }
- }
- }
-
set WOKSteps_exec_link [_get_options lin WOKSteps_exec_link $theToolKit]
if { [regexp {WOKStep_DLLink} $WOKSteps_exec_link] || [regexp {WOKStep_Libink} $WOKSteps_exec_link] } {
set isExecutable "false"
@@ -2736,14 +2712,12 @@ proc osutils:cbpx { theOutDir theToolKit } {
# common include paths
lappend anIncPaths "../../../inc"
- # macros for UNIX to use config.h file
+ # extra macros
lappend aTKDefines "CSFDB"
if { "$aWokStation" == "wnt" } {
lappend aTKDefines "WNT"
lappend aTKDefines "_CRT_SECURE_NO_DEPRECATE"
} else {
- lappend aTKDefines "HAVE_WOK_CONFIG_H"
- lappend aTKDefines "HAVE_CONFIG_H"
if { "$aWokStation" == "lin" } {
lappend aTKDefines "LIN"
}
@@ -2972,45 +2946,12 @@ proc osutils:tkinfo { theRelativePath theToolKit theUsedLib theFrameworks theInc
upvar $theTKDefines aTKDefines
upvar $theTKSrcFiles aTKSrcFiles
+ osutils:usedOsLibs $theToolKit "$aWokStation" aUsedLibs aFrameworks
set aDepToolkits [wokUtils:LIST:Purge [osutils:tk:close $theToolKit]]
foreach tkx $aDepToolkits {
lappend aUsedLibs "${tkx}"
}
- # wokparam -l CSF
-
- foreach tk [lappend aDepToolkits $theToolKit] {
- foreach element [osutils:tk:hascsf $path/src/${tk}/EXTERNLIB] {
- if {[_get_options lin csf $element] == ""} {
- continue
- }
- set isFrameworkNext 0
- foreach fl [split [_get_options lin csf $element]] {
- if {[string first "-libpath" $fl] != "-1"} {
- # this is library search path, not the library name
- continue
- } elseif {[string first "-framework" $fl] != "-1"} {
- set isFrameworkNext 1
- continue
- }
-
- set felem [file tail $fl]
- if {$isFrameworkNext == 1} {
- if {[lsearch $aFrameworks $felem] == "-1"} {
- lappend aFrameworks "${felem}"
- }
- set isFrameworkNext 0
- } elseif {[lsearch $aUsedLibs $felem] == "-1"} {
- if {$felem != "\{\}" & $felem != "lib"} {
- if {[lsearch -nocase [osutils:optinal_libs] $felem] == -1} {
- lappend aUsedLibs [string trimleft "${felem}" "-l"]
- }
- }
- }
- }
- }
- }
-
lappend anIncPaths "$theRelativePath/inc"
set listloc [osutils:tk:units $theToolKit]
@@ -3045,14 +2986,12 @@ proc osutils:tkinfo { theRelativePath theToolKit theUsedLib theFrameworks theInc
# lappend anIncPaths "${theRelativePath}/src/${xlo}"
}
- # macros for UNIX to use config.h file
+ # extra macros
lappend aTKDefines "CSFDB"
if { "$aWokStation" == "wnt" } {
lappend aTKDefines "WNT"
lappend aTKDefines "_CRT_SECURE_NO_DEPRECATE"
} else {
- lappend aTKDefines "HAVE_WOK_CONFIG_H"
- lappend aTKDefines "HAVE_CONFIG_H"
if { "$aWokStation" == "lin" } {
lappend aTKDefines "LIN"
}
@@ -3067,5 +3006,778 @@ proc LibToLinkX {thePackage theDummyName} {
return $aToolKits
}
+# Function to generate Xcode workspace and project files
+proc OS:MKXCD { theOutDir {theModules {}} {theAllSolution ""} {theLibType "dynamic"} {thePlatform ""} } {
+
+ puts stderr "Generating project files for Xcode"
+
+ # Generate projects for toolkits and separate workspace for each module
+ foreach aModule $theModules {
+ OS:xcworkspace $aModule $aModule $theOutDir
+ OS:xcodeproj $aModule $theOutDir ::THE_GUIDS_LIST $theLibType $thePlatform
+ }
+
+ # Generate single workspace "OCCT" containing projects from all modules
+ if { "$theAllSolution" != "" } {
+ OS:xcworkspace $theAllSolution $theModules $theOutDir
+ }
+}
+
+# Generates toolkits sections for Xcode workspace file.
+proc OS:xcworkspace:toolkits { theModule } {
+ set aBuff ""
+
+ # Adding toolkits for module in workspace.
+ foreach aToolKit [osutils:tk:sort [${theModule}:toolkits]] {
+ append aBuff " \n"
+ append aBuff " \n"
+ }
+
+ # Adding executables for module, assume one project per cxx file...
+ foreach aUnit [OS:executable ${theModule}] {
+ set aUnitLoc $aUnit
+ set src_files [_get_used_files $aUnit false]
+ set aSrcFiles {}
+ foreach s $src_files {
+ regexp {source ([^\s]+)} $s dummy name
+ lappend aSrcFiles $name
+ }
+ foreach aSrcFile $aSrcFiles {
+ set aFileExtension [file extension $aSrcFile]
+ if { $aFileExtension == ".cxx" } {
+ set aPrjName [file rootname $aSrcFile]
+ append aBuff " \n"
+ append aBuff " \n"
+ }
+ }
+ }
+
+ # Removing unnecessary newline character from the end.
+ set aBuff [string replace $aBuff end end]
+ return $aBuff
+}
+
+# Generates workspace files for Xcode.
+proc OS:xcworkspace { theWorkspaceName theModules theOutDir } {
+ # Creating workspace directory for Xcode.
+ set aWorkspaceDir "${theOutDir}/${theWorkspaceName}.xcworkspace"
+ wokUtils:FILES:mkdir $aWorkspaceDir
+ if { ! [file exists $aWorkspaceDir] } {
+ puts stderr "Error: Could not create workspace directory \"$aWorkspaceDir\""
+ return
+ }
+
+ # Creating workspace file.
+ set aWsFilePath "${aWorkspaceDir}/contents.xcworkspacedata"
+ set aFile [open $aWsFilePath "w"]
+
+ # Adding header and section for main Group.
+ puts $aFile ""
+ puts $aFile ""
+ puts $aFile " "
+
+ # Adding modules.
+ if { [llength "$theModules"] > 1 } {
+ foreach aModule $theModules {
+ puts $aFile " "
+ puts $aFile [OS:xcworkspace:toolkits $aModule]
+ puts $aFile " "
+ }
+ } else {
+ puts $aFile [OS:xcworkspace:toolkits $theModules]
+ }
+
+ # Adding footer.
+ puts $aFile " "
+ puts $aFile ""
+ close $aFile
+}
+
+# Generates Xcode project files.
+proc OS:xcodeproj { theModules theOutDir theGuidsMap theLibType thePlatform} {
+ upvar $theGuidsMap aGuidsMap
+
+ set isStatic 0
+ if { "$theLibType" == "static" } {
+ set isStatic 1
+ } elseif { "$thePlatform" == "ios" } {
+ set isStatic 1
+ }
+
+ set aProjectFiles {}
+ foreach aModule $theModules {
+ foreach aToolKit [${aModule}:toolkits] {
+ lappend aProjectFiles [osutils:xcdtk $theOutDir $aToolKit aGuidsMap $isStatic $thePlatform "dylib"]
+ }
+ foreach anExecutable [OS:executable ${aModule}] {
+ lappend aProjectFiles [osutils:xcdtk $theOutDir $anExecutable aGuidsMap $isStatic $thePlatform "executable"]
+ }
+ }
+ return $aProjectFiles
+}
+
+# Generates dependencies section for Xcode project files.
+proc osutils:xcdtk:deps {theToolKit theTargetType theGuidsMap theFileRefSection theDepsGuids theDepsRefGuids theIsStatic} {
+ global path
+ upvar $theGuidsMap aGuidsMap
+ upvar $theFileRefSection aFileRefSection
+ upvar $theDepsGuids aDepsGuids
+ upvar $theDepsRefGuids aDepsRefGuids
+
+ set aBuildFileSection ""
+ set aUsedToolKits [wokUtils:LIST:Purge [osutils:tk:close $theToolKit]]
+ set aDepToolkits [lappend [wokUtils:LIST:Purge [osutils:tk:close $theToolKit]] $theToolKit]
+
+ if { "$theTargetType" == "executable" } {
+ set aFile [osutils:tk:files $theToolKit osutils:compilable 0]
+ set aProjName [file rootname [file tail $aFile]]
+ set aDepToolkits [LibToLinkX $theToolKit $aProjName]
+ }
+
+ set aLibExt "dylib"
+ if { $theIsStatic == 1 } {
+ set aLibExt "a"
+ if { "$theTargetType" != "executable" } {
+ return $aBuildFileSection
+ }
+ }
+
+ osutils:usedOsLibs $theToolKit "mac" aLibs aFrameworks
+ set aUsedToolKits [concat $aUsedToolKits $aLibs]
+ set aUsedToolKits [concat $aUsedToolKits $aFrameworks]
+ foreach tkx $aUsedToolKits {
+ set aDepLib "${tkx}_Dep"
+ set aDepLibRef "${tkx}_DepRef"
+
+ if { ! [info exists aGuidsMap($aDepLib)] } {
+ set aGuidsMap($aDepLib) [OS:genGUID "xcd"]
+ }
+ if { ! [info exists aGuidsMap($aDepLibRef)] } {
+ set aGuidsMap($aDepLibRef) [OS:genGUID "xcd"]
+ }
+
+ append aBuildFileSection "\t\t$aGuidsMap($aDepLib) = \{isa = PBXBuildFile; fileRef = $aGuidsMap($aDepLibRef) ; \};\n"
+ if {[lsearch -nocase $aFrameworks $tkx] == -1} {
+ append aFileRefSection "\t\t$aGuidsMap($aDepLibRef) = \{isa = PBXFileReference; lastKnownFileType = file; name = lib${tkx}.${aLibExt}; path = lib${tkx}.${aLibExt}; sourceTree = \"\"; \};\n"
+ } else {
+ append aFileRefSection "\t\t$aGuidsMap($aDepLibRef) = \{isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ${tkx}.framework; path = /System/Library/Frameworks/${tkx}.framework; sourceTree = \"\"; \};\n"
+ }
+ append aDepsGuids "\t\t\t\t$aGuidsMap($aDepLib) ,\n"
+ append aDepsRefGuids "\t\t\t\t$aGuidsMap($aDepLibRef) ,\n"
+ }
+
+ return $aBuildFileSection
+}
+
+# Generates PBXBuildFile and PBXGroup sections for project file.
+proc osutils:xcdtk:sources {theToolKit theTargetType theSrcFileRefSection theGroupSection thePackageGuids theSrcFileGuids theGuidsMap theIncPaths} {
+ upvar $theSrcFileRefSection aSrcFileRefSection
+ upvar $theGroupSection aGroupSection
+ upvar $thePackageGuids aPackagesGuids
+ upvar $theSrcFileGuids aSrcFileGuids
+ upvar $theGuidsMap aGuidsMap
+ upvar $theIncPaths anIncPaths
+
+ set listloc [osutils:tk:units $theToolKit]
+ set resultloc [osutils:justunix $listloc]
+ set aBuildFileSection ""
+ set aPackages [lsort -nocase $resultloc]
+ if { "$theTargetType" == "executable" } {
+ set aPackages [list "$theToolKit"]
+ }
+
+ # Generating PBXBuildFile, PBXGroup sections and groups for each package.
+ foreach fxlo $aPackages {
+ set xlo $fxlo
+ set aPackage "${xlo}_Package"
+ set aSrcFileRefGuids ""
+ if { ! [info exists aGuidsMap($aPackage)] } {
+ set aGuidsMap($aPackage) [OS:genGUID "xcd"]
+ }
+
+ set aSrcFiles [osutils:tk:files $xlo osutils:compilable 0]
+ foreach aSrcFile [lsort $aSrcFiles] {
+ set aFileExt "sourcecode.cpp.cpp"
+
+ if { [file extension $aSrcFile] == ".c" } {
+ set aFileExt "sourcecode.c.c"
+ } elseif { [file extension $aSrcFile] == ".mm" } {
+ set aFileExt "sourcecode.cpp.objcpp"
+ }
+
+ if { ! [info exists aGuidsMap($aSrcFile)] } {
+ set aGuidsMap($aSrcFile) [OS:genGUID "xcd"]
+ }
+ set aSrcFileRef "${aSrcFile}_Ref"
+ if { ! [info exists aGuidsMap($aSrcFileRef)] } {
+ set aGuidsMap($aSrcFileRef) [OS:genGUID "xcd"]
+ }
+ if { ! [info exists written([file tail $aSrcFile])] } {
+ set written([file tail $aSrcFile]) 1
+ append aBuildFileSection "\t\t$aGuidsMap($aSrcFile) = \{isa = PBXBuildFile; fileRef = $aGuidsMap($aSrcFileRef) ;\};\n"
+ append aSrcFileRefSection "\t\t$aGuidsMap($aSrcFileRef) = \{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = ${aFileExt}; name = [wokUtils:FILES:wtail $aSrcFile 1]; path = ../../../[wokUtils:FILES:wtail $aSrcFile 3]; sourceTree = \"\"; \};\n"
+ append aSrcFileGuids "\t\t\t\t$aGuidsMap($aSrcFile) ,\n"
+ append aSrcFileRefGuids "\t\t\t\t$aGuidsMap($aSrcFileRef) ,\n"
+ } else {
+ puts "Warning : more than one occurences for [file tail $aSrcFile]"
+ }
+ }
+
+ append aGroupSection "\t\t$aGuidsMap($aPackage) = \{\n"
+ append aGroupSection "\t\t\tisa = PBXGroup;\n"
+ append aGroupSection "\t\t\tchildren = (\n"
+ append aGroupSection $aSrcFileRefGuids
+ append aGroupSection "\t\t\t);\n"
+ append aGroupSection "\t\t\tname = $xlo;\n"
+ append aGroupSection "\t\t\tsourceTree = \"\";\n"
+ append aGroupSection "\t\t\};\n"
+
+ # Storing packages IDs for adding them later as a child of toolkit
+ append aPackagesGuids "\t\t\t\t$aGuidsMap($aPackage) ,\n"
+ }
+
+ # Removing unnecessary newline character from the end.
+ set aPackagesGuids [string replace $aPackagesGuids end end]
+
+ return $aBuildFileSection
+}
+
+# Creates folders structure and all necessary files for Xcode project.
+proc osutils:xcdtk { theOutDir theToolKit theGuidsMap theIsStatic thePlatform {theTargetType "dylib"} } {
+ set aPBXBuildPhase "Headers"
+ set aRunOnlyForDeployment "0"
+ set aProductType "library.dynamic"
+ set anExecExtension "\t\t\t\tEXECUTABLE_EXTENSION = dylib;"
+ set anExecPrefix "\t\t\t\tEXECUTABLE_PREFIX = lib;"
+ set aWrapperExtension "\t\t\t\tWRAPPER_EXTENSION = dylib;"
+ set aTKDefines [list "CSFDB" "OCC_CONVERT_SIGNALS"]
+
+ if { "$theTargetType" == "executable" } {
+ set aPBXBuildPhase "CopyFiles"
+ set aRunOnlyForDeployment "1"
+ set aProductType "tool"
+ set anExecExtension ""
+ set anExecPrefix ""
+ set aWrapperExtension ""
+ } elseif { $theIsStatic == 1 } {
+ set aProductType "library.static"
+ set anExecExtension "\t\t\t\tEXECUTABLE_EXTENSION = a;"
+ set aWrapperExtension "\t\t\t\tWRAPPER_EXTENSION = a;"
+ }
+
+ set aUsername [exec whoami]
+
+ # Creation of folders for Xcode projectP.
+ set aToolkitDir "${theOutDir}/${theToolKit}.xcodeproj"
+ wokUtils:FILES:mkdir $aToolkitDir
+ if { ! [file exists $aToolkitDir] } {
+ puts stderr "Error: Could not create project directory \"$aToolkitDir\""
+ return
+ }
+
+ set aUserDataDir "${aToolkitDir}/xcuserdata"
+ wokUtils:FILES:mkdir $aUserDataDir
+ if { ! [file exists $aUserDataDir] } {
+ puts stderr "Error: Could not create xcuserdata directorty in \"$aToolkitDir\""
+ return
+ }
+
+ set aUserDataDir "${aUserDataDir}/${aUsername}.xcuserdatad"
+ wokUtils:FILES:mkdir $aUserDataDir
+ if { ! [file exists $aUserDataDir] } {
+ puts stderr "Error: Could not create ${aUsername}.xcuserdatad directorty in \"$aToolkitDir\"/xcuserdata"
+ return
+ }
+
+ set aSchemesDir "${aUserDataDir}/xcschemes"
+ wokUtils:FILES:mkdir $aSchemesDir
+ if { ! [file exists $aSchemesDir] } {
+ puts stderr "Error: Could not create xcschemes directorty in \"$aUserDataDir\""
+ return
+ }
+ # End of folders creation.
+
+ # Generating GUID for tookit.
+ upvar $theGuidsMap aGuidsMap
+ if { ! [info exists aGuidsMap($theToolKit)] } {
+ set aGuidsMap($theToolKit) [OS:genGUID "xcd"]
+ }
+
+ # Creating xcscheme file for toolkit from template.
+ set aXcschemeTmpl [osutils:readtemplate "xcscheme" "xcd"]
+ regsub -all -- {__TOOLKIT_NAME__} $aXcschemeTmpl $theToolKit aXcschemeTmpl
+ regsub -all -- {__TOOLKIT_GUID__} $aXcschemeTmpl $aGuidsMap($theToolKit) aXcschemeTmpl
+ set aXcschemeFile [open "$aSchemesDir/${theToolKit}.xcscheme" "w"]
+ puts $aXcschemeFile $aXcschemeTmpl
+ close $aXcschemeFile
+
+ # Creating xcschememanagement.plist file for toolkit from template.
+ set aPlistTmpl [osutils:readtemplate "plist" "xcd"]
+ regsub -all -- {__TOOLKIT_NAME__} $aPlistTmpl $theToolKit aPlistTmpl
+ regsub -all -- {__TOOLKIT_GUID__} $aPlistTmpl $aGuidsMap($theToolKit) aPlistTmpl
+ set aPlistFile [open "$aSchemesDir/xcschememanagement.plist" "w"]
+ puts $aPlistFile $aPlistTmpl
+ close $aPlistFile
+
+ # Creating project.pbxproj file for toolkit.
+ set aPbxprojFile [open "$aToolkitDir/project.pbxproj" "w"]
+ puts $aPbxprojFile "// !\$*UTF8*\$!"
+ puts $aPbxprojFile "\{"
+ puts $aPbxprojFile "\tarchiveVersion = 1;"
+ puts $aPbxprojFile "\tclasses = \{"
+ puts $aPbxprojFile "\t\};"
+ puts $aPbxprojFile "\tobjectVersion = 46;"
+ puts $aPbxprojFile "\tobjects = \{\n"
+
+ # Begin PBXBuildFile section
+ set aPackagesGuids ""
+ set aGroupSection ""
+ set aSrcFileRefSection ""
+ set aSrcFileGuids ""
+ set aDepsFileRefSection ""
+ set aDepsGuids ""
+ set aDepsRefGuids ""
+ set anIncPaths [list "../../../inc"]
+ set anLibPaths ""
+
+ if { [info exists ::env(CSF_OPT_INC)] } {
+ set anIncCfg [split "$::env(CSF_OPT_INC)" ":"]
+ foreach anIncCfgPath $anIncCfg {
+ lappend anIncPaths $anIncCfgPath
+ }
+ }
+ if { [info exists ::env(CSF_OPT_LIB64)] } {
+ set anLibCfg [split "$::env(CSF_OPT_LIB64)" ":"]
+ foreach anLibCfgPath $anLibCfg {
+ lappend anLibPaths $anLibCfgPath
+ }
+ }
+
+ puts $aPbxprojFile [osutils:xcdtk:sources $theToolKit $theTargetType aSrcFileRefSection aGroupSection aPackagesGuids aSrcFileGuids aGuidsMap anIncPaths]
+ puts $aPbxprojFile [osutils:xcdtk:deps $theToolKit $theTargetType aGuidsMap aDepsFileRefSection aDepsGuids aDepsRefGuids $theIsStatic]
+ # End PBXBuildFile section
+
+ # Begin PBXFileReference section
+ set aToolkitLib "lib${theToolKit}.dylib"
+ set aPath "$aToolkitLib"
+ if { "$theTargetType" == "executable" } {
+ set aPath "$theToolKit"
+ } elseif { $theIsStatic == 1 } {
+ set aToolkitLib "lib${theToolKit}.a"
+ }
+
+ if { ! [info exists aGuidsMap($aToolkitLib)] } {
+ set aGuidsMap($aToolkitLib) [OS:genGUID "xcd"]
+ }
+
+ puts $aPbxprojFile "\t\t$aGuidsMap($aToolkitLib) = {isa = PBXFileReference; explicitFileType = \"compiled.mach-o.${theTargetType}\"; includeInIndex = 0; path = $aPath; sourceTree = BUILT_PRODUCTS_DIR; };\n"
+ puts $aPbxprojFile $aSrcFileRefSection
+ puts $aPbxprojFile $aDepsFileRefSection
+ # End PBXFileReference section
+
+
+ # Begin PBXFrameworksBuildPhase section
+ set aTkFrameworks "${theToolKit}_Frameworks"
+ if { ! [info exists aGuidsMap($aTkFrameworks)] } {
+ set aGuidsMap($aTkFrameworks) [OS:genGUID "xcd"]
+ }
+
+ puts $aPbxprojFile "\t\t$aGuidsMap($aTkFrameworks) = \{"
+ puts $aPbxprojFile "\t\t\tisa = PBXFrameworksBuildPhase;"
+ puts $aPbxprojFile "\t\t\tbuildActionMask = 2147483647;"
+ puts $aPbxprojFile "\t\t\tfiles = ("
+ puts $aPbxprojFile $aDepsGuids
+ puts $aPbxprojFile "\t\t\t);"
+ puts $aPbxprojFile "\t\t\trunOnlyForDeploymentPostprocessing = 0;"
+ puts $aPbxprojFile "\t\t\};\n"
+ # End PBXFrameworksBuildPhase section
+
+ # Begin PBXGroup section
+ set aTkPBXGroup "${theToolKit}_PBXGroup"
+ if { ! [info exists aGuidsMap($aTkPBXGroup)] } {
+ set aGuidsMap($aTkPBXGroup) [OS:genGUID "xcd"]
+ }
+
+ set aTkSrcGroup "${theToolKit}_SrcGroup"
+ if { ! [info exists aGuidsMap($aTkSrcGroup)] } {
+ set aGuidsMap($aTkSrcGroup) [OS:genGUID "xcd"]
+ }
+
+ puts $aPbxprojFile $aGroupSection
+ puts $aPbxprojFile "\t\t$aGuidsMap($aTkPBXGroup) = \{"
+ puts $aPbxprojFile "\t\t\tisa = PBXGroup;"
+ puts $aPbxprojFile "\t\t\tchildren = ("
+ puts $aPbxprojFile $aDepsRefGuids
+ puts $aPbxprojFile "\t\t\t\t$aGuidsMap($aTkSrcGroup) ,"
+ puts $aPbxprojFile "\t\t\t\t$aGuidsMap($aToolkitLib) ,"
+ puts $aPbxprojFile "\t\t\t);"
+ puts $aPbxprojFile "\t\t\tsourceTree = \"\";"
+ puts $aPbxprojFile "\t\t\};"
+ puts $aPbxprojFile "\t\t$aGuidsMap($aTkSrcGroup) = \{"
+ puts $aPbxprojFile "\t\t\tisa = PBXGroup;"
+ puts $aPbxprojFile "\t\t\tchildren = ("
+ puts $aPbxprojFile $aPackagesGuids
+ puts $aPbxprojFile "\t\t\t);"
+ puts $aPbxprojFile "\t\t\tname = \"Source files\";"
+ puts $aPbxprojFile "\t\t\tsourceTree = \"\";"
+ puts $aPbxprojFile "\t\t\};\n"
+ # End PBXGroup section
+
+ # Begin PBXHeadersBuildPhase section
+ set aTkHeaders "${theToolKit}_Headers"
+ if { ! [info exists aGuidsMap($aTkHeaders)] } {
+ set aGuidsMap($aTkHeaders) [OS:genGUID "xcd"]
+ }
+
+ puts $aPbxprojFile "\t\t$aGuidsMap($aTkHeaders) = \{"
+ puts $aPbxprojFile "\t\t\tisa = PBX${aPBXBuildPhase}BuildPhase;"
+ puts $aPbxprojFile "\t\t\tbuildActionMask = 2147483647;"
+ puts $aPbxprojFile "\t\t\tfiles = ("
+ puts $aPbxprojFile "\t\t\t);"
+ puts $aPbxprojFile "\t\t\trunOnlyForDeploymentPostprocessing = ${aRunOnlyForDeployment};"
+ puts $aPbxprojFile "\t\t\};\n"
+ # End PBXHeadersBuildPhase section
+
+ # Begin PBXNativeTarget section
+ set aTkBuildCfgListNativeTarget "${theToolKit}_BuildCfgListNativeTarget"
+ if { ! [info exists aGuidsMap($aTkBuildCfgListNativeTarget)] } {
+ set aGuidsMap($aTkBuildCfgListNativeTarget) [OS:genGUID "xcd"]
+ }
+
+ set aTkSources "${theToolKit}_Sources"
+ if { ! [info exists aGuidsMap($aTkSources)] } {
+ set aGuidsMap($aTkSources) [OS:genGUID "xcd"]
+ }
+
+ puts $aPbxprojFile "\t\t$aGuidsMap($theToolKit) = \{"
+ puts $aPbxprojFile "\t\t\tisa = PBXNativeTarget;"
+ puts $aPbxprojFile "\t\t\tbuildConfigurationList = $aGuidsMap($aTkBuildCfgListNativeTarget) ;"
+ puts $aPbxprojFile "\t\t\tbuildPhases = ("
+ puts $aPbxprojFile "\t\t\t\t$aGuidsMap($aTkSources) ,"
+ puts $aPbxprojFile "\t\t\t\t$aGuidsMap($aTkFrameworks) ,"
+ puts $aPbxprojFile "\t\t\t\t$aGuidsMap($aTkHeaders) ,"
+ puts $aPbxprojFile "\t\t\t);"
+ puts $aPbxprojFile "\t\t\tbuildRules = ("
+ puts $aPbxprojFile "\t\t\t);"
+ puts $aPbxprojFile "\t\t\tdependencies = ("
+ puts $aPbxprojFile "\t\t\t);"
+ puts $aPbxprojFile "\t\t\tname = $theToolKit;"
+ puts $aPbxprojFile "\t\t\tproductName = $theToolKit;"
+ puts $aPbxprojFile "\t\t\tproductReference = $aGuidsMap($aToolkitLib) ;"
+ puts $aPbxprojFile "\t\t\tproductType = \"com.apple.product-type.${aProductType}\";"
+ puts $aPbxprojFile "\t\t\};\n"
+ # End PBXNativeTarget section
+
+ # Begin PBXProject section
+ set aTkProjectObj "${theToolKit}_ProjectObj"
+ if { ! [info exists aGuidsMap($aTkProjectObj)] } {
+ set aGuidsMap($aTkProjectObj) [OS:genGUID "xcd"]
+ }
+
+ set aTkBuildCfgListProj "${theToolKit}_BuildCfgListProj"
+ if { ! [info exists aGuidsMap($aTkBuildCfgListProj)] } {
+ set aGuidsMap($aTkBuildCfgListProj) [OS:genGUID "xcd"]
+ }
+
+ puts $aPbxprojFile "\t\t$aGuidsMap($aTkProjectObj) = \{"
+ puts $aPbxprojFile "\t\t\tisa = PBXProject;"
+ puts $aPbxprojFile "\t\t\tattributes = \{"
+ puts $aPbxprojFile "\t\t\t\tLastUpgradeCheck = 0430;"
+ puts $aPbxprojFile "\t\t\t\};"
+ puts $aPbxprojFile "\t\t\tbuildConfigurationList = $aGuidsMap($aTkBuildCfgListProj) ;"
+ puts $aPbxprojFile "\t\t\tcompatibilityVersion = \"Xcode 3.2\";"
+ puts $aPbxprojFile "\t\t\tdevelopmentRegion = English;"
+ puts $aPbxprojFile "\t\t\thasScannedForEncodings = 0;"
+ puts $aPbxprojFile "\t\t\tknownRegions = ("
+ puts $aPbxprojFile "\t\t\t\ten,"
+ puts $aPbxprojFile "\t\t\t);"
+ puts $aPbxprojFile "\t\t\tmainGroup = $aGuidsMap($aTkPBXGroup);"
+ puts $aPbxprojFile "\t\t\tproductRefGroup = $aGuidsMap($aTkPBXGroup);"
+ puts $aPbxprojFile "\t\t\tprojectDirPath = \"\";"
+ puts $aPbxprojFile "\t\t\tprojectRoot = \"\";"
+ puts $aPbxprojFile "\t\t\ttargets = ("
+ puts $aPbxprojFile "\t\t\t\t$aGuidsMap($theToolKit) ,"
+ puts $aPbxprojFile "\t\t\t);"
+ puts $aPbxprojFile "\t\t\};\n"
+ # End PBXProject section
+
+ # Begin PBXSourcesBuildPhase section
+ puts $aPbxprojFile "\t\t$aGuidsMap($aTkSources) = \{"
+ puts $aPbxprojFile "\t\t\tisa = PBXSourcesBuildPhase;"
+ puts $aPbxprojFile "\t\t\tbuildActionMask = 2147483647;"
+ puts $aPbxprojFile "\t\t\tfiles = ("
+ puts $aPbxprojFile $aSrcFileGuids
+ puts $aPbxprojFile "\t\t\t);"
+ puts $aPbxprojFile "\t\t\trunOnlyForDeploymentPostprocessing = 0;"
+ puts $aPbxprojFile "\t\t\};\n"
+ # End PBXSourcesBuildPhase section
+
+ # Begin XCBuildConfiguration section
+ set aTkDebugProject "${theToolKit}_DebugProject"
+ if { ! [info exists aGuidsMap($aTkDebugProject)] } {
+ set aGuidsMap($aTkDebugProject) [OS:genGUID "xcd"]
+ }
+
+ set aTkReleaseProject "${theToolKit}_ReleaseProject"
+ if { ! [info exists aGuidsMap($aTkReleaseProject)] } {
+ set aGuidsMap($aTkReleaseProject) [OS:genGUID "xcd"]
+ }
+
+ set aTkDebugNativeTarget "${theToolKit}_DebugNativeTarget"
+ if { ! [info exists aGuidsMap($aTkDebugNativeTarget)] } {
+ set aGuidsMap($aTkDebugNativeTarget) [OS:genGUID "xcd"]
+ }
+
+ set aTkReleaseNativeTarget "${theToolKit}_ReleaseNativeTarget"
+ if { ! [info exists aGuidsMap($aTkReleaseNativeTarget)] } {
+ set aGuidsMap($aTkReleaseNativeTarget) [OS:genGUID "xcd"]
+ }
+
+ # Debug target
+ puts $aPbxprojFile "\t\t$aGuidsMap($aTkDebugProject) = \{"
+ puts $aPbxprojFile "\t\t\tisa = XCBuildConfiguration;"
+ puts $aPbxprojFile "\t\t\tbuildSettings = \{"
+
+ puts $aPbxprojFile "\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;"
+ puts $aPbxprojFile "\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;"
+ if { "$thePlatform" == "ios" } {
+ puts $aPbxprojFile "\t\t\t\t\"ARCHS\[sdk=iphoneos\*\]\" = \"\$(ARCHS_STANDARD)\";";
+ puts $aPbxprojFile "\t\t\t\t\"ARCHS\[sdk=iphonesimulator\*\]\" = \"x86_64\";";
+ puts $aPbxprojFile "\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";"
+ puts $aPbxprojFile "\t\t\t\tCLANG_ENABLE_MODULES = YES;"
+ puts $aPbxprojFile "\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;"
+ }
+ puts $aPbxprojFile "\t\t\t\tARCHS = \"\$(ARCHS_STANDARD_64_BIT)\";"
+ puts $aPbxprojFile "\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";"
+ puts $aPbxprojFile "\t\t\t\tCOPY_PHASE_STRIP = NO;"
+ puts $aPbxprojFile "\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;"
+ puts $aPbxprojFile "\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;"
+ puts $aPbxprojFile "\t\t\t\tGCC_ENABLE_OBJC_EXCEPTIONS = YES;"
+ puts $aPbxprojFile "\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;"
+ puts $aPbxprojFile "\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = ("
+ puts $aPbxprojFile "\t\t\t\t\t\"DEBUG=1\","
+ puts $aPbxprojFile "\t\t\t\t\t\"\$\(inherited\)\","
+ puts $aPbxprojFile "\t\t\t\t);"
+ puts $aPbxprojFile "\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;"
+ puts $aPbxprojFile "\t\t\t\tGCC_VERSION = com.apple.compilers.llvm.clang.1_0;"
+ puts $aPbxprojFile "\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;"
+ puts $aPbxprojFile "\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES;"
+ puts $aPbxprojFile "\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES;"
+ puts $aPbxprojFile "\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;"
+ puts $aPbxprojFile "\t\t\t\tOTHER_LDFLAGS = \"\$(CSF_OPT_LNK64D)\"; "
+ if { "$thePlatform" == "ios" } {
+ puts $aPbxprojFile "\t\t\t\tONLY_ACTIVE_ARCH = NO;"
+ puts $aPbxprojFile "\t\t\t\tSDKROOT = iphoneos;"
+ } else {
+ puts $aPbxprojFile "\t\t\t\tONLY_ACTIVE_ARCH = YES;"
+ }
+ puts $aPbxprojFile "\t\t\t\};"
+
+ puts $aPbxprojFile "\t\t\tname = Debug;"
+ puts $aPbxprojFile "\t\t\};"
+
+ # Release target
+ puts $aPbxprojFile "\t\t$aGuidsMap($aTkReleaseProject) = \{"
+ puts $aPbxprojFile "\t\t\tisa = XCBuildConfiguration;"
+ puts $aPbxprojFile "\t\t\tbuildSettings = \{"
+
+ puts $aPbxprojFile "\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";"
+ puts $aPbxprojFile "\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;"
+ if { "$thePlatform" == "ios" } {
+ puts $aPbxprojFile "\t\t\t\t\"ARCHS\[sdk=iphoneos\*\]\" = \"\$(ARCHS_STANDARD)\";";
+ puts $aPbxprojFile "\t\t\t\t\"ARCHS\[sdk=iphonesimulator\*\]\" = \"x86_64\";";
+ puts $aPbxprojFile "\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";"
+ puts $aPbxprojFile "\t\t\t\tCLANG_ENABLE_MODULES = YES;"
+ puts $aPbxprojFile "\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;"
+ }
+ puts $aPbxprojFile "\t\t\t\tARCHS = \"\$(ARCHS_STANDARD_64_BIT)\";"
+ puts $aPbxprojFile "\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";"
+ puts $aPbxprojFile "\t\t\t\tCOPY_PHASE_STRIP = YES;"
+ puts $aPbxprojFile "\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;"
+ puts $aPbxprojFile "\t\t\t\tGCC_ENABLE_OBJC_EXCEPTIONS = YES;"
+ puts $aPbxprojFile "\t\t\t\tDEAD_CODE_STRIPPING = NO;"
+ puts $aPbxprojFile "\t\t\t\tGCC_OPTIMIZATION_LEVEL = 2;"
+ puts $aPbxprojFile "\t\t\t\tGCC_VERSION = com.apple.compilers.llvm.clang.1_0;"
+ puts $aPbxprojFile "\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;"
+ puts $aPbxprojFile "\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES;"
+ puts $aPbxprojFile "\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES;"
+ puts $aPbxprojFile "\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;"
+ puts $aPbxprojFile "\t\t\t\tOTHER_LDFLAGS = \"\$(CSF_OPT_LNK64)\";"
+ if { "$thePlatform" == "ios" } {
+ puts $aPbxprojFile "\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 7.0;"
+ puts $aPbxprojFile "\t\t\t\tSDKROOT = iphoneos;"
+ }
+ puts $aPbxprojFile "\t\t\t\};"
+ puts $aPbxprojFile "\t\t\tname = Release;"
+ puts $aPbxprojFile "\t\t\};"
+ puts $aPbxprojFile "\t\t$aGuidsMap($aTkDebugNativeTarget) = \{"
+ puts $aPbxprojFile "\t\t\tisa = XCBuildConfiguration;"
+ puts $aPbxprojFile "\t\t\tbuildSettings = \{"
+ puts $aPbxprojFile "${anExecExtension}"
+ puts $aPbxprojFile "${anExecPrefix}"
+ puts $aPbxprojFile "\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = ("
+ foreach aMacro $aTKDefines {
+ puts $aPbxprojFile "\t\t\t\t\t${aMacro} ,"
+ }
+ puts $aPbxprojFile "\t\t\t\t);"
+
+ puts $aPbxprojFile "\t\t\t\tHEADER_SEARCH_PATHS = ("
+ foreach anIncPath $anIncPaths {
+ puts $aPbxprojFile "\t\t\t\t\t${anIncPath},"
+ }
+ puts $aPbxprojFile "\t\t\t\t\t\"\$(CSF_OPT_INC)\","
+ puts $aPbxprojFile "\t\t\t\t);"
+
+ puts $aPbxprojFile "\t\t\t\tLIBRARY_SEARCH_PATHS = ("
+ foreach anLibPath $anLibPaths {
+ puts $aPbxprojFile "\t\t\t\t\t${anLibPath},"
+ }
+ puts $aPbxprojFile "\t\t\t\t);"
+
+ puts $aPbxprojFile "\t\t\t\tOTHER_CFLAGS = ("
+ puts $aPbxprojFile "\t\t\t\t\t\"\$(CSF_OPT_CMPL)\","
+ puts $aPbxprojFile "\t\t\t\t);"
+ puts $aPbxprojFile "\t\t\t\tOTHER_CPLUSPLUSFLAGS = ("
+ puts $aPbxprojFile "\t\t\t\t\t\"\$(OTHER_CFLAGS)\","
+ puts $aPbxprojFile "\t\t\t\t);"
+ puts $aPbxprojFile "\t\t\t\tPRODUCT_NAME = \"\$(TARGET_NAME)\";"
+ set anUserHeaderSearchPath "\t\t\t\tUSER_HEADER_SEARCH_PATHS = \""
+ foreach anIncPath $anIncPaths {
+ append anUserHeaderSearchPath " ${anIncPath}"
+ }
+ append anUserHeaderSearchPath "\";"
+ puts $aPbxprojFile $anUserHeaderSearchPath
+ puts $aPbxprojFile "${aWrapperExtension}"
+ puts $aPbxprojFile "\t\t\t\};"
+ puts $aPbxprojFile "\t\t\tname = Debug;"
+ puts $aPbxprojFile "\t\t\};"
+ puts $aPbxprojFile "\t\t$aGuidsMap($aTkReleaseNativeTarget) = \{"
+ puts $aPbxprojFile "\t\t\tisa = XCBuildConfiguration;"
+ puts $aPbxprojFile "\t\t\tbuildSettings = \{"
+ puts $aPbxprojFile "${anExecExtension}"
+ puts $aPbxprojFile "${anExecPrefix}"
+ puts $aPbxprojFile "\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = ("
+ foreach aMacro $aTKDefines {
+ puts $aPbxprojFile "\t\t\t\t\t${aMacro} ,"
+ }
+ puts $aPbxprojFile "\t\t\t\t);"
+ puts $aPbxprojFile "\t\t\t\tHEADER_SEARCH_PATHS = ("
+ foreach anIncPath $anIncPaths {
+ puts $aPbxprojFile "\t\t\t\t\t${anIncPath},"
+ }
+ puts $aPbxprojFile "\t\t\t\t\t\"\$(CSF_OPT_INC)\","
+ puts $aPbxprojFile "\t\t\t\t);"
+
+ puts $aPbxprojFile "\t\t\t\tLIBRARY_SEARCH_PATHS = ("
+ foreach anLibPath $anLibPaths {
+ puts $aPbxprojFile "\t\t\t\t\t${anLibPath},"
+ }
+ puts $aPbxprojFile "\t\t\t\t);"
+
+ puts $aPbxprojFile "\t\t\t\tOTHER_CFLAGS = ("
+ puts $aPbxprojFile "\t\t\t\t\t\"\$(CSF_OPT_CMPL)\","
+ puts $aPbxprojFile "\t\t\t\t);"
+ puts $aPbxprojFile "\t\t\t\tOTHER_CPLUSPLUSFLAGS = ("
+ puts $aPbxprojFile "\t\t\t\t\t\"\$(OTHER_CFLAGS)\","
+ puts $aPbxprojFile "\t\t\t\t);"
+ puts $aPbxprojFile "\t\t\t\tPRODUCT_NAME = \"\$(TARGET_NAME)\";"
+ puts $aPbxprojFile $anUserHeaderSearchPath
+ puts $aPbxprojFile "${aWrapperExtension}"
+ puts $aPbxprojFile "\t\t\t\};"
+ puts $aPbxprojFile "\t\t\tname = Release;"
+ puts $aPbxprojFile "\t\t\};\n"
+ # End XCBuildConfiguration section
+
+ # Begin XCConfigurationList section
+ puts $aPbxprojFile "\t\t$aGuidsMap($aTkBuildCfgListProj) = \{"
+ puts $aPbxprojFile "\t\t\tisa = XCConfigurationList;"
+ puts $aPbxprojFile "\t\tbuildConfigurations = ("
+ puts $aPbxprojFile "\t\t\t\t$aGuidsMap($aTkDebugProject) ,"
+ puts $aPbxprojFile "\t\t\t\t$aGuidsMap($aTkReleaseProject) ,"
+ puts $aPbxprojFile "\t\t\t);"
+ puts $aPbxprojFile "\t\t\tdefaultConfigurationIsVisible = 0;"
+ puts $aPbxprojFile "\t\t\tdefaultConfigurationName = Release;"
+ puts $aPbxprojFile "\t\t\};"
+ puts $aPbxprojFile "\t\t$aGuidsMap($aTkBuildCfgListNativeTarget) = \{"
+ puts $aPbxprojFile "\t\t\tisa = XCConfigurationList;"
+ puts $aPbxprojFile "\t\t\tbuildConfigurations = ("
+ puts $aPbxprojFile "\t\t\t\t$aGuidsMap($aTkDebugNativeTarget) ,"
+ puts $aPbxprojFile "\t\t\t\t$aGuidsMap($aTkReleaseNativeTarget) ,"
+ puts $aPbxprojFile "\t\t\t);"
+ puts $aPbxprojFile "\t\t\tdefaultConfigurationIsVisible = 0;"
+ puts $aPbxprojFile "\t\t\tdefaultConfigurationName = Release;"
+ puts $aPbxprojFile "\t\t\};\n"
+ # End XCConfigurationList section
+
+ puts $aPbxprojFile "\t\};"
+ puts $aPbxprojFile "\trootObject = $aGuidsMap($aTkProjectObj) ;"
+ puts $aPbxprojFile "\}"
+
+ close $aPbxprojFile
+}
+
+proc osutils:xcdx { theOutDir theExecutable theGuidsMap } {
+ set aUsername [exec whoami]
+
+ # Creating folders for Xcode project file.
+ set anExecutableDir "${theOutDir}/${theExecutable}.xcodeproj"
+ wokUtils:FILES:mkdir $anExecutableDir
+ if { ! [file exists $anExecutableDir] } {
+ puts stderr "Error: Could not create project directory \"$anExecutableDir\""
+ return
+ }
+
+ set aUserDataDir "${anExecutableDir}/xcuserdata"
+ wokUtils:FILES:mkdir $aUserDataDir
+ if { ! [file exists $aUserDataDir] } {
+ puts stderr "Error: Could not create xcuserdata directorty in \"$anExecutableDir\""
+ return
+ }
+
+ set aUserDataDir "${aUserDataDir}/${aUsername}.xcuserdatad"
+ wokUtils:FILES:mkdir $aUserDataDir
+ if { ! [file exists $aUserDataDir] } {
+ puts stderr "Error: Could not create ${aUsername}.xcuserdatad directorty in \"$anExecutableDir\"/xcuserdata"
+ return
+ }
+
+ set aSchemesDir "${aUserDataDir}/xcschemes"
+ wokUtils:FILES:mkdir $aSchemesDir
+ if { ! [file exists $aSchemesDir] } {
+ puts stderr "Error: Could not create xcschemes directorty in \"$aUserDataDir\""
+ return
+ }
+ # End folders creation.
+
+ # Generating GUID for tookit.
+ upvar $theGuidsMap aGuidsMap
+ if { ! [info exists aGuidsMap($theExecutable)] } {
+ set aGuidsMap($theExecutable) [OS:genGUID "xcd"]
+ }
+
+ # Creating xcscheme file for toolkit from template.
+ set aXcschemeTmpl [osutils:readtemplate "xcscheme" "xcode"]
+ regsub -all -- {__TOOLKIT_NAME__} $aXcschemeTmpl $theExecutable aXcschemeTmpl
+ regsub -all -- {__TOOLKIT_GUID__} $aXcschemeTmpl $aGuidsMap($theExecutable) aXcschemeTmpl
+ set aXcschemeFile [open "$aSchemesDir/${theExecutable}.xcscheme" "w"]
+ puts $aXcschemeFile $aXcschemeTmpl
+ close $aXcschemeFile
+
+ # Creating xcschememanagement.plist file for toolkit from template.
+ set aPlistTmpl [osutils:readtemplate "plist" "xcode"]
+ regsub -all -- {__TOOLKIT_NAME__} $aPlistTmpl $theExecutable aPlistTmpl
+ regsub -all -- {__TOOLKIT_GUID__} $aPlistTmpl $aGuidsMap($theExecutable) aPlistTmpl
+ set aPlistFile [open "$aSchemesDir/xcschememanagement.plist" "w"]
+ puts $aPlistFile $aPlistTmpl
+ close $aPlistFile
+}
+
# launch generation
genproj {*}$::argv
diff --git a/adm/templates/codeblocks.sh b/adm/templates/codeblocks.sh
old mode 100644
new mode 100755
diff --git a/adm/templates/draw.sh b/adm/templates/draw.sh
old mode 100644
new mode 100755
diff --git a/adm/templates/env.sh b/adm/templates/env.sh
index 472608f842..99885be2ed 100644
--- a/adm/templates/env.sh
+++ b/adm/templates/env.sh
@@ -14,6 +14,7 @@ fi
# Reset values
export CASDEB=""
+export TARGET="";
export HAVE_TBB="false";
export HAVE_OPENCL="false";
export HAVE_FREEIMAGE="false";
@@ -31,14 +32,16 @@ if [ -e "${aScriptPath}/custom.sh" ]; then source "${aScriptPath}/custom.sh"; fi
# Read script arguments
shopt -s nocasematch
-export TARGET="";
-if [[ "$2" == "cbp" ]]; then
- export TARGET="cbp";
-elif [[ "$2" == "xcd" ]]; then
- export TARGET="xcd";
-fi
-if [[ "$1" == "debug" ]]; then export CASDEB="d"; fi
-if [[ "$1" == "d" ]]; then export CASDEB="d"; fi
+for i in $*
+do
+ if [ "$i" == "d" ] || [ "$i" == "debug" ]; then
+ export CASDEB="d"
+ elif [ "$i" == "cbp" ]; then
+ export TARGET="cbp";
+ elif [ "$i" == "xcd" ] || [ "$i" == "xcode" ]; then
+ export TARGET="xcd";
+ fi
+done
shopt -u nocasematch
# ----- Setup Environment Variables -----
diff --git a/adm/templates/xcode.sh b/adm/templates/xcode.sh
new file mode 100755
index 0000000000..ddc0620742
--- /dev/null
+++ b/adm/templates/xcode.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+export TARGET="xcd"
+
+source ./env.sh "$1" "$TARGET"
+
+open -a Xcode ./adm/mac/xcd/OCCT.xcworkspace
diff --git a/dox/license.md b/dox/license.md
old mode 100644
new mode 100755
diff --git a/genproj.sh b/genproj.sh
new file mode 100755
index 0000000000..c565cf6570
--- /dev/null
+++ b/genproj.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+# Helper script to run generation of CBP/XCode projects on Linux / OS X.
+# Running it requires that Tcl should be in the PATH
+
+anOldPath="$PATH"
+anOldLd="$LD_LIBRARY_PATH"
+anOldDyLd="$DYLD_LIBRARY_PATH"
+
+# go to the script directory
+aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
+
+aSystem=`uname -s`
+aTarget="$1"
+anOpt2=$2
+anOpt3=$3
+anOpt4=$4
+anOpt5=$5
+if [ "$aTarget" == "" ]; then
+ aTarget="cbp"
+ if [ "$aSystem" == "Darwin" ]; then aTarget="xcd"; fi;
+fi
+
+if [ ! -e "${aScriptPath}/custom.sh" ]; then
+ tclsh "${aScriptPath}/adm/genconf.tcl"
+fi
+
+if [ ! -e "${aScriptPath}/custom.sh" ]; then
+ echo custom.sh is not created. Run the script again and generate custom.sh
+ exit 1
+fi
+source "${aScriptPath}/custom.sh"
+
+if [ -e "${aScriptPath}/env.sh" ]; then source "${aScriptPath}/env.sh"; fi
+
+tclsh "${aScriptPath}/adm/genproj.tcl" -path="${aScriptPath}" -target=${aTarget} $anOpt2 $anOpt3 $anOpt4 $anOpt5
+
+export PATH="$anOldPath"
+export LD_LIBRARY_PATH="$anOldLd"
+export DYLD_LIBRARY_PATH="$anOldDyLd"
diff --git a/src/OS/ApplicationFramework.tcl b/src/OS/ApplicationFramework.tcl
index a37675167c..622df211cf 100644
--- a/src/OS/ApplicationFramework.tcl
+++ b/src/OS/ApplicationFramework.tcl
@@ -53,65 +53,7 @@ proc ApplicationFramework:alias { } {
proc ApplicationFramework:depends { } {
return [list Visualization]
}
-;#
-;# Pre-requis pour la compilation ( -I ... )
-;# Returns a list of directory that should be used in -I directives
-;# while compiling c or c++ files.
-;#
-proc ApplicationFramework:CompileWith { } {
-
- set l {}
- switch -- [OS:os] {
- HP-UX {
- }
- Linux {
- lappend l "-I[lindex [wokparam -v %CSF_JavaHome] 0]/include"
- lappend l "-I[lindex [wokparam -v %CSF_JavaHome] 0]/include/linux"
- lappend l "[lindex [wokparam -v %CSF_TCL_HOME] 0]/include"
- lappend l "[lindex [lindex [wokparam -v %STLPortInclude] 0] 0]"
- }
- SunOS {
- lappend l "/usr/openwin/include"
- lappend l "/usr/dt/include"
- lappend l "[lindex [wokparam -v %CSF_CXX_INCLUDE] 0]"
- lappend l "-I[lindex [wokparam -v %CSF_JavaHome] 0]/include"
- lappend l "-I[lindex [wokparam -v %CSF_JavaHome] 0]/include/solaris"
- lappend l "[lindex [wokparam -v %CSF_TCL_HOME] 0]/include"
- }
-
- IRIX {
- lappend l "/usr/include/CC"
- }
-
- }
- return $l
-}
-;#
-;# Pre-requis pour la compilation ( -L ... )
-;# Returns a list of directory that should be used in -L directives
-;# while creating shareable.
-;#
-proc ApplicationFramework:LinksoWith { } {
-
-
- set l {}
- switch -- [OS:os] {
- HP-UX {
- }
- Linux {
- lappend l /usr/X11R6/lib
- }
- SunOS {
- lappend l "-L[wokparam -v %CSF_TCL_HOME]/lib -R[wokparam -v %CSF_TCL_HOME]/lib -ltcl"
- lappend l "-L[wokparam -v %CSF_TCL_HOME]/lib -R[wokparam -v %CSF_TCL_HOME]/lib -ltk"
- }
- IRIX {
- lappend l /usr/lib32
- }
- }
- return $l
-}
;#
;# Returns a list of exported features.
;# source : Source files
diff --git a/src/OS/DataExchange.tcl b/src/OS/DataExchange.tcl
index 249c2c9f75..75cb56bf05 100644
--- a/src/OS/DataExchange.tcl
+++ b/src/OS/DataExchange.tcl
@@ -53,60 +53,7 @@ proc DataExchange:alias { } {
proc DataExchange:depends { } {
return [list ApplicationFramework]
}
-;#
-;# Liste des includes utilises qui ne sont pas ceux des Wb.
-;#
-proc DataExchange:CompileWith { } {
-
- set l {}
- switch -- [OS:os] {
- HP-UX {
- }
- Linux {
- lappend l "-I[lindex [wokparam -v %CSF_JavaHome] 0]/include"
- lappend l "-I[lindex [wokparam -v %CSF_JavaHome] 0]/include/linux"
- lappend l "[lindex [wokparam -v %CSF_TCL_HOME] 0]/include"
- lappend l "[lindex [lindex [wokparam -v %STLPortInclude] 0] 0]"
- }
- SunOS {
- lappend l "/usr/openwin/include"
- lappend l "/usr/dt/include"
- lappend l "[lindex [wokparam -v %CSF_CXX_INCLUDE] 0]"
- lappend l "-I[lindex [wokparam -v %CSF_JavaHome] 0]/include"
- lappend l "-I[lindex [wokparam -v %CSF_JavaHome] 0]/include/solaris"
- lappend l "[lindex [wokparam -v %CSF_TCL_HOME] 0]/include"
- }
-
- IRIX {
- lappend l "/usr/include/CC"
- }
- }
- return $l
-}
-;#
-;# Pre-requis pour la compilation ( -L ... )
-;# Returns a list of directory that should be used in -L directives
-;# while creating shareable.
-;#
-proc DataExchange:LinksoWith { } {
-
- set l {}
- switch -- [OS:os] {
- HP-UX {
- }
- Linux {
- }
- SunOS {
- lappend l "-L[wokparam -v %CSF_TCL_HOME]/lib -R[wokparam -v %CSF_TCL_HOME]/lib -ltcl"
- lappend l "-L[wokparam -v %CSF_TCL_HOME]/lib -R[wokparam -v %CSF_TCL_HOME]/lib -ltk"
- }
- IRIX {
- lappend l "/usr/lib32"
- }
- }
- return $l
-}
;#
;# Returns a list of exported features.
;# source : Source files
diff --git a/src/OS/Draw.tcl b/src/OS/Draw.tcl
index 01dab2fa67..a8ac73222d 100644
--- a/src/OS/Draw.tcl
+++ b/src/OS/Draw.tcl
@@ -56,69 +56,6 @@ proc Draw:acdepends { } {
return [list TCLTK]
}
-;#
-;# Pre-requis pour la compilation ( -I ... )
-;# Returns a list of directory that should be used in -I directives
-;# while compiling c or c++ files.
-;#
-proc Draw:CompileWith {} {
-
- set l {}
- switch -- [OS:os] {
- HP-UX {
- }
- Linux {
- lappend l "-I[lindex [wokparam -v %CSF_JavaHome] 0]/include"
- lappend l "-I[lindex [wokparam -v %CSF_JavaHome] 0]/include/linux"
- lappend l "[lindex [wokparam -v %CSF_TCL_HOME] 0]/include"
- lappend l "[lindex [lindex [wokparam -v %STLPortInclude] 0] 0]"
- }
- SunOS {
- lappend l "/usr/openwin/include"
- lappend l "/usr/dt/include"
- lappend l [lindex [wokparam -v %CSF_CXX_INCLUDE] 0]
- lappend l "-I[lindex [wokparam -v %CSF_JavaHome] 0]/include"
- lappend l "-I[lindex [wokparam -v %CSF_JavaHome] 0]/include/solaris"
- lappend l "[lindex [wokparam -v %CSF_TCL_HOME] 0]/include"
- }
- IRIX {
- lappend l /usr/include/CC
- lappend l /usr/tcltk/include/itcl
- lappend l /opt/Orbix_2.2/include
- }
-
- }
- return $l
-}
-;#
-;# Pre-requis pour la compilation ( -L ... )
-;# Returns a list of directory that should be used in -L directives
-;# while creating shareable.
-;#
-proc Draw:LinksoWith {} {
-
- set l {}
- switch -- [OS:os] {
- HP-UX {
- }
- Linux {
- lappend l -L/usr/X11R6/lib
- lappend l "-L[wokparam -v %CSF_TCL_HOME]/lib"
- lappend l "-L[wokparam -v %STLPortHome]/lib"
- }
- SunOS {
- lappend l /usr/openwin/lib
- lappend l "[wokparam -v %CSF_TCL_HOME]/lib"
- lappend l /opt/DEV5_1/SUNWspro/SC4.2/include/CC
- }
- IRIX {
- lappend l /usr/lib32
- lappend l /usr/tcltk.64/lib/itcl
- }
-
- }
- return $l
-}
;#
;# Returns a list of exported features.
;# source : Source files
diff --git a/src/OS/FoundationClasses.tcl b/src/OS/FoundationClasses.tcl
index a80d364c51..b3083377fb 100644
--- a/src/OS/FoundationClasses.tcl
+++ b/src/OS/FoundationClasses.tcl
@@ -49,58 +49,7 @@ proc FoundationClasses:alias { } {
proc FoundationClasses:depends { } {
return {}
}
-;#
-;# Liste des includes utilises qui ne sont pas ceux des Wb.
-;#
-proc FoundationClasses:CompileWith { } {
-
- set l {}
- switch -- [OS:os] {
- HP-UX {
- }
- Linux {
- lappend l "-I[lindex [wokparam -v %CSF_JavaHome] 0]/include"
- lappend l "-I[lindex [wokparam -v %CSF_JavaHome] 0]/inclide/linux"
- lappend l "[lindex [wokparam -v %CSF_TCL_HOME] 0]/include"
- lappend l "[lindex [lindex [wokparam -v %STLPortInclude] 0] 0]"
- }
- SunOS {
- lappend l "/usr/openwin/include"
- lappend l "/usr/dt/include"
- lappend l "[lindex [wokparam -v %CSF_CXX_INCLUDE] 0]"
- lappend l "-I[lindex [wokparam -v %CSF_JavaHome] 0]/include"
- lappend l "-I[lindex [wokparam -v %CSF_JavaHome] 0]/inclide/solaris"
- lappend l "[lindex [wokparam -v %CSF_TCL_HOME] 0]/include"
- }
- IRIX {
- lappend l "/usr/include/CC"
- }
- }
- return $l
-}
-;#
-;# Pre-requis pour la compilation ( -L ... )
-;# Returns a list of directory that should be used in -L directives
-;# while creating shareable.
-;#
-proc FoundationClasses:LinksoWith { } {
-
- set l {}
- switch -- [OS:os] {
- HP-UX {
- }
- Linux {
- }
- SunOS {
- }
- IRIX {
- lappend l /usr/lib32
- }
-
- }
- return $l
-}
;#
;# Returns a list of exported features.
;# source : Source files
diff --git a/src/OS/ModelingAlgorithms.tcl b/src/OS/ModelingAlgorithms.tcl
index df7071fffb..d406a24e94 100644
--- a/src/OS/ModelingAlgorithms.tcl
+++ b/src/OS/ModelingAlgorithms.tcl
@@ -47,63 +47,7 @@ proc ModelingAlgorithms:alias { } {
proc ModelingAlgorithms:depends { } {
return [list ModelingData]
}
-;#
-;# Pre-requis pour la compilation ( -I ... )
-;# Returns a list of directory that should be used in -I directives
-;# while compiling c or c++ files.
-;#
-proc ModelingAlgorithms:CompileWith { } {
-
- set l {}
- switch -- [OS:os] {
- HP-UX {
- }
- Linux {
- lappend l "-I[lindex [wokparam -v %CSF_JavaHome] 0]/include"
- lappend l "-I[lindex [wokparam -v %CSF_JavaHome] 0]/include/solaris"
- lappend l "[lindex [wokparam -v %CSF_TCL_HOME] 0]/include"
- lappend l "[lindex [lindex [wokparam -v %STLPortInclude] 0] 0]"
- }
- SunOS {
- lappend l "/usr/openwin/include"
- lappend l "/usr/dt/include"
- lappend l "[lindex [wokparam -v %CSF_CXX_INCLUDE] 0]"
- lappend l "-I[lindex [wokparam -v %CSF_JavaHome] 0]/include"
- lappend l "-I[lindex [wokparam -v %CSF_JavaHome] 0]/include/solaris"
- lappend l "[lindex [wokparam -v %CSF_TCL_HOME] 0]/include"
- }
- IRIX {
- lappend l "/usr/include/CC"
- }
- }
- return $l
-}
-;#
-;# Pre-requis pour la compilation ( -L ... )
-;# Returns a list of directory that should be used in -L directives
-;# while creating shareable.
-;#
-proc ModelingAlgorithms:LinksoWith { } {
-
- set l {}
- switch -- [OS:os] {
- HP-UX {
- }
- Linux {
- }
- SunOS {
- lappend l "-L[wokparam -v %CSF_TCL_HOME]/lib -R[wokparam -v %CSF_TCL_HOME]/lib -ltcl"
- lappend l "-L[wokparam -v %CSF_TCL_HOME]/lib -R[wokparam -v %CSF_TCL_HOME]/lib -ltk"
- lappend l /usr/openwin/lib
- }
- IRIX {
- lappend l /usr/lib32
- }
-
- }
- return $l
-}
;#
;# Returns a list of exported features.
;# source : Source files
diff --git a/src/OS/ModelingData.tcl b/src/OS/ModelingData.tcl
index b1ce71075c..69afbe8dc8 100644
--- a/src/OS/ModelingData.tcl
+++ b/src/OS/ModelingData.tcl
@@ -39,62 +39,7 @@ proc ModelingData:alias { } {
proc ModelingData:depends { } {
return [list FoundationClasses]
}
-;#
-;# Pre-requis pour la compilation ( -I ... )
-;# Returns a list of directory that should be used in -I directives
-;# while compiling c or c++ files.
-;#
-proc ModelingData:CompileWith { } {
- set l {}
- switch -- [OS:os] {
- HP-UX {
- }
- Linux {
- lappend l "-I[lindex [wokparam -v %CSF_JavaHome] 0]/include"
- lappend l "-I[lindex [wokparam -v %CSF_JavaHome] 0]/include/linux"
- lappend l "[lindex [wokparam -v %CSF_TCL_HOME] 0]/include"
- lappend l "[lindex [lindex [wokparam -v %STLPortInclude] 0] 0]"
- }
- SunOS {
- lappend l "/usr/openwin/include"
- lappend l "/usr/dt/include"
- lappend l "[lindex [wokparam -v %CSF_CXX_INCLUDE] 0]"
- lappend l "-I[lindex [wokparam -v %CSF_JavaHome] 0]/include"
- lappend l "-I[lindex [wokparam -v %CSF_JavaHome] 0]/include/solaris"
- lappend l "[lindex [wokparam -v %CSF_TCL_HOME] 0]/include"
- }
- IRIX {
- lappend l "/usr/include/CC"
- }
-
- }
- return $l
-}
-;#
-;# Pre-requis pour la compilation ( -L ... )
-;# Returns a list of directory that should be used in -L directives
-;# while creating shareable.
-;#
-proc ModelingData:LinksoWith { } {
-
- set l {}
- switch -- [OS:os] {
- HP-UX {
- }
- Linux {
- }
- SunOS {
- lappend l "-L[wokparam -v %CSF_TCL_HOME]/lib -R[wokparam -v %CSF_TCL_HOME]/lib -ltcl"
- lappend l "-L[wokparam -v %CSF_TCL_HOME]/lib -R[wokparam -v %CSF_TCL_HOME]/lib -ltcl"
- }
- IRIX {
- lappend l /usr/lib32
- }
-
- }
- return $l
-}
;#
;# Returns a list of exported features.
;# source : Source files
diff --git a/src/OS/Visualization.tcl b/src/OS/Visualization.tcl
index 74fbe7f8d5..85bdfe9d27 100644
--- a/src/OS/Visualization.tcl
+++ b/src/OS/Visualization.tcl
@@ -67,65 +67,6 @@ proc Visualization:acdepends { } {
return $aList
}
-;#
-;# Pre-requis pour la compilation ( -I ... )
-;# Returns a list of directory that should be used in -I directives
-;# while compiling c or c++ files.
-;#
-proc Visualization:CompileWith {} {
-
- set l {}
- switch -- [OS:os] {
- HP-UX {
- }
- Linux {
- lappend l "-I[lindex [wokparam -v %CSF_JavaHome] 0]/include"
- lappend l "-I[lindex [wokparam -v %CSF_JavaHome] 0]/include/linux"
- lappend l "[lindex [wokparam -v %CSF_TCL_HOME] 0]/include"
- lappend l "[lindex [lindex [wokparam -v %STLPortInclude] 0] 0]"
- }
- SunOS {
- lappend l "\$OPENWINHOME/include"
- lappend l "/usr/openwin/include/X11"
- lappend l "/usr/dt/include"
- lappend l "[lindex [wokparam -v %CSF_CXX_INCLUDE] 0]"
- lappend l "-I[lindex [wokparam -v %CSF_JavaHome] 0]/include"
- lappend l "-I[lindex [wokparam -v %CSF_JavaHome] 0]/include/solaris"
- lappend l "[lindex [wokparam -v %CSF_TCL_HOME] 0]/include"
- }
- IRIX {
- lappend l /usr/include/CC
- }
-
- }
- return $l
-}
-;#
-;# Pre-requis pour la compilation ( -L ... )
-;# Returns a list of directory that should be used in -L directives
-;# while creating shareable.
-;#
-proc Visualization:LinksoWith { } {
-
- set l {}
- switch -- [OS:os] {
- HP-UX {
- }
- Linux {
- lappend l /usr/X11R6/lib
- }
- SunOS {
- lappend l "-L[wokparam -v %CSF_TCL_HOME]/lib -R[wokparam -v %CSF_TCL_HOME]/lib -ltcl"
- lappend l "-L[wokparam -v %CSF_TCL_HOME]/lib -R[wokparam -v %CSF_TCL_HOME]/lib -ltk"
- lappend l /usr/openwin/lib
- }
- IRIX {
- lappend l /usr/lib32
- }
-
- }
- return $l
-}
;#
;# Returns a list of exported features.
;# source : Source files
diff --git a/src/TKQADraw/EXTERNLIB b/src/TKQADraw/EXTERNLIB
index be8b4c90fa..8bbf06a049 100755
--- a/src/TKQADraw/EXTERNLIB
+++ b/src/TKQADraw/EXTERNLIB
@@ -27,6 +27,7 @@ TKXSBase
TKMesh
TKXCAF
TKSTEP
+TKSTEPBase
TKXDESTEP
TKXSDRAW
TKSTL
diff --git a/src/TKXDEIGES/EXTERNLIB b/src/TKXDEIGES/EXTERNLIB
index 8b253df896..007959d773 100755
--- a/src/TKXDEIGES/EXTERNLIB
+++ b/src/TKXDEIGES/EXTERNLIB
@@ -5,5 +5,6 @@ TKXSBase
TKCDF
TKLCAF
TKG2d
+TKG3d
TKXCAF
TKIGES
diff --git a/src/TKXMesh/EXTERNLIB b/src/TKXMesh/EXTERNLIB
index 52df3c1fa2..c7ed54b08b 100644
--- a/src/TKXMesh/EXTERNLIB
+++ b/src/TKXMesh/EXTERNLIB
@@ -2,4 +2,5 @@ TKBRep
TKMath
TKernel
TKG2d
+TKG3d
TKMesh