env.sh 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. #!/bin/bash
  2. aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
  3. # ----- For compatibility with external application using CASROOT -----
  4. if [ "${CASROOT}" == "" ]; then
  5. export CASROOT="/home/chan/temp/FastCAELinuxExtlibSource/opencascade-7.6.0/install"
  6. fi
  7. # ----- Define path to 3rdparty products -----
  8. if [ "${THIRDPARTY_DIR}" == "" ]; then
  9. export THIRDPARTY_DIR="/home/chan/temp/FastCAELinuxExtlibSource/opencascade-7.6.0"
  10. fi
  11. # ----- Read script arguments -----
  12. shopt -s nocasematch
  13. export CASDEB="";
  14. if [[ "$1" == "debug" ]]; then export CASDEB="d"; fi
  15. if [[ "$1" == "d" ]]; then export CASDEB="d"; fi
  16. if [[ "$1" == "relwithdeb" ]]; then export CASDEB="i"; fi
  17. if [[ "$1" == "i" ]]; then export CASDEB="i"; fi
  18. shopt -u nocasematch
  19. # ----- Set path to 3rd party and OCCT libraries -----
  20. anArch=`uname -m`
  21. if [ "$anArch" != "x86_64" ] && [ "$anArch" != "ia64" ]; then
  22. export ARCH="32";
  23. else
  24. export ARCH="64";
  25. fi
  26. aSystem=`uname -s`
  27. if [ "$aSystem" == "Darwin" ]; then
  28. export WOKSTATION="mac";
  29. export ARCH="64";
  30. else
  31. export WOKSTATION="lin";
  32. fi
  33. # ----- Set local settings -----
  34. if [ -e "${CASROOT}/bin/custom.sh" ]; then
  35. source "${CASROOT}/bin/custom.sh" "${CASDEB}" "${ARCH}"
  36. fi
  37. THRDPARTY_PATH=""
  38. if [ "$TCL_DIR" != "" ]; then
  39. THRDPARTY_PATH="${TCL_DIR}:${THRDPARTY_PATH}"
  40. fi
  41. if [ "$TK_DIR" != "" ]; then
  42. THRDPARTY_PATH="${TK_DIR}:${THRDPARTY_PATH}"
  43. fi
  44. if [ "$FREETYPE_DIR" != "" ]; then
  45. THRDPARTY_PATH="${FREETYPE_DIR}:${THRDPARTY_PATH}"
  46. fi
  47. if [ "$FREEIMAGE_DIR" != "" ]; then
  48. THRDPARTY_PATH="${FREEIMAGE_DIR}:${THRDPARTY_PATH}"
  49. fi
  50. if [ "$TBB_DIR" != "" ]; then
  51. THRDPARTY_PATH="${TBB_DIR}:${THRDPARTY_PATH}"
  52. fi
  53. if [ "$VTK_DIR" != "" ]; then
  54. THRDPARTY_PATH="${VTK_DIR}:${THRDPARTY_PATH}"
  55. fi
  56. if [ "$FFMPEG_DIR" != "" ]; then
  57. THRDPARTY_PATH="${FFMPEG_DIR}:${THRDPARTY_PATH}"
  58. fi
  59. if [ "$QTDIR" != "" ]; then
  60. THRDPARTY_PATH="${QTDIR}/lib:${THRDPARTY_PATH}"
  61. fi
  62. if [ "$TK_DIR" != "$TCL_DIR" ]; then
  63. if [ "$TK_DIR" != "" ]; then
  64. export TK_LIBRARY="${TK_DIR}/../lib/tk${TK_VERSION_WITH_DOT}"
  65. fi
  66. if [ "$TCL_DIR" != "" ]; then
  67. export TCL_LIBRARY="${TCL_DIR}/../lib/tcl${TCL_VERSION_WITH_DOT}"
  68. fi
  69. fi
  70. if [ "$LD_LIBRARY_PATH" != "" ]; then
  71. export LD_LIBRARY_PATH="${THRDPARTY_PATH}:${LD_LIBRARY_PATH}"
  72. else
  73. export LD_LIBRARY_PATH="${THRDPARTY_PATH}"
  74. fi
  75. if [ "$CSF_OCCTBinPath" != "" ]; then
  76. export PATH="${CSF_OCCTBinPath}:${PATH}"
  77. fi
  78. if [ "$CSF_OCCTLibPath" != "" ]; then
  79. if [ "$LD_LIBRARY_PATH" != "" ]; then
  80. export LD_LIBRARY_PATH="${CSF_OCCTLibPath}:${LD_LIBRARY_PATH}"
  81. else
  82. export LD_LIBRARY_PATH="${CSF_OCCTLibPath}"
  83. fi
  84. fi
  85. if [ "$WOKSTATION" == "mac" ]; then
  86. if [ "$DYLD_LIBRARY_PATH" != "" ]; then
  87. export DYLD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${DYLD_LIBRARY_PATH}"
  88. else
  89. export DYLD_LIBRARY_PATH="${LD_LIBRARY_PATH}"
  90. fi
  91. fi
  92. # ----- Set envoronment variables used by OCCT -----
  93. export CSF_LANGUAGE=us
  94. export MMGT_CLEAR=1
  95. export CSF_SHMessage="${CSF_OCCTResourcePath}/SHMessage"
  96. export CSF_MDTVTexturesDirectory="${CSF_OCCTResourcePath}/Textures"
  97. export CSF_ShadersDirectory="${CSF_OCCTResourcePath}/Shaders"
  98. export CSF_XSMessage="${CSF_OCCTResourcePath}/XSMessage"
  99. export CSF_TObjMessage="${CSF_OCCTResourcePath}/TObj"
  100. export CSF_StandardDefaults="${CSF_OCCTResourcePath}/StdResource"
  101. export CSF_PluginDefaults="${CSF_OCCTResourcePath}/StdResource"
  102. export CSF_XCAFDefaults="${CSF_OCCTResourcePath}/StdResource"
  103. export CSF_TObjDefaults="${CSF_OCCTResourcePath}/StdResource"
  104. export CSF_StandardLiteDefaults="${CSF_OCCTResourcePath}/StdResource"
  105. export CSF_IGESDefaults="${CSF_OCCTResourcePath}/XSTEPResource"
  106. export CSF_STEPDefaults="${CSF_OCCTResourcePath}/XSTEPResource"
  107. export CSF_XmlOcafResource="${CSF_OCCTResourcePath}/XmlOcafResource"
  108. export CSF_MIGRATION_TYPES="${CSF_OCCTResourcePath}/StdResource/MigrationSheet.txt"
  109. # ----- Draw Harness special stuff -----
  110. if [ -e "${CSF_OCCTResourcePath}/DrawResources" ]; then
  111. export DRAWHOME="${CSF_OCCTResourcePath}/DrawResources"
  112. export CSF_DrawPluginDefaults="${CSF_OCCTResourcePath}/DrawResources"
  113. if [ -e "${CSF_OCCTResourcePath}/DrawResources/DrawDefault" ]; then
  114. export DRAWDEFAULT="${CSF_OCCTResourcePath}/DrawResources/DrawDefault"
  115. fi
  116. fi