3 # Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE
5 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
6 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
8 # This library is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU Lesser General Public
10 # License as published by the Free Software Foundation; either
11 # version 2.1 of the License, or (at your option) any later version.
13 # This library is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # Lesser General Public License for more details.
18 # You should have received a copy of the GNU Lesser General Public
19 # License along with this library; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
25 # File : runLightSalome.csh
26 # Author : Vadim SANDLER, Open CASCADE S.A.S, vadim.sandler@opencascade.com
29 # set default value for the LightAppConfig variable, which
30 # is necessary for loading of .ini or .xml resources file
33 if ( ! ($?LightAppConfig) ) then
34 setenv LightAppConfig ${GUI_ROOT_DIR}/share/salome/resources/gui
36 setenv LightAppConfig ${LightAppConfig}:${GUI_ROOT_DIR}/share/salome/resources/gui
38 if ( ! ($?LightAppResources) ) then
39 setenv LightAppResources ${GUI_ROOT_DIR}/share/salome/resources/gui
41 setenv LightAppResources ${LightAppResources}:${GUI_ROOT_DIR}/share/salome/resources/gui
48 if (! ($?PATH) ) setenv PATH
49 if (! ($?LD_LIBRARY_PATH) ) setenv LD_LIBRARY_PATH
50 if (! ($?PYTHONPATH) ) setenv PYTHONPATH
51 if (! ($?SALOMEPATH) ) setenv SALOMEPATH
54 # process --modules=... command line option (get list of modules)
60 if ( "$arg" != "X" ) then
63 set modules=`echo $arg | awk -F= '{ print $2 }' | sed -e "s%,% %g"`
71 set modules="KERNEL GUI $modules"
74 # exclude modules duplication
79 foreach mod ( $modules )
80 echo $mods | grep -E "\<$mod\>" >/dev/null
81 if ( "$?" == "1" ) then
87 # set additional environment
90 set python_version=`python -c "import sys; print(sys.version[:3])"`
93 set MY_LD_LIBRARY_PATH=""
97 if ( "$arg" != "X" ) then
98 set root_dir=`printenv ${mod}_ROOT_DIR`
99 if ( "$root_dir" != "" ) then
100 set mod_lower=`echo $mod | tr "A-Z" "a-z"`
101 if ( -d ${root_dir}/bin/salome ) then
102 if ( "${MY_PATH}" == "" ) then
103 set MY_PATH=${root_dir}/bin/salome
105 set MY_PATH=${MY_PATH}:${root_dir}/bin/salome
108 if ( -d ${root_dir}/lib/salome ) then
109 if ( "${MY_LD_LIBRARY_PATH}" == "" ) then
110 set MY_LD_LIBRARY_PATH=${root_dir}/lib/salome
112 set MY_LD_LIBRARY_PATH=${MY_LD_LIBRARY_PATH}:${root_dir}/lib/salome
115 if ( "${python_version}" != "" ) then
116 if ( -d ${root_dir}/bin/salome ) then
117 if ( "${MY_PYTHONPATH}" == "" ) then
118 set MY_PYTHONPATH=${root_dir}/bin/salome
120 set MY_PYTHONPATH=${MY_PYTHONPATH}:${root_dir}/bin/salome
123 if ( -d ${root_dir}/lib/salome ) then
124 if ( "${MY_PYTHONPATH}" == "" ) then
125 set MY_PYTHONPATH=${root_dir}/lib/salome
127 set MY_PYTHONPATH=${MY_PYTHONPATH}:${root_dir}/lib/salome
130 if ( -d ${root_dir}/lib/python${python_version}/site-packages/salome ) then
131 if ( "${MY_PYTHONPATH}" == "" ) then
132 set MY_PYTHONPATH=${root_dir}/lib/python${python_version}/site-packages/salome
134 set MY_PYTHONPATH=${MY_PYTHONPATH}:${root_dir}/lib/python${python_version}/site-packages/salome
138 if ( "$mod" != "KERNEL" && "$mod" != "GUI" ) then
139 setenv LightAppConfig ${LightAppConfig}:${root_dir}/share/salome/resources/${mod_lower}
141 if ( "${SALOMEPATH}" == "" ) then
142 setenv SALOMEPATH ${root_dir}
144 setenv SALOMEPATH ${SALOMEPATH}:${root_dir}
150 if ( "${MY_PATH}" != "" ) setenv PATH ${MY_PATH}:${PATH}
151 if ( "${MY_LD_LIBRARY_PATH}" != "" ) setenv LD_LIBRARY_PATH ${MY_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}
152 if ( "${PYTHONPATH}" != "" ) setenv PYTHONPATH ${MY_PYTHONPATH}:${PYTHONPATH}
158 suitexe LightApp $* &