2 # Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
4 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
5 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License.
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 # File : runLightSalome.sh
24 # Author : Vadim SANDLER, Open CASCADE S.A.S, vadim.sandler@opencascade.com
26 # set default value for the LightAppConfig variable, which
27 # is necessary for loading of .ini or .xml resources file
30 if [ -z "$LightAppConfig" ] ; then
31 export LightAppConfig=${GUI_ROOT_DIR}/share/salome/resources/gui
33 export LightAppConfig=${LightAppConfig}:${GUI_ROOT_DIR}/share/salome/resources/gui
35 if [ -z "$LightAppResources" ] ; then
36 export LightAppResources=${GUI_ROOT_DIR}/share/salome/resources/gui
38 export LightAppResources=${LightAppResources}:${GUI_ROOT_DIR}/share/salome/resources/gui
42 # process --modules=... command line option (get list of modules)
48 if [ "$arg" != "X" ] ; then
50 --modules=* ) modules=`echo $arg | awk -F= '{ print $2 }' | sed -e "s%,% %g"` ;;
56 modules="KERNEL GUI $modules"
59 # exclude modules duplication
64 for mod in $modules ; do
65 echo $mods | grep -E "\<$mod\>" >/dev/null 2>&1
66 if [ "$?" == "1" ] ; then
72 # set additional environment
75 python_version=`python -c "import sys; print sys.version[:3]" 2>/dev/null`
82 if [ "$arg" != "X" ] ; then
83 root_dir=`printenv ${mod}_ROOT_DIR`
84 if [ "$root_dir" != "" ] ; then
85 mod_lower=`echo $mod | tr "A-Z" "a-z"`
86 if [ -d ${root_dir}/bin/salome ] ; then
87 if [ "${MY_PATH}" == "" ] ; then
88 MY_PATH=${root_dir}/bin/salome
90 MY_PATH=${MY_PATH}:${root_dir}/bin/salome
93 if [ -d ${root_dir}/lib/salome ] ; then
94 if [ "${MY_LD_LIBRARY_PATH}" == "" ] ; then
95 MY_LD_LIBRARY_PATH=${root_dir}/lib/salome
97 MY_LD_LIBRARY_PATH=${MY_LD_LIBRARY_PATH}:${root_dir}/lib/salome
100 if [ "${python_version}" != "" ] ; then
101 if [ -d ${root_dir}/bin/salome ] ; then
102 if [ "${MY_PYTHONPATH}" == "" ] ; then
103 MY_PYTHONPATH=${root_dir}/bin/salome
105 MY_PYTHONPATH=${MY_PYTHONPATH}:${root_dir}/bin/salome
108 if [ -d ${root_dir}/lib/salome ] ; then
109 if [ "${MY_PYTHONPATH}" == "" ] ; then
110 MY_PYTHONPATH=${root_dir}/lib/salome
112 MY_PYTHONPATH=${MY_PYTHONPATH}:${root_dir}/lib/salome
115 if [ -d ${root_dir}/lib/python${python_version}/site-packages/salome ] ; then
116 if [ "${MY_PYTHONPATH}" == "" ] ; then
117 MY_PYTHONPATH=${root_dir}/lib/python${python_version}/site-packages/salome
119 MY_PYTHONPATH=${MY_PYTHONPATH}:${root_dir}/lib/python${python_version}/site-packages/salome
123 if [ "$mod" != "KERNEL" ] && [ "$mod" != "GUI" ] ; then
124 export LightAppConfig=${LightAppConfig}:${root_dir}/share/salome/resources/${mod_lower}
126 if [ "${SALOMEPATH}" == "" ] ; then
127 export SALOMEPATH=${root_dir}
129 export SALOMEPATH=${SALOMEPATH}:${root_dir}
135 if [ "${MY_PATH}" != "" ] ; then
136 export PATH=${MY_PATH}:${PATH}
138 if [ "${MY_LD_LIBRARY_PATH}" != "" ] ; then
139 export LD_LIBRARY_PATH=${MY_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}
141 if [ "${PYTHONPATH}" != "" ] ; then
142 export PYTHONPATH=${MY_PYTHONPATH}:${PYTHONPATH}
149 SUITApp LightApp $* &