2 # Copyright (C) 2007-2015 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, or (at your option) any later version.
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.csh
24 # Author : Vadim SANDLER, Open CASCADE S.A.S, vadim.sandler@opencascade.com
28 # set default value for the LightAppConfig variable, which
29 # is necessary for loading of .ini or .xml resources file
32 if ( ! ($?LightAppConfig) ) then
33 setenv LightAppConfig ${GUI_ROOT_DIR}/share/salome/resources/gui
35 setenv LightAppConfig ${LightAppConfig}:${GUI_ROOT_DIR}/share/salome/resources/gui
37 if ( ! ($?LightAppResources) ) then
38 setenv LightAppResources ${GUI_ROOT_DIR}/share/salome/resources/gui
40 setenv LightAppResources ${LightAppResources}:${GUI_ROOT_DIR}/share/salome/resources/gui
47 if (! ($?PATH) ) setenv PATH
48 if (! ($?LD_LIBRARY_PATH) ) setenv LD_LIBRARY_PATH
49 if (! ($?PYTHONPATH) ) setenv PYTHONPATH
50 if (! ($?SALOMEPATH) ) setenv SALOMEPATH
53 # process --modules=... command line option (get list of modules)
59 if ( "$arg" != "X" ) then
62 set modules=`echo $arg | awk -F= '{ print $2 }' | sed -e "s%,% %g"`
70 set modules="KERNEL GUI $modules"
73 # exclude modules duplication
78 foreach mod ( $modules )
79 echo $mods | grep -E "\<$mod\>" >/dev/null
80 if ( "$?" == "1" ) then
86 # set additional environment
89 set python_version=`python -c "import sys; print sys.version[:3]"`
92 set MY_LD_LIBRARY_PATH=""
96 if ( "$arg" != "X" ) then
97 set root_dir=`printenv ${mod}_ROOT_DIR`
98 if ( "$root_dir" != "" ) then
99 set mod_lower=`echo $mod | tr "A-Z" "a-z"`
100 if ( -d ${root_dir}/bin/salome ) then
101 if ( "${MY_PATH}" == "" ) then
102 set MY_PATH=${root_dir}/bin/salome
104 set MY_PATH=${MY_PATH}:${root_dir}/bin/salome
107 if ( -d ${root_dir}/lib/salome ) then
108 if ( "${MY_LD_LIBRARY_PATH}" == "" ) then
109 set MY_LD_LIBRARY_PATH=${root_dir}/lib/salome
111 set MY_LD_LIBRARY_PATH=${MY_LD_LIBRARY_PATH}:${root_dir}/lib/salome
114 if ( "${python_version}" != "" ) then
115 if ( -d ${root_dir}/bin/salome ) then
116 if ( "${MY_PYTHONPATH}" == "" ) then
117 set MY_PYTHONPATH=${root_dir}/bin/salome
119 set MY_PYTHONPATH=${MY_PYTHONPATH}:${root_dir}/bin/salome
122 if ( -d ${root_dir}/lib/salome ) then
123 if ( "${MY_PYTHONPATH}" == "" ) then
124 set MY_PYTHONPATH=${root_dir}/lib/salome
126 set MY_PYTHONPATH=${MY_PYTHONPATH}:${root_dir}/lib/salome
129 if ( -d ${root_dir}/lib/python${python_version}/site-packages/salome ) then
130 if ( "${MY_PYTHONPATH}" == "" ) then
131 set MY_PYTHONPATH=${root_dir}/lib/python${python_version}/site-packages/salome
133 set MY_PYTHONPATH=${MY_PYTHONPATH}:${root_dir}/lib/python${python_version}/site-packages/salome
137 if ( "$mod" != "KERNEL" && "$mod" != "GUI" ) then
138 setenv LightAppConfig ${LightAppConfig}:${root_dir}/share/salome/resources/${mod_lower}
140 if ( "${SALOMEPATH}" == "" ) then
141 setenv SALOMEPATH ${root_dir}
143 setenv SALOMEPATH ${SALOMEPATH}:${root_dir}
149 if ( "${MY_PATH}" != "" ) setenv PATH ${MY_PATH}:${PATH}
150 if ( "${MY_LD_LIBRARY_PATH}" != "" ) setenv LD_LIBRARY_PATH ${MY_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}
151 if ( "${PYTHONPATH}" != "" ) setenv PYTHONPATH ${MY_PYTHONPATH}:${PYTHONPATH}
157 SUITApp LightApp $* &