]> OCCT Git - occt-wok.git/commitdiff
Code Block projects files generation refactored
authordbv <dbv@opencascade.com>
Thu, 19 Jul 2012 13:55:13 +0000 (17:55 +0400)
committeribs <ibs@opencascade.com>
Mon, 19 Nov 2012 10:36:24 +0000 (14:36 +0400)
Now WOK adds necessary directories to search path.
wgenproj command now creates codeblocks.sh and draw.sh scripts in the workbench root directory

src/WOKBuilderDef/CSF_MAC.edl
src/WOKTclLib/osutils.tcl
src/WOKTclLib/templates/codeblocks.sh [new file with mode: 0755]
src/WOKTclLib/templates/draw.sh [new file with mode: 0644]
src/WOKTclLib/templates/env.sh
src/WOKsite/wok_deps.tcl
src/WOKsite/wok_tclshrc.tcl

index 2d8c52fccb9a3231102a9c1a6bea66a71e302711..c0e493ba612281190fc08e6cea2fcef25b0f73e9 100644 (file)
   @if (%CSF_TCL_HOME != "") then
     @string %CSF_TCL_INCLUDE = %CSF_TCL_HOME "/include ";
     @string %CSF_TclLibs   = "-L" %CSF_TCL_HOME "/lib -ltcl8.5 ";
-    @string %CSF_TclTkLibs = "-L" %CSF_TCL_HOME "/lib -ltk8.5 -L" %X11_LIB " -lX11 ";
+    @string %CSF_TclTkLibs = "-L" %X11_LIB " -lX11 -L" %CSF_TCL_HOME "/lib -ltk8.5 ";
   @else
     @string %CSF_TclLibs   = " -ltcl8.5 ";
-    @string %CSF_TclTkLibs = " -ltk8.5 -L" %X11_LIB " -lX11 ";
+    @string %CSF_TclTkLibs = "-L" %X11_LIB " -lX11 -ltk8.5 ";
   @endif;
 
   -- FTGL (font renderer for OpenGL)
index 33228e790c969036dd5e824214640fac66b09d8d..b5ce2cf1885f2deac2d46e120e7a00a6f9ed71c9 100755 (executable)
@@ -1794,6 +1794,7 @@ proc osutils:cbptk { theOutDir theToolKit } {
     lappend aUsedToolKits "${tkx}"
   }
   wokparam -l CSF
