if ( ! $?LightAppConfig ) setenv LightAppConfig ${GUI_ROOT_DIR}/share/salome/resources/gui
if ( ! $?LightAppResources ) setenv LightAppResources ${GUI_ROOT_DIR}/share/salome/resources/gui
+###
+# default settings
+###
+
+if (! ($?PATH) ) setenv PATH
+if (! ($?LD_LIBRARY_PATH) ) setenv LD_LIBRARY_PATH
+if (! ($?PYTHONPATH) ) setenv PYTHONPATH
+if (! ($?SALOMEPATH) ) setenv SALOMEPATH
+
###
# process --modules=... command line option (get list of modules)
###
# set additional environment
###
+set python_version=`python -c "import sys; print sys.version[:3]"`
+
+set MY_PATH=""
+set MY_LD_LIBRARY_PATH=""
+set MY_PYTHONPATH=""
+
foreach mod ( $mods )
if ( "$arg" != "X" ) then
set root_dir=`printenv ${mod}_ROOT_DIR`
if ( "$root_dir" != "" ) then
set mod_lower=`echo $mod | tr "A-Z" "a-z"`
- setenv PATH ${root_dir}/bin/salome:${PATH}
- setenv LD_LIBRARY_PATH ${root_dir}/lib/salome:${LD_LIBRARY_PATH}
+ if ( -d ${root_dir}/bin/salome ) then
+ if ( "${MY_PATH}" == "" ) then
+ set MY_PATH=${root_dir}/bin/salome
+ else
+ set MY_PATH=${MY_PATH}:${root_dir}/bin/salome
+ endif
+ endif
+ if ( -d ${root_dir}/lib/salome ) then
+ if ( "${MY_LD_LIBRARY_PATH}" == "" ) then
+ set MY_LD_LIBRARY_PATH=${root_dir}/lib/salome
+ else
+ set MY_LD_LIBRARY_PATH=${MY_LD_LIBRARY_PATH}:${root_dir}/lib/salome
+ endif
+ endif
+ if ( "${python_version}" != "" ) then
+ if ( -d ${root_dir}/bin/salome ) then
+ if ( "${MY_PYTHONPATH}" == "" ) then
+ set MY_PYTHONPATH=${root_dir}/bin/salome
+ else
+ set MY_PYTHONPATH=${MY_PYTHONPATH}:${root_dir}/bin/salome
+ endif
+ endif
+ if ( -d ${root_dir}/lib/salome ) then
+ if ( "${MY_PYTHONPATH}" == "" ) then
+ set MY_PYTHONPATH=${root_dir}/lib/salome
+ else
+ set MY_PYTHONPATH=${MY_PYTHONPATH}:${root_dir}/lib/salome
+ endif
+ endif
+ if ( -d ${root_dir}/lib/python${python_version}/site-packages/salome ) then
+ if ( "${MY_PYTHONPATH}" == "" ) then
+ set MY_PYTHONPATH=${root_dir}/lib/python${python_version}/site-packages/salome
+ else
+ set MY_PYTHONPATH=${MY_PYTHONPATH}:${root_dir}/lib/python${python_version}/site-packages/salome
+ endif
+ endif
+ endif
if ( "$mod" != "KERNEL" && "$mod" != "GUI" ) then
setenv LightAppConfig ${LightAppConfig}:${root_dir}/share/salome/resources/${mod_lower}
endif
+ if ( "${SALOMEPATH}" == "" ) then
+ setenv SALOMEPATH ${root_dir}
+ else
+ setenv SALOMEPATH ${SALOMEPATH}:${root_dir}
+ endif
endif
endif
end
+if ( "${MY_PATH}" != "" ) setenv PATH ${MY_PATH}:${PATH}
+if ( "${MY_LD_LIBRARY_PATH}" != "" ) setenv LD_LIBRARY_PATH ${MY_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}
+if ( "${PYTHONPATH}" != "" ) setenv PYTHONPATH ${MY_PYTHONPATH}:${PYTHONPATH}
+
###
# start application
###
# set additional environment
###
+python_version=`python -c "import sys; print sys.version[:3]" 2>/dev/null`
+
+MY_PATH=""
+MY_LD_LIBRARY_PATH=""
+MY_PYTHONPATH=""
+
for mod in $mods ; do
if [ "$arg" != "X" ] ; then
root_dir=`printenv ${mod}_ROOT_DIR`
if [ "$root_dir" != "" ] ; then
mod_lower=`echo $mod | tr "A-Z" "a-z"`
- export PATH=${root_dir}/bin/salome:${PATH}
- export LD_LIBRARY_PATH=${root_dir}/lib/salome:${LD_LIBRARY_PATH}
+ if [ -d ${root_dir}/bin/salome ] ; then
+ if [ "${MY_PATH}" == "" ] ; then
+ MY_PATH=${root_dir}/bin/salome
+ else
+ MY_PATH=${MY_PATH}:${root_dir}/bin/salome
+ fi
+ fi
+ if [ -d ${root_dir}/lib/salome ] ; then
+ if [ "${MY_LD_LIBRARY_PATH}" == "" ] ; then
+ MY_LD_LIBRARY_PATH=${root_dir}/lib/salome
+ else
+ MY_LD_LIBRARY_PATH=${MY_LD_LIBRARY_PATH}:${root_dir}/lib/salome
+ fi
+ fi
+ if [ "${python_version}" != "" ] ; then
+ if [ -d ${root_dir}/bin/salome ] ; then
+ if [ "${MY_PYTHONPATH}" == "" ] ; then
+ MY_PYTHONPATH=${root_dir}/bin/salome
+ else
+ MY_PYTHONPATH=${MY_PYTHONPATH}:${root_dir}/bin/salome
+ fi
+ fi
+ if [ -d ${root_dir}/lib/salome ] ; then
+ if [ "${MY_PYTHONPATH}" == "" ] ; then
+ MY_PYTHONPATH=${root_dir}/lib/salome
+ else
+ MY_PYTHONPATH=${MY_PYTHONPATH}:${root_dir}/lib/salome
+ fi
+ fi
+ if [ -d ${root_dir}/lib/python${python_version}/site-packages/salome ] ; then
+ if [ "${MY_PYTHONPATH}" == "" ] ; then
+ MY_PYTHONPATH=${root_dir}/lib/python${python_version}/site-packages/salome
+ else
+ MY_PYTHONPATH=${MY_PYTHONPATH}:${root_dir}/lib/python${python_version}/site-packages/salome
+ fi
+ fi
+ fi
if [ "$mod" != "KERNEL" ] && [ "$mod" != "GUI" ] ; then
export LightAppConfig=${LightAppConfig}:${root_dir}/share/salome/resources/${mod_lower}
fi
+ if [ "${SALOMEPATH}" == "" ] ; then
+ export SALOMEPATH=${root_dir}
+ else
+ export SALOMEPATH=${SALOMEPATH}:${root_dir}
+ fi
fi
fi
done
+if [ "${MY_PATH}" != "" ] ; then
+ export PATH=${MY_PATH}:${PATH}
+fi
+if [ "${MY_LD_LIBRARY_PATH}" != "" ] ; then
+ export LD_LIBRARY_PATH=${MY_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}
+fi
+if [ "${PYTHONPATH}" != "" ] ; then
+ export PYTHONPATH=${MY_PYTHONPATH}:${PYTHONPATH}
+fi
+
###
# start application
###