+
   foreach tk [lappend [wokUtils:LIST:Purge [osutils:tk:close [woklocate -u $theToolKit]]] $theToolKit] {
     foreach element [osutils:tk:hascsf [woklocate -p ${tk}:source:EXTERNLIB [wokcd]]] {
       if {[wokparam -t %$element] == 0} {
@@ -2013,6 +2014,9 @@ proc osutils:cbp { theOutDir theProjName theSrcFiles theLibsList theIncPaths the
 
   puts $aFile "\t\t\t\t<Linker>"
   puts $aFile "\t\t\t\t\t<Add directory=\"../../../${aWokStation}/cbp/lib\" />"
+  if { "$aWokStation" == "mac" && [ lsearch $theLibsList X11 ] >= 0} {
+    puts $aFile "\t\t\t\t\t<Add directory=\"/usr/X11/lib\" />"
+  }
   puts $aFile "\t\t\t\t\t<Add option=\"\$(CSF_OPT_LNK${aWokArch})\" />"
   puts $aFile "\t\t\t\t</Linker>"
 
@@ -2057,6 +2061,9 @@ proc osutils:cbp { theOutDir theProjName theSrcFiles theLibsList theIncPaths the
 
   puts $aFile "\t\t\t\t<Linker>"
   puts $aFile "\t\t\t\t\t<Add directory=\"../../../${aWokStation}/cbp/libd\" />"
+  if { "$aWokStation" == "mac" && [ lsearch $theLibsList X11 ] >= 0} {
+    puts $aFile "\t\t\t\t\t<Add directory=\"/usr/X11/lib\" />"
+  }
   puts $aFile "\t\t\t\t\t<Add option=\"\$(CSF_OPT_LNK${aWokArch}D)\" />"
   puts $aFile "\t\t\t\t</Linker>"
 
@@ -2073,6 +2080,7 @@ proc osutils:cbp { theOutDir theProjName theSrcFiles theLibsList theIncPaths the
   foreach anIncPath $theIncPaths {
     puts $aFile "\t\t\t<Add directory=\"$anIncPath\" />"
   }
+  puts $aFile "\t\t\t<Add directory=\"$::env(WOK_LIBRARY)\" />"
   puts $aFile "\t\t</Compiler>"
 
   # COMMON linker options
@@ -2093,6 +2101,25 @@ proc osutils:cbp { theOutDir theProjName theSrcFiles theLibsList theIncPaths the
     }
   }
 
+  if { "$theIsExe" == "true" } {
+    puts $aFile "\t\t<Extensions>"
+    puts $aFile "\t\t\t<code_completion />"
+    puts $aFile "\t\t\t<envvars />"
+    puts $aFile "\t\t\t<debugger>"
+    puts $aFile "\t\t\t\t<remote_debugging>"
+    puts $aFile "\t\t\t\t\t<options conn_type=\"2\" serial_baud=\"115200\" skip_ld_path=\"1\" />"
+    puts $aFile "\t\t\t\t</remote_debugging>"
+    puts $aFile "\t\t\t\t<remote_debugging target=\"Release\">"
+    puts $aFile "\t\t\t\t\t<options conn_type=\"0\" serial_baud=\"115200\" skip_ld_path=\"1\" />"
+    puts $aFile "\t\t\t\t</remote_debugging>"
+    puts $aFile "\t\t\t\t<remote_debugging target=\"Debug\">"
+    puts $aFile "\t\t\t\t\t<options conn_type=\"0\" serial_baud=\"115200\" skip_ld_path=\"1\" />"
+    puts $aFile "\t\t\t\t</remote_debugging>"
+    puts $aFile "\t\t\t</debugger>"
+    puts $aFile "\t\t\t<lib_finder disable_auto=\"1\" />"
+    puts $aFile "\t\t</Extensions>"
+  }
+
   puts $aFile "\t</Project>"
   puts $aFile "</CodeBlocks_project_file>"
   close $aFile
diff --git a/src/WOKTclLib/templates/codeblocks.sh b/src/WOKTclLib/templates/codeblocks.sh
new file mode 100755 (executable)
index 0000000..43bb383
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+source ./env.sh "$1"
+
+export CSF_OPT_LIB64="$CSF_OPT_LIB64:/usr/X11/lib"
+export CSF_OPT_LIB64D="$CSF_OPT_LIB64:/usr/X11/lib"
+
+/Applications/CodeBlocks.app/Contents/MacOS/CodeBlocks ./adm/mac/cbp/OCCT.workspace
diff --git a/src/WOKTclLib/templates/draw.sh b/src/WOKTclLib/templates/draw.sh
new file mode 100644 (file)
index 0000000..8470a91
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+source ./env.sh "$1"
+
+DRAWEXE
index eae1a35de8cae17296143bd1fecde9ad5a95941e..0a13cad4f56196e33bb65f7a8c3fd8b0f481d567 100644 (file)
@@ -6,6 +6,7 @@ aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath
 export CASROOT="$aScriptPath"
 
 # Reset values
+export CASDEB=""
 export HAVE_TBB="false";
 export HAVE_FREEIMAGE="false";
 export HAVE_GL2PS="false";
@@ -18,6 +19,12 @@ export CSF_OPT_BIN64=""
 # ----- Set local settings -----
 if [ -e "${aScriptPath}/custom.sh" ]; then source "${aScriptPath}/custom.sh"; fi
 
+# Read script arguments
+shopt -s nocasematch
+if [[ "$1" == "debug" ]]; then export CASDEB="d"; fi
+if [[ "$1" == "d" ]]; then export CASDEB="d"; fi
+shopt -u nocasematch
+
 export CSF_OPT_INC="${CSF_OPT_INC}:__CSF_OPT_INC__"
 export CSF_OPT_LIB32="${CSF_OPT_LIB32}:__CSF_OPT_LIB32__"
 export CSF_OPT_LIB64="${CSF_OPT_LIB64}:__CSF_OPT_LIB64__"
@@ -40,7 +47,6 @@ else
   export WOKSTATION="lin";
 fi
 
-if [ "${CASDEB}" == "" ]; then export CASDEB=""; fi
 export CASBIN="${WOKSTATION}/cbp"
 
 export CSF_OPT_CMPL=""
@@ -101,6 +107,9 @@ fi
 
 export PATH="${CASROOT}/${CASBIN}/bin${CASDEB}:${PATH}"
 export LD_LIBRARY_PATH="${CASROOT}/${CASBIN}/lib${CASDEB}:${LD_LIBRARY_PATH}"
+if [ "$WOKSTATION" == "mac" ]; then
+  export DYLD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${DYLD_LIBRARY_PATH}"
+fi
 
 # Set envoronment variables used by OCCT
 export CSF_MDTVFontDirectory="${CASROOT}/src/FontMFT"
index c84186e72df45aacb61882dc9a47f2f73bee7195..9dbc262710cfdc36563357a671c14be36234d31b 100644 (file)
@@ -694,7 +694,9 @@ proc wokdep:SearchX11 {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64
   if { "$aXmuLibPath" == "" } {
     set aXmuLibPath [wokdep:SearchLib "Xmu" "$::ARCH" "/usr/X11/lib"]
     if { "$aXmuLibPath" != "" } {
-      lappend ::CSF_OPT_LIB$::ARCH "/usr/X11/lib"
+      if { "$::tcl_platform(os)" != "Darwin" } {
+        lappend ::CSF_OPT_LIB$::ARCH "/usr/X11/lib"
+      }
     } else {
       lappend anErrLib$::ARCH "Error: '${::SYS_LIB_PREFIX}Xmu.${::SYS_LIB_SUFFIX}' not found (X11)"
       set isFound "false"
index ea84622f99bb1587788f781a99e0ee500b443211..c3d22c7a43fac9f58e9739ada43f00aaa410be50 100644 (file)
@@ -292,7 +292,9 @@ proc wgenprojbat {thePath} {
     file copy -force -- "$::env(WOKHOME)/lib/templates/draw.bat" "$aBox/draw.bat"
     file copy -force -- "$::env(WOKHOME)/lib/templates/msvc.bat" "$aBox/msvc.bat"
   } else {
-    catch {file copy -- "$::env(WOKHOME)/site/custom.sh"         "$aBox/custom.sh"}
+    catch {file copy -- "$::env(WOKHOME)/site/custom.sh"              "$aBox/custom.sh"}
+    file copy -force -- "$::env(WOKHOME)/lib/templates/draw.sh"       "$aBox/draw.sh"
+    file copy -force -- "$::env(WOKHOME)/lib/templates/codeblocks.sh" "$aBox/codeblocks.sh"
   }
 }